-
Notifications
You must be signed in to change notification settings - Fork 8.3k
boards: arm: add Seeed XIAO BLE board #46358
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
Conversation
a35faf2 to
55d696f
Compare
carlescufi
left a comment
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.
Looks good, thanks!
|
@anangl can you please take a look? |
|
Some comments, since I have this board too. I haven't tried to upstream it, since I don't know yet how to configure the onboard flash for zephyr (I'm still new here) Shouldn't it be named seeed_xiao_ble to match the other seeed board? It seems not to have support for the flash on qspi. is that intentional? It'd be nice to have it working if possible. I've asked @petejohanson to take a look as well, since he also has this board, and is a bit more familiar with zephyr than I am. EDIT: here's a link to his board defintiion from the zmk repo: https://github.com/zmkfirmware/zephyr/tree/v3.0.0%2Bzmk-fixes/boards/arm/seeeduino_xiao_ble |
55d696f to
5e39950
Compare
Looking at Seeed WIKI boards are structured as:
Also, board names in Zephyr are not prepended with vendor name ("seeed" in that case).
I have configured spi3 (with spi_nor driver) peripheral instead of qspi, simply because I was not succesful with qspi, but everything is fine and tested with spi3 and spi_nor driver. Once qspi is figured out how it should be configured, then we can make a follow up patch with that improvement. I think #46285 needs to be resolved first. |
|
So that is the proper configuration for the flash chip (even if not on the bus we wish it was) ? it works? |
It works. Tested with |
petejohanson
left a comment
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.
A few comments, based on the differences between this definition and the one we've been using in ZMK.
|
Our board definition: https://github.com/zmkfirmware/zephyr/tree/v3.0.0%2Bzmk-fixes/boards%2Farm%2Fseeeduino_xiao_ble (I hadn't had a chance to test the flash, so definitely ignore that portion) |
5e39950 to
faa2f19
Compare
|
I have tested this with the seeeduino xiao ble and the littlefs sample (but you need the fix from here for it to work). I don't believe quad IO will work as-is because of a similar problem with the GD flash chips where you need to enable quad IO through a register write and the driver doesn't do this (or at least the last time I checked). Also here are my pinctrl configs: |
@jeremyherbert Quad IO should work after adding |
|
Thank you @anangl - I wasn't aware of that. I can confirm that the following works with the littlefs sample and the device I have: |
|
Unfortunately I was still not able to run external flash with QSPI instead of SPI. Maybe I just used the wrong PRs / patches, not sure. @jeremyherbert can we leave that part to a follow-up PR with an improvement switching from SPI to QSPI? I would prefer the same with switching from mcuboot flash layout to uf2 or whatever sits there by default. Any objections? |
|
Given the review cycle can take a while, I'm not sure I agree with the flash layout/UF2 approach suggested. Maybe a Zephyr maintainer can weigh in, but I still think defaults that match the default bootloader should be expected as a baseline. I'm happy to send a PR to your fork/branch with the changes, if that would help. |
|
@petejohanson If you will provide documentation part (how to use uf2, how to flash inside index.rst changes, etc.) then I can include those changes in this PR. Factory compatible layout is just part of that and I don't want to include that in a PR without testing that it works. For now I tried to use uf2 by my own, without success, but I gave up mainly because it took much more time than I could spent on it. There are plenty of things already tested and documented as part of this board, like USB with shell and hello world, UART (when using instead of USB) with shell and hello world, documentation about how to use that board with J-Link, west runner configuration, RGB led (with blinky samples) and many more. IMO layout is not a blocking point, because right now this PR can be used to successfully use XIAO BLE with external programming probe (which is documented that way).
A lot depends on the quality of PR. There are PRs merged in the same day, quite often. If you will have PR with flash layout and documentation changes, just assign me to this PR, so I can test and approve it. What happens now is that basic board support PR is not being merged because there are some comments that "this or that could be improved". I agree with those, but I don't have time and interest in doing 100% support for that board now, and just want to unblock PR with 90% of the work already done, so that other Zephyr users/developers can take it from that point. |
|
@mniestroj no worries, qspi can come later. I can create a PR once this and the nrfx fix is merged. Out of interest, when you tested QSPI did you just get a hang at boot? That is the issue which I had. |
Yes, that was one of the symptoms. Another was "disabled" flash device when listed with |
|
Whatever we want to do in terms of timing is fine, I've created a PR against your branch here: mniestroj#1 But I'm just as happy to submit that to Zephyr once this is merged as well. If you've already cleared the default bootloader, and want to test UF2 flashing, they published their bootloader hex (linked from their wiki) at https://github.com/0hotpotman0/BLE_52840_Core/blob/main/bootloader/Seeed_XIAO_nRF52840_Sense/Seeed_XIAO_nRF52840_Sense_bootloader-0.6.1_s140_7.3.0.hex |
faa2f19 to
2bb5ce3
Compare
|
UF2 is now built by default with UF2 compatible flash layout. Updated documentation. |
A fix was just merged. If someone has time can they give it a go? |
|
is there a reason nrfjprog is excluded from would be the line sto add if it wasn't on purpose. |
2bb5ce3 to
b68a086
Compare
I didn't test it previously, so wasn't sure it works. Added it now (after testing), thanks! |
|
Rebased on main, solved conflicts and added nrfjprog support. @petejohanson @jrobeson Could you please review and approve? You are the most interested in addition of this board, which is why I guess other Zephyr maintainers wait before approving :) |
petejohanson
left a comment
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!
The Seeed XIAO BLE is a tiny (21 mm x 17.5 mm) Nordic Semiconductor nRF52840 ARM Cortex-M4F development board with onboard LEDs, USB port, QSPI flash, battery charger, and range of I/O broken out into 14 pins. Co-authored-by: Peter Johanson <peter@peterjohanson.com> Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
b68a086 to
9f91588
Compare
| @@ -0,0 +1,9 @@ | |||
| # SPDX-License-Identifier: Apache-2.0 | |||
|
|
|||
| board_runner_args(nrfjprog "--nrf-family=NRF52") | |||
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've seen --softreset added to the nrfjprog args in other nrf boards. Without it, it doesn't seem to reset the board as I would expect. Maybe that's not the behavior as others would expect though?
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.
--softreset is required only if you don't have hardware reset connected. I think that when I have RST (pogo pin) connected to J-Link, then XIAO BLE was reset automatically after flashing.
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.
ah, you're right. the expansion board doesn't expose reset in the header for some reason. it's got TX, RX, SWDIO, SWCLK, 3v3,5v, and 2 GND, but NOT reset. The reset is exposed to a button instead.
I guess we can just leave it the way it is until there's something explicit about the expansion board. That'd be for a separate PR.
|
I see there are basic instructions for how to use this with external debuggers, but not necessarily for how to use it with mcuboot. Should there be? I'm currently trying to use the smp svr sample, and to get it to compile (but probably not work) I've had to:
There are only 2 other arm boards that enable This board is the only arm board that provides There's one more concern, even if one were to get to build with those options. The compilation will fail due to not being able to link in the acm cdc device. It's also already too big to fit into the default mcuboot partition size of 44K by about 2500 bytes. That's probably not the total shortfall though. EDIT: i totally forgot i switched to use the partitioning of nrf52840dk (and the other nrf52 boards that support mcuboot out of the box). So instructions are needed for mcuboot generally. |
|
got it to compile with mcuboot. turns out you need to enable |
I don't plan to add such section for now. However that would be welcome. |
|
With yesterday's rebase CI is passing now. So please re-review if you have time :) cc @petejohanson @jrobeson @anangl @carlescufi |
ghost
left a comment
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. The expansion board stuff should be done in a separate PR.
This is a variant of XIAO BLE with additional features: * LSM6DS3TR-C 6D IMU (3D accelerometer and 3D gyroscope), * PDM microphone. Since LSM6DS3TR-C is almost the same as LSM6DSL (the former has slightly higher current consumption than the latter, but the register map looks exactly the same), add devicetree node with "st,lsm6dsl" compatible. LSM6DS3TR-C is powered directly by P1.08 pin and I2C pull-ups are also connected to this IO pin. Add a fixed regulator, which will be always on for this board, in order be able able to use this IMU out of the box. Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
The Seeed XIAO BLE is a tiny (21 mm x 17.5 mm) Nordic Semiconductor
nRF52840 ARM Cortex-M4F development board with onboard LEDs, USB port,
QSPI flash, battery charger, and range of I/O broken out into 14 pins.