Kinetis Flash Tool with an Update image failure (cumulative write)

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

Kinetis Flash Tool with an Update image failure (cumulative write)

Jump to solution
5,232 Views
JulianS
Contributor II

Hi all,

I successfully ported the KBOOT V2 from the TWR-MKV58F22 Bootloader to my MKV58F1M0VLL24 MCU on a custom board (Using KDS V3.2). Neraly everything is working as expected, except a strange update-behaviour with the KinetisFlashTool.

Updating my application binary to the target address sometimes succeeds and sometimes fails with the kStatusMemoryCumulativeWrite errormessage. I observerd this behaviour especially then, when there is already an application binary on the target flash, which I am going to erase and replace with my new application (in my example, the new application binary is the same binary as the one already placed on the flash... I just want to test everything to avoid later upcoming bugs, so the content of my binary shouldn't be of interest). When the error message occurs, I try to erase the whole flash memory in order to prevent cumulative memory writing as mentioned in the MCU's reference manual. Since now, every time I erased the whole memory, the KinetisFlashTool just responded with "Erase all memory of internal flash. Completed!", so I expected the erasing to be successful.

Nevertheless after trying to Update my "new" application binary to the "freshly erased flash memory", the same cumulative write error occurs. The only workaround for this problem is to reset the device via the KinetisFlashTool followed by normally clicking the Update Button...

After this procedure, when I reset the device, connect to KinetisFlashTool and try to Update the application binary again, the already mentioned error occurs again. And again, erasing the whole flash memory doesn't help at all.

Since I didn't found any similar question about this, I am wondering if I am missing any important step while updating my application binaries?

I would really appreciate some help to understand what is going wrong with the updating procedure on my MCU...

 

With kind regards,

Julian

Labels (1)
Tags (2)
0 Kudos
Reply
1 Solution
4,098 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Julian Schork,

    That's really very good to hear it works on your side.

    I get the solutions from the KBOOT2.0 owner, and I have been told that kboot2.0 don't support the cache now, so customer need to disable the cache, otherwise, it will cause the problem which you are meeting.

    You just need to comment it!


Have a great day,
Kerry

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

View solution in original post

0 Kudos
Reply
29 Replies
526 Views
JulianS
Contributor II

Hello Kerry,

I just compared the startup file from my MCU (system_MKV58F24.c) with the startup file contained in the TWR-Bootloader I used as a reference for the porting (system_MKV58F22.c) and saw that this is exactly the difference between the two bootloaders. In system_MKV58F22.c the cache part is missing...

This was some awesome support an I am very thankful for your effort!

With kinds regards,

Julian

0 Kudos
Reply
526 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hello Julian,

    Thank you very much for your effort.

    And I got the result, it is really very strange, about this question, I need to contact with our KDS engineer.

   Any updated information, will let you know! Please keep patient, thank you!

   By the way, do you meet this problem in the TWR-KV58 on your side?

   This is my KDS version information, could you also provide yours?

pastedImage_1.png

Best Regards,

Have a great day,
Kerry

 

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

0 Kudos
Reply
539 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hello Julian,

   Really so sorry for my later reply because of overloaded before.

   Your question, I need to contact with our according department, so I still need time to give you feedback.

  I will work on it ASAP, please wait patiently, thank you.


Have a great day,
Kerry

0 Kudos
Reply
539 Views
JulianS
Contributor II

Hello Kerry,

I would like to let you know that I tested an other custom board with the MKV58F1M0VLL24 MCU and the ported bootloader. The flashing-problem occured on the second board with the second MCU as well, so it doesn't seem to be an individual case...

Do you have any news for me so far?

With kind regards,

Julian Schork

0 Kudos
Reply
539 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Julian,

    Thank you for your updated information, I think there still have some problem in the software, not the hardware.

   Now, after discuss this question to my colleagues, could you help to do these test?

1. KDS memory checking, not variable

The following picture is the debug result from your side:

pastedImage_1.png

Just like this:

pastedImage_2.png

The same debug position in your picture, check memory, just to make sure the 0X1000F000 is 0XFF or not? Our IDE department also need this data.

2. Please try to use the blhost to download the application code

You can find blhost in folder:NXP_Kinetis_Bootloader_2_0_0\bin\Tools\blhost\win

You can refer to document: Kinetis Bootloader Demo Application User's Guide.pdf, page 7, chapter 4 The host utility application.

This document can be found in :NXP_Kinetis_Bootloader_2_0_0\doc

If you use this step by step downloading, whether you have the same question?

Because I don't have the MKV58F1M0VLL24 board, I can't test it directly on my side.


Have a great day,
Kerry

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

0 Kudos
Reply
539 Views
JulianS
Contributor II

Hello Kerry Zhou,

here is my bootloader porting...

Thanks again very much for your support!

With kind regards,

Julian Schork

0 Kudos
Reply
539 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Julian Schork,

    Thank you for your details!

   You said: "Again I would like to mention, that this error doesn't occur after resetting the device and connect it again... Only if I update the binary, connect again to the bootloader and try to update again, the error occurs until I again restart the device."

  Do you mean, you already download an app before, then connect it again, and try to download the new app, it will have problem?

   After you download the app, do you try to power off the board, then power on it again, then connect to the kinetisflash Tool, whether this situation have problem?


Have a great day,
Kerry

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

0 Kudos
Reply
539 Views
JulianS
Contributor II

Hello Kerry Zhou,

I want to make an other addition:

when I try to update my application and the update fails with the cumulative write error, I can't access my application again (which is what I expect, because it should be erased)... so it should all depend on this strange behaviour of the asm code.

With kinds regards,

Julian Schork

0 Kudos
Reply
539 Views
JulianS
Contributor II

Hello Kerry Zhou,

you are right. I download the app and after that run the bootloader again and download the app.

Powering on and off also doesn't change anything. If I restart the device then, the error is gone until I repeat the steps.

With kind regards,

Julian Schork

0 Kudos
Reply