Skip to main content
Lead
July 19, 2024
Solved

STM32CubeProgrammer on timeout for STM32MP1

  • July 19, 2024
  • 1 reply
  • 4248 views

I have made my own STM32MP1 board with the STM32MP151AAC3 processor. Right now I'm faceing issues with the software STM32CubeProgrammer and I don't know why this happens.

My goal is to flash the eMMC via the UBS OTG. I have SDIO2 as eMMC by the way.

What we can see here is that:

  • The STM32CubeProgrammer regonize the STM32MP1 processor and its name
  • The USB OTG of the STM32MP1 processor is working
  • I'm using the OpenSTLinux for STM32MP157 processor because it's the only one that are avaiable as Starter Package . It's only a minor difference between STM32MP151, STM32MP153(CAN FD) and STM32MP157(CAN FD + DSI)
  • The flashing fails on 0x1 fsbl-boot
  • The STM32CubeProgrammer can recognize the partisions when I connect via USB OTG

So the question is simple:

Why does STM32CubeProgrammer get timeout?

Skärmklipp.PNG

 

Skärmklipp.PNG

The full log can be found here: https://pastebin.com/q9GttMiR

 

 

 

 

 00:57:35:752 : UR connection mode is defined with the HWrst reset mode
 00:57:35:918 : Device Descriptor:
 00:57:35:918 : |_bLength : 0x12
 00:57:35:918 : |_bDescriptorType : 0x01
 00:57:35:918 : |_bcdUSB : 0x0200
 00:57:35:918 : |_bDeviceClass : 0x00
 00:57:35:918 : |_bDeviceSubClass : 0x00
 00:57:35:918 : |_bDeviceProtocol : 0x00
 00:57:35:918 : |_bMaxPacketSize : 0x40
 00:57:35:918 : |_idVendor : 0x0483
 00:57:35:919 : |_idProduct : 0xdf11
 00:57:35:919 : |_bcdDevice : 0x0200
 00:57:35:919 : |_iManufacturer : 0x01
 00:57:35:919 : |_iProduct : 0x02
 00:57:35:919 : |_iSerialNumber : 0x03
 00:57:35:919 : |_bNumConfigurations : 0x01
 00:57:35:919 : Configuration Descriptor:
 00:57:35:919 : |_bLength : 0x09
 00:57:35:919 : |_bDescriptorType : 0x02
 00:57:35:919 : |_wTotalLength : 0x48
 00:57:35:920 : |_bNumInterfaces : 0x01
 00:57:35:920 : |_bConfigurationValue : 0x01
 00:57:35:920 : |_iConfiguration : 0x02
 00:57:35:920 : |_bmAttributes : 0xc0
 00:57:35:920 : |_bMaxPower : 0x01
 00:57:35:920 : Interface Descriptor Alternate Settings: 0x00
 00:57:35:920 : |_bLength : 0x09
 00:57:35:920 : |_bDescriptorType : 0x04
 00:57:35:920 : |_bInterfaceNumber : 0x00
 00:57:35:920 : |_bAlternateSetting : 0x00
 00:57:35:920 : |_bNumEndpoints : 0x00
 00:57:35:920 : |_bInterfaceClass : 0xfe
 00:57:35:920 : |_bInterfaceSubClass : 0x01
 00:57:35:920 : |_bInterfaceProtocol : 0x02
 00:57:35:920 : |_iInterface : 0x06
 00:57:35:921 : Interface Descriptor Alternate Settings: 0x01
 00:57:35:921 : |_bLength : 0x09
 00:57:35:921 : |_bDescriptorType : 0x04
 00:57:35:921 : |_bInterfaceNumber : 0x00
 00:57:35:921 : |_bAlternateSetting : 0x01
 00:57:35:921 : |_bNumEndpoints : 0x00
 00:57:35:921 : |_bInterfaceClass : 0xfe
 00:57:35:921 : |_bInterfaceSubClass : 0x01
 00:57:35:921 : |_bInterfaceProtocol : 0x02
 00:57:35:921 : |_iInterface : 0x07
 00:57:35:921 : Interface Descriptor Alternate Settings: 0x02
 00:57:35:921 : |_bLength : 0x09
 00:57:35:921 : |_bDescriptorType : 0x04
 00:57:35:921 : |_bInterfaceNumber : 0x00
 00:57:35:921 : |_bAlternateSetting : 0x02
 00:57:35:921 : |_bNumEndpoints : 0x00
 00:57:35:921 : |_bInterfaceClass : 0xfe
 00:57:35:921 : |_bInterfaceSubClass : 0x01
 00:57:35:921 : |_bInterfaceProtocol : 0x02
 00:57:35:922 : |_iInterface : 0x08
 00:57:35:922 : Interface Descriptor Alternate Settings: 0x03
 00:57:35:922 : |_bLength : 0x09
 00:57:35:922 : |_bDescriptorType : 0x04
 00:57:35:922 : |_bInterfaceNumber : 0x00
 00:57:35:922 : |_bAlternateSetting : 0x03
 00:57:35:922 : |_bNumEndpoints : 0x00
 00:57:35:922 : |_bInterfaceClass : 0xfe
 00:57:35:922 : |_bInterfaceSubClass : 0x01
 00:57:35:922 : |_bInterfaceProtocol : 0x02
 00:57:35:922 : |_iInterface : 0x09
 00:57:35:922 : Interface Descriptor Alternate Settings: 0x04
 00:57:35:922 : |_bLength : 0x09
 00:57:35:922 : |_bDescriptorType : 0x04
 00:57:35:922 : |_bInterfaceNumber : 0x00
 00:57:35:922 : |_bAlternateSetting : 0x04
 00:57:35:922 : |_bNumEndpoints : 0x00
 00:57:35:922 : |_bInterfaceClass : 0xfe
 00:57:35:922 : |_bInterfaceSubClass : 0x01
 00:57:35:922 : |_bInterfaceProtocol : 0x02
 00:57:35:923 : |_iInterface : 0x0a
 00:57:35:923 : Interface Descriptor Alternate Settings: 0x05
 00:57:35:923 : |_bLength : 0x09
 00:57:35:923 : |_bDescriptorType : 0x04
 00:57:35:923 : |_bInterfaceNumber : 0x00
 00:57:35:923 : |_bAlternateSetting : 0x05
 00:57:35:923 : |_bNumEndpoints : 0x00
 00:57:35:923 : |_bInterfaceClass : 0xfe
 00:57:35:923 : |_bInterfaceSubClass : 0x01
 00:57:35:923 : |_bInterfaceProtocol : 0x02
 00:57:35:923 : |_iInterface : 0x0b
 00:57:35:923 : Functional Descriptor :
 00:57:35:923 : |_bLength : 0x09
 00:57:35:923 : |_bDescriptorType : 0x21
 00:57:35:923 : |_bmAttributes : 0x0f
 00:57:35:923 : |_wDetachTimeOut : 0xff
 00:57:35:923 : |_wTransferSize : 0x0400
 00:57:35:923 : |_bcdDFUVersion : 0x0110
 00:57:35:923 : USB speed : High Speed (480MBit/s)
 00:57:35:923 : Manuf. ID : STMicroelectronics
 00:57:35:924 : Product ID : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
 00:57:35:924 : SN : 002600373431510433383938
 00:57:35:924 : DFU protocol: 1.1
 00:57:35:924 : Board : --
 00:57:35:924 : Device ID : 0x0500
 00:57:47:117 : Start Embedded Flashing service
 00:57:47:151 : sending a set alternate setting request with index: 5
 00:57:47:152 : receiving packet
 00:57:47:153 : DFU status = 0 : OK
 00:57:47:153 : DFU state = 2 : dfuIDLE
 00:57:47:153 : UpLoading data
 00:57:47:153 : DFU status = 0 : OK
 00:57:47:153 : DFU state = 2 : dfuIDLE
 00:57:47:153 : sending a set alternate setting request with index: 1
 00:57:47:154 : Memory Programming ...
 00:57:47:154 : Opening and parsing file: tf-a-stm32mp157a-ev1-usb.stm32
 00:57:47:197 : File : tf-a-stm32mp157a-ev1-usb.stm32
 00:57:47:197 : Size : 220.41 KB 
 00:57:47:197 : Partition ID : 0x01 
 00:57:47:197 : Download in Progress:
 00:57:47:198 : Size : 225702 Bytes
 00:57:47:199 : sending packet nbr: 0
 00:57:47:200 : DFU status = 0 : OK
 00:57:47:200 : DFU state = 2 : dfuIDLE
 00:57:47:201 : Status: 0, State: 2
 00:57:47:204 : DFU status = 0 : OK
 00:57:47:204 : DFU state = 4 : dfuDNBUSY
