cancel
Showing results for 
Search instead for 
Did you mean: 

After three power up, my STM32F407VG is totally blocked

jean-francois23
Associate II
Posted on June 04, 2012 at 18:02

Hello,

I select the ''BOR'' Level 2 with these lines after init:

 FLASH->OPTKEYR = 0x08192A3B;

 FLASH->OPTKEYR = 0x4C5D6E7F;

 while(FLASH->SR & FLASH_SR_BSY);

  FLASH->OPTCR = 0x0FFFAAE4;

  FLASH->OPTCR = 0x0FFFAAE6;

 while(FLASH->SR & FLASH_SR_BSY);

  FLASH->OPTCR = 0x0FFFAAE7;

and after three power up, my STM32F407VG is totally blocked:

- Don't RUN

- No access with ULINK2 ''Flash TimeOut. Reset the Target and try again''

Ok, I don't understand the link, but this problem happens since I added these lines. 

thank you for your help

Jean-Francois

(Excuse me for my english, I'm French)
4 REPLIES 4
Posted on June 04, 2012 at 18:37

Pull the BOOT0 pin high and restart into the system loader, erase the part, and start over.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
jean-francois23
Associate II
Posted on June 04, 2012 at 21:14

Thank you for your fast answer.

I'm working on the AN3155 (

USART protocol used

in the STM32™ bootloader

),... do you know where i can find an friendly utility software to erase flash memory ?

Do you think the problem comes form my software ? ( wrong BOR configuration ? )

Thank's.

Posted on June 04, 2012 at 22:30

The flash loader demonstrator uses that protocol.

http://www.st.com/internet/com/SOFTWARE_RESOURCES/SW_COMPONENT/SW_DEMO/stm32-stm8_flash_loader_demo.zip

I don't think I'd modify the options like that, this might be less troublesome

FLASH->OPTKEYR = 0x08192A3B;
FLASH->OPTKEYR = 0x4C5D6E7F;
FLASH->OPTCR = (FLASH->OPTCR & ~0x0C) | 0x04; // OB_BOR_LEVEL2
FLASH->OPTCR |= 2; // OPTSTRT
while(FLASH->SR & FLASH_SR_BSY);
FLASH->OPTCR |= 1; // OPTLOCK

If you want to know why it's hanging up trying debugging it, or using the library. If it interferes with your boot process do it later when you can output diagnostic information. You might also want to check the current setting for BOR before changing it and consuming a burn cycle.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
jean-francois23
Associate II
Posted on June 06, 2012 at 16:16

It works pretty well !

It took me five minutes to do it on the dev board (MB997B). It was so much harder on my custom design. But I finaly did it!

Thank you clive1