2025-02-03 07:15 AM
Hello all,
I made my first "from scratch" STM32 board (in the past I always used demo boards).
I cabled JTAG connector : I was able to flash and debug from CubeIDE in SWD mode with a Stlinkv2, but did not succeed in JTAG mode, don't know why but it is not my today's topic. Works ok for what I did at the time. I used the internal clock (HSI RC) and my application worked well.
Then I wanted to add USB, so I had to use an HSE clock (it seems the HSI RC is not stable enougth). i added external quartz (ABLS 8 MHz with two 33pf capacitors), changed the clocking configuration from the Cube assistant, regenerated the code, then flashed. Now the chip is nor more accessible, it does not boot, and I can't flash it, even if I change the clocking setup to HSI RC again.
I have two questions :
- is there a way to get my board STM32F303 flashed again or is it dead ?
- Is there a way to make some electrical diagnostics ?
Here follows how I cabled the quartz.
Best regards,
Mikhaël
2025-02-03 07:44 AM
I don't think the crystal is your problem,
1. If HSE doesn't start it falls back to HSI,
2. Memory programming clock is always HSI.
I guess there's something else wrong in your code.
Try to hold NRST down and release it if the programmer starts to connect.
2025-02-03 07:48 AM
BTW, what's that Voltage divider on Boot0?
Pulling it down by a small R and decoupling it with 10n to GND should be the way to go
2025-02-04 02:56 AM
Here is an improved version of your text in English:
Hello jgnoss,
Thank you very much for your help.
First, regarding the voltage divider: When I created the PCB, I wasn't entirely sure about everything, so I added components for testing purposes. What you interpreted as a voltage divider is not actually a voltage divider; it's simply a method for me to choose whether to pull up or pull down boot0, depending on which resistor I solder.
As for the issue I encountered, I have solved it. I didn't realize that the crystal oscillator amplifier is biased through the analog bias pins of the STM32. Since I was still testing, my design includes two separate regulators—one for the digital section and one for the analog section. It was to test noise, and avoid to make a PCB only for this kind of test. However, I hadn't wired the analog part, because my current application does not require analog features. At this point, I simply added a jumper between the analog and digital bias, and that solved the problem.
Can you confirm this: By default, an STM32 Off-The-Shelf starts in HSI mode. If I switch to HSE mode via code and no external oscillator is connected or biased, the chip becomes stuck and can no longer be flashed (unless the missing components are added)? Additionally, since I'm new to JTAG, etc., do JTAG or SWIO not provide a clock during the flashing process? I guess no, but if you can confirm. ...
Best Regards,
Mikhaël