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

Parents
  • Hi,

    What example did you start with? 

    SOFTDEVICE_PRESENT is a preprocessor definition that tells the compiler to include softdevice specific files. For example, here is the preprocessor definitions for the ble_app_blinky project in the SDK which uses the Softedevice stack:

  • Thanks for your reply.

    I tried to remove SOFTDEVICE_PRESENT from the preprocessor definition it got compiled successfully. But instead of the printing message on UART / Terminal Emulator, it is getting printed on Debug terminal, where usually I believe RTT log is getting printed.

    What is remaining? Can you please help?

    I am using the Blinky example.

    Thanks and regards,

    Neeraj Dhekale

  • Hi,

    Could you share a minimal example than can reproduce the issue on the development kit? I would like to reproduce it on my end. Please make sure that every file that is necessary for the project to build is included. You can upload the project as a zip.

    regards

    Jared 

  • Hello Jared,

    I am making a zip file of the working folder.

    Please find the attached code in a zip file.

    Thanks and regards,

    Neeraj Dhekale

  • Hi,

    Did you upload the correct project? The project that you shared is basically the UART peripheral example, but it lacks the necessary drivers and libraries which result in build errors. Can you double check it? Also, are you using the MBR or blank project?

    regards

    Jared

  • Hello Jared,

    There is no build error at my end. I just made a zip to my working folder. Is it the correct way to export?

    Please correct me if I am wrong.

    Thanks and regards,

    Neeraj Dhekale

  • Hi,

    I wanted to reproduce "the error" at my side by using your project. Your project didn't build successfully because there was a lot of source files and drivers that weren't included. I therefore asked if you uploaded the correct project since it built successfully on your side. Are you using the MBR or the blank project? It's PCA10056 folder right? And you are using SES?

    regards

    Jared 

Reply
  • Hi,

    I wanted to reproduce "the error" at my side by using your project. Your project didn't build successfully because there was a lot of source files and drivers that weren't included. I therefore asked if you uploaded the correct project since it built successfully on your side. Are you using the MBR or the blank project? It's PCA10056 folder right? And you are using SES?

    regards

    Jared 

Children
  • Hi Jared,

    Sorry for the late reply.

    Here is the screenshot of the building successful at my end.

    For you, I have collapsed all folders at left project explorer.

    Attaching a Screenshot of the User include directories.

    Also attaching a screenshot of Preprocessor definition

    Also, I am attaching again same project by making a working project folder as ZIP

    Are you using the MBR or the blank project?

    I am using S132

    It's PCA10056 folder right?

    No. Its PCA10040 folder

    And you are using SES?

    Yes. Correct.

    Now you might cross-check at your end. Is this information sufficient to make this project build successful at your end? Or do you need anything extra information? let me know.

    Thanks and regards,

    Neeraj Dhekale

  • Hi,

    I am using nRF52840 DK board and nRF5SDK17.0.2.
    Neeraj Dhekale said:
    No. Its PCA10040 folder

    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. Still not sure why this would result in serial data being printed out on the Debug terminal. Either way, could you see if you're able to reproduce it using the correct folder. 

    regards

    Jared 

  • 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

Related