Page 1 of 1

STM32F407 with ST-Link

Posted: Wed Jul 28, 2021 11:08 am
by Alan_37
Hi

I have a problem programming STM32 with ST-Link via flowcode,
So here is the problem if in my program I init SPI to work with ILI9341 Display flowcode does not detect target via ST-Link
if I use st-link Utility ( GUI version ) it works fine .

I think is because ST-Link utility resets the MCU exactly before programming it .

Is it possible to make flowcode do the same?

Re: STM32F407 with ST-Link

Posted: Wed Jul 28, 2021 12:33 pm
by LeighM
Hi
If you have the reset pin connected to the ST-LINK, you could try this ...
Edit the stm32prog.bat file found in C:\Program Files (x86)\Flowcode\Common\Compilers\starm\batch
Add the -HardRst command to the programmer line

Code: Select all

@ST-LINK_CLI.exe -HardRst -P "%MX_LOCATION%%MX_PROJECT%.hex" -Run
Let us know if that works for you.

Re: STM32F407 with ST-Link

Posted: Wed Jul 28, 2021 3:29 pm
by Alan_37
Thanks for your reply

I have done that, but it does not work so I was wrong must be something alse
any idea why this happening?



STM32 ST-LINK CLI v2.1.0
STM32 ST-LINK Command Line Interface

No target connected
Unable to connect to ST-LINK!
Error(s)!


Autoclose turned off


FINISHED

Re: STM32F407 with ST-Link

Posted: Wed Jul 28, 2021 4:45 pm
by LeighM
In my experience it does seem easy to "crash" the ST-LINK, driven from command line tool, irrespective of Flowcode.
Most successful sequence is: connect ST-LINK to target, apply power to target, connect ST-LINK to PC USB, invoke ST-LINK_CLI