Hello Jared,
the previous ticket find under the following link is locked. So I decided to open a new one.
https://devzone.nordicsemi.com/f/nordic-q-a/80312/uart-break-detection-failed
Your last answer was:
The reset value is 0 for the ERRORSRC register. Setting it to 0x0C will set the framing and break bit to present. Could you instead modify the nrf_uarte_errorsrc_get_and_clear() by first checking which bit that is high and then resetting it by writing a 0 to the register?
That´s not the behavior of the ERRORSRC register. I tried to write in a clear ERRORSRC register 0xC but nothing changed, the content of the register is still 0. After sending a break from a peer device, the content of the ERRORSRC register is 0xC. After writing 0x4 to the register, the content is 0x8 and after writng 0x8 to the register then the content is 0. That means that individual bits in the register can only be cleared by writing a 1 on the individual bit position. Thats exactly what the funtction "nrf_uare_errorsrc_get_and_clear" does!
Your last question was:
Could you elaborate on the necessity for the delay?
With a baudrate of 9600 Baud a minimum delay of 70us was necessary to get a reliable break detection. For security reason, I will use 100us.
__STATIC_INLINE uint32_t nrf_uarte_errorsrc_get_and_clear(NRF_UARTE_Type * p_reg) { nrf_delay_us(100); uint32_t errsrc_mask = p_reg->ERRORSRC; p_reg->ERRORSRC = errsrc_mask; return errsrc_mask; }
Best Regards
Rainer