Program word in flash
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2009-01-15 9:45 PM
Posted on January 16, 2009 at 06:45
Program word in flash
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 3:59 AM
Posted on May 17, 2011 at 12:59
Hi.
I’m trying to write to the flash but every time I try to do a FLASH_ProgramWord(), it ends up in the HardFault_Handler. I'm using the approach that is used in ST’s Write_Portection examples.Code:
/* Unlock the Flash Program Erase controller */
FLASH_Unlock(); FLASH_ClearFlag(FLASH_FLAG_BSY | FLASH_FLAG_EOP|FLASH_FLAG_PGERR |FLASH_FLAG_WRPRTERR); /* Get pages write protection status */ WRPR_Value = FLASH_GetWriteProtectionOptionByte(); ProtectedPages = WRPR_Value & 0xFFFFFFFF; if (ProtectedPages == 0x00) {/* Pages are write protected */ /* Disable the write protection */ FLASHStatus = FLASH_EraseOptionBytes(); } FLASH_ErasePage(APPLICATION_ADDRESS); FLASHStatus = FLASH_ProgramWord(0x00001111,APPLICATION_ADDRESS); I hope anyone can help me. Søren P.Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 3:59 AM
Posted on May 17, 2011 at 12:59
Hi.
Error located, embarrassed…. FLASH_ProgramWord() is (Address, Data) i had (Data, Address) Best regards Søren P. :-]