In the process of using APM32F103, I found that I can’t download it. Then I found out that the reason is because the MCU has enabled read protection.
If you enable Flash read protection in the code, when you download again, you will find that the download fails.
Then I found out a way, using Openocd.
In the Openocd.bin folder, hold down the Shift key on the keyboard + right mouse button to open the Powershell window, enter:
.\openocd -f interface/cmsis-dap.cfg -f target/apm32f1x.cfg -c init -c “reset halt” -c “apm32f1x unlock 0” -c “reset halt” -c “exit”
The window shows that APM32 is successfully unlocked.
Then you can successfully download again.
Wow!!! That’s amazing!