0
votes

I have some functioning firmware that I am deploying to an STM32 part with 64K of Flash memory (starting at address 0x8000000). I want to use some amount of this memory towards the end of the flash memory space to store a gzipped file on the STM32 part itself.

What is the best way to write this file to a location in the flash with openOCD? Should I somehow bundle it into the firmware ELF? Should I flash firmware and then follow that up with another flash command to write the file to a specific portion of the flash space?

Once written how do i use openOCD to pull the file from this location and get it back in a format that gzip can uncompress?

1

1 Answers

1
votes

For the first question, there is this thread discussing how to embed some resources in an executable.

It would be probably easier to directly load the binary with openOCD in a command line.

For the second question, you will have direct access to the binary content of your file in Flash. The tricky point is that you have to implement an unzipper to uncompress it. There are probably plenty of source code to do so, but perhaps you may want to evaluate if this is the best solution: you would save memory by storing a zipped file but you would "waste" some for the code to unzip it ?