cancel
Showing results for 
Search instead for 
Did you mean: 

Assistance with Debugger Issue

GEvan.1
Associate

Hi all, I've been battling a frustrating issue on my STM32F407 Discovery board for the past few days. I don't know where the fault lies exactly but hopefully if I explain someone can point it out.

I'm working on a robotics project, not doing anything too fancy... I am using the STM32F4 to control 4 PWM signals to the wheels, and 2 PWM signals to two separate servo's. I'm also using input capture direct to capture signals from the transmitter/receiver. Files are generated using an up to date version of CubeMX, and I'm using the VisualGDB plugin for Visual studio.

Here's the fun part...my code/functionality all works perfectly well when connected to the PC via USB. The problem comes when I boot up the board without the USB debugger attached, or if I hit the reset button while the debugger is still attached.

I have my STM32 hooked up to an external power source (5V pin). In order to get the code to work properly without being attached to the PC, I have to flash the code and then unplug the USB to almost trick the board that the debugger is still attached. Very annoying.

One thing I've noticed is that when I hit the hardware reset button with the debugger still attached, my PWM signals seem to be a lot lower than usual. Clock issue? I've ruled out a power issue, because it still happens when booting up via the same usb port (with no debugging).

My question to anyone more experienced than me is: When I flash my code to the board via USB, is something being activating/triggered that my code is somehow dependant on? is this a common problem?

Any pointers would be massively appreciated, this issue is very frustrating.

Cheers

1 REPLY 1

Check the version of ST-LINK/V2 firmware, there was a version around 25 or 26 that held devices in reset.

For clocking, check that it starts the HSE (BYPASS) and PLL properly, and doesn't drop thru that code with an error/failure leaving the clock at 16 MHz (HSI)

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..