AnsweredAssumed Answered

HAL_FLASH_Program always return error code 0x06

Question asked by RiseOfDeath on Mar 30, 2015
Latest reply on Mar 31, 2015 by RiseOfDeath
I use STM32F417IG
Minimal example of code:

uint32_t startAddress = 0x80E0000;


static uint32_t mSize =0x13;//
char test_string[13]={"Hello World."};


HAL_FLASH_Unlock();


for(uint32_t i=0;i<mSize;i++)
{
     status = HAL_FLASH_Program(FLASH_TYPEPROGRAM_BYTE, startAddress+i,test_string[i]);
          
     if(status==HAL_ERROR)
     {
          printf("Flash error code: %d for data index %d\n",HAL_FLASH_GetError(),i);//Always return 6
     }


}


What is wrong?

Outcomes