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 ?
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.
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.
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