To get the board up and running in Arduino IDE (1.8.15) I have followed the instruction: MicroMod nRF52840 Processor Hookup Guide - SparkFun Learn
In the Arduino IDE Arduino mbed 1.3.1 is used and the Arduino IDE detect the MicroMod board, Board: “Sparkfun MicroMod nRF52840 Board”.
The simple Blink example is working, and sending a text to the serial monitor also works fine. However, the moment I try to read for example a sensor (Example1_Basics), it compiles but I get, for the ICM 20948, Initialization of the sensor returned: Data Underflow. Trying again…
Of course, I forget a detail, the nRF52840 Processor board uses the Arduino BLE bootloader however, the MicroMod has a different board definition.
I see they’re instructing there to add a custom variant folder, SF_MM_nRF52840_PB, to the core, along with boards.txt modificatations. So in PlatformIO you will have to do the equivalent of that.
( @7.1.0 is needed to get core version 1.3.2, bugfix of 1.3.1).
Rebuild your sketch. You should get errors now saying something like
arm-none-eabi-g++: error: C:\Users\Max\.platformio\packages\framework-arduino-mbed@1.3.2\variants\SF_MM_nRF52840_PB\includes.txt: No such file or directory
Open the above path to the variants folder (so for above e.g. C:\Users\Max\.platformio\packages\framework-arduino-mbed@1.3.2\variants\). Download the variant definition here and copy the SF_MM_nRF52840_PB from there into the variants folder. It should now look like
Then, rebuild the project. It should now give you a success.
RAM: [== ] 16.5% (used 43136 bytes from 262144 bytes)
Flash: [= ] 7.8% (used 76604 bytes from 983040 bytes)
============== [SUCCESS] Took 13.93 seconds ==============
Hi, I’ve tried the approach proposed by @maxgerhardt but upon building I get a cortex_m4.h not found. The full path to the complaining header is ~/.platformio/packages/framework-arduino-mbed@1.3.2/cores/arduino/mbed/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/modules/nrfx/mdk/nrf52840.h:151:10: fatal error: core_cm4.h: No such file or directory
Looking for such cortex_m4.h header I found a candidate library, armmbed/cmsis-core but this doesn’t help.
Zero result on google about this so I’m now turning back to you for some help.
I’m on linux, and PlatformIO Core, version 6.0.1…
Ludo
Irrelevant to the topic, just a side note: we are Saturday, I’m a fellow European writing from a place 10,000km East of Germany and as soon as I finished writing I see at the bottom of this page an icon reading “M replying…”. Nothing short of an incredibly responsive Max!
With your repo I have no more issue with the absence of cortex_m4.h header indeed and the build is a [SUCCESS] (with the same sketch as the one you mentioned).
Now this was only an exercise for me to try to solve another issue with the same nrf52840 “micromod” from sparkfun to work with their input and display carrier board (I have some issues with pin definitions, PWM0 pins not found though I see it in the pins_arduino.h in the SF_MM_nRF52840_PB variants of your original solution earlier but not in that of your updated one. [EDIT: the PWM0 is defined in the updated variant also].). But that will be for another topic unless I manage to solve it.
Many thanks for your updated solution to this post, have a good Saturday!
Yes, sorry I was too slow to edit my post, I had solved that … (It’s late here and I’m exhausted, hadn’t catch it fast enough, I was editing my post to say it builds successfully while you were replying).
Max, your solution DOES work also for using this nrf52840 board with the MicroMod input and display carrier board contrary to what I thought one post earlier…