Rosanswers logo

Hi all,

as stated here (http://arduino.cc/en/pmwiki.php?n=Tutorial/Memory) adruinos usually do not have much SRAM and it is easy to use it all up by using many constant strings

Notice that there's not much SRAM available in the Uno. It's easy to use it all up by having lots of strings in your program.

<sarcasm warning> The nice feature of the arduino IDE in this cases is that it does not fail to compile or upload but only the arduino programm will run 'strangely' </sarcasm warning>

If you run out of SRAM, your program may fail in unexpected ways; it will appear to upload successfully, but not run, or run strangely. To check if this is happening, you can try commenting out or shortening the strings or other data structures in your sketch (without changing the code). If it then runs successfully, you're probably running out of SRAM.

I have observed this behaviour with my arduino code that uses ros_lib. One of the causes is that ros_lib stores for each topic (publish/subscribe) 3 strings ( md5sum, message type name and topic name ). Particularly if I use topics with namespaces if have observed the problem on arduino uno after setting up only 3 or 4 topics.

How the question: Has anyone considered modifying the message generator for Ardunio such that it uses PROGMEM for storing md5sum, topic and stuff? (Or is it even possible?)


The data is static and I think this would significantly reduce the SRAM usage....

Thank you!

Edit 22.09.: anyone?

Originally posted by Wolf on ROS Answers with karma: 7555 on 2014-09-22

Post score: 2

Original comments

Comment by gvdhoorn on 2014-09-24:
You might want to try and just report this as an issue over at the ros-drivers/rosserial github repo. Do refer to this post in your issue.


1 Answer 1


Rosanswers logo

I forked from rosserial and created a REPO that supports PROGMEN usage for the ros relevant constant strings on arduino. There is a pending pull request.

Until then, anybody interested in this can clone into my fork: https://github.com/strothmw/rosserial

Originally posted by Wolf with karma: 7555 on 2015-03-25

This answer was ACCEPTED on the original site

Post score: 1


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.