USB/UARTs not sending data

kemzoetis
Tue Jun 19, 2018 3:38 pm
Hi,

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)
{
while(1)
{
pc.printf("Hello world\n");
}
}


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

kemzoetis
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?

Thanks


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

Pito
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.

kemzoetis
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


Pito
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
}


BennehBoy
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?

stevestrong
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).


kemzoetis
Wed Jun 20, 2018 8:12 am
@stevestrong

I used PIO for mbed.

The Arduino IDE uses the the files from here https://github.com/rogerclarkmelbourne/Arduino_STM32


kemzoetis
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…


kemzoetis
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.


Pito
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.

kemzoetis
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?

Image

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%
0%ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ 100%
Flash memory programmed in 1s and 326ms.
Programming Complete.

MCU Reset.

Application started.


Pito
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.
http://wiki.stm32duino.com/index.php?ti … 4xx_boards


Leave a Reply

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