Running batch script generated from embedded coder (in Matlab) on command line gives error

26 Views Asked by At

I am using MATLAB R023b and using embedded coder on it (along with Arduino package)

When I 'build' using embedded coder, everything is fine and Arduino gets flashed with my Simulink model. But when I say 'Generate code' and then try running the batch script that is generated, it gives error. If it runs on simulink, it should run using command line too. But this is strange.

Below is my generated batch script cd . if "%1"=="" ("C:\PROGRA~1\MATLAB\R2023b\bin\win64\gmake" -f wrapper.mk all) else ("C:\PROGRA~1\MATLAB\R2023b\bin\win64\gmake" -f wrapper.mk %1) @if errorlevel 1 goto error_exit

    exit /B 0
    :error_exit
    echo The make command returned an error of %errorlevel%
    exit /B 1

And this is the error when run on command line(powershell)

    if "" == "" ("C:\PROGRA~1\MATLAB\R2023b\bin\win64\gmake"  -f wrapper.mk all )  else ("C:\PROGRA~1\MATLAB\R2023b\bin\win64\gmake"  -f wrapper.mk  )
        "### Generating static library."
        "C:/Program Files/MATLAB/R2023b/bin/win64/gmake" -j5 -C "C:/PROGRA~3/MATLAB/SUPPOR~1/R2023b/toolbox/target/SUPPOR~1/ARDUIN~2/STATIC~1" SHELL="%SystemRoot%/system32/cmd.exe" -f avrcore.mk all
        gmake[1]: Entering directory `C:/PROGRA~3/MATLAB/SUPPOR~1/R2023b/toolbox/target/SUPPOR~1/ARDUIN~2/STATIC~1'
        gmake[1]: *** No rule to make target `/hardware/arduino/avr/cores/arduino/wiring_pulse.S', needed by `C:/Users/IndiaEE1/DOCUME~1/MATLAB/R2023b/ARDUIN~1/ARDUIN~1/FASTER~1/wiring_pulse.S.o'.  Stop.
        gmake[1]: Leaving directory `C:/PROGRA~3/MATLAB/SUPPOR~1/R2023b/toolbox/target/SUPPOR~1/ARDUIN~2/STATIC~1'
        gmake: *** [all] Error 2
0

There are 0 best solutions below