diff options
| author | Grissiom <[email protected]> | 2013-05-29 23:39:09 +0800 |
|---|---|---|
| committer | Grissiom <[email protected]> | 2013-05-29 23:39:09 +0800 |
| commit | 4d40978a70158f9906cbef4c0249554ff8d92ce8 (patch) | |
| tree | d29c8d0c2401183de9a466ed33475d354ac33088 /bsp | |
| parent | eda09ab002f2403d9d5a9821c0802cf6ef96c256 (diff) | |
rm48x50: add finsh support
Diffstat (limited to 'bsp')
| -rw-r--r-- | bsp/rm48x50/HALCoGen/source/sys_link.cmd | 26 | ||||
| -rw-r--r-- | bsp/rm48x50/application/application.c | 9 | ||||
| -rw-r--r-- | bsp/rm48x50/application/startup.c | 12 | ||||
| -rw-r--r-- | bsp/rm48x50/rtconfig.h | 4 |
4 files changed, 34 insertions, 17 deletions
diff --git a/bsp/rm48x50/HALCoGen/source/sys_link.cmd b/bsp/rm48x50/HALCoGen/source/sys_link.cmd index 217942999f..1cf658fac5 100644 --- a/bsp/rm48x50/HALCoGen/source/sys_link.cmd +++ b/bsp/rm48x50/HALCoGen/source/sys_link.cmd @@ -12,6 +12,8 @@ /* Linker Settings */ --retain="*(.intvecs)" +--retain="*(FSymTab)" +--retain="*(VSymTab)" /* USER CODE BEGIN (8) */ /* USER CODE END */ @@ -45,12 +47,28 @@ SECTIONS .const : {} > FLASH0 | FLASH1 .cinit : {} > FLASH0 | FLASH1 .pinit : {} > FLASH0 | FLASH1 - .bss : {} > RAM - .data : {} > RAM - .sysmem : {} > RAM - + GROUP + { + .bss : {} + .data : {} + .sysmem : {} + ._dummy : {system_data_end = .;} + } > RAM + /* USER CODE BEGIN (11) */ + /* place this section in the last section in RAM. The brain damaged linker + * could only create symbols in sections. */ + ._FSymTab : { + __fsymtab_start = .; + *(FSymTab) + __fsymtab_end = .; + } > FLASH0 | FLASH1 + ._VSymTab : { + __vsymtab_start = .; + *(VSymTab) + __vsymtab_end = .; + } > FLASH0 | FLASH1 /* USER CODE END */ } diff --git a/bsp/rm48x50/application/application.c b/bsp/rm48x50/application/application.c index fe3d34bf81..cc7a87beb9 100644 --- a/bsp/rm48x50/application/application.c +++ b/bsp/rm48x50/application/application.c @@ -34,11 +34,8 @@ static void user_thread_entry(void *p) for(i = 0; ;i++) { - rt_kprintf("loop %d\n", i); gioSetBit(hetPORT1, 17, gioGetBit(hetPORT1, 17) ^ 1); - /*sciSendByte(scilinREG, 'b');*/ rt_thread_delay(100); - /*sciSendByte(scilinREG, 'a');*/ } } @@ -53,15 +50,15 @@ void vRegTestTask2(void*); int rt_application_init() { rt_thread_init(&user_thread, "user1", user_thread_entry, RT_NULL, - user_thread_stack, sizeof(user_thread_stack), 8, 20); + user_thread_stack, sizeof(user_thread_stack), 21, 20); rt_thread_startup(&user_thread); rt_thread_init(&test_thread, "test1", vRegTestTask1, RT_NULL, - test_thread_stack, sizeof(test_thread_stack), 8, 20); + test_thread_stack, sizeof(test_thread_stack), 21, 20); rt_thread_startup(&test_thread); rt_thread_init(&test_thread2, "test2", vRegTestTask2, RT_NULL, - test_thread_stack2, sizeof(test_thread_stack2), 9, 20); + test_thread_stack2, sizeof(test_thread_stack2), 22, 20); rt_thread_startup(&test_thread2); return 0; diff --git a/bsp/rm48x50/application/startup.c b/bsp/rm48x50/application/startup.c index 6ab9d7526f..72d4ed795b 100644 --- a/bsp/rm48x50/application/startup.c +++ b/bsp/rm48x50/application/startup.c @@ -38,8 +38,8 @@ extern rt_err_t rt_hw_serial_init(void); extern int Image$$RW_IRAM1$$ZI$$Limit; #elif defined(__GNUC__) extern int __bss_end; -#else -extern unsigned char *__TI_DATA_Limit; +#elif defined(__TI_COMPILER_VERSION__) +extern unsigned char * const system_data_end; #endif #define MEMEND 0x08040000 @@ -70,9 +70,11 @@ void rtthread_startup(void) #ifdef __CC_ARM rt_system_heap_init((void*)&Image$$RW_IRAM1$$ZI$$Limit, (void*)MEMEND); #elif defined(__GNUC__) - rt_system_heap_init((void*)&__bss_end, (void*)MEMEND); + rt_system_heap_init((void*)&__bss_end, (void*)MEMEND); +#elif defined(__TI_COMPILER_VERSION__) + rt_system_heap_init((void*)&system_data_end, (void*)MEMEND); #else - rt_system_heap_init((void*)&__TI_DATA_Limit, (void*)MEMEND); +#error Unkown compiler #endif #endif @@ -85,7 +87,7 @@ void rtthread_startup(void) #ifdef RT_USING_FINSH /* init finsh */ finsh_system_init(); - finsh_set_device("uart1"); + finsh_set_device("sci2"); #endif /* init soft timer thread */ diff --git a/bsp/rm48x50/rtconfig.h b/bsp/rm48x50/rtconfig.h index abc3711e50..0ae5168fba 100644 --- a/bsp/rm48x50/rtconfig.h +++ b/bsp/rm48x50/rtconfig.h @@ -57,7 +57,7 @@ // <bool name="RT_USING_MEMHEAP" description="Using Memory Heap Object in the system" default="true" /> #define RT_USING_MEMHEAP // <bool name="RT_USING_HEAP" description="Using Dynamic Heap Management in the system" default="true" /> -//#define RT_USING_HEAP +#define RT_USING_HEAP // <bool name="RT_USING_SMALL_MEM" description="Optimizing for small memory" default="false" /> #define RT_USING_SMALL_MEM // <bool name="RT_USING_SLAB" description="Using SLAB memory management for large memory" default="false" /> @@ -85,7 +85,7 @@ // <bool name="RT_USING_COMPONENTS_INIT" description="Using RT-Thread components initialization" default="true" /> #define RT_USING_COMPONENTS_INIT // <section name="RT_USING_FINSH" description="Using finsh as shell, which is a C-Express shell" default="true" > -//#define RT_USING_FINSH +#define RT_USING_FINSH // <bool name="FINSH_USING_SYMTAB" description="Using symbol table in finsh shell" default="true" /> #define FINSH_USING_SYMTAB // <bool name="FINSH_USING_DESCRIPTION" description="Keeping description in symbol table" default="true" /> |
