2012-11-01 02:15 PM
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-bytes2013-07-10 08:03 AM
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, Ruchika2013-07-10 08:19 AM
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.
2013-07-10 08:55 AM
Thanks for the reply Clive .
I was going through one of your links - the utility and procedure you have mentioned here can help me ??.2013-07-11 06:54 AM
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 Peacock2013-07-11 08:35 AM
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 .2013-07-12 05:12 AM
:D ... Releived now .
Problem solved ... Dfuse ST utility helped . My eval board had support for this USB firmware upgrader and it worked ....2016-07-03 09:44 PM
2016-07-04 05:32 AM
From Level 2 you will have to replace the part.