2021-03-29 02:14 PM
Hello everyone!
I'm getting familiar with the STM32MP1 tools on a linux laptop and I'm trying to burn the demo to my STM32MP1D-DK1 board. I know most the demos are aimed at the DK2 but it's sold out everywhere and I don't currently need wifi or bluetooth (or an LCD), so this seemed good enough for me.
Anyway, I'm trying to follow the instructions on the STM32MP1 wiki page (
https://wiki.st.com/stm32mpu/wiki/Getting_started/STM32MP1_boards/STM32MP157x-DK2/Let%27s_start/Populate_the_target_and_boot_the_image) and I'm running into an issue when trying to burn the firmware:
Unfortunately, I get the errors above, a red LED (LD5?) starts flashing on and off, a blue LED (LD6?) stays on, and LD4 continues to toggle on and off about every second or so (this was the same prior to burning the firmware as well.
I tried to follow a similar tutorial to burn via a command line (https://wiki.st.com/stm32mpu/wiki/STM32MP15_Discovery_kits_-_Starter_Package#Preparing_the_USB_serial_link_for_flashing) and had a similar issue. Here's what I'm getting:
~/STM32MPU_workspace/STM32MP15-Ecosystem-v2.1.0/Starter-Package/stm32mp1-openstlinux-5-4-dunfell-mp1-20-11-12/images/stm32mp1$ STM32_Programmer_CLI -c port=usb1 -w flashlayout_st-image-weston/trusted/FlashLayout_sdcard_stm32mp157d-dk1-trusted.tsv
-------------------------------------------------------------------
STM32CubeProgrammer v2.7.0
-------------------------------------------------------------------
USB speed : High Speed (480MBit/s)
Manuf. ID : STMicroelectronics
Product ID : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
SN : 003400163438511536383238
FW version : 0x0110
Device ID : 0x0500
Device name : STM32MP1
Device type : MPU
Device CPU : Cortex-A7
Start Embedded Flashing service
Memory Programming ...
Opening and parsing file: tf-a-stm32mp157d-dk1-serialboot.stm32
File : tf-a-stm32mp157d-dk1-serialboot.stm32
Size : 237896 Bytes
Partition ID : 0x01
Download in Progress:
[==================================================] 100%
File download complete
Time elapsed during download operation: 00:00:00.569
RUNNING Program ...
PartID: :0x01
Start operation done successfully at partition 0x01
Flashlayout Programming ...
[==================================================] 100%
Running Flashlayout Partition ...
Flashlayout partition started successfully
Memory Programming ...
Opening and parsing file: u-boot-stm32mp157d-dk1-trusted.stm32
File : u-boot-stm32mp157d-dk1-trusted.stm32
Size : 903062 Bytes
Partition ID : 0x03
Download in Progress:
[==================================================] 100%
File download complete
Time elapsed during download operation: 00:00:00.936
RUNNING Program ...
PartID: :0x03
Reconnecting the device ...
Error:
Unable to reconnect the target device: time out expired
Error: Start operation failed at partition 0x03
The errors look similar, which makes sense (whatever is an issue with one is likely the issue with another).
A few notes, I do have both boot switches turned to off for burning FW, my power supply is rated at 3A, I have the ST-Link USB cable connected, as well as the power supply (5V 3A), and the USB C (USB OTG, just going into a port on my laptop, not a powered hub).
Any idea what might be causing the issue? Is it possible there's an issue with the DK1 files or am I doing something wrong?
Any help you can give me would be appreciated. Thanks!
2021-03-30 05:32 AM
Hi,
please have a look to https://community.st.com/s/article/FAQ-STM32MP1-STM32CubeProgrammer-USB-reconnect-error-at-STM32MP1-boot-device-flashing
As you did not rebuilt the binaries, I think it is a Virtual Machine USB setting issue.
Regards.
2021-04-07 05:05 PM
I apologize for the delay, I got pulled away on another project! Finally getting a chance to circle back!
Thank you so much for that link, it definitely sounds like that is my issue. I was going through the guide and got stuck at the following location:
If you are usining native Linux PC check you "see" Uboot configured as a USB peripheral
In Uboot shell run a Dfu command :
STM32MP> env set dfu_alt_info "DDR ram 0xC0000000 0x20000000"
STM32MP> dfu 0 ram 0
I am in native linux but I'm not sure if I understand how to run a uboot script. Maybe this is a basic task but I'm somewhat new to Linux so I'm not sure if this is a file I need to edit or if this is just from terminal. I tried navigating to the ~/STM32MPU_workspace/STM32MP15-Ecosystem-v2.1.0/Starter-Package/stm32mp1-openstlinux-5-4-dunfell-mp1-20-11-12/images/stm32mp1 directory and trying to launch the command but I'm getting the following:
env: ‘set’: No such file or directory
I'm likely doing something wrong there. However, I did run dmesg and seem to have confirmed the issue is there as I'm getting this:
[ 1273.375554] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1273.375555] usb 1-5: Product: DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
[ 1273.375557] usb 1-5: Manufacturer: STMicroelectronics
[ 1273.375558] usb 1-5: SerialNumber: 003400163438511536383238
[ 1831.982439] usb 1-5: USB disconnect, device number 8
Based on this, it does appear that it's in HS mode rather than getting:
[17802.822239] usb 5-1.3.1.2: new high-speed USB device number 10 using xhci_hcd
[17802.922995] usb 5-1.3.1.2: New USB device found, idVendor=0483, idProduct=df11
[17802.922998] usb 5-1.3.1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[17802.923001] usb 5-1.3.1.2: Product: USB download gadget
[17802.923003] usb 5-1.3.1.2: Manufacturer: STMicroelectronics
[17802.923004] usb 5-1.3.1.2: SerialNumber: 003A00203438510D36383238
Looks like my product is wrong, which makes sense, based on the article provided.
I was reading through the article though and I don't really understand what it is I need to do from here to resolve the issue. Can you provide some additional support? I'm not really sure what to do next.
Let me know if there's anything I can try to get this up and working. Hoping to be able to at least burn firmware to this chip soon so I can dive in! Thanks for all your help and sorry again for the delay!
2021-04-08 07:31 AM
First, could you try using command line to flash and add "-tm 10000" on the command (increase default timeout to 10 seconds) ?
I agree the FAQ is not crystal clear.
You need to stop load sequence at uBoot console, by enabling only the two first items in CubeProgrammer.
Then, using the serial console (Virtual Com Port of the ST-Link, 115200,n,8,1, see 'The serial terminal'), with CTRL+C you should get the uBoot "STM32MP>" prompt.
Then you could try the requested commands which should make an USB device visible on your PC (this is just for checking purposes).
If not visible, it is a PC setup issue.
Note that the 'DFU in HS Mode' you see is normal and it is the first USB connection from BootROM used to load TF-A and uBoot in RAM.
Then uBoot start and reconnect using a different USB connection 'USB download gadget' (this occur in the log after "Reconnecting the device ..." which is failing on your PC).
Regards.
2021-04-12 08:35 AM
Ok, after struggling to get this to show the boot info in the terminal window, I realized the issue was likely because it was in boot mode rather than boot from SD card mode . . . I switched it to run from the SD card and could see the boot info and get into the shell command by pressing ctrl+c (which is good). I can now see root@stm32mp1, so I'm ready to punch in those commands.
The page you had linked had two commands it recommended running:
In Uboot shell run a Dfu command :
STM32MP> env set dfu_alt_info "DDR ram 0xC0000000 0x20000000"
STM32MP> dfu 0 ram 0
Unfortunately, I tried running the first command and got this:
root@stm32mp1:~# env set dfu_alt_info "DDR ram 0xC0000000 0x20000000"
env: 'set': No such file or directory
Am I missing a plugin or is the command above correct? Did I miss/misunderstand a step?
I think I'm pretty close now since I can at least get to a point where I can access the board so, assuming those lines are the steps needed to be able to flash the board, I shouldn't be too far off! Any help you can give me would be appreciated!
Also, I tried the "-tm 10000" command at the end of the command line message as you had requested and had the same result as before. Wanted to make sure I mentioned that. Thanks for all your help! Hopefully, I can get this all figured out!
2021-04-12 11:22 PM
As I see the 'root@stm32mp1' prompt, you are not in U-boot shell but rather on Linux shell (which mean your SD-card is flashed). This explain why the U-boot command syntax is not accepted.
To get the U-boot shell, you need to press a key (in the UART console) at right time (when there is 'Hit any key to stop autoboot:' message for 1 second)
Regards.
2021-04-13 06:59 AM
Consolidated in Post Below
2021-04-13 07:19 AM
Ok, i was able to bypass autoboot now when booting from SD card. I also was able to type those commands and verify that running those two lines seems to have resolved the issue.
I have now put the board back in boot mode (both jumpers set to off), I have USB C, power, and ST-Link all connected (power LED is green, LD4 is solid red). I ran dmesg from the PC and I get the following from the USB section:
[ 3875.513773] usb 1-5: new high-speed USB device number 23 using xhci_hcd
[ 3875.662498] usb 1-5: New USB device found, idVendor=0483, idProduct=df11, bcdDevice= 2.00
[ 3875.662504] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3875.662507] usb 1-5: Product: USB download gadget
[ 3875.662509] usb 1-5: Manufacturer: STMicroelectronics
[ 3875.662512] usb 1-5: SerialNumber: 003400163438511536383238
[ 7128.219858] audit: type=1400 audit(1618328257.733:76): apparmor="DENIED" operation="open" profile="/usr/sbin/cupsd" name="/etc/pbis/user-ignore" pid=3145 comm="cupsd" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[ 7128.220616] audit: type=1400 audit(1618328257.737:77): apparmor="DENIED" operation="open" profile="/usr/sbin/cupsd" name="/etc/pbis/user-ignore" pid=3145 comm="cupsd" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[ 7910.721166] usb 1-5: USB disconnect, device number 23
[ 8038.221703] usb 1-5: new high-speed USB device number 24 using xhci_hcd
[ 8043.425674] usb 1-5: device descriptor read/64, error -110
[ 8051.509311] usb 1-5: device descriptor read/64, error -71
[ 8051.745296] usb 1-5: new high-speed USB device number 25 using xhci_hcd
[ 8051.894503] usb 1-5: New USB device found, idVendor=1d6b, idProduct=0104, bcdDevice= 1.00
[ 8051.894509] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 8051.894513] usb 1-5: Product: STM32MP1
[ 8051.894516] usb 1-5: Manufacturer: STMicroelectronics
[ 8051.894519] usb 1-5: SerialNumber: 003400163438511536383238
[ 8051.917416] usbcore: registered new interface driver cdc_ether
[ 8051.919587] rndis_host 1-5:1.0 eth0: register 'rndis_host' at usb-0000:00:14.0-5, RNDIS device, e8:bb:32:94:10:5d
[ 8051.919615] usbcore: registered new interface driver rndis_host
[ 8051.921197] usbcore: registered new interface driver rndis_wlan
[ 8051.925993] rndis_host 1-5:1.0 enxe8bb3294105d: renamed from eth0
[ 8119.136871] usb 1-5: USB disconnect, device number 25
[ 8119.137056] rndis_host 1-5:1.0 enxe8bb3294105d: unregister 'rndis_host' usb-0000:00:14.0-5, RNDIS device
[ 8119.137267] xhci_hcd 0000:00:14.0: WARN Cannot submit Set TR Deq Ptr
[ 8119.137269] xhci_hcd 0000:00:14.0: A Set TR Deq Ptr command is pending.
[ 8119.137280] xhci_hcd 0000:00:14.0: WARN Set TR Deq Ptr cmd failed due to incorrect slot or ep state.
[ 8122.667738] usb 1-3: USB disconnect, device number 22
[ 8122.668176] cdc_acm 1-3:1.1: failed to set dtr/rts
[ 8135.904111] usb 1-5: new high-speed USB device number 26 using xhci_hcd
[ 8136.054016] usb 1-5: New USB device found, idVendor=0483, idProduct=df11, bcdDevice= 2.00
[ 8136.054022] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 8136.054025] usb 1-5: Product: DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
[ 8136.054028] usb 1-5: Manufacturer: STMicroelectronics
[ 8136.054030] usb 1-5: SerialNumber: 003400163438511536383238
[ 8203.159489] usb 1-5: USB disconnect, device number 26
[ 8242.472690] usb 1-5: new high-speed USB device number 27 using xhci_hcd
[ 8242.622331] usb 1-5: New USB device found, idVendor=0483, idProduct=df11, bcdDevice= 2.00
[ 8242.622336] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 8242.622340] usb 1-5: Product: DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
[ 8242.622343] usb 1-5: Manufacturer: STMicroelectronics
[ 8242.622346] usb 1-5: SerialNumber: 003400163438511536383238
[ 8252.838463] usb 1-3: new full-speed USB device number 28 using xhci_hcd
[ 8252.989189] usb 1-3: New USB device found, idVendor=0483, idProduct=3752, bcdDevice= 1.00
[ 8252.989195] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 8252.989199] usb 1-3: Product: STM32 STLink
[ 8252.989201] usb 1-3: Manufacturer: STMicroelectronics
[ 8252.989204] usb 1-3: SerialNumber: 066FFF525753756687094558
I do see the USB gadget, so from here, I want to try burning the board. Below is what I'm getting:
PC:~/STM32MPU_workspace/STM32MP15-Ecosystem-v2.1.0/Starter-Package/stm32mp1-openstlinux-5-4-dunfell-mp1-20-11-12/images/stm32mp1$ STM32_Programmer_CLI -c port=usb1 -w flashlayout_st-image-weston/trusted/FlashLayout_sdcard_stm32mp157d-dk1-trusted.tsv
-------------------------------------------------------------------
STM32CubeProgrammer v2.7.0
-------------------------------------------------------------------
USB speed : High Speed (480MBit/s)
Manuf. ID : STMicroelectronics
Product ID : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
SN : 003400163438511536383238
FW version : 0x0110
Device ID : 0x0500
Device name : STM32MP1
Device type : MPU
Device CPU : Cortex-A7
Start Embedded Flashing service
Memory Programming ...
Opening and parsing file: tf-a-stm32mp157d-dk1-serialboot.stm32
File : tf-a-stm32mp157d-dk1-serialboot.stm32
Size : 237896 Bytes
Partition ID : 0x01
Download in Progress:
[==================================================] 100%
File download complete
Time elapsed during download operation: 00:00:00.569
RUNNING Program ...
PartID: :0x01
Start operation done successfully at partition 0x01
Flashlayout Programming ...
[==================================================] 100%
Running Flashlayout Partition ...
Flashlayout partition started successfully
Memory Programming ...
Opening and parsing file: u-boot-stm32mp157d-dk1-trusted.stm32
File : u-boot-stm32mp157d-dk1-trusted.stm32
Size : 903062 Bytes
Partition ID : 0x03
Download in Progress:
[==================================================] 100%
File download complete
Time elapsed during download operation: 00:00:00.935
RUNNING Program ...
PartID: :0x03
Reconnecting the device ...
Error:
Unable to reconnect the target device: time out expired
Error: Start operation failed at partition 0x03
Error: TSV flashing service failed
There is now a solid blue LED on the board (LD8) and LD6 (I think) is a blinking red light.
It appears that I'm back in the same position I was earlier. Not sure if I missed a step or misunderstood something? What am I missing?
Thanks for your help, Patrick!
2021-09-18 12:33 AM
Hi @JayDev
There can be two issues here :