cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L432KC - Bootloading from RFID I2C Memory?

XBLYNKZ
Associate II

Hi all,

I develop rough environment IoT sensors that are completely potted in polymer epoxies. I use a STM32L432KC MCU inside to drive different sensors and RF radios. My sensors also integrate I2C RFID memories and magnetic switches in order to interact from the outside since there is no buttons or physical connections possible.

Would it be possible to write the bootloading routine routine of the MCU so that it reads its program from the RFID Memory through I2C? I could boot the device in bootloader mode using external magnets. The sensors do not have BLE interfaces for easy OTA DFU.

Thanks,

Xavier

5 REPLIES 5

You could presumably write your own loader to do anything you want with the hardware you have attached to it.

You have I2C RFID routines now to read memories, use those to read and then write into the internal flash.

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

That looks like it could work. How do I write my own loader? I know ST pre-programs the native bootloader in factory and that it cannot be modified. I guess I would have to use memory partitions to dedicate some as the bootloader? I am more used to Cypress PSoC where I can easily add a bootloader with custom code in it, but I cant seem to find how to do it on STM32. Have someone ever done it before?

>>Have someone ever done it before?

Loaders? I'm not sure the STM32 is materially different from any other MCU or Cortex-M part.

You just sub-divide the FLASH and create multiple instances of code using each.

ST has examples for IAP (In Application Programming), there are examples for programming FLASH.

The built in boot-loader has limited utility, It is not capable of dealing with custom hardware unique to your design. It is designed to be simple, with minimal expectations. ie a serial port, or USB.

Pick a memory which can hold your application image, and for which you already have functional interface methods. Have a protocol that is robust , checks integrity, and provides means of recovery.

Figure you might need 16KB or so for your loader, the balance of flash can be used for you app or to hold app and second copy

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

All right, thanks that is what I wanted to hear. I will do more research on that and try to sub-divide the flash as you pointed out.

The CM4 will allow you to relocate the vector table to any 512-byte boundary, use SCB->VTOR

Code in SystemInit() could be more helpful (ie use a symbol visible to the linker), but you can set a define there, and change the memory map in the GUI, or linker script or scatter file, depending on the tool chain.

ARM has TRM for the cores, ST has a Programming Manual, Joseph Yiu has some perspective on those in his books.

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