Swan serial ports in Arduino


According to the datasheet Swan has several Serial ports, I was wondering how these are defined for Arduino. Looking at the variant file I see the following. I am no Arduino experts but I would expect to see a few more of these defined ? T what extent is the variants file for the Swan complete ?

#ifdef __cplusplus
  // These serial port names are intended to allow libraries and architecture-neutral
  // sketches to automatically default to the correct port name for a particular type
  // of use.  For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
  // the first hardware serial port whose RX/TX pins are not dedicated to another use.
  // SERIAL_PORT_MONITOR        Port which normally prints to the Arduino Serial Monitor
  // SERIAL_PORT_USBVIRTUAL     Port which is USB virtual serial
  // SERIAL_PORT_LINUXBRIDGE    Port which connects to a Linux system via Bridge library
  // SERIAL_PORT_HARDWARE       Hardware serial port, physical RX & TX pins.
  // SERIAL_PORT_HARDWARE_OPEN  Hardware serial ports which are open for use.  Their RX & TX
  //                            pins are NOT connected to anything by default.
    #define SERIAL_PORT_MONITOR   Serial
    #define SERIAL_PORT_HARDWARE  Serial


Looking at the Swan pinouts (Swan Carrier Board to STM32 Mapping) Blues Swan Datasheet - Blues Wireless Developers I am assuming that

TX and RX are not the same as TX0 and RX0 ? In which case the RX and TX exposed in the feather headers are the same serial port as that which the USB connection uses and cannot be used by external hardware, right ? Seems a little strange that if you can already access that serial port via USB you would exposed it via headers as well instead of exposing an available port but maybe thats a “feather” thing.

Is TX and RX in essence what the USB serial is connected to ?
In this case shouldn’t TX0 an RX0 be labeled TX1 and RX1 to follow some sort or logic ?


OK got this working now.

HardwareSerial sensorSerial(PA10, PA9);

And use the Tx and Rx pins on the Notecarrier AF. For some reason I had to restart the sensor as well.

Good info here : API · stm32duino/wiki Wiki · GitHub