I have been experiencing mixed results when booting up and programming a custom board using STM32MP131DAG7. Some of the custom boards boot up and program without issues. Other boards do not boot up or program. All the custom boards were built at the same time as part of the same batch. I would like some troubleshooting assistance
Details of my custom board:
STPMIC1DPQR to power the STM32MP131
Switches on BOOT[0-2] to select the boot mode.
Onboard eMMC and SD card slot.
USB port for DFU via STM32_Programmer_CLI.exe to program the eMMC.
On some of my custom boards, I successfully program the eMMC and the board will boot up into the OS perfectly fine. These boards also boot up via SD card perfectly fine when I set the BOOT switches to select SD card boot. Everything on the custom board functions as normal after successful program.
In the same batch of my custom boards, I have seen ones that do not boot up. For these boards I have tried both USB boot and SD card boot. The tests I've tried:
Setting the boot switches to boot from SD card, then booting an image - No boot.
Setting the boot switches to USB to DFU program using STM32_Programmer_CLI.exe - Board is detected, can scan for serial number. First DFU to partition 0x01 downloads 100% but programmer then gives error message: Error: Unable to reconnect the target device: time out expired Error: Start operation failed at partition 0x01 Error: TSV flashing service failed
The program at partition 0x01 should be the TF-A. To check if the TF-A is running, I measured I2C4 SCL and SDA to check if STPMIC1 is being configured; do not see any activity.
I also connected a UART cable to see if there are any messages to the console. No messages were seen
Based on above test results, the reconnection issue does not seem related to device enumeration of the USB but rather with the MCU not running the TF-A
Repeat of the USB programming but used STM32Programmer Windows program instead of the CLI
Able to scan and detect the STM32MP131
Can see the serial number being scanned after DFU connection is established
Attempted to program via Windows program, but same error as using CLI
For the boards that do not program via USB or boot from SD card, I did tests on the board to eliminate a hardware error. I have measured:
BOOT switch voltage levels are correct and are set correctly
HSE and LSE clocks are working and operating at correct frequencies
STPMIC1D default power rails are working and voltage levels are fine (DDR rails not yet enabled as TF-A does not seem to be running)
RESET_n line - not held low
From the tests above, the failure to program due to a critical hardware design issue on my custom board is unlikely since I do have cases where on an identical board the STM32MP131 boots up and programs without fail. However, there could be a possibility of marginal functionality leading to programming failure but I am unsure where to look.
I would appreciate assistance in some other troubleshooting or test cases I can run to narrow down the root cause. For starters, I would most like to understand why the STM32MP131 can be detected as a USB device and can program to partition to 0x01, but fail afterwards. Any other guidance, tests to run, or diagnostics is appreciated.
Thank you