FlexCAN Example Usage - iMXRT1170

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

FlexCAN Example Usage - iMXRT1170

824 Views
D_D97
Contributor II

Hello,

I am facing a problem when attaching the flexcan module toolbox items, something with the tlc file. even when I attach the example of (FCAN Interrupts) into an empty simulink project. it still gives me the following error : 

Error: Inside: EXPRESSION Line: 1 Column: 3 File: C:\Users\MyUser\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\NXP_MBDToolbox_IMXRT1xxx\mbdtbx_imxrt\blocks\fcan\imxrt_fcan.tlc Line: 51 Column: 11 syntax error

this is the line from imxrt_fcan.tlc :
  %if (%<LibBlockInputSignal(0, "", "", 0)> <= 2047) 



The TLC file couldn't be attached, so I have attached a screenshot instead.
Thank you.

0 Kudos
Reply
6 Replies

787 Views
SorinIBancila
NXP Employee
NXP Employee

Hello,

 

I am going to investigate why that error occurs and I will keep you updated.

 

Best regards,

Sorin Bancila

0 Kudos
Reply

804 Views
D_D97
Contributor II

I changed the model configurations and there were no build errors,

however, I tested the CAN examples and none of them worked!
I uploaded the IDE driver example and viewed the CAN traffic on the logic analyzer there were a traffic on the CAN bus
but for the simulink toolbox example it never worked! what the issue could be ? 

* Note: I removed the jumpers 102 and 103, should I do the same for the matlab example or no ? 

0 Kudos
Reply

788 Views
SorinIBancila
NXP Employee
NXP Employee

Hello, 

Can you tell me what MATLAB version and Toolbox version are you currently using?

 

The 'evkmimxrt1170_fcan_transfer' should work out of the box, without any modification to the model or configuration. 

 

On the other hand, 'evkmimxrt1170_fcan_interrupts' example doesn't work out of the box due to a wrong baudrate configuration in the FlexCAN component. 

 

Can you try to run the transfer example and let me know if it works?

 

Best regards,

Sorin Bancila

0 Kudos
Reply

739 Views
D_D97
Contributor II

I'm using  the "evkmimxrt1170_fcan_transfer".

- The MATLAB Version Im using is "R2022b"
- Toolbox version is " 1.3.0".


and it's not working correctly the CANBus traffic is as follows: 

D_D97_0-1734857672280.png

 

0 Kudos
Reply

593 Views
SorinIBancila
NXP Employee
NXP Employee
Hello,

I am not really an expert in CAN communication. Can you please provide more detail about what is not working so we can find a solution?

Best regards,
Sorin Bancila
0 Kudos
Reply

576 Views
D_D97
Contributor II

So the problem is when using the NXP provided SIMULINK toolbox CAN Block, to send a data on the can bus (disabling loopback mode) the data sent on the bus is incorrect as in the logic analyzer capture I provided earlier.
using the IDE CAN transfer works fine but using the toolbox is not working as it should be.

Thank you.

0 Kudos
Reply