Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

warning: redundant redeclaration of 'SystemCoreClock'

Since upgrading to SDK 17.1.0 i get the following warnings of a redundant redeclaration for SystemCoreClock, SystemInit() and SystemCoreClockUpdate() for nrf52810 and nrf52840:

CC /home/br1/dev/nordic/sdk/v17/modules/nrfx/mdk/system_nrf52810.c
In file included from /home/br1/dev/nordic/sdk/v17/modules/nrfx/mdk/system_nrf52.c:31,
from /home/br1/dev/nordic/sdk/v17/modules/nrfx/mdk/system_nrf52810.c:42:
/home/br1/dev/nordic/sdk/v17/modules/nrfx/mdk/system_nrf52.h:33:17: warning: redundant redeclaration of 'SystemCoreClock' [-Wredundant-decls]
33 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
| ^~~~~~~~~~~~~~~
In file included from /home/br1/dev/nordic/sdk/v17/modules/nrfx/mdk/nrf52810.h:141,
from /home/br1/dev/nordic/sdk/v17/modules/nrfx/mdk/nrf.h:142,
from /home/br1/dev/nordic/sdk/v17/modules/nrfx/mdk/system_nrf52.c:28,
from /home/br1/dev/nordic/sdk/v17/modules/nrfx/mdk/system_nrf52810.c:42:
/home/br1/dev/nordic/sdk/v17/modules/nrfx/mdk/system_nrf52810.h:33:17: note: previous declaration of 'SystemCoreClock' was here
33 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
| ^~~~~~~~~~~~~~~
In file included from /home/br1/dev/nordic/sdk/v17/modules/nrfx/mdk/system_nrf52.c:31,
from /home/br1/dev/nordic/sdk/v17/modules/nrfx/mdk/system_nrf52810.c:42:
/home/br1/dev/nordic/sdk/v17/modules/nrfx/mdk/system_nrf52.h:44:13: warning: redundant redeclaration of 'SystemInit' [-Wredundant-decls]
44 | extern void SystemInit (void);
| ^~~~~~~~~~
In file included from /home/br1/dev/nordic/sdk/v17/modules/nrfx/mdk/nrf52810.h:141,
from /home/br1/dev/nordic/sdk/v17/modules/nrfx/mdk/nrf.h:142,
from /home/br1/dev/nordic/sdk/v17/modules/nrfx/mdk/system_nrf52.c:28,
from /home/br1/dev/nordic/sdk/v17/modules/nrfx/mdk/system_nrf52810.c:42:
/home/br1/dev/nordic/sdk/v17/modules/nrfx/mdk/system_nrf52810.h:44:13: note: previous declaration of 'SystemInit' was here
44 | extern void SystemInit (void);
| ^~~~~~~~~~
In file included from /home/br1/dev/nordic/sdk/v17/modules/nrfx/mdk/system_nrf52.c:31,
from /home/br1/dev/nordic/sdk/v17/modules/nrfx/mdk/system_nrf52810.c:42:
/home/br1/dev/nordic/sdk/v17/modules/nrfx/mdk/system_nrf52.h:55:13: warning: redundant redeclaration of 'SystemCoreClockUpdate' [-Wredundant-decls]
55 | extern void SystemCoreClockUpdate (void);
| ^~~~~~~~~~~~~~~~~~~~~
In file included from /home/br1/dev/nordic/sdk/v17/modules/nrfx/mdk/nrf52810.h:141,
from /home/br1/dev/nordic/sdk/v17/modules/nrfx/mdk/nrf.h:142,
from /home/br1/dev/nordic/sdk/v17/modules/nrfx/mdk/system_nrf52.c:28,
from /home/br1/dev/nordic/sdk/v17/modules/nrfx/mdk/system_nrf52810.c:42:
/home/br1/dev/nordic/sdk/v17/modules/nrfx/mdk/system_nrf52810.h:55:13: note: previous declaration of 'SystemCoreClockUpdate' was here
55 | extern void SystemCoreClockUpdate (void);
| ^~~~~~~~~~~~~~~~~~~~~
  • Hello again, Bruno

    Bruno Randolf said:
    I upgraded from SDK16 and I use my own Makefile based build system.

    Could you elaborate on what steps you took when you upgraded from v16 to v17.1.0? As can be seen in the change notes there are quite a few changes between the v16.0.0 release and the v17.0.0 and v17.1.0 releases, with the MDK being updated in both. 

    What changes have you made to your makefile based build system in order to upgrade to v17.1.0?

    Best regards,
    Karl

  • Hello Karl, sorry I don't find a Reply button for your last message, so i reply here.

    The steps I did to upgrade were basically just changing the SDK path and the names and IDs of the softdevice. I don't see anything in the Changelog which would refer to my issue.

  • Hello,

    Thank you for your patience with this.

    Bruno Randolf said:
    sorry I don't find a Reply button for your last message, so i reply here.

    No need to apologize - I have noticed that the answer option sometimes disappear, to get them back it seems that you will need to press the timestamp of the relevant comment.
    I have reported this internally to have it examined and fixed.

    Bruno Randolf said:
    The steps I did to upgrade were basically just changing the SDK path and the names and IDs of the softdevice.

    Is your project a IAR og SES project? There is a backwards compatibility breaking change in the v17.0.2 SDK for SES projects that you will need to account for in your project.

    Upon closer inspection of the system_nrf52810.c files from nRF5 SDK v16 and v17.1 I notice that the contents are changed so much so that the file in v17.1.0 only really includes the general system_nrf52.c file, which is what is causing your redefinition errors.
    The MDK change here is likely due to the nRF52810 being available directly, instead of having to be emulated on the nRF52832 SoC for development.

    For the record, which SoC revisions are you working with, and which SoftDevice versions?

    Best regards,
    Karl

  • My project it based on armgcc and Makefile only and run on Linux. The ARM GCC version I use is: arm-none-eabi-gcc (15:9-2019-q4-0ubuntu2) 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599]

    I'm using the SoftDevice versions from SDK17.1.0 now, so that is version 7.2.0

    I don't know which SoC revisions I use, and honestly I don't see the relevance for this compile step (I use -DNRF_52810_XXAA), but if you give me instructions I can find out.

    We are now talking only about 52810 but it also happens for 52840, where I use a relatively recent DK (PCA0100, 0.9.0, 2019.41).

    You can reproduce the problem by running the following command in the SDK folder:

    arm-none-eabi-gcc -Wall -Wredundant-decls -I./modules/nrfx/mdk/ -I./components/toolchain/cmsis/include/ -DNRF52810_XXAA modules/nrfx/mdk/system_nrf52810.c

  • Bruno Randolf said:

    I'm using the SoftDevice versions from SDK17.1.0 now, so that is version 7.2.0

    I don't know which SoC revisions I use, and honestly I don't see the relevance for this compile step (I use -DNRF_52810_XXAA), but if you give me instructions I can find out.

    Thank you for providing the information, this is helpful for me to know.

    Bruno Randolf said:
    We are now talking only about 52810 but it also happens for 52840, where I use a relatively recent DK (PCA0100, 0.9.0, 2019.41).

    The change is the same for both the system_nrf52810.c and system_nrf52840.c files.
    Have you had a chance to do a comparison of these files from v16 and v17.1 yet?
    In essence, they have changed which files need including to instead be to only include your system_nrf52810.c/system_nrf52840.c file, instead of both the system_nrf52.c and system_nrf52840.c file. The SoC specific file will now include the general system_nrf52.c file itself.
    Please change this in your build system and let me know if the issue persists.

    Best regards,
    Karl

Related