How do I separate Bootloader, Drivers, and Applications Code

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I separate Bootloader, Drivers, and Applications Code

533 Views
ignisuti
Contributor IV

I'd like to make the Bootloader, Hardware Drivers, and Applications Code into 3 seperate projects. The Bootloader and the Application code would both know the location of the Hardware Drivers. 

 

One benefit is that I'm not duplicating driver code by putting it in both locations. The other advantage comes in the form of reduced Application code size. Our product will have the ability to do a firmware update remotely via Satellite, GSM, or CDMA communication. In some of these cases the cost of sending those extra bytes is fairly significant.

 

I'm a noob when it comes to linker issues and don't know where to start. Has anyone done this before and can provide examples or advice on how to set this up? 

0 Kudos
2 Replies

154 Views
Gewehr88
Contributor I

Why do you need to separate bootloader and application in Kinetis? You can take advantage of using program flash memory swap techniques in Kinetis.

 

Please see the application notes AN4533 “Robust Over-the-Air Firmware Updates Using Program FlashMemory Swap on Kinetis

Microcontrollers”

 

Also, if you really want to use bootloader and application structure(in case you want to use flexMemory for something else), one way to do it is to make device drive as separated library, just like MQX, and include it into application and bootloader projects.

 

But since the bootloader and applications are two separated prjects, they will need to have:

1. bootloader + lib (OS +device drive)

2. application + lib (OS +device drive)

 

There is nothing to share between the two.

0 Kudos

154 Views
ignisuti
Contributor IV

My understanding is that my MCU does NOT have the Flex option. Also, I like the traditional method better because it'll make the code more portable to other MCUs.

 

 

0 Kudos