nrfutil failing - ERASE_CTRL_AP not supported

I am setting up our production facility in India. Brought out our test jig software that flashes the nRF53 modules. 

I use nrfutil to program the boards via "nrfutil device program --firmware C:\\firmware\\merged_domains_1128.hex --options chip_erase_mode=ERASE_CTRL_AP,reset=RESET_SYSTEM,verify=VERIFY_READ --json"

I can not get JLlink to accept the ERASE_CTRL_AP parameter. Its working fine in the UK production facility using the exact same command and the exact same test jig software. The only differences where is the nrfutil device version (see  nrfutil device list command fails ) and the JLink version. I cannot access the UK machine so I cannot list the working versions there - hence this ticket.

C:\Users\isans\OneDrive\Desktop\Debug>nrfutil device list
668CB0C12A8A1D0B
Product         Nano 33 BLE
Ports           COM4
Traits          serialPorts, usb

601003266
Product         J-Link
Traits          jlink, usb, seggerUsb

id:6
Product         USB Hub
Ports           COM5
Traits          serialPorts, usb

Supported devices found: 3




C:\Users\isans\OneDrive\Desktop\Debug>nrfutil device program --serial-number 601003266 --firmware c:\\firmware\\merged_domains_1128.hex --options chip_erase_mode=ERASE_CTRL_AP,reset=RESET_SYSTEM,verify=VERIFY_READ --json
{"type":"task_begin","data":{"task":{"id":"b9555529feb84ead9bd3fe24e5e1260c","description":"601003266","name":"program","data":null}}}
{"type":"task_progress","data":{"task":{"id":"b9555529feb84ead9bd3fe24e5e1260c","description":"601003266","name":"program","data":null},"progress":{"progressPercentage":0,"name":"program","description":"Connecting to probe","step":1,"amountOfSteps":5,"state":"progress","duration":0,"error_code":null,"message":null,"result":"success"}}}
{"type":"task_progress","data":{"task":{"id":"b9555529feb84ead9bd3fe24e5e1260c","description":"601003266","name":"program","data":null},"progress":{"progressPercentage":100,"name":"program","description":"Connecting to probe","step":1,"amountOfSteps":5,"state":"progress","duration":51,"error_code":null,"message":null,"result":"success"}}}
{"type":"task_end","data":{"task":{"id":"b9555529feb84ead9bd3fe24e5e1260c","description":"601003266","name":"program","data":null},"message":"Failed, chip_erase_mode=ERASE_CTRL_AP is not yet supported in the probe-plugin","result":"fail","error":{"code":1,"description":"Generic"}}}
Error: One or more program tasks failed:
 * 601003266: chip_erase_mode=ERASE_CTRL_AP is not yet supported in the probe-plugin (Generic)


Stack backtrace:
   0: <unknown>
   1: <unknown>
   2: hid_write
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: <unknown>
   9: <unknown>
  10: <unknown>
  11: <unknown>
  12: <unknown>
  13: <unknown>
  14: hid_write
  15: BaseThreadInitThunk
  16: RtlUserThreadStart

ChatGPT (yes I have had to use that) is suggesting that I should be seeing a line with "probe-plugin JLink" in the device list output. Apparently as thats not there, the nrfutil isnt using the JLink debugger - its using "generic. 

Is that right? And how can I get it to show up here......

All the hardware connections are fine as I can use the nRF Programmer v4.6.2 to program the hex file. Its just nrfutil thats giving me the issue

