2023-05-08 07:14 AM
Hi all,
I updated my project from Morty (2.2) to Kirkstone (4.1). After doing the required fixes/updates on the recipes, I have problems booting the FSBL. I am using the Cube Programmer to flash the image. Below is the log:
STM32CubeProgrammer API v2.13.0 | Windows-64Bits
Read TSV File: C:\temp\stm32mp1-customized-img-kirkstone-alpha2\flashlayout_custom-os-image-debug\trusted\FlashLayout_nand-4-256_stm32mp153a-customized-img-cubemx-mx-trusted.tsv
Number of partitions: 11
UR connection mode is defined with the HWrst reset mode
Device Descriptor:
|_bLength : 0x12
|_bDescriptorType : 0x01
|_bcdUSB : 0x0200
|_bDeviceClass : 0x00
|_bDeviceSubClass : 0x00
|_bDeviceProtocol : 0x00
|_bMaxPacketSize : 0x40
|_idVendor : 0x0483
|_idProduct : 0xdf11
|_bcdDevice : 0x0200
|_iManufacturer : 0x01
|_iProduct : 0x02
|_iSerialNumber : 0x03
|_bNumConfigurations : 0x01
Configuration Descriptor:
|_bLength : 0x09
|_bDescriptorType : 0x02
|_wTotalLength : 0x48
|_bNumInterfaces : 0x01
|_bConfigurationValue : 0x01
|_iConfiguration : 0x02
|_bmAttributes : 0xc0
|_bMaxPower : 0x01
Interface Descriptor Alternate Settings: 0x00
|_bLength : 0x09
|_bDescriptorType : 0x04
|_bInterfaceNumber : 0x00
|_bAlternateSetting : 0x00
|_bNumEndpoints : 0x00
|_bInterfaceClass : 0xfe
|_bInterfaceSubClass : 0x01
|_bInterfaceProtocol : 0x02
|_iInterface : 0x06
Interface Descriptor Alternate Settings: 0x01
|_bLength : 0x09
|_bDescriptorType : 0x04
|_bInterfaceNumber : 0x00
|_bAlternateSetting : 0x01
|_bNumEndpoints : 0x00
|_bInterfaceClass : 0xfe
|_bInterfaceSubClass : 0x01
|_bInterfaceProtocol : 0x02
|_iInterface : 0x07
Interface Descriptor Alternate Settings: 0x02
|_bLength : 0x09
|_bDescriptorType : 0x04
|_bInterfaceNumber : 0x00
|_bAlternateSetting : 0x02
|_bNumEndpoints : 0x00
|_bInterfaceClass : 0xfe
|_bInterfaceSubClass : 0x01
|_bInterfaceProtocol : 0x02
|_iInterface : 0x08
Interface Descriptor Alternate Settings: 0x03
|_bLength : 0x09
|_bDescriptorType : 0x04
|_bInterfaceNumber : 0x00
|_bAlternateSetting : 0x03
|_bNumEndpoints : 0x00
|_bInterfaceClass : 0xfe
|_bInterfaceSubClass : 0x01
|_bInterfaceProtocol : 0x02
|_iInterface : 0x09
Interface Descriptor Alternate Settings: 0x04
|_bLength : 0x09
|_bDescriptorType : 0x04
|_bInterfaceNumber : 0x00
|_bAlternateSetting : 0x04
|_bNumEndpoints : 0x00
|_bInterfaceClass : 0xfe
|_bInterfaceSubClass : 0x01
|_bInterfaceProtocol : 0x02
|_iInterface : 0x0a
Interface Descriptor Alternate Settings: 0x05
|_bLength : 0x09
|_bDescriptorType : 0x04
|_bInterfaceNumber : 0x00
|_bAlternateSetting : 0x05
|_bNumEndpoints : 0x00
|_bInterfaceClass : 0xfe
|_bInterfaceSubClass : 0x01
|_bInterfaceProtocol : 0x02
|_iInterface : 0x0b
Functional Descriptor :
|_bLength : 0x09
|_bDescriptorType : 0x21
|_bmAttributes : 0x0f
|_wDetachTimeOut : 0xff
|_wTransferSize : 0x0400
|_bcdDFUVersion : 0x0110
USB speed : High Speed (480MBit/s)
Manuf. ID : STMicroelectronics
Product ID : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
SN : 002A00253430510537333734
DFU protocol: 1.1
Board : --
Device ID : 0x0500
Start Embedded Flashing service
sending a set alternate setting request with index: 5
receiving packet
DFU status = 0
DFU State = 2
UpLoading data
DFU status = 0
DFU State = 2
sending a set alternate setting request with index: 1
Memory Programming ...
Opening and parsing file: tf-a-stm32mp153a-customized-img-cubemx-mx-usb.stm32
File : tf-a-stm32mp153a-customized-img-cubemx-mx-usb.stm32
Size : 220.82 KB
Partition ID : 0x01
Download in Progress:
Size : 226117 Bytes
sending packet nbr: 0
DFU status = 0
DFU State = 2
Status: 0, State: 2
DFU status = 0
DFU State = 4
DFU status = 0
DFU State = 5
sending packet nbr: 1
DFU status = 0
DFU State = 5
Status: 0, State: 5
DFU status = 0
DFU State = 4
DFU status = 0
DFU State = 5
sending packet nbr: 2
DFU status = 0
DFU State = 5
Status: 0, State: 5
DFU status = 0
DFU State = 4
DFU status = 0
DFU State = 5
sending packet nbr: 3
DFU status = 0
DFU State = 5
Status: 0, State: 5
DFU status = 0
DFU State = 4
DFU status = 0
DFU State = 5
sending packet nbr: 4
DFU status = 0
DFU State = 5
Status: 0, State: 5
DFU status = 0
DFU State = 4
DFU status = 0
DFU State = 5
/*...*/
/* skipped */
/*...*/
sending packet nbr: 216
DFU status = 0
DFU State = 5
Status: 0, State: 5
DFU status = 0
DFU State = 4
DFU status = 0
DFU State = 5
sending packet nbr: 217
DFU status = 0
DFU State = 5
Status: 0, State: 5
DFU status = 0
DFU State = 4
DFU status = 0
DFU State = 5
sending packet nbr: 218
DFU status = 0
DFU State = 5
Status: 0, State: 5
DFU status = 0
DFU State = 4
DFU status = 0
DFU State = 5
sending packet nbr: 219
DFU status = 0
DFU State = 5
Status: 0, State: 5
DFU status = 0
DFU State = 4
DFU status = 0
DFU State = 5
sending packet nbr: 220
DFU status = 0
DFU State = 5
Status: 0, State: 5
DFU status = 0
DFU State = 4
DFU status = 0
DFU State = 5
Segment[0] downloaded successfully
File download complete
Time elapsed during download operation: 00:00:01.186
RUNNING Program ...
PartID: :0x01
DFU status = 0
DFU State = 5
sending a dfu end of download request
DFU status = 0
DFU State = 7
DFU status = 0
DFU State = 2
sending a set alternate setting request with index: 5
receiving packet
sending a clear status request
an error occured after sending the clear status request
Status: errUNKNOWN, State: dfuERROR
sending a clear status request
an error occured after sending the clear status request
Status: errUNKNOWN, State: dfuERROR
sending a clear status request
an error occured after sending the clear status request
Status: errUNKNOWN, State: dfuERROR
sending a clear status request
an error occured after sending the clear status request
Status: errUNKNOWN, State: dfuERROR
sending a clear status request
an error occured after sending the clear status request
Status: errUNKNOWN, State: dfuERROR
sending a clear status request
an error occured after sending the clear status request
Status: errUNKNOWN, State: dfuERROR
sending a clear status request
an error occured after sending the clear status request
Status: errUNKNOWN, State: dfuERROR
sending a clear status request
an error occured after sending the clear status request
Status: errUNKNOWN, State: dfuERROR
sending a clear status request
an error occured after sending the clear status request
Status: errUNKNOWN, State: dfuERROR
sending a clear status request
an error occured after sending the clear status request
Status: errUNKNOWN, State: dfuERROR
unable to switch the device to dfuIDLE state
Error: an error occured while uploading data from the virtual partition 0xF1
Error: Start operation failed at partition 0x01
Error: TSV flashing service failed
I checked the FAQ-STM32MP1-bring-up-troubleshooting-guide, but it didn't help.
I think the "unable to switch the device to dfuIDLE state" might be caused by the TF-A not executing properly rather than some device-host communication issue.
Some repo versions:
Does anyone have some idea how to proceed ?
Best Regards.
Solved! Go to Solution.
2023-05-29 11:52 PM
2023-05-30 12:19 AM
My CONFIG_MTDPARTS_NAND0_BOOT is using the default values.
Checking here the mtdparts sizes, they seem to match the partition table from the TSV.
STM32MP> mtdparts
device nand0 <nand0>, # parts = 9
#: name size offset mask_flags
0: fsbl1 0x00080000 0x00000000 0
1: fsbl2 0x00080000 0x00080000 0
2: metadata1 0x00080000 0x00100000 0
3: metadata2 0x00080000 0x00180000 0
4: fip-a1 0x00400000 0x00200000 0
5: fip-a2 0x00400000 0x00600000 0
6: fip-b1 0x00400000 0x00a00000 0
7: fip-b2 0x00400000 0x00e00000 0
8: UBI 0x1ee00000 0x01200000 0
active partition: nand0,0 - (fsbl1) 0x00080000 @ 0x00000000
defaults:
mtdids : nand0=nand0
mtdparts: mtdparts=nand0:512k(fsbl1),512k(fsbl2),512k(metadata1),512k(metadata2),4m(fip-a1),4m(fip-a2),4m(fip-b1),4m(fip-b2),-(UBI)
Even though the partition definition looks fine, the error `Loading Environment from UBI... ubi0 error: vtbl_check: too large reserved_pebs 3049, good PEBs 1972` seems to point in something in this direction.
STM32MP> mtd list
List of MTD devices:
* nand0
- type: NAND flash
- block size: 0x40000 bytes
- min I/O: 0x1000 bytes
- OOB size: 224 bytes
- OOB available: 118 bytes
- ECC strength: 8 bits
- ECC step size: 512 bytes
- bitflip threshold: 6 bits
- 0x000000000000-0x000020000000 : "nand0"
- 0x000000000000-0x000000080000 : "fsbl1"
- 0x000000080000-0x000000100000 : "fsbl2"
- 0x000000100000-0x000000180000 : "metadata1"
- 0x000000180000-0x000000200000 : "metadata2"
- 0x000000200000-0x000000600000 : "fip-a1"
- 0x000000600000-0x000000a00000 : "fip-a2"
- 0x000000a00000-0x000000e00000 : "fip-b1"
- 0x000000e00000-0x000001200000 : "fip-b2"
- 0x000001200000-0x000020000000 : "UBI"
2023-05-30 11:24 PM
Hi @Kevin HUBER and @Community member.
The booting partition problem is solved.
The fix was to add a node for fmc_pins_mx, fmc, uart7_pins_mx and a sub-node for nand-controller and nand with the setup below on the UBoot dtsi file.
u-boot,dm-pre-reloc;
Thank you both for your support.
2023-05-31 12:41 AM
Great ! Thanks @Vinícius Franchini for the feedback !