This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SK-AM69: Keywriter Error in programming SMPKH part 1

Part Number: SK-AM69
Other Parts Discussed in Thread: AM69, TEST2

I am currently having issues trying to program the OTP memory to test out burning in the TI development keys as part of the secure boot process.

I have generated the final_certificate.bin using gen_keywr_cert.sh, then cleaned and recompiled keywriter binary, but I am repeatedly getting a debug_response: 0x1000 from the device in the debug log.

Looking for advise on how to move forward.  I have included debug logs from the device as well.

MCU_UART0.log
 OTP Keywriter ver: 8.6.5--v08.06.05 (Chill Capybar
OTP_VppEn
AM69 SK Detected!!
WKUP_GPIO0_VPP_CTRL output high
Key programming sequence initialted
Taking OTP certificate from 0x41c7f004
Sciclient_otpProcessKeyCfg returns: -1
Debug response: 0x10000
Key programming sequence completed

uart_boot.txt
02000000011a00006a376165700000000000000048534653000801000008010002a60000000000002b28ecde967b79d61619f89cf299205c36d179cacb2b1c5a7f16e3169cc879602122d07ad47ae878a46e243c6f5078c04a5452faceeccb00d0453a5a5e6420daad0bc40b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ab4c0d7a0a257b6e0618664e0b4248cbb7dd47677f31e6b23db760757153f67b
WKUP_UART0.log
0x400002
0xC00004                                                                                                                                                                                                
0x4003007                                                                                                                                                                                               
0x4400865                                                                                                                                                                                               
0x40000B                                                                                                                                                                                                
0xC00004                                                                                                                                                                                                
0x4003007                                                                                                                                                                                               
0x4400865                                                                                                                                                                                               
0x40000D                                                                                                                                                                                                
0xC00004                                                                                                                                                                                                
0x20800000                                                                                                                                                                                              
0x20800001                                                                                                                                                                                              
0x400002                                                                                                                                                                                                
0xC00004                                                                                                                                                                                                
0x4003007                                                                                                                                                                                               
0x4400865                                                                                                                                                                                               
0x400002                                                                                                                                                                                                
0xC00004                                                                                                                                                                                                
0x4003007                                                                                                                                                                                               
0x4400865                                                                                                                                                                                               
0x409031
0xC00004
#
# Decrypting extensions..
#
MPK Options:  0x0
MEK Options:  0x0
MPK Opt P1:  0x0
MPK Opt P2:  0x0
MEK Opt   :  0x0
* SMPKH Part 1 BCH code: e050cadb

* SMPKH Part 2 BCH code: c099dd36

* SMPK Hash (part-1,2):

1f6002b07cd9b0b7c47d9ca8d1aae57b8e8784a12f636b2b760d7d98a18f189700

60dfd0f23e2b0cb10ec7edc7c6edac3d9bdfefe0eddc3fff7fe9ad875195527d00

* SMEK BCH code: a0c6de4e

* SMEK Hash: 92785809a3dfefea57f6bbed642d730ba5d05e601222a72e815bf01ceb3a50f96ab85d282425f684436fabd4c7da624b791da411615035314103cc64e611f532

EXT OTP extension disabled
MSV extension disabled

KEY CNT extension disabled

KEY REV extension disabled

SWREV extension disabled

FW CFG REV extension disabled

* KEYWR VERSION:  0x20000

#
# Programming Keys..
#

* MSV: 
[u32] bch + msv:  0x0
MSV extension disabled
[u32] bch + msv:  0x0

* SWREV: 
[u32] SWREV-SBL:  0x1
[u32] SWREV-SYSFW  :  0x1
SWREV extension disabled
[u32] SWREV-SBL:  0x1
[u32] SWREV-SYSFW  :  0x1

* FW CFG REV: 
[u32] SWREV-FW-CFG-REV:  0x1
SWREV SEC BCFG extension disabled
[u32] SWREV-FW-CFG-REV:  0x1

* EXT OTP: 
EXT OTP extension disabled

* BMPKH, BMEK: 
BMPKH extension disabled
BMEK extension disabled

* SMPKH, SMEK: 
Error in programming SMPKH part 1
debug_response:  0x10000

  • I should note that I am using PROCESSOR-SDK-RTOS-J784S4 version 9.02.00.05 to build Keywriter and have installed the OTP Writer SR1.0 content on that SDK.

  • HI Wayne 

    Can you check if the response in one of the older thread helps you in any way.

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1317252/sk-am69-wkup_gpio0-control-on-sk-am69/5015761#5015761

    Regards
    Diwakar

  • Hello Diwakar, I have not found an older thread that has helped with my issue.

    I checked the link that you provided and I did have that issue when using the 9.01 version of the Processor RTOS SDK.  I incorporated that fix into my 9.01 builds of keywriter and that allowed the application to actually start checking the keywriter certificate contents.  Prior to the fix it wouldnt even check the certificate contents.  Moving to the 9.02 build, these fixes appear to already be in place. 

  • HI Wayne 

    You are trying this on EVM or on custom board ?

    Can you add the override flag for writing the SMPKH and see if it is working.

    On how many sample you have tried this ?

    Regards
    Diwakar

  • Thank you for your responses.

    You are trying this on EVM or on custom board ?

    I am trying this on the sk-AM69 EVM boards. (https://www.ti.com/tool/SK-AM69)

    Can you add the override flag for writing the SMPKH and see if it is working.

    Tried the override flags as you suggested, but the same results occurred.

    On how many sample you have tried this ?

    Three different boards, of the same EVM.

    I have been using the J784S4 RTOS SDK to build keywriter for the AM69-EVM platform.  Is this correct? 

    When I put the device in UART boot mode I see the device name is listed as "j7aep".  Searching around, this seems to correlate to the j721s2 BOARD.  For building keywriter for the sk-AM69 board, what is the correct RTOS SDK?

    ceslab-tda4.github.io/.../mcusw_c_ug_top.html

  • Hi Wayne 

    Allow me some time to check on this internally currently we dont have any official support for the keywriter on AM69.

    Will get back to you once we have some internal alignment.

    Regards
    Diwakar

  • There is another forum question that references the AM69 board, with the same device name, successfully working through using keywriter to program the efuses.  https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1319925/sk-am69-keywriter-error-validating-bmpk-key.

    This would indicate that keywriter is supported on the AM69 board.

    I have verified that I am not running into any of the issues seen in this topic, though.  So not helpful in clearing the issue, but just demonstrating that the AM69 appears to have keywriter support.

  • HI Wayne 

    What are the steps you followed to generate the keywriter image so that we can corss verify if the steps are correct.

    Regards
    Diwakar

  • Diwakar,

    I am primarily following the steps listed on this PDF. https://www.ti.com/lit/an/sprad04/sprad04.pdf

    But I have also tried the steps listed on the PDK - Jacinto User Guide https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-jacinto7/07_03_00_07/exports/docs/pdk_jacinto_07_03_00_29/docs/userguide/jacinto/modules/keywriter.html

    While using PROCESSOR-SDK-RTOS-J784S4 version 9.02.00.05:

    Steps

    • ./gen_keywr_cert.sh -g
    • Copy TI Dummy Keys Provided in J784S4 RTOS SDK
    • ./gen_keywr_cert.sh -s keys/smpk.pem --smek keys/smek.key -t keys/tifekpub.pem -a keys/aes256.key
    • make keywriter_img_clean
    • make keywriter_img
    • Copy the output tiimage to SDCard as tiboot3.bin
    • Boot

    This has also been performed in multiple versions of Ubuntu (18.04, 20.04 and 22.04) with similar results. 

    I have also tried using the -ovrd flags as originally suggested.

  • HI Wayne 

    Thanks for sharing the steps one quick question have you tried writing MSV value or you just tried SMPK hash.

    If not can you give a quick try ?

    The easier way to generate the test cases are 

    • cd <RTOS_SDK>/<pdk>/packages/ti/build/
    • make keywriter_cfg_test_gen BOARD=j7284s4_evm
    • it will generate a different test binary writing different field in the efuses 

    • after that it will generate test images under folder using script generate_test_binaries.sh

      you can get the test images under <pdk>/packages/ti/boot/keywriter/binary/j784s4/test_images folder 

      you can use any test image to flash using any boot media 

    Regards
    Diwakar

  • I followed the steps provided and I am seeing the same failures.  While I have not worked through all of the keywriter test binaries, the 4 I have tried all have resulted in failure indicators for programming that content.  The "Debug response:" indicators match what is attempting to be programmed from that keywriter binary and the resultant failure.

    As of this message, test cases tried (03, 11, 13, and test2 sequence 2).  Outputs in order below.

    Examples of WKUP_UART0 output:

    OTP Keywriter ver: 8.6.5--v08.06.05 (Chill Capybar
    OTP_VppEn
    AM69 SK Detected!!
    WKUP_GPIO0_VPP_CTRL output high
    Key programming sequence initialted
    Taking OTP certificate from 0x41c7f004
    Sciclient_otpProcessKeyCfg returns: -1
    Debug response: 0x10000
    Key programming sequence completed
    OTP Keywriter Version: 02.00.00.00 (May 23 2024 - 16:08:31)

    OTP Keywriter ver: 8.6.5--v08.06.05 (Chill Capybar
    OTP_VppEn
    AM69 SK Detected!!
    WKUP_GPIO0_VPP_CTRL output high
    Key programming sequence initialted
    Taking OTP certificate from 0x41c7f004
    Sciclient_otpProcessKeyCfg returns: -1
    Debug response: 0x800
    Key programming sequence completed

    OTP Keywriter ver: 8.6.5--v08.06.05 (Chill Capybar
    OTP_VppEn
    AM69 SK Detected!!
    WKUP_GPIO0_VPP_CTRL output high
    Key programming sequence initialted
    Taking OTP certificate from 0x41c7f004
    Sciclient_otpProcessKeyCfg returns: -1
    Debug response: 0x2000000
    Key programming sequence completed
    OTP Keywriter Version: 02.00.00.00 (May 23 2024 - 16:08:31)

    OTP Keywriter ver: 8.6.5--v08.06.05 (Chill Capybar
    OTP_VppEn
    AM69 SK Detected!!
    WKUP_GPIO0_VPP_CTRL output high
    Key programming sequence initialted
    Taking OTP certificate from 0x41c7f004
    Sciclient_otpProcessKeyCfg returns: -1
    Debug response: 0x800
    Key programming sequence completed
    OTP Keywriter Version: 02.00.00.00 (May 23 2024 - 16:08:31)

    Interestingly: When trying to program the BMPKH, BMEK portions it appears to have some minor, but not full success. Whereas the other programming values, the attempt would immediately fail out.

    MCU_UART0 debug

    * BMPKH, BMEK:
    Programmed 11/11 rows successfully
    Programmed 2/2 rows successfully
    Programmed 11/11 rows successfully
    Programmed 2/2 rows successfully
    Error in programming BMPKH part 1
    debug_response: 0x800

  • HI Wayne

    I did the same experiment with image (kw_test03.tiimage) at my end and could burn the value in the efuse

    TIFS logs:

    KEY CNT extension disabled
    
    KEY REV extension disabled
    
    SWREV extension disabled
    
    FW CFG REV extension disabled
    
    * KEYWR VERSION:  0x20000
    
    #
    # Programming Keys..
    #
    
    * MSV: 
    [u32] bch + msv:  0x0
    Programmed 2/2 rows successfully
    [u32] bch + msv:  0x8BAC0FFE
    
    * SWREV: 
    [u32] SWREV-SBL:  0x1
    [u32] SWREV-SYSFW  :  0x1
    SWREV extension disabled
    [u32] SWREV-SBL:  0x1
    [u32] SWREV-SYSFW  :  0x1
    
    * FW CFG REV: 
    [u32] SWREV-FW-CFG-REV:  0x1
    SWREV SEC BCFG extension disabled
    [u32] SWREV-FW-CFG-REV:  0x1
    
    * EXT OTP: 
    EXT OTP extension disabled
    
    * BMPKH, BMEK: 
    BMPKH extension disabled
    BMEK extension disabled
    
    * SMPKH, SMEK: 
    SMPKH extension disabled
    SMEK extension disabled
    
    * KEYCNT: 
    [u32] keycnt:  0x0
    KEY CNT extension disabled
    [u32] keycnt:  0x0
    
    * KEYREV: 
    [u32] keyrev:  0x0
    KEY REV extension disabled
    [u32] keyrev:  0x0
    

    MCU UART logs.

    OTP Keywriter Version: 02.00.00.00 (Jun 4 2024 - 14:52:11)
    
    OTP Keywriter ver: 8.6.5--v08.06.05 (Chill Capybar
    OTP_VppEn
    AM69 SK Detected!!
    WKUP_GPIO0_VPP_CTRL output high
    Key programming sequence initialted
    Taking OTP certificate from 0x41c7f004
    Debug response: 0x0
    Key programming sequence completed

    MCU_UART0 debug

    * BMPKH, BMEK:
    Programmed 11/11 rows successfully
    Programmed 2/2 rows successfully
    Programmed 11/11 rows successfully
    Programmed 2/2 rows successfully
    Error in programming BMPKH part 1
    debug_response: 0x800

    This is very strange and you are seeing this kind of issue on all the boards you have ?

    can you share me the changes which you did while enabling the VPP. 

    Regards
    Diwakar

  • I have the seen the same on 3 different SK-AM69 EVM boards that we have.  

    My understanding is that using the 9.02.00.05 version of the SDK has the VPP changes that were needed for this to work.

    Referencing the forum entry you called out earlier I checked the keywriter implementation and it appears that the fix is already in place on the 9.02 version of SDK.  Is this incorrect? Does an additional change need to be made?

  • Hi Wayne,

    My understanding is that using the 9.02.00.05 version of the SDK has the VPP changes that were needed for this to work.

    Let me look into this 

    In the meantime can you test with this image and see if it is working for you.

    kw_test03.tiimage

    Regards
    Diwakar

  • Hello Diwakar,

    I ran the provided image on the previous response and this successfully programmed MSV.  Though I'm not sure where to go from here.  Are you aware of what differences exist between what you generated and what I've been trying to generate with the 9.02 version of the SDK?

    OTP Keywriter Version: 02.00.00.00 (Jun 4 2024 - 14:52:11)

    OTP Keywriter ver: 8.6.5--v08.06.05 (Chill Capybar
    OTP_VppEn
    AM69 SK Detected!!
    WKUP_GPIO0_VPP_CTRL output high
    Key programming sequence initialted
    Taking OTP certificate from 0x41c7f004
    Debug response: 0x0
    Key programming sequence completed

  • Confirmed on two different devices, the kw_test03.tiimage worked to program MSV.

  • HI Wayne 

    I generated the image based on the SDK 9.1 on top of that i applied the patch as mentioned in the reference thread 

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1317252/sk-am69-wkup_gpio0-control-on-sk-am69/5015761#5015761

    We need to see if the changes are already incorporated on the SDK 9.2 or not.

    Regards
    Diwakar