K22 Flashloader

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

K22 Flashloader

1,007 Views
gcarlson
Contributor II

My customer and I are working with the K22 Flashloader,


1.) What could cause the flashloader/flashtool to erase itself upon an application flash?

2.) Are there ways to verify the flash after an update to see if the bootloader is still present?
3.) What could cause the bootloader to automatically jump to application code without a jump to application command?

We are using the flashloader example with slight modifications which set up a few GPIOs for buttons, but don't think these are impacting it's operation.

Gordy Carlson

0 Kudos
3 Replies

583 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hello Gordy Carlson,

 

1.) What could cause the flashloader/flashtool to erase itself upon an application flash?

== If your application code have the code function which will erase the bootloader flash address.  Actually, it still determined by your code function.

2.) Are there ways to verify the flash after an update to see if the bootloader is still present?

== You can read the botloader flash area.

 Actually, if you are afraid of miss erase of the flash bootloader, you can use the K22 flash protection function to protect the flash bootloader area.

 More details, please read the reference manual, flash protection chapter.
3.) What could cause the bootloader to automatically jump to application code without a jump to application command?

 == It is determined by your flash bootloader code. If the application flash area is valid, after reset, the bootloader code is timeout, it will jump to the application area.

Wish it helps you!


Have a great day,
Kerry

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

0 Kudos

583 Views
gcarlson
Contributor II

Thanks Kerry,

We will  implement the flash protection.

Some additional comments...

1.) There's no function in our application code to erase the flash address.  Itt is still a mystery why it does, perhaps implementing the flash protection will help.

2.) Do you have a recommendation on how to read the bootloader flash area?

3.) In the example bootloader code that I used I commented out all the jump to application code so it should stick in bootloader. But, it still goes to the application.  Still trying to figure out why this happens, doesn't follow generation common sense for how the bootloader should work.

Gordy

0 Kudos

583 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hello Gordy Carlson,

    Thank you for your updated information.

1.) There's no function in our application code to erase the flash address.  Itt is still a mystery why it does, perhaps implementing the flash protection will help.

 == Maybe the poor working condition may caused this problem, for example, the EMI is very larger.

     Actually, in the application, customer normally will protect the bootloader area, just to make sure the bootloader code won't be erased or wrote.

   So, still as what I am recommend you, to protect the flash bootloader area.

2.) Do you have a recommendation on how to read the bootloader flash area?

 == Read? Just read the flash address is OK, very simple! Use code, or JLINK command, take an example: mem 0x40c,0x10

  0X40C is the flash address you want to read, 0X10 is the length you want to get from 0X40C.

3.) In the example bootloader code that I used I commented out all the jump to application code so it should stick in bootloader. But, it still goes to the application.  Still trying to figure out why this happens, doesn't follow generation common sense for how the bootloader should work.

== It may check the application code area, if the application code area, which you want to jump is not null(0xff),it will do the jumping.

   So, you can try to erase all the chip, then download the flashloader, and try again, whether it can jump to the application area again?

Any question, just let me know!


Have a great day,
Kerry

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

0 Kudos