This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Reference sdkconfig.h in NRF5 for NRF52840

Hi there.  I'm developing an NRF52840 project from scratch and wanted to obtain a "good reference" sdkconfig.h.  I tried picking one from the examples (the UART example, 'cos I'm using a UART) but that didn't define the timers that I use (NRFX_TIMER0_ENABLED etc.).  I tried taking the NRF52840 template version but that didn't define logging APIs (NRF_LOG_*) that the core Nordic drivers won't compile without.  I tried the one from config/nrf52840 but that doesn't define NRFX_TIMER0_INST_IDX which the macro NRFX_TIMER_INSTANCE needs (even though I've set NRFX_TIMER_ENABLED and NRFX_TIMER0_ENABLED to 1 in it).

I've tried a manual merge of both and I'm getting further but I've absolutely no idea whether what I'm compiling is supportable/workable anymore.  There must be more #define compilation permutations than the combined age of the universe and number of grains of sand in the galaxy here!

So my question is: where could I obtain a good, supportable, likely to work, compiles with Nordic core code, sdkconfig.h?

FYI I have the Java tool but that doesn't help me make a good reference version, it just allows me to disable/enable the stuff that happens to be there already.

Rob

Parents
  • You're describing a known issue with the nRF5 SDKs, manually cutting and pasting sdk_config.h until it works. 

    The best approach is to look at the examples that contain the parts that you'll need and combine them. So for the timer related code, the sdk_config.h of the examples/peripheral/timer will contain the necessary code, and for TWI you'll have to go to the TWI example. 
    The sdk_config.h files have blocks of related #defines, so all timer-related #defines are in the same block, just copy the whole block into your base sdk_config.h. Remember to copy the escape characters for the java tick-box tool to recognize the blocks.
    If you intend to use BLE you should use one of the BLE example's sdk_config.h as a base. The BLE examples have logging and UART0 enabled by default, in addition, everything else that you need for BLE. 

    It's tedious, we know. There are numerous posts on DevZone on this topic, I suggest you read some if you need more information. 

  • Thanks for the swift response.  I have been doing that, though I then hit the weird issue addressed in this thread:

    https://devzone.nordicsemi.com/f/nordic-q-a/33349/upgrade-to-the-nrfx-api-sdk-v15

    ...where I had to actually remove stuff from sdk_config.h to get the timer code to compile.  One thing that would improve matters would be more "story" like hints in the builds or readme's with the examples: more comments, advice on what to do, etc.  It must be a complete nightmare to support.

    I'm now stuck on setting up FreeRTOS (surprising how few of your examples use an RTOS, it's fundamental to these ever popular IoT devices) but I'll raise a separate topic for that.

Reply Children
No Data
Related