cancel
Showing results for 
Search instead for 
Did you mean: 

Traveo II

yuejin
New Contributor

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
3 Replies
Kavya
Moderator
Moderator

Hello Tian,

 

It seems that BlankCheck SROM API which in turn gets invoked inside Cy_Flash_BlankCheck() is not successful and hence you are getting the error code (CY_FLASH_DRV_FLASH_NOT_ERASED - 0xF00000A4).

 

Is the work flash region for which you are trying to do blank check protected? Is there any access restrictions set in your project for this memory address?

 

Thanks,

Kavya

0 Likes
yuejin
New Contributor

Hello Kavya,

How many cases will return (CY_FLASH_DRV_FLASH_NOT_ERASED - 0xF00000A4).

I read address is 0x14019de4 ,it is in the chip workflash range.

I do not setting any protected , unless it is the default. How can I know  this address is protected?

 

 

0 Likes
Bill-li
New Contributor II

我估计是ECC错误导致的。这玩意儿一般处理方式就是先做Blank Check 如果Check失败就直接擦除

0 Likes