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

NRF Log RTT not working

Specs:

nRF52840 Development Kit

SoftDevice: S140

SDK: 15.2.0

J-Link Version: 6.40

Example SDK Project: nRF5_SDK_15.2.0_9412b96\examples\ble_peripheral\ble_app_hrs_freertos

-----------------------------------------------------------------------------------------

I am having trouble getting the RTT logging working on a number of applications. I have used other projects where this works and prints fine to my terminal application.

Steps I take:

1. Load the SoftDevice onto the board using nRFGo Studio

2. Load the example project in Keil: C:\Nordic\nRF5_SDK_15.2.0_9412b96\examples\ble_peripheral\ble_app_hrs_freertos\pca10056\s140\arm5_no_packs/ble_app_hrs_freertos_pca10056_s140.uvprojx

3. Open a terminal application and point it to the J-Link CDC UART Port (COMXX)

4. Build the application, load and run it. The terminal will print the following:

(17:49:49.682) <info> app: HRS FreeRTOS example started.
(17:49:49.689) <info> app: Fast advertising.
(17:50:02.742) <info> app: HRS FreeRTOS example started.
(17:50:02.750) <info> app: Fast advertising.

5. Now, since the NRF Log is set to UART by default in this example, I switch it to NRF_LOG_BACKEND_RTT_ENABLED, uncheck NRF_LOG_BACKEND_UART_ENABLED, and make sure the NRF_LOG_ENABLED flag is set.

6. Open J-Link RTT Viewer and connect to the board:

LOG: Device "NRF52840_XXAA" selected.
LOG: Found SW-DP with ID 0x2BA01477
LOG: Found SW-DP with ID 0x2BA01477
LOG: Scanning AP map to find all available APs
LOG: AP[2]: Stopped AP scan as end of AP map has been reached
LOG: AP[0]: AHB-AP (IDR: 0x24770011)
LOG: AP[1]: JTAG-AP (IDR: 0x02880000)
LOG: Iterating through AP map to find AHB-AP to use
LOG: AP[0]: Core found
LOG: AP[0]: AHB-AP ROM base: 0xE00FF000
LOG: CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
LOG: Found Cortex-M4 r0p1, Little endian.
LOG: FPUnit: 6 code (BP) slots and 2 literal slots
LOG: CoreSight components:
LOG: ROMTbl[0] @ E00FF000
LOG: ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
LOG: ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
LOG: ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
LOG: ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
LOG: ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
LOG: ROMTbl[0][5]: E0041000, CID: B105900D, PID: 000BB925 ETM
LOG: RTT Viewer connected.

7. Recompile and run and I get nothing on the terminal application nor the J-Link RTT Viewer. What am I missing? I have set a breakpoint on NRF_LOG_FLUSH()  (line 901 in main.c) and see that it is hit before the CPU goes to sleep.

It has to be something simple... I just cant figure it out.

Thanks!

Related