I’ve recently finished a project and I’ve run into an issue: I’m almost out of flash space for my binary. It currently uses 99.88% of the allotted 128kb flash.
I’d like to add quite a few more features to my project but at this rate I won’t be able to add much more before I run out of flash.
I’m aware that there are plans to increase flash memory in the futue but it’s not known when this will be complete and it looks like it may come with some performance caveats.
- Why was the decision made to have only 128kb flash? I’m new to hardware and I don’t know how much flash room is an adequate amount but it seems like the 128kb limit has been an issue for myself and a few others on the forum.
- How can I go about reducing the binary size of my program, so that I can keep adding features? Since this is my first program for embedded, I’m not familiar with common design patterns etc. - I’ve used a pretty standard OOP design pattern but I don’t know if that’s correct for a platform like daisy.
- I currently use a few things from
std::array, and some others. Is it adviseable to use these? I imagine it would save some space to use more elementary C functionalities instead. It would sure be a pain in the ass to give up the conveniences that these libraries offer me, though.
- I use the included libDaisy makefile to build my project, just like everything else in daisy-examples does. Are the compiler flags in this makefile optimized? I know that certain compiler flags can be added to reduce binary size.
- Could I use something like UPX to compress the binary?
The source code is here, if you’d like to take a look.
Thank you for your help