Uart not working correctly when net core flashed by hci_rpmsg

Hi,

I am using SES and NCS SDK 1.6.1 under Win10.

A GPS module is connected to NRF5340, using an UARTE to communicate. The pin receiving GPS data is P0.31. 

It works well when net core is not used or flahsed.

Now I want to use BLE together with GPS module. After I flashed the net core with "hci_rpmsg", the BLE started to work but uarte got "NRFX_UARTE_EVT_ERROR" in uarte_event_handler. Uarte cannot receive any data.

I checked my nrf5340_cpunet_reset.c in \v1.6.1\zephyr\boards\arm\nrf5340dk_nrf5340,  and P0.31 is not used by net core:

#define CPUNET_UARTE_PIN_TX  1
#define CPUNET_UARTE_PIN_RX  0
#define CPUNET_UARTE_PORT_TRX NRF_P1
#define CPUNET_UARTE_PIN_RTS 22 //11
#define CPUNET_UARTE_PIN_CTS 23 //10
 

So how can I use uarte and BLE together?

Parents Reply Children
  • That's a break and framing error. From product specification:

    An ERROR event, in the form of a framing error, will be generated if a valid stop bit is not detected in a frame. Another ERROR event, in the form of a break condition, will be generated if the RXD line is held active low for longer than the length of a data frame. Effectively, a framing error is always generated before a break condition occurs.

    What baud rate are you using? Is it the same on both sides?

  • I tested baud rate 9600 and 115200, and yes, both sides used the same baud rate at the same time. I found if BLE is not used, both 9600 and 115200 can worked well. But only 9600 can work after BLE flashed to net core. It is weird because I believe the uart signal is received by UARTE hardware, I don't understand why BLE has an influence on uart.

    I tried to set HFXO with the code below:

    NRF_CLOCK->TASKS_HFCLKSTART = 1;
    while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0);
    NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
    and nothing changed.

    Is there anything I can do?

  • Hi,

    I can't see any clear connections between the Softdevice controller and the pins that you're using. I see that P0.31 is connected to LED4 on the development kit. Maybe the application running on the app core is toggling that LED? 

    Could you try changing the RX pin to something else and see if it asserts?

    regards

    Jared 

Related