Question/Issue:
Compilation Fails while building Audio classification model using Nordic Thingy 53 .
Project ID:
https://studio.edgeimpulse.com/studio/218688
Context/Use case:
Transfer Learning model for Keyword detection in audio
Failure LOG :
[89/109] Building CXX object CMakeFiles/app.dir/ei-model/tflite-model/trained_model_compiled.cpp.obj
[90/109] Building CXX object CMakeFiles/app.dir/src/inference/ei_run_audio_impulse.cpp.obj
In file included from /ncs/zephyr/include/kernel/sched_priq.h:9,
from /ncs/zephyr/include/kernel_includes.h:23,
from /ncs/zephyr/include/kernel.h:17,
from /ncs/zephyr/include/zephyr.h:18,
from /app/firmware-thingy53/src/ble/ble_nus.h:5,
from /app/firmware-thingy53/src/inference/ei_run_audio_impulse.cpp:29:
/ncs/zephyr/include/sys/util.h:154: warning: “ROUND_UP” redefined
154 | #define ROUND_UP(x, align)
|
In file included from /app/firmware-thingy53/ei-model/edge-impulse-sdk/CMSIS/DSP/Include/arm_math.h:214,
from /app/firmware-thingy53/ei-model/edge-impulse-sdk/dsp/numpy.hpp:46,
from /app/firmware-thingy53/ei-model/edge-impulse-sdk/classifier/ei_model_types.h:24,
from /app/firmware-thingy53/ei-model/edge-impulse-sdk/classifier/ei_run_dsp.h:21,
from /app/firmware-thingy53/ei-model/edge-impulse-sdk/classifier/ei_run_classifier.h:23,
from /app/firmware-thingy53/src/inference/ei_run_audio_impulse.cpp:25:
/app/firmware-thingy53/ei-model/edge-impulse-sdk/CMSIS/DSP/Include/dsp/utils.h:45: note: this is the location of the previous definition
45 | #define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
|
/app/firmware-thingy53/src/inference/ei_run_audio_impulse.cpp:46:14: warning: ‘samples_circ_buff’ defined but not used [-Wunused-variable]
46 | static float samples_circ_buff[EI_CLASSIFIER_DSP_INPUT_FRAME_SIZE];
| ^~~~~~~~~~~~~~~~~
In file included from /app/firmware-thingy53/ei-model/edge-impulse-sdk/classifier/ei_run_classifier.h:26,
from /app/firmware-thingy53/src/inference/ei_run_audio_impulse.cpp:25:
/app/firmware-thingy53/ei-model/edge-impulse-sdk/classifier/ei_performance_calibration.h: In constructor ‘RecognizeEvents::RecognizeEvents(const ei_model_performance_calibration_t*, uint32_t, uint32_t, float)’:
/app/firmware-thingy53/ei-model/edge-impulse-sdk/classifier/ei_performance_calibration.h:41:9: warning: nonnull argument ‘this’ compared to NULL [-Wnonnull-compare]
41 | if ((void )this == NULL) {
| ^~
/app/firmware-thingy53/ei-model/edge-impulse-sdk/classifier/ei_performance_calibration.h: In member function 'int32_t RecognizeEvents::trigger(ei_impulse_result_classification_t)':
/app/firmware-thingy53/ei-model/edge-impulse-sdk/classifier/ei_performance_calibration.h:126:9: warning: nonnull argument ‘this’ compared to NULL [-Wnonnull-compare]
126 | if ((void *)this == NULL || this->_score_array == NULL || this->_running_sum == NULL) {
| ^~
[91/109] Linking CXX static library app/libapp.a
[92/109] Linking CXX executable zephyr/zephyr_pre0.elf
FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map /app/firmware-thingy53/build/zephyr/zephyr_pre0.map
: && ccache /gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi-g++ zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr/zephyr_pre0.elf zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj -fuse-ld=bfd -Wl,-T zephyr/linker_zephyr_pre0.cmd -Wl,-Map=/app/firmware-thingy53/build/zephyr/zephyr_pre0.map -Wl,–whole-archive app/libapp.a
: && ccache /gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi-g++ zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr/zephyr_pre0.elf zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj -fuse-ld=bfd -Wl,-T zephyr/linker_zephyr_pre0.cmd -Wl,-Map=/app/firmware-thingy53/build/zephyr/zephyr_pre0.map -Wl,–whole-archive app/libapp.a zephyr/libzephyr.a zephyr/arch/common/libarch__common.a zephyr/arch/arch/arm/core/aarch32/libarch__arm__core__aarch32.a zephyr/arch/arch/arm/core/aarch32/cortex_m/libarch__arm__core__aarch32__cortex_m.a zephyr/arch/arch/arm/core/aarch32/cortex_m/cmse/libarch__arm__core__aarch32__cortex_m__cmse.a zephyr/arch/arch/arm/core/aarch32/mpu/libarch__arm__core__aarch32__mpu.a zephyr/lib/libc/newlib/liblib__libc__newlib.a zephyr/lib/posix/liblib__posix.a zephyr/soc/arm/common/cortex_m/libsoc__arm__common__cortex_m.a zephyr/boards/arm/thingy53_nrf5340/libboards__arm__thingy53_nrf5340.a zephyr/subsys/bluetooth/common/libsubsys__bluetooth__common.a zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a zephyr/subsys/mgmt/mcumgr/libsubsys__mgmt__mcumgr.a zephyr/subsys/mgmt/mcumgr/zephyr_grp/libsubsys__mgmt__mcumgr__zephyr_grp.a zephyr/subsys/dfu/boot/libsubsys__dfu__boot.a zephyr/subsys/net/libsubsys__net.a zephyr/drivers/usb/device/libdrivers__usb__device.a zephyr/drivers/clock_control/libdrivers__clock_control.a zephyr/drivers/console/libdrivers__console.a zephyr/drivers/gpio/libdrivers__gpio.a zephyr/drivers/i2c/libdrivers__i2c.a zephyr/drivers/ipm/libdrivers__ipm.a zephyr/drivers/sensor/adxl362/libdrivers__sensor__adxl362.a zephyr/drivers/sensor/bmm150/libdrivers__sensor__bmm150.a zephyr/drivers/spi/libdrivers__spi.a zephyr/drivers/hwinfo/libdrivers__hwinfo.a zephyr/drivers/regulator/libdrivers__regulator.a zephyr/drivers/flash/libdrivers__flash.a zephyr/drivers/serial/libdrivers__serial.a zephyr/drivers/bluetooth/libdrivers__bluetooth.a zephyr/drivers/timer/libdrivers__timer.a modules/nrf/lib/dk_buttons_and_leds/lib…__nrf__lib__dk_buttons_and_leds.a modules/nrf/subsys/mpsl/fem/lib…__nrf__subsys__mpsl__fem.a modules/nrf/drivers/sensor/bh1749/lib…__nrf__drivers__sensor__bh1749.a modules/nrf/drivers/hw_cc310/lib…__nrf__drivers__hw_cc310.a modules/nrf/drivers/flash/flash_nop_device/lib…__nrf__drivers__flash__flash_nop_device.a modules/mcuboot/boot/bootutil/zephyr/libmcuboot_util.a modules/cjson/libcjson.a modules/hal_nordic/nrfx/libmodules__hal_nordic__nrfx.a modules/libmetal/libmetal/lib/libmetal.a modules/open-amp/open-amp/lib/libopen_amp.a modules/segger/libmodules__segger.a modules/tinycbor/lib…modules__lib__tinycbor__zephyr.a modules/vm3011/lib……__app__firmware-thingy53__drivers__vm3011.a -Wl,–no-whole-archive zephyr/kernel/libkernel.a -L"/gcc-arm-none-eabi-9-2019-q4-major/bin/…/lib/gcc/arm-none-eabi/9.2.1/thumb/v8-m.main+fp/hard" -L/app/firmware-thingy53/build/zephyr -lgcc zephyr/arch/common/libisr_tables.a /ncs/nrfxlib/crypto/nrf_cc312_platform/lib/cortex-m33/hard-float/no-interrupts/libnrf_cc312_platform_0.9.13.a -no-pie -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfpu=fpv5-sp-d16 -mfp16-format=ieee -Wl,–gc-sections -Wl,–build-id=none -Wl,–sort-common=descending -Wl,–sort-section=alignment -Wl,-u,_OffsetAbsSyms -Wl,-u,_ConfigAbsSyms -nostdlib -static -Wl,-X -Wl,-N -Wl,–orphan-handling=warn -lstdc++ -lm -Wl,-lc -L"/gcc-arm-none-eabi-9-2019-q4-major/arm-none-eabi"/lib/thumb/v8-m.main+fp/hard -u_printf_float -Wl,-lgcc -lc -specs=nano.specs && cd /app/firmware-thingy53/build/zephyr && /opt/cmake/bin/cmake -E echo
/gcc-arm-none-eabi-9-2019-q4-major/bin/…/lib/gcc/arm-none-eabi/9.2.1/…/…/…/…/arm-none-eabi/bin/ld.bfd: zephyr/zephyr_pre0.elf section rodata' will not fit in region
FLASH’
/gcc-arm-none-eabi-9-2019-q4-major/bin/…/lib/gcc/arm-none-eabi/9.2.1/…/…/…/…/arm-none-eabi/bin/ld.bfd: region `FLASH’ overflowed by 73784 bytes
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /usr/local/bin/cmake --build /app/firmware-thingy53/build
Application exited with code 1
FATAL ERROR: command exited with status 1: /usr/local/bin/cmake --build /app/firmware-thingy53/build
Application exited with code 1
Creating deployment failed
Job failed (see above)