Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Support for nRF52xxx (e.g., nRF52840) #747
Is it possible to port to the nRF52840, at least for SPI LED types?
Although the nRF52xxx is similar to the nRF51xxx (which is supported), if I understand correctly, portions of the nRF52 core run at high interrupt level (for BLE), and they cannot be disabled by user application code. Obviously, this could impact any code depending on tight execution timing. Based on this, would some LED control types need to be explicitly excluded (e.g., NeoPixel)?
Wow, looks great, @pcaddict
Would you be able to help me understand a couple items?
Line https://github.com/pcaddict/FastLED/blob/master/platforms/arm/nrf52/fastspi_arm_nrf52.h#L59 appears to set MISO to port0.pin1.
Line https://github.com/pcaddict/FastLED/blob/master/platforms/arm/nrf52/fastspi_arm_nrf52.h#L87 appears to state that the function returns immediately after setting the register. However, it appears at line https://github.com/pcaddict/FastLED/blob/master/platforms/arm/nrf52/fastspi_arm_nrf52.h#L95 to wait for the end-of-transmission event.
After lots of tinkering, compiling, and adding compilation asserts / pragma messages, I've started to understand some aspects of this port. I think it will be possible to port this, which is great. Even better, we may be able rely upon the availability of Nordic's nrfx repo (part of at least Adafruit's BSP for Feather Express 52840. Work now underway....
Sorry for the late reply, I did not see a notification that anyone had responded.
Q1b. Agreed. I think I might have explicitly told PSEL.CSN to be 0xFFFFFFFF at some point but probably removed it for some unknown reason.
Q2. The comment is wrong. I took code from the NRF51 and Teensy platforms and it is likely something that originated elsewhere.
What features of the nrfx library are you thinking will be useful here?
I have not had much luck running this on my nrf52840. I have not been able to get the Adafruit BSP to play nicely with the Particle Xenon board I have, which is mostly used with the Nordic SDK anyway, so all of my testing has been with my feather52832.
Thanks for answers, it helps me sanity-check my understanding, and keep my sanity. :)
Why use nrfx?
I've already gotten the simplest of items showing on a dotstar strip (RGB ordering verification, simple chaser). I'll push a branch "real soon now".
Do you have any thoughts on how to test/validate the nRF52840 support is "complete"?
@henrygab I'm interested to see what improvements you've made to my hatchet job of a port. I honestly got it to a point of "hey pretty lights" one afternoon and did not explore it much further than that. I did try to understand how to get neopixels working and ran out of patience.
In regards to nrfx, I wonder if that isn't going to add a bunch of complexity that many users won't want to deal with, especially in Arduino land. Might make the possibility of porting to the Nordic SDK a little simpler though.
As far as validating that support is complete, I'd imagine that'll take some community testing with various led chipsets. This is probably something @focalintent should comment on.
For some reason Particle Xenon isn't playing nicely with the nordic QSPI libraries in the Adafruit BSP. I've tried removing everything I could find having to do with the QSPI memory and still have problems with most sketches compiling. Since I got the Xenon primarily for working with the Nordic SDK anyway I have not put too much time towards figuring out why I am having the problems I am. Other than that the Xenon is a great dev board and they were a steal at $9 during pre-order.