Hello everyone, I’m currently working with a custom board using the nRF5340 chip. After flashing the program, I encountered some issues with device recovery and coprocessor protection. I’m reaching out to seek guidance and share my experience in case it helps others facing similar challenges.
The Issue
After flashing the program, I noticed that protection was enabled, preventing operations like erase, read, and write. Attempts to recover the device using the nrfjprog tool failed with error code -102. Here’s a snippet of the commands and results I encountered:
bash
PS C:\workspace> nrfjprog --recover --family nRF53 --coprocessor CP_NETWORK --log
[error] [Client] - Encountered error -102: Command enable_coprocessor executed for 140 milliseconds with result -102
ERROR: Failed when selecting coprocessor NETWORK
I also tried selecting the APPLICATION coprocessor with similar results:
bash
PS C:\workspace> nrfjprog --family NRF53 --recover --coprocessor CP_APPLICATION --log
[error] [Client] - Encountered error -102: Command select_coprocessor executed for 126 milliseconds with result -102
ERROR: Failed when selecting coprocessor APPLICATION
What I’ve Tried
- Recovery Commands: I followed the standard recovery procedure but consistently received the same error. I tried running the commands with the
--logflag to get more detailed logs, but the issue persisted. - J-Flash Lite: I considered switching to J-Flash Lite for flashing, but I’m not entirely sure how it integrates with my current setup using VS Code and nRF Connect for Desktop.
- Firmware and Drivers: I verified that I’m using the latest version of the nRF Command Line Tools and Segger J-Link drivers. Everything seems up to date, but the issue remains.
Seeking Help
I’m reaching out to the community for advice on the correct procedure to disable protection and recover the device. I’m also curious if others have encountered similar issues when working with custom boards versus the nRF5340DK development kit.
Lessons Learned
This experience has taught me the importance of thoroughly understanding device protection mechanisms before starting a project. It’s also highlighted the value of having detailed documentation and community support when troubleshooting complex hardware issues.
Looking Ahead
I’m planning to explore alternative flashing tools and dive deeper into the Segger J-Link documentation to better understand the underlying causes of these errors. I’m also considering reaching out to Nordic Semiconductor support for further assistance.
Thank you in advance for your insights and recommendations. I look forward to hearing from the community and learning from your experiences!
Best regards,
[Your Name]