Skip to content

Conversation

@NomDeTom
Copy link
Contributor

@NomDeTom NomDeTom commented Dec 5, 2025

This PR is a tidying up and extending of the defaults for the Xiao NRF, to allow each of the variations in use to coexist harmoniously whilst also sharing a single variant.h. Pins are assigned as follows:

Pin Default I2C BTB BLE-L Pin Default I2C BTB BLE-L
D0 UBTN DIO1 CS 5v
D1 DIO1 DIO1 Busy DIO1 GND
D2 NRST NRST NRST Busy 3v3
D3 Busy Busy CS NRST D10 MOSI MOSI MOSI MOSI
D4 CS CS RXEN SDA D9 MISO MISO MISO MISO
D5 RXEN RXEN   SCL D8 SCK SCK SCK SCK
D6 G_TX SDA G_TX D7 G_RX SCL G_RX RXEN
End
NFC1/ SDA G_TX SDA G_TX NFC2/ SCL G_RX SCL G_RX
D30 D31
Internal
D16 SCL1 SCL1 SCL1 SCL1
D17 SDA1 SDA1 SDA1 SDA1

Basically, Default and I2C variants just swap whether GPS or I2C gets to sit on "real" pins, vs the NFC pads at the back.

The Board-to-board connector version of the WIO radio board is assumed to follow the default pinout apart from that, and BLE legacy just shoves them on the back, because it can.

I've tested it on a sample of 1, and it works on that.

🤝 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)

@NomDeTom NomDeTom marked this pull request as ready for review December 6, 2025 00:38
@NomDeTom
Copy link
Contributor Author

NomDeTom commented Dec 6, 2025

@DaneEvans @porkcube @ndoo
Could I ask you to test this with your respective hardware and see if it works, please?

Many thanks!

@fifieldt fifieldt added the enhancement New feature or request label Dec 6, 2025
@porkcube
Copy link
Contributor

porkcube commented Dec 6, 2025

  • seeed-xiao-nrf52840-wio-sx1262 : ✅

I do have a bunch of Ikoka variants built so could test those as well:

  • seeed_xiao_nrf52840_e22_900m30s : ✅
  • seeed_xiao_nrf52840_e22_900m33s : ✅
  • seeed_xiao_nrf52840_kit_i2c : ✅

seeed_xiao_nrf52840_e22_900m33s is still busted and not putting out even remotely close to 1dBm let alone 33, but that's a whole other problem predating/unrelated to these changes

@DaneEvans
Copy link
Contributor

Generated on c6bd578

tried to flash a nonsense - same symptoms as I used to get on the sense', at least that's what I recall the symptoms were.

DEBUG | ??:??:?? 0 Filesystem files:
DEBUG | ??:??:?? 0  prefs (directory)
DEBUG | ??:??:?? 0    channels.proto (158 Bytes)
DEBUG | ??:??:?? 0    config.proto (316 Bytes)
DEBUG | ??:??:?? 0    device.proto (330 Bytes)
DEBUG | ??:??:?? 0    module.proto (108 Bytes)
DEBUG | ??:??:?? 0    nodes.proto (2234 Bytes)
DEBUG | ??:??:?? 0  adafruit (directory)
DEBUG | ??:??:?? 0  bond_prph (directory)
DEBUG | ??:??:?? 0  bond_cntr (directory)
DEBUG | ??:??:?? 0 Power::lipoInit lipo sensor is not ready yet
DEBUG | ??:??:?? 0 Use analog input 32 for battery level
INFO  | ??:??:?? 0 Scan for i2c devices
DEBUG | ??:??:?? 0 Scan for I2C devices on port 2
DEBUG | ??:??:?? 0 Scan for I2C devices on por

Yes - the last word is cut off.

@DaneEvans
Copy link
Contributor

DaneEvans commented Dec 6, 2025

the nonsense may have just worked on a reflash. but now it's browning out.
I'll do a better check in the morning on a few more boards

And the sense is giving:

