Hello Chibi,
In a few weeks, we will be publishing an article focused on CAN Communication using the MR-CANHUBK344.
Until then, to help you in your development, I have to point out the following:
A few settings have to be made in Simulink to be able to have the code running smoothly, and they are covered in the chapter 2.1 of this article.
The MR-CANHUBK344 board is treated as a custom design currently, which means that for the models to run properly, the default configuration has to be modified. This can be done by pressing the "Configure" button in one of the MBDT blocks.
The following step is to take a look at the schematic and note the CANX pins, and then configure them in the Pins Tool, while making sure to remove old pin configurations that would cause conflicts.
Quick note, CANX_RX, CAN_ERRN are inputs, while CANX_TX, CAN_STB, CAN_EN are outputs; X just represents the instance of the CAN that is being configured, CAN0, CAN1, etc. (CAN0 and CAN1 seem to be easier to configure, so i'd suggest using those)
After this, the _TX, _STB, _EN pins have to be added in the Dio component, similarly to the article.
The next step is to enable the interrupts in the Platform component -> Interrupt Controller. Remember to enable the interrupts, set the priority and add a handler based on the already configured instance there.
The next step is to configure CanControllers in Can_43_FLEXCAN->CanConfigSet->CanController, and then add CanHardwareObjects (in the same tab) to match the CanControllers added.
The CanController has to then be referenced in the CanIf component, CanIf->CanIfCtrlDrvCfg.
For the transceiver initialization, you can set both the _EN and _STB lines to HIGH (using Dio blocks, WriteChannel function) in the beginning of the application.
That should be all. I know that I did not manage to go into great detail, but I hope this serves as a starting point for your configuration process.
Regards,
Robert V