USB/UARTs not sending data

Tue Jun 19, 2018 3:38 pm

I purchased a STM32F407GV board and I am unable to get anything out on any of the UARTs. Toggling outputs work ok.
I tried with both the Arduino and mbed framework syntax. It compiles fine and uploads, but there’s no output on any pins, no matter what I do.
I checked with a scope and theres no voltage change on any pins.

I used simple code like:
#include <mbed.h>
Serial pc(USBTX, USBRX);
int main(void)
pc.printf("Hello world\n");

Tue Jun 19, 2018 5:30 pm
Please give us links to the used board and to used core.

Tue Jun 19, 2018 7:15 pm
Hi stevestrong,

I used the toolchains installed via the Atom/Platform IO and Arduino IDEs.
I’m not sure about a link for the PlatformIO stuff, but the Arduino link is the rogerclarke github.

Is that helpful?


Tue Jun 19, 2018 7:27 pm
STM32F407GV ? Do you mean STM32F407VG?

Tue Jun 19, 2018 7:44 pm
You cannot get something from UARTs when using Serial, use Serial1 and/or Serial2 and/or Serial3 instead.
Serial works via USB.

Tue Jun 19, 2018 8:46 pm
@ BennehBoy – Yes you are correct.

@ Pito – Could you elaborate on that? Exactly what do you mean?

I have a TTL-to-USB converter attached to Tx and Rx on UART outputs, but I still get nothing out.
I can toggle digital pins, but no comms.

PlatformIO STM32 version 4.3.0
Arduino IDE 1.8.5, STM32 board version: newest from github

Tue Jun 19, 2018 9:16 pm
#include "Arduino.h"

void setup() {
Serial1.begin(9600); // PA9=USART1_TX and PA10=USART1_RX

void loop() {
Serial1.println("Hello World!"); // ! is important

Tue Jun 19, 2018 9:41 pm
@Pito certainly knows more than I in relationship to how mature Roger’s core is at handling the Discovery F407, but I would’ve though that STM32GENERIC or the Official STM core would be a better choice for this board?

Wed Jun 20, 2018 7:34 am
[kemzoetis – Tue Jun 19, 2018 8:46 pm] –
PlatformIO STM32 version 4.3.0
Arduino IDE 1.8.5, STM32 board version: newest from github

I don’t get it.
Is it now Arduino or PIO?
And which STM32 version precisely? From which github page?
In this forum only Arduino IDE is supported (officially).

Wed Jun 20, 2018 8:12 am

I used PIO for mbed.

The Arduino IDE uses the the files from here

Wed Jun 20, 2018 8:17 am
I see that I used the board cores from ST Microelectronics, not the ones from STM32Duino.

Trying again now…

Wed Jun 20, 2018 8:34 am
Serial still not working…

When I use Serial1, I get just noise on PA9. But I don’t get just a gnd signal or a high signal, just noise.

Wed Jun 20, 2018 9:42 am
1. Post the link to your board (or shot a picture of it)
2. How do you flash the binary into the board?
3. Post the log from Arduino IDE on the compilation results.

Wed Jun 20, 2018 10:18 am
I managed to get serial out on UART 4, pins A0 and A1.
Is there a difference to how USART and UART are used?


I flash by either the arduino IDE or Atom/PIO or STLink utility.

Console output:
Sketch uses 19804 bytes (3%) of program storage space. Maximum is 514288 bytes.
Global variables use 11920 bytes (9%) of dynamic memory, leaving 119152 bytes for local variables. Maximum is 131072 bytes.
STM32 ST-LINK CLI v2.1.0
STM32 ST-LINK Command Line Interface

ST-LINK SN : 0667FF373333484D43024826
ST-LINK Firmware version : V2J31M21
Connected via SWD.
SWD Frequency = 1800K.
Connection mode : Normal.
Device ID:0x413
Device flash Size : 1024 Kbytes
Device family :STM32F40xx/F41xx

Loading file...
Flash Programming:
File : C:\Users\madsenk\AppData\Local\Temp\1\arduino_build_848928\led_test.ino.bin
Address : 0x08000000
Flash memory programming...
±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± 0%
Flash memory programmed in 1s and 326ms.
Programming Complete.

MCU Reset.

Application started.

Wed Jun 20, 2018 11:01 am
F4Discovery board is using a lot of pins for various hw there on the board. So you have to doublecheck whether the pins are actually free.
Also not sure how well is this board supported by the Roger’s core.

The mini USB connector there is the STLink – you cannot use it for Serial communication.
The micro USB – it may work as the Serial over USB, but have to be supported by sw (no idea whether it is supported).

I ran the board with chibios (the best supported board, HAL based) many years back. That board is rarely used here with stm32duino. People do prefer those $8-$13 F407 boards from ebay/ali (several blue/black 407V/Z variants) – with an sdcard socket, rtc with a battery socket, jtag/swd connectors, serial header, some of them have got a SPI flash and an external SDRAM. … 4xx_boards

Leave a Reply

Your email address will not be published. Required fields are marked *