Kinetis K boot loader code optimization/minimization

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

Kinetis K boot loader code optimization/minimization

430 Views
paulschoenke
Contributor III

Hello:

For a new project, I’m looking to use the Kinetis MK02FN64VLF10.  If we need more memory or a smaller footprint for the project we will be going to the MK22FN128VMP10.

I will not be doing the firmware for this project, however I've been tasked with getting the boot loader code needed for this micro.

Are there any code snippets and associated application notes / descriptions for protecting the flash memory that contains the boot loader?

Also, since we plan on using UART1 for programming, we would like to know what code can be removed from the boot loader code that's not being used, such as the code for programming with the IC2, and SPI bus. The amount of flash memory is limited on this device and we’re trying to optimize the code density with the flash size.

Any feedback or input is welcomed and appreciated.

Thanks again!

Paul

Labels (1)
0 Kudos
1 Reply

292 Views
mjbcswitzerland
Specialist V

Hi

For low memory footprint KBOOT, Developer's loader (AN2295), UART SREC/IHEX loaders for your parts you can see also

http://www.utasker.com/docs/uTasker/uTaskerSerialLoader.PDF

This will avoid you needing to port or rework code and solves your boot sector protection with a single define:

#define KINETIS_FLASH_CONFIGURATION_PROGRAM_PROTECTION (0xffffffff)  // PROT[24:31]:PROT[23:16]:PROT[15:8]:PROT[7:0] - no protection when all are '1'

#define KINETIS_FLASH_CONFIGURATION_PROGRAM_PROTECTION (0xffffffe) for example protects the lowest sector (setting each subsequent bit to 0 protects further sectors).

Works with KDS, CW, IAR, Keil, Rowley Crossworks, Atollic, Green Hills, Coo Cox, GCC and VS.

Kboot UART mode is about 6k (depending on compiler) without any further configuring/optiisation work required. See http://www.utasker.com/kinetis.html for reference binaries available for most boards.

Regards

Mark

0 Kudos