MicroMod nRF52840 Compilation Error

Compiling sketches for the nRF52840 proc board results in the below errors (debug output at the bottom for completeness):

arm-none-eabi-g++: error: softfp: No such file or directory

arm-none-eabi-g++: error: fpv4-sp-d16: No such file or directory

This occurs no matter the OS or Arduino IDE version (1.8.19, 2.0.0-rc5). Searching the Net turned up at least one reference to the board library version including breaking changes, so I tried installing Arduino Mbed OS Nano Boards versions older than the current 3.0.0, but the Boards Manager only lists versions back to 2.0.0, not as old as the 1.3.1 listed in the Hookup Guide. Everything from 2.0.0 to 3.0.0 exhibits the same behavior.

I can get limited functionality by letting the IDE auto-identify it as the Nano 33 BLE but this is pretty dodgy.

Can someone tell me if I’m overlooking anything?


Using board ‘sfnrf52840pb’ from platform in folder: C:\Users\jmcmahon\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\3.0.0

Using core ‘arduino’ from platform in folder: C:\Users\jmcmahon\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\3.0.0

Detecting libraries used…

“C:\Users\jmcmahon\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++” -c -w -g3 -nostdlib “@C:\Users\jmcmahon\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\3.0.0\variants\SF_MM_nRF52840_PB/defines.txt” “@C:\Users\jmcmahon\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\3.0.0\variants\SF_MM_nRF52840_PB/cxxflags.txt” -DARDUINO_ARCH_NRF52840 -mcpu=cortex-m4 softfp fpv4-sp-d16 -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_ARDUINO_NANO33BLE -DARDUINO_ARCH_MBED_NANO -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 “-IC:\Users\jmcmahon\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\3.0.0\cores\arduino” “-IC:\Users\jmcmahon\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\3.0.0\variants\SF_MM_nRF52840_PB” “-IC:\Users\jmcmahon\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\3.0.0\cores\arduino/api/deprecated” “-IC:\Users\jmcmahon\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\3.0.0\cores\arduino/api/deprecated-avr-comp” “-iprefixC:\Users\jmcmahon\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\3.0.0\cores\arduino” “@C:\Users\jmcmahon\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\3.0.0\variants\SF_MM_nRF52840_PB/includes.txt” “C:\Users\jmcmahon\AppData\Local\Temp\arduino-sketch-7DCB38309A5D2B59B996DA9BE88A5117\sketch\sketch_mar25a.ino.cpp” -o nul

Error while detecting libraries included by C:\Users\jmcmahon\AppData\Local\Temp\arduino-sketch-7DCB38309A5D2B59B996DA9BE88A5117\sketch\sketch_mar25a.ino.cpp

Generating function prototypes…

“C:\Users\jmcmahon\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++” -c -w -g3 -nostdlib “@C:\Users\jmcmahon\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\3.0.0\variants\SF_MM_nRF52840_PB/defines.txt” “@C:\Users\jmcmahon\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\3.0.0\variants\SF_MM_nRF52840_PB/cxxflags.txt” -DARDUINO_ARCH_NRF52840 -mcpu=cortex-m4 softfp fpv4-sp-d16 -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_ARDUINO_NANO33BLE -DARDUINO_ARCH_MBED_NANO -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 “-IC:\Users\jmcmahon\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\3.0.0\cores\arduino” “-IC:\Users\jmcmahon\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\3.0.0\variants\SF_MM_nRF52840_PB” “-IC:\Users\jmcmahon\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\3.0.0\cores\arduino/api/deprecated” “-IC:\Users\jmcmahon\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\3.0.0\cores\arduino/api/deprecated-avr-comp” “-iprefixC:\Users\jmcmahon\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\3.0.0\cores\arduino” “@C:\Users\jmcmahon\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nano\3.0.0\variants\SF_MM_nRF52840_PB/includes.txt” “C:\Users\jmcmahon\AppData\Local\Temp\arduino-sketch-7DCB38309A5D2B59B996DA9BE88A5117\sketch\sketch_mar25a.ino.cpp” -o “C:\Users\jmcmahon\AppData\Local\Temp\arduino-sketch-7DCB38309A5D2B59B996DA9BE88A5117\preproc\ctags_target_for_gcc_minus_e.cpp”

arm-none-eabi-g++: error: softfp: No such file or directory

arm-none-eabi-g++: error: fpv4-sp-d16: No such file or directory

The definition in the board.txt file form the micro-mod is incorrect .

Open the boards.txt in the library (see the hookup guide for the location on Windows/OSX/Linux)

Look for :

sfnrf52840pb.build.fpu=fpv4-sp-d16
sfnrf52840pb.build.float-abi=softfp

replace with :

sfnrf52840pb.build.fpu=-mfpu=fpv4-sp-d16
sfnrf52840pb.build.float-abi=-mfloat-abi=softfp

That definitely removed those compilation errors, thanks much. It still fails, but due to the IDE not finding a CMSIS header file, which is confirmed on disk, so that will be my next battle.

Sparkfun friends, the Hookup Guide and git repo have the bogus values for the boards.txt entries, FYI.

I have now made more changes and it all compiles. Attached the changed files.

New boards.txt to replace the current one in the library

used the NANO_33BLE and made the relevant changes for the MM

3 definitions files to be copied to SF_MM_nRF52840_PB:

changes```
includes.txt, (used the one from NANO_33BLE)

change in 

pins_arduino.h, added the line
extern PinName digitalPinToPinName(pin_size_t P);


change in 

variant.cpp, added the line
#include “pinDefinitions.h”


[MM_file_changed.zip|attachment](upload://ptXZEa5IEfwjCRLX3mO1vMoTLHx.zip) (7.53 KB)

I’ve applied the files, and it now fails differently (variety is the spice of life).

exec: “{build.postbuild.cmd}”: executable file not found in %PATH%

I tried rebuilding my Arduino15 directory tree from scratch and re-applying the changed files, in case errors had snuck in elsewhere, but this produced identical results (the above error). The only other references to build.postbuild.cmd that I find in my Arduino15 dir tree is under the neighboring mbed_rp2040 hardware definition, which isn’t a lot for me to compare to or crib from.

Thanks yet again.

The root cause is changes in the library made by Arduino. With version 2.80 changes were made in the folder structure, now with version 3.0 (I have just upgraded) they introduced a new variable “build.postbuild.cmd”. It is a challenge to keep up to date with these changes.

Attached an updated version of the boards.txt which solves that issue and does compile on 3.0.

MM_files_3-0_changed.zip (7.56 KB)

Perfectly clean compile, perfectly clean upload.

Thanks a ton for the assistance. Much of my day job is nagging people to update software, so I’m mentally hard-wired to stay on latest whenever possible. :expressionless: