MBDT - CAN on S32K144EVB

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

MBDT - CAN on S32K144EVB

Jump to solution
1,940 Views
arthur_lubat_ex
Contributor I

Hello.

I am currently trying to make a model with MBDT for a S32K144 EVB. On this model I need to receive 2 CAN messages on the CAN 0 channel (ID 1D7 and 1D8). These two messages are emitted one after another every 20ms.

The problem I have is I don’t manage to receive both messages on the board (Although I manage to read 1 message by doing something similar to the example “How to Build and Configure a CAN with S32K to Emulate Automotive Body Control Infrastructure “ - https://community.nxp.com/thread/465130 )

Can you give me an example of a model able to read two CAN messages? Shall I use the RxFIFO option? If yes can you give me some  information on how to set the “FCAN_Isr” and “FCAN_Config” blocks to make it work.

Thanks by advance

Arthur

Tags (3)
0 Kudos
1 Solution
1,454 Views
constantinrazva
NXP Employee
NXP Employee

Hello arthur.lubat.ext@valeo.com‌,

First of all, what version of the toolbox are you using? Our latest available for S32K14x is 2018.R1 available here.

Secondly, I have attached here a basic example that receives messages (with ids 1D7 and 1D8) and, on Rx Complete event, triggers a subsystem that toggles the RED LED and echoes back the data you've sent.

Example:

Send AABBCCDD data with id 1D7 - the RED LED toggles + message AABBCCDD is sent with id 3FF back. The same happens for id 1D8. I have a switch/case grouped by ID. I think this can be a good starting point for what you were asking. I'm not sure what the problem was with your approach, but let me know if this model attached here works for you.

Kind regards,

Razvan.

View solution in original post

4 Replies
1,455 Views
constantinrazva
NXP Employee
NXP Employee

Hello arthur.lubat.ext@valeo.com‌,

First of all, what version of the toolbox are you using? Our latest available for S32K14x is 2018.R1 available here.

Secondly, I have attached here a basic example that receives messages (with ids 1D7 and 1D8) and, on Rx Complete event, triggers a subsystem that toggles the RED LED and echoes back the data you've sent.

Example:

Send AABBCCDD data with id 1D7 - the RED LED toggles + message AABBCCDD is sent with id 3FF back. The same happens for id 1D8. I have a switch/case grouped by ID. I think this can be a good starting point for what you were asking. I'm not sure what the problem was with your approach, but let me know if this model attached here works for you.

Kind regards,

Razvan.

1,454 Views
oscar_cheng1103
Contributor I

Hi,

@Constantin Razvan Chivu

I has the same problem that was can't receiving multi-CAN ID message with one channel. I reference your example model but it was still can't working. Could you give me some recommend? My platform is NXP S32K144 EVM with Matlab R2019b, NXP_MBDToolbox_S32K1xx ver4.1.0 and NXP Support Package S32K1xx ver2.1.0. My model put on the below attached thanks!

0 Kudos
1,454 Views
oscar_cheng1103
Contributor I

Hi Razvzn,

   I thinks I have resolved the problem. The reason is Message Buffer(MB) setting error. I setting input message use the same MB number, so it always just only one message can be received. More information about Message Buffer(MB) parameter can reference Multiple CAN ID via CAN0 MPC5744P  topic in NXP community, thanks!!

0 Kudos
1,454 Views
arthur_lubat_ex
Contributor I

Hello,

Thank you for your response and for the example.

Your example works fine and thank to it I think I've found the error I made on my own model.

I think that the reception of the second frame was not done because of a bad setting of the "FCAN_Receive" block. 

Thank you,

Arthur

0 Kudos