@@ -7,40 +7,63 @@ platform directly from your PC.
77
88To get started, download STM32 Cube Programmer from the [ ST
99website] ( https://www.st.com/en/development-tools/stm32cubeprog.html ) .
10- We tested with version 2.16 .0, and the below instructions assume that STM32 Cube
10+ We tested with version 2.21 .0, and the below instructions assume that STM32 Cube
1111Programmer is installed in the ` $HOME/stm32cube ` folder.
1212
1313STM32 Cube Programmer will be used to reflash the SD card, with the SD
14- card inserted in the STM32MP1 platform.
15-
16- The following procedure (done for the stm32mp157f-dk2 profile) is also valid for
17- stm32mp135f-dk and the demo profiles.
14+ card inserted in the STM32MP platform. If you want to reflash an eMMC storage
15+ device instead, the ` flash.tsv ` file will have to be adapted.
1816
1917Follow these steps:
2018
21191 . Switch the boot mode switch SW1 to USB boot
22- 2 . Plug a second USB-C cable on CN7
20+ - STM32MP157: BOOT0 and BOOT2 to OFF
21+ - STM32MP135: BOOT0, BOOT1 and BOOT2 to OPEN
22+ - STM32MP2* : BOOT0, BOOT1, BOOT2 and BOOT3 to OPEN
23+ 2 . Plug a second USB-C cable on CN7 on the STM32MP157/135 or CN15 on the
24+ STM32MP257F-EV1.
23253 . Copy images in a dedicated folder
2426``` bash
25- $ mkdir flash
26- $ cp bin/targets/stm32/stm32mp1/trusted-firmware-a-stm32mp157f-dk2/tf-a-stm32mp157f-dk2.stm32 flash/
27- $ cp staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/image/fip-stm32mp157f-dk2.bin flash/
28- $ cp bin/targets/stm32/stm32mp1/openwrt-stm32-stm32mp1-stm32mp157f-dk2-ext4-factory.img.gz flash/
27+ # STM32MP1 based boards
28+ $ mkdir tmp
29+ $ cp flashing/tf-a-stm32mp157_usb.stm32 tmp/
30+ $ cp flashing/fip-stm32mp157_usb.bin tmp/
31+ $ cp bin/targets/stm32/stm32mp1/openwrt-stm32-stm32mp1-stm32mp157f-dk2-ext4-factory.img.gz tmp/
32+ ```
33+ ``` bash
34+ # STM32MP2 based boards
35+ $ mkdir tmp
36+ $ cp flashing/tf-a-stm32mp257_dk_usb.stm32 tmp/
37+ $ cp flashing/fip-stm32mp257_dk_usb.bin tmp/
38+ $ cp flashing/fip-ddr-stm32mp257_dk_usb.bin tmp/
39+ $ cp bin/targets/stm32/stm32mp2/openwrt-stm32-stm32mp2-stm32mp257f-dk-ext4-factory.img.gz tmp/
2940```
30414 . Decompress the factory image
3142``` bash
32- $ gzip -d flash /openwrt-stm32-stm32mp1-stm32mp157f-dk2-ext4-factory.img.gz
43+ $ gzip -d tmp /openwrt-stm32-stm32mp1-stm32mp157f-dk2-ext4-factory.img.gz
3344```
34455 . Create the ` flash.tsv ` file
3546``` bash
36- $ cat flash/flash.tsv
37- - 0x01 fsbl-boot Binary none 0x0 tf-a-stm32mp157f-dk2.stm32
38- - 0x03 fip-boot FIP none 0x0 fip-stm32mp157f-dk2.bin
47+ # STM32MP1 based boards
48+ $ cat tmp/flash.tsv
49+ - 0x01 fsbl-boot Binary none 0x0 tf-a-stm32mp157_usb.stm32
50+ - 0x03 fip-boot FIP none 0x0 fip-stm32mp157_usb.bin
3951P 0x10 sdcard RawImage mmc0 0x0 openwrt-stm32-stm32mp1-stm32mp157f-dk2-ext4-factory.img
4052```
53+ ``` bash
54+ # STM32MP2 based boards
55+ $ cat tmp/flash.tsv
56+ - 0x01 fsbl-boot Binary none 0x0 tf-a-stm32mp257_dk_usb.stm32
57+ - 0x02 fip-ddr Binary none 0x0 fip-ddr-stm32mp257_dk_usb.bin
58+ - 0x03 fip-boot Binary none 0x0 fip-stm32mp257_dk_usb.bin
59+ P 0x10 sdcard RawImage mmc0 0x0 openwrt-stm32-stm32mp2-stm32mp257f-dk-ext4-factory.img
60+ ```
41616 . Run the command to start flashing
4262```
43- $ $HOME/stm32cube/bin/STM32_Programmer_CLI -c port=usb1 -w ./flash /flash.tsv
63+ $ $HOME/stm32cube/bin/STM32_Programmer_CLI -c port=usb1 -w ./tmp /flash.tsv
4464```
45657 . Switch back the boot mode switch to SD boot
66+ - STM32MP157: BOOT0 and BOOT2 to ON
67+ - STM32MP135: BOOT0 to ON, BOOT1 to OPEN, BOOT2 to ON
68+ - STM32MP2* : BOOT0 to ON, BOOT1, BOOT2 and BOOT3 to OPEN
46698 . Reboot the platform
0 commit comments