[.....]
 00:57:49:178 : sending packet nbr: 152
 00:57:49:179 : DFU status = 0 : OK
 00:57:49:179 : DFU state = 5 : dfuDNLOAD-IDLE
 00:57:49:179 : bwPollTimeout = 1
 00:57:49:180 : Status: 0, State: 5
 00:57:49:183 : DFU status = 0 : OK
 00:57:49:183 : DFU state = 4 : dfuDNBUSY
 00:57:49:184 : bwPollTimeout = 1
[......]
 00:57:49:488 : DFU state = 4 : dfuDNBUSY
 00:57:49:488 : bwPollTimeout = 1
 00:57:49:492 : DFU status = 0 : OK
 00:57:49:492 : DFU state = 5 : dfuDNLOAD-IDLE
 00:57:49:492 : bwPollTimeout = 1
 00:57:49:495 : sending packet nbr: 162
 00:57:49:495 : DFU status = 0 : OK
 [.....]
 00:57:50:059 : DFU status = 0 : OK
 00:57:50:060 : DFU state = 5 : dfuDNLOAD-IDLE
 00:57:50:060 : bwPollTimeout = 1
 00:57:50:061 : Status: 0, State: 5
 00:57:50:090 : DFU status = 0 : OK
 00:57:50:090 : DFU state = 4 : dfuDNBUSY
 00:57:50:090 : bwPollTimeout = 1
 00:57:50:094 : DFU status = 0 : OK
 00:57:50:095 : DFU state = 5 : dfuDNLOAD-IDLE
 00:57:50:095 : bwPollTimeout = 1
 00:57:50:099 : Segment[0] downloaded successfully
 00:57:50:099 : File download complete
 00:57:50:099 : Time elapsed during download operation: 00:00:02.454
 00:57:50:099 : RUNNING Program ... 
 00:57:50:099 : PartID: :0x01 
 00:57:50:099 : DFU status = 0 : OK
 00:57:50:099 : DFU state = 5 : dfuDNLOAD-IDLE
 00:57:50:099 : bwPollTimeout = 1
 00:57:50:101 : sending a dfu end of download request
 00:57:50:102 : DFU status = 0 : OK
 00:57:50:102 : DFU state = 7 : dfuMANIFEST
 00:57:50:102 : bwPollTimeout = 1
 00:58:22:076 : DFU status = 0 : OK
 00:58:22:345 : DFU state = 2 : dfuIDLE
 00:58:24:127 : sending a set alternate setting request with index: 5
 00:58:29:426 : receiving packet
 00:58:59:455 : libusb get status error [-7] : LIBUSB_ERROR_TIMEOUT 
 00:58:59:455 : sending a clear status request
 00:59:59:496 : libusb get status error [-7] : LIBUSB_ERROR_TIMEOUT 
 00:59:59:496 : an error occured after sending the clear status request
 00:59:59:496 : Status: errUNKNOWN, State: dfuERROR
 00:59:59:551 : sending a clear status request
 01:00:59:498 : libusb get status error [-7] : LIBUSB_ERROR_TIMEOUT 
 01:00:59:498 : an error occured after sending the clear status request
 01:00:59:498 : Status: errUNKNOWN, State: dfuERROR
 01:00:59:498 : sending a clear status request
 01:01:59:500 : libusb get status error [-7] : LIBUSB_ERROR_TIMEOUT 
 01:01:59:500 : an error occured after sending the clear status request
 01:01:59:500 : Status: errUNKNOWN, State: dfuERROR
 01:01:59:500 : sending a clear status request
 01:03:05:691 : libusb get status error [-7] : LIBUSB_ERROR_TIMEOUT 
 01:03:05:827 : an error occured after sending the clear status request
 01:03:05:828 : Status: errUNKNOWN, State: dfuERROR
 01:03:05:829 : sending a clear status request
 01:03:59:506 : libusb get status error [-7] : LIBUSB_ERROR_TIMEOUT 
 01:03:59:507 : an error occured after sending the clear status request
 01:03:59:507 : Status: errUNKNOWN, State: dfuERROR
 01:04:00:400 : sending a clear status request
 01:04:59:544 : libusb get status error [-7] : LIBUSB_ERROR_TIMEOUT 
 01:04:59:544 : an error occured after sending the clear status request
 01:04:59:544 : Status: errUNKNOWN, State: dfuERROR
 01:04:59:544 : sending a clear status request
 01:05:59:546 : libusb get status error [-7] : LIBUSB_ERROR_TIMEOUT 
 01:05:59:546 : an error occured after sending the clear status request
 01:05:59:546 : Status: errUNKNOWN, State: dfuERROR
 01:05:59:546 : sending a clear status request
 01:06:59:550 : libusb get status error [-7] : LIBUSB_ERROR_TIMEOUT 
 01:06:59:550 : an error occured after sending the clear status request
 01:06:59:550 : Status: errUNKNOWN, State: dfuERROR
 01:06:59:550 : sending a clear status request
 01:07:59:555 : libusb get status error [-7] : LIBUSB_ERROR_TIMEOUT 
 01:07:59:555 : an error occured after sending the clear status request
 01:07:59:556 : Status: errUNKNOWN, State: dfuERROR
 01:07:59:556 : sending a clear status request
 01:08:59:556 : libusb get status error [-7] : LIBUSB_ERROR_TIMEOUT 
 01:08:59:556 : an error occured after sending the clear status request
 01:08:59:557 : Status: errUNKNOWN, State: dfuERROR
 01:08:59:742 : unable to switch the device to dfuIDLE state
 01:08:59:857 : Error: an error occured while uploading data from the virtual partition 0xF1
 01:09:03:186 : Error: Start operation failed at partition 0x01
 01:09:06:454 : Error: TSV flashing service failed
 01:09:39:537 : Disconnected from device.

 

 

 

 

 

