autosar s32k can module issue

cancel
Showing results for 
Search instead for 
Did you mean: 

autosar s32k can module issue

544 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
2 Replies

539 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

529 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