March 6, 2025

STM32F429 Discovery Kit - Hung after Hydra boot

The world is full of surprises.

I am now typing "make flash" (which has worked fine several times up to now) and cannot download code to the board. The question often arises, "what did you do last?". The last thing I did was to boot Hydra several times. The last time I was trying to see if I could get any respose from the HS usb controller.

My last download is in flash and running (I can use picocomm to see serial messages at 38400 baud, and they are the expected messages from Hydra). The last thing my code does is to enter an idle loop which will call the "wfi" instruction in an endless loop.

I start openocd and use the telnet connection. When I try "halt" I get the message:

Target not examined yet
Looking at the startup messages more closely, I see this:
Warn : target stm32f4x.cpu examination failed
I do get this warning (but did back when things were working also) --
WARNING: interface/stlink-v2.cfg is deprecated, please switch to interface/stlink.cfg
I make this change and get the same trouble. This is openocd 0.12.0, and the executable has a timestamp from November, 2023. So it is over a year old. My concern was that a recent update had caused my trouble. This worked just yesterday. The scripts are even older (January, 2023) -- so I am not getting bitten by a recent update.

I even installed all the recent (pending) updates on my linux machine (running Fedora 41) and booted to the new kernel. No change.

I plug in a F411 "black pill" and it works just fine. So, the problem must be with the F429 discovery board. Note that uses an entirely different ST-Link dongle/adapter.

I go back to the Discovery board, unplug it and plug it in anew. I see the usual USB chatter:

Mar  6 17:17:04 trona kernel: usb 2-1.1: new full-speed USB device number 16 using ehci-pci
Mar  6 17:17:04 trona kernel: usb 2-1.1: New USB device found, idVendor=0483, idProduct=374b, bcdDevice= 1.00
Mar  6 17:17:04 trona kernel: usb 2-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Mar  6 17:17:04 trona kernel: usb 2-1.1: Product: STM32 STLink
Mar  6 17:17:04 trona kernel: usb 2-1.1: Manufacturer: STMicroelectronics
Mar  6 17:17:04 trona kernel: usb 2-1.1: SerialNumber: 066BFF545052836687101947
Mar  6 17:17:04 trona kernel: usb-storage 2-1.1:1.1: USB Mass Storage device detected
Mar  6 17:17:04 trona kernel: scsi host10: usb-storage 2-1.1:1.1
Mar  6 17:17:04 trona kernel: cdc_acm 2-1.1:1.2: ttyACM0: USB ACM device
Indeed, ttyACM0 works as expected, I can connect to it using:
picocom -b 38400 /dev/ttyACM0
OpenOCD 0.12.0 is the latest version, release in March of 2023.

Conclusions

The next thing to do is to start digging into the openocd scripts and try to figure out just what it is trying to do to "examine the target". Also find out where this message comes from and why:

Warn : target stm32f4x.cpu examination failed
The F103 is running fine (more or less, it does USB enumeration just fine and sets up the ACM serial port and the mass storage device and enumerates as the ST-Link device.

The F429 is happy running the last Hydra code I loaded into it, sending messages to the serial port.

So I am optimistic that this can all be set right, but see the next page for my decision about what I will do.


Feedback? Questions? Drop me a line!

Tom's Computer Info / tom@mmto.org