I've been using ESP-IDF for quite some time and there is default option to use text file as a version provider. Which is compiled into a code and available at runtime.
- I wish to do the same on STM32, so whenever I change the file content (which is project version string "v0.000") its gonna be compiled into FLASH section that I've created.
version.txt
v0.000
- I wanted to include that file using symbols but I just dont know how to...
- All Iam getting is the PATH to file. Maybe there is a way to use that path, to read from file at this point?
- For now I am convering string into a word (uint32) and specify that in my main.c
main.c
const uint32_t version[] __attribute__((section(".version"))) = {
0xC0FEBABE, 0x76302E30, 0x30300000
};
FLASH
.version :
{
KEEP(*(.version))
} >FLASH