cancel
Showing results for 
Search instead for 
Did you mean: 

CAN for STM32F3 in Simulink (STM32-MAT/TARGET)

abdou si
Associate III
Posted on April 18, 2017 at 23:52

Hello 

i am traing to use CAN (controller area network) of STM32F3 in Simulink with package STM32-MAT/TARGET 

i started to add ico file in config 

0690X00000603lYQAQ.jpg

whene i start adding the CAN i get this 

0690X00000603eJQAQ.jpg

please any help 

#stm32-mat/target-matlab #stm32f3 #can
12 REPLIES 12
Imen.D
ST Employee
Posted on April 19, 2017 at 14:32

Hi,

May be CAN is not configured in used ioc file, or Simulink model has not been configured to be used with STM See attached 'STM32_MAT-TARGET_HandsOn.pdf' file Page.20

Please check these solutions, then if these do not solve your issue, please send ioc file.

Thanks

Imen

________________

Attachments :

STM32_MAT-TARGET_HandsOn_v1_0.pdf : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyiI&d=%2Fa%2F0X0000000bBQ%2FmysgLHfgbKK4EDrp2yumNCK_oymsY2pDKCPqN9t_MVg&asPdf=false
When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on April 19, 2017 at 14:48

Hi

i know where is the problem, the problem in the configuration of ioc file i dont know how i can configurate the CAN of STM32F303K8

my ico file

________________

Attachments :

pi.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hyd9&d=%2Fa%2F0X0000000bBO%2FrgSjyiotKKHhEfg8RxM.u7WaNUie_ZM.XTGYEriyIJo&asPdf=false
Posted on April 24, 2017 at 10:19

Hi abdou si,

When you open block, you drag & drop CAN block : default selected CAN is CAN1.

But name is CAN. 

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on April 24, 2017 at 12:36

Hi Imen D

can you tel me what timeout shoude i choose when i use HAL_CAN_Receive() because it didn't work 

tianchen.fan
Associate II
Posted on August 16, 2017 at 09:01

I spent many time to test the CAN mode ,but it still have some error,please give a example of  stm32f107 for can1,

thank you very much!

Posted on August 16, 2017 at 14:24

hello 

what kind of error 

can you share your code 

you can find an example in C:\Users\yourcomputer\STM32Cube\Repository

tianchen.fan
Associate II
Posted on August 16, 2017 at 16:55

1.I had created the demo board for can1 ofstm32f107 ,it can run in simulink by any error and genrate code.but it compiled by keil ARM 5.20 ,it prompt the error,

system :win7 64bit and matlab 2016

I had already replace the cansend.tlc and canfilter.tlc in STM_MAT.

1.../../slxfile/../iocfile/CANtest1/Inc/CANtest1_CAN.h(35): error: #5: cannot open source input file ''CANtest1_STMh'': No such file or directory

how to deal with it ,thank you very much!0690X00000607vXQAQ.png

________________

Attachments :

CANtest1.slx.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyUu&d=%2Fa%2F0X0000000b8k%2FxYFQ3Xwh.z50gwiMsiWnNZMbj3P8UgU_eOc4TqMH.k8&asPdf=false

cantest.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyUp&d=%2Fa%2F0X0000000b8h%2FSqaWiFaYBISLWM59m9IqOFctUdRJkhnE4ajWzCOhAWA&asPdf=false
Posted on August 16, 2017 at 17:16

sorry i didn't understand exactly the problem  

please i wanna see screenshot for :

the project in simulinkand the error and the configuration 

Posted on August 17, 2017 at 05:44

I had refresh the question,thank you very much!