-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Xiao nRF52840 (Sense) board support #151
base: develop
Are you sure you want to change the base?
Conversation
Works on hardware per this report. |
Thanks for the contribution! |
This PR is based on the ArduinoCore-mbed fork of Seeed, not the Adafruit nRF52 fork. But indeed I now see that there are two packages {
"name": "Seeed nRF52 Boards",
"architecture": "nrf52",
"version": "2.6.1",
"category": "Contributed",
"url": "https://files.seeedstudio.com/arduino/core/nRF52840/nrf52840_05202022_2.6.1.tar.bz2",
"archiveFileName": "nrf52840_05202022_2.6.1.tar.bz2",
"checksum": "SHA-256:32A4544728E9C9E234BA7A2F0719019F1FD5AD5A204BCE1227EC2E20F265C4BB",
"size": "31600049",
"boards": [{
"name": "Seeed XIAO nRF52840 Sense"
}],
...
{
"name": "Seeed nRF52 Boards",
"architecture": "nrf52",
"version": "1.0.0",
"category": "Contributed",
"url": "https://files.seeedstudio.com/arduino/core/nRF52840/Arduino_core_nRF52840.tar.bz2",
"archiveFileName": "Arduino_core_nRF52840.tar.bz2",
"checksum": "SHA-256:2754015D46A2EF7A8CF2727F5459BC8C5CAD9F73A7E69A130AC744D39BECEF77",
"size": "49463833",
},
....
What an extremely bad way to name board packages. If there's a 1.0.0 version and a 2.6.1 version, I won't even look at the 1.0.0 version for integration. But indeed, the 1.0.0 core is indeed an entirely different core (https://github.com/adafruit/Adafruit_nRF52_Arduino). I'll have a look at adding this. Not sure if I want to add another |
Pretty much. I'd imagine they thought about maintaining the 2 varaints under the 1.x and 2.x versioning, so an upstream bugfix/feature addition for 1.0.0 would yield an updated BSP package under e.g. 1.0.1, but since Arduino BSPs never do this, this is just asking for trouble. |
I also would like to see the Adafruit runtime support. The Adafruit runtime uses FreeRTOS under the covers, thus an RTOS task is run to execute the "Arduino" setup()/loop(), don't know about the mbed runtime. As mentioned it does wiggle with SoftDevice 6.1.1, I have yet to try rebuilding bootloader/runtime with Softdevice version 7.3.0. I've not discussed this with Seeed at all to see if they might have a heart ache with support tickets re the Adafruit runtime. https://github.com/leroyle/Adafruit_nRF52_Arduino/tree/leroyle |
What's blocking this PR? |
I've updated the Seed ArduinoCore-mbed version from 2.6.1 to 2.8.1 and added support for building for the "1.0.0" core, aka the Adafruit nRF52 core fork, by using the dedicated board definitions I also had to make an update to the extra_script.py of the Adafruit nRF Crypto library to make it compile with the latest PIO version. Blinky and BLE examples are at https://github.com/maxgerhardt/pio-xiao-ble-test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Tested the latest update. It works great! |
Sounds like a merge is in order. |
Would love to be able to use this board with PIO! |
Great work! Would be awesome to use this board with PIO (dito!) 😄 |
Hm I see the full picture now, the new 1.1.1 core does define that macro by itself. I just updated the core. So if you do
in a PlatformIO Core CLI, then it you should not even need the above |
That did it! Thanks, Max. Much appreciated. |
Is there a way to solve |
That should not appear. Are you 100% using the platformio.ini above?
|
Sorry, I might've gotten lost in the conversation. Which ini are you referring to? |
If you have created a new blank PlatformIO project (doesn't matter with which board or framework), you should have in your VSCode file explorer a |
I updated my branch to the latest Can PlatformIO staff please look at this PR? This has been open since |
Thanks for your work on the Seeed XIAO BLE board stuff. I’m using the Seeed XIAO BLE with this setup and it works great. But now I want to get the chip to sleep or indeed set it in low power mode. All examples I can find are based on Adafruit libraries that are a real PIA because a simple program needs SPI, SoftwareSerial and so on. I don’t like Adafruit libraries. Are you still developing for/with the nRF52840 chips and can you lead me to some libraries that will work in this setup without all the Adafruit overhead? For now just BLE, low power modes and interrupt handling (from timers, BLE or gpio pins).. |
I don't even have a single Seeed XIAO board, so I'd recommend to redirect the question to https://forum.seeedstudio.com/ or the Adafruit library repo on how to reduce the dependencies. The dependencies might however also not be "real" in the sense that PlatformIO includes them when really they're behind some |
@mrWheel, if you don't want the overhead of the Arduino libs then you might take a look at using the nordic build tools or Zephyr. both with the newer NRF Connect SDK if you are just getting started, rather than PlatformIO or Arduino. It does look like they have a steeper learning curve though. As an aside in my experience the nordic files contained in the Adafruit runtime are out of sync with the current version of nRF SDK and of course the newer nRF Connect, a few api are incompatible, how many to what extent I did not go down that rabbit hole. In trying to incorporate the Memfault SDK I had to manipulate include paths so the Memfault code built against the Nordic version while the Adafruit libs built against the Adafruit version. This is a just for grins project that I would not recommend for real work. Bottom line might be if you like the Arduino environment and it not being real bleeding edge, yet. Stick with PIO/Arduino. If not then check out Zepher. Admittedly I know little about that environment but it's on my list and looks to be actively supported by Nordic. That said I have no idea if bringing Nordic support upto date in either PIO or Arduino is being worked or is on anyone's radar. |
Thanks for your reply’s. I don’t think I will investigate more time in the nRF52840 chips as every board has his own quirks and the information over bootloaders, soft devices and what not is very poor. Regards |
Why the heck this needed addition hasn't been merged? -.-' |
Can this get merged? |
Any update on a merge? @FernandoPerezLara |
Many people wait for this request will be merged... Why still not merged? Any reason? |
I've noticed people addressing the issue of merging by pinging the current reviewer of this PR. Only members of the PIO organization can merge, if we wish to get this merged we have to bring them up to speed with the fact that the work for this is done. That being said, @ivankravets this PR has been looking good for some time, perhaps we could get it merged. Thank you in advance! |
@ivankravets , any updates about this merge? |
@maxgerhardt, any chance of updating either (Adafruit / mbed) cores for this board? Both are outdated, and official support is non-existent after so long. I even attempted doing so myself, however, I ran into similar issues as explained here, which I could not fix. The problem I had recently with the board was that hardware interrupts were causing it to freeze using the Adafruit variant, and it took me hours to fix. The issue was resolved once I used Arduino IDE to upload a sample code based on the recent version (1.1.8), and switching back to PlatformIO. |
This PR is 2 years old, can you merge it finally? |
Please add Xiao nRF52840 (Sense) board support! Hundreds of people are waiting for this nRF52 jewel to be supported by PlatformIO... |
For anyone having issues with platformio and the Xiao nRF52840 Sense board, here is a fairly simple blink example showing the setup required to get it working. I followed Max's original instructions and had to play around a little bit. https://github.com/morgankenyon/OpenDataDisc/tree/main/software/examples/11_nrf52_blink |
@valeros Could you please take a look at this? We really need it. |
Maybe just like this, when I was referencing the sample code of seeed-mic (https://github.com/Seeed-Studio/Seeed_Arduino_Mic/blob/master/examples/mic_Saved_OnSDcard/mic_Saved_OnSDcard.ino) and realized that successfully compiling it requires adding the definition of "ARDUINO_ARCH_NRF52840" to platformio.ini. |
Another nudge to get the fork merged in. I've been using it successfully on projects. |
Fixes #142.
Based on https://medium.com/@alwint3r/working-with-seeed-xiao-ble-sense-and-platformio-ide-5c4da3ab42a3.
As requested in https://community.platformio.org/t/support-for-seeeduino-xiao-ble-board/28420.
Uses the latest core version as defined in the Arduino package manifest referenced in https://wiki.seeedstudio.com/XIAO_BLE/#software-setup.
Adds
xiaoblesense
andxiaoble
as available boards. (Difference is, the "Sense" version has a IMU and microphone sensors per this).Adds the Seeed version of
framework-mbed
as a new package,framework-mbed-seeed
with version "2.8.1". Adaptions in the builder script are done according to maxgerhardt/builder-framework-arduino-core-mbed@abb229f.Further adds
framework-arduinoadafruitnrf52-seeed
variant offramework-arduinoadafruitnrf52
and adds dedicated board files for the Adafruit varaint of the board used with the "1.0.0" core.Suggested course of action:
framework-mbed-seeed
hereThis PR can be tested by using the
platformio.ini