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.

  • You are correct, connecting RX pin to a VDD or TX will remove the issue (however connect it to ground did not solve it for me). It is probably just noise and P0.00 or P0.01 is more susceptible for noise, but this can be the PCB as much as the chip itself.

    I still see no difference when I enable the SoftDevice.

Reply Children
No Data
Related