2025-05-06 12:24 PM
I have a custom board with an STM32H747XI with BOOT0 tied to 0. I want to jump to the bootloader from my application so that I can perform a USB DFU. The USB works correctly. I have a terminal app that I use to connect to the VCP. If I send a specific command, the embedded side will set a variable in a NOINIT section, call USBD_DeInit on the FS and HS devces, then call NVIC_SystemReset. In main before bringing up any hardware, I check the NOINIT variable for the specific pattern, if it is set, I clear it to 0 and then call the JumpToBootloader function from this post:
I've left that code as is. Upon executing, my VCP device goes away and is replaced by a device that is labeled as:
Unknown USB Device (Device Descriptor Request Failed)
Running wireshark confirms that the descriptor packets are never seen. If I break in with the debugger, it is executing in the area that "should" be the bootloader. Usually around 0x1FF0Axxx. Matching what AN2606 says, PA11 goes to DM and PA12 goes to DP.
How can I debug this further?
Thanks,
C-Coder
2025-05-06 2:03 PM
Update: Duh. I forgot that we have two ports on this new board and the one I use for everything is connected to the HS device, and of course the DFU uses the FS device. Plugging in my other port I do see a device labeled as "DFU in FS Mode." I'll see if I can use one of the tools for uploading a new image to the device and make sure it works. If so, I'll mark this thread as solved.
C-Coder
2025-05-07 6:18 AM
I ended up trying STM32CubeProgrammer for writing to the DFU device. I was able to get it to write my ELF files to each of the cores locations in flash, although on each attempt, it did try writing to another address and failed. Rebooting the device though proved that the writing of the ELF files worked. I see a lot of old documentation on DFuSe and some DFU File Manager but nothing current. What is the current method for generating DFU files?
C-Coder
2025-05-07 11:33 AM - edited 2025-05-07 11:38 AM
> although on each attempt, it did try writing to another address and failed.
?? Can you post the log, please? To which address did it wrote?
Looks like CubeProgrammer has some bugs with dual core H7, as in this thread.
2025-05-07 1:19 PM
14:16:19 : UR connection mode is defined with the HWrst reset mode
14:16:21 : USB speed : Full Speed (12MBit/s)
14:16:21 : Manuf. ID : STMicroelectronics
14:16:21 : Product ID : DFU in FS Mode
14:16:21 : SN : 200364500000
14:16:21 : DFU protocol: 1.1
14:16:21 : Board : --
14:16:21 : Device ID : 0x0450
14:16:21 : UPLOADING OPTION BYTES DATA ...
14:16:21 : Bank : 0x00
14:16:21 : Address : 0x5200201c
14:16:21 : Size : 308 Bytes
14:16:21 : UPLOADING ...
14:16:21 : Size : 1024 Bytes
14:16:21 : Address : 0x8000000
14:16:21 : Read progress:
14:16:21 : Data read successfully
14:16:21 : Time elapsed during the read operation is: 00:00:00.005
14:16:34 : Opening and parsing file: VS5_FW_CM7.hex
14:16:34 : Memory Programming ...
14:16:34 : File : VS5_FW_CM7.hex
14:16:34 : Size : 55.74 KB
14:16:34 : Address : 0x08000000
14:16:34 : Erasing memory corresponding to segment 0:
14:16:34 : Erasing internal memory sector 0
14:16:35 : Erasing memory corresponding to segment 1:
14:16:35 : Not flash Memory : No erase done
14:16:35 : Download in Progress:
14:16:36 : Error: failed to download Segment[1]
14:16:36 : Error: failed to download the File
Maybe the Segment[1] failure is expected?