You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Knowledge of all chip pin <==> Arduino pin mappings
For each pin that is usable for a given board, there are up to three (yes, 3x!) pin numbers that could be used, one of which has two forms. Let me explain and give them names:
ARDUINO == This is the standard Arduino numbering, often used with a "D" prefix, such as D2. This is most often used to generate a physical external PCB connection that is compatible with one of the official Arduino branded boards, but these numbers might have NOTHING to do with what is used at the lowest chip level.
CHIP aka PORT/PIN == the chip-level view of the port. This can be written in two ways, but it's most commonly written in the form PX.YY, such as P0.16 or P1.10 or the like. When written as a single integer (for the nRF52 boards), the integer representation is always (32*X) + YY.
PCB Label == Each board can have a manufacturer-defined number listed on the PCB. This might match the Arduino numbers, the chip numbers, or be whatever the board designer felt like throwing on.
What you need is often found in a table in variant.h / variant.cpp in the BSP.
Knowledge of unique preprocessor define for the board
Use the RedBear BLE Nano 2 as a fairly simple example. It defines ARDUINO_RB_BLE_NANO2, and the board only exposes ten usable pins.
Expand the above three sections for details at each step. Then, as the most critical step, VERIFY EACH AND EVERY PIN, USING THE ARDUINO PIN NUMBERING. Set the pin as output in setup(), and use the FastPin<x> template to flip the state similar to the blink example.
Untested pseudo-code
// untested pseudo-code// Modify this one define to test each pin, one at a time …// Use multimeter, scope, or LED (+resistor) to verify the correct pin is being manipulated
#defineARDUINO_PIN_TO_TEST1uvoidsetup(void) {
// similar to pinMode(ARDUINO_PIN_TO_TEST, OUTPUT);// but also:// sets high drive mode// disables pin sense level// disables pull-up/pull-down// disconnects input buffering
FastPin<ARDUINO_PIN_TO_TEST>::setOutput();
}
voidloop(void) {
// equivalent to digitalWrite(ARDUINO_PIN_TO_TEST, HIGH);
FastPin<ARDUINO_PIN_TO_TEST>::hival();
delay(1000);
// equivalent to digitalWrite(ARDUINO_PIN_TO_TEST, LOW);
FastPin<ARDUINO_PIN_TO_TEST>::loval();
delay(1000);
}
Short answer:
No support for the Nano 33 BLE / Nano 33 BLE Sense is expected in very near future.
Details...
There's more required. The nrf52 support I wrote presumes the use of FreeRTOS. The Arduino BSP decided to go with mbedos. Support for mbedos would need someone to encapsulate the freertos-specific code, abstract it, write the mbed-equivalents, and test both versions. This is not a huge effort (compared to writing support from scratch), but would still be a fair amount of work.
Alternatively, if you reprogram it to use the AdaFruit bootloader and hack the Adafruit BSP to work with the board, then you might come up with something like the following (untested) list of pin defines:
_FL_DEFPIN( 0, 3, 1); // D0 is P1.03_FL_DEFPIN( 1, 10, 1); // D1 is P1.10_FL_DEFPIN( 2, 11, 1); // D2 is P1.11_FL_DEFPIN( 3, 12, 1); // D3 is P1.12_FL_DEFPIN( 4, 15, 1); // D4 is P1.15_FL_DEFPIN( 5, 13, 1); // D5 is P1.13_FL_DEFPIN( 6, 14, 1); // D6 is P1.14// D7 and D8 have a mismatch between the diagram and the BSP_FL_DEFPIN( 9, 27, 0); // D9 is P0.27_FL_DEFPIN(10, 2, 1); // D10 is P1.02_FL_DEFPIN(11, 1, 1); // D11 is P1.01_FL_DEFPIN(12, 8, 1); // D12 is P1.08_FL_DEFPIN(14, 4, 0); // D14 is P0.04_FL_DEFPIN(15, 5, 0); // D15 is P0.05_FL_DEFPIN(16, 30, 0); // D16 is P0.30_FL_DEFPIN(17, 29, 0); // D17 is P0.29_FL_DEFPIN(20, 28, 0); // D20 is P0.28_FL_DEFPIN(21, 3, 0); // D21 is P0.03
Closing as a documented support boundary in #2698. The maintained nRF52 backend targets the Adafruit nRF52 / Bluefruit Arduino BSP used in CI, not the Arduino Nano 33 BLE / BLE Sense mbed OS core. The maintained nrf52840_dk path is verified with fbuild v2.2.15.
Activity
Biohazard90 commentedon Dec 4, 2019
I have the same issue, looks like the library doesn't recognize and support the platform for the Nano 33/nRF528x correctly yet.
henrygab commentedon Jan 11, 2020
@hccstem, @Biohazard90 -- Here's the basics to enable a new board for the nRF52840:
OK, so what does step #3 entail?
Knowledge of all chip pin <==> Arduino pin mappings
For each pin that is usable for a given board, there are up to three (yes, 3x!) pin numbers that could be used, one of which has two forms. Let me explain and give them names:
ARDUINO == This is the standard Arduino numbering, often used with a "D" prefix, such as
D2. This is most often used to generate a physical external PCB connection that is compatible with one of the official Arduino branded boards, but these numbers might have NOTHING to do with what is used at the lowest chip level.CHIP aka PORT/PIN == the chip-level view of the port. This can be written in two ways, but it's most commonly written in the form
PX.YY, such asP0.16orP1.10or the like. When written as a single integer (for the nRF52 boards), the integer representation is always(32*X) + YY.PCB Label == Each board can have a manufacturer-defined number listed on the PCB. This might match the Arduino numbers, the chip numbers, or be whatever the board designer felt like throwing on.
What you need is often found in a table in variant.h / variant.cpp in the BSP.
Knowledge of unique preprocessor define for the board
This one should be pretty easy. Just build and look at the build log. Or, do it "correctly" by looking into the BSP's JSON. See relevant lines for the AdaFruit Bluefruit nRF52840 Feather Express as an example.
Put it all together...
Use the RedBear BLE Nano 2 as a fairly simple example. It defines
ARDUINO_RB_BLE_NANO2, and the board only exposes ten usable pins.Expand the above three sections for details at each step. Then, as the most critical step, VERIFY EACH AND EVERY PIN, USING THE ARDUINO PIN NUMBERING. Set the pin as output in
setup(), and use theFastPin<x>template to flip the state similar to the blink example.Untested pseudo-code
Hope that helps!
henrygab commentedon Jan 11, 2020
Short answer:
No support for the Nano 33 BLE / Nano 33 BLE Sense is expected in very near future.
Details...
There's more required. The nrf52 support I wrote presumes the use of FreeRTOS. The Arduino BSP decided to go with mbedos. Support for mbedos would need someone to encapsulate the freertos-specific code, abstract it, write the mbed-equivalents, and test both versions. This is not a huge effort (compared to writing support from scratch), but would still be a fair amount of work.
Alternatively, if you reprogram it to use the AdaFruit bootloader and hack the Adafruit BSP to work with the board, then you might come up with something like the following (untested) list of pin defines:
zackees commentedon Jun 3, 2026
Closing as a documented support boundary in #2698. The maintained nRF52 backend targets the Adafruit nRF52 / Bluefruit Arduino BSP used in CI, not the Arduino Nano 33 BLE / BLE Sense mbed OS core. The maintained nrf52840_dk path is verified with fbuild v2.2.15.