TraveoII CYT2B97CA WorkFlash

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
yuejin
Level 1
Level 1
First reply posted First question asked Welcome!

Hi!

I have a  problem。

In M4 Core ,I use Cy_Flash_BlankCheck to check the address,the function return CY_FLASH_DRV_FLASH_NOT_ERASED。But I read the address,it will go the hardfault。

code:

uint32_t  ReadWFlashU32 (uint32_t add)

{

    uint32_t ret;

    cy_stc_flash_blankcheck_config_t blankCheckConfig;

   blankCheckConfig.addrToBeChecked = (uint32_t*)add;
   blankCheckConfig.numOfWordsToBeChecked = 0x1u;

   if ( CY_FLASH_DRV_FLASH_NOT_ERASED == Cy_Flash_BlankCheck(NULL, &blankCheckConfig,    CY_FLASH_DRIVER_BLOCKING))

   {
        ret = (*(uint32_t *)add); 
   }

   else
   {
        ret = 0x00000000uL;
    }

    return (ret);

}

0 Likes
6 Replies