2 separate programs on one processor (Bootloader- and Applicationcode) flashed with Open SDA.

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

2 separate programs on one processor (Bootloader- and Applicationcode) flashed with Open SDA.

Jump to solution
2,202 Views
edwardkäding
Contributor III

Dear Freescale Community,

I apologize in advance if this question has been answered somewhere else before.

For my small 32kB Kinetis L processor, I have programed a Bootloader using the Tutorial from "Erich Styger" ( Serial Bootloader for the Freedom Board with Processor Expert ).

Everything works great and have already tested it with various Applicationcodes. The only problem is that I have to flash the Bootloader program first, using Code Warrior 10.3 with the Open SDA connection, and then use the Bootloader

functionallity to flash the Applicationcode to the processor. And this takes ages with bigger codes.

Here is my question:

Is it possible to flash both Bootloader- and Applicationcode, using Code Warrior 10.3 with the Open SDA or MultiLink connection, and then have the Applicationcode running normal after reset?

How and which Settings have to be done to accomplish this? At the moment this does not work and I can not figure out how to set this up.

Here are my Memory Settings:

MEMORY { (Bootloader)

  m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x000000C0

  m_text      (RX) : ORIGIN = 0x00000410, LENGTH = 0x00003BF0     -> Protected

  m_data      (RW) : ORIGIN = 0x1FFFFC00, LENGTH = 0x00001000

  m_cfmprotrom  (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010

}

MEMORY { (Application)

  m_interrupts (RX) : ORIGIN = 0x00004000, LENGTH = 0x000000C0

  m_text      (RX) : ORIGIN = 0x000040C0, LENGTH = 0x00003F3F

  m_data      (RW) : ORIGIN = 0x1FFFFC00, LENGTH = 0x00001000

  m_cfmprotrom  (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010

}

I hope for good advices and thank each and everyone in advance,

Edward.

Labels (1)
1 Solution
1,711 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Edward:

Here are some options to achieve this:

1) Use target tasks: Target tasks allow you to decide which sectors of flash memory you want to erase. So you first download the bootloader and then your application without erasing the bootloader memory segments. For your reference I attached a document developed by some colleagues, and there is also a video by colleague Derek Snell in the next link:

CW10 Target Task for specifying sectors to erase - YouTube

2) Indicate your connection to preserve bootloader memory range. Again you download first the bootloader then the application. For a clear tutorial on this by Erich Styger check his blog:

Programming part of flash | MCU on Eclipse

3) Merge both S-Record files (Bootloader + Application) in one and then use CodeWarrior simple Flash programmer. There is a merge tool provided with AN2295SW software package.

There are more options to do this, such as modifying linker file of one of the projects to include the binary file from the other, but I think these approaches are easier.

I hope this information helps.


Regards!,
Jorge Gonzalez

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

3 Replies
1,711 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Edward,

I think you may build the application code into a bin file, and then use the INCLUDE keyword to merge the bin file into bootloader's image, by modify the link file for boot loader as below:

3.png

please kindly refer to D:\CW MCU v10.6\MCU\Help\PDF\MCU_Kinetis_Compiler.pdf for more details.


Hope that helps,

Have a great day,
Kan

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,712 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Edward:

Here are some options to achieve this:

1) Use target tasks: Target tasks allow you to decide which sectors of flash memory you want to erase. So you first download the bootloader and then your application without erasing the bootloader memory segments. For your reference I attached a document developed by some colleagues, and there is also a video by colleague Derek Snell in the next link:

CW10 Target Task for specifying sectors to erase - YouTube

2) Indicate your connection to preserve bootloader memory range. Again you download first the bootloader then the application. For a clear tutorial on this by Erich Styger check his blog:

Programming part of flash | MCU on Eclipse

3) Merge both S-Record files (Bootloader + Application) in one and then use CodeWarrior simple Flash programmer. There is a merge tool provided with AN2295SW software package.

There are more options to do this, such as modifying linker file of one of the projects to include the binary file from the other, but I think these approaches are easier.

I hope this information helps.


Regards!,
Jorge Gonzalez

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,711 Views
edwardkäding
Contributor III

Hello Jorge and Kan,

Thank you both very much for your quick and great responses.

For a short term solution I used the second solution by Jorge, but I am sure that Kans solution will also work.

I thank you both yet again for your help.

I hope you both have a great day.

Edward.