Skip to content

Seeed Studio XIAO nrf52-based boards modularization #6788

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
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ndoo
Copy link
Contributor

@ndoo ndoo commented May 11, 2025

  • env:seeed_xiao_nrf52840_kit
    • Define user button (PIN_BUTTON1) -> GPIO D0 (physical button on the Wio-SX1262 for XIAO is wired to GPIO D0)
    • As a compromise, remove L76K GNSS module feature (pin conflict with PIN_BUTTON1)
  • env:seeed_xiao_nrf52840_wio-sx1262_v1_1 (DIY)
    • board_level = extra
    • XIAO ESP32S3 & Wio-SX1262 Kit ships with this PCB (i.e. you DIY and swapped that Wio-SX1262 to a XIAO-nRF52480)
    • Define user button (PIN_BUTTON1) -> GPIO D4 (physical button on the Wio-SX1262 for XIAO PCB v1.1
    • I2C defined for feature parity with removed diy/seeed-xiao-nrf52840-wio-sx1262 variant
  • env:seeed_xiao_nrf52840_kit_l76k (DIY)
    • board_level = extra
    • XIAO L76K GNSS module support
    • As a compromise, remove user button feature (pin conflict with PIN_GPS_STANDBY)
  • env:seeed_xiao_nrf52840_kit_i2c (DIY)
    • board_level = extra
    • Define D6 -> SDA, D7 -> SCL
  • env:seeed_xiao_nrf52840_kit_oled (DIY)
    • board_level = extra
    • Define D6 -> SDA, D7 -> SCL and USE_SSD1306
  • env:seeed-xiao-nrf52840-wio-sx1262 (DIY)
    • Removed as it is superseded by env:seeed_xiao_nrf52840_wio-sx1262_v1_1

🤝 Attestations

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • Heltec (Lora32) V3
    • LilyGo T-Deck
    • LilyGo T-Beam
    • RAK WisBlock 4631
    • Seeed Studio T-1000E tracker card
    • Other (please specify below)
      • env:seeed_xiao_nrf52840_kit
      • env:seeed_xiao_nrf52840_kit_i2c
      • env:seeed_xiao_nrf52840_kit_oled

@ndoo ndoo force-pushed the xiao-nrf52-cleanup branch 2 times, most recently from 7f855f3 to 1814dff Compare May 11, 2025 06:25
@fifieldt
Copy link
Member

Thanks for putting so much thought into this

@ndoo ndoo force-pushed the xiao-nrf52-cleanup branch from 537ce09 to 6a490d9 Compare May 11, 2025 09:29
@ndoo
Copy link
Contributor Author

ndoo commented May 11, 2025

Based on suggestions on Discord#nrf52, moved the DIY (board_level = extra) boards into DIY and inherited the environments from the non-DIY XIAO.

It may be a bit more confusing since all the pin logic is in the variant.h of another folder, but I added a comment to variants/diy/platformio.ini that directs devs to that variant.h.

Either approach of (a) having all the extra build envs in the official variant or (b) having all the extra build envs in DIY is fine by me, up to the maintainers to decide which is preferable.

@ndoo
Copy link
Contributor Author

ndoo commented May 11, 2025

Hm, an unintended consequence of deriving everything from the officially supported board is that they will show up with the supported hardware model over the mesh instead of unsupported hardware. Is that okay?

If not, I will add -DPRIVATE_HW to the DIY environments.

@ndoo ndoo changed the title Seeed Studio XIAO nrf52-based boards cleanup Seeed Studio XIAO nrf52-based boards modularization May 11, 2025
@porkcube
Copy link
Contributor

seeed-xiao-nrf52840-wio-sx1262 (DIY) isn't just a user button difference, the original ESP32 Kit Wio (PCB v1.1) and nRF52840 Kit Wio (PCB v1.0) have a few more pins that are jumbled. Checked our your branch and confirmed that env:seeed_xiao_nrf52840_kit and seeed_xiao_nrf52840_kit_i2c build cleanly but don't actually work as result in NOTE! Record critical error 3 at src/main.cpp:1281

Pin DIY New
CS D3 D4
DIO1 D0 D1
BUSY D1 D3

@ndoo
Copy link
Contributor Author

ndoo commented May 11, 2025

seeed-xiao-nrf52840-wio-sx1262 (DIY) isn't just a user button difference, the original ESP32 Kit Wio (PCB v1.1) and nRF52840 Kit Wio (PCB v1.0) have a few more pins that are jumbled. Checked our your branch and confirmed that env:seeed_xiao_nrf52840_kit and seeed_xiao_nrf52840_kit_i2c build cleanly but don't actually work as result in NOTE! Record critical error 3 at src/main.cpp:1281

Pin DIY New
CS D3 D4
DIO1 D0 D1
BUSY D1 D3

I shall add a variant in to cover the old PCB use case, but what's a good name for the env section?

@porkcube
Copy link
Contributor

That is a very good question! Perhaps something that explicates it's DIY or the PCB rev ala seeed-xiao-nrf52840-wio-sx1262_DIY or seeed-xiao-nrf52840-wio-sx1262_v1.0 / seeed-xiao-nrf52840-wio-sx1262_v1.1 ?

@ndoo
Copy link
Contributor Author

ndoo commented May 11, 2025

That is a very good question! Perhaps something that explicates it's DIY or the PCB rev ala seeed-xiao-nrf52840-wio-sx1262_DIY or seeed-xiao-nrf52840-wio-sx1262_v1.0 / seeed-xiao-nrf52840-wio-sx1262_v1.1 ?

Good idea. I won't touch the original env name for the nrf kit, but the seeed-xiao-nrf52840-wio-sx1262_v1.1 name sounds good.

seeed-xiao-nrf52840-wio-sx1262 (DIY) isn't just a user button difference, the original ESP32 Kit Wio (PCB v1.1) and nRF52840 Kit Wio (PCB v1.0) have a few more pins that are jumbled. Checked our your branch and confirmed that env:seeed_xiao_nrf52840_kit and seeed_xiao_nrf52840_kit_i2c build cleanly but don't actually work as result in NOTE! Record critical error 3 at src/main.cpp:1281

Pin DIY New
CS D3 D4
DIO1 D0 D1
BUSY D1 D3

Oh yes, I noticed the diy/seeed-xiao-nrf52840-wio-sx1262 variant had this defined:
#define SX126X_RXEN 38

Is that actually valid?

@porkcube
Copy link
Contributor

porkcube commented May 11, 2025

That is a very good question! Perhaps something that explicates it's DIY or the PCB rev ala seeed-xiao-nrf52840-wio-sx1262_DIY or seeed-xiao-nrf52840-wio-sx1262_v1.0 / seeed-xiao-nrf52840-wio-sx1262_v1.1 ?

Good idea. I won't touch the original env name for the nrf kit, but the seeed-xiao-nrf52840-wio-sx1262_v1.1 name sounds good.

v1.0 is the nRF Kit version so should work with the "official" Kit firmware, it's just the v1.1 PCB from the ESP32 Kit + your own Xiao nRF52840 that the DIY firmware was built for (because I couldn't wait for Seeed's official kit)

seeed-xiao-nrf52840-wio-sx1262 (DIY) isn't just a user button difference, the original ESP32 Kit Wio (PCB v1.1) and nRF52840 Kit Wio (PCB v1.0) have a few more pins that are jumbled. Checked our your branch and confirmed that env:seeed_xiao_nrf52840_kit and seeed_xiao_nrf52840_kit_i2c build cleanly but don't actually work as result in NOTE! Record critical error 3 at src/main.cpp:1281
Pin DIY New
CS D3 D4
DIO1 D0 D1
BUSY D1 D3

Oh yes, I noticed the diy/seeed-xiao-nrf52840-wio-sx1262 variant had this defined: #define SX126X_RXEN 38

Is that actually valid?

38 should be valid... it just seems to not also be in the variant.cpp to have a D# labelling

@ndoo
Copy link
Contributor Author

ndoo commented May 11, 2025

@porkcube please test this commit -> env:seeed_xiao_nrf52840_wio-sx1262_v1_1

I believe it should be feature/pinout parity with the removed variant.

@ndoo
Copy link
Contributor Author

ndoo commented May 11, 2025

Summary updated to reflect the changes since.

@porkcube
Copy link
Contributor

@ndoo Confirming seeed_xiao_nrf52840_wio-sx1262_v1_1 works as expected (node boots up fine, and user button detected).

Thank you so much for cleaning up the variant mess and for the Ikokas!

@ndoo
Copy link
Contributor Author

ndoo commented May 11, 2025 via email

@garthvh
Copy link
Member

garthvh commented May 11, 2025

Hm, an unintended consequence of deriving everything from the officially supported board is that they will show up with the supported hardware model over the mesh instead of unsupported hardware. Is that okay?

If not, I will add -DPRIVATE_HW to the DIY environments.

The diy variants need to be properly labeled as diy

@ndoo ndoo force-pushed the xiao-nrf52-cleanup branch from 269ade1 to e038461 Compare May 12, 2025 02:35
@ndoo
Copy link
Contributor Author

ndoo commented May 12, 2025

Hm, an unintended consequence of deriving everything from the officially supported board is that they will show up with the supported hardware model over the mesh instead of unsupported hardware. Is that okay?
If not, I will add -DPRIVATE_HW to the DIY environments.

The diy variants need to be properly labeled as diy

Rebased on master and done as requested, build tested.

@ndoo ndoo force-pushed the xiao-nrf52-cleanup branch from e038461 to 4ef1674 Compare May 12, 2025 02:54
@ndoo
Copy link
Contributor Author

ndoo commented May 12, 2025

Squashed commits for readability

@ndoo ndoo force-pushed the xiao-nrf52-cleanup branch 7 times, most recently from be708b2 to 6b964a7 Compare May 15, 2025 14:01
@fifieldt fifieldt force-pushed the xiao-nrf52-cleanup branch from 6b964a7 to 28ff399 Compare May 16, 2025 02:34
@ndoo ndoo force-pushed the xiao-nrf52-cleanup branch 3 times, most recently from 71ea37f to 96d0036 Compare May 19, 2025 15:38
@ndoo ndoo force-pushed the xiao-nrf52-cleanup branch from 96d0036 to 1af5ac1 Compare May 20, 2025 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants