Hello,
I am using Autosar MCAL v1.0.1 for S32K118 eval board. I have generated a config from EB-Tresos for the CAN module with 5 MBs defined for the Tx Hardware object. In my source code, after Can_Init if I run Can_Write in a loop, the number of times the message is transmitted is always equal to the number of MBs that are defined for module.
Is there some additional setting to be done in order to clear and reuse the MBs for subsequent transmissions? Or the MCAL takes care of this automatically but some other step is missing in order to do this?
Solved! Go to Solution.
Hello,
Thank you for pointing me towards the ISRs. I checked them and they are all disabled in the sources based on my CAN configuration in Tresos.
However, I figured out the issue. It seems that the interrupts have to be explicitly enabled after init routines to be able to generate interrupts. Just setting the CAN TX and RX to interrupt mode is Tresos doesnt automatically do this.
So this, along with the linker file changes that I had done seems to make the CAN interrupts work as expected.
So I realized that the MB-IF flags are to be cleared once a message has been sent. There are interrupts for the same which have been enabled in the Tresos config.
However, what i am now stuck with is that the interrupts never trigger as expected. I have mapped them to the startup file available with the default S32K118 project (see attached picture), but still the interrupts are not generated. How do i make this work?
Can you try to use ISR's name defined in Integration Manual which is included in doc/ folder in your product installed directory:
For example, below is ISR table for CAN driver in S32K14X_MCAL4_3_RTM_1_0_1:
These ISR already defined in CAN module source code, you don't need to define again
Hello,
Thank you for pointing me towards the ISRs. I checked them and they are all disabled in the sources based on my CAN configuration in Tresos.
However, I figured out the issue. It seems that the interrupts have to be explicitly enabled after init routines to be able to generate interrupts. Just setting the CAN TX and RX to interrupt mode is Tresos doesnt automatically do this.
So this, along with the linker file changes that I had done seems to make the CAN interrupts work as expected.