Showing results for 
Search instead for 
Did you mean: 

Program won't run after upload

Associate III

I have designed my own PCB and I have the problem that while the code uploads successfully, it doesn't run.Qwyntex_0-1716384046463.png

I have checked NRST and BOOT0 and both should not be the problem. I have found a similar issue where the chip didn't get a clock signal and therefor was stuck. I have used the debugger to step through the code and it went past HAL_Init but I never come past SystemClock_Config, when trying to step into it the debugger throws 'Cannot find bounds of current function'. I am new to designing PCBs and I don't really know where to go from here or what the issue could be.

It is not the debugger itself as I can run the blinking sketch with no problems on a dev board that I have bought, which is why I have attached the schematic. I can also provide the PCB layout but I think it is much more likely that I made a basic mistake than that the layout is the culprit.

Thank you


please try to enable clock security and try..  Looks like there are inputs coming from other sources, you can try to remove them and try the code. Is it forcing the pins to some higher voltages? Check for any shorts in the pcb

Is your added VCAP electrolytic? If yes is you connection polarity right or better change to ...?



Associate III

I have literally no idea what I changed but it's working now. I was trying to get printf to output to the debugger console and have changed a few things, including in the debugger I enabled SWV but that's pretty much it. (On my computer if I scroll over a dropdown I can change its value so maybe that happened by accident? But why did it then work on the dev board?), maybe that was it, I really don't know. There was also an update for the debugger but it didn't work immediately after that and it has worked on the dev board before that so I can't really imagine that being the fix.
Weirdly, now it works with my other debug configuration, too, and I haven't changed anything there.
I am very confused.

At least it works now.

For anybody wondering, the LED works fine. It surely isn't good to have it on PC13 but it isn't killing the chip (as of now). So if anybody made the same mistake and put it there with a comparatively low resistor l it'll probably be ok.

To answer the few remaining questions that I tested before it suddenly worked:

enabling css didn't change anything as far as I can tell. I haven't tested for higher voltages but I haven't found any shorts on the PCB (and now that it works that means there probably aren't any).

The capacitor I added is electrolytic but I have triple checked before soldering it on that I have connected it correctly. I didn't have any ceramic capacitors of that size.


Thank you all so much for trying to help me get this to work, it's just a little sad I can't tell you what was actually wrong.
I will accept the the first reply by Peter as the solution because they fixed the original problem and there isn't really a solution here for the other one. (though it seems a little wrong as the other three pages were about the second problem)

Thank you, again, and I am sorry I didn't really figure out what the problem was