Today I downloaded the latest SparkCore firmware from GitHub and tried it together with my own application.
Unfortunaltely I got a SOS Heap error (flashing red 8 times after SOS).
When I looked at the memory usage I saw a big increase of the used RAM memory (data + bss), exeeding the 16K limit.
In the old situation the RAM usage was 3032 + 12356 = 15388 bytes
In the new situation the RAM usage is 3212 + 13400 = 16612 bytes
Without changing my own application the memory usage has increased with 1224 bytes, resulting in the heap errror.
Is there a way to reduce the RAM usage from the SparkCore?
I have put quite some effort in reducing the amount of RAM of my own application, I don’t know how reduce it with roughly 612 bytes again.
Thanks,
Henk
Here the info after building:
**OLD SparkCore firmware from 28-april-2014 + my own application**
Invoking: ARM GNU Print Size
arm-none-eabi-size --format=berkeley core-firmware.elf
text data bss dec hex filename
89900 3032 12356 105288 19b48 core-firmware.elf
**NEW SparkCore firmware from 15-may-2014 + my own application**
Invoking: ARM GNU Print Size
arm-none-eabi-size --format=berkeley core-firmware.elf
text data bss dec hex filename
92244 3212 13400 108856 1a938 core-firmware.elf
Sorry about that! The latest firmware push seemed to take up more ram than we were expecting.
While we’re working on reducing the baseline ram usage in the firmware, if you wanted to post your code we can try to help look for any low hanging fruit. If you’re building locally and using tcp/udp clients, you can also reduce your TCP client / UDP client buffer sizes which is an easy save.
Great, glad to hear you worked it out. We appreciate the feedback. We’ll make sure to reduce RAM usage in the next release. Spark.subscribe accounts for at least 256 bytes, but the jump of more than 1kb is surprising. Thanks for documenting those numbers side by side for us.
I am using the Publish feature to send information from the SparkCore towards a small server running on Node.js.
I noticed that changing the TCP client buffer did not made any difference on the amount of used RAM while changing the UDP client buffer showed it immediately.
Is my asumption correct that Publish is using the UDP protocol?
Could that also be the reason that I sometimes miss some published messages?
I send roughly 20 to 50 messages in a sequence, with a pause of one second between each message. After the sequense there will be a much longer pause, sometimes a few hours.
Thanks,
Henk
BTW
I want to thank the Spark Team and the community for the great support of this amazing product!!!
As you know the Team and Elites are committed to doing our best and make core awesome…
This is a new feature in the Web IDE which should already be available to everyone!
Displaying Ram Usage when verifying
*Right now, you need to modify the code each time before you verify. Something like adding a SPACE works too.
It’s a hard backend issue to display it every time but we are looking into it!
Special thanks to:
@bko for the script to extract the information, @jgoggins for pushing this feature fast, @Dave for changing the backend and @shime who did the IDE changes!
Not forgetting everyone in the Elite who came up with this idea and made it happen in a short span of 16 Days (minus 5 days for Maker Faire)
The next step is to work on reducing RAM usage itself.
Since we’ve got a new firmware, it might be useful adding the faulty firmware version to this topic title, to avoid confusion. @mhwlng, would you mind trying out a different browser? Maybe that’s where the problem lies.
You might need to clear your browser cache or do a hard refresh, but you should see a little “( i )” icon after that text or after the ready if it’s there. You need to change your file slightly to force it to recompile.
At the moment, it’s not there every time, just after fresh compiles when you change some code and click Verify. I just tried Firefox 29, and it worked, so I would think it would work for you as well, probably just a matter of timing.
Hey @mhwlng , that is weird indeed. The ‘i’ doesn’t show up for you even after you add a newline to your code then hit verify? And only happens for old projects? So strange. I couldn’t replicate. Does it happen in a Chrome incognito window after a fresh login?
just adding a new line or a space and pressing verify doesn’t show the 'i’
but actually changing the code (e.g. adding a new variable) does show the ‘i’