Repository navigation
Description
I'm getting compile errors in Arduino IDE when I try to compile FastLed examples for the Adafruit ItsyBitsy nRF52840 Express. It compiled fine for a Arduino Uno and Nano 33 BLE. I'm testing with FirstLight but I think its a compatibility problem with the board. I read another issue and tried un-commenting two lines in fastpin_arm_nrf52.h:
#define NRF_P0_BASE 0x50000000UL
#define NRF_P1_BASE 0x50000300UL
Here are the compile errors:
Arduino: 1.8.13 (Windows 10), Board: "Adafruit ItsyBitsy nRF52840 Express, 0.2.11 SoftDevice s140 6.1.1, Level 0 (Release)"
In file included from C:\Users\savall21\Documents\Arduino\libraries\FastLED\examples\FirstLight\FirstLight.ino:6:
C:\Users\savall21\Documents\Arduino\libraries\FastLED/FastLED.h:14:21: note: #pragma message: FastLED version 3.002.010
14 | # pragma message "FastLED version 3.002.010"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Users\savall21\Documents\Arduino\libraries\FastLED/FastLED.h:48,
from C:\Users\savall21\Documents\Arduino\libraries\FastLED\examples\FirstLight\FirstLight.ino:6:
C:\Users\savall21\Documents\Arduino\libraries\FastLED/fastpin.h: In instantiation of 'class FastPin<3>':
C:\Users\savall21\Documents\Arduino\libraries\FastLED/platforms/arm/nrf52/clockless_arm_nrf52.h:52:38: required from 'static void ClocklessController<_DATA_PIN, _T1, _T2, _T3, _RGB_ORDER, _XTRA0, _FLIP, _WAIT_TIME_MICROSECONDS>::startPwmPlayback_InitializePinState() [with unsigned char _DATA_PIN = 3; int _T1 = 6; int _T2 = 8; int _T3 = 6; EOrder _RGB_ORDER = RGB; int _XTRA0 = 0; bool _FLIP = false; int _WAIT_TIME_MICROSECONDS = 10]'
C:\Users\savall21\Documents\Arduino\libraries\FastLED/platforms/arm/nrf52/clockless_arm_nrf52.h:247:44: required from 'static void ClocklessController<_DATA_PIN, _T1, _T2, _T3, _RGB_ORDER, _XTRA0, _FLIP, _WAIT_TIME_MICROSECONDS>::startPwmPlayback(uint16_t) [with unsigned char _DATA_PIN = 3; int _T1 = 6; int _T2 = 8; int _T3 = 6; EOrder _RGB_ORDER = RGB; int _XTRA0 = 0; bool _FLIP = false; int _WAIT_TIME_MICROSECONDS = 10; uint16_t = short unsigned int]'
C:\Users\savall21\Documents\Arduino\libraries\FastLED/platforms/arm/nrf52/clockless_arm_nrf52.h:166:25: required from 'void ClocklessController<_DATA_PIN, _T1, _T2, _T3, _RGB_ORDER, _XTRA0, _FLIP, _WAIT_TIME_MICROSECONDS>::showPixels(PixelController<_RGB_ORDER>&) [with unsigned char _DATA_PIN = 3; int _T1 = 6; int _T2 = 8; int _T3 = 6; EOrder _RGB_ORDER = RGB; int _XTRA0 = 0; bool _FLIP = false; int _WAIT_TIME_MICROSECONDS = 10]'
C:\Users\savall21\Documents\Arduino\libraries\FastLED/platforms/arm/nrf52/clockless_arm_nrf52.h:161:18: required from here
C:\Users\savall21\Documents\Arduino\libraries\FastLED/fastpin.h:207:24: error: static assertion failed: Invalid pin specified
207 | static_assert(validpin(), "Invalid pin specified");
| ~~~~~~~~^~
In file included from C:\Users\savall21\Documents\Arduino\libraries\FastLED/platforms/arm/nrf52/fastled_arm_nrf52.h:8,
from C:\Users\savall21\Documents\Arduino\libraries\FastLED/platforms.h:11,
from C:\Users\savall21\Documents\Arduino\libraries\FastLED/FastLED.h:52,
from C:\Users\savall21\Documents\Arduino\libraries\FastLED\examples\FirstLight\FirstLight.ino:6:
C:\Users\savall21\Documents\Arduino\libraries\FastLED/platforms/arm/nrf52/clockless_arm_nrf52.h: In instantiation of 'static void ClocklessController<_DATA_PIN, _T1, _T2, _T3, _RGB_ORDER, _XTRA0, _FLIP, _WAIT_TIME_MICROSECONDS>::startPwmPlayback_InitializePwmInstance(NRF_PWM_Type*) [with unsigned char _DATA_PIN = 3; int _T1 = 6; int _T2 = 8; int _T3 = 6; EOrder _RGB_ORDER = RGB; int _XTRA0 = 0; bool _FLIP = false; int _WAIT_TIME_MICROSECONDS = 10]':
C:\Users\savall21\Documents\Arduino\libraries\FastLED/platforms/arm/nrf52/clockless_arm_nrf52.h:248:47: required from 'static void ClocklessController<_DATA_PIN, _T1, _T2, _T3, _RGB_ORDER, _XTRA0, _FLIP, _WAIT_TIME_MICROSECONDS>::startPwmPlayback(uint16_t) [with unsigned char _DATA_PIN = 3; int _T1 = 6; int _T2 = 8; int _T3 = 6; EOrder _RGB_ORDER = RGB; int _XTRA0 = 0; bool _FLIP = false; int _WAIT_TIME_MICROSECONDS = 10; uint16_t = short unsigned int]'
C:\Users\savall21\Documents\Arduino\libraries\FastLED/platforms/arm/nrf52/clockless_arm_nrf52.h:166:25: required from 'void ClocklessController<_DATA_PIN, _T1, _T2, _T3, _RGB_ORDER, _XTRA0, _FLIP, _WAIT_TIME_MICROSECONDS>::showPixels(PixelController<_RGB_ORDER>&) [with unsigned char _DATA_PIN = 3; int _T1 = 6; int _T2 = 8; int _T3 = 6; EOrder _RGB_ORDER = RGB; int _XTRA0 = 0; bool _FLIP = false; int _WAIT_TIME_MICROSECONDS = 10]'
C:\Users\savall21\Documents\Arduino\libraries\FastLED/platforms/arm/nrf52/clockless_arm_nrf52.h:161:18: required from here
C:\Users\savall21\Documents\Arduino\libraries\FastLED/platforms/arm/nrf52/clockless_arm_nrf52.h:62:55: error: 'nrf_pin' is not a member of 'FastPin<3>'
62 | pwm->PSEL.OUT[0] = FastPin<_DATA_PIN>::nrf_pin();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
exit status 1
Error compiling for board Adafruit ItsyBitsy nRF52840 Express.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Thanks in advance for the help.
Activity
sutaburosu commentedon Jul 20, 2020
FastLED support for nRF52 is quite new. You're using v3.2.10 which is rather old. Several nRF52 fixes have been incorporated since the v3.3.3 release. Try using the master branch here; I get some warnings, but at least compilation succeeds. It would be useful if you could report whether the generated binary works for you. I don't have such a device to test with.
henrygab commentedon Aug 3, 2020
@savall21 -- ItsyBitsy nRF52840 is not a supported board.
Every board needs to have its pinout defined. Then, more important is to test (which is a big job).
But for your own purposes, you could probably get it working fairly quickly.
First however... the error message above suggest you are trying to use Arduino pin
D3... but isn't that connected to a LED onboard? If so, find an unused pin.Start by reviewing PR 1027 -- which just added the Circuit Playground Bluefruit. (The ItsyBitsy nRF52840 is one board that I don't have.)
You will need to figure out which pins are usable on that board, and how the ARDUINO pins map to the nRF port/pin numbers (hint: look in variants subdirectory of the Adafruit hardware BSP files)..
Here's a few examples that (entirely untested and unsupported), may unblock you -- just put the following at the top of your sketch:
Good luck!
Sladerix commentedon Oct 19, 2022
Any news on it?
henrygab commentedon Oct 20, 2022
If the board is uses FreeRTOS, then see:
If the board is using MBED OS, then see:
The status has not changed since those were written. Given the ubiquity of ESP32 solutions (e.g., WLED and ESPixelStick) I am unlikely to put significant additional effort into new support for nRF52. This doesn't prevent anyone else from putting in the efforts to get this working under MBED OS ... it's open source, after all!
fix #1445 #1055