Page 1 of 1

[nRF] UART Reinitialization

Posted: Wed May 12, 2021 5:45 pm
by dbrazil
Hi,

I'm using MicroPython in a nRF52840 (PCA10056) µC that I constantly use the serial UART to talk to a peripheral.

After a serial command that restarts the peripheral, the UART works to write commands, but not to read anymore (ser.readchar()).
The peripheral's UART seems to be working because whichever serial command I send from the µC, the peripheral reacts on it.

To solve this UART reading problem, the only thing that works is to reset the µC (not the peripheral) by doing machine.reset(); then I can write and read normally using the UART interface. The MicroPython nRF ports unfortunately don't have the method UART.deinit(), which some other ports do.

What does the machine.reset() does to the UART that 'reinitializes' it and brings it back to this good state?

Thanks