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?
Parents
  • Hello,

    There might have been a glitch preventing you from pasting the logs. You can always attach a file if pasting doesn't work.
    However, I’ve now received the logs from our FAE (the one you're in touch with). From the logs, I can see that the application is using MCUboot.
    So, please try disabling APPROTECT in the mcuboot.config file as well. This is because the bootloader initializes first after a reset and enables APPROTECT. As a result, the application won’t be able to reach a point where it can enable APPROTECT. 
    Let me know if this resolves the issue or if the problem persists.

    Kind regards,
    Abhijith

  • Alas, the problem still persists. I thought we had it fixed--I _think_ it flashed successfully twice without needing the recover step. And then I tried to connect the RTT up, and now, whether the RTT terminal is there or not, I need to recover each time again.

    mcuboot.config has:

    CONFIG_BOOT_MAX_IMG_SECTORS=512
    CONFIG_NRF_APPROTECT_DISABLE=y
    CONFIG_NRF_SECURE_APPROTECT_DISABLE=y

Reply
  • Alas, the problem still persists. I thought we had it fixed--I _think_ it flashed successfully twice without needing the recover step. And then I tried to connect the RTT up, and now, whether the RTT terminal is there or not, I need to recover each time again.

    mcuboot.config has:

    CONFIG_BOOT_MAX_IMG_SECTORS=512
    CONFIG_NRF_APPROTECT_DISABLE=y
    CONFIG_NRF_SECURE_APPROTECT_DISABLE=y

Children
  • 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