cancel
Showing results for 
Search instead for 
Did you mean: 

RDP level1 is automatically SET on STM32F407 ! STRANGE ISSUE!

moez
Associate II
Posted on October 16, 2014 at 17:32

Hi all,

I have a very strange issue with STM32F407ZG; sometimesthe RDP level 1 is automatically set and then using STLink Utilities I can goback to RDP level 0.

BUT, Now I get RDP level 1 SET and I can't go toRDP level 0 : Seems to be Irreversible (like RDP level2).

I can connect with STLink utilities, to read theoption bytes and I see RDP Level1 and I'm not able to modify it to go to RDPlevel 0.

Canany one help please ? it is urgent!

Thx,

Franco

#stm32f4 #rdp-level-1
17 REPLIES 17
christian239955_stm1
Associate II
Posted on November 05, 2014 at 13:03

Hi

I also have the problem that I can't reset the RDP level backto level 0. I wrote the following code that I can load in theRAM and execute to set the RDP level but it doesn't work. Can someone give me any hints?

int main(void) 
{ 
HAL_Init(); 
SystemCoreClockUpdate(); 
SystemClock_Config(); 
FLASH_OBProgramInitTypeDef OBInit; 
HAL_FLASHEx_OBGetConfig(&OBInit); 
HAL_FLASH_Unlock(); 
HAL_FLASH_OB_Unlock(); 
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR| FLASH_FLAG_BSY); 
OBInit.OptionType = OPTIONBYTE_RDP; 
OBInit.RDPLevel = OB_RDP_LEVEL_0; 
HAL_FLASHEx_OBProgram(&OBInit); 
HAL_FLASH_OB_Launch(); 
HAL_FLASH_OB_Lock(); 
HAL_FLASH_Lock(); 
NVIC_SystemReset(); 
}

Thanks in advance BR Christian
Amel NASRI
ST Employee
Posted on November 05, 2014 at 15:03

Hi Christian,

Did you tried to go back to RDP level 0 using the ST-Link Utility?

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

christian239955_stm1
Associate II
Posted on November 05, 2014 at 16:13

Yes, but it didn't work. I have this problem now on 3 microcontrollers.

Posted on November 05, 2014 at 20:18

Yes, but it didn't work. I have this problem now on 3 micro-controllers.

Hopefully you have access to USART1/USART3 and can strap BOOT0 High, and then un-brick them using the System Loader.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
christian239955_stm1
Associate II
Posted on November 05, 2014 at 22:04

No, the boot0 pin is strapped to low and the uarts are not connected on my PCB. It would be easier to replace the whole MCU :(

Do you see any problem with my code? Should it set the level back to level 0?

What is the difference between my code executed from RAM and unbrick with the system loader?

Amel NASRI
ST Employee
Posted on November 06, 2014 at 16:12

Hello,

Would it be possible to contact your FAE or local ST representative? It may be needed to recover chips having read out protection issue for further checks.

Best Regards,

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Posted on November 06, 2014 at 17:17

I'm not using the HAL libraries, but used code that looks materially similar in nature to put the chips into Level 1. Getting them out is always more of a challenge, and certainly a head ache to work with on Keil + ULink2. I'd surmise the code I used to get to Level 0 managed to erase the part (and itself), but not change the level. I was able to get them working quickly via BOOT0 + USART1, but I have that option because the boards were designed for easy manufacture/test.

I'd certainly recommend anyone using RDP to become very well acquainted with all it's facets on a system they can readily debug and debrick.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Linda
Associate II
Posted on March 15, 2015 at 16:15

good thread.