创建页面,内容为“ == MDK-ARM (Windows) == Windows7x64 virtual machine on Mac * Download and install [https://www.keil.com/demo/eval/arm.htm mdk-arm] * [https://aka.ms/vs/17/release/vc_redist.x64.exe VC_redist.x64.exe] The pack installer seems useless. Just close it, and the install link is somehow disabled. Download [https://www.keil.arm.com/devices/stmicroelectronics-stm32f103ze/processors/ stm32f103ze] DFP and install === MDK4.7 === MDK 4.72 + keygen (Menu/License manag…” |
|||
第47行: | 第47行: | ||
<ref>https://rudi-horn.de/Home/7-debugging-the-stmf-with-an-st-linkv-and-openocd</ref> | <ref>https://rudi-horn.de/Home/7-debugging-the-stmf-with-an-st-linkv-and-openocd</ref> | ||
=== Installation === | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
# don't brew install, lacks of stlink support | # don't brew install, lacks of stlink support | ||
第96行: | 第97行: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Telnet === | |||
=== Issues === | |||
[[Category:Embedded]] | [[Category:Embedded]] | ||
[[Category:STM32]] | [[Category:STM32]] |
2025年4月5日 (六) 05:56的版本
MDK-ARM (Windows)
Windows7x64 virtual machine on Mac
- Download and install mdk-arm
- VC_redist.x64.exe
The pack installer seems useless. Just close it, and the install link is somehow disabled.
Download stm32f103ze DFP and install
MDK4.7
MDK 4.72 + keygen (Menu/License manage/CID), generated key only valid to 2020, but still can use
Project structure(https://github.com/drriguz/stm32-examples/tree/master/stm32-led):
Set c++ options:
Set debuger to use ST-link+SW:
Note:
- Don't use startup_stm32f10x_hd.s by Mdk, use the library one
- Don't call SystemInit in main.c, it's already called in startup_stm32f10x_hd.s
Opensource toolchain
OpenOCD
https://openocd.org/pages/getting-openocd.html
Installation
# don't brew install, lacks of stlink support
# brew install openocd
brew install jimtcl libusb
# ./doc/openocd.texi:12874: Unmatched `@end'.
# makeinfo: Removing output file `doc/openocd.info' due to errors; use --force to preserve.
brew install texinfo # need newer version
# configure: error: libusb-1.x is required for adapter "ST-Link Programmer".
export PKG_CONFIG_PATH="/usr/local/opt/libusb/lib/pkgconfig:$PKG_CONFIG_PATH"
git clone https://git.code.sf.net/p/openocd/code openocd-code
cd openocd-code
# 12.0 Error: ST-Link version does not support DAP direct transport
git checkout v0.10.0
./bootstrap
./configure --enable-stlink --enable-ftdi --disable-werror
make -j 8
sudo make install
OpenOCD install path: /usr/local/share/openocd/scripts/
Start debug:
$ openocd -f interface/stlink-v2.cfg -f target/stm32f1x.cfg
Open On-Chip Debugger 0.10.0 (2025-04-04-01:17)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
none separate
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : clock speed 950 kHz
Info : STLINK v2 JTAG v17 API v2 SWIM v4 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.316364
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints