diff --git a/bsp/stm32f107/project.ewp b/bsp/stm32f107/project.ewp index fad34c2ddb229f76bba86f780688a45791ebbc78..36db9c1e306380dd6e67da6f3829881a3bd25aab 100644 --- a/bsp/stm32f107/project.ewp +++ b/bsp/stm32f107/project.ewp @@ -1,3 +1,5 @@ + + 2 @@ -10,7 +12,7 @@ General 3 - 18 + 20 1 1 + + @@ -144,7 +156,7 @@ 1 @@ -190,15 +202,15 @@ @@ -561,7 +573,7 @@ @@ -883,7 +895,7 @@ General 3 - 18 + 20 1 0 + + @@ -1059,19 +1081,19 @@ @@ -1434,7 +1456,7 @@ - Startup - - $PROJ_DIR$\.\application.c - - - $PROJ_DIR$\.\startup.c - + Filesystem - $PROJ_DIR$\.\board.c + $PROJ_DIR$\..\..\components\dfs\src\dfs.c - $PROJ_DIR$\.\stm32f10x_it.c + $PROJ_DIR$\..\..\components\dfs\filesystems\elmfat\dfs_elm.c - $PROJ_DIR$\.\usart.c + $PROJ_DIR$\..\..\components\dfs\src\dfs_file.c - $PROJ_DIR$\.\serial.c + $PROJ_DIR$\..\..\components\dfs\src\dfs_fs.c - $PROJ_DIR$\.\msd.c + $PROJ_DIR$\..\..\components\dfs\src\dfs_posix.c - $PROJ_DIR$\.\stm32_eth.c + $PROJ_DIR$\..\..\components\dfs\filesystems\elmfat\ff.c - Kernel - - $PROJ_DIR$\..\..\src\clock.c - - - $PROJ_DIR$\..\..\src\device.c - + finsh - $PROJ_DIR$\..\..\src\idle.c + $PROJ_DIR$\..\..\components\finsh\cmd.c - $PROJ_DIR$\..\..\src\ipc.c + $PROJ_DIR$\..\..\components\finsh\finsh_compiler.c - $PROJ_DIR$\..\..\src\irq.c + $PROJ_DIR$\..\..\components\finsh\finsh_error.c - $PROJ_DIR$\..\..\src\kservice.c + $PROJ_DIR$\..\..\components\finsh\finsh_heap.c - $PROJ_DIR$\..\..\src\mem.c + $PROJ_DIR$\..\..\components\finsh\finsh_init.c - $PROJ_DIR$\..\..\src\mempool.c + $PROJ_DIR$\..\..\components\finsh\finsh_node.c - $PROJ_DIR$\..\..\src\module.c + $PROJ_DIR$\..\..\components\finsh\finsh_ops.c - $PROJ_DIR$\..\..\src\object.c + $PROJ_DIR$\..\..\components\finsh\finsh_parser.c - $PROJ_DIR$\..\..\src\rtm.c + $PROJ_DIR$\..\..\components\finsh\finsh_token.c - $PROJ_DIR$\..\..\src\scheduler.c + $PROJ_DIR$\..\..\components\finsh\finsh_var.c - $PROJ_DIR$\..\..\src\slab.c + $PROJ_DIR$\..\..\components\finsh\finsh_vm.c - $PROJ_DIR$\..\..\src\thread.c + $PROJ_DIR$\..\..\components\finsh\shell.c - $PROJ_DIR$\..\..\src\timer.c + $PROJ_DIR$\..\..\components\finsh\symbol.c - STM32 + Kernel - $PROJ_DIR$\..\..\libcpu\arm\stm32\cpuport.c + $PROJ_DIR$\..\..\src\clock.c - $PROJ_DIR$\..\..\libcpu\arm\stm32\context_iar.S + $PROJ_DIR$\..\..\src\device.c - $PROJ_DIR$\..\..\libcpu\arm\common\backtrace.c + $PROJ_DIR$\..\..\src\idle.c - $PROJ_DIR$\..\..\libcpu\arm\common\div0.c + $PROJ_DIR$\..\..\src\ipc.c - $PROJ_DIR$\..\..\libcpu\arm\common\showmem.c + $PROJ_DIR$\..\..\src\irq.c - - - Filesystem - $PROJ_DIR$\..\..\components\dfs\src\dfs.c + $PROJ_DIR$\..\..\src\kservice.c - $PROJ_DIR$\..\..\components\dfs\src\dfs_fs.c + $PROJ_DIR$\..\..\src\mem.c - $PROJ_DIR$\..\..\components\dfs\src\dfs_file.c + $PROJ_DIR$\..\..\src\mempool.c - $PROJ_DIR$\..\..\components\dfs\src\dfs_posix.c + $PROJ_DIR$\..\..\src\module.c - $PROJ_DIR$\..\..\components\dfs\filesystems\elmfat\dfs_elm.c + $PROJ_DIR$\..\..\src\object.c - $PROJ_DIR$\..\..\components\dfs\filesystems\elmfat\ff.c + $PROJ_DIR$\..\..\src\rtm.c - - - finsh - $PROJ_DIR$\..\..\components\finsh\cmd.c + $PROJ_DIR$\..\..\src\scheduler.c - $PROJ_DIR$\..\..\components\finsh\finsh_compiler.c + $PROJ_DIR$\..\..\src\slab.c - $PROJ_DIR$\..\..\components\finsh\finsh_error.c + $PROJ_DIR$\..\..\src\thread.c - $PROJ_DIR$\..\..\components\finsh\finsh_heap.c + $PROJ_DIR$\..\..\src\timer.c + + + LwIP - $PROJ_DIR$\..\..\components\finsh\finsh_init.c + $PROJ_DIR$\..\..\components\net\lwip\src\api\api_lib.c - $PROJ_DIR$\..\..\components\finsh\finsh_node.c + $PROJ_DIR$\..\..\components\net\lwip\src\api\api_msg.c - $PROJ_DIR$\..\..\components\finsh\finsh_ops.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\autoip.c - $PROJ_DIR$\..\..\components\finsh\finsh_parser.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\dhcp.c - $PROJ_DIR$\..\..\components\finsh\finsh_token.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\dns.c - $PROJ_DIR$\..\..\components\finsh\finsh_var.c + $PROJ_DIR$\..\..\components\net\lwip\src\api\err.c - $PROJ_DIR$\..\..\components\finsh\finsh_vm.c + $PROJ_DIR$\..\..\components\net\lwip\src\netif\etharp.c - $PROJ_DIR$\..\..\components\finsh\shell.c + $PROJ_DIR$\..\..\components\net\lwip\src\netif\ethernetif.c - $PROJ_DIR$\..\..\components\finsh\symbol.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\icmp.c - - - LwIP - $PROJ_DIR$\..\..\components\net\lwip\src\api\api_lib.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\igmp.c - $PROJ_DIR$\..\..\components\net\lwip\src\api\api_msg.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\inet.c - $PROJ_DIR$\..\..\components\net\lwip\src\api\err.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\inet_chksum.c - $PROJ_DIR$\..\..\components\net\lwip\src\api\netbuf.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\init.c - $PROJ_DIR$\..\..\components\net\lwip\src\api\netdb.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\ip.c - $PROJ_DIR$\..\..\components\net\lwip\src\api\netifapi.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\ip_addr.c - $PROJ_DIR$\..\..\components\net\lwip\src\api\sockets.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\ip_frag.c - $PROJ_DIR$\..\..\components\net\lwip\src\api\tcpip.c + $PROJ_DIR$\..\..\components\net\lwip\src\netif\loopif.c - $PROJ_DIR$\..\..\components\net\lwip\src\arch\sys_arch.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\memp.c - $PROJ_DIR$\..\..\components\net\lwip\src\arch\sys_arch_init.c + $PROJ_DIR$\..\..\components\net\lwip\src\api\netbuf.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\dhcp.c + $PROJ_DIR$\..\..\components\net\lwip\src\api\netdb.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\dns.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\netif.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\init.c + $PROJ_DIR$\..\..\components\net\lwip\src\api\netifapi.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\memp.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\pbuf.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\netif.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\raw.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\pbuf.c + $PROJ_DIR$\..\..\components\net\lwip\src\netif\slipif.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\raw.c + $PROJ_DIR$\..\..\components\net\lwip\src\api\sockets.c $PROJ_DIR$\..\..\components\net\lwip\src\core\stats.c @@ -1961,6 +1965,12 @@ $PROJ_DIR$\..\..\components\net\lwip\src\core\sys.c + + $PROJ_DIR$\..\..\components\net\lwip\src\arch\sys_arch.c + + + $PROJ_DIR$\..\..\components\net\lwip\src\arch\sys_arch_init.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\tcp.c @@ -1970,44 +1980,56 @@ $PROJ_DIR$\..\..\components\net\lwip\src\core\tcp_out.c + + $PROJ_DIR$\..\..\components\net\lwip\src\api\tcpip.c + $PROJ_DIR$\..\..\components\net\lwip\src\core\udp.c + + + Startup - $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\autoip.c + $PROJ_DIR$\.\application.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\icmp.c + $PROJ_DIR$\.\board.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\igmp.c + $PROJ_DIR$\.\msd.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\inet.c + $PROJ_DIR$\.\serial.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\inet_chksum.c + $PROJ_DIR$\.\startup.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\ip.c + $PROJ_DIR$\.\stm32_eth.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\ip_addr.c + $PROJ_DIR$\.\stm32f10x_it.c - $PROJ_DIR$\..\..\components\net\lwip\src\core\ipv4\ip_frag.c + $PROJ_DIR$\.\usart.c + + + STM32 - $PROJ_DIR$\..\..\components\net\lwip\src\netif\etharp.c + $PROJ_DIR$\..\..\libcpu\arm\common\backtrace.c - $PROJ_DIR$\..\..\components\net\lwip\src\netif\ethernetif.c + $PROJ_DIR$\..\..\libcpu\arm\cortex-m3\context_iar.S - $PROJ_DIR$\..\..\components\net\lwip\src\netif\loopif.c + $PROJ_DIR$\..\..\libcpu\arm\cortex-m3\cpuport.c - $PROJ_DIR$\..\..\components\net\lwip\src\netif\slipif.c + $PROJ_DIR$\..\..\libcpu\arm\common\div0.c + + + $PROJ_DIR$\..\..\libcpu\arm\common\showmem.c @@ -2016,79 +2038,81 @@ $PROJ_DIR$\Libraries\CMSIS\CM3\CoreSupport\core_cm3.c - $PROJ_DIR$\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\system_stm32f10x.c + $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\misc.c - $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_crc.c + $PROJ_DIR$\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\iar\startup_stm32f10x_cl.s - $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c + $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_adc.c - $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_wwdg.c + $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_bkp.c - $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_pwr.c + $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_can.c - $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_exti.c + $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_cec.c - $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_bkp.c + $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_crc.c - $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_i2c.c + $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_dac.c - $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_adc.c + $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_dbgmcu.c - $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_dac.c + $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_dma.c - $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_rtc.c + $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_exti.c - $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_fsmc.c + $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_flash.c - $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_tim.c + $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_fsmc.c - $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_iwdg.c + $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c - $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_spi.c + $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_i2c.c - $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_flash.c + $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_iwdg.c - $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_sdio.c + $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_pwr.c - $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c + $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c - $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_usart.c + $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_rtc.c - $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_dbgmcu.c + $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_sdio.c - $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_dma.c + $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_spi.c - $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_can.c + $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_tim.c - $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_cec.c + $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_usart.c - $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\misc.c + $PROJ_DIR$\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_wwdg.c - $PROJ_DIR$\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\iar\startup_stm32f10x_cl.s + $PROJ_DIR$\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\system_stm32f10x.c + + diff --git a/bsp/stm32f107/project.uvopt b/bsp/stm32f107/project.uvopt index 6af51327f8fbbe55ed9f3ef36f7e6e5c472ad69b..091207384725f7f5d37f73d5aa74d9f7dc4161a8 100644 --- a/bsp/stm32f107/project.uvopt +++ b/bsp/stm32f107/project.uvopt @@ -222,7 +222,7 @@ Startup - 1 + 0 0 0 @@ -311,21 +311,21 @@ 1 - 8 + 7 1 0 0 0 0 - 284 - 296 + 0 + 0 0 .\stm32_eth.c stm32_eth.c 1 - 0 + 8 1 0 0 @@ -563,22 +563,22 @@ 0 3 - 24 + 26 1 0 0 0 0 - 68 - 79 + 0 + 0 0 - ..\..\libcpu\arm\stm32\cpuport.c - cpuport.c + ..\..\libcpu\arm\common\backtrace.c + backtrace.c 3 - 25 - 2 + 27 + 1 0 0 0 @@ -586,12 +586,12 @@ 0 0 0 - ..\..\libcpu\arm\stm32\context_rvds.S - context_rvds.S + ..\..\libcpu\arm\common\div0.c + div0.c 3 - 26 + 28 1 0 0 @@ -600,13 +600,13 @@ 0 0 0 - ..\..\libcpu\arm\common\backtrace.c - backtrace.c + ..\..\libcpu\arm\common\showmem.c + showmem.c 3 - 27 - 1 + 0 + 2 0 0 0 @@ -614,12 +614,12 @@ 0 0 0 - ..\..\libcpu\arm\common\div0.c - div0.c + ..\..\libcpu\arm\cortex-m3\context_rvds.S + context_rvds.S 3 - 28 + 0 1 0 0 @@ -628,8 +628,8 @@ 0 0 0 - ..\..\libcpu\arm\common\showmem.c - showmem.c + ..\..\libcpu\arm\cortex-m3\cpuport.c + cpuport.c @@ -1773,8 +1773,8 @@ 0 0 0 - 0 - 0 + 1 + 1 0 Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_cl.s startup_stm32f10x_cl.s diff --git a/bsp/stm32f107/project.uvproj b/bsp/stm32f107/project.uvproj index bf5f6cedae400a56b635bf9204cd5c6a9ec03071..e118adb15c341e341a59bd40d80e31a95fbf5b46 100644 --- a/bsp/stm32f107/project.uvproj +++ b/bsp/stm32f107/project.uvproj @@ -511,16 +511,6 @@ STM32 - - cpuport.c - 1 - ..\..\libcpu\arm\stm32\cpuport.c - - - context_rvds.S - 2 - ..\..\libcpu\arm\stm32\context_rvds.S - backtrace.c 1 @@ -536,6 +526,16 @@ 1 ..\..\libcpu\arm\common\showmem.c + + context_rvds.S + 2 + ..\..\libcpu\arm\cortex-m3\context_rvds.S + + + cpuport.c + 1 + ..\..\libcpu\arm\cortex-m3\cpuport.c + diff --git a/bsp/stm32f10x/project.Uv2 b/bsp/stm32f10x/project.Uv2 index 5f31aab2b86753957baf05cfbb2a81735b23db41..7059f3a78cb462de149b589b76c4389803bd9921 100644 --- a/bsp/stm32f10x/project.Uv2 +++ b/bsp/stm32f10x/project.Uv2 @@ -32,8 +32,8 @@ File 2,1,<..\..\src\scheduler.c> File 2,1,<..\..\src\slab.c> File 2,1,<..\..\src\thread.c> File 2,1,<..\..\src\timer.c> -File 3,1,<..\..\libcpu\arm\stm32\cpuport.c> -File 3,2,<..\..\libcpu\arm\stm32\context_rvds.S> +File 3,1,<..\..\libcpu\arm\cortex-m3\cpuport.c> +File 3,2,<..\..\libcpu\arm\cortex-m3\context_rvds.S> File 3,1,<..\..\libcpu\arm\common\backtrace.c> File 3,1,<..\..\libcpu\arm\common\div0.c> File 3,1,<..\..\libcpu\arm\common\showmem.c> diff --git a/bsp/stm32f10x/project.ewd b/bsp/stm32f10x/project.ewd index 68ee0381900a611dd78558a299848914a3fabd42..cefeb892c13d9debd17830649ff1ced7059668de 100644 --- a/bsp/stm32f10x/project.ewd +++ b/bsp/stm32f10x/project.ewd @@ -12,7 +12,7 @@ C-SPY 2 - 21 + 22 1 1 + + + + + + @@ -258,7 +282,7 @@ IARROM_ID 2 - 0 + 1 1 1 - @@ -534,6 +594,70 @@ + + PEMICRO_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + + + + RDI_ID 2 @@ -655,13 +779,25 @@ 0 - $TOOLKIT_DIR$\plugins\rtos\OSE\OseEpsilonPlugin.ewplugin + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin 0 $TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin 0 + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB6_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin 0 @@ -682,10 +818,6 @@ $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin 0 - - $EW_DIR$\common\plugins\Profiling\Profiling.ENU.ewplugin - 1 - $EW_DIR$\common\plugins\Stack\Stack.ENU.ewplugin 1 @@ -706,7 +838,7 @@ C-SPY 2 - 21 + 22 1 0 + + + + + + @@ -952,7 +1108,7 @@ IARROM_ID 2 - 0 + 1 1 0 - @@ -1228,6 +1420,70 @@ + + PEMICRO_ID + 2 + + 0 + 1 + 0 + + + + + + + + + + + + + + + RDI_ID 2 @@ -1349,13 +1605,25 @@ 0 - $TOOLKIT_DIR$\plugins\rtos\OSE\OseEpsilonPlugin.ewplugin + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin 0 $TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin 0 + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB6_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin 0 @@ -1376,10 +1644,6 @@ $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin 0 - - $EW_DIR$\common\plugins\Profiling\Profiling.ENU.ewplugin - 1 - $EW_DIR$\common\plugins\Stack\Stack.ENU.ewplugin 1 diff --git a/bsp/stm32f10x/project.ewp b/bsp/stm32f10x/project.ewp index 28b8a089c098060e70948bd6d076aca83ad5824d..b7902c81953bc047e288c5f98a3628b16f82fffd 100644 --- a/bsp/stm32f10x/project.ewp +++ b/bsp/stm32f10x/project.ewp @@ -12,7 +12,7 @@ General 3 - 17 + 20 1 1 - + + + ICCARM 2 - 21 + 26 1 1 - - + + + + + + + + + + + + AARM 2 - 7 + 8 1 1 - @@ -812,7 +890,7 @@ General 3 - 17 + 20 1 0 - + + + ICCARM 2 - 21 + 26 1 0 - - + + + + + + + + + + + + AARM 2 - 7 + 8 1 0 - @@ -1986,10 +2142,10 @@ STM32 - $PROJ_DIR$\..\..\libcpu\arm\stm32\context_iar.S + $PROJ_DIR$\..\..\libcpu\arm\cortex-m3\context_iar.S - $PROJ_DIR$\..\..\libcpu\arm\stm32\cpuport.c + $PROJ_DIR$\..\..\libcpu\arm\cortex-m3\cpuport.c diff --git a/bsp/stm32f10x/rtconfig.py b/bsp/stm32f10x/rtconfig.py index 222dc8ca83e6f4619e077b09c4bf424cd9707ffe..ace5e29ac9f35ff9b987d29b3043ce3dc574e91f 100644 --- a/bsp/stm32f10x/rtconfig.py +++ b/bsp/stm32f10x/rtconfig.py @@ -1,6 +1,6 @@ # toolchains options ARCH='arm' -CPU='stm32' +CPU='cortex-m3' CROSS_TOOL='keil' # lcd panel options diff --git a/bsp/stm32f20x/project.ewp b/bsp/stm32f20x/project.ewp index 42c6f64c9f1995ea4aaf261e97f4c15828d2e587..644ff5298e8062373658d122aa4b606c3efba247 100644 --- a/bsp/stm32f20x/project.ewp +++ b/bsp/stm32f20x/project.ewp @@ -1872,10 +1872,10 @@ $PROJ_DIR$\..\..\libcpu\arm\common\backtrace.c - $PROJ_DIR$\..\..\libcpu\arm\stm32\context_iar.S + $PROJ_DIR$\..\..\libcpu\arm\cortex-m3\context_iar.S - $PROJ_DIR$\..\..\libcpu\arm\stm32\cpuport.c + $PROJ_DIR$\..\..\libcpu\arm\cortex-m3\cpuport.c $PROJ_DIR$\..\..\libcpu\arm\common\div0.c diff --git a/bsp/stm32f20x/project.uvopt b/bsp/stm32f20x/project.uvopt index ad581f1648f0d09cabb22b53d95e772afcaef51a..65e7c6ba651f5ddfeb899848529dbdeffb825c62 100644 --- a/bsp/stm32f20x/project.uvopt +++ b/bsp/stm32f20x/project.uvopt @@ -511,7 +511,7 @@ 0 3 - 24 + 26 1 0 0 @@ -520,13 +520,13 @@ 0 0 0 - ..\..\libcpu\arm\stm32\cpuport.c - cpuport.c + ..\..\libcpu\arm\common\backtrace.c + backtrace.c 3 - 25 - 2 + 27 + 1 0 0 0 @@ -534,12 +534,12 @@ 0 0 0 - ..\..\libcpu\arm\stm32\context_rvds.S - context_rvds.S + ..\..\libcpu\arm\common\div0.c + div0.c 3 - 26 + 28 1 0 0 @@ -548,13 +548,13 @@ 0 0 0 - ..\..\libcpu\arm\common\backtrace.c - backtrace.c + ..\..\libcpu\arm\common\showmem.c + showmem.c 3 - 27 - 1 + 0 + 2 0 0 0 @@ -562,12 +562,12 @@ 0 0 0 - ..\..\libcpu\arm\common\div0.c - div0.c + ..\..\libcpu\arm\cortex-m3\context_rvds.S + context_rvds.S 3 - 28 + 0 1 0 0 @@ -576,8 +576,8 @@ 0 0 0 - ..\..\libcpu\arm\common\showmem.c - showmem.c + ..\..\libcpu\arm\cortex-m3\cpuport.c + cpuport.c @@ -1259,8 +1259,8 @@ 0 0 - 0 - 0 + 6 + 76 1 0 0 @@ -1273,8 +1273,8 @@ dfs.c - 0 - 0 + 6 + 77 1 0 0 @@ -1287,8 +1287,8 @@ dfs_file.c - 0 - 0 + 6 + 78 1 0 0 @@ -1301,8 +1301,8 @@ dfs_fs.c - 0 - 0 + 6 + 79 1 0 0 @@ -1316,45 +1316,4 @@ - - 1 - 0 - - 100 - 3 - - - .\application.c - 50 - 25 - 26 - - - .\board.c - 0 - 65 - 65 - - - .\stm32f20x_it.c - 0 - 79 - 80 - - - .\sdio_sd.c - 27 - 1 - 15 - - - .\startup.c - 0 - 102 - 108 - - - - - diff --git a/bsp/stm32f20x/project.uvproj b/bsp/stm32f20x/project.uvproj index c8b67237d1ae8f7089779dd7cd10d245484bcffa..47da2e4c60ea00c2e253242eaf07650eda1d72d3 100644 --- a/bsp/stm32f20x/project.uvproj +++ b/bsp/stm32f20x/project.uvproj @@ -511,16 +511,6 @@ STM32 - - cpuport.c - 1 - ..\..\libcpu\arm\stm32\cpuport.c - - - context_rvds.S - 2 - ..\..\libcpu\arm\stm32\context_rvds.S - backtrace.c 1 @@ -536,6 +526,16 @@ 1 ..\..\libcpu\arm\common\showmem.c + + context_rvds.S + 2 + ..\..\libcpu\arm\cortex-m3\context_rvds.S + + + cpuport.c + 1 + ..\..\libcpu\arm\cortex-m3\cpuport.c + diff --git a/bsp/stm32f20x/rtconfig.py b/bsp/stm32f20x/rtconfig.py index 3e8a6779ebda2c6799b1516db23fbca8ca3af9d4..2cbfe93d432d8c826c331a3731cdc773ebc97573 100644 --- a/bsp/stm32f20x/rtconfig.py +++ b/bsp/stm32f20x/rtconfig.py @@ -1,6 +1,6 @@ # toolchains options ARCH='arm' -CPU='stm32' +CPU='cortex-m3' CROSS_TOOL='keil' if CROSS_TOOL == 'gcc': diff --git a/libcpu/arm/cortex-m3/context_iar.S b/libcpu/arm/cortex-m3/context_iar.S index c7d5c61d704a7fa3e51b042951b90327dbb30085..8152e5f40d0e356e452a53777b5fb5d74a95ddbb 100644 --- a/libcpu/arm/cortex-m3/context_iar.S +++ b/libcpu/arm/cortex-m3/context_iar.S @@ -14,7 +14,7 @@ ; */ ;/** -; * @addtogroup STM32 +; * @addtogroup cortex-m3 ; */ ;/*@{*/ diff --git a/libcpu/arm/stm32/context_gcc.S b/libcpu/arm/stm32/context_gcc.S deleted file mode 100644 index 189e7e6246f3b7c4ede117f1e1a6de8e95c6f25a..0000000000000000000000000000000000000000 --- a/libcpu/arm/stm32/context_gcc.S +++ /dev/null @@ -1,178 +0,0 @@ -/* - * File : context_gcc.S - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2009, RT-Thread Development Team - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE - * - * Change Logs: - * Date Author Notes - * 2009-10-11 Bernard first version - */ - -/** - * @addtogroup STM32 - */ -/*@{*/ - -.cpu cortex-m3 -.fpu softvfp -.syntax unified -.thumb -.text - -.equ NVIC_INT_CTRL, 0xE000ED04 /* interrupt control state register */ -.equ NVIC_SYSPRI2, 0xE000ED20 /* system priority register (2) */ -.equ NVIC_PENDSV_PRI, 0x00FF0000 /* PendSV priority value (lowest) */ -.equ NVIC_PENDSVSET, 0x10000000 /* value to trigger PendSV exception */ - -/* - * rt_base_t rt_hw_interrupt_disable(); - */ -.global rt_hw_interrupt_disable -.type rt_hw_interrupt_disable, %function -rt_hw_interrupt_disable: - MRS r0, PRIMASK - CPSID I - BX LR - -/* - * void rt_hw_interrupt_enable(rt_base_t level); - */ -.global rt_hw_interrupt_enable -.type rt_hw_interrupt_enable, %function -rt_hw_interrupt_enable: - MSR PRIMASK, r0 - BX LR - -/* - * void rt_hw_context_switch(rt_uint32 from, rt_uint32 to); - * r0 --> from - * r1 --> to - */ -.global rt_hw_context_switch_interrupt -.type rt_hw_context_switch_interrupt, %function -.global rt_hw_context_switch -.type rt_hw_context_switch, %function - -rt_hw_context_switch_interrupt: -rt_hw_context_switch: - /* set rt_thread_switch_interrupt_flag to 1 */ - LDR r2, =rt_thread_switch_interrupt_flag - LDR r3, [r2] - CMP r3, #1 - BEQ _reswitch - MOV r3, #1 - STR r3, [r2] - - LDR r2, =rt_interrupt_from_thread /* set rt_interrupt_from_thread */ - STR r0, [r2] - -_reswitch: - LDR r2, =rt_interrupt_to_thread /* set rt_interrupt_to_thread */ - STR r1, [r2] - - LDR r0, =NVIC_INT_CTRL /* trigger the PendSV exception (causes context switch) */ - LDR r1, =NVIC_PENDSVSET - STR r1, [r0] - BX LR - -/* r0 --> swith from thread stack - * r1 --> swith to thread stack - * psr, pc, lr, r12, r3, r2, r1, r0 are pushed into [from] stack - */ -.global PendSV_Handler -.type PendSV_Handler, %function -PendSV_Handler: - /* disable interrupt to protect context switch */ - MRS r2, PRIMASK - CPSID I - - /* get rt_thread_switch_interrupt_flag */ - LDR r0, =rt_thread_switch_interrupt_flag - LDR r1, [r0] - CBZ r1, pendsv_exit /* pendsv already handled */ - - /* clear rt_thread_switch_interrupt_flag to 0 */ - MOV r1, #0x00 - STR r1, [r0] - - LDR r0, =rt_interrupt_from_thread - LDR r1, [r0] - CBZ r1, swtich_to_thread /* skip register save at the first time */ - - MRS r1, psp /* get from thread stack pointer */ - STMFD r1!, {r4 - r11} /* push r4 - r11 register */ - LDR r0, [r0] - STR r1, [r0] /* update from thread stack pointer */ - -swtich_to_thread: - LDR r1, =rt_interrupt_to_thread - LDR r1, [r1] - LDR r1, [r1] /* load thread stack pointer */ - - LDMFD r1!, {r4 - r11} /* pop r4 - r11 register */ - MSR psp, r1 /* update stack pointer */ - -pendsv_exit: - /* restore interrupt */ - MSR PRIMASK, r2 - - ORR lr, lr, #0x04 - BX lr - -/* - * void rt_hw_context_switch_to(rt_uint32 to); - * r0 --> to - */ -.global rt_hw_context_switch_to -.type rt_hw_context_switch_to, %function -rt_hw_context_switch_to: - LDR r1, =rt_interrupt_to_thread - STR r0, [r1] - - /* set from thread to 0 */ - LDR r1, =rt_interrupt_from_thread - MOV r0, #0x0 - STR r0, [r1] - - /* set interrupt flag to 1 */ - LDR r1, =rt_thread_switch_interrupt_flag - MOV r0, #1 - STR r0, [r1] - - /* set the PendSV exception priority */ - LDR r0, =NVIC_SYSPRI2 - LDR r1, =NVIC_PENDSV_PRI - LDR.W r2, [r0,#0x00] /* read */ - ORR r1,r1,r2 /* modify */ - STR r1, [r0] /* write-back */ - - LDR r0, =NVIC_INT_CTRL /* trigger the PendSV exception (causes context switch) */ - LDR r1, =NVIC_PENDSVSET - STR r1, [r0] - - CPSIE I /* enable interrupts at processor level */ - - /* never reach here! */ - -/* compatible with old version */ -.global rt_hw_interrupt_thread_switch -.type rt_hw_interrupt_thread_switch, %function -rt_hw_interrupt_thread_switch: - BX lr - NOP - -.global HardFault_Handler -.type HardFault_Handler, %function -HardFault_Handler: - /* get current context */ - MRS r0, psp /* get fault thread stack pointer */ - PUSH {lr} - BL rt_hw_hard_fault_exception - POP {lr} - - ORR lr, lr, #0x04 - BX lr diff --git a/libcpu/arm/stm32/context_iar.S b/libcpu/arm/stm32/context_iar.S deleted file mode 100644 index c7d5c61d704a7fa3e51b042951b90327dbb30085..0000000000000000000000000000000000000000 --- a/libcpu/arm/stm32/context_iar.S +++ /dev/null @@ -1,176 +0,0 @@ -;/* -; * File : context_iar.S -; * This file is part of RT-Thread RTOS -; * COPYRIGHT (C) 2009, RT-Thread Development Team -; * -; * The license and distribution terms for this file may be -; * found in the file LICENSE in this distribution or at -; * http://www.rt-thread.org/license/LICENSE -; * -; * Change Logs: -; * Date Author Notes -; * 2009-01-17 Bernard first version -; * 2009-09-27 Bernard add protect when contex switch occurs -; */ - -;/** -; * @addtogroup STM32 -; */ -;/*@{*/ - -NVIC_INT_CTRL EQU 0xE000ED04 ; interrupt control state register -NVIC_SYSPRI2 EQU 0xE000ED20 ; system priority register (2) -NVIC_PENDSV_PRI EQU 0x00FF0000 ; PendSV priority value (lowest) -NVIC_PENDSVSET EQU 0x10000000 ; value to trigger PendSV exception - - SECTION .text:CODE(2) - THUMB - REQUIRE8 - PRESERVE8 - - IMPORT rt_thread_switch_interrupt_flag - IMPORT rt_interrupt_from_thread - IMPORT rt_interrupt_to_thread - -;/* -; * rt_base_t rt_hw_interrupt_disable(); -; */ - EXPORT rt_hw_interrupt_disable -rt_hw_interrupt_disable: - MRS r0, PRIMASK - CPSID I - BX LR - -;/* -; * void rt_hw_interrupt_enable(rt_base_t level); -; */ - EXPORT rt_hw_interrupt_enable -rt_hw_interrupt_enable: - MSR PRIMASK, r0 - BX LR - -;/* -; * void rt_hw_context_switch(rt_uint32 from, rt_uint32 to); -; * r0 --> from -; * r1 --> to -; */ - EXPORT rt_hw_context_switch_interrupt - EXPORT rt_hw_context_switch -rt_hw_context_switch_interrupt: -rt_hw_context_switch: - ; set rt_thread_switch_interrupt_flag to 1 - LDR r2, =rt_thread_switch_interrupt_flag - LDR r3, [r2] - CMP r3, #1 - BEQ _reswitch - MOV r3, #1 - STR r3, [r2] - - LDR r2, =rt_interrupt_from_thread ; set rt_interrupt_from_thread - STR r0, [r2] - -_reswitch - LDR r2, =rt_interrupt_to_thread ; set rt_interrupt_to_thread - STR r1, [r2] - - LDR r0, =NVIC_INT_CTRL ; trigger the PendSV exception (causes context switch) - LDR r1, =NVIC_PENDSVSET - STR r1, [r0] - BX LR - -; r0 --> swith from thread stack -; r1 --> swith to thread stack -; psr, pc, lr, r12, r3, r2, r1, r0 are pushed into [from] stack - EXPORT PendSV_Handler -PendSV_Handler: - - ; disable interrupt to protect context switch - MRS r2, PRIMASK - CPSID I - - ; get rt_thread_switch_interrupt_flag - LDR r0, =rt_thread_switch_interrupt_flag - LDR r1, [r0] - CBZ r1, pendsv_exit ; pendsv already handled - - ; clear rt_thread_switch_interrupt_flag to 0 - MOV r1, #0x00 - STR r1, [r0] - - LDR r0, =rt_interrupt_from_thread - LDR r1, [r0] - CBZ r1, swtich_to_thread ; skip register save at the first time - - MRS r1, psp ; get from thread stack pointer - STMFD r1!, {r4 - r11} ; push r4 - r11 register - LDR r0, [r0] - STR r1, [r0] ; update from thread stack pointer - -swtich_to_thread - LDR r1, =rt_interrupt_to_thread - LDR r1, [r1] - LDR r1, [r1] ; load thread stack pointer - - LDMFD r1!, {r4 - r11} ; pop r4 - r11 register - MSR psp, r1 ; update stack pointer - -pendsv_exit - ; restore interrupt - MSR PRIMASK, r2 - - ORR lr, lr, #0x04 - BX lr - -;/* -; * void rt_hw_context_switch_to(rt_uint32 to); -; * r0 --> to -; */ - EXPORT rt_hw_context_switch_to -rt_hw_context_switch_to: - LDR r1, =rt_interrupt_to_thread - STR r0, [r1] - - ; set from thread to 0 - LDR r1, =rt_interrupt_from_thread - MOV r0, #0x0 - STR r0, [r1] - - ; set interrupt flag to 1 - LDR r1, =rt_thread_switch_interrupt_flag - MOV r0, #1 - STR r0, [r1] - - ; set the PendSV exception priority - LDR r0, =NVIC_SYSPRI2 - LDR r1, =NVIC_PENDSV_PRI - LDR.W r2, [r0,#0x00] ; read - ORR r1,r1,r2 ; modify - STR r1, [r0] ; write-back - - LDR r0, =NVIC_INT_CTRL ; trigger the PendSV exception (causes context switch) - LDR r1, =NVIC_PENDSVSET - STR r1, [r0] - - CPSIE I ; enable interrupts at processor level - - ; never reach here! - -; compatible with old version - EXPORT rt_hw_interrupt_thread_switch -rt_hw_interrupt_thread_switch: - BX lr - - IMPORT rt_hw_hard_fault_exception - EXPORT HardFault_Handler -HardFault_Handler: - - ; get current context - MRS r0, psp ; get fault thread stack pointer - PUSH {lr} - BL rt_hw_hard_fault_exception - POP {lr} - - ORR lr, lr, #0x04 - BX lr - - END diff --git a/libcpu/arm/stm32/context_rvds.S b/libcpu/arm/stm32/context_rvds.S deleted file mode 100644 index b38113239ecbe7eda0d18dfd588cfbb2f0927cb9..0000000000000000000000000000000000000000 --- a/libcpu/arm/stm32/context_rvds.S +++ /dev/null @@ -1,188 +0,0 @@ -;/* -; * File : context_rvds.S -; * This file is part of RT-Thread RTOS -; * COPYRIGHT (C) 2009, RT-Thread Development Team -; * -; * The license and distribution terms for this file may be -; * found in the file LICENSE in this distribution or at -; * http://www.rt-thread.org/license/LICENSE -; * -; * Change Logs: -; * Date Author Notes -; * 2009-01-17 Bernard first version -; */ - -;/** -; * @addtogroup STM32 -; */ -;/*@{*/ - -NVIC_INT_CTRL EQU 0xE000ED04 ; interrupt control state register -NVIC_SYSPRI2 EQU 0xE000ED20 ; system priority register (2) -NVIC_PENDSV_PRI EQU 0x00FF0000 ; PendSV priority value (lowest) -NVIC_PENDSVSET EQU 0x10000000 ; value to trigger PendSV exception - - AREA |.text|, CODE, READONLY, ALIGN=2 - THUMB - REQUIRE8 - PRESERVE8 - - IMPORT rt_thread_switch_interrupt_flag - IMPORT rt_interrupt_from_thread - IMPORT rt_interrupt_to_thread - -;/* -; * rt_base_t rt_hw_interrupt_disable(); -; */ -rt_hw_interrupt_disable PROC - EXPORT rt_hw_interrupt_disable - MRS r0, PRIMASK - CPSID I - BX LR - ENDP - -;/* -; * void rt_hw_interrupt_enable(rt_base_t level); -; */ -rt_hw_interrupt_enable PROC - EXPORT rt_hw_interrupt_enable - MSR PRIMASK, r0 - BX LR - ENDP - -;/* -; * void rt_hw_context_switch(rt_uint32 from, rt_uint32 to); -; * r0 --> from -; * r1 --> to -; */ -rt_hw_context_switch_interrupt - EXPORT rt_hw_context_switch_interrupt -rt_hw_context_switch PROC - EXPORT rt_hw_context_switch - - ; set rt_thread_switch_interrupt_flag to 1 - LDR r2, =rt_thread_switch_interrupt_flag - LDR r3, [r2] - CMP r3, #1 - BEQ _reswitch - MOV r3, #1 - STR r3, [r2] - - LDR r2, =rt_interrupt_from_thread ; set rt_interrupt_from_thread - STR r0, [r2] - -_reswitch - LDR r2, =rt_interrupt_to_thread ; set rt_interrupt_to_thread - STR r1, [r2] - - LDR r0, =NVIC_INT_CTRL ; trigger the PendSV exception (causes context switch) - LDR r1, =NVIC_PENDSVSET - STR r1, [r0] - BX LR - ENDP - -; r0 --> swith from thread stack -; r1 --> swith to thread stack -; psr, pc, lr, r12, r3, r2, r1, r0 are pushed into [from] stack -PendSV_Handler PROC - EXPORT PendSV_Handler - - ; disable interrupt to protect context switch - MRS r2, PRIMASK - CPSID I - - ; get rt_thread_switch_interrupt_flag - LDR r0, =rt_thread_switch_interrupt_flag - LDR r1, [r0] - CBZ r1, pendsv_exit ; pendsv already handled - - ; clear rt_thread_switch_interrupt_flag to 0 - MOV r1, #0x00 - STR r1, [r0] - - LDR r0, =rt_interrupt_from_thread - LDR r1, [r0] - CBZ r1, swtich_to_thread ; skip register save at the first time - - MRS r1, psp ; get from thread stack pointer - STMFD r1!, {r4 - r11} ; push r4 - r11 register - LDR r0, [r0] - STR r1, [r0] ; update from thread stack pointer - -swtich_to_thread - LDR r1, =rt_interrupt_to_thread - LDR r1, [r1] - LDR r1, [r1] ; load thread stack pointer - - LDMFD r1!, {r4 - r11} ; pop r4 - r11 register - MSR psp, r1 ; update stack pointer - -pendsv_exit - ; restore interrupt - MSR PRIMASK, r2 - - ORR lr, lr, #0x04 - BX lr - ENDP - -;/* -; * void rt_hw_context_switch_to(rt_uint32 to); -; * r0 --> to -; * this fucntion is used to perform the first thread switch -; */ -rt_hw_context_switch_to PROC - EXPORT rt_hw_context_switch_to - ; set to thread - LDR r1, =rt_interrupt_to_thread - STR r0, [r1] - - ; set from thread to 0 - LDR r1, =rt_interrupt_from_thread - MOV r0, #0x0 - STR r0, [r1] - - ; set interrupt flag to 1 - LDR r1, =rt_thread_switch_interrupt_flag - MOV r0, #1 - STR r0, [r1] - - ; set the PendSV exception priority - LDR r0, =NVIC_SYSPRI2 - LDR r1, =NVIC_PENDSV_PRI - LDR.W r2, [r0,#0x00] ; read - ORR r1,r1,r2 ; modify - STR r1, [r0] ; write-back - - ; trigger the PendSV exception (causes context switch) - LDR r0, =NVIC_INT_CTRL - LDR r1, =NVIC_PENDSVSET - STR r1, [r0] - - ; enable interrupts at processor level - CPSIE I - - ; never reach here! - ENDP - -; compatible with old version -rt_hw_interrupt_thread_switch PROC - EXPORT rt_hw_interrupt_thread_switch - BX lr - NOP - ENDP - - IMPORT rt_hw_hard_fault_exception - EXPORT HardFault_Handler -HardFault_Handler PROC - - ; get current context - MRS r0, psp ; get fault thread stack pointer - PUSH {lr} - BL rt_hw_hard_fault_exception - POP {lr} - - ORR lr, lr, #0x04 - BX lr - ENDP - - END diff --git a/libcpu/arm/stm32/cpuport.c b/libcpu/arm/stm32/cpuport.c deleted file mode 100644 index 02d342ef2533006e3565a01e60c19195e48dc9e4..0000000000000000000000000000000000000000 --- a/libcpu/arm/stm32/cpuport.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * File : cpuport.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2009 - 2011, RT-Thread Development Team - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE - * - * Change Logs: - * Date Author Notes - * 2006-08-23 Bernard the first version - * 2011-06-03 Bernard merge all of C source code into cpuport.c - */ -#include - -/* exception and interrupt handler table */ -rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; -rt_uint32_t rt_thread_switch_interrupt_flag; - -struct stack_contex -{ - rt_uint32_t r0; - rt_uint32_t r1; - rt_uint32_t r2; - rt_uint32_t r3; - rt_uint32_t r12; - rt_uint32_t lr; - rt_uint32_t pc; - rt_uint32_t psr; -}; - -rt_uint8_t *rt_hw_stack_init(void *tentry, void *parameter, - rt_uint8_t *stack_addr, void *texit) -{ - unsigned long *stk; - - stk = (unsigned long *)stack_addr; - *(stk) = 0x01000000L; /* PSR */ - *(--stk) = (unsigned long)tentry; /* entry point, pc */ - *(--stk) = (unsigned long)texit; /* lr */ - *(--stk) = 0; /* r12 */ - *(--stk) = 0; /* r3 */ - *(--stk) = 0; /* r2 */ - *(--stk) = 0; /* r1 */ - *(--stk) = (unsigned long)parameter; /* r0 : argument */ - - *(--stk) = 0; /* r11 */ - *(--stk) = 0; /* r10 */ - *(--stk) = 0; /* r9 */ - *(--stk) = 0; /* r8 */ - *(--stk) = 0; /* r7 */ - *(--stk) = 0; /* r6 */ - *(--stk) = 0; /* r5 */ - *(--stk) = 0; /* r4 */ - - /* return task's current stack address */ - return (rt_uint8_t *)stk; -} - -extern void rt_hw_interrupt_thread_switch(void); -extern void list_thread(void); -extern rt_thread_t rt_current_thread; -void rt_hw_hard_fault_exception(struct stack_contex* contex) -{ - rt_kprintf("psr: 0x%08x\n", contex->psr); - rt_kprintf(" pc: 0x%08x\n", contex->pc); - rt_kprintf(" lr: 0x%08x\n", contex->lr); - rt_kprintf("r12: 0x%08x\n", contex->r12); - rt_kprintf("r03: 0x%08x\n", contex->r3); - rt_kprintf("r02: 0x%08x\n", contex->r2); - rt_kprintf("r01: 0x%08x\n", contex->r1); - rt_kprintf("r00: 0x%08x\n", contex->r0); - - rt_kprintf("hard fault on thread: %s\n", rt_current_thread->name); -#ifdef RT_USING_FINSH - list_thread(); -#endif - while (1); -} - -void rt_hw_cpu_shutdown() -{ - rt_kprintf("shutdown...\n"); - - RT_ASSERT(0); -}