Fun with Option Bytes
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2010-03-11 12:46 PM
Posted on March 11, 2010 at 21:46
Fun with Option Bytes
This discussion is locked. Please start a new topic to ask your question.
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 6:07 AM
Posted on May 17, 2011 at 15:07
Hi,
You should add:
// Define FLASH programming time
FLASH_SetProgrammingTime(FLASH_PROGRAMTIME_STANDARD);
and just then:
FLASH_Unlock(FLASH_MEMTYPE_DATA); // unlock data memory by passing the RASS key in the proper orderFLASH_ProgramOptionByte(0x4803,0x80); // byte OPT2 resides at address x4803, write a 1 to bit 7. This will also write to the NOPT2 complement byteFLASH_Lock(FLASH_MEMTYPE_DATA); // re-lock data memoryOptions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 6:07 AM
Posted on May 17, 2011 at 15:07
Hi,
Thanks for the feedback. Unfortunately, this still doesn't work. I added that line, built the project and went into debug - still no beeper. Exit debug mode and the board resets - THEN I can get the beeper. However, any subsequent attempt at entering debug mode generates the error ''Connection error (usb://usb): gdi-error[40701]: option bytes read error: not complemented; please use a programmer'' At this point, it seems hung up and I can't connect to the board. I'm forced to go into STVP ''option byte'' tab, setting ROP to ON, write it, and then set ROP to OFF, and write it. That will erase the entire flash area and allow me to re-establish a connection to the board. I'll keep playing around with this....Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 6:07 AM
Posted on May 17, 2011 at 15:07
Hi,
Can you please check this sequence : FLASH_Unlock(FLASH_MEMTYPE_DATA); while (FLASH_GetFlagStatus(FLASH_FLAG_DUL) ==RESET); FLASH_ProgramOptionByte(0x4803,0x80); FLASH_Lock(FLASH_MEMTYPE_DATA); Thanks to keep us informed Regards mozra