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);
| ^~~~~~~~~~~~~~~~~~~~~
  • 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.

  • 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