-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
zephyr: Add Seeed Studio's XIAO BLE NRF52840 SENSE board. #17679
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
base: master
Are you sure you want to change the base?
zephyr: Add Seeed Studio's XIAO BLE NRF52840 SENSE board. #17679
Conversation
Thanks for the contribution, this is a nice addition. I've opened #17680 which should help simplify this PR. |
3857a69
to
469d4f0
Compare
The additional features defined in |
Great ! |
@Blafy asks:
Good question. Not using this flash means that instead of 2MiB filesystem we'd have only 32KiB, at least without partition modification. The stock "Storage" partition (given the original overlay; see Although the newest Adafruit UF2 bootloader allows for having no SoftDevice (thus maybe letting us use the 156kiB space for As for putting it into suspend mode, I would hope that the |
This can now be rebased, because the Also, this PR is currently blocked behind #17616 (ADC support), which may take some time to resolve. If you want to get this PR in now (before ADC support) then please remove all the ADC and io-channel stuff from this PR. Otherwise this PR can wait, no hurry. |
Signed-off-by: Ned Konz <ned@metamagix.tech>
…rd files. Signed-off-by: Ned Konz <ned@metamagix.tech>
…ython#17680. @dpgeorge's PR micropython#17680 defines the standard Zephyr config based on MICROPY_CONFIG_ROM_LEVEL_BASIC. This allows for simplifying the XIAO BLE board's mpconfigport-xiao.h. Signed-off-by: Ned Konz <ned@metamagix.tech>
Signed-off-by: Ned Konz <ned@metamagix.tech>
…ectory. Signed-off-by: Ned Konz <ned@metamagix.tech>
1672be8
to
7b7a69b
Compare
Signed-off-by: Ned Konz <ned@metamagix.tech>
OK, rebased and removed ADC stuff from |
|
||
# Enable MicroPython's VFS and mount a littlefs filesystem on boot | ||
CONFIG_MICROPY_VFS_LFS2=y | ||
CONFIG_MICROPY_VFS_FAT=y |
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.
I think these will be enabled by default from prj.conf
, right?
If so, I suggest removing everything from here that's already the default in prj.conf
, to keep this file minimal. Otherwise in the future when people add other boards, they copy this file and there are more and more duplicated settings.
#undef MICROPY_CONFIG_ROM_LEVEL | ||
#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES) | ||
|
||
#define MICROPY_PY_SYS_MODULES (1) |
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.
This is already the default (in py/mpconfig.h
), so can be removed.
#include "../mpconfigport.h" | ||
|
||
#undef MICROPY_CONFIG_ROM_LEVEL | ||
#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES) |
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.
If you set this before including ../mpconfigport.h
then it doesn't need to be undef'd.
@@ -0,0 +1,8 @@ | |||
# freeze("../modules") |
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.
This comment can be removed.
# freeze("../modules") | ||
include("$(MPY_DIR)/extmod/asyncio") | ||
|
||
# Require a micropython-lib module. |
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.
This comment is not really correct, it was copied from the example manifest.
You could remove it, or change it to something like "Require some useful micropython-lib modules."
Summary
This PR adds Zephyr support for Seeed Studio's XIAO BLE NRF52840 SENSE board.
It also provides a good example of a richer Zephyr port than the default, adding:
asyncio
,upysh
,aioble
,neopixel
, andaiorepl
).aioble
(at least for thetemp_sensor.py
example)random
,re
,struct
, etc./flash
You can build it in the usual way:
This will produce a
.uf2
file inbuild/zephyr/zephyr.uf2
that can be copied into the XIAO-SENSE USB drive that appears when you double-click theRESET
button.Testing
I have tested this on several of these boards, with and without my ADC (#17615) and
zensor.Sensor.attr_set()
(#17653) PRs.I have run the
aioble
temp_sensor.py
example but haven't done much more with the BLE.Trade-offs and Alternatives
The build size is as follows: