cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 application split up

timothy0508
Associate II

I'm working on an STM32L432KCU microcontroller. I want to develop two applications on the same MCU:

  • An "OTA" app. This would load first. It uses a cellular modem to check for, and download firmware updates, and overwrite the existing application. Otherwise, it loads the main application if no update is available.
  • The main application.

I also need to reserve a region of the flash that will store the device's serial number and encryption keys, and I need this region to be protected, so that I only write these values once, and they cannot be changed, ever.

Question:

  • How would you go about assessing where in memory to place the two applications, as well as the dedicated region for data?
  • How would you merge the two applications into a single hex/bin file?

1 REPLY 1

There should be 1KB of OTP in the L432, at 0x1FFF7000 thru 0x1FFF73FF

Would depend on the size of each component. If you can make the loader smaller, the application can be larger.

For a .HEX file you could use a text editor and merge the records, skipping the end record of the first file. You could automate, or process the file with fopen(), fread(), fwrite() type of interactions, the .HEX file format is not particularly complicated. For a binary you could allocate the whole 256 KB space, and fopen(), fread() the into the respective parts of the memory space, and then write out a singular file.

https://www.st.com/resource/en/reference_manual/dm00151940-stm32l41xxx42xxx43xxx44xxx45xxx46xxx-advanced-armbased-32bit-mcus-stmicroelectronics.pdf

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..