Skip to content

Conversation

@geonnave
Copy link
Contributor

@geonnave geonnave commented Jan 13, 2026

The idea is to introduce a set of self-contained changes to firmware and python, that enable DotBots and gateways to be easily provisioned at deployment time.


initial comment about writing to config memory With this change we will be able to change the network id after flashing the hex, simplifying deployment.

The network id can be changed as follows:

nrfjprog -f NRF53 --coprocessor CP_NETWORK --erasepage 0x0103F000 # erase page
nrfjprog -f NRF53 --coprocessor CP_NETWORK --memwr 0x0103F000 --val 0x5753524D # magic value "SWRM"
nrfjprog -f NRF53 --coprocessor CP_NETWORK --memwr 0x0103F004 --val 0x00000100 # net_id = 0x0100

@codecov-commenter
Copy link

codecov-commenter commented Jan 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (0d7f248) to head (cc8ffe7).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #116   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           18        18           
  Lines         2102      2102           
=========================================
  Hits          2102      2102           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aabadie
Copy link
Contributor

aabadie commented Jan 14, 2026

is there a way to write to flash using nrfutil ? nrfjprog is deprecated and should not be used.

@geonnave
Copy link
Contributor Author

is there a way to write to flash using nrfutil ? nrfjprog is deprecated and should not be used.

Yes there is. I am preparing a script for that. I will use nrfutil to flash.

On the other hand, I found that we can read the device id with nrfjprog -f NRF53 --coprocessor CP_NETWORK --memrd 0x01FF0204 --n 8, and that is not possible with nrfutil.

So I will make a script that requires nrfutil, and, in case nrfjprog is available, also dumps the device id (that way we don't need a custom firmware speaking uart in the robot).

@geonnave geonnave force-pushed the config-net-id-via-flash branch from 9f12405 to 6c8de12 Compare January 15, 2026 08:23
@geonnave geonnave changed the title Allow configuring Network ID by writing to flash Add scripts for provisioning DotBots Jan 15, 2026
@geonnave
Copy link
Contributor Author

geonnave commented Jan 15, 2026

How to test this change

Just follow the README: https://github.com/geonnave/swarmit/blob/a55d5b387edc4bff38f92bb6831b17884cc71724/swarmit/provision/README.md

During the first step (fetch), use the test release I created, called test-provision. So the fetch command is:

swarmit-provision fetch --fw-version test-provision

@geonnave
Copy link
Contributor Author

For the moment I am using nrfjprog, since there was already a base script created by Martina that uses nrfjprog, so it was just faster to integrate it that way. We should be able to easily replace it with the more modern nrfutils, perhaps in a future PR.

@geonnave geonnave force-pushed the config-net-id-via-flash branch 7 times, most recently from ddca253 to 6e4538f Compare January 15, 2026 19:17
@aabadie
Copy link
Contributor

aabadie commented Jan 16, 2026

Nice and useful addition. I know it's annoying and time is missing but it took me quite some effort to cover all Python code with tests. Would you mind adding tests for the new provision modules?

@geonnave
Copy link
Contributor Author

I see, however timing is unfortunate to add tests right now.

@geonnave geonnave force-pushed the config-net-id-via-flash branch from 6e4538f to cc8ffe7 Compare January 16, 2026 13:42
@geonnave
Copy link
Contributor Author

Ok, removed all python changes, and kept only the C change for the config struct.

The python provisioning script now lives at https://github.com/DotBots/dotbot-provision

@geonnave geonnave changed the title Add scripts for provisioning DotBots Add config struct to Flash Jan 16, 2026
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