gmake trying to use folder that doesn't exist?
48 次查看(过去 30 天)
显示 更早的评论
Hello,
Sorry if this is a silly question, I am very new to using simulink. I'm trying to run the sample lcdsimpletext program that comes with the arduino liquid crystal display library to check if I've wired my lcd correctly, but every time I try and run it on my arduino uno it gives an error of 2. I think this is because it's trying to search in the libraries folder in the aCLI folder which doesn't exist. I've tried deleting and reinstalling the add on to see if it would fix it but it doesn't. How do I fix this? Is there a way of changing what folder simulink searches in to run that library?
Here's the full build log if it helps:
"### Generating static library." "C:/Program Files/MATLAB/R2024b/bin/win64/gmake" -j9 -C "C:/PROGRA~3/MATLAB/SUPPOR~1/R2024b/toolbox/target/SUPPOR~1/ARDUIN~1/STATIC~1" SHELL="%SystemRoot%/system32/cmd.exe" -f avrcore.mk all gmake[1]: Entering directory `C:/PROGRA~3/MATLAB/SUPPOR~1/R2024b/toolbox/target/SUPPOR~1/ARDUIN~1/STATIC~1' "### Successfully generated libcore.a library." gmake[1]: Leaving directory `C:/PROGRA~3/MATLAB/SUPPOR~1/R2024b/toolbox/target/SUPPOR~1/ARDUIN~1/STATIC~1' "C:/Program Files/MATLAB/R2024b/bin/win64/gmake" -j9 SHELL="%SystemRoot%/system32/cmd.exe" -f "lcdsimpletext.mk" all gmake[1]: Entering directory `C:/Users/Hanna/AppData/Roaming/MathWorks/MATLAB Add-Ons/Collections/Simulink library for Arduino Liquid Crystal Display/lcdsimpletext_ert_rtw' gmake[1]: Leaving directory `C:/Users/Hanna/AppData/Roaming/MathWorks/MATLAB Add-Ons/Collections/Simulink library for Arduino Liquid Crystal Display/lcdsimpletext_ert_rtw' gmake[1]: *** No rule to make target `C:/ProgramData/MATLAB/SupportPackages/R2024b/aCLI/libraries/LiquidCrystal/src/LiquidCrystal.cpp', needed by `LiquidCrystal.o'. Stop. gmake: *** [all] Error 2 The make command returned an error of 2 ### Build procedure for lcdsimpletext aborted due to an error.
0 个评论
回答(1 个)
Kanishk
2024-11-19,6:38
The issue you're encountering arises from gmake searching for a library folder in an incorrect location. The "libraries" folder is located within the "aCLI/user" directory, with the full path being:
“C:/ProgramData/MATLAB/SupportPackages/R2024b/aCLI/user/libraries”
As the “Simulink library for Arduino Liquid Crystal Display” add-on is only compatible for R2018a to R2019a, as mentioned on the add-ons page, a modification is needed for it to work in R2024b. This involves editing the “LCD.m” file located at:
“C:\Users\<username>\AppData\Roaming\MathWorks\MATLAB Add-Ons\Collections\Simulink library for Arduino Liquid Crystal Display\Arduino_LCD_Driver\+LiquidCrystalDisplay\+block”
Please update line 85 of the file by modifying the “fullfile” function to include "user" folder, as follows:
libpath = fullfile(codertarget.arduinobase.internal.getArduinoIDERoot('libraries'), 'user', 'libraries','LiquidCrystal');
Additionally, please delete the folders generated by Simulink during code generation, specifically “lcdsimpletext_ert_rtw” and “slprj”. Removing these folders should allow Simulink to generate the code without any errors.
Alternatively, you can follow this official MathWorks documentation to create an LCD Add-on for Arduino when using later releases.
Hope this helps!
Thanks
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!