Trouble Connecting SAMD51 using Arduino RPC Library

I’m using a Wio Terminal with the Arduino IDE and I’m getting an error when I try to compile the openmv_popular_features_as_the_control_device_example.

The Wio Terminal uses a SAMD51 device which does not use Software Serial but it does have a second Hardware Serial port that is used as a UART (Serial1). I tried uncommenting the line for hardware_serial1 but I get the following error: ‘rpc_hardware_serial1_uart_master’ in namespace ‘openmv’ does not name a type

Here is the block of code with the line I uncommented at the end:

// Uncomment the below line to setup your Arduino for controlling over a hardware UART.
// * baudrate - Serial Baudrate.
// NOTE: Master and slave baud rates must match. Connect master tx to slave rx and master rx to
// slave tx. Finally, both devices must share a common ground.
// WARNING: The program and debug port for your Arduino may be “Serial”. If so, you cannot use
// “Serial” to connect to an OpenMV Cam without blocking your Arduino’s ability to
// be programmed and use print/println.
// openmv::rpc_hardware_serial_uart_master → Serial
// openmv::rpc_hardware_serial1_uart_master → Serial1
// openmv::rpc_hardware_serial2_uart_master → Serial2
// openmv::rpc_hardware_serial3_uart_master → Serial3
openmv::rpc_hardware_serial1_uart_master interface(115200);

Should I be specifying this differently?


I have some ifdefs in my code that enable the serial ports. If that does doesn’t define the right thing then the ifdefs won’t work.

Please let me know what board support packages and board versions I need for the Arduino IDE to compile this.

I am using the Seeed SAMD Boards package version 1.7.9
The specific board is the Seeeduino Wio Terminal.

There are 3 hardware serial ports configured
Serial for the monitor/upload port
Serial1 for the available UART ← this is what I am trying to use
Serial2 for the WiFi/BT interface



Just to let you know that I figured it out. On the SAMD parts (21 and 51) that I am using, SERIAL_PORT_HARDWARE is defined as Serial1.



Ah, sorry, I forgot about this.

Then The default Serial should work for you.

Hi Nyamekye-

You might also want to add to the instructions which pins on the camera to use (or did I just totally miss them?). I looked at the pinout and didn’t realize there were two UARTs and I2C buses to choose from and so I was getting the “1 second and freeze” problem.

BUT, after a little more investigation, I did get it working with both hardware UART and I2C on a Pololu A-Star (Leonardo). it’s all pretty slick!

Good catch, that’s not in the documentation.