Replies: 12 comments 7 replies
-
Did you get it to work? I also have stlink, but I have never felt like messing with it. Could you send a photo with connected wires? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Here you have a ready to use config file for OpenOCD using STLinkv2 probe: |
Beta Was this translation helpful? Give feedback.
-
******** Launching 1 shot unbricking process with OpenOCD (STLink v2)... Checking ROM masking ROM masking is set to 0b100. Setting ON... Bootloader code programmed. Checking ROM masking |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Fortunately, I returned to normal after using my own cfg |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
I am wondering if it is possible to debug code by configuring IDE and OPENOCD? |
Beta Was this translation helpful? Give feedback.
-
Sorry for the inconvenience. My "1-hand" unbricking script wasn't tested with my recent updates to the target cfg file. |
Beta Was this translation helpful? Give feedback.
-
My apologies again : The firmware file I provided in my repo was wrong! It was a full flash image, whereas 'uv_flash_fw' needs 0x1000+ region. Corrected. |
Beta Was this translation helpful? Give feedback.
-
@egzumer , I never figured out how to set up IDE which GDB interface. May I suggest you to remove reference to 'interface/stlink.cfg' in your config file? It shouldn't lead to issue, but it is not necessary as there are implicit imports since we call swd protocol. Also, for sure there's a way for the compiler to output an ELF formatted binary while it produces ROM file, as it seems to be expected here. |
Beta Was this translation helpful? Give feedback.
-
Regarding upload speed, I implemented must faster 'uv_fastflash_bl' and 'uv_fastflash_fw' procedures as you can see in the cfg, in a similar way as bootloader does when using uart flashing method. Regarding classic word by word uploading method, it really works reliably using this cfg. There must be another issue with your setup if it's not the case. I successfully hooked a GDB instance over openOCD. OpenOCD must run as a daemon and interface initialized (no 'shutdown' nor 'halt' here). Then just launch gdb.exe, it will default attach to localhost:3333. |
Beta Was this translation helpful? Give feedback.
-
HELLO, EGZUMER
I want to use stlink V2 for burning
I modified the first two lines of gd32g030.cfg:
transport select hla_swd
adapter speed 100
Then use openocd to execute:
sudo openocd -c "bindto 0.0.0.0" -f interface/stlink.cfg -f dp32g030.cfg -c "write_image firmware.bin 0; shutdown;"
But prompt:
Open On Chip Debugger 0.11.0-rc2
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Force hard breakpoints
Info: The selected transport tool over low level target control The results may differ compared to plain JTAG/SWD
Info: clock speed 100 kHz
Info: STLINK V2J38S7 (API v2) VID: PID 0483:3748
Info: Target voltage: 3.273879
Warn: UNEXPECTED idcode: 0x0bb11477
Then OpenOCD terminated

I set CPUTAPID
Still useless, do you have any relevant suggestions?
I am sure my connection is correct and STLINK is working properly
AND I got the same results on both Windows and Debian
Beta Was this translation helpful? Give feedback.
All reactions