Clear Filters
Clear Filters

When using simulink for PX4 Autopilot occur false "Generating ELF failed"

17 views (last 30 days)
Generating ELF failed for command "C:\PX4\run-console_Simulink.bat "cd C:/PX4/home/Firmware/build/px4_fmu-v6x_default; bash /cygdrive/c/ProgramData/MATLAB/SupportPackages/R2023b_3/toolbox/target/supportpackages/px4/lib/scripts/readGenerateELF.sh /cygdrive/c/PX4/home/Firmware/build/px4_fmu-v6x_default/generateElf.txt"" with error "/cygdrive/c/PX4/toolchain/gcc-arm/bin/arm-none-eabi-g++ -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -Os -DNDEBUG --specs=nosys.specs -nostartfiles -nodefaultlibs -nostdlib -nostdinc++ -fno-exceptions -fno-rtti -Wl,--script=C:/PX4/home/Firmware/build/px4_fmu-v6x_default/NuttX/nuttx-config/scripts/script.ld -Wl,-Map=px4_fmu-v6x_default.map -Wl,--warn-common -Wl,--gc-sections -Wl,--start-group NuttX/apps/libapps.a NuttX/nuttx/arch/arm/src/libarch.a NuttX/nuttx/binfmt/libbinfmt.a NuttX/nuttx/libs/libc/libc.a NuttX/nuttx/boards/libboards.a NuttX/nuttx/libs/libxx/libxx.a NuttX/nuttx/drivers/libdrivers.a NuttX/nuttx/fs/libfs.a NuttX/nuttx/mm/libmm.a NuttX/nuttx/sched/libsched.a NuttX/nuttx/net/libnet.a -Wl,--end-group -lm -lgcc -Wl,--print-memory-usage src/drivers/adc/ads1115/libdrivers__ads1115.a src/drivers/adc/board_adc/libdrivers__board_adc.a src/drivers/barometer/bmp280/libdrivers__barometer__bmp280.a src/drivers/barometer/bmp388/libdrivers__barometer__bmp388.a src/drivers/barometer/dps310/libdrivers__barometer__dps310.a src/drivers/barometer/lps22hb/libdrivers__barometer__lps22hb.a src/drivers/barometer/lps33hw/libdrivers__barometer__lps33hw.a src/drivers/barometer/ms5611/libdrivers__barometer__ms5611.a src/drivers/batt_smbus/libdrivers__batt_smbus.a src/drivers/camera_capture/libdrivers__camera_capture.a src/drivers/camera_trigger/libdrivers__camera_trigger.a src/drivers/differential_pressure/ets/libdrivers__ets_airspeed.a src/drivers/differential_pressure/ms4525/libdrivers__ms4525_airspeed.a src/drivers/differential_pressure/ms5525/libdrivers__ms5525_airspeed.a src/drivers/differential_pressure/sdp3x/libdrivers__sdp3x_airspeed.a src/drivers/distance_sensor/cm8jl65/libdrivers__cm8jl65.a src/drivers/distance_sensor/leddar_one/libdrivers__distance_sensor__leddar_one.a src/drivers/distance_sensor/ll40ls/libdrivers__ll40ls.a src/drivers/distance_sensor/ll40ls_pwm/libdrivers__ll40ls_pwm.a src/drivers/distance_sensor/mappydot/libdrivers__mappydot.a src/drivers/distance_sensor/mb12xx/libdrivers__mb12xx.a src/drivers/distance_sensor/pga460/libdrivers__pga460.a src/drivers/distance_sensor/lightware_laser_i2c/libdrivers__distance_sensor__lightware_laser_i2c.a src/drivers/distance_sensor/lightware_laser_serial/libdrivers__distance_sensor__lightware_laser_serial.a src/drivers/distance_sensor/srf02/libdrivers__distance_sensor__srf02.a src/drivers/distance_sensor/teraranger/libdrivers__distance_sensor__teraranger.a src/drivers/distance_sensor/tfmini/libdrivers__tfmini.a src/drivers/distance_sensor/ulanding_radar/libdrivers__distance_sensor__ulanding_radar.a src/drivers/distance_sensor/vl53l0x/libdrivers__distance_sensor__vl53l0x.a src/drivers/distance_sensor/vl53l1x/libdrivers__distance_sensor__vl53l1x.a src/drivers/distance_sensor/gy_us42/libdrivers__distance_sensor__gy_us42.a src/drivers/dshot/libdrivers__dshot.a src/drivers/gps/libdrivers__gps.a src/drivers/heater/libdrivers__heater.a src/drivers/imu/bosch/bmi088/libdrivers__imu__bosch__bmi088.a src/drivers/imu/invensense/icm20602/libdrivers__imu__invensense__icm20602.a src/drivers/imu/invensense/icm20649/libdrivers__imu__invensense__icm20649.a src/drivers/imu/invensense/icm20948/libdrivers__imu__invensense__icm20948.a src/drivers/imu/invensense/icm20948/libdrivers__imu__invensense__icm20948_i2c_passthrough.a src/drivers/imu/invensense/icm42688p/libdrivers__imu__invensense__icm42688p.a src/drivers/irlock/libdrivers__irlock.a src/drivers/lights/rgbled/libdrivers__rgbled.a src/drivers/lights/rgbled_ncp5623c/libdrivers__rgbled_ncp5623c.a src/drivers/magnetometer/akm/ak8963/libdrivers__magnetometer__akm__ak8963.a src/drivers/magnetometer/akm/ak09916/libdrivers__magnetometer__akm__ak09916.a src/drivers/magnetometer/bosch/bmm150/libdrivers__magnetometer__bosch__bmm150.a src/drivers/magnetometer/hmc5883/libdrivers__hmc5883.a src/drivers/magnetometer/qmc5883l/libdrivers__magnetometer__qmc5883l.a src/drivers/magnetometer/isentek/ist8308/libdrivers__magnetometer__isentek__ist8308.a src/drivers/magnetometer/isentek/ist8310/libdrivers__magnetometer__isentek__ist8310.a src/drivers/magnetometer/lis2mdl/libdrivers__lis2mdl.a src/drivers/magnetometer/lis3mdl/libdrivers__magnetometer__lis3mdl.a src/drivers/magnetometer/lsm303agr/libdrivers__magnetometer__lsm303agr.a src/drivers/magnetometer/rm3100/libdrivers__rm3100.a src/drivers/magnetometer/vtrantech/vcm1193l/libdrivers__magnetometer__vcm1193l.a src/drivers/optical_flow/paw3902/libdrivers__optical_flow__paw3902.a src/drivers/optical_flow/pmw3901/libdrivers__optical_flow__pmw3901.a src/drivers/optical_flow/px4flow/libdrivers__px4flow.a src/drivers/optical_flow/thoneflow/libdrivers__thoneflow.a src/drivers/osd/atxxxx/libdrivers__atxxxx.a src/drivers/pca9685/libdrivers__pca9685.a src/drivers/pca9685_pwm_out/libdrivers__pca9685_pwm_out.a src/drivers/power_monitor/ina226/libdrivers__ina226.a src/drivers/pwm_out_sim/libdrivers__pwm_out_sim.a src/drivers/pwm_out/libdrivers__pwm_out.a src/drivers/px4io/libdrivers__px4io.a src/drivers/rc_input/libdrivers__rc_input.a src/drivers/roboclaw/libdrivers__roboclaw.a src/drivers/rpm/pcf8583/libdrivers__pcf8583.a src/drivers/safety_button/libdrivers__safety_button.a src/drivers/smart_battery/batmon/libdrivers__batmon.a src/drivers/telemetry/bst/libdrivers__bst.a src/drivers/telemetry/frsky_telemetry/libdrivers__frsky_telemetry.a src/drivers/telemetry/hott/hott_sensors/libdrivers__hott__hott_sensors.a src/drivers/telemetry/hott/hott_telemetry/libdrivers__hott__hott_telemetry.a src/drivers/tone_alarm/libdrivers__tone_alarm.a src/drivers/uavcan/libdrivers__uavcan.a src/modules/px4_simulink_app/libmodules__px4_simulink_app.a src/modules/airspeed_selector/libmodules__airspeed_selector.a src/modules/attitude_estimator_q/libmodules__attitude_estimator_q.a src/modules/camera_feedback/libmodules__camera_feedback.a src/modules/commander/libmodules__commander.a src/modules/dataman/libmodules__dataman.a src/modules/ekf2/libmodules__ekf2.a src/modules/esc_battery/libmodules__esc_battery.a src/modules/events/libmodules__events.a src/modules/flight_mode_manager/libmodules__flight_mode_manager.a src/modules/fw_att_control/libmodules__fw_att_control.a src/modules/fw_pos_control_l1/libmodules__fw_pos_control_l1.a src/modules/gyro_calibration/libmodules__gyro_calibration.a src/modules/gyro_fft/libmodules__gyro_fft.a src/modules/land_detector/libmodules__land_detector.a src/modules/landing_target_estimator/libmodules__landing_target_estimator.a src/modules/load_mon/libmodules__load_mon.a src/modules/logger/libmodules__logger.a src/modules/mavlink/libmodules__mavlink.a src/modules/mc_att_control/libmodules__mc_att_control.a src/modules/mc_hover_thrust_estimator/libmodules__mc_hover_thrust_estimator.a src/modules/mc_pos_control/libmodules__mc_pos_control.a src/modules/mc_rate_control/libmodules__mc_rate_control.a src/modules/navigator/libmodules__navigator.a src/modules/rc_update/libmodules__rc_update.a src/modules/rover_pos_control/libmodules__rover_pos_control.a src/modules/sensors/libmodules__sensors.a src/modules/sih/libmodules__sih.a src/modules/temperature_compensation/libmodules__temperature_compensation.a src/modules/vmount/libdrivers__vmount.a src/modules/vtol_att_control/libmodules__vtol_att_control.a src/systemcmds/bl_update/libsystemcmds__bl_update.a src/systemcmds/dmesg/libsystemcmds__dmesg.a src/systemcmds/esc_calib/libsystemcmds__esc_calib.a src/systemcmds/gpio/libsystemcmds__gpio.a src/systemcmds/hardfault_log/libsystemcmds__hardfault_log.a src/systemcmds/i2cdetect/libsystemcmds__i2cdetect.a src/systemcmds/led_control/libsystemcmds__led_control.a src/systemcmds/mft/libsystemcmds__mft.a src/systemcmds/mixer/libsystemcmds__mixer.a src/systemcmds/motor_ramp/libsystemcmds__motor_ramp.a src/systemcmds/motor_test/libsystemcmds__motor_test.a src/systemcmds/mtd/libsystemcmds__mtd.a src/systemcmds/nshterm/libsystemcmds__nshterm.a src/systemcmds/netman/libmodules__netman.a src/systemcmds/param/libsystemcmds__param.a src/systemcmds/perf/libsystemcmds__perf.a src/systemcmds/pwm/libsystemcmds__pwm.a src/systemcmds/reboot/libsystemcmds__reboot.a src/systemcmds/sd_bench/libsystemcmds__sd_bench.a src/systemcmds/system_time/libsystemcmds__system_time.a src/systemcmds/top/libsystemcmds__top.a src/systemcmds/topic_listener/libsystemcmds__topic_listener.a src/systemcmds/tune_control/libsystemcmds__tune_control.a src/systemcmds/uorb/libsystemcmds__uorb.a src/systemcmds/ver/libsystemcmds__ver.a src/systemcmds/work_queue/libsystemcmds__work_queue.a src/examples/fake_gps/libmodules__fake_gps.a ROMFS/libromfs.a platforms/nuttx/src/px4/stm/stm32h7/adc/libarch_adc.a src/lib/drivers/smbus/libdrivers__smbus.a src/lib/drivers/airspeed/libdrivers__airspeed.a src/lib/drivers/rangefinder/libdrivers_rangefinder.a platforms/nuttx/src/px4/stm/stm32h7/dshot/libarch_dshot.a src/lib/battery/libbattery.a platforms/nuttx/src/px4/stm/stm32h7/io_pins/libarch_io_pins.a platforms/nuttx/src/px4/stm/stm32h7/px4io_serial/libarch_px4io_serial.a src/lib/rc/librc.a src/lib/drivers/smbus_sbs/libdrivers__smbus_sbs.a src/drivers/telemetry/hott/libdrivers__hott.a platforms/nuttx/src/px4/stm/stm32h7/tone_alarm/libarch_tone_alarm.a src/lib/mixer_module/libmixer_module.a src/lib/output_limit/liboutput_limit.a src/lib/led/libled.a src/drivers/uavcan/libuavcan_drivers/libuavcan_stm32h7_driver.a src/drivers/uavcan/libuavcan/libuavcan/libuavcan.a src/lib/airspeed_validator/libAirspeedValidator.a src/lib/ecl/airdata/libecl_airdata.a src/modules/commander/failure_detector/libfailure_detector.a src/modules/commander/Arming/PreFlightCheck/libPreFlightCheck.a src/modules/commander/Arming/ArmAuthorization/libArmAuthorization.a src/modules/commander/Arming/HealthFlags/libHealthFlags.a src/lib/ecl/EKF/libecl_EKF.a src/lib/ecl/geo_lookup/libecl_geo_lookup.a src/modules/ekf2/Utility/libEKF2Utility.a src/lib/weather_vane/libWeatherVane.a src/modules/flight_mode_manager/tasks/AutoFollowMe/libFlightTaskAutoFollowMe.a src/modules/flight_mode_manager/tasks/AutoLineSmoothVel/libFlightTaskAutoLineSmoothVel.a src/modules/flight_mode_manager/tasks/AutoMapper/libFlightTaskAutoMapper.a src/modules/flight_mode_manager/tasks/Auto/libFlightTaskAuto.a src/lib/avoidance/libavoidance.a src/modules/flight_mode_manager/tasks/Descend/libFlightTaskDescend.a src/modules/flight_mode_manager/tasks/Failsafe/libFlightTaskFailsafe.a src/modules/flight_mode_manager/tasks/ManualAcceleration/libFlightTaskManualAcceleration.a src/modules/flight_mode_manager/tasks/ManualPositionSmoothVel/libFlightTaskManualPositionSmoothVel.a src/modules/flight_mode_manager/tasks/ManualPosition/libFlightTaskManualPosition.a src/lib/collision_prevention/libCollisionPrevention.a src/modules/flight_mode_manager/tasks/Transition/libFlightTaskTransition.a src/modules/flight_mode_manager/tasks/Orbit/libFlightTaskOrbit.a src/modules/flight_mode_manager/tasks/ManualAltitudeSmoothVel/libFlightTaskManualAltitudeSmoothVel.a src/modules/flight_mode_manager/tasks/ManualAltitude/libFlightTaskManualAltitude.a src/modules/flight_mode_manager/tasks/Utility/libFlightTaskUtility.a src/modules/flight_mode_manager/tasks/FlightTask/libFlightTask.a src/lib/bezier/libbezier.a src/modules/fw_pos_control_l1/launchdetection/liblaunchdetection.a src/modules/fw_pos_control_l1/runway_takeoff/librunway_takeoff.a src/lib/tecs/libtecs.a src/modules/mc_att_control/AttitudeControl/libAttitudeControl.a src/modules/mc_hover_thrust_estimator/libzero_order_hover_thrust_ekf.a src/modules/mc_pos_control/PositionControl/libPositionControl.a src/modules/mc_pos_control/Takeoff/libTakeoff.a src/lib/hysteresis/libhysteresis.a src/lib/controllib/libcontrollib.a src/lib/slew_rate/libSlewRate.a src/lib/circuit_breaker/libcircuit_breaker.a src/modules/mc_rate_control/RateControl/libRateControl.a src/lib/landing_slope/liblanding_slope.a src/modules/navigator/GeofenceBreachAvoidance/libgeofence_breach_avoidance.a src/lib/motion_planning/libmotion_planning.a src/lib/l1/libl1.a src/lib/pid/libpid.a src/lib/airspeed/libairspeed.a src/modules/sensors/data_validator/libdata_validator.a src/modules/sensors/vehicle_acceleration/libvehicle_acceleration.a src/modules/sensors/vehicle_angular_velocity/libvehicle_angular_velocity.a src/modules/sensors/vehicle_air_data/libvehicle_air_data.a src/modules/sensors/vehicle_gps_position/libvehicle_gps_position.a src/modules/sensors/vehicle_imu/libvehicle_imu.a src/modules/sensors/vehicle_magnetometer/libvehicle_magnetometer.a src/lib/sensor_calibration/libsensor_calibration.a src/lib/drivers/barometer/libdrivers_barometer.a src/lib/drivers/accelerometer/libdrivers_accelerometer.a src/lib/drivers/gyroscope/libdrivers_gyroscope.a src/lib/drivers/magnetometer/libdrivers_magnetometer.a src/lib/conversion/libconversion.a src/lib/mathlib/libmathlib.a src/lib/ecl/geo/libecl_geo.a src/lib/mixer/libmixer.a src/lib/mixer/AllocatedActuatorMixer/libAllocatedActuatorMixer.a src/lib/mixer/HelicopterMixer/libHelicopterMixer.a src/lib/mixer/MultirotorMixer/libMultirotorMixer.a src/lib/mixer/NullMixer/libNullMixer.a src/lib/mixer/SimpleMixer/libSimpleMixer.a src/lib/mixer/MixerBase/libMixerBase.a src/lib/tunes/libtunes.a src/lib/version/libversion.a src/lib/systemlib/libsystemlib.a NuttX/nuttx/arch/arm/src/libarch.a boards/px4/fmu-v6x/src/libdrivers_board.a platforms/nuttx/src/px4/stm/stm32h7/hrt/libarch_hrt.a platforms/nuttx/src/px4/common/libpx4_layer.a platforms/common/libpx4_platform.a platforms/common/px4_work_queue/libpx4_work_queue.a src/lib/cdev/libcdev.a src/lib/drivers/device/libdrivers__device.a platforms/nuttx/src/px4/stm/stm32h7/spi/libarch_spi.a platforms/nuttx/src/px4/stm/stm32h7/board_hw_info/libarch_board_hw_info.a src/lib/drivers/led/libdrivers__led.a src/lib/parameters/libparameters.a platforms/nuttx/src/px4/stm/stm32h7/board_reset/libarch_board_reset.a platforms/nuttx/src/px4/stm/stm32h7/board_critmon/libarch_board_critmon.a platforms/nuttx/src/px4/stm/stm32h7/version/libarch_version.a platforms/common/uORB/libuORB.a src/lib/parameters/flashparams/libflashparams.a NuttX/nuttx/arch/arm/src/libarch.a boards/px4/fmu-v6x/src/libdrivers_board.a platforms/nuttx/src/px4/stm/stm32h7/hrt/libarch_hrt.a platforms/nuttx/src/px4/common/libpx4_layer.a platforms/common/libpx4_platform.a platforms/common/px4_work_queue/libpx4_work_queue.a src/lib/cdev/libcdev.a src/lib/drivers/device/libdrivers__device.a platforms/nuttx/src/px4/stm/stm32h7/spi/libarch_spi.a platforms/nuttx/src/px4/stm/stm32h7/board_hw_info/libarch_board_hw_info.a src/lib/drivers/led/libdrivers__led.a src/lib/parameters/libparameters.a platforms/nuttx/src/px4/stm/stm32h7/board_reset/libarch_board_reset.a platforms/nuttx/src/px4/stm/stm32h7/board_critmon/libarch_board_critmon.a platforms/nuttx/src/px4/stm/stm32h7/version/libarch_version.a platforms/common/uORB/libuORB.a src/lib/parameters/flashparams/libflashparams.a NuttX/apps/libapps.a src/lib/perf/libperf.a src/lib/parameters/tinybson/libtinybson.a NuttX/nuttx/libs/libxx/libxx.a NuttX/nuttx/libs/libc/libc.a NuttX/nuttx/drivers/libdrivers.a NuttX/nuttx/fs/libfs.a NuttX/nuttx/net/libnet.a NuttX/nuttx/mm/libmm.a NuttX/nuttx/sched/libsched.a -lgcc msg/libuorb_msgs.a -lm -o px4_fmu-v6x_default.elf
  1 Comment
Kautuk Raj
Kautuk Raj on 27 Mar 2024
Is the ARM GCC toolchain is correctly installed and configured? The error message mentions arm-none-eabi-g++, a part of this toolchain. You can test if it is accessible by running arm-none-eabi-g++ --version in your command line.

Sign in to comment.

Answers (1)

Himanshu
Himanshu on 10 Jul 2024
Hello,
I see that you are encountering the "Generating ELF failed" error in Simulink for PX4 Autopilot.
I faced a similar issue and it was related to the Toolchain Compatibility. Ensure that the Cygwin toolchain version you have downloaded is compatible with the PX4 firmware. The documentation below will help you select the correct Cygwin version:
In case the above troubleshooting steps do not fix the issue, you can share the support package version you are using along with the steps you followed before encountering the error.
I hope this helps.

Community Treasure Hunt

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

Start Hunting!