Something Wrong with Simulink C code generation in CAN bus communication

조회 수: 2 (최근 30일)
Yuri ricardo
Yuri ricardo 2018년 1월 15일
편집: Nail 2020년 1월 11일
While I was doing the MBD(Model Based Design) using SImulink,Keil,stm cubemx and stm32_mat_target. I build a simple model in the Simulink then it goes well when I just click the run button.
This is the simple model, CAN1 read the data and CAN2 send it.
But when I press Build Model and generate the C code for stm32, the compiler in Keil tell me that ‘cannot open source input file “can_message.h”:No such file or dictionary’
the compiler tell me the code which Simulink generated is wrong and the can_message.h is missing.
  댓글 수: 3
Daniel Vicca
Daniel Vicca 2019년 6월 26일
Hello someone was able to fix it?
Nail
Nail 2020년 1월 11일
편집: Nail 2020년 1월 11일
You can copy the can_message.h in the path
C:\Program Files\MATLAB\R2018a\toolbox\shared\can\src\scanutil\can_message.h
under
C:\Program Files (x86)\MATLAB\STM32-MAT\STM32\addSrc\inc\
(adjust paths for yourself). Then, go to Configuration Parameters under Simulink, STM32 Project Files -> Select include files -> choose can_message.h
If compiling fails, you might need to edit can_messages.h so that
#include "tmwtypes.h"
becomes
#include "rtwtypes.h"

댓글을 달려면 로그인하십시오.

답변 (0개)

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!