We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug The UART for the variant is misconfigured and Serial1 does NOT identify the Rx/Tx pins of the Adafruit Feather STM32F405.
Serial1
Instead, Serial3 identifies Rx/Tx, as configured in the peripheral pins file, and targeted in the variant file.
Serial3
#ifndef SERIAL_UART_INSTANCE #define SERIAL_UART_INSTANCE 3 #endif
Serial1 is the common interface for the Rx/Tx pins on Adafruit Feather boards. This can be validated by looking at the bottom of the variant header.
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. ... #ifndef SERIAL_PORT_HARDWARE #define SERIAL_PORT_HARDWARE Serial1 #endif
Not only is this unintuitive, but this breaks the portability of software between disparate Feather MCUs.
To Reproduce
Hardware:
Firmware:
#define REPRO_ON_SERIAL 0 #if REPRO_ON_SERIAL == 0 HardwareSerial txRxSerial(PIN_SERIAL_RX,PIN_SERIAL_TX); #elif REPRO_ON_SERIAL == 1 #define txRxSerial Serial1 #elif REPRO_ON_SERIAL == 2 #define txRxSerial Serial2 #elif REPRO_ON_SERIAL == 3 #define txRxSerial Serial3 #else #error "Unknown Repro Mode" #endif void setup (void) { txRxSerial.begin(115200); const size_t usb_timeout_ms = 3000; for (const size_t start_ms = millis(); !txRxSerial && (millis() - start_ms) < usb_timeout_ms;); } void loop (void) { txRxSerial.println("Hello, stm32duino!"); ::delay(5000); }
Steps to reproduce the behavior:
REPRO_ON_SERIAL
SerialX
Expected behavior
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Board (please complete the following information):
Additional context
I noticed something else strange about the configuration while I was looking through it. You specify the RX pin for UART2 in the configuration, but not the TX pin: https://github.com/stm32duino/Arduino_Core_STM32/blob/main/variants/STM32F4xx/F405RGT_F415RGT/PeripheralPins_FEATHER_F405.c#L175
The text was updated successfully, but these errors were encountered:
Hi @zfields OK, will update to this:
#ifndef SERIAL_PORT_HARDWARE #define SERIAL_PORT_HARDWARE Serial3 #endif
About
When REPRO_ON_SERIAL is either 1 or 2, then the sketch will fail to compile.
This is normal, only one default Serialx is instantiate and mapped to Serial. Up to you to instantiate Serial1 and Serial2. See https://github.com/stm32duino/Arduino_Core_STM32/wiki/API#hardwareserial
Serialx
Serial
Serial2
About UART2, yes, probably PA2 was commented because it is not connected. I will comment also PA3.
PA2
PA3
Sorry, something went wrong.
8363c25
No branches or pull requests
Describe the bug
The UART for the variant is misconfigured and
Serial1
does NOT identify the Rx/Tx pins of the Adafruit Feather STM32F405.Instead,
Serial3
identifies Rx/Tx, as configured in the peripheral pins file, and targeted in the variant file.Serial1
is the common interface for the Rx/Tx pins on Adafruit Feather boards. This can be validated by looking at the bottom of the variant header.Not only is this unintuitive, but this breaks the portability of software between disparate Feather MCUs.
To Reproduce
Hardware:
Firmware:
Steps to reproduce the behavior:
REPRO_ON_SERIAL
to the desiredSerialX
object to test.Expected behavior
REPRO_ON_SERIAL
is either 0 or 3, then the sketch will write "Hello, stm32duino!" on the Rx/Tx pins.REPRO_ON_SERIAL
is either 1 or 2, then the sketch will fail to compile.Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Board (please complete the following information):
Additional context
I noticed something else strange about the configuration while I was looking through it. You specify the RX pin for UART2 in the configuration, but not the TX pin:
https://github.com/stm32duino/Arduino_Core_STM32/blob/main/variants/STM32F4xx/F405RGT_F415RGT/PeripheralPins_FEATHER_F405.c#L175
The text was updated successfully, but these errors were encountered: