ADKP Programming with HSE returning HSE_SRV_RSP_INVALID_PARAM

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

ADKP Programming with HSE returning HSE_SRV_RSP_INVALID_PARAM

跳至解决方案
710 次查看
Bhushan1312
Contributor I

Hello Team,

I am trying to program ADKP using HSE FW installed on MCU, but getting HSE_SRV_RSP_INVALID_PARAM error.

Same sequence works well (HSE_SRV_RSP_OK) if i do Step-In using debugger inside HSE_ProgramAdkp() function.

I can read HSE FW Version, Auth mode without any issue.

Only for ADKP programming i am getting HSE_SRV_RSP_INVALID_PARAM error.

Attached is my Linker file. I have mapped all HSE variables to int_sram_no_cacheable region. Also, stack is mapped to int_sram_no_cacheable.  

Please let me know where its going wrong.

 

 

0 项奖励
回复
1 解答
512 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Yes, this approach is correct. The question is why you are getting HSE_SRV_RSP_INVALID_PARAM. I would step this down to the HSE_IP_ServiceRequest to check the HSE descriptor and address which is sent to MU. And I would try to disable the cache completely to see if it makes a difference. 

What to force to RAM:

HSE_IP_ServiceRequest – be aware that this function calls some other functions.

 

This is the critical part of code inside the function when using synchronous mode:

 

