cancel
Showing results for 
Search instead for 
Did you mean: 

Flashing STM32F405 with ST link utility

neoirto
Associate II
Posted on October 24, 2012 at 21:07

Hi all,

After flashing my board based on a STM32F405RG with ST link utility (Hex compiled with GCC under eclipse), I can't communicate anymore with the core. I have this error :

Cannot run core while booting from flash memory and Read out protection is activated

And I have to hold reset pin long time before restore com and erase it.

I probably have a wrong initialization procedure ?

Could you please tell me what is the minimal configuration to run a simple main() ?

I used :

    SystemInit();

 

    SystemCoreClockUpdate();

 

With HSE_VALUE changed to 24 MHz

 

 

Iis there something else to do ?

Any help would be greatly appreciated !
5 REPLIES 5
Posted on October 24, 2012 at 22:48

You should review the startup_stm32f4xx.s file (GNU RIDE), it typically calls SystemInit() prior to calling main(), and after zeroing and copying static initializations.

Failing to zero various BSS areas properly will cause much unexpected grief, review also the linker script.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
neoirto
Associate II
Posted on October 25, 2012 at 12:12

Thanks for your answer clive,

I checked my linker : it's a STM32F407VG one...

How can I find a STM32F405RG one ? Is it possible I fried my MCU with an inappropriate linker ?

About the .s file : what do you mean by GNU RIDE please ?

Is there a way to check my MCU health ? I hope everything is still ok with my board...

Should I be worry ?
Posted on October 25, 2012 at 13:24

GNU/RIDE refers to the location of the file in the library, a startup file for GNU C using GNU AS

\STM32F4xx_DSP_StdPeriph_Lib_V1.0.0\Libraries\CMSIS\Device\ST\STM32F4xx\Source\Templates\gcc_ride7\startup_stm32f4xx.s

Not sure how you changed the Option Bytes, the ST-Link utility under Windows should permit you to program the RDP to Level 0, provided it's not at Level 2.

If it relates to specific code of your own, setting BOOT0 high will cause it to enter the System Loader rather than running your code.This should also permit connectivity via the serial port using the Flash Loader Demonstrator. A simple check would be to send an 0x7F byte at 8E1 to the USART1/USART3 and get a 0x79 response.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
neoirto
Associate II
Posted on October 25, 2012 at 14:45

Thanks again Clive,

Finlay I used Coocox IDE to compile and flash with appropriate linker and startup sequence to the MCU. And I have a led blinking with success... Hummm, it's a beginning ;).

I'm really happy to see I didn't fried anything... Hope it's truly the case.

Can you tell me if CooCox is a good starting place with its available libraries to begin a work that will need a complex interrupt schem ?

Posted on October 25, 2012 at 17:09

IDE's are much about personal preference, I'd recommend Keil, Rowley or IAR.

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