cancel
Showing results for 
Search instead for 
Did you mean: 

Option byte progamming

gagonzalez
Associate
Posted on November 26, 2008 at 16:23

Option byte progamming

1 REPLY 1
gagonzalez
Associate
Posted on May 17, 2011 at 12:54

I've tried to program option bytes(read-out unprotect and write protect) debbugging wiht J-Link(Segger). I used the library from UM0427 and I managed to erase these bytes, however when I tried to write in it I got a Hard Fault.

My code(flash library) is executing from RAM, and I believe the Fault cause is Option bytes address(0x1FFF F800...) which is probably unknown to mcu. Is that correct? How can I solve this?

Just to showing:

FLASH->OPTKEYR = FLASH_KEY1;

FLASH->OPTKEYR = FLASH_KEY2;

FLASH->CR |= CR_OPTER_Set;

FLASH->CR |= CR_STRT_Set;

status = FLASH_WaitForLastOperation(EraseTimeout);

if(status == FLASH_COMPLETE)

{

FLASH->CR &= CR_OPTER_Reset;

FLASH->CR |= CR_OPTPG_Set;

OB->RDP= RDP_Key; After this point I get a Hard Fault

Thanks!