[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

[SOLVED] How to flash STM32_F4VE

Post by Lennyz1988 » Tue Jul 25, 2017 8:18 am

UPDATE: 08-22-2017

It appears this board has a wrong resistor value. That's why I could not get the usb port to work. See this thread for more info:

http://www.stm32duino.com/viewtopic.php?f=39&t=2484

Flashing the board works using the following methods:

This core: https://github.com/rogerclarkmelbourne/Arduino_STM32

1. Using an ST-link

This core: https://github.com/danieleff/STM32GENERIC (This core has my personal preference because of the good documentation.)

1. Using an ST-link
2. Using a Serial-to-USB



*OLD POST*

I am sorry if this is a really noob question, but how does one flash a STM32_F4VE (STM32F4XX STM32_F4VE V2.0 1509)

http://wiki.stm32duino.com/index.php?title=STM32F407

I tried to read all the information I could find in this section, but what am I missing here?

- I tried using the mini-usb port connected to my Windows 10 x64 and Linux Mint using all the boot jumper combinations. In Windows 10 I always get the "USB device descriptor failed (VID 0x000 PID 0x0002)." So it never loads the DFU mode. I tried to install the drivers from the Arduino_STM32 core, same result. I tried to install the drivers from the STM32 website, same result.

The wiki describes that this board has mini USB which provides USB Serial (VCP) via the ST VCP driver. But after installing still the descriptor failed error. So I tried this driver from the STM32 website:

http://www.st.com/en/development-tools/ ... 32102.html


This post explains that the STM32F4 already has a built in bootloader, thus it should give me DFU mode. So what am I doing wrong here?

http://www.stm32duino.com/viewtopic.php ... 215#p15447

- I also tried to hook up a FT232 USB-to-serial adapter, but I still cannot upload sketches through the Arduino IDE. So what am I doing wrong or what am I missing here?
Last edited by Lennyz1988 on Tue Aug 22, 2017 8:02 am, edited 3 times in total.

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

Re: How to flash STM32_F4VE

Post by stevestrong » Tue Jul 25, 2017 8:41 am

Upload possibilities:

1. DFU over USB or any of Serial 1,2,3
- set BOOT0 jumper (BT0 on the black F4 board) to 3.3V
- reset the board
Now the F4 chip should enter DFU upload mode, the device manager should show you "STM32F4 DFU device" or similar.
If not, then you have to try other drivers.
- flash the chip
- set the BOOT0 jumper back to GND
- reset the board.
https://youtu.be/Kx7yWVi8kbU?t=203

2. STLink V2
- preferred method as no jumper setting is required, works on-the-fly
- you can buy one for ~2USD from Aliexpress or Ebay.

Which OS are you running?

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

Re: How to flash STM32_F4VE

Post by Lennyz1988 » Tue Jul 25, 2017 8:57 am

stevestrong wrote:
Tue Jul 25, 2017 8:41 am
Upload possibilities:

1. DFU over USB or any of Serial 1,2,3
- set BOOT0 jumper (BT0 on the black F4 board) to 3.3V
- reset the board
Now the F4 chip should enter DFU upload mode, the device manager should show you "STM32F4 DFU device" or similar.
If not, then you have to try other drivers.
- flash the chip
- set the BOOT0 jumper back to GND
- reset the board.

2. STLink V2
- you can buy one for ~2USD from Aliexpress or Ebay.

Which OS are you running?
Hi, thank you for replying. This is a picture of the board when connected to the pc. As you can see I the jumper from Boot0 is set to 1 and Boot1 is set to 0. I set them before connecting the device to the pc.

Image

After that I hook it up to Windows 10 x64 and get this error. Pressing the reset button has no alternative effect. The translation is: USB device descriptor failed. Linux Mint also fails to detect the board. STM32F4 DFU device never appears in my list.

Image

What drivers should I try? I already tried multiple drivers, but the error remains.

These are the drivers I tried:

1. http://www.st.com/en/development-tools/ ... 32102.html

2. The drivers provided in the STM32_Arduino core.

3. http://www.st.com/en/development-tools/ ... 32080.html

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

Re: How to flash STM32_F4VE

Post by stevestrong » Tue Jul 25, 2017 9:32 am

Try another USB2.0 port, avoid USB 3.x ports.
Or try any of the Serial 1,2,3 ports.

You can also try to connect the board via an USB hub, sometimes it helps.

What does the board in the initial state (BOOT0 to GND)? LED blinks? Any output on serial ports?

Finally the board can be faulty.

I would definitely buy an STLink V2 probe, it would also help later for debugging.

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

Re: How to flash STM32_F4VE

Post by Lennyz1988 » Tue Jul 25, 2017 10:02 am

No there is not any output on the serial. I attached a usb-to-serial to the TX, RX, GND, 5v and there wasn't any output. I tried multiple baudrates. The LED at D1 is always on. It is constant on and never blinks. I tried all the usb ports in my pc, usb2.0 and usb3.0 but that doesn't make any difference.

In the Youtube video you posted there are blinking leds, but not at my board. Do you think I got a faulty board? I will order a ST-Link, but that will take a few weeks to arrive.

BOOT0 = 1
BOOT1 = 0
LED = Constant on

Image

BOOT0 = 0
BOOT1 = 1
Led = Constant on

Image

BOOT0 = 0
BOOT1 = 0
Led = Constant on

Image

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

Re: How to flash STM32_F4VE

Post by stevestrong » Tue Jul 25, 2017 11:24 am

stevestrong wrote:
Tue Jul 25, 2017 9:32 am
What does the board in the initial state (BOOT0 to GND)? LED blinks? Any output on serial ports?
I asked this because on my board originally there was an application flashed which blinked the D2 and D3 LEDs (bottom left part of the pictures) and sent some data over serial 1.
Set both BOOT0 and BOOT1 to GND (original setting) and reset the board.
The D1 LED you pointed out just signalizes that the board is powered, and it should not blink.
Measure the 3.3V supply, maybe is lower than needed.
Change the USB cable.
Re-solder the USB connections on the board.

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

Re: How to flash STM32_F4VE

Post by vitor_boss » Tue Jul 25, 2017 4:16 pm

Lennyz1988 wrote:
Tue Jul 25, 2017 10:02 am
LED = Constant on

...
That LED is power indicator, for flash mine I use a USB serial(FTDI) adaptes connected on TX RX GND 5V header and boot0 to 3.3V using ST flash loader demo.

Or using https://github.com/danieleff/STM32GENERIC library, there is an option to use serial adapter to upload trough serial

EDIT: Try remove battery before power the board if still giving errors, happened here.

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

Re: How to flash STM32_F4VE

Post by Lennyz1988 » Wed Jul 26, 2017 9:19 am

stevestrong wrote:
Tue Jul 25, 2017 11:24 am
stevestrong wrote:
Tue Jul 25, 2017 9:32 am
What does the board in the initial state (BOOT0 to GND)? LED blinks? Any output on serial ports?
I asked this because on my board originally there was an application flashed which blinked the D2 and D3 LEDs (bottom left part of the pictures) and sent some data over serial 1.
Set both BOOT0 and BOOT1 to GND (original setting) and reset the board.
The D1 LED you pointed out just signalizes that the board is powered, and it should not blink.
Measure the 3.3V supply, maybe is lower than needed.
Change the USB cable.
Re-solder the USB connections on the board.
I measured the pins with a multimeter and I get a solid 3.3v output on the pins. I also tried to reflow the solderpaths for the USB connector, but that didn't change anything. The last thing I am going to try is changing the USB cable. I ordered a new one. I got plenty of micro-USB cables, but I couldn't find another mini-USB cable. The cable came with the board, but maybe it's just a crappy cable. I will report back if I have tried the new cable.

I manged to flash the board using the USB-to-Serial using the options @vitor_boss gave me. So the board itself is working fine :)
vitor_boss wrote:
Tue Jul 25, 2017 4:16 pm
Lennyz1988 wrote:
Tue Jul 25, 2017 10:02 am
LED = Constant on

...
That LED is power indicator, for flash mine I use a USB serial(FTDI) adaptes connected on TX RX GND 5V header and boot0 to 3.3V using ST flash loader demo.

Or using https://github.com/danieleff/STM32GENERIC library, there is an option to use serial adapter to upload trough serial

EDIT: Try remove battery before power the board if still giving errors, happened here.
Thanks! I managed to flash the board with the "ST FLash Loader" and the library you posted. I am still figuring out what the difference is between this core and the one you posted.

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

Re: How to flash STM32_F4VE

Post by stevestrong » 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.

ag123
Posts: 716
Joined: Thu Jul 21, 2016 4:24 pm

Re: How to flash STM32_F4VE

Post by ag123 » 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

Post Reply