April 30, 2025

STM32H743 Nucleo board -- diagnostic firmware

It is now 2025. 5 years after I received this board I am getting back to doing things with it.

Before trying to load and run any of my own software, I wanted to see if there was any software resident in the board in its "as shipped" configuration.
It turns out there is!

I find a micro-USB cable, and plug it in. This powers the board just fine (a jumper selectes ST-Link for power). It sets up 3 USB devices:

Apr 30 12:17:43 trona kernel: usb 4-1.6: New USB device found, idVendor=0483, idProduct=374e, bcdDevice= 1.00
Apr 30 12:17:43 trona kernel: usb 4-1.6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Apr 30 12:17:43 trona kernel: usb 4-1.6: Product: ST-LINK/V3
Apr 30 12:17:43 trona kernel: usb 4-1.6: Manufacturer: STMicroelectronics
Apr 30 12:17:43 trona kernel: usb-storage 4-1.6:1.1: USB Mass Storage device detected
Apr 30 12:17:43 trona kernel: cdc_acm 4-1.6:1.2: ttyACM0: USB ACM device
I have peeked at the USB storage already and there is nothing particularly interesting there.
The red LED "User LED 3" is blinking rapidly.
I connect to /dev/ttyACM0 and see the following message rapidly repeated (and in a red font):
Toggle every  100 ms led3 red
I press reset and see:
MB1364 H743ZI V2.01

Demo started:
Press user button to change the toggle
Toggle every  100 ms led3 red
Toggle every  500 ms led2 orange
Toggle every 1000 ms led1 green
Let's Go
Indeed, when I press the blue "USER" button, it changes both which LED is blinking and the message which is endlessly displayed.

Read out this firmware

I connect to ST-Link using OpenOCD:
openocd -f /usr/share/openocd/scripts/interface/stlink.cfg -f /usr/share/openocd/scripts/target/stm32h7x.cfg
Open On-Chip Debugger 0.12.0
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1800 kHz
Info : STLINK V3J2M1 (API v3) VID:PID 0483:374E
Info : Target voltage: 3.285141
Info : [stm32h7x.cpu0] Cortex-M7 r1p1 processor detected
Info : [stm32h7x.cpu0] target has 8 breakpoints, 4 watchpoints
I use another terminal window to run "telnet localhost 4444", then type:
dump_image demo.bin 0x08000000 0x200000
I have a little C program "imsizer.c" that examines this file, looking at 64K blocks and reporting which are simply an unprogrammed block of all 0xff bytes. It shows me that only the first 3 of these blocks have actual content (192K), so I do:
mv demo.bin demo.orig
dd if=demo.orig of=demo.bin bs=64k count=3
rm demo.orig
Rather than keeping a 2M file around, I reduce it down to 192K, then I use my program "wrap.c" and enclose this in an ELF file so I can disassemble it.
Feedback? Questions? Drop me a line!

Tom's Computer Info / tom@mmto.org