autosar s32k can module issue

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

autosar s32k can module issue

1,351 Views
Shaojun
Contributor I

Hi,

I'm implementing the can module with S32K146. After simply initialization of mcu, port, gpt, sbc, and can modules. I tried to send one can message with the cyclic called function Can_Write() and Can_MainFunction_Write() in gpt notification function. The cfg code is generated with EB tresos(CAN Processing Type Polling) and Autosar version 4.3.1. 

It works and everything looks fine but when I try to send two can messages at different cycle times (for example 10ms and 50ms), the two messages are successfully sent out but with wrong periods (typically 10ms and 25ms). 

I do not have a good understanding of can module in autosar, so I'm posting this question here in case somebody knows how to solve this issue.

Best Regards,

Shaojun

0 Kudos
3 Replies

1,346 Views
hungnguyenphi
NXP Employee
NXP Employee

Hello @Shaojun ,

 

Could you please explain more. As your description, I understand that you:

- Call the Can_write(1, frame1) each 10ms.

- Call the Can_write(2, frame2) each 50ms.

- But you see the frame2 in the bus each 25ms.

The above behavior seems doesn't make sense to me. From my understand, the period of frame2 should higher or equal to 50ms. Have you tried to comment the Can_write(1, frame1)  and checked the period of frame2 in the bus.

 

Best regards,

Hung

0 Kudos

1,336 Views
Shaojun
Contributor I

Hello, Hung

thanks for the reply!

Your understanding is correct. When I comment Can_write(frame1), the period of frame2 is 50ms.

That's why I'm confused. But this issue is already fixed by enabling CAN_MAINFUNCTION_MULTIPLE_WRITE. That means, do not simply use Can_MainFunction_Write(). Instead of this Can_MainFunction_Write_0/1() shall be used for the case of multiple-write. 

By the way, I didn't integrate the CanIf code into my project, so Can_MainFunction_Write() was directly called by manual code.

0 Kudos

492 Views
Rammi
Contributor I

I have a question concerning the tx polling mode. I have two CAN Tx massages with a cycle tx time of 40ms and two CAN massages with a cycle tx time of 20ms. For my understanding I call the function  Can_Write twice for the same cycle time and afterwards I call the coresponding function Can_MainFunction_Write_x for tx confirmation for the tx telegramms. Am I right?

0 Kudos