Writing to Flash memory kills MCU

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

Writing to Flash memory kills MCU

Jump to solution
1,822 Views
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?

Tags (3)
0 Kudos
Reply
1 Solution
1,762 Views
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

View solution in original post

4 Replies
1,763 Views
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,758 Views
sm0khey
Contributor III

Thank you for the help!

0 Kudos
Reply
1,761 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I attach the code here.

BR

XiangJun Rong

 

0 Kudos
Reply
1,787 Views
sm0khey
Contributor III

up

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-1883457%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EWriting%20to%20Flash%20memory%20kills%20MCU%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1883457%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello!%20I%20am%20trying%20to%20save%20a%20variable%2C%20which%20a%20user%20input%2C%20to%20the%20flash%20memory.%20I%20am%20using%20MC56F82...%20and%20the%20IFsh1%20library.%20I%20disable%20the%20events%20and%20then%20erase%20the%20block%20and%20then%20write%20to%20the%20flash%2C%20but%20my%20MCU%20keeps%20dying%2C%20i%20have%20to%20restart%20it%20and%20flash%20it%20again%20to%20get%20it%20working.%20Any%20ideas%20on%20how%20to%20do%20it%20correctly%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1885089%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Writing%20to%20Flash%20memory%20kills%20MCU%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1885089%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThank%20you%20for%20the%20help!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1885063%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Writing%20to%20Flash%20memory%20kills%20MCU%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1885063%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3EI%20attach%20the%20code%20here.%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EXiangJun%20Rong%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1885059%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Writing%20to%20Flash%20memory%20kills%20MCU%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1885059%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3EThis%20is%20the%20flash%20example%20code%20based%20on%20CodeWarrior%20for%20DSP56800E%20ver8.x.%3C%2FP%3E%0A%3CP%3EPls%20refer%20to%20it.%3C%2FP%3E%0A%3CP%3ERegarding%20your%20question%2C%20the%20flash%20erasing%2Fprogramming%20code%20must%20be%20located%20in%20flash%20and%20copied%20to%20p%20RAM%2C%20you%20have%20to%20run%20the%20erasing%2Fprogramming%20code%20in%26nbsp%3B%20RAM%20to%20manipulate%20the%20flash.%3C%2FP%3E%0A%3CP%3EHope%20it%20can%20help%20you%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EXiangJun%20Rong%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1884181%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Writing%20to%20Flash%20memory%20kills%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