cancel
Showing results for 
Search instead for 
Did you mean: 

CAN communication demo running error (CAN_IT Module) of STM32-MAT/TARGET

Anjie Wang
Associate

Hello!

I have installed the ​STM32-MAT/TARGET toolbox.My operating environment:

matlab 2018b

STM32CubeMX 5.1.0

STM32-MAT/TARGET 5.1.0

There are two question about CAN communication example!

  • Question 1:

There is a error about CAN_IT module as follows when I simulate the CAN communication example in STM32demos.​

0690X000009Z6mwQAC.pngI have tryed to solve this error.However,It seems that we need to modify S-function.But the S-function is saved as .p file,we can't view and modify.

  • Question 2:

I want to delete CAN_IT module and simulate in polling mode.However,it still can't send or recieve CAN messege.The CAN state which gets from CAN_Get_State module is always “reset�?.

The attached are the Simulink model and the .ioc configuration file for STM32CubeMX of question 1 and question 2.

Please any help! Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions

Hi Anjie ****,

sorry for the late answer.

STM32-MAT/TRAGET does not support simulation but code generation only for STM32 devices.

So, CAN blocks drivers can't be used for Simulation but for code generation only.

We reproduce the issue when we press Run button on the Simulink toolbar instead of the Build Model button.

Using the Build button, Build process completed successfully

And can be compiled with IDE.

Then, only execution on the target failed due TX FIFO full (due to changes in the RX filter in your application).

Hopping it clarifies the situation you met.

Regards.

Pascal & Cyril

View solution in original post

1 REPLY 1

Hi Anjie ****,

sorry for the late answer.

STM32-MAT/TRAGET does not support simulation but code generation only for STM32 devices.

So, CAN blocks drivers can't be used for Simulation but for code generation only.

We reproduce the issue when we press Run button on the Simulink toolbar instead of the Build Model button.

Using the Build button, Build process completed successfully

And can be compiled with IDE.

Then, only execution on the target failed due TX FIFO full (due to changes in the RX filter in your application).

Hopping it clarifies the situation you met.

Regards.

Pascal & Cyril