[SOLVED] How to flash STM32_F4VE

Limited support for STM32F4 Discovery, Nucleo and custom F4 boards
Lennyz1988
Posts: 20
Joined: Fri Jun 30, 2017 9:11 am

Re: How to flash STM32_F4VE

Post by Lennyz1988 » Wed Aug 02, 2017 12:41 pm

stevestrong wrote:
Wed Jul 26, 2017 9:37 am
The flashing process as such should not make any difference on the used core.

So once you are able to flash, you can use any of the available cores:

Arduino_STM32 = https://github.com/rogerclarkmelbourne/Arduino_STM32
or
stm32duino = https://github.com/stm32duino/Arduino_Core_STM32F1
or
STM32GENERIC = https://github.com/danieleff/STM32GENERIC

This forum started initially with the Arduino_STM32 core, even if the forum name hints maybe something different.
Thank you for the list. I appreciate your hard work on this core!

I also found some clarification here:

http://www.stm32duino.com/viewtopic.php?f=42&t=97
ag123 wrote:
Thu Jul 27, 2017 3:02 pm
it is actually hidden in this thread
http://www.stm32duino.com/viewtopic.php ... =10#p26203
that's how i did it
Thank you for pointing this out. Unfortionally this is not the issue that I am having. The board never loads the DFU drivers. I always get the error "USB device descriptor failed" when connecting the blackboard.

For now I am giving up on programming my device using the usb port. I've resoldered the contacts, changed pc's, tried different os, different cable and different drivers. I just think I got a faulty board.

User avatar
Pito
Posts: 1531
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: How to flash STM32_F4VE

Post by Pito » Wed Aug 02, 2017 1:21 pm

My current understanding is you can use Serial upload with the built in eternal STM32 bootloader via Serial UART, when configured via the jumpers.
Why do you try it with USB when issues, try with Serial Uart..

UPDATE: I've tried with my Black F407ZE first time over USB DFU, basically the same board as yours. Win7 64bit.
1. I set Boot0 to 3.3V (was to GND)
2. unplug/plug usb (power off/on the board)
3. It recognized usb device and it installed STM32 BOOTLOADER (libusbK driver, 12/1/2014, v 3.0.7.0, dig signer USB\VID_0483&PID_DF11 (libwdi autogenerated) )
4. I ran dfu-util and uploaded a "d.bin" OK

Code: Select all

C:\Users\pito\Desktop\ProgDev\dfu-util-0.9-win64>dfu-util -l
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Found DFU: [0483:df11] ver=2200, devnum=8, cfg=1, intf=0, path="2-3", alt=3, nam
e="@Device Feature/0xFFFF0000/01*004 e", serial="8767865B8980"
Found DFU: [0483:df11] ver=2200, devnum=8, cfg=1, intf=0, path="2-3", alt=2, nam
e="@OTP Memory /0x1FFF7800/01*512 e,01*016 e", serial="8767865B8980"
Found DFU: [0483:df11] ver=2200, devnum=8, cfg=1, intf=0, path="2-3", alt=1, nam
e="@Option Bytes  /0x1FFFC000/01*016 e", serial="8767865B8980"
Found DFU: [0483:df11] ver=2200, devnum=8, cfg=1, intf=0, path="2-3", alt=0, nam
e="@Internal Flash  /0x08000000/04*016Kg,01*064Kg,07*128Kg", serial="8767865B8980"

C:\Users\pito\Desktop\ProgDev\dfu-util-0.9-win64>dfu-util -a 0 -s 0x8000000 -D d
.bin
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device...
ID 0483:df11
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuERROR, status = 10
dfuERROR, clearing status
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 2048
DfuSe interface name: "Internal Flash  "
Downloading to address = 0x08000000, size = 28276
Download        [=========================] 100%        28276 bytes
Download done.
File downloaded successfully

C:\Users\pito\Desktop\ProgDev\dfu-util-0.9-win64>
AFAIK I had to install the libusbK driver for the STM32 DFU BOOTLOADER via latest zadig tool. Maybe I reported in a post in past what was the issue..
Yep, I did it with F103ZET in past
http://www.stm32duino.com/viewtopic.php ... 188#p26207
Pukao Hats Cleaning Services Ltd.

Lennyz1988
Posts: 20
Joined: Fri Jun 30, 2017 9:11 am

Re: How to flash STM32_F4VE

Post by Lennyz1988 » Thu Aug 03, 2017 12:11 pm

Pito wrote:
Wed Aug 02, 2017 1:21 pm
My current understanding is you can use Serial upload with the built in eternal STM32 bootloader via Serial UART, when configured via the jumpers.
Why do you try it with USB when issues, try with Serial Uart..

