2020-05-20 03:47 AM
Hi,
Our board is base on STM32MP157C-DK2 and the HW difference are...
1. DK2 CN7 USB Type-C is replaced by micro USB and removed STUSB1600.
2. DK2 CN6 PWR-IN is replaced by DC jack and CC1 is 0.4v to PA4 and CC2 keep 0v to PA5.
And we would like to program SD card (16GB, 8GB) by STM32CubeProgrammer with FlashLayout_sdcard_stm32mp157c-dk2-trusted.tsv
The programmer can connect to our board via USB and this tsv is work to program DK2.
Meanwhile the BOOT pin configures as USB mode (000b).
Show the entire log as below:
17:58:45 : STM32CubeProgrammer API v2.2.0
18:01:10 : Read TSV File: D:\AIRD\LiDAR\firmware\release_image\DK2\DK2-Trusted\FlashLayout_sdcard_stm32mp157c-dk2-trusted.tsv
18:01:10 : Number of partitions: 9
18:01:50 : USB speed : High Speed (480MBit/s)
18:01:50 : Manuf. ID : STMicroelectronics
18:01:50 : Product ID : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
18:01:50 : SN : 004D00363139511138313636
18:01:50 : FW version : 0x0110
18:01:50 : Device ID : 0x0500
18:01:56 : Start Embedded Flashing service
18:01:56 : Memory Programming ...
18:01:56 : Opening and parsing file: tf-a-stm32mp157c-dk2-trusted.stm32
18:01:56 : File : tf-a-stm32mp157c-dk2-trusted.stm32
18:01:56 : Size : 245364 Bytes
18:01:56 : Partition ID : 0x01
18:01:56 : Download in Progress:
18:01:57 : File download complete
18:01:57 : Time elapsed during download operation: 00:00:00.662
18:01:57 : RUNNING Program ...
18:01:57 : PartID: :0x01
18:01:57 : Error: Start operation failed at partition 0x01
18:01:57 : Error: TSV flashing service failed
18:01:57 : Warning: Connection to device 0x500 is lost
18:01:57 : Disconnected from device.
Please advise the possible reason and hint.
Many Thanks.
FC. Tu
Solved! Go to Solution.
2020-05-25 11:23 PM
Hi @fctu
Thanks for clarification. Seems then to be a classical issue, that may have various root cause, and for which we have provided this FAQ article :
Hope this help,
Olivier
2020-05-24 11:39 PM
Hi @fctu
Even if your board design is very close to DK2 there is a high risk that boot chain and particularly TF-A does not fit.
Did you check console log while programming ? I guess you will notice a failure in TF-A execution. ( explaining why you can't proceed further in flash operation)
Please consider to recompile TF-A with a Device Tree fitting perfectly your design :
https://wiki.st.com/stm32mpu/wiki/How_to_create_your_board_device_tree
Hope it help,
Olivier
2020-05-25 07:30 PM
Hi OlivierG,
The programmer can proceed the flash operation since update DTS to TF-A and U-boot.
But the process is stuck on "reconnecting the device ..."
Below is STM32CubeProgrammer log:
=============================================================
19:23:38 : USB speed : High Speed (480MBit/s)
19:23:38 : Manuf. ID : STMicroelectronics
19:23:38 : Product ID : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
19:23:38 : SN : 003600413139511138313636
19:23:38 : FW version : 0x0110
19:23:38 : Device ID : 0x0500
19:23:41 : Start Embedded Flashing service
19:23:41 : Memory Programming ...
19:23:41 : Opening and parsing file: tf-a-stm32mp157c-dk2-trusted.stm32
19:23:41 : File : tf-a-stm32mp157c-dk2-trusted.stm32
19:23:41 : Size : 245364 Bytes
19:23:41 : Partition ID : 0x01
19:23:41 : Download in Progress:
19:23:42 : File download complete
19:23:42 : Time elapsed during download operation: 00:00:00.663
19:23:42 : RUNNING Program ...
19:23:42 : PartID: :0x01
19:23:42 : Start operation done successfully at partition 0x01
19:23:42 : Flashlayout Programming ...
19:23:42 : Running Flashlayout Partition ...
19:23:42 : Flashlayout partition started successfully
19:23:42 : Memory Programming ...
19:23:42 : Opening and parsing file: u-boot-stm32mp157c-dk2-trusted.stm32
19:23:42 : File : u-boot-stm32mp157c-dk2-trusted.stm32
19:23:42 : Size : 801519 Bytes
19:23:42 : Partition ID : 0x03
19:23:42 : Download in Progress:
19:23:43 : File download complete
19:23:43 : Time elapsed during download operation: 00:00:01.571
19:23:43 : RUNNING Program ...
19:23:43 : PartID: :0x03
19:23:43 : reconnecting the device ...
19:24:13 : Error: unable to reconnect the target device: time out expired
19:24:13 : Error: Start operation failed at partition 0x03
19:24:14 : Error: TSV flashing service failed
19:24:14 : Warning: Connection to device 0x500 is lost
19:24:14 : Disconnected from device.
===========================================================
Board side message log as below:
===========================================================
NOTICE: CPU: STM32MP157CAC Rev.?
NOTICE: Model: STMicroelectronics STM32MP157C-DK2 Discovery Board
INFO: Reset reason (0x15):
INFO: fc.tu@coretronic.com
INFO: Power-on Reset (rst_por)
INFO: Using USB
INFO: Instance 2
INFO: Boot used partition fsbl1
NOTICE: BL2: v2.0-r1.5(debug):
NOTICE: BL2: Built : 07:56:09, Nov 5 2019
INFO: BL2: Doing platform setup
INFO: PMIC version = 0x21
INFO: RAM: DDR3-1066/888 bin G 1x4Gb 533MHz v1.45
INFO: Memory size = 0x20000000 (512 MB)
INFO: BL2 runs SP_MIN setup
INFO: BL2: Loading image id 4
INFO: Loading image id=4 at address 0x2fff0000
INFO: Image id=4 loaded: 0x2fff0000 - 0x30000000
INFO: BL2: Loading image id 5
INFO: GETSTATUS :
INFO: DFU_STATE_IDLE
INFO: Receive DFU abort
INFO: GETSTATUS :
INFO: DFU_STATE_IDLE
INFO: UPLOAD :
INFO: Phase ID : 0
INFO: address 0x2ffee780
INFO: GETSTATUS :
INFO: DFU_STATE_IDLE
INFO: GETSTATUS :
INFO: DFU_STATE_IDLE
INFO: UPLOAD :
INFO: Phase ID : 0
INFO: address 0x2ffee780
INFO: GETSTATUS :
INFO: DFU_STATE_IDLE
INFO: Start Download partition 0 to address 0xc0000000 length 0
INFO: USB : DFU : end of download partition : 0
INFO: Loading image id=5 at address 0xc0100000
INFO: GETSTATUS :
INFO: DFU_STATE_IDLE
INFO: UPLOAD :
INFO: Phase ID : 3
INFO: address 0x2ffee780
INFO: GETSTATUS :
INFO: DFU_STATE_IDLE
INFO: GETSTATUS :
INFO: DFU_STATE_IDLE
INFO: UPLOAD :
INFO: Phase ID : 3
INFO: address 0x2ffee780
INFO: GETSTATUS :
INFO: DFU_STATE_IDLE
INFO: usb_partition_size: partition size : 0xc39ef
INFO: Start Download partition 3 to address 0xc0100000 length 801263
INFO: USB : DFU : end of download partition : 3
WARNING: Skip signature check (header option)
INFO: GETSTATUS :
INFO: DFU_STATE_IDLE
INFO: UPLOAD :
INFO: Phase ID : 0
INFO: address 0xffffffff
INFO: Send detach request
INFO: GETSTATUS :
INFO: DFU_STATE_IDLE
INFO: Receive Detach
INFO: Image id=5 loaded: 0xc0100000 - 0xc01c39ef
INFO: read version 0 current version 0
NOTICE: BL2: Booting BL32
INFO: Entry point address = 0x2fff0000
INFO: SPSR = 0x1d3
INFO: PMIC version = 0x21
NOTICE: SP_MIN: v2.0-r1.5(debug):
NOTICE: SP_MIN: Built : 06:47:11, Nov 5 2019
INFO: ARM GICv2 driver initialized
INFO: stm32mp HSI (18): Secure only
INFO: stm32mp HSE (20): Secure only
INFO: stm32mp PLL2 (27): Secure only
INFO: stm32mp PLL2_R (30): Secure only
INFO: SP_MIN: Initializing runtime services
INFO: SP_MIN: Preparing exit to normal world
U-Boot 2018.11-stm32mp-r3 (May 21 2020 - 19:18:21 +0800)
CPU: STM32MP157CAC Rev.?
Model: STMicroelectronics STM32MP157C-DK2 Discovery Board
Board: stm32mp1 in trusted mode (st,stm32mp157c-dk2)
DRAM: 512 MiB
Clocks:
- MPU : 650 MHz
- MCU : 208.878 MHz
- AXI : 266.500 MHz
- PER : 24 MHz
- DDR : 533 MHz
NAND: 0 MiB
MMC: STM32 SDMMC2: 0, STM32 SDMMC2: 1
In: serial
Out: serial
Err: serial
invalid MAC address in OTP 00:00:00:00:00:00Net:
Error: ethernet@5800a000 address not set.
eth-1: ethernet@5800a000
Hit any key to stop autoboot: 0
Boot over usb0!
partitions : Writing GPT: success!
done
DFU alt info setting: done
=========================================================
And WINDOWS's device manager cannot recognize this USB device as well.
I'm trying to figure out why the USB connection will be lost when reconnecting.
I appreciate your any feedback.
Many Thanks.
FC
2020-05-25 11:23 PM
Hi @fctu
Thanks for clarification. Seems then to be a classical issue, that may have various root cause, and for which we have provided this FAQ article :
Hope this help,
Olivier
2020-05-26 05:36 AM
Hi OlivierG,
Thanks for your helping, the problem had been solved.
The root cause was the OTG_VBUS did not wire properly since we removed STUSB1600.
The DFU function is working well now.
Many Thanks,
FC