Missing libraries for FIFO blocks on Raspberry Pi

2 views (last 30 days)
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.
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.

Accepted Answer

Craig Beal
Craig Beal on 26 Apr 2023
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.

More Answers (1)

Sugandhi
Sugandhi on 26 Apr 2023
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.

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!