I'm using SERCOM0 and SERCOM3 in an application
The initialisation runs correctly on SERCOM0, but hangs when enabling the USART for SERCOM3
At entry to the following code the registers SERCOM->CTRLA and BAUD are identical for both SERCOMs
The code is:
SERCOM3->USART.CTRLB.bit.RXEN = 0x01;
SERCOM3->USART.CTRLA.bit.ENABLE = 1u; /* Enable the receiver */
On setting CTRLA.ENABLE the SERCOM3->SYNCBUSY bits ENABLE and CTRLA bits get set, so the next statement loops for ever. They are not set on SERCOM0.
The same code on SERCOM1 hangs as well
On page 411 of the SAMD21 datasheet it reads "Writing '1' to CTRLB.RXEN when the USART is disabled will set CTRLB.RXEN immediately. When the
USART is enabled, CTRLB.RXEN will be cleared, and SYNCBUSY.CTRLB will be set and remain set
until the receiver is enabled. When the receiver is enabled, CTRLB.RXEN will read back as '1'."
I tried setting CTRLB.RXEN after the enable, it resulted in a hard fault...
Thanks for any good ideas, I've been messing about with this problem for a few hours