Error flashing custom board w/ nRF52832 (unable to read)

I'm trying to flash a custom board (schematics in this ticket - Schematic/Layout review request) using a Jlink EDU mini and keep running into an error message saying it's failing to read or erase memory. I've seen suggestions on other posts that running nrfjprog --recover can remove the read protection mechanism, but when I ran that (with --log, which I've attached) it also failed.

 

4274.log.log

I've had the flash process succeed sometimes, but the board doesn't act any differently to before (can't control the GPIO) so I'm assuming that's another issue.

Any ideas for what could be causing this?

Thanks

Parents
  • I've encountered similar issues on an nRF52DK and on a custom board. Launching JLinkExe, clearing and setting the RESET pin then using the nrfutils device recover command seems to unbrick the chip. Hope this helps you!

  • Thanks for the suggestion!

    It's a bit difficult to tell how much this helps since the board was successfully programming intermittently anyway, but I haven't had a failure since doing it (I'll hold off on calling this issue resolved until I've tested the rest of the prototypes). Did you figure out why the chips were bricked in the first place? I'm guessing it's not a common issue.

  • I've only encountered this issue when flashing using the VsCode extension which calls nrfjprog in the background. I've never encountered the issue when using the nRF Connect for Desktop Programmer. Therefore, I suspect something is wrong with either the VsCode extension or nrfjprog.

    It also seems to happen more often on SDK v2.9.0 than on v2.8.0, but that's just a feeling, I obviously don't have data to prove it.

  • Hi Alexandre

    Just FYI. The nRF Connect for Desktop Programmer app also calls nrfjprog in the background, but it could be something with VS Code or west that is at fault here and we will keep investigating. I'm glad you're both able to work around it though.

    It could be helpful if you share the support log information from your VS Code extension on computer(s) this occurs on:

    Best regards,

    Simon

Reply
  • Hi Alexandre

    Just FYI. The nRF Connect for Desktop Programmer app also calls nrfjprog in the background, but it could be something with VS Code or west that is at fault here and we will keep investigating. I'm glad you're both able to work around it though.

    It could be helpful if you share the support log information from your VS Code extension on computer(s) this occurs on:

    Best regards,

    Simon

Children
  • Here's my log:

    // IMPORTANT: The following data can contain sensitive or confidential information about your environment.
    // If you do not want others to see this information, make sure to remove it before sharing the data.
    
    // For help and support, visit Nordic Semiconductor's DevZone at https://devzone.nordicsemi.com/.
    
    {
    "platform": {
    "os": "linux",
    "osVersion": "#53~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Jan 15 19:18:46 UTC 2",
    "osKernel": "6.8.0-52-generic",
    "vscode": "1.97.2",
    "node": "v20.18.1",
    "name": "Ubuntu",
    "id": "ubuntu",
    "version": "22.04.5 LTS (Jammy Jellyfish)",
    "versionId": "22.04"
    },
    "system": {
    "date": "2025-03-06T18:28:37.028Z",
    "vscodeRoot": "/vscode/vscode-server/bin/linux-x64/e54c774e0add60467559eb0d1e229c6452cf8447",
    "nrfConnectForDesktopInstalled": "unknown",
    "vscodeUptime": "00:11:39",
    "osUptime": "04:27:42",
    "cpu": "13th Gen Intel(R) Core(TM) i7-13700H"
    },
    "workspace": {
    "name": "Bluetooth (Workspace) [Dev Container: nRF Connect DevContainer]",
    "workspaceFile": "/azuresphere-npa-application/Bluetooth/Bluetooth.code-workspace",
    "folders": [
    "/azuresphere-npa-application/Bluetooth",
    "/azuresphere-npa-application"
    ]
    },
    "sdks": [
    {
    "version": "v2.8.0",
    "path": "/"
    }
    ],
    "activeBuild": "/azuresphere-npa-application/Bluetooth/build",
    "apps": [
    {
    "workspace": "/azuresphere-npa-application/Bluetooth",
    "uri": "/azuresphere-npa-application/Bluetooth",
    "buildConfigurations": [
    {
    "id": "/azuresphere-npa-application/Bluetooth/build",
    "name": "build",
    "boardId": "nrf52dk/nrf52832",
    "type": "Sysbuild",
    "isChild": false,
    "isStale": false,
    "taskBindings": {
    "build": [],
    "pristineBuild": [],
    "flash": [],
    "eraseAndFlash": []
    },
    "sdk": "/",
    "toolchain": "nRF Connect SDK Toolchain v2.8.0"
    }
    ]
    }
    ],
    "toolchains": [
    {
    "version": "2.8.0",
    "path": "/root/ncs/toolchains/b81a7cd864"
    }
    ],
    "connectedDevices": [],
    "tools": {
    "/root/ncs/toolchains/b81a7cd864/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc": "0.16.8",
    "/opt/SEGGER/JLink/JLinkExe": "7.94e",
    "/usr/local/bin/nrfjprog": "10.24.2",
    "/usr/local/bin/nrfutil": "7.12.0",
    "/root/ncs/toolchains/b81a7cd864/usr/local/bin/cmake": "3.21.0",
    "/root/ncs/toolchains/b81a7cd864/usr/local/bin/west": "1.2.0",
    "/root/ncs/toolchains/b81a7cd864/usr/local/bin/python3": "3.12.4",
    "/root/ncs/toolchains/b81a7cd864/usr/local/bin/ninja": "1.10.2",
    "/root/ncs/toolchains/b81a7cd864/usr/bin/gperf": "3.1",
    "/root/ncs/toolchains/b81a7cd864/usr/bin/dtc": "1.5.0",
    "/root/ncs/toolchains/b81a7cd864/opt/bin/gn": "2132",
    "/root/ncs/toolchains/b81a7cd864/usr/local/bin/git": "2.37.3",
    "arm-gdbPath": "/root/ncs/toolchains/b81a7cd864/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb",
    "riscv-gdbPath": "/root/ncs/toolchains/b81a7cd864/opt/zephyr-sdk/riscv64-zephyr-elf/bin/riscv64-zephyr-elf-gdb"
    },
    "nrfutil": {
    "nrfutil-device": {
    "version": "2.7.9",
    "binPath": "/root/.vscode-server/extensions/nordic-semiconductor.nrf-connect-2025.1.127-linux-x64/platform/nrfutil/bin/nrfutil-device",
    "jlinkInfo": {
    "description": "This version of SEGGER J-Link is different from the J-Link version that was used to test nrfutil device commands",
    "expectedVersion": {
    "version": "JLink_V7.94i",
    "versionFormat": "string"
    },
    "name": "JlinkARM",
    "version": "JLink_V7.94e",
    "versionFormat": "string"
    }
    },
    "nrfutil-toolchain-manager": {
    "version": "0.14.4",
    "binPath": "/root/.vscode-server/extensions/nordic-semiconductor.nrf-connect-2025.1.127-linux-x64/platform/nrfutil/bin/nrfutil-toolchain-manager"
    }
    },
    "environment": {
    "westEnv": {
    "GIT_EXEC_PATH": "/root/ncs/toolchains/b81a7cd864/usr/local/libexec/git-core",
    "HOME": "/root",
    "PATH": "/root/ncs/toolchains/b81a7cd864/usr/bin:/root/ncs/toolchains/b81a7cd864/usr/bin:/root/ncs/toolchains/b81a7cd864/usr/local/bin:/root/ncs/toolchains/b81a7cd864/opt/bin:/root/ncs/toolchains/b81a7cd864/opt/nanopb/generator-bin:/root/ncs/toolchains/b81a7cd864/opt/zephyr-sdk/arm-zephyr-eabi/bin:/root/ncs/toolchains/b81a7cd864/opt/zephyr-sdk/riscv64-zephyr-elf/bin:/vscode/vscode-server/bin/linux-x64/e54c774e0add60467559eb0d1e229c6452cf8447/bin/remote-cli:/usr/local/lib/nodejs/node/bin:/sonar-scanner-cli/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/vscode/vscode-server/bin/linux-x64/e54c774e0add60467559eb0d1e229c6452cf8447/bin/remote-cli:/usr/local/lib/nodejs/node/bin:/sonar-scanner-cli/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
    "ZEPHYR_BASE": "/zephyr",
    "ZEPHYR_TOOLCHAIN_VARIANT": "zephyr",
    "ZEPHYR_SDK_INSTALL_DIR": "/root/ncs/toolchains/b81a7cd864/opt/zephyr-sdk",
    "PYTHONPATH": "/root/ncs/toolchains/b81a7cd864/usr/local/lib/python3.12:/root/ncs/toolchains/b81a7cd864/usr/local/lib/python3.12/site-packages"
    },
    "inherited": {
    "ELECTRON_RUN_AS_NODE": "1",
    "HOME": "/root",
    "PATH": "/vscode/vscode-server/bin/linux-x64/e54c774e0add60467559eb0d1e229c6452cf8447/bin/remote-cli:/usr/local/lib/nodejs/node/bin:/sonar-scanner-cli/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
    }
    },
    "terminal": {
    "defaultProfile": null
    },
    "config": {
    "nordic-semiconductor.nrf-connect": {
    "topdir": "",
    "toolchain": {
    "path": ""
    },
    "ozonePath": "",
    "applications": [
    "${workspaceFolder}/Bluetooth"
    ],
    "applicationOptions": {},
    "kconfig": {
    "interface": "kconfig"
    },
    "west": {
    "env": {
    "$base": "terminal"
    }
    },
    "boardRoots": [],
    "taskBindings": {},
    "buildTerminal": {
    "condensedProgress": true
    },
    "debugging": {
    "flash": true,
    "bindings": {},
    "justMyCode": false
    },
    "activeAppFollowActiveEditor": true,
    "flash": {
    "softreset": false,
    "erase": false,
    "recover": false
    },
    "enableTelemetry": false,
    "thirdpartyIntegration": {},
    "toolchainManager": {
    "indexURL": null,
    "installDirectory": null
    },
    "nrfutil": {
    "home": null
    },
    "defaultOpenAction": "ask",
    "terminalProfile": {
    "shell": null
    }
    },
    "nordic-semiconductor.nrf-terminal": {
    "terminalMode": "character"
    }
    },
    "extensions": {
    "internal": {
    "nordic-semiconductor.nrf-connect": {
    "version": "2025.1.127",
    "path": "/root/.vscode-server/extensions/nordic-semiconductor.nrf-connect-2025.1.127-linux-x64",
    "isActive": true
    },
    "nordic-semiconductor.nrf-terminal": {
    "version": "2024.9.14",
    "path": "/root/.vscode-server/extensions/nordic-semiconductor.nrf-terminal-2024.9.14",
    "isActive": true
    },
    "nordic-semiconductor.nrf-devicetree": {
    "version": "2024.12.15",
    "path": "/root/.vscode-server/extensions/nordic-semiconductor.nrf-devicetree-2024.12.15",
    "isActive": true
    },
    "nordic-semiconductor.nrf-kconfig": {
    "version": "2024.12.13",
    "path": "/root/.vscode-server/extensions/nordic-semiconductor.nrf-kconfig-2024.12.13",
    "isActive": true
    }
    },
    "external": {
    "marus25.cortex-debug": null,
    "ms-vscode.cpptools": "1.23.6",
    "ms-vscode.js-debug": "1.97.1",
    "ms-vscode.vscode-js-profile-table": "1.0.10",
    "cschlosser.doxdocgen": "1.4.0",
    "ms-azuretools.vscode-docker": "1.29.4",
    "ms-vscode.cmake-tools": "1.20.52",
    "ms-vscode.cpptools-extension-pack": "1.3.1",
    "streetsidesoftware.code-spell-checker": "4.0.40",
    "trond-snekvik.gnu-mapfiles": "1.1.0",
    "twxs.cmake": "0.0.17"
    }
    }
    }

    An other thing I noticed is that this issue seems to happen more frequently if I have an RTT connection open while attempting to Flash the device.

Related