STM32F4 upload problem

Limited support for STM32F4 Discovery, Nucleo and custom F4 boards
User avatar
RogerClark
Posts: 6917
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: STM32F4 upload problem

Post by RogerClark » Fri Oct 07, 2016 9:56 am

Umm

Odd.
I'm running W7 Pro, IDE 1.6.12 so you could try upgrading but I doubt that's the cause, as I didn't have any issues with 1.6.11

Do you have Java installed ? I know the IDE uses Java, but I thought somehow it was merged into the EXE, but perhaps external copies of Java can screw things up.

piastri2
Posts: 6
Joined: Thu Oct 06, 2016 5:42 pm

Re: STM32F4 upload problem

Post by piastri2 » Fri Oct 07, 2016 1:37 pm

No i dont java installed, i guess im using the one embedded.
i will install it and retry with the original platform.txt when i have the time

User avatar
RogerClark
Posts: 6917
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: STM32F4 upload problem

Post by RogerClark » Fri Oct 07, 2016 7:58 pm

No worries.

stevestrong
Posts: 1612
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: STM32F4 upload problem

Post by stevestrong » Fri Oct 07, 2016 9:50 pm

The fix is OK, in the F1 platforms.txt the same variable is used.
Extract from F1 platforms.txt:

Code: Select all

# stlink upload
tools.stlink_upload.path.windows={runtime.hardware.path}/tools/win
...
tools.stlink_upload.upload.pattern="{path}/{cmd}" {serial.port.file} {upload.altID} {upload.usbID} "{build.path}/{build.project_name}.bin"
If it was probably not fixed yet for F4, it should be checked into the repo.

On the other side, I don't see any reason why the STlink upload method needs the serial port and the other 2 parameters (IDs). These are simply not needed.

I suggest to change line 144 to:

Code: Select all

tools.stlink_upload.upload.pattern="{path}/{cmd}" "{build.path}/{build.project_name}.bin"
and the stlink_upload.bat line 9:

Code: Select all

set str=%1
accordingly. Of course, for linux and macOS as well.

User avatar
RogerClark
Posts: 6917
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: STM32F4 upload problem

Post by RogerClark » Fri Oct 07, 2016 10:59 pm

Steve

We have a lot of redundant params, which no one has got around to removing ;-(

Actually I should be able to just copy the uploads section from the F1 platforms.txt to the F4

edogaldo
Posts: 264
Joined: Fri Jun 03, 2016 8:19 am

Re: STM32F4 upload problem

Post by edogaldo » Sat Oct 08, 2016 1:18 pm

Hi all, question: is there alread in the repository an upload method which leverages the standard f4 dfu bootloader?

User avatar
RogerClark
Posts: 6917
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: STM32F4 upload problem

Post by RogerClark » Sat Oct 08, 2016 8:01 pm

edogaldo wrote:Hi all, question: is there alread in the repository an upload method which leverages the standard f4 dfu bootloader?
No. I don't think so.

Is it possible to enter the built in DFU via code ? e.g can the code jump to a specific address, or perhaps set some registers and then jump etc ??.

edogaldo
Posts: 264
Joined: Fri Jun 03, 2016 8:19 am

Re: STM32F4 upload problem

Post by edogaldo » Sat Oct 08, 2016 8:19 pm

RogerClark wrote:Is it possible to enter the built in DFU via code ? e.g can the code jump to a specific address, or perhaps set some registers and then jump etc ??.
I know it can be done with the usart bootloader so I guess it should be possible also with the dfu one but I don't know how..

[Edit] maybe this can be intersting: https://m.youtube.com/watch?v=cvKC-4tCRgw
There is aldo a comment specific to the dfu bootloader

User avatar
RogerClark
Posts: 6917
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: STM32F4 upload problem

Post by RogerClark » Sat Oct 08, 2016 9:07 pm

Thanks

That could be handy even for just jumping to Serial upload on the F103

But even better if it works on the F4 for USB DFU

blackt1ger
Posts: 3
Joined: Fri Dec 23, 2016 8:55 pm

Re: STM32F4 upload problem

Post by blackt1ger » Fri Dec 23, 2016 9:03 pm

Hi, I finally got around to getting my STM32F407 Discovery Board up and running.

I had the upload problem, too and I have a fix. In:

Aurduino_STM32/tools/win/stlink_update.bat

Change:

rem: ------------- use STLINK CLI
stlink\ST-LINK_CLI.exe -c SWD -P %str% 0x8000000 -Rst -Run

To:
rem: ------------- use STLINK CLI
stlink\ST-LINK_CLI.exe -c SWD UR -P %str% 0x8000000 -Rst -Run

How I found this .... Had the same problem. Downloaded the ST-LINK utility. Tried to connect and couldn't. Error message said to do a reset before connect. Looked at the ST-LINK_CL.exe command line options. Reset before connect is enabled by adding a "UR" command.

I updated my ST-LINK flash firmware prior to finding the solution, so you might have to do that as well.

Post Reply