Forced to recover the board each time I flash

Hey all,

Every time I flash, I get the following error message:

Error: One or more batch tasks failed:
- [Probe] Device error: Memory access error at 0x00000000. Probably a memory protection issue. Probe access is Secure, code: Generic

FATAL ERROR: command exited with status 1: nrfutil --json device x-execute-batch --batch-path 'C:\src\warn-zephyr\core\build\generated_nrfutil_batch.json' --serial-number 852006111

I then need to go to the connected devices and recover the board. At that point, I'm able to flash again. If I look at my .config output file, both of the APPROTECT configs are set to disable:

CONFIG_NRF_APPROTECT_DISABLE=y
CONFIG_NRF_SECURE_APPROTECT_DISABLE=y
Is there something more I need to do?
  • Here's the log:
    
    * Executing task: nRF Connect: Flash: core/build (active)
    
    Flashing build to 852006111
    C:\WINDOWS\system32\cmd.exe /d /s /c "west flash -d c:\src\warn-zephyr_2\core\build --dev-id 852006111"
    
    -- west flash: rebuilding
    [0/10] Performing build step for 'core'
    ninja: no work to do.
    [1/10] Performing build step for 'mcuboot'
    ninja: no work to do.
    [3/10] Completed 'core'
    [5/10] cmd.exe /C "cd /D C:\src\warn-zephyr_2\core\build\_sysbuild && C:\ncs\toolchains\0b393f9e1b\opt\bin\cmake.exe -E true"
    [6/9] No install step for 'mcuboot'
    [7/9] Completed 'mcuboot'
    [8/9] cmd.exe /C "cd /D C:\src\warn-zephyr_2\core\build\_sysbuild && C:\ncs\toolchains\0b393f9e1b\opt\bin\cmake.exe -E true"
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    -- runners.nrfutil: Flashing file: C:\src\warn-zephyr_2\core\build\merged.hex
    -- runners.nrfutil: Erasing address ranges touched by firmware
    Error: One or more batch tasks failed:
    * 852006111: Device error: Memory access error at 0x00000000. Probably a memory protection issue. Probe access is Secure (Generic)
    
    FATAL ERROR: command exited with status 1: nrfutil --json device x-execute-batch --batch-path 'C:\src\warn-zephyr_2\core\build\generated_nrfutil_batch.json' --serial-number 852006111
    
    * The terminal process terminated with exit code: 1.
    * Terminal will be reused by tasks, press any key to close it.
    
    * Executing task: nRF Connect: Flash: core/build (active)
    
    Flashing build to 852006111
    C:\WINDOWS\system32\cmd.exe /d /s /c "west flash -d c:\src\warn-zephyr_2\core\build --dev-id 852006111"
    
    -- west flash: rebuilding
    [0/10] Performing build step for 'core'
    ninja: no work to do.
    [1/10] Performing build step for 'mcuboot'
    ninja: no work to do.
    [3/10] Completed 'core'
    [5/10] cmd.exe /C "cd /D C:\src\warn-zephyr_2\core\build\_sysbuild && C:\ncs\toolchains\0b393f9e1b\opt\bin\cmake.exe -E true"
    [6/9] No install step for 'mcuboot'
    [7/9] Completed 'mcuboot'
    [8/9] cmd.exe /C "cd /D C:\src\warn-zephyr_2\core\build\_sysbuild && C:\ncs\toolchains\0b393f9e1b\opt\bin\cmake.exe -E true"
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    -- runners.nrfutil: Flashing file: C:\src\warn-zephyr_2\core\build\merged.hex
    -- runners.nrfutil: Erasing address ranges touched by firmware
    -- runners.nrfutil: Programming image
    -- runners.nrfutil: Verifying image
    -- runners.nrfutil: Reset
    -- runners.nrfutil: Board with serial number 852006111 flashed successfully.
    * Terminal will be reused by tasks, press any key to close it.
    
    * Executing task: nRF Connect: Flash: core/build (active)
    
    Flashing build to 852006111
    C:\WINDOWS\system32\cmd.exe /d /s /c "west flash -d c:\src\warn-zephyr_2\core\build --dev-id 852006111"
    
    -- west flash: rebuilding
    [0/10] Performing build step for 'core'
    ninja: no work to do.
    [1/10] Performing build step for 'mcuboot'
    ninja: no work to do.
    [3/10] Completed 'core'
    [5/10] cmd.exe /C "cd /D C:\src\warn-zephyr_2\core\build\_sysbuild && C:\ncs\toolchains\0b393f9e1b\opt\bin\cmake.exe -E true"
    [6/9] No install step for 'mcuboot'
    [7/9] Completed 'mcuboot'
    [8/9] cmd.exe /C "cd /D C:\src\warn-zephyr_2\core\build\_sysbuild && C:\ncs\toolchains\0b393f9e1b\opt\bin\cmake.exe -E true"
    -- west flash: using runner nrfutil
    -- runners.nrfutil: reset after flashing requested
    -- runners.nrfutil: Flashing file: C:\src\warn-zephyr_2\core\build\merged.hex
    -- runners.nrfutil: Erasing address ranges touched by firmware
    Error: One or more batch tasks failed:
    * 852006111: Device error: Memory access error at 0x00000000. Probably a memory protection issue. Probe access is Secure (Generic)
    
    FATAL ERROR: command exited with status 1: nrfutil --json device x-execute-batch --batch-path 'C:\src\warn-zephyr_2\core\build\generated_nrfutil_batch.json' --serial-number 852006111
    
    * The terminal process terminated with exit code: 1.
    * Terminal will be reused by tasks, press any key to close it.

  • Hey Abhijith,

    I was discussing this issue with my colleague, and we figured it out! I also needed to add CONFIG_PROTECT=n to the mcuboot.config. As follows:

    CONFIG_BOOT_MAX_IMG_SECTORS=512
    CONFIG_NRF_APPROTECT_DISABLE=y
    CONFIG_NRF_SECURE_APPROTECT_DISABLE=y
    CONFIG_FPROTECT=n
    This works now--thanks so much for pointing us in the right direction! You rock!
    Now, I have another problem: I can't get RTT working. It used to work, but it's borked now. But to keep things straight, I'll open another ticket.
    Thanks for all the support!
Related