Question
HAL_FLASH_Program always return error code 0x06
Posted on March 30, 2015 at 15:44
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? #flash #hal #stm32