cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP157-DK2 can not boot after fuse prog command attempt

IKoch.1
Associate II

Hello!

How to fix STM32MP1157-DK2:

My board cannot boot after attempt of MAC address changing by fuse programming from U-Boot command line:

  fuse prog -y 0 57 0x78563412 0x0000bc9a

Then we got following during boot process:

NOTICE: CPU: STM32MP157CAC Rev.B

   NOTICE: Model: STMicroelectronics STM32MP157C-DK2 Discovery Board

   NOTICE: Board: MB1272 Var2 Rev.C-01

   INFO:   Reset reason (0x10):

   INFO:     Reset due to a failure of VDD_CORE

   INFO:   Using SDMMC

   INFO:     Instance 1

   INFO:   Boot used partition fsbl1

   INFO:   Product_below_2v5=1: HSLVEN update is

   INFO:     destructive, no update as VDD>2.7V

   NOTICE: BL2: v2.0(debug):

   NOTICE: BL2: Built : 13:13:37, Oct 2 2018

   INFO:   BL2: Doing platform setup

   INFO:   PMIC version = 0x10

   INFO:   RAM: DDR3-1066/888 bin G 1x4Gb 533MHz v1.41                           

   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:   Loading image id=5 at address 0xc0100000                              

   INFO:   STM32 Image size : 748404                                             

   WARNING: Skip signature check (header option)                                  

   INFO:   Image id=5 loaded: 0xc0100000 - 0xc01b6b74                            

   INFO:   read version 0 current version 0                                      

   NOTICE: BL2: Booting BL32                                                     

   INFO:   Entry point address = 0x2fff0000                                      

   INFO:   SPSR = 0x1d3                                                          

   PANIC at PC : 0x2fff6243                                                       

   Exception mode=0x00000016 at: 0xfffffffc

We tried to fix it by following:

1) attempt to connect by SWD causes error:

09:40:40 : ST-LINK SN : 0672FF353036465043221036

   09:40:40 : ST-LINK FW : V2J35M0

   09:40:40 : Voltage : 3,21V

   09:40:40 : Error: No STM32 target found!

2) attempt to rewrite software by STM32CubeProgrammer and DFU Boot0=off, Boot2=off causes message:

09:48:15 : USB speed : High Speed (480MBit/s)

   09:48:15 : Manuf. ID : STMicroelectronics

   09:48:15 : Product ID : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000

   09:48:15 : SN : 002A002B3338510939303435

   09:48:15 : FW version : 0x0110

   09:48:15 : Device ID : 0x0500

   09:48:27 : Read TSV File: /home/user/Downloads/en.FLASH-stm32mp1-openstlinux-4.19-thud-mp1-19-10-09/stm32mp1-openstlinux-4.19-thud-mp1-19-10-09/images/stm32mp1/flashlayout_st-image-weston/FlashLayout_sdcard_stm32mp157c-dk2-trusted.tsv

   09:48:27 : Number of partitions: 9

   09:48:36 : Start Embedded Flashing service

   09:48:36 : Memory Programming ...

   09:48:36 : Opening and parsing file: tf-a-stm32mp157c-dk2-trusted.stm32

   09:48:36 : File : tf-a-stm32mp157c-dk2-trusted.stm32

   09:48:36 : Size : 245364 Bytes

   09:48:36 : Partition ID : 0x01

   09:48:36 : Download in Progress:

   09:48:37 : File download complete

   09:48:37 : Time elapsed during download operation: 00:00:00.423

   09:48:37 : RUNNING Program ...

   09:48:37 : PartID: :0x01

   09:48:37 : Start operation done successfully at partition 0x01

   09:48:37 : Flashlayout Programming ...

   09:48:37 : Running Flashlayout Partition ...

   09:48:37 : Flashlayout partition started successfully

   09:48:37 : Memory Programming ...

   09:48:37 : Opening and parsing file: u-boot-stm32mp157c-dk2-trusted.stm32

   09:48:37 : File : u-boot-stm32mp157c-dk2-trusted.stm32

   09:48:37 : Size : 805514 Bytes

   09:48:37 : Partition ID : 0x03

   09:48:37 : Download in Progress:

   09:48:37 : File download complete

   09:48:37 : Time elapsed during download operation: 00:00:00.580

   09:48:37 : RUNNING Program ...

   09:48:37 : PartID: :0x03

   09:48:37 : reconnecting the device ...

   09:49:07 : Error: unable to reconnect the target device: time out expired

   09:49:08 : Error: Start operation failed at partition 0x03

   09:49:08 : Error: TSV flashing service failed

   09:49:08 : Warning: Connection to device 0x500 is lost

   09:49:08 : Disconnected from device.

Thank you in advance!

BR

Ivan

7 REPLIES 7
PatrickF
ST Employee

Hello,

reprogramming non-blank One Time Programming fuses such as MAC address make them corrupted as bits can only be set to '1' and as they are protected by an hidden ECC, which is corrupted as well. Only lower OTP (1024 bits) are set to be fuses one by one.

As MAC address read from OTP return a corruption error, this might explain the panic. I will check if it is possible to skip it.

In future batch of STM32MP15x-DK1/DK2 boards, the MAC address would be write protected to avoid such mistake.

Btw, what is the purpose of changing the MAC address ? MAC address on all ST board is already programmed and there is no need to change it.

Only on your own board, with 'blank' STM32MP15x devices, MAC address in your company attributed range should be programmed in OTP.

Regards

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.

Thank you Patrick!

1)How to fix it?

Is it possible to return previous values by erase - burn or somehow else?

2) We use DK2 board for prototyping and need to understand how to process MAC in future mass production according to assigned purchased MAC range.

Regards

Ivan

PatrickF
ST Employee

You should change the TF-A devicetree to remove bsec mac_address node.

Note: It is then not possible anymore to read the mac address from the OTP (which is anyway corrupted)

With that change, your board should boot, but with an error as MAC address is not set

- the mac address is stored in u-boot env:

  STM32MP> env print ethaddr

 ethaddr=00:80:e1:42:45:20 (address example)

 - So each time you reflash your board, you will need to reinitialize the mac address:

 STM32MP> env set ethaddr 00:80:e1:42:45:20 (address example)

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.

Thank You Patrick!

Regards,

Ivan

IKoch.1
Associate II

Hello!

How to repair my board, I don't understand how to change the TF-A devicetree on my board, I don't understand what tool is helpful in my case?

Regards,

Ivan

Bernard PUEL
ST Employee

Sorry for not being clear .... here are more details:

I/ To modify your TF-A:

https://wiki.st.com/stm32mpu/wiki/STM32MP1_Developer_Package#Modifying_the_TF-A

II/ To be able to boot with your corrupted otp (mac_address), you will need to remove:

this node:

&bsec {

mac_addr: mac_addr@e4 {

reg = <0xe4 0x6>;

};

in this file: stm32mp157c-security.dtsi

III/ Then hile booting your board with the new TF-A devicetree, you won't get the boot error

IV/ But your mac address will be invalid, so you may update it in U-boot (u-boot console):

STM32MP> env set ethaddr 00:80:e1:42:45:20 (address example)

IKoch.1
Associate II

Thank You!

Regards

Ivan