<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div>I finally got CONFIG_OVMS_HW_SPIMEM_AGGRESSIVE working properly. It seems we need to include sdkconfig.h to access these CONFIG_* variables (if we don’t include other esp libraries that do that already). Other than that change, the rest was easy.<div class=""><br class=""></div><div class="">For my running config (a car, a v2 server connected, and wifi), I originally had this:</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">OVMS# module memory</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">Free 8-bit 87484/230708, 32-bit 7296/11532, SPIRAM 4079552/4194252</span></font></div></div></blockquote><div class=""><div><br class=""></div><div>Now, with CONFIG_OVMS_HW_SPIMEM_AGGRESSIVE working properly, I get this:</div><div><br class=""></div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">OVMS# module memory</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">Free 8-bit 104640/230700, 32-bit 7296/11532, SPIRAM 4062400/4194252</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class=""><br class=""></span></font></div><div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">OVMS# test spiram</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">Metrics (0x3f802024) are in SPI RAM</span></font></div></div></div></div></blockquote><div class=""><div><br class=""></div><div>With that config option enabled, all the C++ allocations are by default in SPI RAM, and we gain about 17KB of conventional RAM.</div><div><br class=""></div><div><div>A quick ‘fgrep -r alloc main components’ shows about 1,000 uses of calloc/malloc in our system. I’ve got a large number of them now done, but probably a few more still to do. For example, changing wolf ssh/ssl to use it means most of the incremental allocations are from SPI RAM. Duktape would be a good win (but non-trivial, I think).</div><div class=""><br class=""></div></div><div>Even with bluetooth compiled in, and running, I now have:</div><div><br class=""></div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div><div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">OVMS# module memory</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">Free 8-bit 76476/230696, 32-bit 7296/11532, SPIRAM 4033960/4194252</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class=""><br class=""></span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">OVMS# module tasks</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">Number of Tasks = 21 Stack: Now Max Total Heap 32-bit SPIRAM</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">3FFCFF98 1 Blk esp_timer 388 628 4096 23928 644 44632</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">3FFD1C38 2 Blk eventTask 436 1876 4608 0 0 0</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">3FFD4158 3 Blk OVMS Events 436 3124 8192 73960 0 22128</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">3FFD56C0 4 Blk OVMS CanRx 428 476 1024 0 0 0</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">3FFBC3D4 5 Blk ipc0 400 480 1024 7776 0 0</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">3FFBC9D4 6 Blk ipc1 400 496 1024 12 0 0</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">3FFBD5E8 9 Rdy IDLE 372 548 1024 0 0 0</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">3FFBD768 10 Rdy IDLE 372 548 1024 0 0 0</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">3FFBD8E8 11 Blk Tmr Svc 344 888 3072 88 0 0</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">3FFBCCAC 16 Blk tiT 496 1504 3072 696 0 884</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">3FFB7A2C 17 Blk OVMS SIMCOM 464 512 4096 0 0 0</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">3FFB7D58 18 Blk wifi 432 2384 4096 360 0 1576</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">3FFDAD44 19 Blk OVMS Vehicle 460 508 6144 0 0 0</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">3FFDF718 20 Rdy OVMS Console 740 2612 6144 9072 3488 24044</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">3FFDFBC0 21 Blk mdns 456 1384 4096 108 0 4</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">3FFE37BC 22 Blk OVMS NetMan 728 2552 8192 104 0 1136</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">3FFE79B0 23 Blk btController 444 1980 4096 88 0 0</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">3FFE8CA0 24 Blk Btc_task 412 2572 3584 14924 0 1688</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">3FFE9EEC 25 Blk hciHostT 408 744 2560 0 0 0</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">3FFEAFF0 26 Blk hciH4T 412 604 2560 0 0 0</span></font></div><div><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">3FFEC854 27 Blk btuT 416 2016 4608 2760 0 23996</span></font></div></div></div></blockquote><div class=""><div><br class=""></div><div>That seems very workable.</div><div><br class=""></div><div>Regards, Mark</div><div><br class=""></div><div><blockquote type="cite" class=""><div class="">Begin forwarded message:</div><br class="Apple-interchange-newline"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">From: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">GitHub <<a href="mailto:noreply@github.com" class="">noreply@github.com</a>><br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">Subject: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class=""><b class="">[openvehicles/Open-Vehicle-Monitoring-System-3] c2d3f7: Add a test spiram command to show whether SPI RAM ...</b><br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">Date: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">11 June 2018 at 12:51:21 PM HKT<br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><br class=""></div><div class=""><div class=""> Branch: refs/heads/master<br class=""> Home: <a href="https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3" class="">https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3</a><br class=""> Commit: c2d3f7f7ae8655d9d2809e15ad6f989a3459c8df<br class=""> <a href="https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/commit/c2d3f7f7ae8655d9d2809e15ad6f989a3459c8df" class="">https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/commit/c2d3f7f7ae8655d9d2809e15ad6f989a3459c8df</a><br class=""> Author: Mark Webb-Johnson <<a href="mailto:mark@webb-johnson.net" class="">mark@webb-johnson.net</a>><br class=""> Date: 2018-06-11 (Mon, 11 Jun 2018)<br class=""><br class=""> Changed paths:<br class=""> M vehicle/OVMS.V3/main/test_framework.cpp<br class=""><br class=""> Log Message:<br class=""> -----------<br class=""> Add a test spiram command to show whether SPI RAM is being globally used or not<br class=""><br class=""><br class=""> Commit: c1f96e71dd51c44f9aeff9cf5940982b939a8b24<br class=""> <a href="https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/commit/c1f96e71dd51c44f9aeff9cf5940982b939a8b24" class="">https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/commit/c1f96e71dd51c44f9aeff9cf5940982b939a8b24</a><br class=""> Author: Mark Webb-Johnson <<a href="mailto:mark@webb-johnson.net" class="">mark@webb-johnson.net</a>><br class=""> Date: 2018-06-11 (Mon, 11 Jun 2018)<br class=""><br class=""> Changed paths:<br class=""> M vehicle/OVMS.V3/main/ovms.cpp<br class=""> M vehicle/OVMS.V3/main/ovms.h<br class=""><br class=""> Log Message:<br class=""> -----------<br class=""> Fix CONFIG_OVMS_HW_SPIMEM_AGGRESSIVE<br class=""></div></div></blockquote><br class=""></div></div></body></html>