Creating backup image

I’ve had a quick go at creating a backup image with basic web access (wired network port) using HTTP/FTP to allow update of a corrupted main image. Using AWS for the web side.

The ‘easy’ size reductions have yielded a compressed image of just under 700K - rather too big to fit in the 450K or so which is available on my ME.

Has anyone any idea whether I should be able to reduce the image so that it will fit, and if so, where to look for things to throw out?

Try changing your optimization to -Os under the project properties -> c/c++ builds -> optimization. Also make sure you’re using a release build.

Thanks for the suggestion - unfortunately -Os only reduced the size by a few kilobytes!

I’ll try and have a better look next week

One thing to also keep in mind is that the included libraries only include the code they need. So the size of the image will be dependant on the size of the code in your project. Also, if you have any large arrays (char myarray[8000];), those can be included as part of the image, so I’d recommend instead using pointers and malloc’ing the space. Finally, a 700k image is actually pretty small, you can try taking out the AWS and see if that helps any.

Thanks for the pointers - unfortunately taking out AWS isn’t an option.

Possibly wanting a backup image that will fit into a 2M flash part is optimistic