Placing string at a certain address in flash
Posted: Wed Apr 27, 2022 7:46 pm
Hi,
Is it possible to place a const char * at a certain known address in flash, and the use the SPI flash API to erase/write the same address?
My application embeds SSL keys in the flash as const char *, however I need to provide a way for the end user to update the certificates manually. I am thinking of placing a `key.pem` file on the SD card, and then on boot the application can use its contents to overwrite the existing key in the flash.
That will cover the situation where for some reason the certificate is invalid and the device cannot receive OTA with updated certificate.
It would be great to hear other suggestions as well.
Is it possible to place a const char * at a certain known address in flash, and the use the SPI flash API to erase/write the same address?
My application embeds SSL keys in the flash as const char *, however I need to provide a way for the end user to update the certificates manually. I am thinking of placing a `key.pem` file on the SD card, and then on boot the application can use its contents to overwrite the existing key in the flash.
That will cover the situation where for some reason the certificate is invalid and the device cannot receive OTA with updated certificate.
It would be great to hear other suggestions as well.