-
-
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
Open
bikeNomad
wants to merge
5
commits into
micropython:master
Choose a base branch
from
bikeNomad:ned/zephyr-add-xiao-ble-nrf52840-sense
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
zephyr: Add Seeed Studio's XIAO BLE NRF52840 SENSE board. #17679
bikeNomad
wants to merge
5
commits into
micropython:master
from
bikeNomad:ned/zephyr-add-xiao-ble-nrf52840-sense
+238
−37
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit adjusts the configuration of the minimal zephyr build to use MICROPY_CONFIG_ROM_LEVEL_MINIMUM. That's a lot cleaner than explicitly enabling/disabling options. Prior to this change the minimal build for qemu_cortex_m3 had size: Memory region Used Size Region Size %age Used FLASH: 114436 B 256 KB 43.65% RAM: 26320 B 64 KB 40.16% and had the following test results (running using the CI settings, ie `-d basics float --exclude inf_nan_arith`): 352 tests performed (7092 individual testcases) 352 tests passed 254 tests skipped: ... With the changes here the qemu_cortex_m3 size is now: Memory region Used Size Region Size %age Used FLASH: 99428 B 256 KB 37.93% RAM: 26312 B 64 KB 40.15% That's a good decrease of about 15k firmware size. And the test suite still passes with: 342 tests performed (6776 individual testcases) 341 tests passed 265 tests skipped: ... Signed-off-by: Damien George <damien@micropython.org>
This commit adjusts the configuration of the standard zephyr build to use MICROPY_CONFIG_ROM_LEVEL_BASIC_FEATURES. That's a lot cleaner than explicitly enabling/disabling options, and allows boards to more easily fine-tune the settings, eg select a different feature level. Features that are now enabled are: - async/await keyword support - `filter`, `property` and `reversed` builtins - `range` attributes - `str.count()` method - `array` module with `array.array` object - `collections` module with `collections.namedtuple` object - `struct` module with everything - `id = const()` and constant folding in the compiler Bulding qemu_cortex_m3, the code size was originally: Memory region Used Size Region Size %age Used FLASH: 193864 B 256 KB 73.95% RAM: 61992 B 64 KB 94.59% and with this commit it is now: Memory region Used Size Region Size %age Used FLASH: 200698 B 256 KB 76.56% RAM: 61992 B 64 KB 94.59% That's a mild increase of +6834 bytes flash usage for a good selection of new features. Signed-off-by: Damien George <damien@micropython.org>
Thanks for the contribution, this is a nice addition. I've opened #17680 which should help simplify this PR. |
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>
3857a69
to
469d4f0
Compare
The additional features defined in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: