Clear Filters
Clear Filters

Error encountered while trying to run connected I/O simulation in PX4 support toolbox.

3 views (last 30 days)
I am trying to run the example with just an accelerometer, using an NXP FMUK66 Rev.B (FMU v.3) and it always fails because somehow there is no "stm32_can.h" file in the directory C:\PX4\home\Firmware\src\modules\px4_simulink_app.
The error code is: Warning: Compilation failure for command "C:\PX4\toolchain\gcc-arm\bin\arm-none-eabi-gcc -DCONFIG_ARCH_BOARD_NXP_FMUK66_V3 -DCONSTRAINED_MEMORY -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=connectedIO -DNUMST=1 -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 -DSTACK_SIZE=64 -D__MW_TARGET_USE_HARDWARE_RESOURCES_H__ -DRT -DNULL=0 -DPX4_CONNECTEDIO -DFMUvx -DMW_PX4_NUTTX_BUILD -DMW_PX4_EXTMODE_HWPORT=\"/dev/ttyACM0\" -DMW_PX4_EXTMODE_BAUD_RATE=115200 -DMW_PX4_DISABLE_MAVLINK=1 -DMW_NUM_CAN_RECEIVE_RAW=20 -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-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 -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fno-common -Wbad-function-cast -Wnested-externs -Wstrict-prototypes -Wframe-larger-than=2048 -std=gnu11 -Wno-narrowing -Wframe-larger-than=2000 -I../../boards/nxp/fmuk66-v3/src -I../../platforms/nuttx/src/px4/common/include -I. -Isrc/lib -I../../platforms/nuttx/src/px4/nxp/k66/include -I../../platforms/common -I../../platforms/common/include -I../../src -I../../src/include -I../../src/lib -I../../src/lib/matrix -I../../src/modules -INuttX/nuttx/arch/arm/src/armv7-m -INuttX/nuttx/arch/arm/src/chip -INuttX/nuttx/arch/arm/src/common -INuttX/apps/include -Iexternal/Install/include -I../../src/modules/px4_simulink_app -I../../src/modules/mavlink -I../../mavlink/include/mavlink -isystem ../../platforms/nuttx/NuttX/include/cxx -isystem NuttX/nuttx/include/cxx -isystem NuttX/nuttx/include -o src\modules\px4_simulink_app\CMakeFiles\modules__px4_simulink_app.dir\customFunction.c.obj -c ..\..\src\modules\px4_simulink_app\customFunction.c" with error "In file included from ..\..\src\modules\px4_simulink_app\IO_peripheralInclude.h:17:0, from ..\..\src\modules\px4_simulink_app\customFunction.h:9, from ..\..\src\modules\px4_simulink_app\customFunction.c:2: ..\..\src\modules\px4_simulink_app\IO_debug.h:58:1: warning: function declaration isn't a prototype [-Wstrict-prototypes] void sendDebugPackets(); ^~~~ In file included from ..\..\src\modules\px4_simulink_app\customFunction.h:19:0, from ..\..\src\modules\px4_simulink_app\customFunction.c:2: ..\..\src\modules\px4_simulink_app\MW_PX4_CAN.h:40:10: fatal error: stm32_can.h: No such file or directory #include "stm32_can.h" ^~~~~~~~~~~~~ compilation terminated.

Answers (1)

Prateekshya on 24 Jan 2024
The error message you're encountering indicates that the "stm32_can.h" file is missing from the expected directory within the PX4 firmware source code.
Here are some steps you can take to resolve this issue:
  1. Make sure you have the latest version of the PX4 firmware. If not, update the firmware repository by pulling the latest changes from the PX4 GitHub repository.
  2. Verify that the "stm32_can.h" file actually exists in the PX4 firmware source tree. It should be located in the NuttX-specific directories related to the STM32 family of microcontrollers.
  3. Review the project's include paths to ensure that the directory containing "stm32_can.h" is correctly specified. If the file exists but is in a different directory, you may need to modify the include directories in your build configuration to point to the correct location of the "stm32_can.h" file.
  4. If you've made changes to the PX4 firmware configuration or if there are updates, you might need to reconfigure the firmware build for your specific hardware target. After ensuring that the configuration is correct and all necessary files are in place, rebuild the PX4 firmware.
The exact paths and configurations may vary depending on your setup and the version of the PX4 firmware you are using. Please refer the PX4 documentation and the documentation for your specific hardware target for the most accurate instructions. You can refer to the below link:
I hope this helps!




Community Treasure Hunt

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

Start Hunting!