iotjs icon indicating copy to clipboard operation
iotjs copied to clipboard

Make IoT.js to use ccm memory on stm32f4board

Open tczene opened this issue 11 years ago • 6 comments

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.

tczene avatar Nov 23 '15 13:11 tczene

Here are the patches: IoT.js JerryScript nuttx nuttx apps nuttx arch nuttx boards

tczene avatar Nov 23 '15 14:11 tczene

@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?

seanshpark avatar Nov 24 '15 01:11 seanshpark

Hi, I updated the patches. Yes I have tried. Simple http tests run well.

tczene avatar Dec 10 '15 13:12 tczene

@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?

seanshpark avatar Dec 14 '15 00:12 seanshpark

@tczene , I've added review comments for nuttx. please check.

seanshpark avatar Dec 14 '15 00:12 seanshpark

close since as we mentioned here hw-boards, the optimization for stm seires boards are up to each developer.

chokobole avatar Oct 20 '16 06:10 chokobole