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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
1,289 次查看
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 项奖励
回复
1 解答
964 次查看
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 项奖励
回复
4 回复数
964 次查看
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 项奖励
回复
964 次查看
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 项奖励
回复
965 次查看
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 项奖励
回复
964 次查看
yenhsu
Contributor III

Hi Hui Ma,

Got you. I will try to study it.

Thank you for your great help.

Regards,

Chris Chen

0 项奖励
回复