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);
| ^~~~~~~~~~~~~~~~~~~~~
Parents
  • Hello,

    It looks to me like you are including multiple system files - both for nRF52840 and nRF52810 - into your build.
    Please exclude one of them, so that you are only building for one SoC at the time.
    You can see your configuration in the project options.

    Best regards,
    Karl

  • Excuse me but in the warning messages i posted there is no nRF52840 reference at all. I just mentioned that these warnings happen with both 52810 and 52840, of course I build only for one board at the time

  • 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

  • If you carefully look at the list of files and the output above you will see that I only compile system_nrf52810.c and system_nrf52.c is included from there.

    I have not done a full comparison of the MDK from v16 to v17 as there are many changes and I'm not part of the MDK team ;-) as a customer and programmer I would expect the MDK and SDK to compile without warnings though.

Reply Children
  • Bruno Randolf said:
    If you carefully look at the list of files and the output above you will see that I only compile system_nrf52810.c and system_nrf52.c is included from there.

    I see this, but still it is hard for me to get a good overview of your system since this is the extent of what I have seen of it.

    Bruno Randolf said:
    I have not done a full comparison of the MDK from v16 to v17 as there are many changes and I'm not part of the MDK team ;-) as a customer and programmer I would expect the MDK and SDK to compile without warnings though.

    I too would expect this, and it is on my side - I am not seeing any of these issues on my end, which makes me suspect that the issue here is somewhere with your custom build system. Could you show me your makefile or similar?

    Best regards,
    Karl

  • My Makefile is a bit too complex to share it here, sorry. Have you tried?

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

    This already shows the warnings.

Related