Bare minimum configuration to include EKF2

I’m trying to make a bare minimum board config with EKF2 that fits in Kakute F7 flash (1MB). I’m OK using RC control only (no need for mission following). I’m at 107% flash usage with the following:

DRIVERS
adc
barometer/bmp280
#dshot
gps
imu/invensense/icm20689
#imu/invensense/mpu6000
magnetometer/hmc5883
#optical_flow/px4flow
#osd
#pwm_out_sim
pwm_out
rc_input
telemetry
tone_alarm
MODULES
#attitude_estimator_q
#battery_status
commander
dataman
ekf2
events
land_detector
#load_mon
#local_position_estimator
logger
mavlink
mc_att_control
mc_hover_thrust_estimator
mc_pos_control
mc_rate_control
navigator
rc_update
sensors
#temperature_compensation
SYSTEMCMDS
bl_update
dmesg
dumpfile
esc_calib
hardfault_log
i2cdetect
#led_control
mixer
#motor_ramp
#motor_test
nshterm
param
perf
pwm
reboot
reflect
sd_bench
#top
topic_listener
tune_control
usb_connected
ver
work_queue

Is there a way to remove obstacle avoidance and collision prevention which I can see is now being built? Any other things I can remove to reduce size by ~7%?

You can see what is enabled for FMU-v2 which is also a 1MB flash:

Also, you can consider adding:
CONSTRAINED_FLASH.

CONSTRAINED_FLASH did the trick! Also thanks for the link to the config file for inspiration.

1 Like

@j_p i also try to use ekf2 on Kakute F7 v1.5
I will use px4flow and a companion computer.
I think your problem fits mine.
Could you please share cmake doc to help?

@altug

This is what I was flying last. I tried 1.11 beta, but had some issues with 2 motors not running.

px4_add_board(
PLATFORM nuttx
VENDOR holybro
MODEL kakutef7
LABEL default
TOOLCHAIN arm-none-eabi
ARCHITECTURE cortex-m7
ROMFSROOT px4fmu_common
CONSTRAINED_FLASH
SERIAL_PORTS
TEL1:/dev/ttyS0 # UART1
TEL2:/dev/ttyS1 # UART2
#TEL3:/dev/ttyS2 # UART3 (currently NuttX console)
GPS1:/dev/ttyS3 # UART4
RC:/dev/ttyS4 # UART6
# /dev/ttyS5: UART7 (ESC telemetry)
DRIVERS
adc
barometer/bmp280
#dshot
gps
imu/mpu6000
#imu/icm20689
magnetometer/hmc5883
#optical_flow/px4flow
#pwm_out_sim
px4fmu
rc_input
telemetry
tone_alarm
#osd
MODULES
#attitude_estimator_q
commander
dataman
ekf2
#events
land_detector
#load_mon
logger
mavlink
mc_att_control
mc_pos_control
navigator
battery_status
sensors
SYSTEMCMDS
bl_update
config
dmesg
#dumpfile
esc_calib
hardfault_log
#led_control
mixer
#motor_ramp
motor_test
nshterm
param
#perf
pwm
reboot
#reflect
#sd_bench
#shutdown
#top
tune_control
#topic_listener
usb_connected
ver
work_queue
)

1 Like

Thank you @j_p
As i saw u disabled dshot.
May I ask did you use dshot esc or one shot traditional?
I use Kopis2 6s setup and have an issue that i think about escs.

This is my secondary “crash-cheaply” drone that I use to test Px4 integration with the companion PC and data-link. It’s running cheap Turnigy Multistar 32bit PWM ESCs that are more than enough for my needs. Although I must admit I consider moving to something more digital…

@j_p Did you get this working? I tried 1.11 beta and had similar motor issues. Im reverting to 1.10.2 but so far have not been able to get it to spin all 4 motors.

No, I did not, and reverted back to 1.10.2. I might be able to spend some more time this weekend and make a new build from Git to see if anything changed.

Hi,

I’ve got ekf2 compiled on the KakuteF7 by deleting some modules, but the problem I have now is that there are errors in the AHRS and Pre-arm check (I’m seeing this from QGroundControl).

