cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MPU257F Stm32CubeProgrammer: Unable to reconnect the target device

pierrelc
Associate

Hello Experts,


Based on STM32MP257F-EV1 we have designed a custom board. For the DDR, PMIC, and eMMC we tried to follow the EV1 rooting as much as possible. There are few differences on the BOM though: 
Our DDR chips are Alliance Memory AS4C1G16D4A-62BCN
Our eMMC is a Kingston EMMC32G-TS0A-01002

We have build an image that can be flashed into the EV1's eMMC without any issues. 
Things go differently when we try to flash our 2 prototypes.  
The first prototype stops after having properly downloaded the partition 0x3 fip-stm32mp257f:

12:15:04 : Number of partitions: 14
12:15:29 : USB speed   : High Speed (480MBit/s)
12:15:29 : Manuf. ID   : STMicroelectronics
12:15:29 : Product ID  : DFU in HS Mode @Device ID /0x505, @Revision ID /0x2000
12:15:29 : SN          : 0029002A4C4250110038344D
12:15:29 : DFU protocol: 1.1
12:15:29 : Board       : --
12:15:29 : Device ID   : 0x0505
12:15:36 : Start Embedded Flashing service
12:15:36 : Opening and parsing file: tf-a-stm32mp257f-tablet-mx-optee-programmer-usb.stm32
12:15:36 : Memory Programming ...
12:15:36 :   File          : tf-a-stm32mp257f-tablet-mx-optee-programmer-usb.stm32
12:15:36 :   Size          : 198.95 KB
12:15:36 :   Partition ID  : 0x01
12:15:36 : Download in Progress:
12:15:38 : File download complete
12:15:38 : Time elapsed during download operation: 00:00:01.946
12:15:38 : RUNNING Program ...
12:15:38 :   PartID:      :0x01
12:15:38 : Reconnecting the device ...
12:15:38 : USB speed   : High Speed (480MBit/s)
12:15:38 : Manuf. ID   : STMicroelectronics
12:15:38 : Product ID  : DFU @Device ID /0x505, @Revision ID /0x0011,  /STM32MP257FAI Rev.Y,
12:15:38 : SN          : 0029002A4C4250110038344D
12:15:38 : DFU protocol: 1.1
12:15:38 : Board       : --
12:15:38 : Device ID   : 0x0505
12:15:38 : Device name : STM32MP257FAI Rev.Y
12:15:38 : Device type :
12:15:38 : Device CPU  :
12:15:38 : Start operation done successfully at partition 0x01
12:15:38 : Opening and parsing file: fip-stm32mp257f-tablet-mx-ddr-optee-programmer-usb.bin
12:15:38 : Memory Programming ...
12:15:38 :   File          : fip-stm32mp257f-tablet-mx-ddr-optee-programmer-usb.bin
12:15:38 :   Size          : 29.38 KB
12:15:38 :   Partition ID  : 0x02
12:15:38 : Download in Progress:
12:15:38 : File download complete
12:15:38 : Time elapsed during download operation: 00:00:00.054
12:15:38 : RUNNING Program ...
12:15:38 :   PartID:      :0x02
12:15:39 : Reconnecting the device ...
12:15:39 : USB speed   : High Speed (480MBit/s)
12:15:39 : Manuf. ID   : STMicroelectronics
12:15:39 : Product ID  : DFU @Device ID /0x505, @Revision ID /0x0011,  /STM32MP257FAI Rev.Y,
12:15:39 : SN          : 0029002A4C4250110038344D
12:15:39 : DFU protocol: 1.1
12:15:39 : Board       : --
12:15:39 : Device ID   : 0x0505
12:15:39 : Device name : STM32MP257FAI Rev.Y
12:15:39 : Device type :
12:15:39 : Device CPU  :
12:15:39 : Start operation done successfully at partition 0x02
12:15:39 : Opening and parsing file: fip-stm32mp257f-tablet-mx-optee-programmer-usb.bin
12:15:39 : Memory Programming ...
12:15:39 :   File          : fip-stm32mp257f-tablet-mx-optee-programmer-usb.bin
12:15:39 :   Size          : 2.97 MB
12:15:39 :   Partition ID  : 0x03
12:15:39 : Download in Progress:
12:15:43 : File download complete
12:15:43 : Time elapsed during download operation: 00:00:03.658
12:15:43 : RUNNING Program ...
12:15:43 :   PartID:      :0x03
12:15:43 : Reconnecting the device ...
12:16:13 : Error: Unable to reconnect the target device: time out expired
12:16:13 : Error: Start operation failed at partition 0x03
12:16:13 : Error: TSV flashing service failed
12:16:14 : Disconnected from device.

 

The second prototype stops after having downloaded the partition 0x02: 
0x2.jpeg

On the USB debug I have: 

