The Simulink program fails to compile, while it compiles successfully in the Toolbox and WSL

I’m using Pixhawk 6C to develop an algorithm using Simulink, but I’m encountering the following problem: The Simulink program fails to compile, while it compiles successfully in the Toolbox and WSL.

WSL is running Ubuntu 22.04, MATLAB is version 2025A, and PX4 is version 1.14.3.

The specific compilation error is as follows:

Simulink cache file “No4_OutPWMinSTL.slxc” not found.

Searching for referenced models in model ‘No4_OutPWMinSTL’.

Only 1 model needs to be built.

Initiating the compilation process for No4_OutPWMinSTL

Generating code and artifacts for the ‘model-specific’ folder structure

Generating code to the compilation folder: D:\PX4_EXP\No4_OutPWMinSTL_ert_rtw

Invoking Target Language Compiler on No4_OutPWMinSTL.rtw

Using System Target File: D:\Software_Use\MATLAB2025A\rtw\c\ert\ert.tlc

Loading TLC function libraries

Initial pass through model to cache user-defined code

Caching model source code

Writing header file No4_OutPWMinSTL_types.h

Writing header file No4_OutPWMinSTL.h

Writing source file No4_OutPWMinSTL.cpp

Writing header file rtwtypes.h

Writing header file rtGetNaN.h

.

Writing source file rtGetNaN.cpp

Writing header file rt_nonfinite.h

Writing source file rt_nonfinite.cpp

Writing header file rtGetInf.h

Writing source file rtGetInf.cpp

.

Writing header file No4_OutPWMinSTL_private.h

Writing source file No4_OutPWMinSTL_data.cpp

Writing header file rtmodel.h

Writing source file ert_main.cpp

TLC code generation complete (took 1.148s).

Saving binary information cache.

Removing old px4_simulink_app directory: \wsl.localhost\Ubuntu-22.04\home\sjy\mypx4\PX4-Autopilot\src\modules\px4_simulink_app.

Build path: D:\PX4_EXP\No4_OutPWMinSTL_ert_rtw

Warning: PX4 Firmware build not done for the selected cmake config, perform setup screens

The compilation process for No4_OutPWMinSTL was aborted due to an error.

Top-level model target:

Model Compilation reason Status Compilation duration

=================================================================== No4_OutPWMinSTL information cache folder or artifact is missing. Unable to compile. See the build log for details. 0d

0 models compiled, out of 1 model (0 models are already up-to-date)

Compilation time: 0h 0m 9.2575s

PX4 Firmware build not done for the selected cmake config, perform setup screens

Component: Simulink | Category: Block diagram Error