2018-07-13 02:14 AM
ATM I have to build the hex file then use STM ST-Link utility to flash the file to the MCU.
If I try to flash from within system workbench the if fails this also means that I can't use debugger.
Has anyone else had this problem or know the solution to it??
here is the output from systemwork bench when trying to flash
19:04:19 **** Programming project SD5 on chip ****
'C:\\Ac6\\SystemWorkbench\\plugins\\fr.ac6.mcu.externaltools.openocd.win32_1.17.0.201801121207\\tools\\openocd\\bin\\openocd.exe' -f stm32.flash.4259900286939563601.cfg -s 'C:\\data\\SD5' -s 'C:\\Ac6\\SystemWorkbench\\plugins\\fr.ac6.mcu.debug_2.1.4.201801121207\\resources\\openocd\\st_scripts' -c 'program Debug/SD5.elf verify exit' Open On-Chip Debugger 0.10.0-dev-00007-g58350bc-dirty (2018-01-12-12:21)Licensed under GNU GPL v2For bug reports, read
https://community.st.com/external-link.jspa?url=http%3A%2F%2Fopenocd.org%2Fdoc%2Fdoxygen%2Fbugs.html
srst_only separate srst_nogate srst_open_drain connect_assert_srstInfo : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWDadapter_nsrst_delay: 100adapter speed: 1800 kHzInfo : clock speed 1800 kHzInfo : STLINK v2 JTAG v17 API v2 SWIM v4 VID 0x0483 PID 0x3748Info : vid/pid are not identical: 0x0483/0x374B 0x0483/0x3748Info : using stlink api v2Info : Target voltage: 3.241579Info : STM32F407VETx.cpu: hardware has 6 breakpoints, 4 watchpointsadapter speed: 1800 kHzError: timed out while waiting for target haltedTARGET: STM32F407VETx.cpu - Not haltedin procedure 'program' in procedure 'reset' called at file 'embedded:startup.tcl', line 490in procedure 'ocd_bouncer'** Unable to reset target **shutdown command invoked2018-07-14 02:23 AM
OK after 3 days of googling I have found the problem and the solution.
The problem is the cheap Aliexpress st-link doesn't have the RST pin connected, it is on the st link but it isn't connected so when system work bench tries to do a hardware reset it can't.
The solution is in debug configurations under debug tab press show generator options then under reset mode choose software reset then the work bench will use a software reset using SWDIO pin instead of a hardware reset using RST pin.