How to solve "lockup reset" issue when programming or erasing KL26 flash

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

How to solve "lockup reset" issue when programming or erasing KL26 flash

Jump to solution
1,285 Views
yenhsu
Contributor III

Hello,

When I do Program Flash Sector Erase, bit1 (Lockup) in the RCM bloc is set.

Here is my example:

=========

FTFA_FCCOB0 = 0x09;
FTFA_FCCOB1 = 0x01;
FTFA_FCCOB2 = 0xFF;
FTFA_FCCOB3 = 0xF0;

/* All required FCCOBx registers are written, so launch the command */
FTFA_FSTAT = FTFA_FSTAT_CCIF_MASK;

/* Wait for the command to complete */
while(!(FTFA_FSTAT & FTFA_FSTAT_CCIF_MASK));

=========

 

The Lockup Reset always happens when system auto run or I set a breakpoint at the line, "while(!(FTFA_FSTAT & FTFA_FSTAT_CCIF_MASK));". However, it seems to happen less if I set a breakpoint at the line, "FTFA_FSTAT = FTFA_FSTAT_CCIF_MASK;" and then do single step.

Could anyone give me a big favor to teach me how to solve the issue???

Thanks.

Regards,

Chris.

0 Kudos
Reply
1 Solution
960 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Chris,

Sorry for the later reply.

I think you call the Flash operation code located in Flash memory.

Please refer AN4695 to avoid read while write Errors of Flash operation.

The related software AN4695SW could be downloaded at here.

While, I also recommend to download the [TFS Flash Driver Software for Kinetis® and ColdFire+ Microcontrollers(REV 1.04) ] software package, which provide Kinetis product Flash driver and demo.

Wish it helps.


Have a great day,
Ma Hui

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

View solution in original post

0 Kudos
Reply
4 Replies
960 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Chris,

For the KL26 Flash sector size is 1KB, the sector erase address should be 1KB aligned.

pastedImage_2.png

For customer erase sector start address is 0x1FFF0, which is not 1KB aligned.

Please change the sector start address to 0x1FFC0 and try.

Wish it helps.


Have a great day,
Ma Hui

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

0 Kudos
Reply
960 Views
yenhsu
Contributor III

Hi Hui_Ma,

Sorry for late response.

I tried your approach to change the start address but the lockup reset does still happen.

Could you have other ideas to solve the issue please?

Thank you.

Regards,

Chris.

0 Kudos
Reply
961 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Chris,

Sorry for the later reply.

I think you call the Flash operation code located in Flash memory.

Please refer AN4695 to avoid read while write Errors of Flash operation.

The related software AN4695SW could be downloaded at here.

While, I also recommend to download the [TFS Flash Driver Software for Kinetis® and ColdFire+ Microcontrollers(REV 1.04) ] software package, which provide Kinetis product Flash driver and demo.

Wish it helps.


Have a great day,
Ma Hui

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

0 Kudos
Reply
960 Views
yenhsu
Contributor III

Hi Hui Ma,

Got you. I will try to study it.

Thank you for your great help.

Regards,

Chris Chen

0 Kudos
Reply