Skip to main content
Visitor II
February 24, 2020
Question

How to use STM32CubeProgrammer to program OTP data

  • February 24, 2020
  • 7 replies
  • 2013 views

I see that the MAC address of the Ethernet is stored in the OTP memory, how to program the OTP data, and whether there are relevant instructions. Is there an editing tool for OTP data?

    This topic has been closed for replies.

    7 replies

    Technical Moderator
    February 24, 2020

    Hi @Jzhua​ 

    A small procedure has been recently documented here :

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

    Let us know if it's answer your need.

    BR,

    Olivier

    JzhuaAuthor
    Visitor II
    February 26, 2020

    I tried to program OTP, and the chip can no longer boot, the serial port displays these contents

    PANIC at PC : 0x2fff5c6b

    Exception mode=0x00000016 at: 0xfffffffc

    USB boot can connect to the computer, but can not flash any firmware.

    Is the chip dead ?

    Can it still be saved ?

    Technical Moderator
    February 26, 2020

    ​Hi @Jzhua​ 

    Please could you precise which OTP you tried to program ?

    Thx

    Olivier

    JzhuaAuthor
    Visitor II
    February 27, 2020

    i run this cmd to program the otp

    STM32_Programmer_CLI -c port=usb1 -otp program wordID=0x39 value=0x42e18000

    STM32_Programmer_CLI not successful, it stuck, I'm forced to shut down the program,That's it

    JzhuaAuthor
    Visitor II
    February 27, 2020

    Today I found that the mpu cannot be booted with a trusted image, but it can be booted with a basic image

    Technical Moderator
    February 28, 2020

    ​Hi @Jzhua​ 

    This confirm you proceed to forbiden change of MAC address on ST board.

    You may have miss the warning banner :

    MAC address / board Id OTP write should not be performed on ST boards ! They are written and protected by ECC during factory production. Any further write will break the board with no way to recover if these OTP are not locked

    This OTP can no more be recovered, but you can still work with the board either using non secure boot as you mention in your last post, or by removing mac reference in &bsec node of the TF-A DTS.

    Hope it help,

    Olivier

    Technical Moderator
    February 28, 2020

    ​As a complement.

    Once  remove bsec mac_address node, the board is boot normally with the right mac address

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

     STM32MP> env print ethaddr

     ethaddr=00:80:e1:42:45:20

    - So if you reflash your board, you will need to reinitialse the mac address:

     STM32MP> env set ethaddr 00:80:e1:42:45:20

    Olivier

    JzhuaAuthor
    Visitor II
    March 2, 2020

    I am using a custom board, not an ST board. Does this mean that I cannot set a MAC address?

    How do I set the MAC address by programming OTP during mass production,or do you have other suggestions

    Technical Moderator
    March 24, 2020

    Hi @Jzhua​ 

    Sorry to miss you last comment.

    Indeed MAC address can be set on STM32MP1 sample not previously programmed. That might be the case for the one on you custom board.

    Do you finally succeed ?

    Thanks

    Olivier