Skip to main content
Associate III
October 19, 2026
Question

OTP read getting failed

Hello,

I’m bringing up a custom board based on STM32MP135F and cannot read OTP reg. 
I am using scarthgap based Yocto distribution “openstlinux-6.6-yocto-scarthgap-mpu-v26.06.10”
I modified DTS of TF-A, Optee, u-boot according to my board. File generated from openstlinux-6.1 version, I am able to able to  do read and write operation.

I am able to program EMMC but not able to do OTP read and write. Getting following error on COM port-
optee optee: TA_NVMEM invoke failed TEE err: ffff0006, err:0
Error: OTP read issue -5
dfu_read: Failed to fill buffer

Error Log from ST-programmer CLI-
Error: Read OTP Partition failed
Error: Uploading the OTP structure failed
Error: Initializing the OTP structure failed

Do I need enable any configuration or any build modification for this openstlinux-6.6?

5 replies

Associate
October 19, 2026

You must explicitly enable the NVMEM TA and BSEC parameters in your OP-TEE OS build flags.

This should give you all you need!

https://wiki.st.com/stm32mpu/wiki/OP-TEE_OTP_overview

 

 

Associate III
October 19, 2026

Hi Ozammo, 
In yocto build setup, where this should be enabled? as I try to build it, I get error. I made a separate build setup and using following command to try to build-

make -f $PWD/../Makefile.sdk.stm32mp13-rt all OPTEE_CONFIG=opteemin-programmer CFG_EMBED_DTB_SOURCE_FILE="stm32mp135f-dk"  CFG_STM32MP_PROFILE=secure_and_system_services   CFG_BSEC_PTA=y     CFG_STM32_BSEC=y     CFG_STM32_BSEC_WRITE=y CFG_TA_STM32MP_NVMEM=y

but then I have to make changes to some more files as I get error.
If I make required changes in files mk/config.mk to disable CFG_EARLY_TA=n and then I could build optee and fip. But it does not have any impact on build system.

mƎALLEm
ST Technical Moderator
October 19, 2026

Hello ​@stack_shailesh

STM32MP135 is a MPU product not a MCU. So you’ve posted this thread in the wrong forum board.

I’m moving it to STM32 MPUs Embedded software and solutions. 

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.