Skip to content

Add Muzi Base (Duo + Uno + SuperIO) support - #1

Open
tjdownes wants to merge 57 commits into
devfrom
muzi-base
Open

Add Muzi Base (Duo + Uno + SuperIO) support#1
tjdownes wants to merge 57 commits into
devfrom
muzi-base

Conversation

@tjdownes

@tjdownes tjdownes commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Summary

Adds the MuziWorks Base board to MeshCore as a single shared nRF52840 variant, with the radio selected per build environment:

  • Base Duo LR1121 (USE_LR1121)
  • Base Uno SX1262 (USE_SX1262)

Both are the same PCB; only the radio module and the DIO1 IRQ pin differ (LR1121 = P1.08, SX1262 = P1.06). All board logic is shared under variants/muzi_base/.

Also supports the optional SuperIO add-on: SH1107 128×128 OLED, GPS, buzzer, and joystick.

What's included

  • variants/muzi_base/* shared board / target / variant + all PlatformIO environments
  • boards/muzi_base.json board definition
  • src/helpers/radiolib/CustomLR1121{,Wrapper}.h LR1121 radio driver + wrapper
  • src/helpers/ui/SH1107Display.{h,cpp} SH1107 OLED display driver

Build environments

For each radio flavor (muzi_base_duo_* / muzi_base_uno_*):
repeater, room_server, companion_radio_usb, companion_radio_ble, and companion_radio_ble_superIO.

Provenance

Consolidates meshcore-dev PR meshcore-dev#2054 (Base Duo, @lbibass) with @andyshinn's shared-base + Uno refactor, rebased onto the latest dev. Original authorship preserved via Co-authored-by trailers.

Verification

  • All 10 environments build and link against the current dev head.
  • A hostile multi-agent code review was performed on the added files (every external RadioLib / Adafruit SH110X / nRF52-core API usage verified against pinned upstream source). No critical issues; a small set of low/medium cleanups and a few hardware-schematic confirmations (ADC divider ratio, TCXO presence, I2C address strap) are noted for follow-up.

Note: IMU and the SuperIO toggle switch are not yet wired (matching the original PR's scope).

NickDunklee and others added 30 commits June 23, 2026 11:39
While working on some sensor code implementations, I ran into
some hard crashes that root-caused to the 4KB loop task stack
being exhausted.

Looking for various optimization schemes resulted in this relatively
low-lift fix. RAK3401 and RAK4631 both support hardware crypto.

Rather than loading in one of the two software crypto libs,
we can just use the onboard hardware. This is faster, should
consume less power, and in testing used a scant up to 700
bytes in the run loop vs 2.5-3KB per advert.

This change **only** affects advert verification processing, which
currently consumes a significant chunk of the 4KB run loop.

I figured such a change should likely be implemented in phases.

After soaking, this hardware crypto verification
process could be implemented across the entire MeshCore
cryptographic function on RAK nodes. Also possible other nodes
have available hardware crypto, however, I have not checked,
so future improvements may also exist there.

Tested on:
  - RAK3401 RAK 1W
  - RAK4631 19001
Tested Heltec t096 and Seeed t1000-e, both support this
hardware feature.
After soaking for a bit on the adverts without issue on multiple nodes,
I added more hardware crypto.

Supported nodes is unchanged in this PR addition, but if others can verify,
they can easily be added.

Some info on the CC310: https://docs.nordicsemi.com/r/bundle/ps_nrf9151/page/cryptocell.html

**Added:**

- AES-128 packet encryption/decryption now use hardware crypto
- HMAC-SHA-256 authentication now uses hardware crypto
- ACK hash computation and channel ID derivation now use hardware crypto
- RNG (random number generator) now uses hardware crypto rather than
  radio noise + weak software RNG (which can have issues if there's
  no surrounding radio noise.) NIST SP 800-90B certified.
  - Runs hardware self-tests on startup
  - Runs continuous health tests during operation
  - Uses thermal noise/shot noise for randomness

**Unchanged:**

- calcSharedSecret remains software - it would be a split hw/sw solution
  and added complexity for likely not a lot of gains. This only happens
  when establishing a new contact, so not too frequent to be worth it.
- ed25519_create_keypair remains software. This is only called when a
  node is first initialized. It does use the hardware RNG change, however,
  so better randomization.

Tested on (so far):

- Heltec t096

Build test on:
- Heltec t096 companion ble
- t1000e companion ble
- RAK 4631 repeater
- RAK 3401 companion BLE
- Heltec v3 companion wifi
for hardware encryption. Now `USE_CC310_HW_CRYPTO`
* new prefs file now "/prefs.json"
* color displays now with a new light theme
Select nodes had this flag enabled, testing by the community
and hardware specs indicate this can be enabled global for all
node types using this chipset.

Any nodes down the line that may be quirky can be individually
disabled with `-U USE_CC310_HW_CRYPTO`.
# Conflicts:
#	test/mocks/Arduino.h
#	test/mocks/Stream.h
mkdocs will only consider the first H1 (if any) and subheaders under it for the table of contents

this increases the header levels of everything below "important concepts" by 1 so that the table of contents correctly resolves them
…DocsFormatting

Increase header levels on "Payloads" documentation page to fix table of contents
liamcottle and others added 27 commits July 28, 2026 03:18
If Bluefruit.begin fails, BLE OTA mode won't actually start and the board might require a reboot to reattempt.

Fixes:
- Bluefruit.begin returns false in NRF52Board.startOTAUpdate if OTA mode fails to start. User is notified of the fault through existing error message in CommonCLI and can reattempt "start ota" command.
…e-recovery

nRF52840 "start ota" Failure Recovery
Refactor Companion Interfaces + Add ThinkNode M7 Ethernet Support
Unify IRQ timeout logic across all applicable radio types
Clean up debugs left on in platform.ini files
…advert-names

Preserve UTF-8 boundaries in advert names
…system-posts

room_server: add room.post command for server-originated posts
CustomLR1110::startReceive() passed RADIOLIB_LR11X0_IRQ_PREAMBLE_DETECTED
(1<<4 = 16) as RadioLib's first argument, which is the RX *timeout*, not an
IRQ mask. At the LR11x0's 30.52us tick that armed the receiver for ~488us, so
it dropped out of RX before any packet could arrive and the node received
nothing at all -- while transmitting normally.

Symptoms on a SenseCAP T1000-E: tx_air_secs rising, rx_air_secs stuck at 0,
recv_errors 0, and the noise floor pinned at the -120 clamp because
getCurrentRSSI() never sampled a live receiver.

Pass RADIOLIB_LR11X0_RX_TIMEOUT_INF (continuous RX), which is what
LR11x0::startReceive() itself uses, keeping the PREAMBLE_DETECTED flag in the
reported IRQ flags as intended.

Introduced in ea5d7c8 ("LR1110: add PREAMBLE_DETECTED to reported irq flags").
Verified on two T1000-E units: with only the repeater fixed it began receiving
(last_rssi -29, SNR 17.0) while the unfixed companion stayed deaf; fixing both
brought up the link in each direction.
Board manifest for esp32-c6-devkitm-1 defaults build.flash_mode to qio,
which this module's flash chip does not support -- causes a boot
crash-loop (repeated USB-Serial-JTAG reconnects) on real hardware.
Override with board_build.flash_mode = dio in the common M5Stack_Unit_C6L
section so it applies to all envs (ble/usb/repeater/room_server).
…ncryption

feat: use nrf52 hardware crypto where we can
…mode-dio

fix: M5Stack Unit C6L boot failure caused by flash_mode=qio
Removed unnecessary comments regarding RX timeout and IRQ mask.
LR1110: fix startReceive() passing an IRQ bit as the RX timeout 🤖🤖
One nRF52840 variant shared across both radios, picked per env: Duo runs
the LR1121, Uno the SX1262. Same PCB, only the radio and its DIO1 pin
change.

SuperIO adds the SH1107 OLED, GPS, buzzer and joystick. GPS is driven by
the 3-position mode switch (Mode 2 = on), polled live the way thinknode_m1
does it.

Consolidates meshcore-dev#2054 and andyshinn's shared-base/uno work, rebased on dev.

Co-authored-by: lbibass <ewdries02@gmail.com>
Co-authored-by: Andy Shinn <andys@andyshinn.as>
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.

9 participants