Open george-hawkins opened 8 years ago
Solved: I got things to work with the latest version of the Arduino IDE - i.e. 1.6.6.
The Arduino people have been fiddling about a lot with platform.txt
in recent IDE releases and the nRF51822-Arduino/.../platform.txt
has drifted apart a bit from the layouts now used in the Arduino repository.
So I rearranged nRF51822-Arduino/.../platform.txt
to match as closely as possible the layout of the Arduino SAM platform.txt
(except for the Avrdude section which I rearranged to match up as much as possible with the Avrdude section if the AVR platform.txt
).
I did all this while keeping all the RBL specific behavior (and removed some elements that are no longer required in the newer IDE releases).
The only really important thing was to separate out the RBL specific #defines like NRF51
into the properties compiler.c.extra_flags
and compiler.cpp.extra_flags
so that the IDE's .ino
converter can pick up compiler.cpp.extra_flags
.
Other than doing this the only real addition that I made was to add the -DNRF51_S130
define that @sandeepmistry already proposed in issue #41 so that one knows that the S130 soft device is being used.
Here is the new platform.txt
that will work with version 1.6.6 of the Arduino IDE. Despite looking very different, it is equivalent to nRF51822-Arduino/.../platform.txt
at revision c6d7669
, i.e. the latest version existing on Dec 6, 2015.
PS best of luck with the DUO Kickstarter - I'm looking forward to receiving mine :smile:
@george-hawkins, Thank you for your good work and support, we will do more better with the open source world! --Cheong
I know the 1.6.5 Arduino IDE is the currently recommended version for nRF51822-Arduino - this is a heads up and explanation of a breaking change that seems to have been introduced in 1.6.6.
If your
.ino
file (or a header it includes) depends on theNRF51
macro (or any of the other normally defined macros) then it will break with 1.6.6.This is because
arduino-builder
(that converts a.ino
into a.cpp
) uses a different recipe to the normalcpp
recipe and this recipe does not currently pick up all the additional defines likeNRF51
.Here's how to see the source of the problem - if you download and unpack arduino-1.6.6-linux64.tar.xz you'll find
arduino-1.6.6/hardware/platform.txt
- open it in an editor and you'll see the lines:The crucial thing is that it doesn't include all the defines (such as
-DNRF51
) then we see incompiler.cpp.flags
innRF51822-Arduino/arduino-1.6.x/hardware/RBL/RBL_nRF51822/platform.txt:21
, i.e.:If you scroll over above you'll see that
recipe.preproc.includes
expects to pick upcompiler.cpp.extra_flags
rather thancompiler.cpp.flags
as defined inRBL_nRF51822/platform.txt
.Note: oddly it's not clear where the file
arduino-1.6.6/hardware/platform.txt
comes from - if I clone the Arduino code base and checkout revision0992606
that's supposed to correspond to 1.6.6 I can't find any equivalent file.