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
  • 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.

Children
  • 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.

  • Let's go back to the original problem - no documentation for SDK_config.h.

    For example, in SDK 12.3. 0 there is no NRF_BLE_GATT_ENABLED option. What is that? In fact, in the 12.3.0 there is no NRF_ anything except logging related stuff. There is no place I can find that states what each of these options actually do, when you need them, what they bring to the table, if and when you have to use them, etc. There is a lot of 'NRF' stuff across the board in SDK 17.2.0 that was not present in SDK 12.3.0

    If I am using sd_ methods to do pairing and encryption, do I need all these NRF crypto items enabled?

    If I am using sd_ methods to write to flash. do I need NRF_FSTORAGE_ENABLED?

    How about NRF_SDH_BLE_ENABLED 1

    and

    NRF_SDH_ENABLED 1?

    I am using sd_get methods to get the events and dispatching them myself.

    There is no where to information on what these things do or mean besides what is in the header file itself.

  • Hi, 

    brianreinhold said:
    there is no NRF_BLE_GATT_ENABLED option. What is that?

     NRF_BLE_GATT_ENABLED is used to Enable GATT Module. If you open sdk_config.h, there are simple comments for each config. 

     

    brianreinhold said:
    If I am using sd_ methods to do pairing and encryption, do I need all these NRF crypto items enabled?

    Do you mean LESC? You could refer to examples\ble_peripheral\ble_app_hrs and its sdk_config.h. 

     

    brianreinhold said:
    If I am using sd_ methods to write to flash. do I need NRF_FSTORAGE_ENABLED?

    Do you mean sd_flash_write? If so, you don't need to enable NRF_FSTORAGE_ENABLED. It is a function of the SoC Library API


    brianreinhold said:

    How about NRF_SDH_BLE_ENABLED 1

    and

    NRF_SDH_ENABLED 1?

    NRF_SDH_BLE_ENABLED is used to Enable the SoftDevice Handler BLE module. 

    NRF_SDH_ENABLED is used to Enable the SoftDevice Handler

     

    brianreinhold said:
    There is no where to information on what these things do or mean besides what is in the header file itself.

     Do you also check https://infocenter.nordicsemi.com/index.jsp? The information like the SoftDevice BLE event handler configuration could be found on the inforcenter

    -Amanda H.

Related