HAL_FLASH_Program always return error code 0x06
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-03-30 6:44 AM
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
Labels:
- Labels:
-
Flash
-
STM32Cube MCU Packages
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-03-30 12:24 PM
Posted on March 30, 2015 at 21:24
Dunno, what's 6 defined as meaning, and is the memory erased, check the bytes are 0xFF
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-03-30 10:11 PM
Posted on March 31, 2015 at 07:11
#define HAL_FLASH_ERROR_PGS ((uint32_t)0x00000002) /*!< Programming Sequence error */
#define HAL_FLASH_ERROR_PGP ((uint32_t)0x00000004) /*!< Programming Parallelism error */Sector 12 (0x080E000 - 0x080FFFFF) filed by 0xff. I try to fully erase chip by j-link flashing device. No any changes.