uart implementation using pca10059 dongle

i have a code base which is originally run on nrf52832 dk and i want to port it to the pca10059 dongle
i run in gcc env and successfully modified the definitions and includes to run on nrf52840.
with one exception/problem:
something with the uart handling routine seems to be broken.
it bootloops when the first char is printed,so i added  NRF_LOG_USES_RTT=1 define and now it handles a printf in the code

but the printf not show on the correct gpio pin but if i run app_uart_put it outputs a pulse train continuously and the program halts

i defined all uart pins besides the tx pin to be UART_PIN_DISCONNECTED.

in the makefile i change:
CFLAGS += -DBOARD_PCA10040
CFLAGS += -DNRF52832_XXAA
CFLAGS += -DNRF52
to:
CFLAGS += -DBOARD_PCA10059
CFLAGS += -DNRF52840_XXAA
CFLAGS += -DNRF_LOG_USES_RTT=1
and
SRC_FILES +=$(SDK_ROOT)/components/toolchain/gcc/gcc_startup_nrf52.S
SRC_FILES +=$(SDK_ROOT)/components/toolchain/system_nrf52.c
to:
SRC_FILES +=$(SDK_ROOT)/components/toolchain/gcc/gcc_startup_nrf52840.S
SRC_FILES +=$(SDK_ROOT)/components/toolchain/system_nrf52840.c
appropriately
it runs fine using the ble and toggling leds on both the pca10040 and pca10059, but if i use printf it only works fine on the nrf52832 dk

Parents
  • Hi,

    Have you modified the dongle with a debugger and connected the UART line(s) to something external? The Dongle does not come with a debug chip like the DKs, so it will not output UART over the USB port. You can also use USB CDC ACM to send UART data over the USB port of the dongle.

    Please post a diagram of the dongle and how you program it and interface with the UART.

    For more details, please see the nRF52840 Dongle Programming Tutorial.

    Best regards,
    Jørgen

  • Which GPIOs are you using for the UART peripheral? the default pins used for UART in most examples (P0.06/P0.08) are connected to LEDs on the Dongle. If the application also initializes BSP to control the LEDs, this may cause issues for UART if the same pins are used.

    If the application crashes when using UART/printf, and you don't have a debugger connected to the Dongle, it would be quite hard to debug why it is failing. This is the reason that we do not recommend the Dongle for development of applications, it is mainly intended for use with prebuilt applications, together with our development tools (nRF Connect for desktop applications, nrfutil, OpenThread border router, etc). I would recommend that you either connect debug headers to the Dongle to be able to debug the application (you can use the debug output of the nRF52832 DK), or get a nRF52840 DK for application development.

Reply
  • Which GPIOs are you using for the UART peripheral? the default pins used for UART in most examples (P0.06/P0.08) are connected to LEDs on the Dongle. If the application also initializes BSP to control the LEDs, this may cause issues for UART if the same pins are used.

    If the application crashes when using UART/printf, and you don't have a debugger connected to the Dongle, it would be quite hard to debug why it is failing. This is the reason that we do not recommend the Dongle for development of applications, it is mainly intended for use with prebuilt applications, together with our development tools (nRF Connect for desktop applications, nrfutil, OpenThread border router, etc). I would recommend that you either connect debug headers to the Dongle to be able to debug the application (you can use the debug output of the nRF52832 DK), or get a nRF52840 DK for application development.

Children
Related