2012-10-24 12:07 PM
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 activatedAnd 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 !
2012-10-24 01:48 PM
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.2012-10-25 03:12 AM
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 ?2012-10-25 04:24 AM
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.2012-10-25 05:45 AM
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 ?2012-10-25 08:09 AM
IDE's are much about personal preference, I'd recommend Keil, Rowley or IAR.