Make IoT.js to use ccm memory on stm32f4board
I succesfully moved the heap and stack of nuttx and the heap of IoT.js to ccm. The stack of IoT. js and the heap of Jerryscript stayed on sram. Now we can use ~100kb of memory for Jerry heap on stm32f4 board. We couldn't move the IoT.js's stack to ccm so far, because there are only 11kb on ccm left. If we could decrease the stack size of IoT.js then we could use the entire sram as Jerry heap.
Here are the patches: IoT.js JerryScript nuttx nuttx apps nuttx arch nuttx boards
@tczene , you've done a great work.
+ .data : {
+ _sdata = ABSOLUTE(.);
+ *(.data .data.*)
+ *(.gnu.linkonce.d.*)
+ CONSTRUCTORS
+ _edata = ABSOLUTE(.);
+ } > ccmram AT > flash
+
+ .bss : {
+ _sbss = ABSOLUTE(.);
+ *(.bss .bss.*)
+ *(.gnu.linkonce.b.*)
+ *(COMMON)
+ _ebss = ABSOLUTE(.);
+ } > ccmram
+
+ .jerry_mem : {
+ _sjerry_mem = ABSOLUTE(.);
+ *(.jerry_mem .jerry_mem.*)
+ *(COMMON)
+ _ejerry_mem = ABSOLUTE(.);
+ } > sram
Seems that data and bss are moved to CCM if possible, so, have you tried with some network test?
Hi, I updated the patches. Yes I have tried. Simple http tests run well.
@tczene , it seems there was a typo in arm/src/stm32/stm32_eth.c
-#if 0
-defined(CONFIG_SYSTEM_IOTJS) || defined(CONFIG_SYSTEM_TUVTESTER)
-static struct stm32_ethmac_s __attribute__((section (".ccmram"))) \
- g_stm32ethmac[STM32_NETHERNET];
+#if CONFIG_ITOJS_USE_CCM
+static struct stm32_ethmac_s g_stm32ethmac[STM32_NETHERNET] __attribute__((section(".sram_section")));
CONFIG_ITOJS_USE_CCM should be CONFIG_IOTJS_USE_CCM
Can you check with the network again?
@tczene , I've added review comments for nuttx. please check.
close since as we mentioned here hw-boards, the optimization for stm seires boards are up to each developer.