diff --git a/boards/samr21-xpro/Kconfig b/boards/samr21-xpro/Kconfig index 76a6677fcd..f0f73c4cb1 100644 --- a/boards/samr21-xpro/Kconfig +++ b/boards/samr21-xpro/Kconfig @@ -19,5 +19,6 @@ config BOARD_SAMR21_XPRO select HAS_PERIPH_SPI select HAS_PERIPH_TIMER select HAS_PERIPH_UART + select HAS_PERIPH_UART_HW_FC select HAS_PERIPH_USBDEV select HAS_RIOTBOOT diff --git a/boards/samr21-xpro/Makefile.features b/boards/samr21-xpro/Makefile.features index 3fb3bb44eb..6800fd1f5c 100644 --- a/boards/samr21-xpro/Makefile.features +++ b/boards/samr21-xpro/Makefile.features @@ -10,6 +10,7 @@ FEATURES_PROVIDED += periph_rtt FEATURES_PROVIDED += periph_spi FEATURES_PROVIDED += periph_timer FEATURES_PROVIDED += periph_uart +FEATURES_PROVIDED += periph_uart_hw_fc FEATURES_PROVIDED += periph_usbdev # Put other features for this board (in alphabetical order) diff --git a/boards/samr21-xpro/doc.txt b/boards/samr21-xpro/doc.txt index 4fdd081a91..7f57265374 100644 --- a/boards/samr21-xpro/doc.txt +++ b/boards/samr21-xpro/doc.txt @@ -157,6 +157,21 @@ specific board like this: BOARD=samr21-xpro SERIAL="ATML2127031800002124" make debug +## Accessing STDIO via UART + +STDIO is available through the edbg debugger. + +Use the `term` target to open a terminal: + + make BOARD=samr21-xpro -C examples/hello-world term + +RTS / CTS hardware flow control is available on `UART_DEV(0)` and +`UART_DEV(1)`. This is unavailable when using STDIO directly through +the debugger since it does not support it. Therefore to use hardware +flow control an external FTDI device must be connected to the board's +rx, tx, cts & rts matching pin headers, eg. for `UART_DEV(0)` to +`PA5`, `PA4`, `PA6` & `PA7` (respectively) on EXT1 headers. + ## Supported Toolchains diff --git a/boards/samr21-xpro/include/periph_conf.h b/boards/samr21-xpro/include/periph_conf.h index 847103a57c..aab2901b4b 100644 --- a/boards/samr21-xpro/include/periph_conf.h +++ b/boards/samr21-xpro/include/periph_conf.h @@ -147,12 +147,16 @@ static const uart_conf_t uart_config[] = { .rx_pin = GPIO_PIN(PA,5), .tx_pin = GPIO_PIN(PA,4), #ifdef MODULE_PERIPH_UART_HW_FC - .rts_pin = GPIO_UNDEF, - .cts_pin = GPIO_UNDEF, + .rts_pin = GPIO_PIN(PA,6), + .cts_pin = GPIO_PIN(PA,7), #endif .mux = GPIO_MUX_D, .rx_pad = UART_PAD_RX_1, +#ifdef MODULE_PERIPH_UART_HW_FC + .tx_pad = UART_PAD_TX_0_RTS_2_CTS_3, +#else .tx_pad = UART_PAD_TX_0, +#endif .flags = UART_FLAG_NONE, .gclk_src = SAM0_GCLK_MAIN, }, @@ -161,12 +165,16 @@ static const uart_conf_t uart_config[] = { .rx_pin = GPIO_PIN(PA,23), .tx_pin = GPIO_PIN(PA,22), #ifdef MODULE_PERIPH_UART_HW_FC - .rts_pin = GPIO_UNDEF, - .cts_pin = GPIO_UNDEF, + .rts_pin = GPIO_PIN(PB,22), + .cts_pin = GPIO_PIN(PB,23), #endif .mux = GPIO_MUX_D, .rx_pad = UART_PAD_RX_1, +#ifdef MODULE_PERIPH_UART_HW_FC + .tx_pad = UART_PAD_TX_0_RTS_2_CTS_3, +#else .tx_pad = UART_PAD_TX_0, +#endif .flags = UART_FLAG_NONE, .gclk_src = SAM0_GCLK_MAIN, }