cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeProgrammer on timeout for STM32MP1

DMårt
Senior II

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.

 

 

 

 

 

11 REPLIES 11
PatrickF
ST Employee

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.

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. 

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.

@PatrickF 

I made my own board.

DanielMartensson/STM32-Computer: STM32 Computer were Linux can be deployed onto (github.com)

I could connect to UART and see the log, but I have no cable yet.

When I power on my board. the red LED is blinking 5 in Hz, as it waints for be connected to the USB OTG. Once I connect the USB OTG into my computer, then the red LED is stop blinking. It's in order as the documentation says.

That means that the PMIC is soldered correctly.

Yes. I using I2C between PMIC and STM32MP1.

Perhaps I could solder some cables onto the 14-pin 1.27mm headers. Give me a moment and I will fix that!

Accessing board UART is a must to go further. STLINK might also help later.

 

At least, using the starter package binaries from EV1 board will not work as you have only a 16-bit DDR.

Maybe the starter package of DK1 board might be more closer to your HW (as you are also using 12x12 package and single DDR3L).

But unless you fully copied the HW, using the starter package binary will not work (or partially if your have some luck).

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.

@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

Hi,

usually, all the HW related adaptations are done using Device Tree update. Strongly not recommended to change code for simple pin muxing change.

https://wiki.st.com/stm32mpu/wiki/Device_tree

https://wiki.st.com/stm32mpu/wiki/STM32_MPU_device_tree#STM32MP1_series

https://wiki.st.com/stm32mpu/wiki/How_to_compile_the_device_tree_with_the_Developer_Package

https://wiki.st.com/stm32mpu/wiki/STM32CubeMX

note that CubeMx generated device tree are not complete for peripherals configuration and must be tailored (a compare with DK1 or EV1 starter package device trees is usually a strong help)

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.

@PatrickF 

In my opinion, I need to change the pins or else, I will get the same error message again. 

Or am I wrong?

I cannot see any solution from your URL links.

Here is one that had exacty the same issue as I having now.

His solution was to change the pins in CubeMX.

Solved: Cannot boot custom board based on STM32MP157F-DK2 - STMicroelectronics Community

By the way. I have an STM32CubeIDE project with correct pin configuration. 

Hi,

I cannot help you more as I'm more knowledgeable on HW side..

If you started to build your own HW to run embedded Linux, I assume you are aware of the effort behind to get the whole Linux chain SW up and running on a specific HW.

You need to ramp up knowledge on Device Tree tailoring, rebuild images thanks to yocto or buildroot, etc... there is plenty of information in ST wiki or more general Linux information/courses/resources available on the web.

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.