Try to program a custom board using BL5340PA module to see LOG

I have made a PCB using a BL5340PA module, to start i have tried a simple code to see log from RTT using the SWD SWCLK pin, i am using an NRF5340 DK as debugger/programmer, my pin connection bewteen my board  and nrf5340 dk seem good as i was able to flash the code without error.

But still can't see the log in JLink RTT Viewer.

#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>


LOG_MODULE_REGISTER(main, LOG_LEVEL_DBG);


int main(void)
{
        LOG_INF("Hello from RTT!");
        while (1) {
                LOG_DBG("Toggling");
                 k_msleep(1000);
         }
        return 0;
}

  • CONFIG_LOG=y
    CONFIG_LOG_DEFAULT_LEVEL=4
    CONFIG_LOG_MODE_IMMEDIATE=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_LOG_BACKEND_RTT=y
    

  • LOG: J-Link RTT Viewer V8.18: Logging started.
    LOG: Connecting to J-Link via USB...
    LOG: Device "NRF5340_XXAA_APP" selected.
    LOG: ConfigTargetSettings() start
    LOG: ConfigTargetSettings() end - Took 11us
    LOG: InitTarget() start
    LOG: InitTarget() end - Took 1.33ms
    LOG: Found SW-DP with ID 0x6BA02477
    LOG: DPIDR: 0x6BA02477
    LOG: CoreSight SoC-400 or earlier
    LOG: AP map detection skipped. Manually configured AP map found.
    LOG: AP[0]: AHB-AP (IDR: Not set, ADDR: 0x00000000)
    LOG: AP[1]: AHB-AP (IDR: Not set, ADDR: 0x00000000)
    LOG: AP[2]: MEM-AP (IDR: Not set, ADDR: 0x00000000)
    LOG: AP[3]: MEM-AP (IDR: Not set, ADDR: 0x00000000)
    LOG: AP[0]: Core found
    LOG: AP[0]: AHB-AP ROM base: 0xE00FE000
    LOG: CPUID register: 0x410FD214. Implementer code: 0x41 (ARM)
    LOG: Feature set: Mainline
    LOG: Cache: No cache
    LOG: Found Cortex-M33 r0p4, Little endian.
    LOG: FPUnit: 8 code (BP) slots and 0 literal slots
    LOG: Security extension: implemented
    LOG: Secure debug: enabled
    LOG: CoreSight components:
    LOG: ROMTbl[0] @ E00FE000
    LOG: [0][0]: E00FF000 CID B105100D PID 000BB4C9 ROM Table
    LOG: ROMTbl[1] @ E00FF000
    LOG: [1][0]: E000E000 CID B105900D PID 000BBD21 DEVARCH 47702A04 DEVTYPE 00 Cortex-M33
    LOG: [1][1]: E0001000 CID B105900D PID 000BBD21 DEVARCH 47701A02 DEVTYPE 00 DWT
    LOG: [1][2]: E0002000 CID B105900D PID 000BBD21 DEVARCH 47701A03 DEVTYPE 00 FPB
    LOG: [1][3]: E0000000 CID B105900D PID 000BBD21 DEVARCH 47701A01 DEVTYPE 43 ITM
    LOG: [1][5]: E0041000 CID B105900D PID 002BBD21 DEVARCH 47724A13 DEVTYPE 13 ETM
    LOG: [1][6]: E0042000 CID B105900D PID 000BBD21 DEVARCH 47701A14 DEVTYPE 14 CSS600-CTI
    LOG: [0][1]: E0040000 CID B105900D PID 000BBD21 DEVARCH 00000000 DEVTYPE 11 TPIU
    LOG: RTT Viewer connected.
    

  • Is it necessary to create a custom boards on my folders or i can just compile the code using nrf5340dk_nrf5340_cpuapp ? 

  • Depends.

    I got away using the dk board with a lot of DTS magic in the overlay. Its quite powerful once you learn how to delete nodes and properties.

    Note that you MUST customise prj.conf and the DTS if you are missing the LF crystal or the DC/DC inductor.

  • Ok thanks yes i think i flash code but my module is not enable to run it, probably i need custom files like DTS, i go check how to do that

Related