Firmware update using a custom bootloader

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Firmware update using a custom bootloader

884 Views
gauravbanyal
Contributor IV

Dear kinetis support,

 

I am using a MKL03Z32 micro-controller and I have a need to write a custom booloader to enable fimware-over-the-air updates to the application code. In my schematics I have only the MKL03Z32 and to its I2C interface I have 2 slave devices, none of them are microcontrollers. When I read through the description of the Kinetis ROM Bootloader that comes with the devices, I understand that I can use it only with another on-board host processor or PC using the MKL03Z as a slave device and connecting to one of its buses I2C/UART/SPI. So in my case I cannot use it. Please confirm if my understanding is correct.

 

The use-case I have is that I can send the FW image to the MKL03 via the on-board NTAG I2C chip. I just need to write a new application that sits on the flash memory in a defined area (separate from the application code) which has a specific flash area used to store the FW image it receives via the NTAG I2C chip (typically sent by a NFC enabled phone app) and overwrites the application area with the received FW image. I am using Keil MDK5 IDE for my work.

 

I need help on the following things:

1. How to modify the scatter file to define separate areas for application, bootloader and the area the bootloader needs to store the incoming FW image file (I don't have an external memory on the board attached to the microcontroller).  I want the boot-up to always run the bootloader code and based on certain conditions, bootloader code may either continue with its stuff or jump to application code area.

I have attached the linker script that my project is using. Please modify it and send me two versions back. One for the bootloader code (default entry point after a reset) and one for the application code (only executed when control jumps from bootloader to application).

 

2. The instructions to write the new FW image to the application area in the flash.

3. Jump the execution to the application area after a successful flashing.

 

Please help me on priority on this one.

 

Many thanks,

Gaurav.

Original Attachment has been moved to: MKL03Z32xxx4_flash.scf.zip

Tags (1)
0 Kudos
0 Replies