Hey guys I have encountered the following error while trying to run my simulink block in external mode. How can I solve it

5 views (last 30 days)
rtiostream_serial_daemon.cpp:(.text.rtIOStreamSend+0x10): undefined reference to `Print::write(unsigned char const*, unsigned int)' collect2.exe: error: ld returned 1 exit status gmake[1]: *** [../blink_simulink.elf] Error 1 gmake[1]: Leaving directory `E:/OneDrive/Desktop/output/blink_simulink_ert_rtw' gmake: *** [all] Error 2 The make command returned an error of 2 ### Build procedure for blink_simulink aborted due to an error.
Build Summary
Top model targets built: Model Action Rebuild Reason ==================== blink_simulink Failed Code generation information file does not exist.
0 of 1 models built (0 models already up to date) Build duration: 0h 5m 35.22s

Accepted Answer

Animesh
Animesh on 17 Jun 2024
Hi Tinotenda,
This error typically indicates a linker issue where the compiler cannot find the implementation of the “Print::write method, which is commonly used in Arduino programming for serial communication. This can happen due to several reasons:
  1. Missing Library or Source Files
  2. Incorrect Linker Settings
  3. Target Hardware Configuration
Now, to resolve the issue you can try following the workarounds:
  1. Revisit the model configuration parameters to ensure they are set correctly for your target hardware and intended code generation settings. This includes verifying the solver settings, data type settings, and any custom code settings that might affect the build process.
  2. Try cleaning the build folder. Delete the contents of the “blink_simulink_ert_rtw” folder, and then attempt to rebuild the model.
  3. Ensure all model dependencies (such as custom code, libraries, or external files) are correctly specified and accessible in the project's path.
If the above-mentioned steps do not suffice to resolve your issue, you can try to ensure your MATLAB, Simulink, and any relevant hardware support packages (e.g., for Arduino) are up to date. Updates can resolve bugs and compatibility issues that might be causing the build to fail.
I hope this helps!
Animesh

More Answers (0)

Categories

Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!