Error when trying to simulate Matlabfunction

3 ビュー (過去 30 日間)
leon chen
leon chen 2021 年 1 月 31 日
回答済み: Srija Kethiri 2022 年 8 月 22 日
Hello everyone,
For a project I wanted to implement some C-code into simulink and let it simulate using the simulink functions. This is how the blocks look like. and I put the code of the matlab function below. But I get some errors from it and I am not sure how to solve it or what the error means. I already looked on the forum and found this who had similiar No rule to make target error1 and this one No rule to make target error 2, but I still could not solve it. Also to make it more clear this
This is the error I am getting:
I would be really happy if someone can guide me to the right directions.
function uartWriteMessage = wifiModule(uartReadMessage, uartBufferSize, uartStatus)
uartWriteMessage = zeros(1, 200, 'uint8');
%initialisatie van uartWriteMessage array met 200 keer (uint8_t)0
%coder.cinclude('MAIN.h')
coder.updateBuildInfo('addIncludePaths','C:\Users\leon-\Documents\Laatste jaar school\BasysESP32_V2\BasysESP32V2.X');
coder.updateBuildInfo('addSourceFiles','MAIN.c');
coder.cinclude('MAIN.h');
%hier wordt MAIN.c geincluded
%coder.ceval('main');
%coder.ceval('matlabLoop', coder.ref(uartReadMessage), uartBufferSize, uartStatus, coder.ref(uartWriteMessage));
%matlabLoop en main zijn functies die aangeroepen worden, dingend die naast
%matlabLoop staan zijn argumenten
%coder.ref(x) betekent x is een pointer of array
end

回答 (1 件)

Srija Kethiri
Srija Kethiri 2022 年 8 月 22 日
Hi Leon,
This is an error message that is thrown by the "make" (make/gmake) command. The common cause for this error message is: It could mean that the indicated file is missing i.e., here the file "Main.obj" does not exist.
In the above case, the indicated file was missing as a result of a faulty Support Package installation. A clean re-installation of the support package resolves the issue.
Another possible reason could be that the model location was changed. Make sure to delete all artifacts and code generation folders (slprj, model_xxx) before you attempt a rebuild.
Hope this helps!

カテゴリ

Help Center および File ExchangeCommunications Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by