Discovered the board I had didn't have the original firmware on it, so I needed to download and install the original demonstration firmware.
It seems this can be found in a file named
The file is
STM32Cube_FW_F7_V1.3.0/Projects/STM32746G-Discovery/Demonstration/Binaries/STM32746G-DISCO_Demo_V1.1.0.hex which I found in a couple of places on the web.
Also, the demonstration code and process for uploading (with the official ST-Link Utility for Windows, at least) is described in
It appears that the non-code portion of the board was still intact, so I was able to just write the code portion.
.hex file has two ranges of memory in it and are offset from 0, which means converting from
.bin creates stupidly large files. (And the FLOSS
stlink project doesn't support
So, after much fluffing around I installed
Srecord (which has sub-optimal documentation and UI) and managed to extract the two regions separately and convert the first one to a
srec_cat STM32746G-DISCO_Demo_V1.1.0.hex --Intel -crop 0x08000000 0x90000000 -o STM32746G-DISCO_Demo_V1.1.0--crop-part1.hex --Intel
srec_cat STM32746G-DISCO_Demo_V1.1.0--crop-part1.hex --Intel -offset - -minimum-addr STM32746G-DISCO_Demo_V1.1.0--crop-part1.hex --Intel -o STM32746G-DISCO_Demo_V1.1.0--crop-part1.bin -binary
It may not actually require two separate steps but I couldn't get the
-offset flag to work correctly when I first tried to only use one command and had better things to do.
To upload the firmware I used (assuming you have a recent enough version of
stlink, I used
homebrew to install 1.2.0 it seems):
st-flash write STM32746G-DISCO_Demo_V1.1.0--crop-part1.bin 0x8000000
I also extracted the second memory range but didn't upload it because it seemed to be intact from the original installation:
srec_cat STM32746G-DISCO_Demo_V1.1.0.hex --Intel -crop 0x90000000 0x9fffffff -o STM32746G-DISCO_Demo_V1.1.0--crop-part2.hex --Intel
srec_cat STM32746G-DISCO_Demo_V1.1.0--crop-part2.hex --Intel -offset - -minimum-addr STM32746G-DISCO_Demo_V1.1.0--crop-part2.hex --Intel -o STM32746G-DISCO_Demo_V1.1.0--crop-part2.bin -binary