This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2642R-Q1: OAD project erasing the external flash data

Part Number: CC2642R-Q1

Hi all,

      I have been working on simple peripheral off-chip OAD project. All the functionalities are working fine but I am facing following issue.

  • Some fixed portion of external flash data are erasing while I am rebooting the device.
  • By debugging, I am found out that erased flash data portion is at the end of 1MB and erased flash data size is exactly the size of my BIN file
  • By analyzing, I am found out that OAD project is storing backup image at the end of the flash
  • Since, I am using 16MB flash, I changed the factory image storage address at the end of the 16Mb flash
  • But still sometimes, my external flash data stored at the end of 1MB are erased while rebooting the device

Is there any condition available in OAD project which erases the end of the 1MB in flash?

Note: Flash IC part.NO:GD25Q128EWIGR

Regards,

Aslam 

  • Hi Mohamed,

    One point of clarification is that the device you are using appears to be 128 Mb (Megabits) and thus truly 16 MB (Megabytes).  The examples expect the MX25R8035F which is 1 MB (8 Mbit) and thus a sixteenth the size of the part you are now using.  Have you accounted for such in flashInfo of ext_flash.c of your BIM project?  Since the data is erased after rebooting I assume that the BIM is involved in calling extFlashErase which may mean FLASH_DEVICE_ERASE is defined.  Otherwise you should debug the simple peripheral project to determine whether oadEraseExtFlashPages is used, which could occur during oadCreateFactoryImageBackup if oadCheckFactoryImage returns false, which it may if you have not already stored a factory image on your external flash device.  The External Flash Memory Layout expects to store the factory image on the top part of the external flash memory which may be what you've observed.  You should also check EFL_FLASH_SIZE from flash_interface.h and make sure it matches your expectations.

    Regards,
    Ryan

  • Hi Ryan,

           Thanks for the reply.

    Have you accounted for such in flashInfo of ext_flash.c of your BIM project?

         Yes, I have added GD25Q128EWIGR flash information in ExtFlashInfo_t structure of the BIM project.

    Since the data is erased after rebooting I assume that the BIM is involved in calling extFlashErase which may mean FLASH_DEVICE_ERASE is defined

        FLASH_DEVICE_ERASE is not defined in my BIM project

    You should also check EFL_FLASH_SIZE from flash_interface.h and make sure it matches your expectations.

        EFL_FLASH_SIZE changed from 0x100000(1MB) to 0x1000000(16MB).

    But still sometimes, my external flash data stored at the end of 1MB are erased while rebooting the device

    Regard,

    Aslam

  • Does your simple_peripheral project have OAD_DEBUG defined?  This would allow for the ability to erase sections of external flash for the User Interface.  Are you aware of what conditions cause the erasure to occur, and are you able to further debug it?  It would be optimal to pause within oadEraseExtFlashPages to review the call stack.  The OAD_open function will attempt to create a factory image on the external flash (by copying the internal image) if one is not already available.

    Regards,
    Ryan

  • Does your simple_peripheral project have OAD_DEBUG defined?

      OAD_DEBUG not defined

    Are you aware of what conditions cause the erasure to occur, and are you able to further debug it?

       erasure happens only while rebooting and it is difficult to debug since erasure happens sometimes only

    It would be optimal to pause within oadEraseExtFlashPages to review the call stack

       Will try and let you know.

    Regards,

    Aslam