2012-06-04 09:02 AM
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)2012-06-04 09:37 AM
Pull the BOOT0 pin high and restart into the system loader, erase the part, and start over.
2012-06-04 12:14 PM
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.2012-06-04 01:30 PM
The flash loader demonstrator uses that protocol.
I don't think I'd modify the options like that, this might be less troublesomeFLASH->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.
2012-06-06 07:16 AM
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