cancel
Showing results for 
Search instead for 
Did you mean: 

Reboot SoC after DFU without having to do it physically

APeña.1
Associate II

Hello all,

 

I managed to enter the DFU mode by rebooting the SoC from the command line after setting the proper tamper register to get the Uboot to select my desired USB boot mode. After flashing the new image with the STM32CubeProgrammer I would like to be able to reboot the SoC again without having to do press physically the reset button or have to type the reset command inthe Uboot with a STLink console.

 

I see in the wiki that the proper configuration of the tsv file should be able to trigger a RESET PhaseID (0xFF) but I have no clue on how to do it. I entered the line "-      0xFF   reset  Binary none   0x0    arm-trusted-firmware/tf-a-stm32mp157c-demo-logic-analyser-mx-serialboot.stm32" at the end of my tsv file but it does not do the trick. By checking the stm32prog.c source code it seems that that PhaseID is unusable and will only be triggered in case of an error ocurring during the flashing process.

 

I would really appreciate some help with this topic. If there is also an alternative way to trigger the reset from the USB connection not being the reset PhaseID it would also be useful.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Olivier GALLIEN
ST Employee

Hi @Alberto Peña Vidal​ ,

STM32CubeProgrammer is not provided solution for such reset.

But this is possible with following dfu-util command :

dfu-util -d 0483:df11 -a 0 -e -R

You can then do following command sequence exemple :

$> STM32_Programmer_CLI -c port=usb1 -w FlashLayout_SDCARD.tsv -> program you boot device

$> STM32_Programmer_CLI -c port=usb1 -otp displ … -> read or write OTP

$> dfu-util -d 0483:df11 -a 0 -e -R -> reset

Please give a try and let me know if it fit your need

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

3 REPLIES 3
Olivier GALLIEN
ST Employee

Hi @Alberto Peña Vidal​ ,

STM32CubeProgrammer is not provided solution for such reset.

But this is possible with following dfu-util command :

dfu-util -d 0483:df11 -a 0 -e -R

You can then do following command sequence exemple :

$> STM32_Programmer_CLI -c port=usb1 -w FlashLayout_SDCARD.tsv -> program you boot device

$> STM32_Programmer_CLI -c port=usb1 -otp displ … -> read or write OTP

$> dfu-util -d 0483:df11 -a 0 -e -R -> reset

Please give a try and let me know if it fit your need

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hello @Community member​ ,

thank you very much for your reply. That works like a charm :)

Kamil Mozdzynski
Associate

Hi!

I am currently working on the same topic.

dfu-util -d 0483: df11 -a 0 -e -R -> reset only disconnects the USB port and U-boot goes to the application without performing MCU reset. I am using TF-A and U-boot files from starter package.

The phase id is 0xFE and the detach command does not force a reset.

Regards,

Kamil

NOTICE:  CPU: STM32MP157FAA Rev.Z
NOTICE:  Model: STMicroelectronics STM32MP157F eval daughter on eval mother
NOTICE:  Board: MB1263 Var4.0 Rev.C-03
INFO:    Reset reason (0x15):
INFO:      Power-on Reset (rst_por)
INFO:    PMIC version = 0x20
INFO:    Using USB
INFO:      Instance 2
INFO:    Boot used partition fsbl1
NOTICE:  BL2: v2.2-r2.0(debug):v2.2-dirty
NOTICE:  BL2: Built : 13:36:23, Oct 22 2019
INFO:    Using crypto library 'stm32_crypto_lib'
INFO:    BL2: Doing platform setup
INFO:    RAM: DDR3-DDR3L 32bits 533000Khz
INFO:    Memory size = 0x40000000 (1024 MB)
INFO:    BL2 runs SP_MIN setup
INFO:    BL2: Loading image id 4
INFO:    Loading image id=4 at address 0x2ffeb000
INFO:    Image id=4 loaded: 0x2ffeb000 - 0x2ffff000
INFO:    BL2: Loading image id 5
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:    UPLOAD :
INFO:                   Phase ID : 3
INFO:                   address 0x2ffe5988
INFO:    GETSTATUS :
INFO:                   DFU_STATE_IDLE
INFO:    Receive DFU abort
INFO:    usb_partition_size: partition size : 0xd5a19
INFO:    Start Download partition 3 to address 0xc0100000 length 875033
INFO:    USB : DFU : end of download partition : 3
INFO:    UPLOAD :
INFO:                   Phase ID : 0
INFO:                   address 0xffffffff
INFO:    Send detach request
INFO:    UPLOAD :
INFO:                   Phase ID : 0
INFO:                   address 0xffffffff
INFO:    Send detach request
INFO:    UPLOAD :
INFO:                   Phase ID : 0
INFO:                   address 0xffffffff
INFO:    Send detach request
INFO:    GETSTATUS :
INFO:                   DFU_STATE_IDLE
INFO:    Receive DFU abort
INFO:    Receive Detach
INFO:    Image id=5 loaded: 0xc0100000 - 0xc01d5a19
WARNING: Skip signature check (header option)
NOTICE:  ROTPK is not deployed on platform. Skipping ROTPK verification.
NOTICE:  BL2: Booting BL32
INFO:    Entry point address = 0x2ffeb000
INFO:    SPSR = 0x1d3
NOTICE:  SP_MIN: v2.2-r2.0(debug):v2.2-dirty
NOTICE:  SP_MIN: Built : 13:36:23, Oct 22 2019
INFO:    ARM GICv2 driver initialized
INFO:    Set calibration timer to 60 sec
INFO:    stm32mp IWDG1 (12): Secure
INFO:    SP_MIN: Initializing runtime services
INFO:    SP_MIN: Preparing exit to normal world
 
 
U-Boot 2020.01-stm32mp-r1 (Jan 06 2020 - 20:56:31 +0000)
 
CPU: STM32MP157FAA Rev.Z
Model: STMicroelectronics STM32MP157F eval daughter on eval mother
Board: stm32mp1 in trusted mode (st,stm32mp157f-ev1)
Board: MB1263 Var4.0 Rev.C-03
DRAM:  1 GiB
Clocks:
- MPU : 800 MHz
- MCU : 208.878 MHz
- AXI : 266.500 MHz
- PER : 24 MHz
- DDR : 533 MHz
WDT:   Started with servicing (32s timeout)
NAND:  1024 MiB
MMC:   STM32 SD/MMC: 0, STM32 SD/MMC: 1
In:    serial
Out:   serial
Err:   serial
Net:   eth0: ethernet@5800a000
Hit any key to stop autoboot:  0
Boot over usb0!
partitions : done
Phase=END
DFU alt info setting: done
crq->brequest:0x0
#
UPLOAD ... done
Ctrl+C to exit ...
Download done
STM32MP>