NOTICE:  CPU: STM32MP257FAI Rev.Y                       
NOTICE:  Model: STMicroelectronics STM32MP257F-EV1 STM32CubeMX board - openstli1
NOTICE:  Reset reason: Power-on reset (por_rstn) (0x2035)
INFO:    PMIC2 version = 0x11                           
INFO:    PMIC2 product ID = 0x21
INFO:    FCONF: Reading TB_FW firmware configuration file from: 0xe011000
INFO:    FCONF: Reading firmware configuration information for: stm32mp_fuse
INFO:    FCONF: Reading firmware configuration information for: stm32mp_io
INFO:    Using USB
INFO:      Instance 2
INFO:    Boot used partition fsbl1
NOTICE:  BL2: v2.10-stm32mp2-r2.0(debug):lts-v2.10.13-dirty(b1f57509)
NOTICE:  BL2: Built : 17:10:59, Feb 14 2025
INFO:    EventBuffer0: BuffArea=e03f000 DmaAddr=0e03f000 CoherentMapAddr=0xe03f0
INFO:    dwc3_set_dev_speed = HighSpeed
INFO:    DFU USB START...                                                       
INFO:    Event: Link Status Change : ON(0)                                      
INFO:    Event: Link Status Change : Early Suspend(5)                           
INFO:    Event: Link Status Change : L2(3)                                      
INFO:    Event: Suspend                                                         
INFO:    USB Suspend mode                                                       
INFO:    Event: Device Reset                                                    
INFO:    Event: Device Connection Done                                          
INFO:    dwc3_get_dev_speed = HighSpeed                                         
INFO:    Event: Link Status Change : ON(0)                                      
INFO:    Event: Link Status Change : Early Suspend(5)                           
INFO:    Event: Device Reset                                                    
INFO:    Event: Device Connection Done                                          
INFO:    dwc3_get_dev_speed = HighSpeed                                         
INFO:    Event: Link Status Change : ON(0)                                      
INFO:    phase ID :2, Manifestation 0 at e007584                                
INFO:    Send detach request                                                    
INFO:    Receive DFU Detach                                                     
INFO:    DFU USB STOP...                                                        
INFO:    BL2: Loading image id 26                                               
INFO:    Loading image id=26 at address 0xe041000                               
INFO:    Image id=26 loaded: 0xe041000 - 0xe048524                              
INFO:    BL2: Doing platform setup                                              
INFO:    RAM: DDR4 32bits 700000kHz                                             
INFO:    Memory size = 0x100000000 (4096 MB)                                    
INFO:    DFU USB START...                                                       
INFO:    Event: Link Status Change : ON(0)                                      
INFO:    Event: Link Status Change : Early Suspend(5)                           
INFO:    Event: Link Status Change : L2(3)                                      
INFO:    Event: Suspend                                                         
INFO:    USB Suspend mode                                                       
INFO:    Event: Device Reset                                                    
INFO:    Event: Device Connection Done                                          
INFO:    dwc3_get_dev_speed = HighSpeed                                         
INFO:    Event: Link Status Change : ON(0)                                      
INFO:    Event: Link Status Change : Early Suspend(5)                           
INFO:    Event: Device Reset                                                    
INFO:    Event: Device Connection Done                                          
INFO:    dwc3_get_dev_speed = HighSpeed                                         
INFO:    Event: Link Status Change : ON(0)                                      
INFO:    phase ID :3, Manifestation 1 at 872f79b2                               
INFO:    Send detach request                                                    
INFO:    Receive DFU Detach                                                     
INFO:    DFU USB STOP...                                                        
INFO:    BL2: Loading image id 1                                                
INFO:    Loading image id=1 at address 0xe000000                                
INFO:    Image id=1 loaded: 0xe000000 - 0xe000326                               
INFO:    FCONF: Reading FW_CONFIG firmware configuration file from: 0xe000000   
INFO:    FCONF: Reading firmware configuration information for: risaf_config    
INFO:    RISAF2: No configuration in DT, use default                            
INFO:    FCONF: Reading firmware configuration information for: dyn_cfg         
INFO:    BL31 max size = 0x17000 (94208B)                                       
INFO:    BL2: Loading image id 3                                                
INFO:    Loading image id=3 at address 0xe000000                                
INFO:    Image id=3 loaded: 0xe000000 - 0xe0114c1                               
INFO:    BL2: Loading image id 19                                               
INFO:    Loading image id=19 at address 0x81fc0000                              
INFO:    Image id=19 loaded: 0x81fc0000 - 0x81fc3aeb                            
INFO:    BL2: Loading image id 4                                                
INFO:    Loading image id=4 at address 0x82000000                               
INFO:    Image id=4 loaded: 0x82000000 - 0x8200001c                             
INFO:    OPTEE ep=0x82000000                                                    
INFO:    OPTEE header info:                                                     
INFO:          magic=0x4554504f                                                 
INFO:          version=0x2                                                      
INFO:          arch=0x1                                                         
INFO:          flags=0x0                                                        
INFO:          nb_images=0x1                                                    
INFO:    BL2: Loading image id 8                                                
INFO:    Loading image id=8 at address 0x82000000                               
INFO:    Image id=8 loaded: 0x82000000 - 0x820fd798                             
INFO:    BL2: Loading image id 2                                                
INFO:    Loading image id=2 at address 0x84400000                               
INFO:    Image id=2 loaded: 0x84400000 - 0x84418860                             
INFO:    BL2: Loading image id 5                                                
INFO:    Loading image id=5 at address 0x84000000                               
INFO:    Image id=5 loaded: 0x84000000 - 0x841c5008                             
NOTICE:  BL2: Booting BL31                                                      
INFO:    Entry point address = 0xe000000                                        
INFO:    SPSR = 0x3cd                                                           
INFO:    ARM GICv2 driver initialized                                           
NOTICE:  BL31: v2.10-stm32mp2-r2.0(debug):lts-v2.10.13-dirty(b1f57509)          
NOTICE:  BL31: Built : 17:10:59, Feb 14 2025                                    
INFO:    BL31: Initializing runtime services                                    
INFO:    BL31: Initializing BL32                                                
I/TC: Early console on UART#2                                                   
I/TC:                                                                           
I/TC: Embedded DTB found                                                        
I/TC: OP-TEE version: 4.0.0-dev (gcc version 13.3.0 (GCC)) #1 Fri Oct 20 18:29:4
I/TC: WARNING: This OP-TEE configuration might be insecure!                     
I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecturel
I/TC: Primary CPU initializing                                                  
I/TC: WARNING: All debug access are allowed                                     
I/TC: Override the OTP 124: 0 to 0x18db6                                        
I/TC: WARNING: Embeds insecure stm32mp_provisioning driver                      
I/TC: PMIC STPMIC REFID:2.A V1.1                                                
I/TC: Platform stm32mp2: flavor PLATFORM_FLAVOR - DT stm32mp257f-oghji-tablet-ms
I/TC: OP-TEE ST profile: secure_and_system_services                             
[    0.000000] SCP-firmware 2.13.0-intree-optee-os-4.0.0-dev                    
[    0.000000]                                                                  
[    0.000000] [FWK] Module initialization complete!                            
I/TC: Primary CPU switching to normal world boot                                
INFO:    BL31: Preparing for EL3 exit to normal world                           
INFO:    Entry point address = 0x84000000                                       
INFO:    SPSR = 0x3c9                                                           
I/TC: Reserved shared memory is disabled                                        
I/TC: Dynamic shared memory is enabled                                          
I/TC: Normal World virtualization support is disabled                           
I/TC: Asynchronous notifications are enabled                                    
                                                                                
                                                                                
U-Boot 2023.10-stm32mp-r2 (Oct 02 2023 - 14:39:59 +0000)                        
                                                                                
