nrf52840 dfu secure_bootloader gcc build error

Hello

I'm unable to build the dfu secure_bootloader example with gcc. Is there something I need to change?

➜  armgcc make
Compiling file: nrf_dfu_ble.c
In file included from ../../../../../components/libraries/log/nrf_log.h:81,
                 from ../../../../../components/libraries/bootloader/ble_dfu/nrf_dfu_ble.c:62:
../../../../../components/libraries/bootloader/ble_dfu/nrf_dfu_ble.c: In function 'ble_evt_handler':
../../../../../components/libraries/log/src/nrf_log_internal.h:145:25: error: 'cccd' may be used uninitialized [-Werror=maybe-uninitialized]
  145 |     /*lint -save -e571*/nrf_log_frontend_std_1(type, str, (uint32_t)(arg0))/*lint -restore*/
      |                         ^~~~~~~~~~~~~~~~~~~~~~
../../../../../components/libraries/bootloader/ble_dfu/nrf_dfu_ble.c:749:22: note: 'cccd' was declared here
  749 |             uint16_t cccd;
      |                      ^~~~
In function 'is_cccd_configured',
    inlined from 'on_rw_authorize_req' at ../../../../../components/libraries/bootloader/ble_dfu/nrf_dfu_ble.c:549:10,
    inlined from 'ble_evt_handler' at ../../../../../components/libraries/bootloader/ble_dfu/nrf_dfu_ble.c:844:21:
../../../../../components/libraries/bootloader/ble_dfu/nrf_dfu_ble.c:259:12: error: 'cccd_val_buf' may be used uninitialized [-Werror=maybe-uninitialized]
  259 |     return ble_srv_is_notification_enabled(cccd_val_buf);
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../../../../components/libraries/bootloader/ble_dfu/nrf_dfu_ble.c:52:
../../../../../components/libraries/bootloader/ble_dfu/nrf_dfu_ble.c: In function 'ble_evt_handler':
../../../../../components/ble/common/ble_srv_common.h:265:6: note: by argument 1 of type 'const uint8_t *' {aka 'const unsigned char *'} to 'ble_srv_is_notification_enabled' declared here
  265 | bool ble_srv_is_notification_enabled(uint8_t const * p_encoded_data);
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../components/libraries/bootloader/ble_dfu/nrf_dfu_ble.c:245:13: note: 'cccd_val_buf' declared here
  245 |     uint8_t cccd_val_buf[BLE_CCCD_VALUE_LEN];
      |             ^~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [../../../../../components/toolchain/gcc/Makefile.common:272: _build/nrf52840_xxaa_s140/nrf_dfu_ble.c.o] Error 1
➜  armgcc gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror --with-build-config=bootstrap-lto --enable-link-serialization=1 gdc_include_dir=/usr/include/dlang/gdc
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (GCC) 

Parents Reply Children
No Data
Related