AnsweredAssumed Answered

S12XHY256 - P-Flash Sector erase problem

Question asked by sakthivel G on Aug 10, 2011
Latest reply on Aug 10, 2011 by sakthivel G
HI, I'm facing a problem with flash erasing. But the same SW works fine if I single step or if I check the status with break point. Erase command = 0x0A Erase address = 0x7E0000 Erase length = 0x1E000 Obervation while SIngle stepping: Erase length (0x1E000) is checked periodically and decremented (0x400) sector by sector till the erase length becomes zero. Flash erased successfully from 0x7E0000 to 0x7FE000 Observation with breakpoint in FSTAT status check: Erase length (0x1E000) is checked periodically and decremented (0x400) sector by sector till the erase length becomes zero. Flash erased successfully from 0x7E0000 to 0x7FE000 Observation during Free RUN: Erase length is checked and first sector is erased. FERSTAT has the value 0x03 FECCR has the value 0x7F Then PC is loaded with value 0 and SP hass some junk value SW does not return to normal execution after erasing first sector Please let me know whether similar problem was faced or any solution for this. 1) Why the error flag is getting set? 2) Why the same problem is not observed with breakpoint or single stepping? 3) Will this error flag generate any reset? because of which PC is loaded with 0? 4) Any possible root cause or solution? Please suggest.

Outcomes