Long build time on Arduino

I have a student saying that building the accelerometer example for the Arduino Nano 33 BLE Sense is taking an exceptionally long time (over 24 hours). They are using a Windows 10 laptop with the following specs: 1.9Ghz I7-8665U CPU,16GB DDR, and 1TB HDD. Tried on both Arduino 1.8.13 and 1.8.16.

Here is what they said:

Downgrading to 1.8.13 had no effect on the build time. It still takes over 24 hours to build the example sketches. Scratching my head here… what could be the reason? The majority of the time is spent after the line about Wire.h library. I’m pasting an excerpt from the build below incase someone sees something simple that I have setup wrong. This is one line of the build output, of which there are many more that follow.

Alternatives for Wire.h: [Wire]
ResolveLibrary(Wire.h)
-> candidates: [Wire]
“C:\Users\a0322160\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++” -c -w -g3 -nostdlib “@C:\Users\a0322160\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\2.5.2\variants\ARDUINO_NANO33BLE/defines.txt” “@C:\Users\a0322160\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\2.5.2\variants\ARDUINO_NANO33BLE/cxxflags.txt” -DARDUINO_ARCH_NRF52840 -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -w -x c++ -E -CC -DARDUINO=10816 -DARDUINO_ARDUINO_NANO33BLE -DARDUINO_ARCH_MBED_NANO -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 “-IC:\Users\a0322160\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\2.5.2\cores\arduino” “-IC:\Users\a0322160\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\2.5.2\variants\ARDUINO_NANO33BLE” “-IC:\Users\a0322160\Documents\Arduino\libraries\rperezti-project-1_inferencing\src” “-IC:\Users\a0322160\Documents\Arduino\libraries\Arduino_LSM9DS1\src” “-IC:\Users\a0322160\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\2.5.2\libraries\Wire” “-IC:\Users\a0322160\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\2.5.2\cores\arduino/api/deprecated” “-IC:\Users\a0322160\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\2.5.2\cores\arduino/api/deprecated-avr-comp” “-iprefixC:\Users\a0322160\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\2.5.2\cores\arduino” “@C:\Users\a0322160\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\2.5.2\variants\ARDUINO_NANO33BLE/includes.txt” “C:\Users\a0322160\AppData\Local\Temp\arduino_build_31323\sketch\nano_ble33_sense_accelerometer.ino.cpp” -o nul

Has anyone else experienced something like this?

1 Like

@ShawnHymel what I experience is that the compile-time on Windows 10 takes some time. But, 24 hours is long.

Personally, I prefer using PlatformIO. Using the Arduino IDE takes a much longer compile time (especially on a Windows 10 machine) compared to PlatformIO. Why? I don’t know.

The Arduino Nano BLE sense board is supported by PlatformIO. Maybe the student can try PlatformIO? Check Use PlatformIO to Build Your tinyML Projects

1 Like

Hi I just started the build using PlatformIO and based on where it is at about 1 hour into the build, it “feels” like it will take just as long as Arduino IDE did. Most of the time is spent linking in a significant number of individual functions from CMSIS DSP and CMSIS NN library. I’m wondering if I missed a step in the EdgeImpulse library build process that tells the linker to only pull in the necessary functions?? Anyway, below is the beginning of the build output from PlatformIO and it continues on with dozens of functions from each CMSIS DSP category - SVNFunctions, StatisticFunctions, Support Functions, etc.

Executing task: C:\Users\a0322160.platformio\penv\Scripts\platformio.exe run <

Processing nano33ble (platform: nordicnrf52; board: nano33ble; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/nordicnrf52/nano33ble.html
PLATFORM: Nordic nRF52 (9.0.0) > Arduino Nano 33 BLE
HARDWARE: NRF52840 64MHz, 256KB RAM, 960KB Flash
DEBUG: Current (blackmagic) External (blackmagic, cmsis-dap, jlink)
PACKAGES:

  • framework-arduino-mbed 2.5.2
  • tool-sreccat 1.164.0 (1.64)
  • toolchain-gccarmnoneeabi 1.80201.190214 (8.2.1)
    LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 34 compatible libraries
    Scanning dependencies…
    Dependency Graph
    |-- <rperezti-project-1_inferencing> 1.0.1
    |-- <Arduino_LSM9DS1> 1.1.0
    | |--
    Building in release mode
    Compiling .pio\build\nano33ble\src\main.cpp.o
    Generating LD script .pio\build\nano33ble\cpp.linker_script.ld
    Compiling .pio\build\nano33ble\lib60c\rperezti-project-1_inferencing\edge-impulse-sdk\CMSIS\DSP\Source\BasicMathFunctions\arm_abs_f16.c.o
    Compiling .pio\build\nano33ble\lib60c\rperezti-project-1_inferencing\edge-impulse-sdk\CMSIS\DSP\Source\BasicMathFunctions\arm_abs_f32.c.o
    Compiling .pio\build\nano33ble\lib60c\rperezti-project-1_inferencing\edge-impulse-sdk\CMSIS\DSP\Source\BasicMathFunctions\arm_abs_q15.c.o
    Compiling .pio\build\nano33ble\lib60c\rperezti-project-1_inferencing\edge-impulse-sdk\CMSIS\DSP\Source\BasicMathFunctions\arm_abs_q31.c.o
    Compiling .pio\build\nano33ble\lib60c\rperezti-project-1_inferencing\edge-impulse-sdk\CMSIS\DSP\Source\BasicMathFunctions\arm_abs_q7.c.o
    Compiling .pio\build\nano33ble\lib60c\rperezti-project-1_inferencing\edge-impulse-sdk\CMSIS\DSP\Source\BasicMathFunctions\arm_add_f16.c.o
    Compiling .pio\build\nano33ble\lib60c\rperezti-project-1_inferencing\edge-impulse-sdk\CMSIS\DSP\Source\BasicMathFunctions\arm_add_f32.c.o

The PlatformIO build is definitely much faster than Arduino IDE. I actually don’t know how long the build took because I was away from my PC when it finished. What I can say is that it took longer than 1 hour but less than 4 hours, versus >24 hours for Arduino IDE. Thanks very much for pointing out this alternate build method.

I confirm the same behavior for both Windows and Ubuntu. The build in Linux is usually faster, but here both are same and take 1-2 hours. I build a project using TFLM using CMake/Mbed Studio in less that 10 mins.