Error in building simulink code for PX4-V6x
显示 更早的评论
Dear everyone,
I am building Simulink code for PX4 6x. However I got this issue. Could you let me know the solution?
Error:Compilation failure for command /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++ -DCONFIG_ARCH_BOARD_PX4_FMU_V6X -D_SYS_CDEFS_H_ -D_SYS_REENT_H_ -D__CUSTOM_FILE_IO__ -D__PX4_NUTTX -D__STDC_FORMAT_MACROS -DMODULE_NAME=\\\"px4_simulink_app\\\" -DPX4_MAIN=px4_simulink_app_app_main -DMODEL=waypoint_following -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DTERMFCN=1 -DONESTEPFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DPX4 -DFMUv6x -DNULL=0 -DMW_PX4_NUTTX_BUILD -DEXTMODE_DISABLETESTING -DEXTMODE_DISABLEPRINTF -DEXTMODE_DISABLE_ARGS_PROCESSING=1 -D__linux__ -DXCP_PLATFORM_LINUX_NO_PIE_SUPPORT -DSTACK_SIZE=64 -D__MW_TARGET_USE_HARDWARE_RESOURCES_H__ -DRT -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -Os -DNDEBUG -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -Wno-stringop-truncation -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -Wreorder -Wno-overloaded-virtual -fno-rtti -fno-exceptions -fno-sized-deallocation -fno-threadsafe-statics -nostdinc++ -Wframe-larger-than=2000 -fpermissive -Wno-narrowing -Wno-address-of-packed-member -Wno-cast-align -D__KERNEL__ -std=gnu++14 -I/home/thaibahoa2024/PX4-Autopilot/boards/px4/fmu-v6x/src -I/home/thaibahoa2024/PX4-Autopilot/platforms/nuttx/src/px4/common/include -I/home/thaibahoa2024/PX4-Autopilot/build/px4_fmu-v6x_multicopter -I/home/thaibahoa2024/PX4-Autopilot/build/px4_fmu-v6x_multicopter/src/lib -I/home/thaibahoa2024/PX4-Autopilot/platforms/nuttx/src/px4/stm/stm32h7/include -I/home/thaibahoa2024/PX4-Autopilot/platforms/common -I/home/thaibahoa2024/PX4-Autopilot/platforms/common/include -I/home/thaibahoa2024/PX4-Autopilot/src -I/home/thaibahoa2024/PX4-Autopilot/src/include -I/home/thaibahoa2024/PX4-Autopilot/src/lib -I/home/thaibahoa2024/PX4-Autopilot/src/lib/matrix -I/home/thaibahoa2024/PX4-Autopilot/src/modules -I/home/thaibahoa2024/PX4-Autopilot/platforms/nuttx/NuttX/nuttx/arch/arm/src/armv7-m -I/home/thaibahoa2024/PX4-Autopilot/platforms/nuttx/NuttX/nuttx/arch/arm/src/chip -I/home/thaibahoa2024/PX4-Autopilot/platforms/nuttx/NuttX/nuttx/arch/arm/src/common -I/home/thaibahoa2024/PX4-Autopilot/platforms/nuttx/NuttX/apps/include -I/home/thaibahoa2024/PX4-Autopilot/build/px4_fmu-v6x_multicopter/external/Install/include -I/home/thaibahoa2024/PX4-Autopilot/src/modules/px4_simulink_app -I/home/thaibahoa2024/PX4-Autopilot/src/modules/mavlink -I/home/thaibahoa2024/PX4-Autopilot/build/px4_fmu-v6x_multicopter/mavlink -I/home/thaibahoa2024/PX4-Autopilot/build/px4_fmu-v6x_multicopter/mavlink/common -I/home/thaibahoa2024/PX4-Autopilot/build/px4_fmu-v6x_multicopter/mavlink/uAvionix -isystem /home/thaibahoa2024/PX4-Autopilot/platforms/nuttx/NuttX/include/cxx -isystem /home/thaibahoa2024/PX4-Autopilot/platforms/nuttx/NuttX/nuttx/include/cxx -isystem /home/thaibahoa2024/PX4-Autopilot/platforms/nuttx/NuttX/nuttx/include -o src/modules/px4_simulink_app/CMakeFiles/modules__px4_simulink_app.dir/MW_ParameterRead.cpp.obj -c ../../src/modules/px4_simulink_app/MW_ParameterRead.cpp with error '\\wsl.localhost\ubuntu-22.04\home\thaibahoa2024\PX4-Autopilot\build\px4_fmu-v6x_multicopter' CMD.EXE was started with the above path as the current directory. UNC paths are not supported. Defaulting to Windows directory. bash: line 1: /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++: No such file or directory
采纳的回答
更多回答(2 个)
Thai Hoa
2025-9-11
2 个评论
Umar
2025-9-11
Hi @Thai Hoa,
Thank you for the detailed follow-up! I'm glad to hear that the solution worked for you and that you were able to resolve the issues. Your summary of the steps you took is really helpful and will definitely be valuable for others facing the same challenge.
Wishing you the best with your PX4 development, and feel free to reach out if you encounter any more questions in the future!
裕
2025-11-5
Bro, I had exactly the same problem, and your solution worked perfectly!
Ankur Bose
2025-9-23
1 个投票
The reason you faced the compilation issue is that either the expected GCC version (gcc-arm-none-eabi-9-2020-q2) was not installed or installed at some other location and not found at the expected path. You fixed the issue dy downloading and installing the gcc under /opt. We are enhancing the gcc path detection in upcoming releases to auto-detect the gcc for users
2 个评论
Thai Hoa
2025-9-23
Ankur Bose
2025-9-24
I would highly recommend using R2024b. The PX4 firmware supported in R2023b is a very old one and different from the one in R2024b. I would suggest you to run HITL using R2024b. If you are facing issues with R2024b, please reach out to MathWorks Technical support and we will look into your question
类别
在 帮助中心 和 File Exchange 中查找有关 Deployment, Integration, and Supported Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!