Skip to content

Thingy91x Gateway Fixes - #306

Open
szczys wants to merge 6 commits into
mainfrom
szczys/thingy91x-gateway-fixes
Open

Thingy91x Gateway Fixes#306
szczys wants to merge 6 commits into
mainfrom
szczys/thingy91x-gateway-fixes

Conversation

@szczys

@szczys szczys commented Jul 23, 2026

Copy link
Copy Markdown
Contributor
  • Update gateway_custom_connect partitions to match changes already made in gateway so code is generated without a bootloader offset
  • Make sure UART0 is disabled on ncs-serial-modem as it inteferes with inter-chip comms.
  • Handle memory use in the same way as the nrf9160dk so we have enough room for heap
  • Add auto-pairing by default as is done wiht nrf9160dk
  • Document how to provision certificates by flashing an lfs binary

Known Issues:

The chips can now communicate with one another and we are able to get a network connection and start the sync with bluetooth devices. However, after every pouch operation, the BLE connection drops with reason 0x08
~5-8 seconds later, regardless of the 7-second supervision timeout.

This issue is beyond the scope of the current PR and is tracked here: https://github.com/golioth/firmware-issue-tracker/issues/1056

@szczys
szczys force-pushed the szczys/thingy91x-gateway-fixes branch from 4e2898f to e8ae187 Compare July 24, 2026 21:55
@szczys
szczys marked this pull request as ready for review July 24, 2026 22:02

@trond-snekvik trond-snekvik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really for this PR, but it'd be real neat if we made this a west command - something like west provision <crt> <privatekey>. I know the west runner mechanism should allow us to interact with whatever flash command the hardware needs, but I have never tried it.

Could be something we could throw to an LLM and see if it manages to get it right

Install the `littlefs_tools` Python package:

```bash
pip install littlefs_tools

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could potentially go into requirements.txt or a new examples/requirements.txt

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, I added this to requirements.txt and regenerated requirements-ci-zephyr.txt.

bool
default y if BOARD_NRF52_BSIM_NATIVE
default y if BOARD_NRF9160DK_NRF52840
default y if BOARD_THINGY91X_NRF5340_CPUAPP_NS

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure we need that for Thingy91:X. Did you try to use the button for pairing? I think it worked before. nrf9160dk has no button dedicated to nrf52840 core, so default y if BOARD_NRF9160DK_NRF52840 was just a workaround for that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 13 comments on this symbol and says:

# This option is used only for automated tests
config SAMPLE_POUCH_GATEWAY_BT_AUTO_BOND
	bool
	default y if BOARD_NRF52_BSIM_NATIVE
	default y if BOARD_NRF9160DK_NRF52840
	default y if BOARD_THINGY91X_NRF5340_CPUAPP_NS

So I added this to ensure we can run automated testing without pushing the button to pair.

the thingy91x does not use mcuboot so the partition table must be adjusted
to place slot0 at 0x0. This matches the same change made in
examples/zephyr/gateway.

Signed-off-by: Mike Szczys <michael.szczys@canonical.com>
The UART0 tx/rx pins are being used for flow control (cts/rts) with the
nrf53. Reroute shell to RTT and disable UART0 to resolve interference with
inter-chip comms.

Signed-off-by: Mike Szczys <michael.szczys@canonical.com>
- limit BT max connections to 8 to ensure there is enough RAM for the heap
- move cmux workqueue stack from 1024 to 2048 to avoid flow control issues

This maps changes already made to the nrf9160dk gateway

Signed-off-by: Mike Szczys <michael.szczys@canonical.com>
By default, enable auto-pair and auto-connect on the Thingy91x in the same
way we do for the nrf9160dk.

Signed-off-by: Mike Szczys <michael.szczys@canonical.com>
This tool is used to provision the Thingy91:X gateway by creating a lfs
partition that can be flashed onto the device instead of using the mcumgr
transport.

The requirements-ci-zephyr.txt file was regenerated to incorporate this
change.

Signed-off-by: Mike Szczys <michael.szczys@canonical.com>
the Thingy91x uses RTT instead of USB for console communication and the
mcumgr-based provisioning used by other boards is not available in this
setup. This commit documents how to generate a LittleFS (lfs) binary that
contains the PKI credentials that may be flash directly to the storage
partition.

Signed-off-by: Mike Szczys <michael.szczys@canonical.com>
@szczys
szczys force-pushed the szczys/thingy91x-gateway-fixes branch from e8ae187 to fd93c5e Compare September 4, 2026 15:15
@szczys
szczys requested review from mniestroj and removed request for hasheddan September 4, 2026 15:15
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.

3 participants