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

The sdk_config.h file is not being parsed by the compiler

I cannot get the scope of the sdk_config.h file to encompass all modules. Process

  • Start with example project using the file system as per the install.
  • After compiling and running on the DK, copy the example files over to a new folder for inclusion into revision control.
  • Edit the project file to make sure the relative paths have been properly modified to reflect the new project folder
  • Make sure the project still compiles and runs.
  • Make an edit that includes a new module, in this case the TWIM
  • dutifully edit the sdk_config.h file to enable the TWIM module
  • Compiler error in main at this line: static const nrfx_twim_t twi0 = NRFX_TWIM_INSTANCE(TWI_INSTANCE_ID);
  • When expanding the macro the compiler cannot find a definition for "NRFX_TWIM0_INST_IDX" because it is not enumerated in nrfx_twim.h because NRFX_TWIM0_ENABLED is not defined
  • Go back and check the nrf_config.h file and it is indeed enabled.
  • Find out that disabling other modules in the nrf_config.h file doesn't have an effect, ergo the nrf_config.h file is not being used.
  • To make sure the pathways are not pointing to another version, disable (rename) all other nrf_config.h files in the file system - no effect.
  • Explicitly define NRFX_TWIM0_ENABLED in nrfx_twim.h and everything compiles fine.
  • make a test header file with just that line and include it in main - no effect.
  • include that same test header file in nrfx_twim.h file, everything compiles fine
  • remove the test include and include the sdk_config.h file in the nrfx_twim.h file, compile fails again

What on earth is going on? I've searched up and down the project settings thinking that the config file is disabled somehow, but nothing. 

Parents
  • OK, commenting the TWI_PRESENT line in the file nrf52840_peripherals.h did the trick. so help me understand what your rationale is behind having these compiler directives scattered all over the SDK? I would be nice, I think, if the local sdk_config.h were the ONE place where we could go to figure out what's being compiled and what's not, because there's no easy way to track these down. For future reference am I expected to go to nrf52840_peripherals.h and update those settings as well? And also for future edification, please list ALL the files where these directives and overrides can be found - I now know of sdk_config.h, nrfx_config.h, nrf52840_peripherals.h - are there others? It would also be nice to list all the places in the SES settings where these directives can be found as well, and what all the path macros and presets mean. This information would be golden and in this case could have saved me a couple days worth of frustration. Thanks.

    Tony

Reply
  • OK, commenting the TWI_PRESENT line in the file nrf52840_peripherals.h did the trick. so help me understand what your rationale is behind having these compiler directives scattered all over the SDK? I would be nice, I think, if the local sdk_config.h were the ONE place where we could go to figure out what's being compiled and what's not, because there's no easy way to track these down. For future reference am I expected to go to nrf52840_peripherals.h and update those settings as well? And also for future edification, please list ALL the files where these directives and overrides can be found - I now know of sdk_config.h, nrfx_config.h, nrf52840_peripherals.h - are there others? It would also be nice to list all the places in the SES settings where these directives can be found as well, and what all the path macros and presets mean. This information would be golden and in this case could have saved me a couple days worth of frustration. Thanks.

    Tony

Children
Related