Support for CAN configuration for MRCANHUBK344

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

Support for CAN configuration for MRCANHUBK344

1,704 Views
Chibi
Contributor I

I'm working on application to send and receive CAN messages following the examples but I'm unable to successfully send messages. I can only see the message error count increase but not the sent messages. I'm assuming there's something wrong with my configuration. Is there any documentation or help available to configure MRCANHUBK344 ?

0 Kudos
Reply
3 Replies

1,687 Views
robertv
NXP Employee
NXP Employee

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

0 Kudos
Reply

1,649 Views
Chibi
Contributor I

Hello Robert, 

Thank you for the information. I updated my toolbox to 1.4 and found CAN peripheral for CAN0 was already configured with steps you had mentioned. However after configuring the JTAG pins I'm not able to download the .elf on target and get an error which were not there with the 1.1 version. I'm attaching a screenshots of the error and log. Could you please look at it and let me know if I'm missing anything?

 

I'm using PE micro multilink debugger for programming the board.

 

Chibi_0-1698970945423.png

Chibi_2-1698971161309.png

 

Chibi_1-1698971047533.png

 

Thanks,

Abhishek

 

0 Kudos
Reply

1,555 Views
robertv
NXP Employee
NXP Employee

Hello Chibi,

Recently, I've had to configure the CAN peripheral in a few models so I would like to double-check some things regarding the configuration:
- Are the CAN pins updated to the MR-CANHUBK344 mappings?

robertv_0-1699268353740.png

- Is the CanController enabled?  (inside CAN_43_FLEXCAN > CanConfigSet > CanController)
- If i remember correctly, the CAN0 is configured for CAN FD by default, so keep that in mind.
- The error you encountered could be caused by the wrong hardware part being chosen in the following menu: (S32K344-Q172 should be selected for the MR-CANHUBK344)

robertv_1-1699270239823.png


Regarding the downloading process for the code, we would need you to provide more details, if the points mentioned before do not fix the issue.

- Which external configuration tool are you using?  S32 Config Tools or Elektrobit Tresos?
- How exactly is the PEmicro connected to the board and if the P7A connector is used?
- What are the steps you followed when configuring the JTAG pins?

Regards,
RobertV

0 Kudos
Reply