Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
Support requests without the output above may be impossible to answer, so please help us to help you
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Attempting to debug STMF103, Please Help (Read 146 times)
Indrid kold
Junior Member
**
Offline



Posts: 15
Attempting to debug STMF103, Please Help
Nov 25th, 2019 at 7:24pm
 
Hello, I'm desperately trying to debug an STM32F103. I have tried...
1) The Official ST-Link/v2 connected to 4 out of the 20 JTAG pins. Not recognized by ST-Link application, although I could update the ST-Link firmware.
2) A Nucleo0F103RB board. I could connect and debug a simple 'Blink' application using the built-in STLink V2-1. I then loaded my much larger program and although a debug session appeared to start, I could not set breakpoints.
3) An ST-Link V2 'mini' debugger (one of the many knockoff brands). I "Could not start a debug session', nor did the ST-Link utility see this debugger.

I'm using the dan.drown STM32Duino bootloader and upload method.

I'm not sure if I need a Zadiq driver, I don't know what that is and the Zadiq application gives no information. Should the Zadiq appication see a device if one is plugged in? It's just blank when I run it. Not sure which of the 4 drivers I should install.

I'm happy to purchase a preferred debug setup if you can recommend one. Any help appreciated with any of the 3 scenarios described above. My preferred setup would allow me to debug an STM32F103C8 (128K) on a BluePill dev board. Thanks for any assistance, IK
Back to top
 
 
IP Logged
 
Simon Hopkinson
Administrator
*****
Offline



Posts: 63
Re: Attempting to debug STMF103, Please Help
Reply #1 - Nov 26th, 2019 at 10:05am
 
The Zadig driver is required to allow the software used with the debugger to find and connect to it.

When you run the software it will be blank, until you click the "Options > List All Devices", then you should see all USB Devices connected, and relevant STLink device to update the driver for.

2) If you can debug Blink then you should be able to debug other applications.  Is the Debugger Optimisation set to "No Project + Library"?

3) This may show as a different VID/PID in Device Manager to what the STLink / STLink v2.1 configurations are expecting
(Device > Properties > Details > Hardware Id)

When you start debugging there is a log created in the compilation folder "SketchName.ino_DebugOpenOCD.log" which will have further detail in when you encounter issues.    This can also be seen in the Debug Output window in the commands being run when you start to debug.
Back to top
 
 
IP Logged
 
Indrid kold
Junior Member
**
Offline



Posts: 15
Re: Attempting to debug STMF103, Please Help
Reply #2 - Nov 26th, 2019 at 1:48pm
 
Thanks for your response, I'm focusing on trying to get the 'STLink v2 (External)' working. I updated the driver via Zadiq, from v2.1 to v6.1... A screenshot is attached as this shows the USB ID as USB\VID_0483&PID_3748. Also attached is the debug output log which shows a matching STLink target. The location of gdb.exe seems correct, I can run the debug command line and GDB starts, but cannot connect. The program uploads correctly via the USBBootloader. The STLink V2 does appear in the device manager list of USB Devices. The Debug menu is set to 'No Project + Libraries Optimization' and my solution config is set to 'Release'. Still cannot connect. My boot jumpers for the bluepill board are both set to zero. Thanks again, IK
Back to top
 
 
IP Logged
 
Indrid kold
Junior Member
**
Offline



Posts: 15
Re: Attempting to debug STMF103, Please Help
Reply #3 - Dec 3rd, 2019 at 7:05pm
 
Further info... I believe the USB Bootloader (rogerclarke PC13 version) is interfering with the ST-LINK. With a stock bluepill and UploadMethod=STLink, Debug:Hardware=Stlink V2 (External) I can upload and debug Blink. I have not tried to verify (in sourcecode) if there is a conflict between the debug pins and any assignments made by the bootloader. If I try the same using a USB bootloader bluepill I cannot establish a debug session or upload a sketch or connect using the ST-Link utility. Any input appreciated, thanks.
Back to top
 
 
IP Logged
 
Simon Hopkinson
Administrator
*****
Offline



Posts: 63
Re: Attempting to debug STMF103, Please Help
Reply #4 - Dec 4th, 2019 at 1:31am
 
Thanks for the additional information, I have updated one of my boards to the same maple bootloader and have the problem.

I have been able to debug this board using the Black Magic Probe (which I believe can also be made from a blue pill), and had to hold the reset button whilst connecting the debugger in VMicro, then release it once it was trying to connect.

I will update if I have any other progress or ideas, and not sure if the CMSIS element of the bootloader is the issue (it would make sense and the BMP supports debug and upload)
Back to top
 
 
IP Logged
 
Indrid kold
Junior Member
**
Offline



Posts: 15
Re: Attempting to debug STMF103, Please Help
Reply #5 - Dec 4th, 2019 at 6:40pm
 
Hello and thanks for the update. I have a Black Magic Probe and will give it a try. For the upload method, did you select 'BMP (Black Magic Probe)' or 'Black Magic + GDB (vMicro)'? Thanks again, IK
Back to top
 
 
IP Logged
 
Simon Hopkinson
Administrator
*****
Offline



Posts: 63
Re: Attempting to debug STMF103, Please Help
Reply #6 - Yesterday at 7:37am
 
No problem, I just uploaded via the USB as it had that bootloader on.

I see no reason the BMP wouldn't work for upload, the 'Black Magic + GDB (vMicro)' will use the same configuration as the debugger so I would recommend using this one.
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print