-
Notifications
You must be signed in to change notification settings - Fork 13.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Board config: SPI & I2C config simplifications (1) #14221
Conversation
|
I think I do.
Before the The reasoning for this was to not add delays the start up. (Using the time from OS init as the reset time) Will this still work correctly? |
The way it is now, yes. It configures the GPIO's and accesses the (static) SPI configuration (so it does not access more OS functionality than before). But please have a look at the definitions as well (under |
5e421ae
to
97f0281
Compare
@PX4/testflights can you test this on all boards? Make sure to check that you do not have to recalibrate sensors when flashing this PR. When switching back to master, you will however have to recalibrate. |
tested on pixhawk4 v5 f-450 Position Mode: Good. Procedure pr Log: master log: |
Tested on NXP FMUK66 v3Modes Tested
Procedure Notes Logs Tested on Pixhawk 3 v4ProModes Tested
Procedure Notes Logs |
Tested on PixRacer V4- Modes Tested Log Nota****In altitude mode, the vehicle did not respect the height that continued to increase in pitch forward. |
ce65c4b
to
27dff4b
Compare
The 3DR pixhawk mini? I'm fairly certain it actually does have an IO (the 8 pwm outputs). |
27dff4b
to
80c8ad3
Compare
Indeed. Something was off then on my test board, it was not able to communicate with the IO. |
80c8ad3
to
9ab45e5
Compare
@dagar can we get this in? |
For now can you at least keep qurt building? Hopefully soon we'll decide to either resurrect Excelsior (ModalAI) or purge it. |
|
||
} else { | ||
// Making sure the other peripherals are not selected | ||
stm32_gpiowrite(bus->devices[i].cs_gpio, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you consider not propagating this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is an option too. I was considering the opposite: dropping the deselect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was considering the opposite: dropping the deselect.
Do you mean leaving parts selected until another device is selected?
That might be a bad idea, the CS needs to be de-asserted to release the bus and re-asserted for some parts to reset state (address counters) etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but since that's a bad idea, let's look into the other option then.
I'm wondering if we should use this as an opportunity to split fmu-v2 and fmu-v3. Proposal
This would save a little bit of flash and help us identify boards that need bootloader updates. |
constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { | ||
initSPIBus(SPI::Bus::SPI1, { | ||
initSPIDevice(DRV_IMU_DEVTYPE_MPU9250, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), | ||
initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortC, GPIO::Pin15}, SPI::DRDY{GPIO::PortC, GPIO::Pin14}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question for later, is there a better way we can handle these cases of "contains one of the following"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could do it based on those that use the same CS pin.
initSPIDevice(DRV_IMU_DEVTYPE_MPU9250, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), | ||
initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortC, GPIO::Pin15}, SPI::DRDY{GPIO::PortC, GPIO::Pin14}), | ||
initSPIDevice(DRV_IMU_DEVTYPE_ICM20608, SPI::CS{GPIO::PortC, GPIO::Pin15}, SPI::DRDY{GPIO::PortC, GPIO::Pin14}), | ||
initSPIDevice(DRV_MAG_DEVTYPE_HMC5883, SPI::CS{GPIO::PortE, GPIO::Pin15}, SPI::DRDY{GPIO::PortE, GPIO::Pin12}), // hmc5983 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't newer pixracers have an lis3mdl in place of the hmc5883?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I overlooked that one.
@@ -110,7 +110,7 @@ __EXPORT void board_peripheral_reset(int ms) | |||
{ | |||
/* set the peripheral and sensor rails off */ | |||
stm32_gpiowrite(GPIO_VDD_3V3_PERIPH_EN, 0); | |||
stm32_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, 0); | |||
board_control_spi_sensors_power(false, 0xffff); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we ever not using a busmask of 0xffff
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in V5x
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in V5x
I don't believe so. https://github.com/PX4/Firmware/pull/14221/files#diff-8e2fa2c853114fc9e393de59a7442b16R108
Overall this looks great. The only blocker I see for merging is the pixracer lis3mdl (#9175) and possibly the fmu-v2/v3 split (unless there's a reason that's a terrible idea). |
It is cool! Debug wise it can be not really inspectable...but that should be ok because it is perfect!. On V3 I do not see a clean power reset on the sensors from SW. This may be an artifact of the bad HW that bootlooped on Sensor power down. We should fix that herein or a next PR. The right thing to do is to power off all the sensors in To overcome the bad HW that wired the FMU and sensor power together, will have to reserve a RTC register for state:Call it RTCn. 0xXXXXXXXX - not any of the below, unknown (first boot) Then in If RTCn is 0xA0A0A0A0 leave it, if not set it to 0xb00b00 turn the power off. Then in board_app_initialize if RTCn is not 0xbaddbadd, set it to 0xA0A0A0A0 - this is good hw. Bad HW will boot twice if the RTC battery drains. But it is bad HW so I think that is OK. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bkueng Really nice! Thank you for this! I ran it and instrumented it, and I stepped it. While it is 500ns slower, and a bit harder to inspect in some cases. It million times more readable!
Chip-select and SPI initialization uses the new config, whereas the drivers still use the existing defines. The configuration in board_config.h can be removed after all drivers are updated.
This avoids the need for recalibration, and also cleans up other driver ID's (merge separate accel/gyro). The SPI address was previously set to a board-specific (arbitrary) value, and is now set to 0. This will allow extending for multiple sensors of the same type on the same bus.
to reduce FLASH size
to reduce FLASH size
9ab45e5
to
88ef51b
Compare
Thanks for the reviews. I added the lis3mdl to pixracer, and added QuRT.
Yes, but I think that ship has sailed already. If there's indeed anyone supporting it, I'm perfectly fine with that though.
That's an option. I'm a bit concerned if it gets flashed to the wrong board and uses the wrong pins. |
@@ -467,18 +467,20 @@ __END_DECLS | |||
// param is a C-interface. This means there is no overloading, and thus no type-safety for param_get(). | |||
// So for C++ code we redefine param_get() to inlined overloaded versions, which gives us type-safety | |||
// w/o having to use a different interface | |||
static inline int param_get(param_t param, float *val) | |||
static inline int param_get_cplusplus(param_t param, float *val) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks linking on gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide the error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[691/691] Linking CXX executable bin/px4
FAILED: bin/px4
: && /home/jake/hexagon/Qualcomm/ARM_Tools/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ --sysroot=/home/jake/hexagon/Qualcomm/ARM_Tools/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc -O2 -g -DNDEBUG -fuse-ld=gold -Wl,--export-dynamic -rdynamic platforms/posix/CMakeFiles/px4.dir/px4muorb_stub.c.o platforms/posix/CMakeFiles/px4.dir/src/px4/common/main.cpp.o platforms/posix/CMakeFiles/px4.dir/apps.cpp.o platforms/posix/CMakeFiles/px4.dir/home/jake/hexagon/Qualcomm/Hexagon_SDK/3.1/libs/common/rpcmem/src/rpcmem.c.o -o bin/px4 -L/home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/external/Install/lib -Wl,-rpath,/home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/external/Install/lib -Wl,--start-group platforms/posix/src/px4/common/libpx4_layer.a src/lib/parameters/libparameters.a src/modules/uORB/libmodules__uORB.a src/drivers/batt_smbus/libdrivers__batt_smbus.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/sf0x/libdrivers__sf0x.a src/drivers/distance_sensor/sf1xx/libdrivers__sf1xx.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/gps/libdrivers__gps.a src/drivers/pwm_out_sim/libdrivers__pwm_out_sim.a src/drivers/qshell/posix/libdrivers__qshell__posix.a src/drivers/rc_input/libdrivers__rc_input.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/events/libmodules__events.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/land_detector/libmodules__land_detector.a src/modules/landing_target_estimator/libmodules__landing_target_estimator.a src/modules/local_position_estimator/libmodules__local_position_estimator.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/muorb/krait/libmodules__muorb__krait.a src/modules/muorb/test/libmodules__muorb__test__muorb_test.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/simulator/libmodules__simulator.a src/modules/simulator/battery_simulator/libmodules__simulator__battery_simulator.a src/modules/vmount/libdrivers__vmount.a src/modules/vtol_att_control/libmodules__vtol_att_control.a src/systemcmds/esc_calib/libsystemcmds__esc_calib.a src/systemcmds/led_control/libsystemcmds__led_control.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/param/libsystemcmds__param.a src/systemcmds/perf/libsystemcmds__perf.a src/systemcmds/pwm/libsystemcmds__pwm.a src/systemcmds/sd_bench/libsystemcmds__sd_bench.a src/systemcmds/shutdown/libsystemcmds__shutdown.a src/systemcmds/topic_listener/libsystemcmds__topic_listener.a src/systemcmds/tune_control/libsystemcmds__tune_control.a src/systemcmds/ver/libsystemcmds__ver.a src/systemcmds/work_queue/libsystemcmds__work_queue.a -L/home/jake/hexagon/Qualcomm/Hexagon_SDK/3.1/libs/common/remote/ship/UbuntuARM_Debug -lsdsprpc -lpthread -lm -lrt -Wl,--end-group -L/home/jake/hexagon/Qualcomm/Hexagon_SDK/3.1/libs/common/remote/ship/UbuntuARM_Debug -lsdsprpc src/lib/drivers/smbus/libdrivers__smbus.a src/lib/drivers/airspeed/libdrivers__airspeed.a src/lib/drivers/rangefinder/libdrivers_rangefinder.a src/lib/mixer_module/libmixer_module.a src/lib/output_limit/liboutput_limit.a src/lib/rc/librc.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/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/lib/controllib/libcontrollib.a src/modules/mc_pos_control/PositionControl/libPositionControl.a src/lib/flight_tasks/libFlightTasks.a src/lib/flight_tasks/tasks/ManualAltitudeSmoothVel/libFlightTaskManualAltitudeSmoothVel.a src/lib/flight_tasks/tasks/ManualPositionSmooth/libFlightTaskManualPositionSmooth.a src/lib/flight_tasks/tasks/ManualPositionSmoothVel/libFlightTaskManualPositionSmoothVel.a src/lib/flight_tasks/tasks/ManualPosition/libFlightTaskManualPosition.a src/lib/flight_tasks/tasks/AutoLineSmoothVel/libFlightTaskAutoLineSmoothVel.a src/lib/flight_tasks/tasks/AutoMapper/libFlightTaskAutoMapper.a src/lib/flight_tasks/tasks/AutoFollowMe/libFlightTaskAutoFollowMe.a src/lib/flight_tasks/tasks/Auto/libFlightTaskAuto.a src/lib/avoidance/libavoidance.a src/lib/flight_tasks/tasks/Offboard/libFlightTaskOffboard.a src/lib/flight_tasks/tasks/Failsafe/libFlightTaskFailsafe.a src/lib/flight_tasks/tasks/Descend/libFlightTaskDescend.a src/lib/flight_tasks/tasks/Transition/libFlightTaskTransition.a src/lib/flight_tasks/tasks/Orbit/libFlightTaskOrbit.a src/lib/flight_tasks/tasks/ManualAltitudeSmooth/libFlightTaskManualAltitudeSmooth.a src/lib/flight_tasks/tasks/ManualAltitude/libFlightTaskManualAltitude.a src/lib/flight_tasks/tasks/Manual/libFlightTaskManual.a src/lib/flight_tasks/tasks/Utility/libFlightTaskUtility.a src/lib/flight_tasks/tasks/FlightTask/libFlightTask.a src/lib/bezier/libbezier.a src/lib/weather_vane/libWeatherVane.a src/lib/collision_prevention/libCollisionPrevention.a src/modules/mc_pos_control/Takeoff/libTakeoff.a src/lib/hysteresis/libhysteresis.a src/lib/circuit_breaker/libcircuit_breaker.a src/modules/mc_rate_control/RateControl/libRateControl.a src/lib/landing_slope/liblanding_slope.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_imu/libvehicle_imu.a src/modules/sensors/sensor_calibration/libsensor_calibration.a src/lib/mag_compensation/libmag_compensation.a src/lib/drivers/accelerometer/libdrivers_accelerometer.a src/lib/drivers/barometer/libdrivers_barometer.a src/lib/drivers/gyroscope/libdrivers_gyroscope.a src/lib/drivers/device/libdrivers__device.a src/lib/drivers/magnetometer/libdrivers_magnetometer.a src/lib/conversion/libconversion.a src/lib/mathlib/libmathlib.a src/lib/battery/libbattery.a src/lib/ecl/geo/libecl_geo.a src/lib/mixer/libmixer.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/Mixer/libMixer.a src/lib/tunes/libtunes.a src/lib/version/libversion.a platforms/posix/src/px4/common/libpx4_layer.a src/lib/parameters/libparameters.a src/modules/uORB/libmodules__uORB.a platforms/common/px4_work_queue/libpx4_work_queue.a platforms/posix/src/px4/common/px4_daemon/libpx4_daemon.a platforms/common/libpx4_platform.a src/lib/systemlib/libsystemlib.a src/lib/cdev/libcdev.a platforms/posix/src/px4/common/libpx4_layer.a src/lib/parameters/libparameters.a src/modules/uORB/libmodules__uORB.a platforms/common/px4_work_queue/libpx4_work_queue.a platforms/posix/src/px4/common/px4_daemon/libpx4_daemon.a platforms/common/libpx4_platform.a src/lib/systemlib/libsystemlib.a src/lib/cdev/libcdev.a platforms/common/work_queue/libwork_queue.a boards/atlflight/excelsior/src/libdrivers_board.a src/lib/perf/libperf.a src/lib/parameters/tinybson/libtinybson.a msg/libuorb_msgs.a -lpthread -lm -lrt && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-uorb && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-batt_smbus && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-camera_trigger && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-ets_airspeed && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-ms4525_airspeed && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-ms5525_airspeed && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-sdp3x_airspeed && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-cm8jl65 && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-leddar_one && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-ll40ls && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-ll40ls_pwm && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-mappydot && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-mb12xx && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-pga460 && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-sf0x && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-sf1xx && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-srf02 && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-teraranger && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-tfmini && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-ulanding_radar && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-vl53l0x && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-gps && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-pwm_out_sim && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-qshell && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-rc_input && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-airspeed_selector && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-attitude_estimator_q && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-camera_feedback && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-commander && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-dataman && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-ekf2 && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-send_event && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-fw_att_control && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-fw_pos_control_l1 && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-land_detector && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-landing_target_estimator && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-local_position_estimator && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-logger && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-mavlink && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-mc_att_control && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-mc_hover_thrust_estimator && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-mc_pos_control && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-mc_rate_control && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-muorb && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-muorb_test && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-navigator && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-rc_update && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-rover_pos_control && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-sensors && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-simulator && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-battery_simulator && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-vmount && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-vtol_att_control && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-esc_calib && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-led_control && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-mixer && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-motor_ramp && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-motor_test && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-param && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-perf && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-pwm && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-sd_bench && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-shutdown && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-listener && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-tune_control && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-ver && cd /home/jake/code/jake/px4/Firmware/build/atlflight_excelsior_default/bin && /usr/bin/cmake -E create_symlink px4 px4-work_queue
../../src/lib/parameters/param.h:473: error: undefined reference to 'param_get'
../../src/lib/parameters/param.h:473: error: undefined reference to 'param_get'
../../src/lib/parameters/param.h:473: error: undefined reference to 'param_get'
../../src/lib/parameters/param.h:473: error: undefined reference to 'param_get'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Makefile:224: recipe for target 'atlflight_excelsior' failed
make: *** [atlflight_excelsior] Error 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to add #define PARAM_IMPLEMENTATION
in parameters_shmem.cpp
before #include "param.h"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That did the trick. Thank you!
This brings the 1. iteration from #14156: extending board configs with the new SPI+I2C config.
With this PR the SPI reset and chip-select code uses the new configuration whereas the drivers still use the existing board config.
The SPI address used to be some (arbitrary) board-specific number, which is now set to zero (and allows for extension to multiple instances of the same sensor type on one bus). To avoid having to recalibrate, code was added to do the transition on param import (7e03d4a). Consolidation of separate Accel vs Gyro ID's was done as well.
There's some tricky dependencies during bootup: the board hw detection requires ADC on some boards (v5), and the SPI init requires to know the board version. This leads to some changes in bootup on some of the boards. @davids5 let me know if you see a problem with that (board changes are in 5a986ae).
Other:
Tested on these boards (comparing the boot output):
Next steps (the PR does not depend on those and can be merged independently):