HSE MonotonicCnt API stuck in while loop

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

HSE MonotonicCnt API stuck in while loop

4,529件の閲覧回数
VincentYALin
Contributor II

We are using S32K312 HSE API MonotonicCnt , we found out there are a possibility that function might stuck in Hse_Ip_ServiceRequest’s while loop.

 

MonotonicCnt_Read -> HSE_Send -> Hse_Ip_ServiceRequest

 

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);

}

We are calling MonotonicCnt_Read , MonotonicCnt_Config , MonotonicCnt_Write about once every few seconds , is there anyway to avoid it ?

 

 

0 件の賞賛
返信
10 返答(返信)

3,892件の閲覧回数
StephenYeh
Contributor III

Hi Dan,

We try to use MONOTONIC_CNT for our application.

We find this data which could not access every 2 seconds. Does this the limitation and control by HSE-FW due to protect the HSE data-flash Read/Write cycle?

0 件の賞賛
返信

4,469件の閲覧回数
DanNguyenDuy
NXP Employee
NXP Employee

Hello @VincentYALin,

Did the HSE FW version you are using support for config monotomic counter?

Did you pass into the correct parameters when call HSE functions?

Best regards,

Dan

0 件の賞賛
返信

3,957件の閲覧回数
VincentYALin
Contributor II

Hi Dan, 

I was trying to reply to your question but NXP website has gone maintain for few days 

Did the HSE FW version you are using support for config monotomic counter?

from the function 

GetAttr( HSE_FW_VERSION_ATTR_ID, sizeof(hseAttrFwVersion_t), &pHseFwVersion );

[Cpt_M] pHseFwVersion.socTypeId 13

[Cpt_M] pHseFwVersion.fwTypeId 0

[Cpt_M] pHseFwVersion.majorVersion 2

[Cpt_M] pHseFwVersion.minorVersion 6

[Cpt_M] pHseFwVersion.patchVersion 0

HSE_DEMOAPP_S32K3XX_0_2_6_0 have example about monotonic operation. so we are assuming fw does support it. 

Did you pass into the correct parameters when call HSE functions?

Yes , it's stability issue, it works sometimes but it stuck in while loop occassionally.

 

from the installer folder nxp > HSE_DEMOAPP_S32K3XX_0_2_6_0 > demo_security_installer_scripts, we found some scripts relate to the monotonic functions that has delay time of 4s to 5s. we had experience this stuck in while loop issue while we doing stress testing on monotonic counter with intervals around 4s, Would you share with us about why do you set 4s-5s as delay time in the example scripts? 

following are from monotonic_counter.cmm file

SUB_FILL_DATA:
DIALOG.END
BREAK
v monotonic_cnt_select = MONOTONIC_CNT_INCREMENT
v gProgramAttributes = MONOTONIC_COUNTER
v gRunExampleTest = 1
GO
wait 4s
break
v allTestExecuted = 1
v monotonic_cnt_select = MONOTONIC_CNT_NOT_SELECTED
v gProgramAttributes = NO_ATTRIBUTE_PROGRAMMED v gRunExampleTest = 0
v MonotonicCnt IncrementValue = 0
GO
do monotonic_counter.cmm

0 件の賞賛
返信

4,505件の閲覧回数
VincentYALin
Contributor II

Any NXP tech support can help ?

0 件の賞賛
返信

3,884件の閲覧回数
DanNguyenDuy
NXP Employee
NXP Employee

Hello @VincentYALin,

The HSE FW team confirmed that: there is no need for such larger delay. As it involves, flash write operation, they added sufficient delay to ensure smooth operation. You can reduce the delay as per your convenience.

Best regards,

Dan

0 件の賞賛
返信

3,844件の閲覧回数
VincentYALin
Contributor II
so what's next step ? I might still stuck in the while loop
0 件の賞賛
返信

3,841件の閲覧回数
DanNguyenDuy
NXP Employee
NXP Employee

Hi @VincentYALin,

From my point of view, you can modify "wait 4s" to "wait 2s or 1s" to follow your expectation.

Best regards,

Dan

0 件の賞賛
返信

3,818件の閲覧回数
VincentYALin
Contributor II

It sound like we have an misunderstanding on what I have trouble with . 

What I have trouble with is that , there is a possibility S32K312 MCU might stuck in MonotonicCnt_Read with HSE fw version 2.6

What I want from NXP is to give me a reason why this happen / How do I avoid it ?

is this a known issue  ? if not have you try to replicate it ?

Thank you 

0 件の賞賛
返信

3,488件の閲覧回数
DanNguyenDuy
NXP Employee
NXP Employee

Hello @VincentYALin,

Could you send me your project or a demo example? I'm going to check this from my side.

Best regards,

Dan

0 件の賞賛
返信

3,450件の閲覧回数
VincentYALin
Contributor II

this is basically how we reproduce it 

MonotonicCnt_Config(1, 64);

int count = 0; 

uint64 hse_counter = 0 ;

while(1){

MonotonicCnt_Read(1,&hse_counter ); 

count++;

print("count  = %d",count );

sleep(1);

}

 

0 件の賞賛
返信