-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Core 2.1.0
Arduino IDE 1.8.16
Linux 64 bit
I'm developing a board with a STM32F405ZGT6 processor. I'm using the variant "GenericF407ZGTx" because it has the pheripherals that I need.
I need Serial1, Serial4 and Serial5, so I wrote the declaration code in this way:
// RX TX
HardwareSerial Serial1(PA10, PA9);
// RX TX
HardwareSerial Serial5(PD2, PC12);
// RX TX
HardwareSerial Serial4(PC11, PC10);
But, if I compile the code, the copiler tells me that Serial4 is already declared in HardwareSerial.cpp.
So I opened te file variant_generic.h (under hardware\stm32\2.1.0\variants\STM32F4xx\F407Z(E-G)T and changed the line:
// UART Definitions
#ifndef SERIAL_UART_INSTANCE
#define SERIAL_UART_INSTANCE 4
#endif
in:
// UART Definitions
#ifndef SERIAL_UART_INSTANCE
#define SERIAL_UART_INSTANCE 6
#endif
In this way, sketch compiles and serial is running.
What is the purpose of this define?
Is there something that I need to do to make serial4 work without modify sources?
Best regards.
Luca