CPU: STM32MP257FAI Rev.Y                                                        
Model: STMicroelectronics STM32MP257F-EV1 STM32CubeMX board - openstlinux-6.6-y1
Board: stm32mp2 (st,stm32mp257f-oghji-tablet-mx)                                
DRAM:  boot device not supported 96                                             
4 GiB                                                                           
optee optee: OP-TEE: revision 4.0 (2a5b1d12)                                    
I/TC: Reserved shared memory is disabled                                        
I/TC: Dynamic shared memory is enabled                                          
I/TC: Normal World virtualization support is disabled                           
I/TC: Asynchronous notifications are enabled                                    
STM32Programmer key pressed, Fastboot key pressed, entering download mode...    
Core:  288 devices, 37 uclasses, devicetree: board                              
WDT:   Started watchdog with servicing every 1000ms (32s timeout)               
NAND:  0 MiB                                                                    
MMC:   gpio_stm32 gpio@44270000: Failed to acquire RIF access on IO GPIOD 9 @ 00
STM32 SD/MMC: 0, STM32 SD/MMC: 1                                                
Loading Environment from nowhere... OK                                          
In:    serial                                                                   
Out:   serial                                                                   
Err:   serial                                                                   
Enter fastboot!                                                                 
invalid MAC address 0 in OTP 00:00:00:00:00:00                                  
Net:   No ethernet found.                                                       
dwc3-generic-wrapper usb@48300000: configured in usb2 mode 



Please note: 

  • We have seen many threads with "Reconnecting the device ..." issues but we could not find a satisfying solution for our custom board
  • After the reconnection fails, the board needs a complete power cycle OFF/ON, otherwise stm32cubeProgrammer can't detect the "USB1" anymore.
  • We have tried 2 Ubuntu 24.04 PCs, and one Mac (we don't use any VM): Same behaviour.
  • We use 2 different 12v power supplies to power the two prototypes.
  • We tried to flash the generic openstlinuxweston-stm32mp2 image. Same conclusion: EV1 flash+runs perfects. Prototypes stops at part 0x2/0x3.
  • We tried all the eMMC .tsv flashlayouts: optee, opteemin, fastboot, fastboot-opteemin. Again, same conclusion : EV1 flash+runs smoothly. Prototypes stops during flash process.

Any idea what could cause this "Unable to reconnect the target device" ?

Thank you



0 REPLIES 0