Using PB22 pin as Serial RX

Hello guys,

i have made a custom board with SAMD21 and arduino zero bootloader that exposes pin PB22 (EDBG_UART TX | *SERCOM5/PAD[2]).

I would like to use it as a RX pin and not TX, is this possible? i have tried to change the variant.h

// Serial (EDBG)
#define PIN_SERIAL_RX (31ul)
#define PIN_SERIAL_TX (30ul)
#define PAD_SERIAL_TX (UART_TX_PAD_2)
#define PAD_SERIAL_RX (SERCOM_RX_PAD_3)

to this

// Serial (EDBG)
#define PIN_SERIAL_RX (30ul)
#define PIN_SERIAL_TX (31ul)
#define PAD_SERIAL_TX (UART_TX_PAD_2)
#define PAD_SERIAL_RX (SERCOM_RX_PAD_2)

with no success

do you have any idea how can i use PB22 pin on SAMD21 as Serial RX line??

thank you very much!!

OK i managed this myself,

i changed the above to

/*

  • Serial interfaces
    */
    // Serial (EDBG)
    #define PIN_SERIAL_RX (30ul)
    #define PIN_SERIAL_TX (20ul)
    #define PAD_SERIAL_TX (UART_TX_PAD_0)
    #define PAD_SERIAL_RX (SERCOM_RX_PAD_2)

and i am using the Serial object and its working now....

Have fun!