Is there a functional difference between Platformio's "framework-arduinoadafruitnrf52" firmware and arduino's official firmware

1 2

Are these two firmware the same?

Does platformio implement all the functions of the official firmware?

I want to use nrf52832 to create a project with HID. I found an example in arduino IDE, then copied the code of this example to platformio, and then compiled it, but it failed.

platformio prompts that it is missing “BLEHIDPeripheral.h”, I found this file in the firmware provided by arduino IDE, but it was not found in the firmware provided by platformio

I can’t find the arduino primo board in platformio either

PlatformIO copies the Arduino cores as its own seperate package, since it does its own package management. So e.g., we have the PlatformIO package framework-arduinoadafruitnrf52 of the latest version 1.2100.201028 which means it maps to version 0.21.0 release of Adafruit’s nRF52 core release.

Every Arduino core that PlatformIO can build for is managed in its own framework-arduinox package and the platform (nordicnrf52) has to have explicit code support for being able to build a specific Arduino core.

Currently for nRF52, the supported cores are

Each core supports its own set of boards and its own set of APIs and are not necessarily compatible between each other – a firmware written against one core may not work on another core if different libraries are APIs are used which don’t exist equivalently in the other core.

From that you can also see that PlatformIO does not currently implement this “ArduinoCore-primo” core with that Arduino Primo (nRF52832 based) baord. Since both that core and that board are deprecated, I don’t think official support will come either. A custom user-made implementation was referenced in this issue if you still want to try it out.

If the main goal is just using the Arduino Primo board I’d just recommend to use any other board with a nRF52832, like e.g. board = adafruit_feather_nrf52832, and with it Adafruit’s core, and try and program it with that; Just be aware that the pin labels “D1” etc do not map correctly to that board then, but you can still reference “absolute” pinnames like P1.12.

1 Like

Thank you for your answer, it is very useful to me, thank you very much

How do I switch between the two Arduino cores? I have some issues wtih sandeepmistry’s one, since apparently many nrf SDK components were not implemented, and would love to switch to Adafruit’s one.

Which core is being used depends on the used board = .... Technically speaking, when you look at the available boards, there will be some which have a "bsp": {"name": "adafruit"} (–> Adafruit nRF52) or not. The builder script also showcases this.

So e.g.,

is a board which will use the Adafruit core, while

will use nRF5.

I see. My board corresponds to the latter example, that is, nRF52 is the default.
Now, I guess I need to add the

to my board’s json file, since the latter example doesnt have the bsp. Could this be a correct appraoach?

While this will generally select the Adafruit core, this will not work as a whole. The "variant" value additionally selects the used sub-variant folder of the core, see variants. This would have to be adapted too, at least.

It’s better to search for an Adafruit board with the exact same chip and select that board directly, instead of creating your own.