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

SOFTDEVICE_PRESENT defined in Makefile and Project?

In Nordic's example GCC projects, the Makefile of the SD examples have -DSOFTDEVICE_PRESENT defined. However I noted that even though it is defined here, in nrf_drv_common.h it does not unlock the section dependent on this DEFINE. It seems I need to ALSO add SOFTDEVICE_PRESENT to the Project Symbol's section.

  1. Why does SOFTDEVICE_PRESENT have to be defined twice?

  2. Is this a new requirement for SDK 12?

Thanks,

-DC

  • What do you mean 'add it to the Project Symbols' section? What development environment are you using? Is it even using the Makefile? If it's defined, it's defined and will be used by the preprocessor, so if it's not 'unlocking' the section in nrf_drv_common.h then it's because it's not defined, or has been undefined.

    Go check the actual build lines which are being emitted by whatever you're using to build it, if the symbol isn't on the build line, it's not defined.

  • I'm using Eclipse. In the makefile examples, Nordic has defined the following: CFLAGS += -DSOFTDEVICE_PRESENT ASMFLAGS += -DSOFTDEVICE_PRESENT

    But it does not unlock the SOFTDEVICE_PRESENT sections in nrf_drv_common.h. I have add SOFTDEVICE_PRESENT as a Project Symbol include in order to unlock these sections, which seems incorrect and redundant.

    In the build console I do see -DSOFTDEVICE_PRESENT.

  • Little do I know about Eclipse, however it has two build modes does it not, one where it just runs the Makefile and one where it uses the project settings to generate the build line and entirely ignores the Makefile. I did not believe there is a mode in which it parses the Makefile and then adds in more stuff from the project settings. So if you're using the latter, as it sounds like you are, then you do have to add the setting to the project settings because .. it's not using the Makefile.

    If you remove it from the project settings and it's still on the build line, then it's defined and your problem is something different.

    Perhaps it's time to find a better tool than Eclipse, it seems to cause you more trouble than its worth.

  • I can't migrate at this time as I have a mature product and firmware project that I've been developing without issue on SDK6.1 and SDK10. Just trying to migrate over to SDK12.

    I'm 100% certain its using the Makefile settings. If I change the compile flags (-O0 vs -O2) there are different images sizes and so forth.

  • Well either the define is on the build line (for every file being built in the entire project) without you having to add it to project settings or it's not. If it is, you've misidentified the problem, if it's not, it's not using the makefile and you have to add it to the Eclipse settings. There are no other possibilities.

Related