2010-03-11 12:46 PM
Fun with Option Bytes
2011-05-17 06:07 AM
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 memory2011-05-17 06:07 AM
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....2011-05-17 06:07 AM
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