This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Why does using P0.0 as uart RX cause BLE stack to hang?

I have a custom board that doesn't use the external 32Khz crystal. The engineer that designed it chose to use P0.0 as UART RX. (I know, poor choice.) I have set up a custom_board.h file with the RC oscillator and if I set the RX as P0.8, it works fine. If I only change the RX port to P0.0, it hangs in ble_init(). Is there a reason that P0.0 can't be used as a UART with the BLE stack? I am running S132 on SDK 11.0 with a BMD-300 module using an nRF52832 processor.

Thanks for any insight that you can provide.

Edit: The port works fine when I run it without the BLE stack.

Parents
  • I tested this on the DK and got the same problem, using pin 0 or 1 as UART RX would cause the device to hang at the next SoftDevice call it seemed.

    After some investigation I found out that it was actually the UART event handler calling the APP_ERROR_HANDLER because of a APP_UART_COMMUNICATION_ERROR event. Defining DEBUG in the preprocessor symbols showed that the application would go into the error handler and stop the execution.

    The problem is that when using pin 0 or 1 for UART RX the UART peripheral will get an error event as soon as it is enabled, which will lead to the UART event handler calling the error handler. The solution is to ignore the first APP_UART_COMMUNICATION_ERROR and not call APP_ERROR_HANDLER(p_event->data.error_communication).

    The problem is not related to the SoftDevice. I tested without enabling the SoftDevice and got the same error.

    I will report this internally so that we can fix this. Thank you for noticing the issue.

  • Try one more thing. Change TX_PIN_NUMBER to 1 and then loopback 1 to 0. I think you are just seeing noise. Without the loopback, I get the uart error. With the loopback, I don't get any uart events at all. Even with the loopback, I get the spurious interrupt on 0 during SOFTDEVICE_HANDLER_INIT with the BLE code uncommented. Edit: or just tie 0 to ground.

Reply
  • Try one more thing. Change TX_PIN_NUMBER to 1 and then loopback 1 to 0. I think you are just seeing noise. Without the loopback, I get the uart error. With the loopback, I don't get any uart events at all. Even with the loopback, I get the spurious interrupt on 0 during SOFTDEVICE_HANDLER_INIT with the BLE code uncommented. Edit: or just tie 0 to ground.

Children
No Data
Related