2022-10-07 11:04 AM
I've got a strange problem. My custom-built board has SWD problems after cold reset with my code. I don't think that my code is directly responsible for altering the SWD interface.
I'm using an in-house SWD probe that has a long history. JTAG/SWD are my areas of professional expertise. When SWD fails, I mean that SWD initialization fails at the lowest level - the SWD interface doesn't respond to the initial SWD probes.
Heres what I know:
My best guess is that something is going wrong with the DAPCLK. My code is already using SRAM4, so I know that D3 is powered up.
My board is modeled on the STM32H725 dev board, although I'm actually using a STM32H735. I'm using the oscillator and clock config from that project. I get the same results with the auto-generated clock config from the STMCube utility.
2022-10-07 11:11 AM
Added: I've also checked the DBGMCU registers. They are the same in both cases.
2022-10-07 11:30 AM
There don't appear to be any applicable RCC registers.
2022-10-07 11:59 AM
Also: JNRST is in Alternate mode #0, so hooked up. I can ground it and see the IO change. It has no effect on the state of SWD.
2022-10-09 05:55 AM
Everything points to your code just failing at initialization. Most likely some issue with configuration of clocks, buses or FLASH. And yes, HAL/CubeMX code is a broken bloatware.