Hi,
I’m working on the S32K344 using MBDT v1.5, and I'm trying to configure all four CAN controllers for both Tx and Rx. For initial validation, I’ve configured only CAN0 and CAN1.
CAN0 is working fine for both transmission and reception.
CAN1, however, does not produce any output even though I’ve followed the same configuration steps as for CAN0.
Both controllers are initialized in the model, and the Tx blocks are set up identically for both. I’ve attached the .mex file for reference, along with a screenshot of how I'm configuring the blocks in MBDT.
Could someone help me understand what might be missing or misconfigured for CAN1 to work in parallel with CAN0?
Thanks in advance.
Solved! Go to Solution.
Hello,
I've downloaded your configuration file and I found a few problems:
1. In the platform configuration, you need to enable the interrupts for the FlexCAN component, set a priority and add the IRQ handlers.. The lower the number, the higher the priority.
2. You need to configure the pins in the PORT components for the CAN instance you want to use, similarly to the CAN0 instance.
3. In the PINS view, you need to configure the EN and STB pins for the transceiver too, similarly to the CAN0. If the state of the EN and STB are not properly set, you might get undefined behavior.
3.1 If you want to control EN and STB at runtime, you also have to update the DIO component with the EN and STB pins, similarly to CAN0.
These are a few things I was able to find looking through your configuration file. Let me know if the suggestions help you.
Best regards,
Sorin Bancila
Hello,
One thing to verify is to download the schematic and check if the transceiver for CAN1 is the same as the transceiver for CAN0. If they are different, the initialization part might be different.
Can you provide the name of the reference design board you are using? Or maybe a link.
Best regards,
Sorin Bancila
Hello,
I've downloaded your configuration file and I found a few problems:
1. In the platform configuration, you need to enable the interrupts for the FlexCAN component, set a priority and add the IRQ handlers.. The lower the number, the higher the priority.
2. You need to configure the pins in the PORT components for the CAN instance you want to use, similarly to the CAN0 instance.
3. In the PINS view, you need to configure the EN and STB pins for the transceiver too, similarly to the CAN0. If the state of the EN and STB are not properly set, you might get undefined behavior.
3.1 If you want to control EN and STB at runtime, you also have to update the DIO component with the EN and STB pins, similarly to CAN0.
These are a few things I was able to find looking through your configuration file. Let me know if the suggestions help you.
Best regards,
Sorin Bancila
Hello,
If you want to see how to configure, initialize and use different peripherals, you can install S32 Design Studio and install the same RTD version as the RTD included in the toolbox. Then, you gain access to examples for most of the peripherals (including configuration projects .mex).
Another way to understand the MBDT workflow is to check the webinars and articles available on the MBDT Community.
The third option is to check the included examples in the MBD Toolboxes. All the supported peripherals include at least one example to showcase the functionality.
Best regards,
Sorin Bancila