Writing to Flash memory kills MCU

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

Writing to Flash memory kills MCU

跳至解决方案
1,825 次查看
sm0khey
Contributor III

Hello! I am trying to save a variable, which a user input, to the flash memory. I am using MC56F82... and the IFsh1 library. I disable the events and then erase the block and then write to the flash, but my MCU keeps dying, i have to restart it and flash it again to get it working. Any ideas on how to do it correctly?

标记 (3)
0 项奖励
回复
1 解答
1,765 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

This is the flash example code based on CodeWarrior for DSP56800E ver8.x.

Pls refer to it.

Regarding your question, the flash erasing/programming code must be located in flash and copied to p RAM, you have to run the erasing/programming code in  RAM to manipulate the flash.

Hope it can help you

BR

XiangJun Rong

在原帖中查看解决方案

4 回复数
1,766 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

This is the flash example code based on CodeWarrior for DSP56800E ver8.x.

Pls refer to it.

Regarding your question, the flash erasing/programming code must be located in flash and copied to p RAM, you have to run the erasing/programming code in  RAM to manipulate the flash.

Hope it can help you

BR

XiangJun Rong

1,761 次查看
sm0khey
Contributor III

Thank you for the help!

0 项奖励
回复
1,764 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I attach the code here.

BR

XiangJun Rong

 

0 项奖励
回复
1,790 次查看
sm0khey
Contributor III

up

0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-1883457%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%86%99%E5%85%A5%E9%97%AA%E5%AD%98%E4%BC%9A%E6%9D%80%E6%AD%BB%20MCU%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1883457%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%EF%BC%81%E6%88%91%E6%AD%A3%E5%9C%A8%E5%B0%9D%E8%AF%95%E5%B0%86%E7%94%A8%E6%88%B7%E8%BE%93%E5%85%A5%E7%9A%84%E5%8F%98%E9%87%8F%E4%BF%9D%E5%AD%98%E5%88%B0%E9%97%AA%E5%AD%98%E4%B8%AD%E3%80%82%E6%88%91%E6%AD%A3%E5%9C%A8%E4%BD%BF%E7%94%A8%20MC56F82...%20%E5%92%8C%20IFsh1%20%E5%BA%93%E3%80%82%E6%88%91%E7%A6%81%E7%94%A8%E4%BA%8B%E4%BB%B6%EF%BC%8C%E7%84%B6%E5%90%8E%E6%93%A6%E9%99%A4%E5%9D%97%EF%BC%8C%E7%84%B6%E5%90%8E%E5%86%99%E5%85%A5%E9%97%AA%E5%AD%98%EF%BC%8C%E4%BD%86%E6%88%91%E7%9A%84%20MCU%20%E4%B8%8D%E6%96%AD%E6%AD%BB%E4%BA%A1%EF%BC%8C%E6%88%91%E5%BF%85%E9%A1%BB%E9%87%8D%E6%96%B0%E5%90%AF%E5%8A%A8%E5%AE%83%E5%B9%B6%E5%86%8D%E6%AC%A1%E5%88%B7%E6%96%B0%E6%89%8D%E8%83%BD%E4%BD%BF%E5%85%B6%E5%B7%A5%E4%BD%9C%E3%80%82%E5%85%B3%E4%BA%8E%E5%A6%82%E4%BD%95%E6%AD%A3%E7%A1%AE%E6%89%A7%E8%A1%8C%E6%AD%A4%E6%93%8D%E4%BD%9C%EF%BC%8C%E6%82%A8%E6%9C%89%E4%BB%80%E4%B9%88%E6%83%B3%E6%B3%95%E5%90%97%EF%BC%9F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1885089%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E5%86%99%E5%85%A5%E9%97%AA%E5%AD%98%E4%BC%9A%E6%9D%80%E6%AD%BB%20MCU%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1885089%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E8%B0%A2%E8%B0%A2%E4%BD%A0%E7%9A%84%E5%B8%AE%E5%8A%A9%EF%BC%81%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1884181%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E5%86%99%E5%85%A5%E9%97%AA%E5%AD%98%E4%BC%9A%E6%9D%80%E6%AD%BB%20MCU%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1884181%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Eup%3C%2FP%3E%3C%2FLINGO-BODY%3E