Parents
  • Hi,

    I reproduce this on my end as well and we are looking into it. If you need something working in the mean time, could it be an option to run "nruftil device recover" first, then program without the erase option?

  • The recover works to erase it, but if I remove the ERASE_CTRL part then I still get an error

    nrfutil device program --serial-number 601003266 --firmware c:\\firmware\\merged_domains_1128.hex --options reset=RESET_SYSTEM,verify=VERIFY_READ --json
    {"type":"task_begin","data":{"task":{"id":"90baf971db3047958eac570749819c60","description":"601003266","name":"program","data":null}}}
    {"type":"task_progress","data":{"task":{"id":"90baf971db3047958eac570749819c60","description":"601003266","name":"program","data":null},"progress":{"progressPercentage":0,"name":"program","description":"Connecting to probe","step":1,"amountOfSteps":5,"state":"progress","duration":0,"error_code":null,"message":null,"result":"success"}}}
    {"type":"task_progress","data":{"task":{"id":"90baf971db3047958eac570749819c60","description":"601003266","name":"program","data":null},"progress":{"progressPercentage":100,"name":"program","description":"Connecting to probe","step":1,"amountOfSteps":5,"state":"progress","duration":58,"error_code":null,"message":null,"result":"success"}}}
    {"type":"task_progress","data":{"task":{"id":"90baf971db3047958eac570749819c60","description":"601003266","name":"program","data":null},"progress":{"progressPercentage":0,"name":"program","description":"Erasing non-volatile memory (ERASEALL)","step":1,"amountOfSteps":5,"state":"progress","duration":130,"error_code":null,"message":"Erasing non-volatile memory (ERASEALL)","result":"success"}}}
    {"type":"task_progress","data":{"task":{"id":"90baf971db3047958eac570749819c60","description":"601003266","name":"program","data":null},"progress":{"progressPercentage":100,"name":"program","description":"Erasing non-volatile memory (ERASEALL)","step":1,"amountOfSteps":5,"state":"progress","duration":493,"error_code":null,"message":"Erasing non-volatile memory (ERASEALL)","result":"success"}}}
    {"type":"task_end","data":{"task":{"id":"90baf971db3047958eac570749819c60","description":"601003266","name":"program","data":null},"message":"Failed, Device error: Address range 0x01000000..0x010059dc is outside the memory ranges defined for programming through the Application core","result":"fail","error":{"code":1,"description":"Generic"}}}
    Error: One or more program tasks failed:
     * 601003266: Device error: Address range 0x01000000..0x010059dc is outside the memory ranges defined for programming through the Application core (Generic)

    The hex file is known good. If I use the Nordic Programmer via nRF Connect then I can program using that. This is my fall back solution for now. Not great having to tell our production folks to use a workaround, but its a fallback position.

  • Hi folks,

    Im setting up a new PC with the programming environment and just had the same issue - and after googling the error code found out this ticket - which is amusing as its my own ticket from months ago!!!

    Any update on when a new version will be available?

    nrfutil-device is 2.19.4 and still throws the same error 

    nrfutil device program --firmware C:\firmware\merged_domains_v1291.hex --options chip_erase_mode=ERASE_CTRL_AP,reset=RESET_SYSTEM,verify=VERIFY_READ --json
    {"type":"task_begin","data":{"task":{"id":"e52e6a96b2df4f14a2fca23d3907b70d","description":"851000622","name":"program","data":null}}}
    {"type":"task_progress","data":{"task":{"id":"e52e6a96b2df4f14a2fca23d3907b70d","description":"851000622","name":"program","data":null},"progress":{"progressPercentage":0,"name":"program","description":"Connecting to probe","step":1,"amountOfSteps":5,"state":"progress","duration":0,"error_code":null,"message":null,"result":"success"}}}
    {"type":"task_progress","data":{"task":{"id":"e52e6a96b2df4f14a2fca23d3907b70d","description":"851000622","name":"program","data":null},"progress":{"progressPercentage":100,"name":"program","description":"Connecting to probe","step":1,"amountOfSteps":5,"state":"progress","duration":543,"error_code":null,"message":null,"result":"success"}}}
    {"type":"task_progress","data":{"task":{"id":"e52e6a96b2df4f14a2fca23d3907b70d","description":"851000622","name":"program","data":null},"progress":{"progressPercentage":0,"name":"program","description":"Recovering device","step":2,"amountOfSteps":5,"state":"progress","duration":560,"error_code":null,"message":"Recovering device","result":"success"}}}
    {"type":"task_progress","data":{"task":{"id":"e52e6a96b2df4f14a2fca23d3907b70d","description":"851000622","name":"program","data":null},"progress":{"progressPercentage":6,"name":"program","description":"Recovering device","step":2,"amountOfSteps":5,"state":"progress","duration":1062,"error_code":null,"message":"Recovering device","result":"success"}}}
    {"type":"task_progress","data":{"task":{"id":"e52e6a96b2df4f14a2fca23d3907b70d","description":"851000622","name":"program","data":null},"progress":{"progressPercentage":11,"name":"program","description":"Recovering device","step":2,"amountOfSteps":5,"state":"progress","duration":1562,"error_code":null,"message":"Recovering device","result":"success"}}}
    {"type":"task_progress","data":{"task":{"id":"e52e6a96b2df4f14a2fca23d3907b70d","description":"851000622","name":"program","data":null},"progress":{"progressPercentage":100,"name":"program","description":"Recovering device","step":2,"amountOfSteps":5,"state":"progress","duration":1563,"error_code":null,"message":"Recovering device","result":"success"}}}
    {"type":"task_end","data":{"task":{"id":"e52e6a96b2df4f14a2fca23d3907b70d","description":"851000622","name":"program","data":null},"message":"Failed, Device error: Address range 0x01000000..0x0101fb00 is outside the memory ranges defined for programming through the Application core","result":"fail","error":{"code":1,"description":"Generic"}}}
    Error: One or more program tasks failed:
     * 851000622: Device error: Address range 0x01000000..0x0101fb00 is outside the memory ranges defined for programming through the Application core (Generic)

    Moving to the older nrfutil-device via "nrfutil install device=2.7.15 --force" fixes it

    Mat

  • Hi Mat, 

    Mathew Key said:
    after googling the error code found out this ticket - which is amusing as its my own ticket from months ago!!!

    I can relate, happens to me more than I'd like to admit! 

    Mathew Key said:
    nrfutil-device is 2.19.4 and still throws the same error 

    Our internal tracking shows that it was fixed in v2.16.0, but there could have been another regression since. Could you please test with v2.16.0 and let me know if you see the issue there as well? 

    Best regards,

    Maria

  • "nrfutil install device=2.16.0 --force" to install it

    nrfutil device program --firmware C:\firmware\merged_domains_v1291.hex --options chip_erase_mode=ERASE_CTRL_AP,reset=RESET_SYSTEM,verify=VERIFY_READ --json
    {"type":"task_begin","data":{"task":{"id":"a1dc322eb8d14ebf81ac79c45ca009a4","description":"851000622","name":"program","data":null}}}
    {"type":"task_progress","data":{"task":{"id":"a1dc322eb8d14ebf81ac79c45ca009a4","description":"851000622","name":"program","data":null},"progress":{"progressPercentage":0,"name":"program","description":"Connecting to probe","step":1,"amountOfSteps":5,"state":"progress","duration":0,"error_code":null,"message":null,"result":"success"}}}
    {"type":"task_progress","data":{"task":{"id":"a1dc322eb8d14ebf81ac79c45ca009a4","description":"851000622","name":"program","data":null},"progress":{"progressPercentage":100,"name":"program","description":"Connecting to probe","step":1,"amountOfSteps":5,"state":"progress","duration":495,"error_code":null,"message":null,"result":"success"}}}
    {"type":"task_progress","data":{"task":{"id":"a1dc322eb8d14ebf81ac79c45ca009a4","description":"851000622","name":"program","data":null},"progress":{"progressPercentage":0,"name":"program","description":"Recovering device","step":2,"amountOfSteps":5,"state":"progress","duration":510,"error_code":null,"message":"Recovering device","result":"success"}}}
    {"type":"task_progress","data":{"task":{"id":"a1dc322eb8d14ebf81ac79c45ca009a4","description":"851000622","name":"program","data":null},"progress":{"progressPercentage":100,"name":"program","description":"Recovering device","step":2,"amountOfSteps":5,"state":"progress","duration":1555,"error_code":null,"message":"Recovering device","result":"success"}}}
    {"type":"task_end","data":{"task":{"id":"a1dc322eb8d14ebf81ac79c45ca009a4","description":"851000622","name":"program","data":null},"message":"Failed, Device error: Address range 0x01000000..0x0101fb00 is outside the memory ranges defined for programming through the Application core","result":"fail","error":{"code":1,"description":"Generic"}}}
    Error: One or more program tasks failed:
     * 851000622: Device error: Address range 0x01000000..0x0101fb00 is outside the memory ranges defined for programming through the Application core (Generic)

    Same issue in 2.16.0

  • Thank you for the super quick reply. I'll let the team know! 

  • Hello again, 

    When looking closer into your logs, I see that the error for your original ticket and your replies is different. 

    Mathew Key said:
     * 851000622: Device error: Address range 0x01000000..0x0101fb00 is outside the memory ranges defined for programming through the Application core (Generic)

    This error stems from having a merged_domains.hex file which covers address regions in the application and the network core. The address range in the error belongs to the network core. The programmer application splits the hex file before flashing it onto the cores. This is why the programmer application works and nrfutil from the command line does not. nrfutil device does not support programming several cores with the same hex-file, unfortunately. 

    You can see the relevant cli commands for the nRF5340 here under the nRF Util tab. 

    Best regards,

    Maria

