cancel
Showing results for 
Search instead for 
Did you mean: 

Level 1 read protection set when wrote WRP bit for sector 8 and restarted IAR debugger

ruchika1
Associate II
Posted on July 23, 2013 at 16:46

Hi ,

I enable write protection for Sector 8 , which set my option byte to 0x0EFFAAED as i can read from debugger  ( IAR ). but as soon as i restart my debugger again i found read protection set to level 1 . i.e value of option byte turns to 0x0EFFFFED.

I am not touching RDP byte anywhere from my code.

No power fluctutaion and no ESD discharge .

Is there any other way that RDP turn to level 1 without explictly writing on RDP option byte ??

regards,
4 REPLIES 4
Nickname12657_O
Associate III
Posted on July 23, 2013 at 23:30

in theory, I beleive this is not possible. I think there is a mix between our devices series F1 options and F2 or F4 series in the way the options bytes are written, can you share your code and which MCU series are used to understand the case.

Cheers,

STOne-32

ruchika1
Associate II
Posted on July 24, 2013 at 10:39

Please find prototype of code , MCU and sequence of event -

init()

{

Write_pro( FALSE);

//Some work

Write_pro(TRUE)

}

write_pro(bool write_protect)

{

 

        FLASH_OB_Unlock();

 

        if (write_protect==TRUE)

        {

            FLASH_OB_WRPConfig(OB_WRP_Sector_8 , ENABLE);

        }

        else

        {

            FLASH_OB_WRPConfig(OB_WRP_Sector_8 , DISABLE);

        }

 

        FLASH_OB_Launch();

 

        FLASH_OB_Lock();

}

IAR workbench with ijet , STM3220G-EVALEvaluation board for STM32 F2 series - with STM32F207IG MCU

Sequence of Event -

1) Download image and run

2) It runs fine and set option byte to 0x0EFFAAED

3) Restart the debugger with the same image i.e debug without download option.

4) Read option byte get set to level 1 with value FF . and CPU Status in debugger is LOCK-UP.

ruchika1
Associate II
Posted on July 24, 2013 at 11:28

I would like to mention one more point .

If i call  Write_pro( FALSE); ,i.e disable Write protection of sector 8 before restarting the debugger then everything works fine . CPU doesnot go to LOCKUP state and all option bytes are fine. Could not able to relate these things.

ruchika1
Associate II
Posted on July 29, 2013 at 09:39

Hi STOne-32,

Do you have any idea/advice about this problem ??

Regards,

Ruchika