2020-10-15 10:03 AM
Hi!
I am using STM32F373RCT6 controller on custom board. In that board we have used USB to serial convertere chip FT2232HL-REEL and it is connected to USART1 (PA9 and PA10).
STM32F373RCT6 system clock frequency is 70MHz.
Can I use USB to serial option to debug the code instead of ST Link V2? If Yes, how?
I want to flash the code through USB in our project.
If any other details required, please let me know.
Regards,
Gaurav
2020-10-15 10:18 AM
> Can I use USB to serial option to debug the code instead of ST Link V2? If Yes, how?
The SWD protocol doesn't work over UART, so you can't just have STM32CubeIDE or another IDE use UART instead of the SWD connection.
You can debug your code though UART, but you will need to implement that functionality yourself. A common method is to have printf statements get output over UART and read in on a console. You can use that information to figure out what the chip is doing. This method of debugging is going to be much slower than if you were to connect over SWD in order to inspect variables and registers at will.
2020-10-15 10:30 AM
With BOOT0 HIGH you should be able to reset into the System Loader and use the COM/USART update method in STM32 Cube Programmer
People have moved away from target hosted debugging, best you can probably do is telemetry and diagnostic output, and create a little debug monitor/console to test your own routines.
Pity you didn't provide yourself a means to get to SWDIO/SWCLK/SWO pins, test points or edge connector to do JTAG/SWD properly. If you really need to step your code to understand it, perhaps build a proxy for your board with suitable access.
2020-10-15 11:48 PM
I've been debugging/programming my STM boards/software via the uart (and stepping through code segments with the simulator) for the last ten years - but I don't have a project manager breathing down my neck, so I can take my time.... I just print diagnostics (via the uart), toggle pins etc. to debug when needed. The simulator is crucial to this method though.
2020-10-17 03:50 AM
Thanks for your reply.
2020-10-17 05:29 AM
I grew up with DDT and SID, and my super-boss was always fascinated that I didn't need a symbolic debugger, or ICE, to figure out what his code and mine actually did..
2020-10-18 11:43 PM
...yep, there is a Zen about good debugging. I haven't had the luxury of an ICE since the early 1990's... but I do wish a had a few clones of myself so that I can get some of my half finished projects finished :)