diff --git a/bsp/fm3/CMSIS/system_mb9bf50x.c b/bsp/fm3/CMSIS/system_mb9bf50x.c index f965d2ea0c..21cd7a3f26 100644 --- a/bsp/fm3/CMSIS/system_mb9bf50x.c +++ b/bsp/fm3/CMSIS/system_mb9bf50x.c @@ -73,8 +73,8 @@ static void ClockInit(void) while(!(FM3_CRG->SCM_STR & 0x02)); /* sub CLK enable */ - FM3_CRG->SCM_CTL |= 0x08; - while(!(FM3_CRG->SCM_STR & 0x08)); + //FM3_CRG->SCM_CTL |= 0x08; + //while(!(FM3_CRG->SCM_STR & 0x08)); /*Set PLL stabilization wait time to 512uS*/ diff --git a/bsp/fm3/application.c b/bsp/fm3/application.c index 3d75e017f6..14d7868ada 100644 --- a/bsp/fm3/application.c +++ b/bsp/fm3/application.c @@ -18,9 +18,29 @@ /*@{*/ #include +#include "board.h" + +void rt_init_thread_entry(void *parameter) +{ + while(1) + { + rt_hw_led_on(LED1); + rt_hw_led_off(LED2); + rt_thread_delay(100); + rt_hw_led_off(LED1); + rt_hw_led_on(LED2); + rt_thread_delay(100); + } +} int rt_application_init() { + rt_thread_t init_thread; + + init_thread = rt_thread_create("init", rt_init_thread_entry, RT_NULL, 1024, 21, 20); + if(init_thread != RT_NULL) + rt_thread_startup(init_thread); + return 0; } diff --git a/bsp/fm3/board.c b/bsp/fm3/board.c index 393a6c2084..f58044c00c 100644 --- a/bsp/fm3/board.c +++ b/bsp/fm3/board.c @@ -42,13 +42,60 @@ void rt_hw_timer_handler(void) rt_interrupt_leave(); } +void led_init(void) +{ + /*Select CPIO function*/ + LED_PFR &= ~LED_MASK; + /*Set Pin to turn off leds*/ + LED_PDOR |= LED_MASK; + /*Make led pins outputs*/ + LED_DDR |= LED_MASK; +} + +void rt_hw_led_on(int n) +{ + switch(n) + { + case LED1: + LED_PDOR &= ~LED1; + break; + case LED2: + LED_PDOR &= ~LED2; + break; + case LED3: + LED_PDOR &= ~LED3; + break; + default: + break; + } +} + +void rt_hw_led_off(int n) +{ + switch(n) + { + case LED1: + LED_PDOR |= LED1; + break; + case LED2: + LED_PDOR |= LED2; + break; + case LED3: + LED_PDOR |= LED3; + break; + default: + break; + } +} + /** - * This function will initial LPC17xx board. +* This function will initial FM3 Easy Kit board. */ void rt_hw_board_init() { - /* init systick */ - SysTick_Config(SystemFrequency/RT_TICK_PER_SECOND - 1); + led_init(); + /* init systick */ + SysTick_Config(SystemFrequency/RT_TICK_PER_SECOND - 1); } /*@}*/ diff --git a/bsp/fm3/board.h b/bsp/fm3/board.h index 1a2664cff1..95fb18e416 100644 --- a/bsp/fm3/board.h +++ b/bsp/fm3/board.h @@ -16,6 +16,28 @@ #ifndef __BOARD_H__ #define __BOARD_H__ +#include "mb9bf506r.h" + +/*LEDs*/ +#define LED1 (1UL<<10) +#define LED2 (1UL<<11) +#define LED3 (1UL<<12) +#define LED_MASK (LED1 | LED2 | LED3) + +#define LED_PFR (FM3_GPIO->PFR3) +#define LED_DDR (FM3_GPIO->DDR3) +#define LED_PDOR (FM3_GPIO->PDOR3) + +//Internal SRAM memory size[Kbytes] <8-64> +//MB9BF500 : 32 +//MB9BF504 : 32 +//MB9BF505 : 48 +//MB9BF506 : 64 +#define FM3_SRAM_SIZE 32 +#define FM3_SRAM_END (0x20000000 + FM3_SRAM_SIZE * 1024) + +void rt_hw_led_on(int n); +void rt_hw_led_off(int n); void rt_hw_board_init(void); #endif diff --git a/bsp/fm3/fm3_easy_kit.dep b/bsp/fm3/fm3_easy_kit.dep new file mode 100644 index 0000000000..bc44654a65 --- /dev/null +++ b/bsp/fm3/fm3_easy_kit.dep @@ -0,0 +1,542 @@ + + + + 2 + 65142411 + + Debug + + $PROJ_DIR$\Debug\Obj\ipc.pbi + $PROJ_DIR$\Debug\Obj\mempool.o + $PROJ_DIR$\Debug\Obj\board.pbi + $PROJ_DIR$\Debug\Obj\module.o + $PROJ_DIR$\Debug\Obj\cpuport.o + $PROJ_DIR$\Debug\Obj\clock.pbi + $PROJ_DIR$\Debug\Obj\irq.pbi + $PROJ_DIR$\Debug\Obj\object.o + $PROJ_DIR$\Debug\Obj\device.pbi + $PROJ_DIR$\..\..\include\rthw.h + $PROJ_DIR$\Debug\Obj\slab.pbi + $PROJ_DIR$\Debug\Obj\core_cm3.pbi + $PROJ_DIR$\Debug\Obj\mem.o + $PROJ_DIR$\Debug\Obj\system_mb9bf50x.pbi + $PROJ_DIR$\Debug\Obj\kservice.pbi + $PROJ_DIR$\Debug\Obj\idle.o + $PROJ_DIR$\..\..\include\rtthread.h + $PROJ_DIR$\Debug\Obj\timer.o + $PROJ_DIR$\Debug\Obj\rtm.pbi + $PROJ_DIR$\Debug\Obj\core_cm3.o + $PROJ_DIR$\Debug\Obj\start_iar.o + $PROJ_DIR$\CMSIS\mb9bf506r.h + $PROJ_DIR$\Debug\Obj\application.pbi + $PROJ_DIR$\..\..\include\rtm.h + $PROJ_DIR$\Debug\Obj\kservice.o + $PROJ_DIR$\Debug\Obj\board.o + $PROJ_DIR$\..\..\src\kservice.h + $PROJ_DIR$\Debug\Obj\object.pbi + $PROJ_DIR$\Debug\Obj\module.pbi + $PROJ_DIR$\Debug\Exe\fm3_easy_kit.out + $PROJ_DIR$\Debug\Obj\clock.o + $PROJ_DIR$\Debug\Obj\irq.o + $PROJ_DIR$\Debug\Obj\system_mb9bf50x.o + $PROJ_DIR$\Debug\Obj\cpuport.pbi + $PROJ_DIR$\CMSIS\core_cm3.h + $PROJ_DIR$\Debug\Obj\rtm.o + $PROJ_DIR$\Debug\Obj\thread.pbi + $PROJ_DIR$\board.h + $PROJ_DIR$\Debug\Obj\fm3_easy_kit.pbd + $PROJ_DIR$\Debug\Obj\thread.o + $PROJ_DIR$\Debug\Obj\startup.pbi + $PROJ_DIR$\Debug\Obj\slab.o + $PROJ_DIR$\Debug\Obj\device.o + $PROJ_DIR$\Debug\Obj\timer.pbi + $PROJ_DIR$\Debug\Obj\mempool.pbi + $PROJ_DIR$\Debug\Obj\idle.pbi + $PROJ_DIR$\Debug\Obj\ipc.o + $PROJ_DIR$\Debug\Obj\scheduler.o + $PROJ_DIR$\rtconfig.h + $PROJ_DIR$\CMSIS\core_cmFunc.h + $PROJ_DIR$\CMSIS\system_mb9bf50x.h + $PROJ_DIR$\..\..\include\rtdef.h + $PROJ_DIR$\Debug\Obj\mem.pbi + $PROJ_DIR$\Debug\Obj\context_iar.o + $PROJ_DIR$\Debug\Obj\startup.o + $PROJ_DIR$\CMSIS\core_cmInstr.h + $PROJ_DIR$\Debug\Obj\fault_iar.o + $PROJ_DIR$\Debug\Obj\scheduler.pbi + $PROJ_DIR$\Debug\Obj\application.o + $PROJ_DIR$\CMSIS\core_cm3.c + $PROJ_DIR$\CMSIS\system_mb9bf50x.c + $PROJ_DIR$\..\..\libcpu\arm\fm3\context_iar.S + $PROJ_DIR$\..\..\libcpu\arm\fm3\cpuport.c + $PROJ_DIR$\..\..\libcpu\arm\fm3\fault_iar.S + $PROJ_DIR$\..\..\libcpu\arm\fm3\start_iar.S + $PROJ_DIR$\..\..\src\clock.c + $PROJ_DIR$\..\..\src\device.c + $PROJ_DIR$\..\..\src\idle.c + $PROJ_DIR$\..\..\src\ipc.c + $PROJ_DIR$\..\..\src\irq.c + $PROJ_DIR$\..\..\src\kservice.c + $PROJ_DIR$\..\..\src\mem.c + $PROJ_DIR$\..\..\src\mempool.c + $PROJ_DIR$\..\..\src\module.c + $PROJ_DIR$\..\..\src\object.c + $PROJ_DIR$\..\..\src\rtm.c + $PROJ_DIR$\..\..\src\scheduler.c + $PROJ_DIR$\..\..\src\slab.c + $PROJ_DIR$\..\..\src\thread.c + $PROJ_DIR$\..\..\src\timer.c + $PROJ_DIR$\application.c + $PROJ_DIR$\board.c + $PROJ_DIR$\startup.c + + + [ROOT_NODE] + + + ILINK + 29 + + + + + $PROJ_DIR$\Debug\Obj\fm3_easy_kit.pbd + + + BILINK + 22 2 5 11 33 8 45 0 6 14 52 44 28 27 18 57 10 40 13 36 43 + + + + + $PROJ_DIR$\CMSIS\core_cm3.c + + + ICCARM + 19 + + + BICOMP + 11 + + + + + $PROJ_DIR$\CMSIS\system_mb9bf50x.c + + + ICCARM + 32 + + + BICOMP + 13 + + + + + BICOMP + 21 34 55 49 50 + + + + + $PROJ_DIR$\..\..\libcpu\arm\fm3\context_iar.S + + + AARM + 53 + + + + + $PROJ_DIR$\..\..\libcpu\arm\fm3\cpuport.c + + + ICCARM + 4 + + + BICOMP + 33 + + + + + BICOMP + 9 16 51 48 21 34 55 49 50 + + + + + $PROJ_DIR$\..\..\libcpu\arm\fm3\fault_iar.S + + + AARM + 56 + + + + + $PROJ_DIR$\..\..\libcpu\arm\fm3\start_iar.S + + + AARM + 20 + + + + + $PROJ_DIR$\..\..\src\clock.c + + + ICCARM + 30 + + + BICOMP + 5 + + + + + BICOMP + 16 51 48 + + + + + $PROJ_DIR$\..\..\src\device.c + + + ICCARM + 42 + + + BICOMP + 8 + + + + + BICOMP + 16 51 48 26 + + + + + $PROJ_DIR$\..\..\src\idle.c + + + ICCARM + 15 + + + BICOMP + 45 + + + + + BICOMP + 9 16 51 48 26 + + + + + $PROJ_DIR$\..\..\src\ipc.c + + + ICCARM + 46 + + + BICOMP + 0 + + + + + BICOMP + 16 51 48 9 26 + + + + + $PROJ_DIR$\..\..\src\irq.c + + + ICCARM + 31 + + + BICOMP + 6 + + + + + BICOMP + 9 16 51 48 + + + + + $PROJ_DIR$\..\..\src\kservice.c + + + ICCARM + 24 + + + BICOMP + 14 + + + + + BICOMP + 16 51 48 9 + + + + + $PROJ_DIR$\..\..\src\mem.c + + + ICCARM + 12 + + + BICOMP + 52 + + + + + BICOMP + 16 51 48 + + + + + $PROJ_DIR$\..\..\src\mempool.c + + + ICCARM + 1 + + + BICOMP + 44 + + + + + BICOMP + 9 16 51 48 26 + + + + + $PROJ_DIR$\..\..\src\module.c + + + ICCARM + 3 + + + BICOMP + 28 + + + + + BICOMP + 16 51 48 23 26 + + + + + $PROJ_DIR$\..\..\src\object.c + + + ICCARM + 7 + + + BICOMP + 27 + + + + + BICOMP + 16 51 48 9 26 + + + + + $PROJ_DIR$\..\..\src\rtm.c + + + ICCARM + 35 + + + BICOMP + 18 + + + + + BICOMP + 16 51 48 + + + + + $PROJ_DIR$\..\..\src\scheduler.c + + + ICCARM + 47 + + + BICOMP + 57 + + + + + BICOMP + 16 51 48 9 26 + + + + + $PROJ_DIR$\..\..\src\slab.c + + + ICCARM + 41 + + + BICOMP + 10 + + + + + BICOMP + 9 16 51 48 26 + + + + + $PROJ_DIR$\..\..\src\thread.c + + + ICCARM + 39 + + + BICOMP + 36 + + + + + BICOMP + 16 51 48 9 26 + + + + + $PROJ_DIR$\..\..\src\timer.c + + + ICCARM + 17 + + + BICOMP + 43 + + + + + BICOMP + 16 51 48 9 26 + + + + + $PROJ_DIR$\application.c + + + ICCARM + 58 + + + BICOMP + 22 + + + + + BICOMP + 16 51 48 37 21 34 55 49 50 + + + + + $PROJ_DIR$\board.c + + + ICCARM + 25 + + + BICOMP + 2 + + + + + BICOMP + 9 16 51 48 37 21 34 55 49 50 + + + + + $PROJ_DIR$\startup.c + + + ICCARM + 54 + + + BICOMP + 40 + + + + + BICOMP + 9 16 51 48 37 21 34 55 49 50 + + + + + + Release + + + [MULTI_TOOL] + ILINK + + + + + diff --git a/bsp/fm3/fm3_easy_kit.ewd b/bsp/fm3/fm3_easy_kit.ewd new file mode 100644 index 0000000000..343f72b4b0 --- /dev/null +++ b/bsp/fm3/fm3_easy_kit.ewd @@ -0,0 +1,1659 @@ + + + + 2 + + Debug + + ARM + + 1 + + C-SPY + 2 + + 22 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 1 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 1 + + + + + + + + + JLINK_ID + 2 + + 12 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 1 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 0 + 1 + 1 + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 1 + 1 + 1 + + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 1 + 1 + 1 + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 1 + + + + + + + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $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 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\Stack\Stack.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + + + Release + + ARM + + 0 + + C-SPY + 2 + + 22 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 0 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 0 + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 0 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 0 + + + + + + + + + JLINK_ID + 2 + + 12 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 0 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 0 + 1 + 0 + + + + + + + + + + + + + + + + + RDI_ID + 2 + + 1 + 1 + 0 + + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 1 + 1 + 0 + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 0 + + + + + + + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $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 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\Stack\Stack.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + + + + diff --git a/bsp/fm3/fm3_easy_kit.ewp b/bsp/fm3/fm3_easy_kit.ewp new file mode 100644 index 0000000000..03c8d8251c --- /dev/null +++ b/bsp/fm3/fm3_easy_kit.ewp @@ -0,0 +1,1805 @@ + + + + 2 + + Debug + + ARM + + 1 + + General + 3 + + 18 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 26 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 8 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 11 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Release + + ARM + + 0 + + General + 3 + + 18 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 26 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 8 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 0 + + + + + + + + + CUSTOM + 3 + + + + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 11 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 0 + + + + + + + BILINK + 0 + + + + + CMSIS + + $PROJ_DIR$\CMSIS\core_cm3.c + + + $PROJ_DIR$\CMSIS\system_mb9bf50x.c + + + + FM3 + + $PROJ_DIR$\..\..\libcpu\arm\fm3\context_iar.S + + + $PROJ_DIR$\..\..\libcpu\arm\fm3\cpuport.c + + + $PROJ_DIR$\..\..\libcpu\arm\fm3\fault_iar.S + + + $PROJ_DIR$\..\..\libcpu\arm\fm3\start_iar.S + + + + Kernel + + $PROJ_DIR$\..\..\src\clock.c + + + $PROJ_DIR$\..\..\src\device.c + + + $PROJ_DIR$\..\..\src\idle.c + + + $PROJ_DIR$\..\..\src\ipc.c + + + $PROJ_DIR$\..\..\src\irq.c + + + $PROJ_DIR$\..\..\src\kservice.c + + + $PROJ_DIR$\..\..\src\mem.c + + + $PROJ_DIR$\..\..\src\mempool.c + + + $PROJ_DIR$\..\..\src\module.c + + + $PROJ_DIR$\..\..\src\object.c + + + $PROJ_DIR$\..\..\src\rtm.c + + + $PROJ_DIR$\..\..\src\scheduler.c + + + $PROJ_DIR$\..\..\src\slab.c + + + $PROJ_DIR$\..\..\src\thread.c + + + $PROJ_DIR$\..\..\src\timer.c + + + + Startup + + $PROJ_DIR$\application.c + + + $PROJ_DIR$\board.c + + + $PROJ_DIR$\startup.c + + + + + diff --git a/bsp/fm3/fm3_easy_kit.eww b/bsp/fm3/fm3_easy_kit.eww new file mode 100644 index 0000000000..bdaf802ebd --- /dev/null +++ b/bsp/fm3/fm3_easy_kit.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\fm3_easy_kit.ewp + + + + + diff --git a/bsp/fm3/mb9bf500r.icf b/bsp/fm3/mb9bf500r.icf new file mode 100644 index 0000000000..5abdf95d14 --- /dev/null +++ b/bsp/fm3/mb9bf500r.icf @@ -0,0 +1,32 @@ +/*###ICF### Section handled by ICF editor, don't touch! ****/ +/*-Editor annotation file-*/ +/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ +/*-Specials-*/ +define symbol __ICFEDIT_intvec_start__ = 0x00000000; +/*-Memory Regions-*/ +define symbol __ICFEDIT_region_ROM_start__ = 0x00000000; +define symbol __ICFEDIT_region_ROM_end__ = 0x0003FFFF; +define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; +define symbol __ICFEDIT_region_RAM_end__ = 0x20007FFF; +/*-Sizes-*/ +define symbol __ICFEDIT_size_cstack__ = 0x800; +define symbol __ICFEDIT_size_heap__ = 0x400; +/**** End of ICF editor section. ###ICF###*/ + + +define memory mem with size = 4G; +define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; +define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; + +define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; +define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; + +initialize by copy { readwrite }; +//initialize by copy with packing = none { section __DLIB_PERTHREAD }; // Required in a multi-threaded application +do not initialize { section .noinit }; + +place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; + +place in ROM_region { readonly }; +place in RAM_region { readwrite, + block CSTACK, block HEAP }; diff --git a/bsp/fm3/startup.c b/bsp/fm3/startup.c index 8b0635a8fe..f74c60bc5c 100644 --- a/bsp/fm3/startup.c +++ b/bsp/fm3/startup.c @@ -16,7 +16,7 @@ #include #include "board.h" - +#include "mb9bf506r.h" /** * @addtogroup FM3 */ @@ -55,12 +55,12 @@ void rtthread_startup(void) #ifdef RT_USING_HEAP #ifdef __CC_ARM - rt_system_heap_init((void*)&Image$$RW_IRAM1$$ZI$$Limit, (void*)0x10008000); + rt_system_heap_init((void*)&Image$$RW_IRAM1$$ZI$$Limit, (void*)FM3_SRAM_END); #elif __ICCARM__ - rt_system_heap_init(__segment_end("HEAP"), (void*)0x10008000); + rt_system_heap_init(__segment_end("HEAP"), (void*)FM3_SRAM_END); #else /* init memory system */ - rt_system_heap_init((void*)&__bss_end, (void*)0x10008000); + rt_system_heap_init((void*)&__bss_end, (void*)FM3_SRAM_END); #endif #endif @@ -95,6 +95,9 @@ int main(void) /* disable interrupt first */ level = rt_hw_interrupt_disable(); + /* init system setting */ + SystemInit(); + /* startup RT-Thread RTOS */ rtthread_startup();