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-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-08 11:58 PM
HI @Vinícius Franchini ,
Yes probably come from TF-A not booting due to some miss/error in the DTS.
This might be confirmed by getting TF-A traces from serial console.
ST never provide any version based on Morty ?
Could please clarify on what previous version it was working ?
Did you update CubeMX accordingly with a move to Kirstone 4.1 ?
Thanks
Olivier
2023-05-09 07:32 AM
Hi @Community member. Thank you for your reply.
The serial console is not outputting anything. Isn't it expected at the FSBL?
I also tried to dump the traces from the memory as described here: https://wiki.st.com/stm32mpu/wiki/STM32_MPU_ROM_trace_analyzer#Procedure_to_dump_traces.
However I get the message: "Error: failed to read the requested memory content"
You're correct. I wrote the wrong version. The initial version is Dunfell (yocto 3.1). Here is a list of the previous versions where I am updating from:
I did the updates for the CubeMX. Is there a way to verify if they are correct and/or complete?
Best Regards.
2023-05-15 12:47 AM
Hey @Community member. Do you have any idea/suggestion how I could procced to investigate this issue?
2023-05-15 01:19 AM
Hi @Vinícius Franchini ,
Can you please provide some details about your hardware? ( Soc reference, boot device)
Is it still working with previous Dunfell SW ? If yes could you please provide boot logs ?
Strange that bootrom trace dump fail...
Please confirm you didn't do anything related to security on the platform ( program key on OTP or close the chip ) ?
Olivier
2023-05-16 08:20 AM
Hi @Community member
I am using a STM32MP153AABx, booting from the Nand memory.
I didn't change anything related to the security on the platform. I am using the same configurations as before.
Please see below the logs from the Dunfell version:
NOTICE: CPU: STM32MP153AAB Rev.Z
NOTICE: Model: STMicroelectronics custom STM32CubeMX board
INFO: Reset reason (0x15):
INFO: Power-on Reset (rst_por)
INFO: PMIC version = 0x21
INFO: Using FMC NAND
INFO: Instance 1
INFO: Boot used partition fsbl1
NOTICE: BL2: v2.2-r1.0(debug):v2.2-dirty
NOTICE: BL2: Built : 15:43:39, Jan 12 2023
INFO: Using crypto library 'stm32_crypto_lib'
INFO: BL2: Doing platform setup
INFO: RAM: DDR3-DDR3L 16bits 533000Khz
INFO: Memory size = 0x10000000 (256 MB)
INFO: BL2 runs SP_MIN setup
INFO: BL2: Loading image id 4
INFO: Loading image id=4 at address 0x2ffed000
INFO: Image id=4 loaded: 0x2ffed000 - 0x2ffff000
INFO: BL2: Loading image id 5
INFO: Loading image id=5 at address 0xc0100000
INFO: STM32 Image size : 855747
INFO: Image id=5 loaded: 0xc0100000 - 0xc01d0ec3
WARNING: Skip signature check (header option)
NOTICE: ROTPK is not deployed on platform. Skipping ROTPK verification.
NOTICE: BL2: Booting BL32
INFO: Entry point address = 0x2ffed000
INFO: SPSR = 0x1d3
NOTICE: SP_MIN: v2.2-r1.0(debug):v2.2-dirty
NOTICE: SP_MIN: Built : 15:43:39, Jan 12 2023
INFO: ARM GICv2 driver initialized
INFO: ETZPC: UART1 (3) could be non secure
INFO: ETZPC: SPI6 (4) could be non secure
INFO: ETZPC: HASH1 (8) could be non secure
INFO: ETZPC: CRYP1 (9) could be non secure
INFO: ETZPC: I2C6 (12) could be non secure
INFO: SP_MIN: Initializing runtime services
INFO: SP_MIN: Preparing exit to normal world
U-Boot 2020.01-stm32mp-r1 (Jan 12 2023 - 15:44:47 +0000)
CPU: STM32MP153AAB Rev.Z
Model: STMicroelectronics custom STM32CubeMX board
Board: stm32mp1 in trusted mode (st,stm32mp153a-customized-img-cubemx-mx)
DRAM: 256 MiB
Clocks:
- MPU : 650 MHz
- MCU : 200 MHz
- AXI : 266.500 MHz
- PER : 24 MHz
- DDR : 533 MHz
WDT: Started with servicing (32s timeout)
NAND: 512 MiB
MMC:
Loading Environment from UBI... Read 8192 bytes from volume uboot_config to cddec880
Read 8192 bytes from volume uboot_config_r to cddee8c0
OK
In: serial
Out: serial
Err: serial
invalid MAC address in OTP 00:00:00:00:00:00
Net:
Warning: ethernet@5800a000 (eth0) using random MAC address - e7:44:0c:9c:50:06
eth0: ethernet@5800a000
No autoboot delay. Start Custom OSBoot over nand0!
Scanning ubi 0:...
Found /nand0_extlinux/extlinux.conf
Retrieving file: /nand0_extlinux/extlinux.conf
234 bytes read in 23 ms (9.8 KiB/s)
Retrieving file: /splash.bmp
18244 bytes read in 24 ms (742.2 KiB/s)
Error: 1 bit/pixel mode, but BMP has 8 bit/pixel
1: OpenSTLinux
Retrieving file: /uImage
7350464 bytes read in 1801 ms (3.9 MiB/s)
append: ubi.mtd=UBI rootfstype=ubifs root=ubi0:rootfs rootwait rw console=ttySTM0,115200
Retrieving file: /stm32mp153a-customized-img-cubemx-mx.dtb
56419 bytes read in 26 ms (2.1 MiB/s)
## Booting kernel from Legacy Image at c2000000 ...
Image Name: Linux-5.4.31
Created: 2023-01-12 15:39:29 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 7350400 Bytes = 7 MiB
Load Address: c2000040
Entry Point: c2000040
Verifying Checksum ... OK
## Flattened Device Tree blob at c4000000
Booting using the fdt blob at 0xc4000000
XIP Kernel Image
Loading Device Tree to cdddd000, end cddedc62 ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 5.4.31 (oe-user@oe-host) (gcc version 9.3.0 (GCC)) #1 SMP PREEMPT Tue Nov 15 15:34:18 UTC 2022
[ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: STMicroelectronics custom STM32CubeMX board
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] Reserved memory: created DMA memory pool at 0x10000000, size 0 MiB
[ 0.000000] OF: reserved mem: initialized node mcuram2@10000000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created DMA memory pool at 0x10040000, size 0 MiB
[ 0.000000] OF: reserved mem: initialized node vdev0vring0@10040000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created DMA memory pool at 0x10042000, size 0 MiB
[ 0.000000] OF: reserved mem: initialized node vdev0vring1@10042000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created DMA memory pool at 0x10044000, size 0 MiB
[ 0.000000] OF: reserved mem: initialized node vdev0buffer@10044000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created DMA memory pool at 0x30000000, size 0 MiB
[ 0.000000] OF: reserved mem: initialized node mcuram@30000000, compatible id shared-dma-pool
[ 0.000000] Reserved memory: created DMA memory pool at 0x38000000, size 0 MiB
[ 0.000000] OF: reserved mem: initialized node retram@38000000, compatible id shared-dma-pool
[ 0.000000] cma: Reserved 128 MiB at 0xc5800000
/* ... */
/* Normal kernel initialization */
2023-05-22 09:09 AM
Hi @Vinícius Franchini ,
Lot of change from Dunfell to Kirstone ..
Did you switch to OP-TEE (default) or manage to stay in trusted (SP-MIN) boot scheme ?
Can you share the .tsv for a check?
Else, I would focus on BSP Device Tree as it's the most common pitfall when moving from one version to another.
You might be aware that the one generated by MX are not working as it and require a complete review to fill USER SECTION accordingly.
Can you share TF-A DT ?
Olivier
2023-05-23 01:16 AM
Hi @Community member.
Thank you for your reply.
I am using the trusted boot. Please see below the .tsv file.
#Opt Id Name Type IP Offset Binary
- 0x01 fsbl-boot Binary none 0x0 arm-trusted-firmware/tf-a-stm32mp153a-customized-img-cubemx-mx-usb.stm32
- 0x03 fip-boot FIP none 0x0 fip/fip-stm32mp153a-customized-img-cubemx-mx-trusted.bin
P 0x04 fsbl1 Binary nand0 0x00000000 arm-trusted-firmware/tf-a-stm32mp153a-customized-img-cubemx-mx-nand.stm32
P 0x05 fsbl2 Binary nand0 0x00080000 arm-trusted-firmware/tf-a-stm32mp153a-customized-img-cubemx-mx-nand.stm32
P 0x06 metadata1 Binary nand0 0x00100000 arm-trusted-firmware/metadata.bin
P 0x07 metadata2 Binary nand0 0x00180000 arm-trusted-firmware/metadata.bin
P 0x08 fip-a1 FIP nand0 0x00200000 fip/fip-stm32mp153a-customized-img-cubemx-mx-trusted.bin
P 0x09 fip-a2 FIP nand0 0x00600000 fip/fip-stm32mp153a-customized-img-cubemx-mx-trusted.bin
PED 0x0A fip-b1 FIP nand0 0x00A00000 none
PED 0x0B fip-b2 FIP nand0 0x00E00000 none
P 0x10 ubifs System nand0 0x01200000 custom-os-image-debug-custom-os-stm32mp1-customized-img_nand_4_256_multivolume.ubi
I am aware of the MX code being incomplete. This is why I asked before if there is a way to verify if MX files are correct and/or complete. I couldn't find anything for it.
Best Regards.
2023-05-23 01:26 AM
2023-05-25 04:19 AM
Hi @Community member
I managed to advance a bit more on my issue. Basically I fixed some clock configuration which was messed up by the CubeMX tool when the project was migrated to a newer version. I also needed to remove the `regulator-min-microvolt` and `regulator-max-microvolt` from the ldo3 and I don't know if this is correct, maybe you could confirm. Please see attached the newest dts. Now I can boot up to BL32.
At this stage, the bootloader is not registering the `nand0` device (or not finding it), causing the next stage to fail (full log below).
I am getting the following error:
serial_stm32 serial@40018000: pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19
It is worthy to notice that the U-Boot identifies the nand as `NAND: 0 MiB`, which according to the previous log I posted should be `NAND: 512 MiB`. I thing this is a consequence of the BL32 error.
Do you have any idea how to fix this nand0 issue? The pinout configuration is just like before (Dunfell).
NOTICE: CPU: STM32MP153AAB Rev.Z
NOTICE: Model: STMicroelectronics custom STM32CubeMX board - openstlinux-5.15-yocto-kirkstone-mp1-v22.11.23
INFO: PMIC version = 0x21
INFO: Reset reason (0x14):
INFO: Pad Reset from NRST
INFO: FCONF: Reading TB_FW firmware configuration file from: 0x2ffe2000
INFO: FCONF: Reading firmware configuration information for: stm32mp_io
INFO: Using USB
INFO: Instance 2
INFO: Boot used partition fsbl1
NOTICE: BL2: v2.6-stm32mp1-r1.0(debug):v2.6-dirty
NOTICE: BL2: Built : 13:14:26, Nov 23 2021
INFO: BL2: Doing platform setup
INFO: RAM: DDR3-DDR3L 16bits 533000kHz
INFO: Memory size = 0x10000000 (256 MB)
INFO: DFU USB START...
INFO: phase ID :3, Manifestation 3 at c71181c6
INFO: Send detach request
INFO: Receive DFU Detach
INFO: DFU USB STOP...
INFO: BL2: Loading image id 31
INFO: Loading image id=31 at address 0x2ffff000
INFO: Image id=31 loaded: 0x2ffff000 - 0x2ffff226
INFO: FCONF: Reading FW_CONFIG firmware configuration file from: 0x2ffff000
INFO: FCONF: Reading firmware configuration information for: dyn_cfg
INFO: FCONF: Reading firmware configuration information for: stm32mp1_firewall
INFO: BL2: Loading image id 4
INFO: Loading image id=4 at address 0x2ffc5000
INFO: Image id=4 loaded: 0x2ffc5000 - 0x2ffd9820
INFO: BL2: Skip loading image id 21
INFO: BL2: Skip loading image id 22
INFO: BL2: Loading image id 23
INFO: Loading image id=23 at address 0xc0500000
INFO: Image id=23 loaded: 0xc0500000 - 0xc05129a0
INFO: BL2: Loading image id 26
INFO: Loading image id=26 at address 0x2ffc0000
INFO: Image id=26 loaded: 0x2ffc0000 - 0x2ffc3e58
INFO: BL2: Loading image id 5
INFO: Loading image id=5 at address 0xc0100000
INFO: Image id=5 loaded: 0xc0100000 - 0xc01ece88
NOTICE: BL2: Booting BL32
INFO: Entry point address = 0x2ffc5000
INFO: SPSR = 0x1d3
NOTICE: SP_MIN: v2.6-stm32mp1-r1.0(debug):v2.6-dirty
NOTICE: SP_MIN: Built : 13:14:26, Nov 23 2021
INFO: ARM GICv2 driver initialized
INFO: ETZPC: UART1 (3) could be non secure
INFO: ETZPC: SPI6 (4) could be non secure
INFO: ETZPC: HASH1 (8) could be non secure
INFO: ETZPC: CRYP1 (9) could be non secure
INFO: ETZPC: I2C6 (12) could be non secure
INFO: SP_MIN: Initializing runtime services
INFO: SP_MIN: Preparing exit to normal world
serial_stm32 serial@40018000: pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19
U-Boot 2021.10-stm32mp-r1 (Oct 04 2021 - 15:09:26 +0000)
CPU: STM32MP153AAB Rev.Z
Model: STMicroelectronics custom STM32CubeMX board - openstlinux-5.15-yocto-kirkstone-mp1-v22.11.23
Board: stm32mp1 in trusted mode (st,stm32mp153a-customized-img-cubemx-mx)
DRAM: 256 MiB
Clocks:
- MPU : 650 MHz
- MCU : 200 MHz
- AXI : 266.500 MHz
- PER : 24 MHz
- DDR : 533 MHz
WDT: Started with servicing (32s timeout)
NAND: 0 MiB
MMC:
Loading Environment from nowhere... OK
In: serial
Out: serial
Err: serial
invalid MAC address 0 in OTP 00:00:00:00:00:00
Net:
Error: ethernet@5800a000 address not set.
No ethernet found.
No autoboot delay. Start Custom OSBoot over usb0!
DFU alt info setting: done
#
UPLOAD ... done
Ctrl+C to exit ...
#
FlashLayout received, size = 622
DOWNLOAD ... OK
Ctrl+C to exit ...
#
UPLOAD ... done
Ctrl+C to exit ...
Error: MTD device nand0 not found
DFU alt info setting: done
Reset requested
#
UPLOAD ... done
Ctrl+C to exit ...