Build warnings and errors when adding FOTA for nRF54L15 project

I'm following along with the Nordic Academy tutorial for v2.7.0-v2.9.0. I made the recommended modifications to my v2.9.0 project with an nRF54L15-DK target:

  1. Create sysbuild.conf with SB_CONFIG_BOOTLOADER_MCUBOOT=y
  2. Add CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y to the main app prj.conf

While this did properly add OTA DFU support, it also generated a handful of warnings when running CMake for mcuboot. First, FPROTECT_ALLOW_COMBINED_REGIONS was set to 'n' because FPROTECT was set to 'n'. Second, NRF_RTC_TIMER_USER_CHAN_COUNT was not assigned a value and is dependent on (NRF_RTC_TIMER && SYS_CLOCK_EXISTS). To resolve these warnings, I created an mcuboot.conf file in app/sysbuild and added the following configs:

CONFIG_FPROTECT=y
CONFIG_NRF_RTC_TIMER=y
CONFIG_SYS_CLOCK_EXISTS=y

mcuboot builds successfully after this change but now I get build errors for the main app:

FAILED: zephyr/drivers/timer/CMakeFiles/drivers__timer.dir/nrf_rtc_timer.c.obj 

In file included from .../zephyr/include/zephyr/toolchain.h:50,
                 from .../zephyr/include/zephyr/sys/util.h:18,
                 from .../zephyr/include/zephyr/init.h:13,
                 from .../zephyr/drivers/timer/nrf_rtc_timer.c:8:

.../zephyr/drivers/timer/nrf_rtc_timer.c:29:25: error: 'RTC1_CC_NUM' undeclared here (not in a function); did you mean 'RTC10_CC_NUM'?
   29 | #define CHAN_COUNT_MAX (RTC1_CC_NUM - (RTC_PRETICK ? 1 : 0))

.../zephyr/include/zephyr/toolchain/gcc.h:87:51: error: expression in static assertion is not an integer
   87 | #define BUILD_ASSERT(EXPR, MSG...) _Static_assert((EXPR), "" MSG)

.../zephyr/include/zephyr/toolchain/gcc.h:87:36: error: static assertion failed: "Counter for RTC1 must be disabled"
   87 | #define BUILD_ASSERT(EXPR, MSG...) _Static_assert((EXPR), "" MSG)

.../zephyr/drivers/timer/nrf_rtc_timer.c:26:13: error: 'NRF_RTC1' undeclared (first use in this function); did you mean 'NRF_RTC10'?
   26 | #define RTC NRF_RTC1

It seems to be looking for an RTC instance based on the old naming sequence? That's what I gathered from the error output at least. Am I doing something wrong in trying to integrate OTA DFU here, and if so, how can I resolve the original build warnings the correct way?

Parents
  • Hi, 

    Before modifying for FOTA, are you able to build and run your application without issue?

    CONFIG_FPROTECT=y
    CONFIG_NRF_RTC_TIMER=y
    CONFIG_SYS_CLOCK_EXISTS=y

    I think only the CONFIG_SYS_CLOCK_EXISTS=y is required for nRF54LDK. 

    Could you test with the peripheral_lbs?  

    Regards,
    Amanda H.

  • Yes, the application builds and runs with no warnings before adding FOTA support. When I explicitly enable FPROTECT for mcuboot, the first warning goes away. SYS_CLOCK_EXISTS alone does not remove the second warning, since it is also dependent on NRF_RTC_TIMER. I did some digging and it looks like this is actually an upstream bug. Is there any way to manually suppress the warning when building so I don't need to modify my Zephyr instance? Also, is there any harm in leaving FPROTECT=y for the 54L15?

Reply
  • Yes, the application builds and runs with no warnings before adding FOTA support. When I explicitly enable FPROTECT for mcuboot, the first warning goes away. SYS_CLOCK_EXISTS alone does not remove the second warning, since it is also dependent on NRF_RTC_TIMER. I did some digging and it looks like this is actually an upstream bug. Is there any way to manually suppress the warning when building so I don't need to modify my Zephyr instance? Also, is there any harm in leaving FPROTECT=y for the 54L15?

Children
Related