cancel
Showing results for 
Search instead for 
Did you mean: 

Reset read protection in STM32F205

jpeacock2399
Associate II
Posted on November 01, 2012 at 22:15

I turned on a test board this morning and could not program or read the flash area (0x0000 0000 to 0x1FFF FFFF).  Looking at the option bytes in FLASH_OPTCR register I see the RDp field set to FF, level 1 protection enabled.  Mystery how it was set but okay, I'll try to reset it back to level 0.  JTAG is working and I can access SRAM and registers.  CPU is an STM32F205VF.

Using a JLINK and gdb I sent this command sequence to the FLASH registers:

monitor memu32 0x40023c08 = 0x08192a3b    1st OPTKEYR to unlock

monitor memu32 0x40023c08 = 0x4c5d6e7f     2nd OPTKEYR to unlock

(at this point if I look at OPTCR it shows as unlocked, OPTSR shows not busy)

monitor memu32 0x40023c14 = 0x0fffaaee      no write prot, level 0 read prot, start

(I wait about 30 seconds, should be doing a mass erase)

monitor memu32 0x40023c14

  return 0x0FFF FFED            read protection still at level 1

I power down and back up, read protection still set to FF.

I also tried the JLINK utility JlinkSTM32.exe, to clear read protection.  It returns an error ''resetting option byte failed''.  Seems to be the same problem.

I'm not at the irreversible level 2, because JTAG still works and I can dump memory except for the flash region.  But I can't clear read level 1 back to level 0.

Any idea how to clear the read protection?   Has anyone else encountered this problem?  The read level changed between power off at 5pm and power on at 8am the next day.  The application code in the flash doesn't modify the option byte.

  Jack Peacock

#option-bytes #option-bytes
8 REPLIES 8
ruchika1
Associate II
Posted on July 10, 2013 at 17:03

Hi jack,

Are you able to solve this problem .

Accidently  RDP bit is 0xff in my STM32F207 Eval board and i am using IAR ijet debugger but could not able to bring read protection from level 1 to level 0 . Please guide .

Regards,

Ruchika

Posted on July 10, 2013 at 17:19

Not an IAR user, but you might consider using the System Loader (BOOT0=High) mode via USART1 or USART3 and reprogram the option bytes using it's protocol. You might want to look at the Flash Demonstrator app, or the ST-Link and utilities.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
ruchika1
Associate II
jpeacock2399
Associate II
Posted on July 11, 2013 at 15:54

I contacted my distributor (Arrow) who forwarded the report to ST but no results.  ST says they can't reproduce the problem and haven't seen it before.

My assumption for now is it is some kind of damage to the STM32, maybe ESD discharge fried the flash read protect bits.  I saw it on two boards but it hasn't shown up since the original post.  I have since switched from 'F205 to 'F405 parts.

  Jack Peacock
ruchika1
Associate II
Posted on July 11, 2013 at 17:35

Thanks jack for the reply .

In my STM3220G eval board , I have not touched Read protection bit and am still wondering why RDP bits get set . :( ...

I am exploring ST utility (flash loader demo) as clive suggested and setting boot configuration accordingly but no luck till now ... Flash loader demo says No target device ... This flash loader demo uses UART protocol and STM3220F eval board has a USART port , may be this is a possible reason for the Flash loader utility error , not sure.

.. and now having a look at ST another utility Dfuse .

If anyone in this forum has any idea about the reason or solution , please suggest .

ruchika1
Associate II
Posted on July 12, 2013 at 14:12

:D ... Releived now .

Problem solved ... Dfuse ST utility helped . My eval board had support for this USB firmware upgrader and it worked ....

np1
Associate II
Posted on July 04, 2016 at 06:44

I got the problem with ROP level 2, could you help me how to reset it?

Posted on July 04, 2016 at 14:32

From Level 2 you will have to replace the part.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..