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

Two UART example for the nRF52833 DK with SDK17.0.2 for Keil uVision

I am looking for an example where I can enable UARTE0 and UARTE1 on the nRF52833 DK.  I am using nRF5_SDK_17.0.2 with Keil uVision V5.  I am successful with the loopback example in examples > peripheral > uart > pca10100, and looking in the forums I understand that I need to use examples > peripheral > libuarte for the two UART configuration.  Could I get some guidance on how to modify the pca10056 example to work for the pca10100, and ultimately modified to enable the second UART port?  Thank you very much.

Parents Reply Children
  • Hi Simon,

    I modified the libuarte example for a second UART port (second UART on P0.17 and P0.19) based on information from this post:
    devzone.nordicsemi.com/.../running-two-libuarte---rx-not-working-on-libuarte0

    I also inserted additional log commands for viewing when the initialization is done, and when data is received on the UART pins. My sdk_config.h originally had NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED 1. The manual log statements I inserted in the code show up in the RTT viewer in this format for the terminal window:

    00> <info> app: Init0 err_code: 0
    00>
    00>
    00> <info> app: Init1 err_code: 0
    00>
    00>
    00> <info> app: Finished init
    00>
    00> <info> app: Received data0
    00>
    00> <info> app: Received data0
    00>
    00> <info> app: Received data0
    00>
    00> <info> app: Received data0
    00>
    00> <info> app: Received data0
    00>

    Changing it to NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED 0, the behavior is changed to show the following:

    00> <info> app: Init0 err_code: 0
    00>
    00> <info> app: Init1 err_code: 0
    00>
    00> <info> app: Finished init
    00> <info> app: Received data0
    00> <info> app: Received data0
    00> <info> app: Received data0
    00> <info> app: Received data0
    00> <info> app: Received data0

    The window below the terminal window in the J-Link RTT Viewer V6.88a shows additional messages when connecting, which appears to be the same immediately after the flash download (with the program not running) and after running nrfjprog -r (when the program is running). When the program is running, the terminal shows the messages I inserted as well as the LEDs on the DK is illuminated, otherwise there is no activity.

    LOG: J-Link RTT Viewer V6.88a: Logging started.
    LOG: Terminal 0 added.
    LOG: Connecting to J-Link via USB...
    LOG: Device "NRF52833_XXAA" selected.
    LOG: InitTarget() start
    LOG: InitTarget() end
    LOG: Found SW-DP with ID 0x2BA01477
    LOG: DPIDR: 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.

    To verify there is no issue with my DK board, I downloaded the blinky examples and the program starts running immediately after downloading. Is there perhaps a setting that prevents the program from running immediately after downloading the flash? Comparing the projects nothing seems to be different. Is the above log what you were looking for?

    Thanks,
    Wilbur

Related