How to save the firmware file to the header file (.h)

I have a firmware file (.raw) that needs to be written to a sequential flash. One way is to create a header file from it, i.e. A string array with the contents of the file, and then in the code read this buffer and write it to a sequential flash.

In linux, we have any tool / command to create a header file with the correct formatting. I find it difficult to do it manually. The size of the source file is about 5 MB.

+4
source share
1 answer

On linux, you can use the xxd command for this function.

Usage: xxd -i fname> abc.h

.

+4

All Articles