Răsfoiți Sursa

rm48x50: add finsh support

Grissiom 12 ani în urmă
părinte
comite
4d40978a70

+ 22 - 4
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 */
 }
 

+ 3 - 6
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;

+ 7 - 5
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 */

+ 2 - 2
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" />