MPC5746C Flash erase question

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

MPC5746C Flash erase question

423 Views
kimdukyu
Contributor II

Hi.

 

0x01140000 Attempting to erase flash memory. I programmed it like this:

==============================================================================

blockSelect.lowBlockSelect = 0x0U;
blockSelect.midBlockSelect = 0x000U;
blockSelect.highBlockSelect = 0x0U;
blockSelect.first256KBlockSelect = 0x20U; //0x01140000
blockSelect.second256KBlockSelect = 0x0U;
g_usrCnt = 0U;

ret = FLASH_DRV_Erase(ERS_OPT_MAIN_SPACE, &blockSelect);

if (STATUS_SUCCESS == ret)
{
    do
    {
      /* The user can do any tasks while check status function is still in progress */
      UserCallBack();
      ret = FLASH_DRV_CheckEraseStatus(&opResult);
    } while (ret == STATUS_FLASH_INPROGRESS);
}

if (STATUS_SUCCESS != ret)
{
    printf("Failed flash erase.\n\r");
    return ret;
}

dest = 0x01140000;
size = 0x0117FFFF + 1 - 0x01140000;
numOfWordCycle = NUMBER_OF_WORD_BLANK_CHECK;

/* Blank check */
ret = FLASH_DRV_BlankCheck(dest, size, numOfWordCycle, &failedAddress, NULL_CALLBACK);
if (STATUS_SUCCESS != ret)
{
    printf("Failed flash blank check.\n\r");
    return ret;
}

==============================================================================

But when I run the program it doesn't work properly. An error occurs in the FLASH_DRV_BlankCheck() function. How do I clear the 0x01140000 flash memory address?

 

Thank you

0 Kudos
Reply
0 Replies