Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Documentation about the sdk_config.h file; remove unnecessary project files.

I am trying to port an nRF51 project that runs on the nRF51 DK using Keil to the nRF52840 DK using Segger Embedded Studio. Clearly the best way to start is to take an example from the SDK which has all the Segger-specific stuff and hardware specific stuff and change those few files which the app developer actually writes (like main.c) and update for the new SoftDevice

In my case the Keil project uses SoftDevice calls for all the Bluetooth functionality and Flash. It handles the sd_ble_evt_get() and dispatching of events.  I know I will have to make a few modifications because there are changes in SoftDevice s130 to SoftDevice s140 but they are not extensive. However, the sdk_config.h file changes ARE huge and I don't know what 90% of it means. Is there any detailed documentation describing what all these config parameters mean? A few are obvious to me like turning off the service support like CTS, DIS, BATtery, etc. This project is an implementation of a proposed protocol and there is no support in the SDK for it. So I want to turn off all those items in the sdk_config.h file that I don't need, but I don't want to mess up something that will mess up that which is needed for the chip on the DK.

Eventually I want to remove all the files in the project that I don't need - that's not too easy either. It would be nice to have a final project which ONLY contains those files necessary to build this project.

How to proceed?

Parents Reply Children
  • Hi, 

    This doc Health Thermometer Application can help you understand how to use the example. As I replyed previously, you should use https://infocenter.nordicsemi.com/index.jsp to find the doc of the config in the sdk_config.h. 

    -Amanda H.
  • Of course I have looked through that site. The search engine is poor (as I have pointed out many times) so finding what you need is very time consuming as you have to page through everything yourself. I have found 'documentation' on the sdk_config.h' file but it just lists what's in it ... it does not explain what they mean or what the consequences are from the various settings. You have to guess from the words in the defines. Its kind of like Linux 'man' pages - useless if you don't know what the commands mean, but good if you do and you have forgotten what the details of the settings are.

    In any case, I cannot get NRF_LOG to work at all (with or without RTT) and I can only get printf to work with RTT in the 'main' function of main.c. Once a callback event is handled, nothing.

    Something is seriously sick.

    Absolutely no problem using s130 on the nrf51 DK in a Keil project. (No RTT of course.)

    Try porting that SoftDevice only project to SES and the nRF52840 DK using s140 has been a nightmare. Thought it would be easy.

  • Hi, 

    If you want to get RTT log, you need to enable NRF_LOG_BACKEND_RTT_ENABLED and disable NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED in the sdk_config.h as

    //==========================================================
    // <e> NRF_LOG_BACKEND_RTT_ENABLED - nrf_log_backend_rtt - Log RTT backend
    //==========================================================
    #ifndef NRF_LOG_BACKEND_RTT_ENABLED
    #define NRF_LOG_BACKEND_RTT_ENABLED 1
    
    // <q> NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED  - For each printed LF, function will add CR.
     
    
    #ifndef NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED
    #define NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED 0
    #endif

  • I tried that. Among many other combinations. Works are far as the main function in main.c but nowhere else. So my NRF_LOG_DEBUG works at the start of the main() function but in the event handler such print statements are not displayed - and I know the code is hit because the client gets a connection event and does service discovery and configures descriptors.

    The template project wont even build!

    cannot find ../../../../../../external/micro-ecc/nrf52hf_armgcc/armgcc/micro_ecc_lib_nrf52.a: No such file or directory

    I was going to try and start with that perhaps but I guess not now.

    I have have done nothing to that project. Something HAS to be bad here. Maybe a corrupted download of the SDK? SES?

    template project has NRF_FPRINTF_ENABLED 1 and the auto carriage return enabled but not NRF_LOG

    What is all this? What's the difference between FPRINTF, NRF_LOG, and RTT? What's the difference between LOG with BACKEND in the name versus that without the BACKEND? Are they separate entities? Does more than one need to be enabled or is that a sin?

  • Hi, 

    brianreinhold said:
    cannot find ../../../../../../external/micro-ecc/nrf52hf_armgcc/armgcc/micro_ecc_lib_nrf52.a: No such file or directory

    Please Install micro-ecc. This library is required for the Cryptography library - nrf_crypto, which is used in the BLE Secure DFU Bootloader example.

     

    brianreinhold said:
    Something HAS to be bad here. Maybe a corrupted download of the SDK? SES?

     What do you mean "be bad" here? Could you elaborate in more detail? Are you able to provide the any log from the device or nRF Connect app? Maybe you could try to download SDK or SEGGER Embedded Studio (SES) for ARM again. 

     

    brianreinhold said:
    What's the difference between FPRINTF, NRF_LOG, and RTT?

    FPRINTF works like a standard fprintf C function with some limitations. 

    NRF_LOG provides logging capability for your application. It is used by SDK modules and can be also used in the application code.  

     

    brianreinhold said:
    What's the difference between LOG with BACKEND in the name versus that without the BACKEND?

     See Logger backend interface

    -Amanda H.

Related