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 @@
//
#define RT_USING_MEMHEAP
//
-//#define RT_USING_HEAP
+#define RT_USING_HEAP
//
#define RT_USING_SMALL_MEM
//
@@ -85,7 +85,7 @@
//
#define RT_USING_COMPONENTS_INIT
//
-//#define RT_USING_FINSH
+#define RT_USING_FINSH
//
#define FINSH_USING_SYMTAB
//