diff --git a/cpu/sam0_common/periph/uart.c b/cpu/sam0_common/periph/uart.c index 25aca6d511..a0810a9da2 100644 --- a/cpu/sam0_common/periph/uart.c +++ b/cpu/sam0_common/periph/uart.c @@ -162,6 +162,9 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg) return UART_NODEV; } + /* enable peripheral clock */ + sercom_clk_en(dev(uart)); + /* must disable here first to ensure idempotency */ dev(uart)->CTRLA.reg = 0; @@ -173,9 +176,6 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg) /* configure pins */ _configure_pins(uart); - /* enable peripheral clock */ - sercom_clk_en(dev(uart)); - /* reset the UART device */ _reset(dev(uart));