Skip to content

Conversation

GabrielNotman
Copy link
Contributor

Overview

This PR makes two changes which I believe would be helpful to others as they cover issues and questions I ran into when testing out the SoftSIM library (at v5.1.0 with SDK v2.9.1).

Additions

  1. Add nonsecure_storage/nvs_storage to the static partition list.
    When using the SoftSIM library with custom boards, this can help make it explicitly clear what additional partitions are required.

  2. Add a sample which demonstrates how to preserve existing profile data when re-flashing a device.
    This might help in situations where during production first a test / provisioning firmware image is loaded which is later replaced by an application image. (I had a similar question as the one raised in Provisioning SoftSIM (and staying provisioned) in production #92.)

Issues

Instructions for the new sample have been included in README.md in the sample folder. This is inconsistent with the existing samples which lack a README.md.

The new sample will fault if the device is not already provisioned (a warning about this has been added to the instructions). I tried disabling CONFIG_SOFTSIM_AUTO_INIT and then checking the provisioning using nrf_softsim_check_provisioned(). This worked however, if already provisioned there seems to be some issue with calling nrf_softsim_init() explicitly from main, this was resulting in a fault.

@GabrielNotman GabrielNotman force-pushed the preprovisioned_sample branch from f91fd9c to c7bd045 Compare July 17, 2025 11:59
@JoriamVS
Copy link

Hello @GabrielNotman,

I am the one that created issue #93. I just looked at your sample and would like to thank you for your insights.
What I discovered myself is that if you flash the dfu_application.zip after the original merged.hex was flashed the SIM profile also stays intact. At least this works for me using the thingy91:x. Might be slightly faster than changing the build configuration as you do in your sample, your sample did help me understand why my discovery works and I think the repository would benefit from having your sample added.

Now for a more detailed overview of my discovery

dfu_application.zip:

  • Directly to thingy
  • Does not overwrite (or contain) SIM profile. (In my experience so far, could be a coincidence)
  • Use this if you want SIM profile untouched
  • nrfutil device program --firmware dfu_application.zip --serial-number $serial_number --traits mcuboot --x-family nrf91 --core Application

merged.hex:

  • Via nrf9151dk
  • Does (over)write SIM profile.
  • Use this if you want to change SIM profile.
  • nrfutil device program --firmware merged.hex --traits jlink

I hope this helps you or another person that stumbles upon this. Also if someone from Onomondo sees this I would love it if they could confirm/correct my theory.

@GabrielNotman GabrielNotman changed the title Preprovisioned Sample feat: preprovisioned Sample Jul 22, 2025
@GabrielNotman GabrielNotman changed the title feat: preprovisioned Sample feat: Preprovisioned Sample Jul 22, 2025
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.

2 participants