Best answer by DMårt

@PatrickF 

 

Hi Again!

Here is the error message. It was the I2C as you said.

 

 

 

 

NOTICE: CPU: STM32MP151AAC Rev.Z
NOTICE: Model: STMicroelectronics STM32MP157A eval daughter on eval mother
ERROR: I2C device not ready
PANIC at PC : 0x2fff101b

Exception mode=0x00000016 at: 0x2fff101b

Trying the Flashout Delete All DK1 STM32MP157a.
Exception mode=0x00000016 at: 0x2fff101b

NOTICE: CPU: STM32MP151AAC Rev.Z
NOTICE: Model: STMicroelectronics STM32MP157A-DK1 Discovery Board
ERROR: I2C device not ready
PANIC at PC : 0x2fff101b

 

 

 

So what could be done here? I2C is not ready...hmm....I don't think it's a bad soldering. I mean, the CPU get its 3.3V from the PMIC. So the PMIC and the CPU must be correct soldered. 

My I2C4 is connected to PF14 and PF15 and it's also connected to the PMIC. 

 

Update:

The schematics for the DK1 and DK2 shows PZ4 and PZ5 as for the I2C4.

So I guess that the ARM Trusted Firmware expecting to use PZ4 and PZ5 as the I2C4, but instead, I need to change it to PF14 and PF15. 

 

