Merge pull request #2573 from xuzhuoyi/tms320f28379d
[bsp][tms320f28379d] Improve finsh support and update README.md
This commit is contained in:
commit
41aabf3736
@ -84,29 +84,30 @@ CONFIG_RT_USING_COMPONENTS_INIT=y
|
||||
#
|
||||
# Command shell
|
||||
#
|
||||
# CONFIG_RT_USING_FINSH is not set
|
||||
CONFIG_RT_USING_FINSH=y
|
||||
CONFIG_FINSH_THREAD_NAME="tshell"
|
||||
CONFIG_FINSH_USING_HISTORY=y
|
||||
CONFIG_FINSH_HISTORY_LINES=5
|
||||
# CONFIG_FINSH_USING_SYMTAB is not set
|
||||
# CONFIG_FINSH_USING_DESCRIPTION is not set
|
||||
# CONFIG_FINSH_ECHO_DISABLE_DEFAULT is not set
|
||||
CONFIG_FINSH_THREAD_PRIORITY=6
|
||||
CONFIG_FINSH_THREAD_STACK_SIZE=4096
|
||||
CONFIG_FINSH_CMD_SIZE=80
|
||||
# CONFIG_FINSH_USING_AUTH is not set
|
||||
# CONFIG_FINSH_USING_MSH is not set
|
||||
|
||||
#
|
||||
# Device virtual file system
|
||||
#
|
||||
CONFIG_RT_USING_DFS=y
|
||||
CONFIG_DFS_USING_WORKDIR=y
|
||||
CONFIG_DFS_FILESYSTEMS_MAX=2
|
||||
CONFIG_DFS_FILESYSTEM_TYPES_MAX=2
|
||||
CONFIG_DFS_FD_MAX=16
|
||||
# CONFIG_RT_USING_DFS_MNTTABLE is not set
|
||||
# CONFIG_RT_USING_DFS_ELMFAT is not set
|
||||
CONFIG_RT_USING_DFS_DEVFS=y
|
||||
# CONFIG_RT_USING_DFS_ROMFS is not set
|
||||
# CONFIG_RT_USING_DFS_RAMFS is not set
|
||||
# CONFIG_RT_USING_DFS_UFFS is not set
|
||||
# CONFIG_RT_USING_DFS_JFFS2 is not set
|
||||
# CONFIG_RT_USING_DFS is not set
|
||||
|
||||
#
|
||||
# Device Drivers
|
||||
#
|
||||
CONFIG_RT_USING_DEVICE_IPC=y
|
||||
CONFIG_RT_PIPE_BUFSZ=512
|
||||
# CONFIG_RT_USING_SYSTEM_WORKQUEUE is not set
|
||||
CONFIG_RT_USING_SERIAL=y
|
||||
CONFIG_RT_SERIAL_USING_DMA=y
|
||||
CONFIG_RT_SERIAL_RB_BUFSZ=64
|
||||
|
@ -32,12 +32,13 @@
|
||||
<option id="com.ti.ccstudio.buildDefinitions.C2000_18.1.compilerID.LARGE_MEMORY_MODEL.2001892821" name="Option deprecated, set by default (--large_memory_model, -ml)" superClass="com.ti.ccstudio.buildDefinitions.C2000_18.1.compilerID.LARGE_MEMORY_MODEL" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.C2000_18.1.compilerID.UNIFIED_MEMORY.1224119119" name="Unified memory (--unified_memory, -mt)" superClass="com.ti.ccstudio.buildDefinitions.C2000_18.1.compilerID.UNIFIED_MEMORY" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.C2000_18.1.compilerID.SILICON_VERSION.1107602335" name="Processor version (--silicon_version, -v)" superClass="com.ti.ccstudio.buildDefinitions.C2000_18.1.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.C2000_18.1.compilerID.SILICON_VERSION.28" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.C2000_18.1.compilerID.FLOAT_SUPPORT.1330432923" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.C2000_18.1.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.C2000_18.1.compilerID.FLOAT_SUPPORT.fpu32" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.C2000_18.1.compilerID.FLOAT_SUPPORT.1330432923" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.C2000_18.1.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.C2000_18.1.compilerID.FLOAT_SUPPORT.softlib" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.C2000_18.1.compilerID.CLA_SUPPORT.1090597518" name="Specify CLA support (--cla_support)" superClass="com.ti.ccstudio.buildDefinitions.C2000_18.1.compilerID.CLA_SUPPORT" value="com.ti.ccstudio.buildDefinitions.C2000_18.1.compilerID.CLA_SUPPORT.cla1" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.C2000_18.1.compilerID.VCU_SUPPORT.1640791193" name="Specify VCU support (--vcu_support)" superClass="com.ti.ccstudio.buildDefinitions.C2000_18.1.compilerID.VCU_SUPPORT" value="com.ti.ccstudio.buildDefinitions.C2000_18.1.compilerID.VCU_SUPPORT.vcu2" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.C2000_18.1.compilerID.TMU_SUPPORT.1184307973" name="Specify TMU support (--tmu_support)" superClass="com.ti.ccstudio.buildDefinitions.C2000_18.1.compilerID.TMU_SUPPORT" value="com.ti.ccstudio.buildDefinitions.C2000_18.1.compilerID.TMU_SUPPORT.tmu0" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.C2000_18.1.compilerID.INCLUDE_PATH.559432837" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.C2000_18.1.compilerID.INCLUDE_PATH" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value="${PROJECT_ROOT}"/>
|
||||
<listOptionValue builtIn="false" value="${PROJECT_LOC}/../../components/finsh"/>
|
||||
<listOptionValue builtIn="false" value="${PROJECT_LOC}/../../components/drivers/include"/>
|
||||
<listOptionValue builtIn="false" value="${PROJECT_LOC}/libraries/headers/include"/>
|
||||
<listOptionValue builtIn="false" value="${PROJECT_LOC}/libraries/common/include"/>
|
||||
@ -83,7 +84,7 @@
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="libraries/common/source/F2837xD_SWPrioritizedPieVect.c|libraries/headers/cmd/F2837xD_Headers_nonBIOS_cpu2.cmd|libraries/headers/cmd/F2837xD_Headers_BIOS_cpu1.cmd|libraries/headers/cmd/F2837xD_Headers_BIOS_cpu2.cmd|libraries/common/source/device.c|libraries/common/source/usb.c|libraries/common/source/usb_hal.c|libraries/common/targetConfigs|libraries/common/deprecated|libraries/common/cmd" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
<entry excluding="finsh/msh.c|finsh/msh_file.c|finsh/msh_cmd.c|libraries/common/source/F2837xD_SWPrioritizedPieVect.c|libraries/headers/cmd/F2837xD_Headers_nonBIOS_cpu2.cmd|libraries/headers/cmd/F2837xD_Headers_BIOS_cpu1.cmd|libraries/headers/cmd/F2837xD_Headers_BIOS_cpu2.cmd|libraries/common/source/device.c|libraries/common/source/usb.c|libraries/common/source/usb_hal.c|libraries/common/targetConfigs|libraries/common/deprecated|libraries/common/cmd" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
|
@ -40,6 +40,11 @@
|
||||
<type>2</type>
|
||||
<locationURI>PARENT-2-PROJECT_LOC/libcpu/ti-dsp/c28x</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>finsh</name>
|
||||
<type>2</type>
|
||||
<locationURI>PARENT-2-PROJECT_LOC/components/finsh</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>DeviceDrivers/serial.c</name>
|
||||
<type>1</type>
|
||||
|
@ -11,6 +11,8 @@ encoding//Debug/c28x/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/c28x/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/drivers/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/drivers/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/finsh/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/finsh/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/libraries/common/source/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/libraries/common/source/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/libraries/headers/cmd/subdir_rules.mk=UTF-8
|
||||
|
@ -4,12 +4,16 @@
|
||||
## 1. 简介
|
||||
|
||||
TMS320F28379D BSP 基于 C2000 Delfino MCU F28379D LaunchPad 开发套件开发。
|
||||
TMS320F28379D 是一款功能强大的 32 位浮点微控制器单元 (MCU),针对高级闭环控制应用而设计,例如工业驱动器和伺服电机控制、太阳能逆变器和转换器、数字电源、电力输送以及电力线通信。包括如下硬件特性:
|
||||
TMS320F28379D 是一款功能强大的 32 位浮点微控制器单元 (MCU),针对高级闭环控制应用而设计,例如工业驱动器和伺服电机控制、太阳能逆变器和转换器、数字电源、电力输送以及电力线通信。
|
||||
|
||||
![launch-28379d](figures/launch-28379d.png)
|
||||
|
||||
包括如下硬件特性:
|
||||
|
||||
| 硬件 | 描述 |
|
||||
| -- | -- |
|
||||
|芯片型号| TMS320F28379D |
|
||||
|多核 CPU| 两个 TMS320C28x 32 位 CPU
|
||||
|多核 CPU| 两个 TMS320C28x 32 位 CPU |
|
||||
|| 两个可编程控制律加速器 (CLA) |
|
||||
|主频| 200MHz |
|
||||
|CLA 频率| 200MHz |
|
||||
@ -17,43 +21,88 @@ TMS320F28379D 是一款功能强大的 32 位浮点微控制器单元 (MCU),
|
||||
|片内SRAM| 204kB |
|
||||
|片内Flash| 1MB |
|
||||
|
||||
## 2. 编译说明
|
||||
F28379D LaunchPad 板载资源如下:
|
||||
* USB 调试和下载接口通过电气隔离的高速 XDS100v2 调试器实现,同时包含虚拟串口功能
|
||||
* TMS320F28379D CPU
|
||||
* 两个 LED
|
||||
* 设备复位按钮
|
||||
* 易于使用的引出引脚,用于调试或用作扩展板的接口
|
||||
* 双 5V 正交编码接口
|
||||
* 带集成收发器的 CAN 接口
|
||||
* 拨码开关用于启动模式选择
|
||||
* 差分放大器向差分模式 ADC 提供 16 位模式的缓冲信号
|
||||
* 可选的 SMA 连接点
|
||||
* 四个 Sigma-Delta 解调器输入到 BP 接口
|
||||
|
||||
编译使用 Code Composer Studio,在 Code Composer Studio 8.1.0 使用 TI v18.1.3.LTS 编译器已测试编译通过。
|
||||
## 2. 编译说明
|
||||
TMS320F28379D 程序的编译和下载要使用的是 TI 官方提供的 Code Composer Studio,TMS320F28379D 至少需要 CCS6.0 以上的版本才能正常编译调试。本 BSP 在 CCS7/CCS8 版本上测试通过,其他版本未做测试。可以在 TI 的官方站点上下载最新版本的 CCS。[CCS 官方下载站点][3]
|
||||
### 2.1 导入工程
|
||||
首先打开 Code Composer Studio,点击 Project -> Import CCS Projects...
|
||||
|
||||
![import](figures/import.png)
|
||||
|
||||
在打开的对话框中,点击 Select search -> directory 右边的 Browse... 选择 TMS320F28379D BSP 所在文件夹,如图所示。选择完成后点击 Finish 完成导入。
|
||||
|
||||
![import_dia](figures/import_dia.png)
|
||||
|
||||
### 2.2 编译工程
|
||||
使用 CCS 内置的 C 编译器可以进行工程的编译,本文使用的是 Code Composer Studio 8.1.0 和 TI v18.1.3.LTS 编译器的组合。
|
||||
|
||||
导入工程后,在右边的 Project Explorer 列表里可以看到刚刚导入的 rt-thread 工程,右键点击,在弹出的菜单中选择 Build Project 即可开始编译。
|
||||
|
||||
![build](figures/build.png)
|
||||
|
||||
## 3. 烧写及执行
|
||||
|
||||
连接开发板电源后,使用 CCS 中的烧写功能可直接通过板载 XDS100v2 仿真器烧写并执行。在终端工具里打开相应的串口(115200-8-1-N),复位设备后,可以看到 RT-Thread 的输出信息:
|
||||
编译完成后,可以开始下载和调试。把开发板和电脑通过 Mini-USB 线连接,使用 CCS 中的烧写功能可直接通过板载 XDS100v2 仿真器烧写并执行。
|
||||
|
||||
![debug_as](figures/debug_as.png)
|
||||
|
||||
在右边的 Project Explorer 的列表中右键点击 rt-thread 工程,在弹出的菜单中选择 Debug As -> 1 Code Composer Debug Session。
|
||||
|
||||
![launching](figures/launching.png)
|
||||
|
||||
在弹出的 Launching Debug Session 对话框中可以选择要调试的 CPU 核和 CLA 核,这里我们只选择 C28xx_CPU1,点击 OK 开始下载和调试。
|
||||
|
||||
下载完成后,CCS 将进入调试模式,可以选择继续运行、单步调试、复位等操作。
|
||||
|
||||
退出 CCS 调试模式,在终端工具里打开相应的串口(115200-8-1-N),按下板子上的复位按钮执行复位操作后,可以看到 RT-Thread 的输出信息:
|
||||
```bash
|
||||
\ | /
|
||||
- RT - Thread Operating System
|
||||
/ | \ 4.0.1 build Feb 21 2019
|
||||
2006 - 2019 Copyright by rt-thread team
|
||||
finsh >
|
||||
```
|
||||
|
||||
## 4. 驱动支持情况及计划
|
||||
## 4. 注意事项
|
||||
|
||||
* 由于当前还暂未编写 Scons 编译系统对 CCS 开发环境的支持,所以在使用 env 中的 menuconfig 进行配置后,如果添加了新的组件或软件包,需要手动在 CCS 中添加相应的 C 源文件和头文件。
|
||||
|
||||
## 5. 驱动支持情况及计划
|
||||
|
||||
| 驱动 | 支持情况 | 备注 |
|
||||
| ------ | ---- | :------: |
|
||||
| CPU Timer | 支持 | |
|
||||
| GPIO | 支持 | |
|
||||
| SCI | 支持 | SCIA |
|
||||
| ePWM | | 预计2019年3月支持 |
|
||||
| ADC | | 预计2019/Q2支持 |
|
||||
| SCI | 支持 | SCIA/B/C |
|
||||
| ePWM | | |
|
||||
| ADC | | |
|
||||
| DAC | | |
|
||||
| I2C | | |
|
||||
| SPI | | |
|
||||
| CAN | | |
|
||||
| eCAP | | |
|
||||
|
||||
## 5. 联系人信息
|
||||
## 6. 联系人信息
|
||||
|
||||
维护人:xuzhuoyi < xzy476386434@vip.qq.com >
|
||||
|
||||
## 6. 参考
|
||||
## 7. 参考
|
||||
|
||||
* [C2000 Delfino MCU F28379D LaunchPad 开发套件][1]
|
||||
* TMS320F28379D [相关技术文档][2]
|
||||
|
||||
[1]: http://www.ti.com.cn/tool/cn/launchxl-f28379d
|
||||
[2]: http://www.ti.com.cn/product/cn/tms320f28379d/technicaldocuments
|
||||
[3]: http://processors.wiki.ti.com/index.php/Download_CCS#Download_the_latest_CCS
|
||||
|
@ -12,11 +12,15 @@
|
||||
#include <board.h>
|
||||
#include <rtthread.h>
|
||||
|
||||
#ifdef RT_USING_FINSH
|
||||
#include "shell.h"
|
||||
#endif
|
||||
|
||||
void rt_init_thread_entry(void* parameter)
|
||||
{
|
||||
/* initialization RT-Thread Components */
|
||||
rt_components_init();
|
||||
|
||||
#ifdef RT_USING_FINSH
|
||||
finsh_system_init();
|
||||
#endif
|
||||
}
|
||||
|
||||
int rt_application_init()
|
||||
|
@ -13,15 +13,23 @@
|
||||
#include "drv_sci.h"
|
||||
#include "F28x_Project.h"
|
||||
|
||||
extern rt_uint32_t rt_thread_switch_interrupt_flag;
|
||||
|
||||
extern interrupt void RTOSINT_Handler();
|
||||
|
||||
void trap_rtosint()
|
||||
{
|
||||
if(rt_thread_switch_interrupt_flag)
|
||||
asm(" trap #16");
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the timer interrupt service routine.
|
||||
*
|
||||
*/
|
||||
interrupt void cpu_timer2_isr(void)
|
||||
{
|
||||
CpuTimer2Regs.TCR.all = 0x8000;
|
||||
CpuTimer2Regs.TCR.all = 0xC000;
|
||||
/* enter interrupt */
|
||||
rt_interrupt_enter();
|
||||
|
||||
@ -31,7 +39,7 @@ interrupt void cpu_timer2_isr(void)
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will initial STM32 board.
|
||||
* This function will initial TMS320F28379D board.
|
||||
*/
|
||||
void rt_hw_board_init()
|
||||
{
|
||||
@ -68,4 +76,5 @@ void rt_hw_board_init()
|
||||
#ifdef RT_USING_CONSOLE
|
||||
rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
|
||||
#endif
|
||||
rt_interrupt_leave_sethook((void (*)(void))trap_rtosint);
|
||||
}
|
||||
|
@ -147,8 +147,25 @@ static int c28x_putc(struct rt_serial_device *serial, char c)
|
||||
static int c28x_getc(struct rt_serial_device *serial)
|
||||
{
|
||||
char ch;
|
||||
SCI_read(0, &ch, 1);
|
||||
if(SCI_read(0, &ch, 1))
|
||||
return ch;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Uart common interrupt process. This need add to uart ISR.
|
||||
*
|
||||
* @param serial serial device
|
||||
*/
|
||||
static void uart_isr(struct rt_serial_device *serial) {
|
||||
struct c28x_uart *uart = (struct c28x_uart *) serial->parent.user_data;
|
||||
|
||||
RT_ASSERT(uart != RT_NULL);
|
||||
|
||||
rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND);
|
||||
SciaRegs.SCIFFRX.bit.RXFFINTCLR = 1; // Clear Interrupt flag
|
||||
PieCtrlRegs.PIEACK.all |= 0x100; // Issue PIE ack
|
||||
}
|
||||
|
||||
static const struct rt_uart_ops c28x_uart_ops =
|
||||
@ -159,6 +176,20 @@ static const struct rt_uart_ops c28x_uart_ops =
|
||||
.getc = c28x_getc,
|
||||
};
|
||||
|
||||
//
|
||||
// sciaRxFifoIsr - SCIA Receive FIFO ISR
|
||||
//
|
||||
interrupt void sciaRxFifoIsr(void)
|
||||
{
|
||||
/* enter interrupt */
|
||||
rt_interrupt_enter();
|
||||
|
||||
uart_isr(&uart_obj[0].serial);
|
||||
|
||||
/* leave interrupt */
|
||||
rt_interrupt_leave();
|
||||
}
|
||||
|
||||
int rt_hw_sci_init(void)
|
||||
{
|
||||
EALLOW;
|
||||
@ -182,8 +213,18 @@ int rt_hw_sci_init(void)
|
||||
CpuSysRegs.PCLKCR7.bit.SCI_B = 1;
|
||||
CpuSysRegs.PCLKCR7.bit.SCI_C = 1;
|
||||
|
||||
PieVectTable.SCIA_RX_INT = &sciaRxFifoIsr;
|
||||
|
||||
EDIS;
|
||||
|
||||
//
|
||||
// Enable interrupts required for this example
|
||||
//
|
||||
PieCtrlRegs.PIECTRL.bit.ENPIE = 1; // Enable the PIE block
|
||||
PieCtrlRegs.PIEIER9.bit.INTx1 = 1; // PIE Group 9, INT1
|
||||
IER |= 0x100; // Enable CPU INT
|
||||
EINT;
|
||||
|
||||
struct serial_configure config = RT_SERIAL_CONFIG_DEFAULT;
|
||||
rt_err_t result = 0;
|
||||
|
||||
@ -202,7 +243,6 @@ int rt_hw_sci_init(void)
|
||||
uart_obj[2].name = "scic";
|
||||
uart_obj[2].sci_regs = &ScicRegs;
|
||||
|
||||
|
||||
/* register UART device */
|
||||
result = rt_hw_serial_register(&uart_obj[0].serial, uart_obj[0].name,
|
||||
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX,
|
||||
|
BIN
bsp/tms320f28379d/figures/build.png
Normal file
BIN
bsp/tms320f28379d/figures/build.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 90 KiB |
BIN
bsp/tms320f28379d/figures/debug_as.png
Normal file
BIN
bsp/tms320f28379d/figures/debug_as.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 143 KiB |
BIN
bsp/tms320f28379d/figures/import.png
Normal file
BIN
bsp/tms320f28379d/figures/import.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 87 KiB |
BIN
bsp/tms320f28379d/figures/import_dia.png
Normal file
BIN
bsp/tms320f28379d/figures/import_dia.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
BIN
bsp/tms320f28379d/figures/launch-28379d.png
Normal file
BIN
bsp/tms320f28379d/figures/launch-28379d.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 466 KiB |
BIN
bsp/tms320f28379d/figures/launching.png
Normal file
BIN
bsp/tms320f28379d/figures/launching.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
@ -69,6 +69,8 @@
|
||||
typedef int int32_t;
|
||||
typedef unsigned int uint32_t;
|
||||
#else
|
||||
typedef char int8_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef int int16_t;
|
||||
typedef unsigned int uint16_t;
|
||||
typedef long int32_t;
|
||||
@ -187,9 +189,6 @@
|
||||
/* sorry, [u]int_fast64_t not implemented for C54x, C55x */
|
||||
#endif
|
||||
|
||||
typedef uint_fast8_t uint8_t;
|
||||
typedef int_fast8_t int8_t;
|
||||
|
||||
/* 7.18.1.4 Integer types capable of holding object pointers */
|
||||
#if defined(_TMS320C5XX) || defined(__TMS320C55X__) || \
|
||||
(defined(__MSP430__) && defined(__LARGE_CODE_MODEL__)) || \
|
||||
|
@ -55,15 +55,16 @@
|
||||
|
||||
/* Command shell */
|
||||
|
||||
#define RT_USING_FINSH
|
||||
#define FINSH_THREAD_NAME "tshell"
|
||||
#define FINSH_USING_HISTORY
|
||||
#define FINSH_HISTORY_LINES 5
|
||||
#define FINSH_THREAD_PRIORITY 6
|
||||
#define FINSH_THREAD_STACK_SIZE 4096
|
||||
#define FINSH_CMD_SIZE 80
|
||||
|
||||
/* Device virtual file system */
|
||||
|
||||
#define RT_USING_DFS
|
||||
#define DFS_USING_WORKDIR
|
||||
#define DFS_FILESYSTEMS_MAX 2
|
||||
#define DFS_FILESYSTEM_TYPES_MAX 2
|
||||
#define DFS_FD_MAX 16
|
||||
#define RT_USING_DFS_DEVFS
|
||||
|
||||
/* Device Drivers */
|
||||
|
||||
|
@ -94,7 +94,6 @@ _rt_hw_interrupt_enable:
|
||||
|
||||
.asmfunc
|
||||
_rt_hw_context_switch_interrupt:
|
||||
_rt_hw_context_switch:
|
||||
MOVL XAR0, #0
|
||||
MOV AR0, AL
|
||||
MOVL XAR4, *-SP[4]
|
||||
@ -114,6 +113,36 @@ _reswitch:
|
||||
MOVL XAR5, #_rt_interrupt_to_thread ; set rt_interrupt_to_thread
|
||||
MOVL *XAR5, XAR4
|
||||
|
||||
LRETR
|
||||
.endasmfunc
|
||||
|
||||
;
|
||||
; void rt_hw_context_switch(rt_uint32 from, rt_uint32 to);
|
||||
; r0 --> from
|
||||
; r4 --> to
|
||||
|
||||
|
||||
.asmfunc
|
||||
_rt_hw_context_switch:
|
||||
MOVL XAR0, #0
|
||||
MOV AR0, AL
|
||||
MOVL XAR4, *-SP[4]
|
||||
; set rt_thread_switch_interrupt_flag to 1
|
||||
MOVL XAR5, #_rt_thread_switch_interrupt_flag
|
||||
MOVL XAR6, *XAR5
|
||||
MOVL ACC, XAR6
|
||||
CMPB AL, #1
|
||||
B _reswitch2, EQ
|
||||
MOVL XAR6, #1
|
||||
MOVL *XAR5, XAR6
|
||||
|
||||
MOVL XAR5, #_rt_interrupt_from_thread ; set rt_interrupt_from_thread
|
||||
MOVL *XAR5, XAR0
|
||||
|
||||
_reswitch2:
|
||||
MOVL XAR5, #_rt_interrupt_to_thread ; set rt_interrupt_to_thread
|
||||
MOVL *XAR5, XAR4
|
||||
|
||||
TRAP #16
|
||||
LRETR
|
||||
.endasmfunc
|
||||
@ -140,8 +169,6 @@ _RTOSINT_Handler:
|
||||
CMP AR1, #0
|
||||
B switch_to_thread, EQ ; skip register save at the first time
|
||||
|
||||
;MOVZ AR1, @SP ; get from thread stack pointer
|
||||
|
||||
;#if defined (__VFP_FP__) && !defined(__SOFTFP__)
|
||||
; TST lr, #0x10 ; if(!EXC_RETURN[4])
|
||||
; VSTMDBEQ r1!, {d8 - d15} ; push FPU register s16~s31
|
||||
@ -159,7 +186,7 @@ _RTOSINT_Handler:
|
||||
;#endif
|
||||
|
||||
MOV AL, *AR0
|
||||
MOV AR1, AL
|
||||
MOV AR0, AL
|
||||
MOVZ AR1, @SP ; get from thread stack pointer
|
||||
MOV *AR0, AR1 ; update from thread stack pointer
|
||||
|
||||
@ -175,7 +202,7 @@ switch_to_thread:
|
||||
;#endif
|
||||
|
||||
MOV @SP, AR1
|
||||
INC SP
|
||||
|
||||
RT_CTX_RESTORE ; pop r4 - r11 register
|
||||
|
||||
rtosint_exit:
|
||||
|
@ -17,6 +17,9 @@ rt_uint32_t rt_thread_switch_interrupt_flag;
|
||||
/* exception hook */
|
||||
static rt_err_t (*rt_exception_hook)(void *context) = RT_NULL;
|
||||
|
||||
extern rt_uint16_t rt_hw_get_st0(void);
|
||||
extern rt_uint16_t rt_hw_get_st1(void);
|
||||
|
||||
struct exception_stack_frame
|
||||
{
|
||||
rt_uint32_t t_st0;
|
||||
@ -59,6 +62,7 @@ rt_uint8_t *rt_hw_stack_init(void *tentry,
|
||||
stk = stack_addr;
|
||||
stk = (rt_uint8_t *)RT_ALIGN((rt_uint32_t)stk, 8);
|
||||
//stk -= sizeof(struct stack_frame);
|
||||
stk += 1;
|
||||
|
||||
stack_frame = (struct stack_frame *)stk;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user