S32K3 FlexCAN IP RTD User Manual out of date

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

S32K3 FlexCAN IP RTD User Manual out of date

Jump to solution
1,865 Views
ziomocci
Contributor IV

Hi all,

I am configuring the FlexCAN peripheral Message Buffers and I have notices that a lot of APIs description in the User Manual are not correct or exaustive.

For example, API FlexCAN_SetMsgBuffIntCmd description is aligned the old SDK onces, but RTD version entry point is totally different.

Could someone explain the difference between parameters "enable" and "bIsIntActive" highlighted in the screen and not distinguished in the parameters table?

ziomocci_0-1665392172647.png

 

0 Kudos
Reply
1 Solution
1,818 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

if you call init with FlexCAN_Ip_Init(INST_FLEXCAN_0, &FlexCAN_State0, &FlexCAN_Config0) then last parameter in FlexCAN_SetMsgBuffIntCmd should be FlexCAN_State0.isIntActive.

BR, Petr

View solution in original post

0 Kudos
Reply
7 Replies
1,849 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

this function is called internally by driver. The "Enable" specifies if respective MB bit in IMASK register will be set or not, so enabling interrupt for given MB. The "bIsIntActive" is data field of internal drive state variable/structure (Flexcan_Ip_StateType), and save status of enabling/disabling interrupts in runtime. bIsIntActive is set within FlexCAN_Ip_Init function.

BR, Petr

0 Kudos
Reply
1,847 Views
ziomocci
Contributor IV

Hi,
enable parameter meaning is clear, but I cannot say the same for the bIsIntActive parameter.

I am writing a simple API interfacing with FlexCAN RTD

 

int16_T CAN_BufferConfig (uint8_T Channel, 
                          uint8_T bufferNumber, 
                          uint8_T direction,
                          uint8_T size, 
                          uint8_T IDtype, 
                          uint32_T msgId, 
                          uint32_T int_en)
{
int16_T error;
Flexcan_Ip_StateType * state = Flexcan_Ip_apxState[Channel];

/* configure the Mailing Box, message direction, CAN ID value, CAN ID type, etc */
...

 

At the moment my API, before the return, performs 

 

/* Enable MB interrupt if required*/
result = FlexCAN_SetMsgBuffIntCmd(base,Channel,nbuf,TRUE,int_en);

 

but considering your answer the correct way should be:

 

/* Enable MB interrupt if required*/
result = FlexCAN_SetMsgBuffIntCmd(base,Channel,nbuf,int_en, state->bIsIntActive );

 

Is it correct?

B.R.

0 Kudos
Reply
1,840 Views
ziomocci
Contributor IV

I have to correct my self

Flexcan_Ip_apxState[Channel];


is static with scope limited to FlexCAN_Ip.c module.

So which state have I to use as last etry point for FlexCAN_SetMsgBuffIntCmd API?

0 Kudos
Reply
1,829 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

FlexCAN_SetMsgBuffIntCmd is not public API too, FlexCAN_IP drive is calling it when Send/receive function is used, yu can refer to those functions.

I placed simple RTD code on https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K344-FlexCAN-Ip-TX-RX-EnhanceRXFIFO-test...

BR, Petr

0 Kudos
Reply
1,826 Views
ziomocci
Contributor IV

Yes I kown.

To be precise, it is defined in FlexCAN_Ip_HwAccess.h but "inlined" by multiple translation units by NXP RTD implementation, FlexCAN_Ip/FlexCAN_Ip_HwAccess.c modules.

So, why cannot I use it in my translation unit?

Moreover, we have always configured MB for reception by polling or by ISR one time on ECU startup, for sure not each time we have to send or receive a message. 

 

0 Kudos
Reply
1,819 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

if you call init with FlexCAN_Ip_Init(INST_FLEXCAN_0, &FlexCAN_State0, &FlexCAN_Config0) then last parameter in FlexCAN_SetMsgBuffIntCmd should be FlexCAN_State0.isIntActive.

BR, Petr

0 Kudos
Reply
1,813 Views
ziomocci
Contributor IV
Hi Petr, I am using exactly the "isIntActive" bit field as you suggested a few days ago and well, the CAN works as expected!
Thank you very much!
Andrea
0 Kudos
Reply