I've since abandoned this particular model/endeavor, as I will be using a different (non-ASCII) serial message and have written a custom S-function to parse it. However, my understanding at this point is that the FIFO serial blocks that I used in my model are not implemented for code generation for the Raspberry Pi. For those following in my footsteps, it would appear that you will have to write custom code for parsing ASCII serial data, unless more recent versions of the Simulink Support Package complete the implementation of these blocks.
Missing libraries for FIFO blocks on Raspberry Pi
7 次查看(过去 30 天)
显示 更早的评论
I'm attempting to compile and run a very simple example Simulink model on a Raspberry Pi. The goal of the model is to receive formatted ASCII serial (RS232) data from a GPS unit and display it while using Monitor and Tune. I am able to receive the data character-by-character using the Raspberry Pi Serial Read block. Next I add a FIFO Write block followed by a FIFO Read HDRS block in between the Serial Read and Display blocks.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1252222/image.png)
When I try to build this model, I get the following error (note that $$$$$ is in replacement of the actual username):
Error executing command "touch -c /home/pi/MATLAB_ws/R2020b/C/Users/$$$$$/Documents/MATLAB/Audesse_Programming/test_models/RS232_Test/RS232_Test_ert_rtw/*.*;make -f RS232_Test.mk all MATLAB_WORKSPACE="/home/pi/MATLAB_ws/R2020b" -C /home/pi/MATLAB_ws/R2020b/C/Users/$$$$$/Documents/MATLAB/Audesse_Programming/test_models/RS232_Test/RS232_Test_ert_rtw". Details:
STDERR: In file included from /home/pi/MATLAB_ws/R2020b/C/Users/$$$$$/Documents/MATLAB/Audesse_Programming/test_models/RS232_Test/RS232_Test_ert_rtw/RS232_Test.c:20:
/home/pi/MATLAB_ws/R2020b/C/Users/$$$$$/Documents/MATLAB/Audesse_Programming/test_models/RS232_Test/RS232_Test_ert_rtw/RS232_Test.h:30:10: fatal error: slrtdatatypes.h: No such file or directory
#include "slrtdatatypes.h"
^~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [RS232_Test.mk:450: RS232_Test.c.o] Error 1
This device is actually a larger device which includes a Raspberry Pi Compute Module 4 on board. There are subtle differences elsewhere, but it is set up with Raspbian and interfaces to MATLAB/Simulink as any other RPi does. I understand from the error message that it's missing a header file, but I can find no reference to the header file anywhere. Would this be installed as part of an apt package that might be missing? Or are the FIFO blocks not compatible with RPi? Any insights or clues would be helpful.
0 个评论
采纳的回答
更多回答(1 个)
Sugandhi
2023-4-26
Hi Craig Beal,
I understand that you are getting errors on attempting to compile and run a Simulink model on a Raspberry Pi.
Based on the error message you provided, it appears that the Simulink model is missing the header file "slrtdatatypes.h", which is required for compilation. This header file is part of the Simulink Real-Time (SLRT) library and is typically included in Simulink models that target real-time hardware like Raspberry Pi.
To resolve this issue, you can try the following steps:
1. Ensure that you have the Simulink Real-Time (SLRT) library installed in your MATLAB installation. You can check this by going to the MATLAB Add-Ons menu and verifying if the Simulink Real-Time library is installed. If it's not installed, you can install it from the MATLAB Add-Ons menu.
2. Make sure that you have the correct version of the Simulink Real-Time (SLRT) library installed that is compatible with your MATLAB version and Raspberry Pi hardware.
3. Double-check the configuration of your Simulink model to ensure that it is set up correctly for targeting Raspberry Pi. Verify that the appropriate hardware support package is installed for Raspberry Pi in your MATLAB installation.
4. Make sure that the required header file "slrtdatatypes.h" is included in your Simulink model. You can do this by checking the "Include directories" in the "Code Generation" settings of your Simulink model and adding the path to the directory where the "slrtdatatypes.h" header file is located.
5. If you are using custom blocks or third-party blocks in your Simulink model, make sure that they are compatible with Raspberry Pi and have been properly installed and configured.
6. If you are using FIFO blocks in your Simulink model, ensure that they are compatible with Raspberry Pi. Some blocks may have limitations or dependencies on specific hardware platforms.
7. Verify that you have the necessary permissions and access to the file paths mentioned in the error message, including the username and file locations. Make sure that the file paths are correctly set up in your Simulink model.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Run on Target Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!