5
votes

I'am using IAR Workbench and I am having hard time to flash my STM32F407VG I got:

FATAL error ST-Link No MCU device found.

  • The USB cable connecting the laptop and the MCU is new so I don't think it's the problem.
  • ST-Link en.stsw-link009 is installed

When I go to project options Debugger > ST-Link > Reset > connect during reset and try to download again I got:

Warning stack pointer is setup to incorrect alignement stack addr = 0x00000016 after the download progress bar stay blocked.

By navigating in the option menu I find it's possible to adjust CPU frequency actually it's 72 MHz, the default one, I changed it to 168 MHz, the CPU frequency but the problem remains.

Could you please suggest me some solutions to debug/resolve the problem.

Edit

I have used STM32 ST-Link Utility and i succeded to connect to the board, But the problem with my IDE is not resolved yet.

1
You forgot to mention what IDE you are using. Project options: Debugger does not tell a lot, what project. Guessing from the MCU you are using an STM32F4 Discovery board, or is it a custom board? To simply verify if you can connect to the chip I suggest to use STM32 ST-Link Utlity. - Bence Kaulics
@BenceKaulics Thank you for the feedback, i'am using IAR Workbench Yes i have used STM32 ST-Link Utility and i succeded to connect to the board. This is why i'am not sure to undrestand from where the problem come - Mouin
Do you have a file called something like stm32f407xx_flash.icf in your project? - Bence Kaulics
Yes i have this file in the project - Mouin
Then first check your warning. There should be a line define block CSTACK with alignment = . Now, I suppose it is equal 16 in your case. Is that correct? - Bence Kaulics

1 Answers

3
votes

I used ST-Link Utility to erase flash memory, once this is done i activated

Debugger > ST-Link > Reset > connect during reset

and all works well, i don't know why but i'am glad to see my board works again

Thank you for your help