Reply
  • Hello again, 

    When looking closer into your logs, I see that the error for your original ticket and your replies is different. 

    Mathew Key said:
     * 851000622: Device error: Address range 0x01000000..0x0101fb00 is outside the memory ranges defined for programming through the Application core (Generic)

    This error stems from having a merged_domains.hex file which covers address regions in the application and the network core. The address range in the error belongs to the network core. The programmer application splits the hex file before flashing it onto the cores. This is why the programmer application works and nrfutil from the command line does not. nrfutil device does not support programming several cores with the same hex-file, unfortunately. 

    You can see the relevant cli commands for the nRF5340 here under the nRF Util tab. 

    Best regards,

    Maria

Children
  • Guessing we are sticking with the older version then. There is a LOT less risk in production from having a single hex file containing everything rather than two different hex files.

  • I understand. There is a way to split the hex file before programming, if that is an option for you. See the instructions below (addresses are specific to the nRF5340). 

    Split the hex file with i.e. srecord: 

    srec_cat merged_domains.hex -intel -crop 0x00000000 0x00FFFFFF -o app.hex -intel
    srec_cat merged_domains.hex -intel -crop 0x01000000 0x01FFFFFF -o net.hex -intel

    Recover and program in this order: 

    nrfutil device recover --core Network
    nrfutil device recover --core Application
    nrfutil device program --firmware net.hex --core Network
    nrfutil device program --firmware app.hex --core Application

    You can add the options you need to the programming commands. 

    Best regards,

    Maria

Related