cancel
Showing results for 
Search instead for 
Did you mean: 

Can't read OTP bits on STM32MP157C-DK2 using STM32CubeProgrammer

DMart.3
Associate II

Hi I'm trying to read the OTP bits on the discovery board STM32MP157C-DK2 using the STM32CubeProgrammer v2.4.0. The GUI version can't read the OTP bits, but I tried with the Command Line Interface and it gave me the following error:

C:\Program Files (x86)\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin>stm32_programmer_cli.exe --connect port=usb1 -otp displ
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.4.0
      -------------------------------------------------------------------
 
 
 
USB speed   : High Speed (480MBit/s)
Manuf. ID   : STMicroelectronics
Product ID  : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
SN          : 002A00413338510939303435
FW version  : 0x0110
Device ID   : 0x0500
Device name : STM32MPxxx
Device type : MPU
Device CPU  : Cortex-A7
 
 
UPLOADING OTP STRUCTURE ...
  Partition     : 242
  Size          : 1024 Bytes
 
Uploading OTP data:
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒Error:
 
Error: unable to get the associate alternate setting of partition ID: 0xf2
Error: please make sure that your alternate settings have string descriptors with the right format
Error: the specified partition: 0xf2 is unreachable
Error: Read OTP Partition failed
 
 
Error: Uploading the OTP structure failed
Error: Initializing the OTP structure failed
 0%

What am I doing wrong?

My final goal is to change these OTP bits because on my custom board we have an eMMC connected to SDMMC1 and the WiFi connected to SDMMC2 (The default is the SD card on SDMMC1).

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
Olivier GALLIEN
ST Employee

Hi @DMart.3​ 

looks like you miss the step to first load u-boot in order to get 0xf2 partition.

refer to :

https://wiki.st.com/stm32mpu/wiki/STM32CubeProgrammer#How_to_fuse_STM32MP15x_OTP

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

8 REPLIES 8
Olivier GALLIEN
ST Employee

Hi @DMart.3​ 

looks like you miss the step to first load u-boot in order to get 0xf2 partition.

refer to :

https://wiki.st.com/stm32mpu/wiki/STM32CubeProgrammer#How_to_fuse_STM32MP15x_OTP

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.
DMart.3
Associate II

Hi OlivierG,

Thanks! I've tried your sujestion and it worked!

On my final board I will have an eMMC instead of an SDCard connected to the SDMMC1, so I think that I have to change the emmc_if_id bits of the CFG3 word to "1", am I wright?

Thanks!

PatrickF
ST Employee

CFG3 is not enough, you need also to define the pins used by the BootROM.

see https://community.st.com/s/question/0D50X0000AkQJiHSQW/how-to-change-emmc-interface

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.
DMart.3
Associate II

Thanks!

We will try it soon. As soon as I have results (I hope that they are good results 🙂 ) I will give the news!

Best Regards!

DMart.3
Associate II

Hi OlivierG,

To gain some time (while my custom board is not ready), I have decided to try the eMMC on the STM32MP157A-DK1. I have changed the OTP3, 5 and 6 as referred on the link above, but the system doesn't boot up. On the ST-Link terminal there isn't any printed message and the LD6 led is flashing.

I know that it is necessary to change the Device Tree but before that it will be necessary to start the fsbl partition. On the link above it is mentioned that "... and rebuild all subsequent level of boot to use SDMMC1 interface and pins (including all eMMC data lines pins , as later stages use 8-bit data mode)".

How do I do that? Can you point me on the right direction?

I also have an STM32MP157C-DK2 board, but I don't think that this is the problem.

Thanks in advance!

PatrickF
ST Employee

Hi @DMart.3,

some causes which could explain the LD6 red led flashing

  • BOOT pins should be set to eMMC (i.e. 0b010). as the switches are only for BOOT0 and BOOT2, this need some HW action to set BOOT1 = VDD (need to disconnect R82 and connect BOOT2 to VDD)
  • OTP values you set are not correct. If you share the values, I can have a look.
  • eMMC content is not correct (e.g. bad image header or misprogramming)

Beside that, I think you can load your customized TF-A and uBoot in RAM using CubeProgrammer (a stripdown .tsv is needed), then I think you can check if eMMC is accessible from uBoot (this is not possible from stock images as eMMC is expected on SDMMC2)

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.
DMart.3
Associate II

Hi @PatrickF​ ! Thanks for the quick answer!

It is working now! I was looking everywere and forgot about the BOOT pins... I made the HW changes on the BOOT1 pin and now it is working.

Now, I want to use the eMMC with 8 data bits instead of the current 4 but the new lines have no signals (checking with the osciloscope). I made the following changes:

  • I adapted the hardware to connect to the external eMMC socket to the new data lines on PB8, PB9, PE5 and PC7.
  • I changed the I've changed the sdmmc1_b4_pins_a, sdmmc1_b4_od_pins_a and sdmmc1_b4_sleep_pins_a on stm32mp15-pinctrl.dtsi
  • I changed &sdmmc1 {bus-width} on stm32mp157a-dk1.dts from 4 to 8.

But these changes have no effect on the change to 8-bits.

Do you now what can be the problem?

Thanks in advance!

I'm not specialist of the SW aspects, so, some clues:

  • no error messages ?
  • check if you updated all the related DT (tf-a, u-boot and kernel). I assume you already check this and this wiki pages.
  • there is probably some Linux command to check the eMMC settings (e.g. width)
  • maybe the 8-bit mode, even if allowed, is not used by TF-A nor uBoot and only by Linux kernel
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.