- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is very strange as it's such a common basic thing, I don't know what could cause this.
This compiles:
sprintf(outputstring, "data = 5");
This does not:
sprintf(outputstring, "data = %i", 5);
Creator reports an error "Build error: The command 'arm-none-eabi-gcc.exe' failed with exit code '1'."
outputstring is global. Without the %i parameter it not only compiles but it also works just fine. Other types, such as %s, trigger the same error. If I include the %i without supplying an integer I get the correct error that a parameter is missing.
In a fresh project sprintf with parameters works fine just as one would expect.
The only project where I have this problem so far is the 100 Projects in 100 Days, Day009_DynamicBroadcaster.
(I've been trying to debug DynamicBroadcaster because while it broadcasts the data in the advertisement never changes. That's a different issue though)
Any ideas?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Increase your heap size.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The program compiled when I set "Use newlib-nano float formatting" to true. Seems a bit strange...
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Bob! I don't know how you figured this out, you were correct. Setting "Use newlib-nano float formatting" to true in the project's build settings resolved this compile error.
Now I'm able to make some real progress on this project.
Thanks to bobgoar as well. I did try increasing the heap size but it didn't resolve this particular issue for me.