Something Wrong with Simulink C code generation in CAN bus communication
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
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!