DEBUG | ??:??:?? 2 Use compiled/slipstreamed tzplaceholder
DEBUG | ??:??:?? 2 Saved TZ: AEST-10AEDT,M10.1.0,M4.1.0/3
DEBUG | ??:??:?? 2 Set Timezone to AEST-10AEDT,M10.1.0,M4.1.0/3
DEBUG | ??:??:?? 2 Rescan for I2C keyboard
DEBUG | ??:??:?? 2 Scan for I2C devices on port 1
DEBUG | ??:??:?? 2 Scan address 0x1f
DEBUG | ??:??:?? 2 Scan address 0x34
DEBUG | ??:??:?? 2 Scan address 0x55
DEBUG | ??:??:?? 2 Scan address 0x5a
DEBUG | ??:??:?? 2 Scan address 0x5f
ERROR | ??:??:?? 2 Could not open / read /prefs/cannedConf.proto
INFO  | ??:??:?? 2 CannedMessageModule is enabled
INFO  | ??:??:?? 2 External Notification Module Disabled
DEBUG | ??:??:?? 2 SX126xInterface(cs=3, irq=0, rst=2, busy=1)
DEBUG | ??:??:?? 2 SX126X_DIO3_TCXO_VOLTAGE defined, using DIO3 as TCXO reference voltage at 1.800000 V
INFO  | ??:??:?? 2 Start meshradio init
INFO  | ??:??:?? 2 Radio freq=919.875, config.lora.frequency_offset=0.000
INFO  | ??:??:?? 2 Set radio: region=ANZ, name=CRS_infra, config=6, ch=19, power=30
INFO  | ??:??:?? 2 myRegion->freqStart -> myRegion->freqEnd: 915.000000 -> 928.000000 (13.000000 MHz)
INFO  | ??:??:?? 2 numChannels: 52 x 250.000kHz
INFO  | ??:??:?? 2 channel_num: 20
INFO  | ??:??:?? 2 frequency: 919.875000
INFO  | ??:??:?? 2 Slot time: 8 msec, preamble time: 8 msec
INFO  | ??:??:?? 2 Final Tx power: 22 dBm
INFO  | ??:??:?? 4 SX126x init result -2

WARN  | ??:??:?? 4 No SX1262 radio
ERROR | ??:??:?? 4 NOTE! Record critical error 3 at src/main.cpp:1476
INFO  | ??:??:?? 4 PowerFSM init, USB power=1

Rolling back to my known versions worked without issue, although the low voltage warning was still present

@NomDeTom
Copy link
Contributor Author

NomDeTom commented Dec 6, 2025

Rolling back to my known versions worked without issue, although the low voltage warning was still present

Might be worth trying again now I've fixed the default setup pins, although there might need to be a further tweak. If you drop me a reference to your branch, I'll take another look.

@DaneEvans
Copy link
Contributor

That was after that commit.
And the one before that is busted. Does commit 2 work? Was that what the others tested on?

@DaneEvans
Copy link
Contributor

DaneEvans commented Dec 7, 2025

The .bin and .uf2 also aren't getting produced by this branch in it's current state, just the .elf

Just made fw off 2.7.16 successfully on my updated branches:
https://github.com/DaneEvans/Flamingo-Firmware/releases/tag/flamingo_2.7.16
Using this target for both the sense and nonsense

[env:seeed_xiao_nrf52840_sense-flamingo] ; also works on regular seeed xiao
extends = env:seeed_xiao_nrf52840_kit

build_flags =
  ${env:seeed_xiao_nrf52840_kit.build_flags}
  -D FLAMINGO
build_unflags = -DGPS_L76K


lib_deps =
  ${env:seeed_xiao_nrf52840_kit.lib_deps}

and successfully used the same target on commit 61e41a8 (divergence between this branch and develop), so it's definitely this branch that broke things.

But using it on this branch gives the same crash on reading I2C on both board varieties

If I had to guess, the others didn't reboot vsc, and ran on cached targets, so it worked for them. Otherwise I can't explain the discrepancy

@NomDeTom NomDeTom marked this pull request as draft December 7, 2025 12:28
@NomDeTom
Copy link
Contributor Author

NomDeTom commented Dec 7, 2025

Moving to draft, as I can't be sure it's building successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants