Can't Upload to WISBLOCK 4631 via SWD

I am using the RAK4631 with the Zephyr infrastructure and uploading code via the Nordic extension for VS Code. To upload code, I was using the nRF52 DK through SWD. I was able to flash code multiple times without any problem using the command west flash --runner nrfjprog. Then, to erase all memory before flashing new code, I tried the command west flash --runner nrfjprog --erase, but it gave me an error. Now, the same error appears every time I try to upload new code. The error is the following:

[error] [ Client] - Encountered error -102: Command read_device_info executed for 139 milliseconds with result -102
[error] [ Client] - Encountered error -102: Command read_memory_descriptors executed for 46 milliseconds with result -102
Failed to read device memories.
[error] [ Worker] - An unknown error.
[error] [ Worker] - An unknown error.
ERROR: JLinkARM DLL reported an error. Try again. If error condition
ERROR: persists, run the same command again with argument --log, contact Nordic
ERROR: Semiconductor and provide the generated log.log file to them.
NOTE: For additional output, try running again with logging enabled (–log).
NOTE: Any generated log error messages will be displayed.
FATAL ERROR: command exited with status 33: nrfjprog --program ‘C:\Users\royal\Desktop\IT\0_Meu_Zephyr\sensor-box-zephyr\RAK4631\build\merged.hex’ --sectoranduicrerase --verify -f NRF52 --snr 682565660

I am also not able to access the logger via RTT (I was able to do it before).

Welcome to RAK forum @Yopoitio ,

I haven’t tried to use nRF52 DK or any other kit from nordic as an external debugger/programmer. But it seems something went wrong after doing west flash erase.

For sanity check, you can doublcheck wiring jumpers and if the supply going to the module is ok (3.3V on VDD). If you have external Jlink, you can try to use it to check if you can establish connection.

Else, it might be best to check on zephyr forum who also uses nrf52 DK to upload via west. There could be some pointers there.

Hello @Yopoitio

As an addition to @carlrowan suggestion, please try to run following command on your terminal.

nrfjprog --recover

Also, please be sure that P0.18 (reset pin) is connected to VDD if you are using a custom hardware.

Best regards,
Sercan.

Thank you for your replies. I have already checked the wiring, and everything is fine, including the supplied voltage.

I tried nrfjprog --recover with the connection reset to VDD, and it shows this message:

Recovering device. This operation might take 30s.
Erasing user code and UICR flash areas.

However, when I try to flash again, I get the same error. I also tried connecting using J-Link Commander, and it just returns this:

Connecting to target via SWD
InitTarget() start
InitTarget() end - Took 2.94ms
Found SW-DP with ID 0x2BA01477
DAP error while determining CoreSight SoC version
Connect fallback: Reset via Reset pin & Connect.
InitTarget() start
InitTarget() end - Took 3.04ms
Found SW-DP with ID 0x2BA01477
DAP error while determining CoreSight SoC version
Cannot connect to target.

I was searching and read somewhere that the --erase option erases the entire chip, making it unusable. Is that correct, and could this be the cause?

No. It is not possible. --erase option will not corrupt your module. Maybe, you can try to use J-Flash Lite application from SEGGER.

Sorry for the late update, but after some tests I realized the problem was the connections. I was using jumper cables, which didn’t provide a stable enough connection, and that was causing all the issues.

Thank you again for all your help.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.