Boot loader and fixing function in a specific memory location

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

Boot loader and fixing function in a specific memory location

2,715 Views
kinetis_user
Contributor II

I am trying to write a simple flash boot loader , that will get the s19 file from a PC using a serial connection (such as UART) , without using any RTOS at the moment , has anyone tried this and have some example (even if preliminary code) to shae ?

What are the compiler directives to tell the linker to put specific functions such as the thumb_startup code, init_hardware code and main() in a specific memory location ?

How do I write to a specific flash location ?

Thank you.

 

0 Kudos
Reply
6 Replies

2,044 Views
alex_br
Contributor I

What compiler are you using? 

0 Kudos
Reply

2,044 Views
kinetis_user
Contributor II

I am using CW10.1 and the arm compiler that is shipped with it

0 Kudos
Reply

2,044 Views
alex_br
Contributor I

I can help you with IAR compiler. I would recomend to contact Freescale support regarding the CW 10.1. They will respond within 48 hours.

0 Kudos
Reply

2,044 Views
d_shah
Contributor II

Hi,

 

I had tried this on NXP processor but not on freescale but the basic concepts remains the same, you can find plenty of Application notes with source code to get started.

 

The compiler directives will depend on the type of compiler you are using, if its IAR you will have to modify linker configuratin file and in case of Keil you will have to go to target options. Basically you will have to partition your flash memroy one for bootloader and other for application.

 

After you have done this, the linker will take care of locating your code at specific location in memory.

 

d2v0

0 Kudos
Reply

2,044 Views
Briwallis
Contributor I

I am also writing a bootloader for the Kinetis with MQX RTOS.  I am referencing the FNET and MQX Rev 1.3 document that I found on another thread. It was written quite a while ago and for a different processor but has some relevant information.

 

I was wondering if there is additional documentation that I can reference regarding this task.

0 Kudos
Reply

2,044 Views
mjbcswitzerland
Specialist V

Hi

 

The uTasker project includes serial, USB and Ethernet loading - see www.uTasker.com for all code and boot loader documentation (the Kinetis development guide is at http://www.utasker.com/docs/KINETIS/uTaskerV1.4_Kinetis_demo.pdf

).

 

It also supports encrypted loading, intermediate storage in SPI Flash devices (which is quite a popular method) and, although there is presently no pre-built configuration to do it, includes also the methods to boot load from SD cards. To simplify and accelerate developments the project includes a Kinetis simulator to allow testing all operations. As reference, the following forum post includes details of debugging boot loaders in the simulator: http://www.utasker.com/forum/index.php?topic=902.0

 

Regards

 

Mark

 

 

0 Kudos
Reply