1961661_en-US

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

1961661_en-US

1961661_en-US

s32k312 hse write OTP cant return successfully

Hi NXP,

   i use hse api to set OTP attribute, function,  eg.  use '

Set_Attr(HSE_DEBUG_AUTH_MODE_ATTR_ID, sizeof(hseAttrDebugAuthMode_t), (void *)&mode);

' to set a value . when execute this api, the program halted and not return, after mcu reset, the value has been written.  

when call the api again, or use read operation, it returns  aa55a21c or read value ok, it never crashed.  


my question is, what cause hse set_attr()  not return successfully.

回复: s32k312 hse write OTP cant return successfully

i found this already disscused in community. the reason is  UTEST in plash0.

Re: s32k312 hse write OTP cant return successfully

Hi @victory 

I recommend you to check out the S32K3 MCUs for General Purpose HSE Demo Examples. Here you will find different use-case scenarios and examples to showcase the capabilities of the HSE FW in different devices. Also, you will find the implementation of the SetAttr() function.

Re: s32k312 hse write OTP cant return successfully

thansks, the error return 0xAA55A21C is due to missing some precondition.  how about call Set_Attr cause cpu halt?  i only do 2 steps

1.  use HSE_install_FW project  to install hse fw and check version ok.

2. use my app , just run Set_Attr(HSE_DEBUG_AUTH_MODE_ATTR_ID,...), then mcu halted and have to reset, then check this attr is written.

3. run Set_Attr(HSE_EXTEND_CUST_SECURITY_POLICY_ATTR_ID, ...) , then mcu halted as step2, after reset, check this value is written.

same as write ADKP. etc, i've met this in 2 samples, and every write operation always go to mcu halt.  i think is there any precondtion to set? 

here is my hse wrapper function, since my SDK is hse_ip servicerequest , not hse_send in most examples.


static const uint8_t MUIF = 0;
static hseSrvDescriptor_t gHseSrvDesc[HSE_IP_NUM_OF_CHANNELS_PER_MU] = {0};
static const Hse_Ip_ReqType gSyncTxOption = {HSE_IP_REQTYPE_SYNC, NULL, NULL, 1000000};
hseSrvResponse_t Set_Attr(hseAttrId_t attrId, uint32_t attrLen, void *pAttr)
{
    hseSrvResponse_t ret = HSE_SRV_RSP_GENERAL_ERROR;
    hseSrvDescriptor_t *pHseSrvDesc = NULL;

    uint8_t ch = HSE_IP_INVALID_MU_CHANNEL_U8;

    ch = Hse_Ip_GetFreeChannel(MUIF);
    if (HSE_IP_INVALID_MU_CHANNEL_U8 != ch)
    {
        pHseSrvDesc = &gHseSrvDesc[ch];
        memset(pHseSrvDesc, 0, sizeof(hseSrvDescriptor_t));

        pHseSrvDesc->srvId = HSE_SRV_ID_SET_ATTR;
        pHseSrvDesc->hseSrv.setAttrReq.attrId = attrId;
        pHseSrvDesc->hseSrv.setAttrReq.attrLen = attrLen;
        pHseSrvDesc->hseSrv.setAttrReq.pAttr = (HOST_ADDR)pAttr;
        ret = Hse_Ip_ServiceRequest(MUIF, ch, &gSyncTxOption, pHseSrvDesc);
    }

    return ret;
}


Re: s32k312 hse write OTP cant return successfully

Hi @victory 

The return value 0xAA55A21C means HSE_SRV_RSP_NOT_ALLOWED. This status means the operation is not allowed because of some restrictions (in attributes, life-cycle dependent operations, key management, etc.).

As the data is aready written in the UTEST Sector, as an OTP (One Time Programmable), iit only allows append new data or configuration and read data. Erase and overwrite operations are not allowed.


BR, VaneB

タグ(1)
評価なし
バージョン履歴
最終更新日:
‎11-21-2025 08:36 PM
更新者: