some question about function Can_43_FLEXCAN_Ipw_MainFunction_Read

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

some question about function Can_43_FLEXCAN_Ipw_MainFunction_Read

1,826 Views
yin_qiu
Contributor III

dear NXP experts:

I have a question while taking use of EB Mcal version as SW32K3_S32M27x_RTD_R21-11_4.0.0_P04.

in the function "Can_43_FLEXCAN_Ipw_MainFunction_Read" located in file "Can_43_FLEXCAN_Ipw.c"

a local variable "ReceivedDataBuffer" is defined without adding "static ", but in the previous Mcal version like 1.0.0 ,static is added, so I want to know the reason .

if there is no static ,the local ReceivedDataBuffer will be assign a random address and the address of pMBmessage will not equal to the ReceivedDataBuffer.

 

thank you very much.

0 Kudos
Reply
10 Replies

1,768 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

the keyword “static” was removed from those variables in order to support multicore/multithread feature, as those variables will be put into stack, and because each core will have their own stack in multicore environment, so those variables will not be concurrently accessed.
See ARTD-24436 in RTD release note.

BR, Petr

0 Kudos
Reply

1,757 Views
yin_qiu
Contributor III
dear Petrs:
thanks pretty much for answering my question.
I take use of the mcal in S32K312 and meet an hardfault problem and I logged my debug information here:
https://community.nxp.com/t5/S32K/ECU-jump-into-hard-fault-if-receive-frame-in-polling-mode/td-p/201...
after adding "static",ECU will not go hardfault. could you pls check the debug infor and help me to check if "static "is the root cause?
0 Kudos
Reply

1,712 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

maybe there is issue with Stack or similar. To say more, share simplified full project indicating an issue so we can check/test.

BR, Petr

0 Kudos
Reply

1,692 Views
yin_qiu
Contributor III

hello,Petrs:

yes, I tried to set a large size of stack, but it seems make no sense and I also check the contents of stack by S32DS when mcu jump into hardfault and I also find the contents in the top area of the stack is "FF", so it seems the stack is not overflow.

 

0 Kudos
Reply

1,668 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

OK then as I wrote, share simplified full project indicating an issue so we can check/test.

BR, Petr

0 Kudos
Reply

1,660 Views
yin_qiu
Contributor III

hello PetrS:

I upload the file,and if there is no FS23 in your board ,you can delete the FS23 folder and some related include item.

you may config the "ToolPath.mk" for adjust the compiler(ghs) and python (I take use of python27).

thank you very much.

0 Kudos
Reply

1,621 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

sorry but I have neither GHS nor Python.

BR, Petr 

0 Kudos
Reply

1,596 Views
yin_qiu
Contributor III
hi PetrS:
could you pls help me to analysis the cycle of Can_43_FLEXCAN_MainFunction_Read(), any side effect will happen if it is located in while(1)?
or is it must be located in 10ms task?
thanks a lot
0 Kudos
Reply

1,658 Views
yin_qiu
Contributor III

hi I am not sure if the project is upload successful. ahd upload again

Tags (1)
0 Kudos
Reply

1,786 Views
yin_qiu
Contributor III
https://community.nxp.com/t5/S32K/ECU-jump-into-hard-fault-if-receive-frame-in-polling-mode/td-p/201...
hello ,I met the hardfault problem and I think the reason maybe related with the missing static here.
0 Kudos
Reply