Browse Source

Merge pull request #3721 from ArdaFu/master

[BSP][TM4C129X] Fix the bug that HEAP is not initialized at system start up.
Bernard Xiong 4 years ago
parent
commit
08048bbcb7
2 changed files with 6 additions and 2 deletions
  1. 5 1
      bsp/tm4c129x/applications/board.c
  2. 1 1
      bsp/tm4c129x/applications/board.h

+ 5 - 1
bsp/tm4c129x/applications/board.c

@@ -55,12 +55,16 @@ extern void PendSV_Handler(void);
 extern void HardFault_Handler(void);
 
 /**
- * This function will initial LPC40xx board.
+ * This function will initial TM4C129X board.
  */
 void rt_hw_board_init()
 {
     //init low level drivers. e.g. cpu uart etc.
     rt_components_board_init();
+    //init HEAP.
+    #ifdef RT_USING_HEAP
+        rt_system_heap_init(HEAP_BEGIN, HEAP_END);
+    #endif
     //redirect RTT stdio to CONSOLE device
     rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
 }

+ 1 - 1
bsp/tm4c129x/applications/board.h

@@ -33,7 +33,7 @@ extern int Image$$RW_IRAM$$ZI$$Limit;
 extern int _ebss;
 #define HEAP_BEGIN  ((void *)&_ebss)
 #endif
-#define HEAP_END    (0x20000000 + 256*1024)
+#define HEAP_END    ((void *)(0x20000000 + 256*1024))
 
 #define FINSH_DEVICE_NAME   RT_CONSOLE_DEVICE_NAME
 void rt_hw_board_init(void);