KEAZ128-S32DS WDOG_EWM_IrqHandler ERR

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

KEAZ128-S32DS WDOG_EWM_IrqHandler ERR

1,037 Views
cqhcau
Contributor I

Hi,

I develop KEAZ128 MCU with S32DS.When running to the code below(s==4,or2),the MCU stop running.

if (s==4) {

*(CCP_DWORD*)d = *(CCP_DWORD*)p;
} else if (s==2) {
*(CCP_WORD*)d = *(CCP_WORD*)p;
} else {
*d = *p;
}

cqhcau_0-1622781485669.png

But, if I change the code to below, it's running ok. I guess  the problem it's the pointer.

But the same code running ok on S32K144 MCU.

So, why?

 CCP_BYTE i;

if (s==4) {
 for(i = 0; i < 4; i++)
 {
 *d++ = *p++;
 }

 } else if (s==2) {
for(i = 0; i < 2; i++)
{
*d++ = *p++;
}
 } else {
 *d = *p;
 }

 

0 Kudos
7 Replies

1,030 Views
nxf56274
NXP Employee
NXP Employee

Hi,

What's the value of d and p?

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 days after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

1,026 Views
cqhcau
Contributor I

Hi,

p is a Pointer to a globle variable“vehda_tiECUOn” and is a Pointer to a address in stack.

Thanks.

cqhcau_0-1622789960082.png

cqhcau_1-1622789975668.png

 

 

0 Kudos

1,003 Views
nxf56274
NXP Employee
NXP Employee

Hi,

If you do not put these operation in wdog, do you meet this problem again?  

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 days after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

997 Views
cqhcau
Contributor I

Hi,

I never put the operation in watchdog.

I just disable the interrupt with " __asm("CPSID i")" before the operation and enable the interrupt after the operation.

Whatever I will test the function again.

0 Kudos

987 Views
nxf56274
NXP Employee
NXP Employee

Hi,

I test the usage of pointer you provided on FRDM-k64. It works well. So I think it may be not the pointer problem. I can't reappear the problem. So it is hard to say what causes this result.

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 days after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

976 Views
cqhcau
Contributor I

Hi,

I test the funtion again.I found when the code running to the two lines below it will get wrong.

00019e90: ldrh r0, [r0,#0]

00019e92: strh r0,[r2,#0]

Do you know why?

I seach on the internet,it said: maybe the pointer point to non aligned address will lead to hard err.Is the reason?

In my project.


CCP_BYTE dtm[8];

d = &dtm[1];

*(CCP_DWORD*)d = *(CCP_DWORD*)p;

 

 

 

cqhcau_0-1623138782220.png

cqhcau_1-1623138814978.png

 

 

0 Kudos

953 Views
nxf56274
NXP Employee
NXP Employee

Hi,

You can try to align your two variable. It looks like that the 'd' address is not aligned.

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 days after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos