UART config not possible

Hey Guys

I am currently working on a project where i would like to read some data via the Serial Port (Pin 17 RX) on my Arduino Due.

The data has 8bit parity is even and 2 stop bits.

The data is coming from a RC-Contrler via an SBUS intface (every thing works and was measuret in the analoge domain).

If i try to configure the Serial2 via:

IN: [SBUS_exampleMy]

SBUS Sbus(Serial2); (constructor)

IN: [sbus.h]

class SBUS{
SBUS(HardwareSerial& bus);

IN: [sbus.cpp]

SBUS::SBUS(HardwareSerial& bus)
_bus = &bus;


I just get:

Arduino: 1.8.12 (Windows 10), Board: “Arduino Due (Programming Port)”

F:\Documents\Arduino\libraries\Bolder_Flight_Systems_SBUS\src\SBUS.cpp: In member function ‘void SBUS::begin()’:

F:\Documents\Arduino\libraries\Bolder_Flight_Systems_SBUS\src\SBUS.cpp:60:35: error: no matching function for call to ‘HardwareSerial::begin(const uint32_t&, UARTClass::UARTModes)’



F:\Documents\Arduino\libraries\Bolder_Flight_Systems_SBUS\src\SBUS.cpp:60:35: note: candidate is:

In file included from C:\Users____\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\cores\arduino/Arduino.h:195:0,

from F:\Documents\Arduino\libraries\Bolder_Flight_Systems_SBUS\src\SBUS.h:27,

from F:\Documents\Arduino\libraries\Bolder_Flight_Systems_SBUS\src\SBUS.cpp:24:

C:\Users___\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\cores\arduino/HardwareSerial.h:29:18: note: virtual void HardwareSerial::begin(long unsigned int)

virtual void begin(unsigned long);


C:\Users___\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\cores\arduino/HardwareSerial.h:29:18: note: candidate expects 1 argument, 2 provided

exit status 1
Error compiling for board Arduino Due (Programming Port).

By searching in the web i found some old posts where the conclusion was that config is not yet implemented is that true? And is there a workaround for it?

I realy need help i dont know what to do anymore…

Thank you very much for any feedback

HardwareSerial.h (1.31 KB)

SBUS.h (3.22 KB)

SBUS.cpp (11.9 KB)

SBUS_exampleMy.ino (2.43 KB)

Note that RX2 is for Serial2, and Serial2 is USART1.

Try this example sketch where I alter some USART parameters before sending/receiving. Likewise you can alter parameters for number of bits/parity/stop bits as necessary after reading the default parameters in US_MR register after initialization. Of course you'll have to adjust the baud rate.

These informations are page 828 of Sam3x datasheet.

/* Jumper between RX1 and TX2, and another one between TX1 and RX2   */

char c = 0;
void setup() {

  Serial1.begin(2500000); // USART0
  Serial2.begin(2500000); // USART1


void loop() {
  String s;
  s = "";

  while (Serial1.available() > 0) {
    c =;
    s += c;

  if (s.length() > 0) {

Thank you very much for your reply!

You are a true legend! I got it to work.

Also the hint about the datasheet was very helpful.

Thank you and have a great day!

Hi both,

Do you alter the USART parameters prior to using the SBUS library as normal? Or how do these changes fit in with the original SBUS_exampleMy.ino sketch?