AnsweredAssumed Answered

Data Flash not holding data after power down?

Question asked by David Sweeney on May 15, 2015
Latest reply on May 19, 2015 by David Sweeney

Hi we use the MC56F8367 DSC in our system, and recently have set about using the data flash to retain user-supplied settings. By using the Codewarrior memory viewer I can see the data in the data flash (address 0x4000) and I have a checksum routine and a validation routine (which reads the flash and compares with the buffer which supplied the data) and both report ok.

At start-up after a power-down the flash data should be restored to the buffer, but this fails. To see the memory requires Codewarrior, and a re-program of the chip which I think resets the flash (at least, when I look at the flash data its back to all 0xFFFF. My Codewarrior settings for the flash are shown below, along with the code to write to flash.


Any ideas?


Thanks in advance!


void ReConfig(void)


    int gs;

    int rv;

    int try;

    volatile long waste;

    unsigned long blocksize;

    unsigned long addrf;

    long csum;


    //reset cpured led now that reconfiguration has happened







    //put data into Factory Data Area



    F.cksbuff = csum;


    //configured, so write it to flash           

    blocksize=(unsigned long)(&F.lastword-&F.memptr)*2;


    for(try=0; try<2; try++)


        addrf=((unsigned long)&F)*2;


        rv=IFsh1_SetGlobalProtection(false);    //unprotect all   


        //waste time   

        for(waste=0; waste<2000000; waste++) ;//do nothing




        //waste time   

        for(waste=0; waste<5000000; waste++) ;//do nothing


        LogErr(0,603,0,0);    //info- Write to flash           






        else break;