PlatformIO Community

Build for nRF53832 feather suddenly fails when including bluefruit.h (#error CryptoCell CC310 not supported)

Hi everyone,

A day ago my builds for the nRF52832 started failing without code changes with the following error:

C:\.platformio\packages\framework-arduinoadafruitnrf52\libraries\Adafruit_nRFCrypto\src\Adafruit_nRFCrypto.cpp:36:4: error: #error CryptoCell CC310 is not supported on this board
   #error CryptoCell CC310 is not supported on this board
    ^~~~~
*** [.pio\build\adafruit_feather_nrf52832\libd32\Adafruit_nRFCrypto\Adafruit_nRFCrypto.cpp.o] Error 1

I tried the same with ArduinoIDE and it built without issues but also fails on a fresh install of Visual Studio Code and PlatformIO extension for it. So I guess it was caused by some automatic platformio-specific library or configuration update.

In this issue-thread I tried to track the issue and provide a minimal code sample: https://github.com/adafruit/Adafruit_nRF52_Arduino/issues/737

To summarize: As soon as you include bluefruit.h , the build fails because it wants for the macro NRF_CRYPTOCELL to be defined for some reason with the above message. When looking for this macro, it is defined in the nrf52840.h headerfile (in C:\.platformio\packages\framework-arduinoadafruitnrf52\cores\nRF5\nordic\nrfx\mdk ). An analogous file does NOT (or no longer?) exist for the nrf52832 (only a *_periphals.h).

I would be grateful if someone had a pointer why this error occurs exactly now (after no explicit change) or where I can go to look for changelogs/commits that potentially caused the deletion of an nrf52832.h ? Anyway, all help to fix this problem is greatly appreciated! Thanks in advance.

I’ve encountered that too in https://github.com/platformio/platform-nordicnrf52/pull/155 and fixed it by ignoring the library.

lib_ignore = Adafruit nRFCrypto

in the platformio.ini.

There may be a conditional include there that includes that library, so maybe setting lib_ldf_mode = chain+ fixes it too.

Yeah

has a conditional include based on a macro but

has no library.json that could tell PlatformIO to turn on its more stringent library dependency finder mode, so the LDF will always try to include Adafruit_nRFCrypto.h when any BLE header is included.

Weird! Thanks for the workaround.

What strikes me is that this worked previously (literally 2 days ago) without issues and I cannot find any that-recent release in these libraries changing any behaviors. Did you find one where we could mention this issue appearing?

I have created https://github.com/adafruit/Adafruit_nRF52_Arduino/pull/738 to counteract this, but I still have to test this.

And that was with the exact same example code? No inclusion of BLE libraries won’t lead to this error.

No, it was a relatively complex BLE implementation that had bluefruit.h includes. Thinking about it, it may have re-used old compiled versions of the library and therefore not occurred until now (for some reason it may have recompiled… maybe I fat-fingered a global clean all or something).

Anyway, the library-exclude fixed the issue for now; hopefully your amazingly swift fix-implementation gets included and released soon!