UPDATE: I've tried with my Black F407ZE first time over USB DFU, basically the same board as yours. Win7 64bit.
1. I set Boot0 to 3.3V (was to GND)
2. unplug/plug usb (power off/on the board)
3. It recognized usb device and it installed STM32 BOOTLOADER (libusbK driver, 12/1/2014, v 3.0.7.0, dig signer USB\VID_0483&PID_DF11 (libwdi autogenerated) )
4. I ran dfu-util and uploaded a "d.bin" OK

AFAIK I had to install the libusbK driver for the STM32 DFU BOOTLOADER via latest zadig tool. Maybe I reported in a post in past what was the issue..
Yep, I did it with F103ZET in past
http://www.stm32duino.com/viewtopic.php ... 188#p26207
Thanks for the suggestion. The reason that I didn't upload through Serial UART was because Arduino_STM32 core does not support serial upload via the Arduino IDE. I didn't know that when I started this thread. I am able to upload to the board using ST Flash Loader or through Serial using the core from Danieleff.

I also tried your suggestion but the same error remains. I am suspecting that the board is faulty.

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

Re: How to flash STM32_F4VE

Post by RogerClark » Thu Aug 03, 2017 10:57 pm

I have all sorts of issues with drivers and DFU to a similar board.

But We have serial upload in the libmaple tools

Which Core are you using ?

Lennyz1988
Posts: 20
Joined: Fri Jun 30, 2017 9:11 am

Re: How to flash STM32_F4VE

Post by Lennyz1988 » Fri Aug 04, 2017 7:02 am

RogerClark wrote:
Thu Aug 03, 2017 10:57 pm
I have all sorts of issues with drivers and DFU to a similar board.

But We have serial upload in the libmaple tools

Which Core are you using ?
I am using the core from your repository:

https://github.com/rogerclarkmelbourne/Arduino_STM32


There is no option to select upload via usb serial so I assume it's not supported yet in this core.

Image

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

Re: How to flash STM32_F4VE

Post by stevestrong » Fri Aug 04, 2017 7:20 am

Yea, currently is only upload over STLink supported for F4.
I assume the DFU upload with ST flash utility should also work, but it is a bit cumbersome, you have to set the BOOT0 jumper to 3.3V, upload the sw, and set back the jumper to GND. As we don't have a working DFU utility, we have no menu for selecting upload modality.

Using on long term the F4 boards you will sooner or later need debugging, so that getting a STLink probe is anyway useful, I recommend to get one and then all your problems are gone :)
Last edited by stevestrong on Fri Aug 04, 2017 8:15 am, edited 1 time in total.

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

Re: How to flash STM32_F4VE

Post by RogerClark » Fri Aug 04, 2017 7:44 am

It would be easy to add Serial upload, but like @stevestrong says, I don't think hardly anyone would use it

Lennyz1988
Posts: 20
Joined: Fri Jun 30, 2017 9:11 am

Re: How to flash STM32_F4VE

Post by Lennyz1988 » Fri Aug 04, 2017 9:12 am

stevestrong wrote:
Fri Aug 04, 2017 7:20 am
Yea, currently is only upload over STLink supported for F4.
I assume the DFU upload with ST flash utility should also work, but it is a bit cumbersome, you have to set the BOOT0 jumper to 3.3V, upload the sw, and set back the jumper to GND. As we don't have a working DFU utility, we have no menu for selecting upload modality.

Using on long term the F4 boards you will sooner or later need debugging, so that getting a STLink probe is anyway useful, I recommend to get one and then all your problems are gone :)
Yes, I ordered the STLink a week ago based on your recommendation. I am still waiting for it to arrive :)
RogerClark wrote:
Fri Aug 04, 2017 7:44 am
It would be easy to add Serial upload, but like @stevestrong says, I don't think hardly anyone would use it
I understand :)

User avatar
Pito
Posts: 1531
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: How to flash STM32_F4VE

Post by Pito » Fri Aug 04, 2017 10:39 am

I am using j-link clone with Black F407ZET exclusively (the black jtag connector), works great (you have to upgrade the j-link's fw, not easy exercise though).
ST-Link is a "mandatory tool" when messing with stm32 stuff, indeed.
I still think your usb dfu as described above may work, maybe your driver for STM BOOTLOADER has not been installed properly.
Pukao Hats Cleaning Services Ltd.

vitor_boss
Posts: 61
Joined: Wed Apr 19, 2017 9:50 am

Re: How to flash STM32_F4VE

Post by vitor_boss » Mon Aug 07, 2017 10:50 am

RogerClark wrote:
Fri Aug 04, 2017 7:44 am
It would be easy to add Serial upload, but like @stevestrong says, I don't think hardly anyone would use it
I'm using it from STM32GENERIC, stm32flash flash utility run the program after flashing without touch the boot jumper

Post Reply