Closed mzhboy closed 3 years ago
I'm sorry, it's not a STM32duino-bootloader issue but a rogerclarkmelbourne/Arduino_STM32 issue, it sseems that swd pins were disabled by Arduino_STM32 framework. stm32duino/Arduino_Core_STM32 has no problem with st-link.
I jsut found out the code to disable debug pins
la:~/stm32# cd Arduino_STM32/;grep -R disableDebugPorts STM32F1/cores/maple/stm32f1/wirish_debug.cpp:void disableDebugPorts(void) { STM32F1/cores/maple/wirish_debug.h:void disableDebugPorts(void); STM32F1/cores/maple/wirish_debug.h: @.see disableDebugPorts() STM32F1/variants/generic_stm32f103t/board.cpp: disableDebugPorts(); STM32F1/variants/generic_stm32f103c/board.cpp: disableDebugPorts(); STM32F1/variants/hytiny_stm32f103t/board.cpp: disableDebugPorts(); STM32F1/variants/STM32VLD/board.cpp: disableDebugPorts(); STM32F1/variants/generic_stm32f103r8/board.cpp: disableDebugPorts(); STM32F1/variants/generic_stm32f103vb/board.cpp: disableDebugPorts(); STM32F1/variants/generic_gd32f103c/board.cpp: disableDebugPorts(); STM32F1/variants/microduino/board.cpp: disableDebugPorts(); STM32F1/variants/maple_mini/board.cpp: disableDebugPorts(); STM32F4/cores/maple/wirish_debug.h:static inline void disableDebugPorts(void) { STM32F4/cores/maple/wirish_debug.h: * @.see disableDebugPorts()
enable SWD ports by define CONFIG_MAPLE_MINI_NO_DISABLE_DEBUG
I'm new to arduino. I was trying different upload methods to bluepill board(stm32f108c8t6) on windows. This bootloader works fine, however it was failed when I tried uploading with st-link/v2(clone, mini board). So I did some investigation.
The st-link is fine because the bootloader was uploaded by st-link utility. Then I tried connect nRST pin to st-link and change resetmode to Hardware Reset in STM32 ST-LINK Utility, disconnect usb and then click "connect to the target" button. It failed connect to target.
Then I tried every combination of "mode" and "reset mode", all failed. I was depressed because I thought this board was bricked.
Any way, I didn't give up and did found out the proper procedures to connect mcu.
STM32_HID_Bootloader has no problem except had to reconnect usb so that Windows can recognize device.
I tried inspect code but grep didn't find any code that disable swd/jatg pins.