SoftSIM Profile Loss After Partial Flash Erase on nRF9160

Dear Nordic Semiconductor Support Team,

I’m encountering two related issues when updating my nRF9160 application firmware that cause the Onomondo SoftSIM profile to be erased. Both issues use the same partition layout and J-Link Commander commands, and I need guidance on how to preserve the SoftSIM data in NVS during firmware upgrades.


Background

  • Target: nRF9160_SICA running Zephyr OS
  • SoftSIM provider: Onomondo
  • Two firmware variants:
    1. Test firmware – validates peripherals, provisions SoftSIM, and works flawlessly
    2. Main firmware – intended only to update application code

Partition table is identical in both firmware builds.


Problem 1: SoftSIM Profile Disappears After “erase app section”

  1. Provision SoftSIM profile successfully under test firmware.
  2. Switch to main firmware and execute J-Link Commander script:
    device NRF9160_XXAA
    if SWD
    speed 4000
    erase 0x00010000,0x00050000
  3. After flashing, nrf_softsim_check_provisioned() returns “not present.”
  4. It appears J-Link’s partial erase also clears the SoftSIM’s NVS area.

Request: How can I restrict the J-Link erase to the application region (0x10000–0x50000) without touching NVS partitions? Are there alternate commands or options to preserve NVS data?

pm_static.yml

tfm_its:
address: 0xf8000
size: 0x2000
tfm_otp_nv_counters:
address: 0xfa000
size: 0x2000
EMPTY_tfm_ps:
address: 0xfc000
size: 0x4000
tfm_storage:
address: 0xf8000
span:
- EMPTY_tfm_ps
- tfm_its
- tfm_otp_nv_counters
size: 0x8000

Problem 2: Custom NVS Partition for SoftSIM Also Gets Cleared

To isolate the issue, I created dedicated NVS partitions under nonsecure_storage for both Onomondo SoftSIM and my own data. My custom entries survive a firmware update, but the SoftSIM profile is still lost.

Custom partition excerpt:

nonsecure_storage:
  address: 0x000ee000
  size:    0x0c000
  span:
    - settings_storage
    - nvs_storage      # SoftSIM uses this
    - my_nvs           # persists correctly
  
nvs_storage:
  address: 0x000ee000
  size:    0x08000

my_nvs:
  address: 0x000f6000
  size:    0x02000

Observation: After replaying the same J-Link erase and flash, my_nvs data remains intact but nvs_storage (SoftSIM) is wiped.

pm_static.yml

tfm_secure:
address: 0x00000000
end_address: 0x00018000
region: flash_primary
size: 0x18000
span:
- tfm

tfm:
address: 0x00000000
end_address: 0x00018000
region: flash_primary
size: 0x18000

tfm_nonsecure:
address: 0x00018000
end_address: 0x000f0000
region: flash_primary
size: 0xd8000
span:
- app

app:
address: 0x00018000
end_address: 0x00076000
region: flash_primary
size: 0x5E000

nonsecure_storage:
address: 0x000ee000
end_address: 0x000fa000
orig_span: &id004
- settings_storage
- nvs_storage
- my_nvs
region: flash_primary
size: 0xc000
span: *id004

nvs_storage:
address: 0x000ee000
end_address: 0x000f6000
inside:
- nonsecure_storage
placement:
align:
start: 0x8000
before:
- my_nvs
region: flash_primary
size: 0x8000

my_nvs:
address: 0x000f6000
end_address: 0x000f8000
inside:
- nonsecure_storage
placement:
after:
- nvs_storage
before:
- settings_storage
region: flash_primary
size: 0x2000

settings_storage:
address: 0x000f8000
end_address: 0x000fa000
inside:
- nonsecure_storage
placement:
align:
start: 0x8000
before:
- end
region: flash_primary
size: 0x2000

tfm_storage:
address: 0x000f8000
end_address: 0x00100000
region: flash_primary
size: 0x8000
span:
- tfm_its
- tfm_otp_nv_counters
- EMPTY_tfm_ps

tfm_its:
address: 0x000f8000
end_address: 0x000fa000
region: flash_primary
size: 0x2000
inside:
- tfm_storage

tfm_otp_nv_counters:
address: 0x000fa000
end_address: 0x000fc000
region: flash_primary
size: 0x2000
inside:
- tfm_storage

EMPTY_tfm_ps:
address: 0x000fc000
end_address: 0x00100000
region: flash_primary
size: 0x4000
inside:
- tfm_storage

Requested Support

  1. Recommended J-Link Commander commands or options to erase only the application partition.
  2. Best practices for partition alignment and partition table configuration to safeguard SoftSIM profiles.
  3. Any known limitations or additional steps required by the nRF9160 secure/non-secure flash attribution unit to preserve non-volatile data.
  4. how i can presure my softsim profile after reflashing, 

Thank you for your assistance—I’m happy to provide any further logs or details.

Best regards,
Aizaz Ullah

  • Hi,

    Can you provide additional details about your application? Is it based on any of existing samples?

    In problem 1 statement, which partion are you trying to erase using Jlink? What are you trying to erase using "erase 0x00010000, 0x0005000"?

    Can you upload your complete static partition files pm_static.yml that correspond to both problems?

    Best regards,
    Dejan

Related