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");
}
}
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
Serial works via USB.
@ 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
#include "Arduino.h"
void setup() {
Serial1.begin(9600); // PA9=USART1_TX and PA10=USART1_RX
}
void loop() {
Serial1.println("Hello World!"); // ! is important
}
[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).
I used PIO for mbed.
The Arduino IDE uses the the files from here https://github.com/rogerclarkmelbourne/Arduino_STM32
Trying again now…
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.
2. How do you flash the binary into the board?
3. Post the log from Arduino IDE on the compilation results.
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%
0%ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ 100%
Flash memory programmed in 1s and 326ms.
Programming Complete.
MCU Reset.
Application started.
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