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

nrf52840-dk uart corruption/settings over segger/usb/ACM

I'm not able to get clear/un-corrupted data across the ttyACM on the nrf52840-PDK.  I must be missing something, seems like this would have been solved a million times, but I have googled this with no results that work. 

I've tried all the combinations i can think of, here is what worked the 'best' (least corruption / most readable output on serial on my host):

  • baud 115200
  • data bits 8
  • stop bits 1
  • parity none
  • flow-ctrl hw(RTS/CTS)

Corresponding to sdk_config.h settings (the only change from the default in sdk14 is HWFC, which is disabled by default):

  • #define UART_ENABLED 1
  • #define UART_DEFAULT_CONFIG_HWFC 1
  • #define UART_DEFAULT_CONFIG_PARITY 0
  • #define UART_DEFAULT_CONFIG_BAUDRATE 30801920 #115200
  • #define NRF_LOG_DEFERRED 1

Running a mimally modified 'ble_app_hts' from the examples:

  • above sdk_config.h settings
  • added "NRF_LOG_INFO('####') in the main-loop
  • tried with, and without, a "long" busy-wait loop inside the main loop (in case i was swamping things). 
    • Same results. With the busy loop, the NRF_LOG_INFO is called once per ~second, eg a few orders of magnitude under the serial bandwidth.
  • still using defered logging, as above, which is the default.

This is what is expected on the serial port:

<info> app: ####
<info> app: ####
<info> app: ####
<info> app: ####
.....

But this is what i see: eg logging is clearly working but one end (likely my config?) is introducing corruption:

<info> app: ####
<info> ap> app: ####<info<info> <info> app: ####
<info> app: ####
<info> a<info> app: ####
fo> app: ##p: ####
p: ####
<info> app: ####
pp: ####
fo> app: ##<info> app: ####
<info> app: ####
<info> app: ####
<info> app: ####
<infp: ####

<info> app: ####
<info> app: ####
<info> app: ####
<info> app: ####
<info> app: ####
o> app: ####p: ####
<info> app: ####
<info> app: ####
<info> app: ####
<info> app: ####
<info> app:####
<info> app: ####
<info> app: ####
<info> app: ####

So my question is, what settings to use to get correct output over serial to my host?

If you see something wrong with my settings, that would work.  Alternatively, I am new to the SDK, perhaps you could give a known-good setup for me to flash. Eg:

Parents Reply Children
Related