In the stm32mp_pmic.c file. I think I can change the peripheral to I2C4 I guess?

https://github.com/STMicroelectronics/arm-trusted-firmware/blob/648de4789e0456eb9f874d6dd2151baaa85032d3/drivers/st/pmic/stm32mp_pmic.c#L170

1 reply

PatrickF
Technical Moderator
July 22, 2024

Hi @DMårt 

seems there is already a thread on same topic.

https://community.st.com/t5/stm32-mpus-embedded-software/how-do-i-flash-openstlinux-onto-stm32mp151-with-emmc-by-using/td-p/699261

 

Using ST Starter package on your own HW is not guaranteed to work (even a minor difference could make it fail).

Seems the FSBL (TF-A) is not starting well on your board (could be multiple causes).

Could you try providing the board console log during flashload ?

Did you have checked if your DDR is working well using https://wiki.st.com/stm32mpu/wiki/STM32DDRFW-UTIL ?

Regards.

 

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.NEW ! Sidekick STM32 AI agent, see here
DMårtAuthor
Lead
July 22, 2024

Hi @PatrickF 

>> Could you try providing the board console log during flashload ?

I have posted it above in the first post. Or do you ment something else?

https://pastebin.com/q9GttMiR

>> Did you have checked if your DDR is working well using https://wiki.st.com/stm32mpu/wiki/STM32DDRFW-UTIL ?

I have not checked the DDR yet. I have only a USB OTG cable in hands at the moment. I have made pins for UART and ST-LINK to use, but it's 1.27mm 14-pin headers.

According to my microscope, the soldering of the DDR3 memory seems to be perfect. 

STM32MP151AAC3 custom board with STM32-OS as operating system: https://github.com/DanielMartensson/STM32-ComputerSTM32MP257FAK3 custom board with STM64-OS as operating system: https://github.com/DanielMartensson/STM64-Computer
PatrickF
Technical Moderator
July 22, 2024

By console, I mean the UART output as they could be very useful indication (even if messages are not always clear as FSBL size is constrained to put many debug strings).

FSBL could fail initializing the STPMIC1 (using I2C), the DDR, etc...

As your are using the Starter Package of STM32MP157A-EV1 board, did you use same 32-bits DDR with terminations ?

Regards.

 

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.NEW ! Sidekick STM32 AI agent, see here