This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

softdevice - How to print UART message / what is SOFTDEVICE_PRESENT and where it is defined in Segger

Hello,

I am using nRF52840 DK board and nRF5SDK17.0.2.

I am trying to code to print data on UART so I have added below folder path into user include directories:

../../../config
../../../../../../components
../../../../../../components/boards
../../../../../../components/drivers_nrf/nrf_soc_nosd
../../../../../../components/libraries/atomic
../../../../../../components/libraries/balloc
../../../../../../components/libraries/bsp
../../../../../../components/libraries/delay
../../../../../../components/libraries/experimental_section_vars
../../../../../../components/libraries/fifo
../../../../../../components/libraries/log
../../../../../../components/libraries/log/src
../../../../../../components/libraries/memobj
../../../../../../components/libraries/ringbuf
../../../../../../components/libraries/strerror
../../../../../../components/libraries/uart
../../../../../../components/libraries/util
../../../../../../components/toolchain/cmsis/include
../../..
../../../../../../external/fprintf
../../../../../../integration/nrfx
../../../../../../integration/nrfx/legacy
../../../../../../modules/nrfx
../../../../../../modules/nrfx/drivers/include
../../../../../../modules/nrfx/hal
../../../../../../modules/nrfx/mdk
../config

uploaded sdk_config.h file for your reference.

Also, I have added the required file to the project but still, I am getting the error below.

Compiling 'nrf_log_frontend.c'

sdk_common.h

nrf_log_frontend.c

nrf_mbr.h: No such file or directory

What is SOFTDEVICE_PRESENT and where it is defined in SEGGER?

I am attaching my screenshot for your reference.

What I am doing wrong? Please help.

Please find the attached code file.

Thanks and regards,

Neeraj Dhekale

  • Hello Jared,

    Thanks for the reply.

    The PCA10040 is not the correct folder for the nRF52840 DK, it doesn't map the pins correctly nor does it adjust the memory settings correctly for the nRF52840. You should use PCA10056

    Yes, Recently I got realized I was using the wrong folder from here. And I started recently to use PCA 10056 > S140 folder.

    Still not sure why this would result in serial data being printed out on the Debug terminal.

    Correct. I think so because when I use nRF5SDK17.0.2 > example > peripheral> uart with

    PCA10040 > S132 folder it works completely fine and I can see the log is getting printed on UART. Also, I had cross-checked it in the PuTTy tool.

    could you see if you're able to reproduce it using the correct folder. 

    Let me check and update you on this.

    Thanks and regards,

    Neeraj Dhekale

  • Hello Jared,

    could you see if you're able to reproduce it using the correct folder.

    I have checked with PCA10056 as you can see in the screenshot at the top (Written PCA10056). But behavior is similar like before.

    instead of the printing message on UART / Terminal Emulator, it is getting printed on Debug terminal,

    Thanks and regards,

    Neeraj Dhekale

  • Hello Jared,

    I found the problem there was 1 file that needs to be included in nRF_Libraries folder that is retarget.c kept in nRF5_SDK_17.0.2_d674dde/components/libraries/uart/retarget.c

    instead of the printing message on UART / Terminal Emulator, it is getting printed on Debug terminal,

    Maybe I assume this retarget.c file is necessary to indicate that LOG should print on UART instead of Debug terminal (Where generally RTT LOG is getting displayed).

    Thank you so much Jared for your help. Got so much input from you. Really Appreciated.

    Thanks and regards,

    Neeraj Dhekale

  • Hello Jared,

    I found the problem there was 1 file that needs to be included in nRF_Libraries folder that is retarget.c kept in nRF5_SDK_17.0.2_d674dde/components/libraries/uart/retarget.c

    instead of the printing message on UART / Terminal Emulator, it is getting printed on Debug terminal,

    Maybe I assume this retarget.c file is necessary to indicate that LOG should print on UART instead of Debug terminal (Where generally RTT LOG is getting displayed).

    Thank you so much Jared for your help. Got so much input from you. Really Appreciated.

    Thanks and regards,

    Neeraj Dhekale

Related