if (HSE_IP_REQTYPE_SYNC == pRequest->eReqType)

        {

            /* Convert from microseconds to ticks */

            u32TimeoutTicks = OsIf_MicrosToTicks(pRequest->u32Timeout, (OsIf_CounterType)HSE_IP_TIMEOUT_OSIF_COUNTER_TYPE);

            /* Send the service request to HSE */

            Mu_Ip_SetTxRegister(Hse_Ip_apMuBase[u8MuInstance], u8MuChannel, (uint32)pHseSrvDesc);

            /* Read the current value of the counter */

            u32CurrentTicks = OsIf_GetCounter((OsIf_CounterType)HSE_IP_TIMEOUT_OSIF_COUNTER_TYPE);

            /* Wait for the HSE response */

            while ((FALSE == Mu_Ip_IsResponseReady(Hse_Ip_apMuBase[u8MuInstance], u8MuChannel)) && (u32ElapsedTicks < u32TimeoutTicks))

            {

                /* Update the elapsed ticks, current ticks will be updated too by the OsIf function */

                u32ElapsedTicks += OsIf_GetElapsed(&u32CurrentTicks, (OsIf_CounterType)HSE_IP_TIMEOUT_OSIF_COUNTER_TYPE);

            }

 

The Mu_Ip… functions are inlined, so there’s no problem. But OsIf functions from BaseNXP module are not inlined, so you need to move them to RAM too. I recommend to step the function to see that all the code executed in this area is running from RAM. Or you can check the map file as well.

Regards,

Lukas

在原帖中查看解决方案

0 项奖励
回复
4 回复数
390 次查看
Bhushan1312
Contributor I

Hello @lukaszadrapa.

ADKP programming seems to be working with Linker changes (linker attached). As in previous linker i made too much of changes by mapping all data variables to SRAM section, also the stack was mapped to non-cacheable region.

I have not moved any of the functions to RAM or other flash section.

I am yet to confirm LC stage advancement. 

Thank You for your support.

 

 

0 项奖励
回复
613 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @Bhushan1312 

Are you forcing HSE descriptors to DTCM?

lukaszadrapa_0-1767359890040.png

DTCM memory at address 0x2000_0000 is visible only for core. Other bus masters can access DTCM only via backdoor addresses at 0x2100_0000. So, I do not recommend to use DTCM for HSE variables, use normal non-cacheable SRAM instead. 

And next point - when programming ADKP, be aware that this service programs UTEST memory. And that UTEST memory is in the same partition as flash block 0. That means the code should be executed from another flash block or from RAM. Otherwise it could lead to read-while-write errors. 

Regards,

Lukas

 

0 项奖励
回复
526 次查看
Bhushan1312
Contributor I

Hello @lukaszadrapa,

Thank you for the reply.

Yes, HSE descriptors are forced to DTCM and accessed same with offset as below:

Bhushan1312_0-1767586452894.png

Let me know if this is fine to work with.

For 2nd point: Do i need to move all the functions (given below) responsible for ADKP programming to other Flash Sector or RAM?

HSE_ProgramAdkp -> SetAttr -> HSE_Send -> Hse_Ip_ServiceRequest.
 
 

 

 

0 项奖励
回复
513 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Yes, this approach is correct. The question is why you are getting HSE_SRV_RSP_INVALID_PARAM. I would step this down to the HSE_IP_ServiceRequest to check the HSE descriptor and address which is sent to MU. And I would try to disable the cache completely to see if it makes a difference. 

What to force to RAM:

HSE_IP_ServiceRequest – be aware that this function calls some other functions.

 

This is the critical part of code inside the function when using synchronous mode:

 

if (HSE_IP_REQTYPE_SYNC == pRequest->eReqType)

        {

            /* Convert from microseconds to ticks */

            u32TimeoutTicks = OsIf_MicrosToTicks(pRequest->u32Timeout, (OsIf_CounterType)HSE_IP_TIMEOUT_OSIF_COUNTER_TYPE);

            /* Send the service request to HSE */

            Mu_Ip_SetTxRegister(Hse_Ip_apMuBase[u8MuInstance], u8MuChannel, (uint32)pHseSrvDesc);

            /* Read the current value of the counter */

            u32CurrentTicks = OsIf_GetCounter((OsIf_CounterType)HSE_IP_TIMEOUT_OSIF_COUNTER_TYPE);

            /* Wait for the HSE response */

            while ((FALSE == Mu_Ip_IsResponseReady(Hse_Ip_apMuBase[u8MuInstance], u8MuChannel)) && (u32ElapsedTicks < u32TimeoutTicks))

            {

                /* Update the elapsed ticks, current ticks will be updated too by the OsIf function */

                u32ElapsedTicks += OsIf_GetElapsed(&u32CurrentTicks, (OsIf_CounterType)HSE_IP_TIMEOUT_OSIF_COUNTER_TYPE);

            }

 

The Mu_Ip… functions are inlined, so there’s no problem. But OsIf functions from BaseNXP module are not inlined, so you need to move them to RAM too. I recommend to step the function to see that all the code executed in this area is running from RAM. Or you can check the map file as well.

Regards,

Lukas

0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-2270415%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E4%BD%BF%E7%94%A8%E8%BF%94%E5%9B%9E%20HSE_SRV_RSP_INVALID_PARAM%20%E7%9A%84%20HSE%20%E8%BF%9B%E8%A1%8C%20ADKP%20%E7%BC%96%E7%A8%8B%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2270415%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%EF%BC%8C%E5%9B%A2%E9%98%9F%E3%80%81%3C%2FP%3E%3CP%3E%E6%88%91%E6%AD%A3%E8%AF%95%E5%9B%BE%E4%BD%BF%E7%94%A8%20MCU%20%E4%B8%8A%E5%AE%89%E8%A3%85%E7%9A%84%20HSE%20FW%20%E5%AF%B9%20ADKP%20%E8%BF%9B%E8%A1%8C%E7%BC%96%E7%A8%8B%EF%BC%8C%E4%BD%86%E5%8D%B4%E5%87%BA%E7%8E%B0%20HSE_SRV_RSP_INVALID_PARAM%20%E9%94%99%E8%AF%AF%E3%80%82%3C%2FP%3E%3CP%3E%3CSPAN%3E%E5%A6%82%E6%9E%9C%E6%88%91%E5%9C%A8%20HSE_ProgramAdkp()%E5%87%BD%E6%95%B0%E5%86%85%E4%BD%BF%E7%94%A8%E8%B0%83%E8%AF%95%E5%99%A8%E8%BF%9B%E8%A1%8C%20Step-In%20%E8%B0%83%E8%AF%95%EF%BC%8C%3C%2FSPAN%3E%E5%90%8C%E6%A0%B7%E7%9A%84%E5%BA%8F%E5%88%97%E4%B9%9F%E8%83%BD%E6%AD%A3%E5%B8%B8%E5%B7%A5%E4%BD%9C%3CSPAN%3E%EF%BC%88HSE_SRV_RSP_OK%3C%2FSPAN%3E%EF%BC%89%E3%80%82%3C%2FP%3E%3CP%3E%E6%88%91%E5%8F%AF%E4%BB%A5%E9%A1%BA%E5%88%A9%E8%AF%BB%E5%8F%96%20HSE%20FW%20%E7%89%88%E6%9C%AC%E5%92%8C%20Auth%20%E6%A8%A1%E5%BC%8F%E3%80%82%3C%2FP%3E%3CP%3E%E5%8F%AA%E6%9C%89%20ADKP%20%E7%BC%96%E7%A8%8B%E6%97%B6%EF%BC%8C%E6%88%91%E6%94%B6%E5%88%B0%20HSE_SRV_RSP_INVALID_PARAM%20%E9%94%99%E8%AF%AF%E3%80%82%3C%2FP%3E%3CP%3E%E9%99%84%E4%B8%8A%E6%88%91%E7%9A%84%E9%93%BE%E6%8E%A5%E5%99%A8%E6%96%87%E4%BB%B6%E3%80%82%E6%88%91%E5%B7%B2%E5%B0%86%E6%89%80%E6%9C%89%20HSE%20%E5%8F%98%E9%87%8F%E6%98%A0%E5%B0%84%E5%88%B0%20int_sram_no_cacheable%20%E5%8C%BA%E5%9F%9F%E3%80%82%E6%AD%A4%E5%A4%96%EF%BC%8C%E5%A0%86%E6%A0%88%E8%A2%AB%E6%98%A0%E5%B0%84%E5%88%B0%20int_sram_no_cacheable%E3%80%82%20%20%3C%2FP%3E%3CP%3E%E8%AF%B7%E5%91%8A%E8%AF%89%E6%88%91%E5%93%AA%E9%87%8C%E5%87%BA%E4%BA%86%E9%97%AE%E9%A2%98%E3%80%82%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2270791%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20ADKP%20Programming%20with%20HSE%20returning%20HSE_SRV_RSP_INVALID_PARAM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2270791%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F258016%22%20target%3D%22_blank%22%3E%40Bhushan1312%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%E6%82%A8%E6%98%AF%E5%90%A6%E5%B0%86%20HSE%20%E6%8F%8F%E8%BF%B0%E7%AC%A6%E5%BC%BA%E5%8A%A0%E7%BB%99%E4%BA%86%20DTCM%EF%BC%9F%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22lukaszadrapa_0-1767359890040.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22lukaszadrapa_0-1767359890040.png%22%20style%3D%22width%3A%20238px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22lukaszadrapa_0-1767359890040.png%22%20style%3D%22width%3A%20238px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F371618iF1030A047FC1D793%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22lukaszadrapa_0-1767359890040.png%22%20alt%3D%22lukaszadrapa_0-1767359890040.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%E5%9C%B0%E5%9D%80%E4%B8%BA%200x2000_0000%20%E7%9A%84%20DTCM%20%E5%86%85%E5%AD%98%E4%BB%85%E6%A0%B8%E5%BF%83%E5%8F%AF%E8%A7%81%E3%80%82%E5%85%B6%E4%BB%96%E6%80%BB%E7%BA%BF%E7%AE%A1%E7%90%86%E5%91%98%E5%8F%AA%E8%83%BD%E9%80%9A%E8%BF%87%200x2100_0000%20%E7%9A%84%E5%90%8E%E9%97%A8%E5%9C%B0%E5%9D%80%E8%AE%BF%E9%97%AE%20DTCM%E3%80%82%E5%9B%A0%E6%AD%A4%EF%BC%8C%E6%88%91%E4%B8%8D%E5%BB%BA%E8%AE%AE%E5%AF%B9%20HSE%20%E5%8F%98%E9%87%8F%E4%BD%BF%E7%94%A8%20DTCM%EF%BC%8C%E8%80%8C%E5%BA%94%E4%BD%BF%E7%94%A8%E6%99%AE%E9%80%9A%E7%9A%84%E9%9D%9E%E9%AB%98%E9%80%9F%E7%BC%93%E5%AD%98%20SRAM%E3%80%82%20%3C%2FP%3E%0A%3CP%3E%E4%B8%8B%E4%B8%80%E7%82%B9--%E5%9C%A8%E5%AF%B9%20ADKP%20%E8%BF%9B%E8%A1%8C%E7%BC%96%E7%A8%8B%E6%97%B6%EF%BC%8C%E8%AF%B7%E6%B3%A8%E6%84%8F%E8%AF%A5%E6%9C%8D%E5%8A%A1%E4%BC%9A%E5%AF%B9UTEST%20%E5%86%85%E5%AD%98%E8%BF%9B%E8%A1%8C%E7%BC%96%E7%A8%8B%E3%80%82%E8%80%8CUTEST%20%E5%86%85%E5%AD%98%E4%B8%8E%E9%97%AA%E5%AD%98%E5%9D%97%200%20%E4%BD%8D%E4%BA%8E%E5%90%8C%E4%B8%80%E5%88%86%E5%8C%BA%E3%80%82%E8%BF%99%E6%84%8F%E5%91%B3%E7%9D%80%E4%BB%A3%E7%A0%81%E5%BA%94%E8%AF%A5%E4%BB%8E%E5%8F%A6%E4%B8%80%E4%B8%AA%E9%97%AA%E5%AD%98%E5%9D%97%E6%88%96%20RAM%20%E4%B8%AD%E6%89%A7%E8%A1%8C%E3%80%82%E5%90%A6%E5%88%99%E4%BC%9A%E5%AF%BC%E8%87%B4%E8%BE%B9%E8%AF%BB%E8%BE%B9%E5%86%99%E9%94%99%E8%AF%AF%E3%80%82%20%3C%2FP%3E%0A%3CP%3E%E6%AD%A4%E8%87%B4%EF%BC%8C%3C%2FP%3E%0A%3CP%3ELukas%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2290121%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20ADKP%20Programming%20with%20HSE%20returning%20HSE_SRV_RSP_INVALID_PARAM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2290121%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%EF%BC%8C%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F37795%22%20target%3D%22_blank%22%3E%40lukaszadrapa%3C%2FA%3E%E3%80%82%3C%2FP%3E%3CP%3EADKP%20%E7%BC%96%E7%A8%8B%E4%BC%BC%E4%B9%8E%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A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