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.

  • Hi Simon,

    Thanks for the input, after rechecking and retrying everything without success, I found that for the program to run on the nRF52833 DK I needed to disconnect/reconnect the USB (or cycle the power) for it to work each time I do a flash download.  Interestingly, I did not need to do this for the other example PCA10100 programs I've tried, and the libuarte example would run on the nRF52 DK board that I also have without a disconnect/reconnect.

    Does requiring a power cycle indicate something is not quite right before I work on modifying the program to enable both UART ports for the nRF52833 DK?

    Thanks,

    Wilbur

  • Hi

    This seems strange, especially since it's only the one example on that one DK causing that needs a power cycle.

    Can you try printing the log out on RTT to check what goes on with the example once it is programmed (before and after he power cycle).

    Can you also try doing a soft reset during programming, by using nrfjprog -p (for programming the .hex file generated by Keil) and -r (to reset) to see what behavior that causes?

    Best regards,

    Simon

  • Hi Simon,

    Thanks for the suggestion.  When you ask to print out the log on RTT, is there something specific you are looking to log?  I can insert NRF_LOG_INFO to print out on RTT successfully, but I'm not sure if that is what you mean.  Nothing seems to printout after the flash download (seems like the program is not running), but if I power cycle, the log messages I added show up on RTT.  The RTT messages correlate to when I see "UART example started" messages on the UART, along with the LED3 illumination.

    If I issue nrfjprog -p (Applying pin reset.) or nrfjprog -r (Applying system reset. Run.) in the command window after downloading to the flash in Keil, both of them start the program running as well.

    Do you have suggestions on what else to try for debugging this behavior?

    Thanks,

    Wilbur

  • Hi

    Yes, I mean the nRF logging. Please also enable the DEBUG in your preprocessor definitions. That way we should see some more debug information as well. Where are you seeing these RTT logs, in the Keil IDE or are you using SEGGERs RTT viewer or similar?

    Best regards,

    Simon

  • Hi Simon,

    I added DEBUG to the Options for Target > C/C++ > Preprocessor Symbols Define, but don't see any other messages on RTT.  I am using the J-Link RTT Viewer V6.88a, and connecting each time with a download or nrfjprog reset.  If I step through the code in the Keil Debug session, the program runs without a reset after the download.

    Best regards,

    Wilbur

Related