NRF54 BLE UART PERIPHERAL works only when the debugger is connected

Hi,

We are currently working on a new product based on NRF54L15.

Goal :
We are trying to set up the "Bluetooth LE UART service" example in order to transmit and receive data via BLE (nrf connect for mobile) and display the data in a serial monitor.

Configuration
1) This is the schematic


2) This is the "nrf54l15dk_nrf54l15_cpuapp.overlay"
 

/ {
	chosen {
		nordic,nus-uart = &uart20;
	};
};


&spi00 {
	status = "disabled";
};

&uart20_default {
	group1 {
		psels = <NRF_PSEL(UART_TX, 2, 2)>, <NRF_PSEL(UART_RTS, 2, 4)>;
	};

	group2 {
		psels = <NRF_PSEL(UART_RX, 2, 0)>, <NRF_PSEL(UART_CTS, 2, 5)>;
	};
};


&lfxo {
	status = "disabled";
};

&uart20_sleep {
	group1 {
		psels = <NRF_PSEL(UART_TX, 2, 2)>,
				<NRF_PSEL(UART_RX, 2, 0)>,
				<NRF_PSEL(UART_RTS, 2, 4)>,
				<NRF_PSEL(UART_CTS, 2, 5)>;
	};
};


3) This is the "prj.conf"
# Enable the UART driver
CONFIG_UART_ASYNC_API=y
CONFIG_NRFX_UARTE0=y
CONFIG_SERIAL=y

CONFIG_GPIO=y

# Make sure printk is printing to the UART console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

CONFIG_HEAP_MEM_POOL_SIZE=2048

CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME="Nordic_UART_Service"
CONFIG_BT_MAX_CONN=1
CONFIG_BT_MAX_PAIRED=1

# Enable the NUS service
CONFIG_BT_NUS=y

# Enable bonding
CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y

# Enable DK LED and Buttons library
CONFIG_DK_LIBRARY=y

# This example requires more stack
CONFIG_MAIN_STACK_SIZE=1152
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

# Config logger
CONFIG_LOG=n
CONFIG_USE_SEGGER_RTT=n
CONFIG_LOG_BACKEND_RTT=n
CONFIG_LOG_BACKEND_UART=n
CONFIG_LOG_PRINTK=n

CONFIG_ASSERT=y

CONFIG_SPI_NOR=n
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_FIXED_RATE_CLOCK=y


4) We are using nrf v2.9.1 sdk, v2.9.1 toolchain with nrf connect vs code extension.

5) The debugger is a j-link.

6) Chip reference nRF54L15-QFBB

Behaviour :
1) When the program starts we observe the following message :

** Booting My Application v2.9.1-e9d3107cba3d ***
*** Using nRF Connect SDK v2.9.1-60d0d6c8d42d ***
*** Using Zephyr OS v3.799-ca954a6216c9 ***
Starting Nordic UART service example

2) When we transmit via RX characteristic "hello\nworld\n" here is the message displayed : 

3) When we transmit "test\n" via the serial monitor, the TX characteristic doesn't display anything.

4) After connecting the debugger (*). We then transmit via RX characteristic "nordic\nsemi\n". Here is the message displayed : 


4) While the the debugger is still connected (*). We then transmit "nrf\n" via the serial monitor the TX characteristic. Here is the message displayed :
"nnrf"

(*): The debugger has to be plugged and connected. The debugger uses SWD.

Questions
:

  1. Debugger Dependency Issue:
    The application only runs when the debugger is attached. How can we ensure it functions properly in standalone mode ?

  2. Character Rendering Problem:
    Some characters appear missing or corrupted. What steps can we take to diagnose and resolve this issue ?



Thank you for your help.

  • Hello,

    What is the buffer size you set for the sample in configuration? If the goal is to transfer large chunks of data, 128-512 bytes would be more appropriate. You can set this in the config file

    CONFIG_BT_NUS_UART_BUFFER_SIZE=x

    Did you set the baudrate 115200 in the terminal?

  • Hi,
     
    - We kept the default value of 128 for CONFIG_BT_NUS_UART_BUFFER_SIZE, as it is sufficient for our current data transmission needs.

    - The baud rate is set to 115200. Below is the full configuration output from stty -F /dev/ttyLP2 -a

    speed 115200 baud;stty: /dev/ttyLP2
     line = 0;
    intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q;
    stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
    -parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
    -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8
    opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
    isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho -extproc

  • Hi,

    I found a similar issue here nRF54L15: UART pinout not working unless connecting the RTT viewer.

    This appears to be a temporary workaround :
     

    #include <uart_async_adapter.h>
    
    ...
    
    int main(void) {
      NRF_TAD->ENABLE = 1;
      ...
    }


    It would be interesting to understand why the application require this special mode (Enable debug domain and aquire selected GPIOs).

    Do you have any information on the subject ? Thanks

  • Hello,

    Apart from the default pin sets for UART communication on NRF54L15

    You Can connect across power domains to dedicated pins on P2. You have to change the overlay file. 

    Selected pins of P2 can be used for some serial interfaces in the peripheral domain — SPIM, SPIS, and UARTE. This is not the most power-efficient way of connecting these serial interfaces but adds flexibility when designing a circuit board. When setting up the peripheral's PSEL register for cross-domain connections, it must be connected only to the corresponding function listed in the pin assignments table. For example, the peripheral's PSEL.SCK register must use the P2 SCK pin from the pin assignment table. The pin assignments table shows which pins can be configured for cross power-domain connections.

    You have to change the device tree accordingly, in the hardware the RX and TX pin should be powered from the default pin; as its mentioned in the previous case ''Connected wires from P1.04/05 -> P2.07/08 on the DK for easier access to the uart console.''. You can also connect P2.07 or P2.08 with external UART or US converter.

    You also need to add this kconfig in the prj.conf file

    CONFIG_SOC_NRF_FORCE_CONSTLAT=y

Related