2025-10-16 4:18 AM
Hello,
I have developed a custom board using the STM32MP157DAC1. The pin layout is nearly identical to the STM32MP157-DK2 for all pins with the same name.
I am trying to flash an SD card image using STM32CubeProgrammer, but I'm facing two critical issues.
1. USB Device Not Recognized
My primary issue is that the USB connection is not recognized by my PC at all when I try to connect in DFU mode. I cannot get any response from the device over USB.
I have attached a schematic of my USB circuit. Please note that I initially had an error where the DP and DM lines were crossed, but this has since been corrected on the board. Despite the fix, the USB port remains unresponsive.
2. UART Flashing Fails with Timeout Error
As a workaround, I attempted to flash the image via UART. The process starts, and the first stage bootloader (tf-a- ... .stm32) appears to download successfully. However, the process then fails with multiple timeout errors when trying to get the next phase.
Here is the log from STM32CubeProgrammer:
18:58:28 : Read TSV File: C:\temp\flashlayout_st-image-core\optee\FlashLayout_sdcard_stm32mp157d-dk1-optee.tsv 18:58:28 : Number of partitions: 13 18:58:33 : RTS low 18:58:33 : DTR Low 18:58:33 : Serial Port COM10 is successfully opened. 18:58:33 : Port configuration: parity = even, baudrate = 115200, data-bit = 8, stop-bit = 1.0, flow-control = off 18:58:34 : Activating device: OK 18:58:34 : Board : -- 18:58:34 : Chip ID: 0x500 18:58:34 : BootLoader protocol version: 4.0 18:58:35 : Start Embedded Flashing service 18:58:36 : Opening and parsing file: tf-a-stm32mp157d-dk1-optee-programmer-usb.stm32 18:58:36 : Memory Programming ... 18:58:36 : File : tf-a-stm32mp157d-dk1-optee-programmer-usb.stm32 18:58:36 : Size : 220.41 KB 18:58:36 : Partition ID : 0x01 18:58:36 : Download in Progress: 18:59:32 : File download complete 18:59:32 : Time elapsed during download operation: 00:00:56.471 18:59:32 : RUNNING Program ... 18:59:32 : PartID: :0x01 18:59:32 : Start operation done successfully at partition 0x01 19:00:04 : Timeout error occured while waiting for acknowledgement. 19:00:35 : Timeout error occured while waiting for acknowledgement. 19:01:06 : Timeout error occured while waiting for acknowledgement. 19:01:37 : Timeout error occured while waiting for acknowledgement. 19:02:08 : Timeout error occured while waiting for acknowledgement. 19:02:08 : Error: GetPhase command not acknowledged after several retries! 19:02:08 : Error: Parition 0xBB not found in TSV File 19:02:08 : Error: TSV flashing service failed 19:02:08 : Disconnected from device.
Could you please provide some guidance on the following questions?
What could be the potential reasons for the USB interface not being detected by the PC, even after fixing the DP/DM lines?
Why might the UART programming be failing with a "GetPhase command not acknowledged" error after the initial TF-A file is downloaded?
Any help or suggestions would be greatly appreciated.
Thank you.
Solved! Go to Solution.
2025-10-21 2:05 AM
Hi @mittyan321
I can only repeat to check any differences on schematics you could have between your custom board and the STM32MP157F-DK2 (of STM32MP157D-DK1).
VDD3V3_USBHS, VDDA1V1_REG as well as VDDA1V8_REG should be present (and BYPASS_REG1V8 grounded).
Check possible noise/spurs on all supplies and/or unexpected power sequence (bad component choice around STPMI1A could have dramatic results).
Check if correction of DP/DM swap is ok.
Check DP/DM continuity on the PCB.
Remove all USB protection devices.
Regards.
2025-10-17 4:30 AM
Hi,
I assume you use STPMIC1A with same supply schema than STM32MP157-DK2.
Did you check various supply presence (especially USB ones) ?
Did you try using a Type-A cable on PC side ?
Maybe there is an issue around CC lines pull-down not detected by the Host (so, using a Type-A cable make this not needed).
Regarding TF-A which potentially crash when loaded by UART, as you use the dk1 starter package, did you also use a 24MHz oscillator like the STM32MP157-DK2 board (using a crystal need to change DTS and rebuild the image) ?
Regards.
2025-10-20 5:32 PM
Hi ,
Thank you for your valuable suggestions.
Here are my answers to your questions:
I assume you use STPMIC1A with same supply schema than STM32MP157-DK2.
Yes, we are using the STPMIC1A.
Did you check various supply presence (especially USB ones) ?
Yes, I have confirmed that VDD_USB (3.3V) is being supplied from the STPMIC1A.
Did you try using a Type-A cable on PC side ? Maybe there is an issue around CC lines pull-down not detected by the Host (so, using a Type-A cable make this not needed).
I tried connecting with a USB Type-A cable, but the result was the same. The PC now detects the device as "Unknown USB Device (Port Reset Failed)".
Regarding TF-A which potentially crash when loaded by UART, as you use the dk1 starter package, did you also use a 24MHz oscillator like the STM32MP157-DK2 board (using a crystal need to change DTS and rebuild the image) ?
Yes, we are using an equivalent circuit with a 24MHz oscillator, similar to the DK2 board.
Given this, do you think the USB problem could be related to the PCB layout/pattern?
Regards,
2025-10-20 11:32 PM
Hi,
unlikely that bad PCB layout (i.e. trace impedance or else) could create such issue.
Did you check the 24MHz external oscillator is providing correct digital clock frequency / amplitude and also that OSC_OUT = VSS (for digital bypass detection by bootrom)?
More generally, did you look to AN5031 ?
Worth also to check the ROM traces to see if any issues (e.g. boot pins, HSE frequency detection, etc...):
https://wiki.st.com/stm32mpu/wiki/STM32_MPU_ROM_trace_analyzer#ROM_trace_analysis_procedure
Regards
2025-10-21 1:30 AM
Hi ,
Thank you for the additional advice.
Here are my responses:
Did you check the 24MHz external oscillator is providing correct digital clock frequency / amplitude and also that OSC_OUT = VSS (for digital bypass detection by bootrom)?
I have confirmed that the 24MHz oscillator is outputting the correct frequency. The OSC_OUT pin is pulled down to VSS with a 1kΩ resistor.
More generally, did you look to AN5031 ?
Yes, I did refer to AN5031 while designing the board.
Worth also to check the ROM traces to see if any issues (e.g. boot pins, HSE frequency detection, etc...):
I have tried the ROM trace analyzer. The output was identical to the trace from the STM32MP157-DK2 board.
The fact that the ROM trace is identical to the STM32MP157-DK2 makes this issue very confusing.
Given that Windows detects a device but reports an "Unknown USB Device (Port Reset Failed)" error, what could be the potential causes for the DFU port not being recognized correctly at this stage? We are trying to understand what could go wrong between a successful ROM trace and a failed USB enumeration.
Any further ideas would be greatly appreciated.
Regards,
2025-10-21 2:05 AM
Hi @mittyan321
I can only repeat to check any differences on schematics you could have between your custom board and the STM32MP157F-DK2 (of STM32MP157D-DK1).
VDD3V3_USBHS, VDDA1V1_REG as well as VDDA1V8_REG should be present (and BYPASS_REG1V8 grounded).
Check possible noise/spurs on all supplies and/or unexpected power sequence (bad component choice around STPMI1A could have dramatic results).
Check if correction of DP/DM swap is ok.
Check DP/DM continuity on the PCB.
Remove all USB protection devices.
Regards.
2025-10-21 6:16 PM
Hi ,
Thank you for all your dedicated support. I'm happy to report that I have finally solved the problem.
It turns out the root cause was a faulty capacitor connected to the VDDA1V1_REG pin.
After I replaced that capacitor, the USB is now properly recognized by my PC.
Your advice to carefully check all the power supply lines was the key to discovering this issue. Thank you again for your invaluable help.
Best regards,