Has anyone got the EKF2 actually working and flying with it?

I’m not using GPS or magnetometer. Just the IMU and barometer that comes on the board.

Thanks

Hey, I’m still working on this actually with no success so far.
Baro and Mag aren’t working AT ALL on a KakuteF7 (for me) right now so maybe that’s creating issues with the EKF2?
Because compiling a “bare minimum” isn’t that hard it’s just that this still won’t lead to any improvements… ;D
Please anyone with knowledge of the KakuteF7 look into this pretty please! :wink:

Been trying some more and so far I can see the Baro working in Mavlink Inspector - Altitude just not relaying that info to QGC…
But all my compiles towards the EKF2 do not get it working correctly yet.
It looks all fine except for when doing Calibration - Level Horizon it errors “estimator not running - check boot”.
Should EKF2 on this FC (v1.5) run at least in theory, like spec wise and all…?
cheers

EDIT:
Okay big progress here: EKF2 running and working including Baro and Magnetometer. Yay.
Only thing weird is no data from 2nd GPS is being read anymore it seems. It has a lock as per its LED indicator but the GPS2_RAW topic is gone.

Anyway I hope I can do an actual flight test later today. <3

Hi again, sorry for clugging this thread up but I’m so excited.
Just returned from flight testing and it actually worked! :smiley:

Here’s my default.cmake for reference.
You have to edit the corresponding drivers for your mag hardware of course but this compiled and flew. :wink:
Oh and I also added “-X start” to onboard baro in rc.board_sensors as will be included from 1.13.0.


px4_add_board(
	PLATFORM nuttx
	VENDOR holybro
	MODEL kakutef7
	LABEL default
	TOOLCHAIN arm-none-eabi
	ARCHITECTURE cortex-m7
	EXTERNAL_METADATA
	ROMFSROOT px4fmu_common
	CONSTRAINED_FLASH
	SERIAL_PORTS
		TEL1:/dev/ttyS0 # UART1
		TEL2:/dev/ttyS1 # UART2
#		TEL3:/dev/ttyS2 # UART3 (currently NuttX console)
		GPS1:/dev/ttyS3 # UART4
		RC:/dev/ttyS4 # UART6
		# /dev/ttyS5: UART7 (ESC telemetry)
	DRIVERS
		adc/board_adc
		barometer/bmp280
		dshot
		gps
		#imu/invensense/icm20689
		imu/invensense/mpu6000
		#magnetometer
		magnetometer/qmc5883l
		#optical_flow/px4flow
		#osd
		#pwm_out_sim
		pwm_out
		rc_input
		#telemetry
		#telemetry/frsky_telemetry
		#tone_alarm
	MODULES
		#attitude_estimator_q
		battery_status
		commander
		dataman
		ekf2
		#events
		flight_mode_manager
		#gyro_calibration
		#gyro_fft
		land_detector
		#load_mon
		#local_position_estimator
		logger
		mavlink
		mc_att_control
		mc_hover_thrust_estimator
		mc_pos_control
		mc_rate_control
		navigator
		rc_update
		sensors
		#temperature_compensation
	SYSTEMCMDS
		#bl_update
		#dmesg
		#dumpfile
		#esc_calib
		hardfault_log
		#i2cdetect
		#led_control
		mixer
		#motor_ramp
		#motor_test
		#nshterm
		param
		#perf
		pwm
		reboot
		#reflect
		#sd_bench
		top
		#topic_listener
		tune_control
		uorb
		#usb_connected
		#ver
		#work_queue
	)

Hi! I am so excited to find your comments on this issue. I meet the same problem when using Kakute H7 just like you said. The baro seems to work but I cannot calibrate the level horizon.

Firstly, I thought it may be the problem that there is no mag on the rc board. However, I noticed that you have solved this problem well with baro and mag. So if it’s possible to solve it without using mag? Because I will use vicon or vision system to provide the yaw estimate.

Could you give me some idea how to make the EKF2 work and make the level horizon calibration work properly?