Low power uart timeout causes micro to hang up

Hi, we are using the LPUART in async mode to communicate between an nRF52840 and an nRF9160. Everything works well except when a timeout occurs. I noticed this when the other micro is being bootloaded and the nRF52 tries to communicate with it. It is possible to replicate this using:
1. C:\ncs\v2.2.0\nrf\samples\peripheral\lpuart example
2. nRF52840DK

For this example you need to connect RX and TX together and also the request and response pins. Leave all these pins unconnected to force a timeout.

To me it looks like the following happens:

1. When the example starts, the req pin goes high.
2. After 10 seconds the timer interrupt calls tx_complete (uart_nrf_sw_lpuart.c line 368). This calls pend_req_pin_idle which waits for the line to be high and then make it low.
3. This causes the pin interrupt to trigger, which calls tx_complete a second time. In here it waits forever in a while loop for the pin to be high. Because this is called from an interrupt context it causes the nRF52 to become completely unresponsive.

Can you please give me advice about this?

Parents
  • Hi Hubert

    I discussed this with one of the developers. He needs to do some maintenance work on the LPUART driver, and will have a look at this issue as well. It will be a bit of a wait until he has time to look into it though, I will ask if he can provide a schedule for a fix. 

    In the mean time would it be an acceptable workaround to enable the watchdog on the nRF52 side? 
    Then the MCU would reset rather than just locking up, which should allow it to recover. 

    Best regards
    Torbjørn

Reply
  • Hi Hubert

    I discussed this with one of the developers. He needs to do some maintenance work on the LPUART driver, and will have a look at this issue as well. It will be a bit of a wait until he has time to look into it though, I will ask if he can provide a schedule for a fix. 

    In the mean time would it be an acceptable workaround to enable the watchdog on the nRF52 side? 
    Then the MCU would reset rather than just locking up, which should allow it to recover. 

    Best regards
    Torbjørn

Children
Related