sparkfun / Arduino_Boards

Board definitions for SparkFun-manufactured AVR, ARM, and ESP-based Arduino boards.
267 stars 123 forks source link

Sparkfun SAMD21 boards don't #define SERIAL_PORT_MONITOR correctly. #37

Closed WestfW closed 6 years ago

WestfW commented 6 years ago

According to the comments in variant.h:

// 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

However, the Sparkfun SAMD21 boards seem to have copied the Arduino Zero variant.h file, which has it's hardware serial port connected through the EDBG chip to the "programming" USB port, and this use "Serial" at the default "monitor" port

#define SERIAL_PORT_USBVIRTUAL      SerialUSB
#define SERIAL_PORT_MONITOR         Serial

But the Sparkfun boards all lack a USB/Serial converter of any kind, and IMO should therefore have

#define SERIAL_PORT_MONITOR SerialUSB

(Not that I've ever seen anyone use SERIAL_PORT_MONITOR, but I did just write a sketch that could use it!)

mgrusin commented 6 years ago

Thanks Bill, I'm sure you're right, let me dig into it a bit.

jimblom commented 6 years ago

@WestfW This should be fixed in the latest update to the SAMD core. (SparkFun v.1.5.0).

(I'd love to see more examples use macros like SERIAL_PORT_MONITOR and LED_BUILTIN, but...we'll see...)