Unable to build vtol for px4fmu-v2 with uavcan enabled

Hi!

I’m trying to build px4 for my vtol. Also i have esc’s connected via uavcan, so i need to enable uavcan module.

I’m trying to modify cmake/configs/nuttx_px4fmu-v2_default.cmake. But, unfortunately, after i enabled uavcan, firmware ceased to fit into memory. I tried to disable unnecessary modules, but this did not help much, the limit is still exceeded by ~ 40 kilobytes.

Hardware:

  1. px4fmu-v2
  2. airspeed sensor
  3. 4 esc connected via uavcan + 5 esc connected via pwm
  4. PX4FLOW + it’s onboard sonar
  5. external gps + compass

CMAKE output:

-- Build Type: MinSizeRel
-- PX4 VERSION: v1.6.5-1619-g29af234
-- CONFIG: nuttx_px4fmu-v2_default
-- The ASM compiler identification is GNU
-- Found assembler: /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc
-- Found PythonInterp: /usr/bin/python (found version "2.7.12") 
-- Found PY_jinja2: /usr/local/lib/python2.7/dist-packages/jinja2  
-- C compiler: arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors 6-2017-q1-update) 6.3.1 20170215 (release) [ARM/embedded-6-branch revision 245512]
-- C++ compiler: arm-none-eabi-g++ (GNU Tools for ARM Embedded Processors 6-2017-q1-update) 6.3.1 20170215 (release) [ARM/embedded-6-branch revision 245512]
-- Building and including px4io-v2
-- Using C++03
-- Release build type: MinSizeRel
-- Adding UAVCAN STM32 platform driver
-- NuttX: px4fmu-v2 nsh cortex-m4
-- ROMFS: px4fmu_common

Modified config:

include(nuttx/px4_impl_nuttx)
px4_nuttx_configure(HWCLASS m4 CONFIG nsh ROMFS y ROMFSROOT px4fmu_common IO px4io-v2)

set(config_uavcan_num_ifaces 2)

set(config_module_list
	#
	# Board support modules
	#
	drivers/device
	drivers/stm32
	drivers/stm32/adc
	drivers/stm32/tone_alarm
	drivers/led
	drivers/px4fmu
	drivers/px4io
	drivers/boards
	drivers/rgbled
	drivers/mpu6000
	#drivers/mpu9250
	drivers/lsm303d
	drivers/l3gd20
	drivers/hmc5883
	drivers/ms5611
	#drivers/mb12xx
	#drivers/srf02
	#drivers/sf0x
	#drivers/sf1xx
	#drivers/ll40ls
	#drivers/teraranger
	drivers/gps
	#drivers/pwm_out_sim
	#drivers/hott
	#drivers/hott/hott_telemetry
	#drivers/hott/hott_sensors
	#drivers/blinkm
	drivers/airspeed
	#drivers/ets_airspeed
	#drivers/ms4525_airspeed
	#drivers/ms5525_airspeed
	#drivers/sdp3x_airspeed
	#drivers/frsky_telemetry
	modules/sensors
	#drivers/mkblctrl
	drivers/px4flow
	#drivers/oreoled
	#drivers/vmount
	drivers/pwm_input
	#drivers/camera_trigger
	#drivers/bst
	#drivers/snapdragon_rc_pwm
	drivers/lis3mdl
	#drivers/iridiumsbd
	#drivers/ulanding

	#
	# System commands
	#
	systemcmds/bl_update
	systemcmds/config
	#systemcmds/dumpfile
	#systemcmds/esc_calib
	systemcmds/hardfault_log
	systemcmds/mixer
	#systemcmds/motor_ramp
	systemcmds/mtd
	systemcmds/nshterm
	systemcmds/param
	systemcmds/perf
	systemcmds/pwm
	systemcmds/reboot
	#systemcmds/sd_bench
	systemcmds/top
	#systemcmds/topic_listener
	systemcmds/ver

	#
	# Testing
	#
	#drivers/sf0x/sf0x_tests
	#drivers/test_ppm
	#lib/rc/rc_tests
	#modules/commander/commander_tests
	#lib/controllib/controllib_test
	#modules/mavlink/mavlink_tests
	#modules/uORB/uORB_tests
	#systemcmds/tests

	#
	# General system control
	#
	modules/commander
	modules/events
	modules/load_mon
	modules/navigator
	modules/mavlink
	modules/gpio_led
	modules/uavcan
	#modules/land_detector
	#modules/camera_feedback

	#
	# Estimation modules
	#
	#modules/attitude_estimator_q
	#modules/position_estimator_inav
	#modules/local_position_estimator
	modules/ekf2

	#
	# Vehicle Control
	#
	modules/fw_att_control
	modules/fw_pos_control_l1
	#modules/gnd_att_control
	#modules/gnd_pos_control
	modules/mc_att_control
	modules/mc_pos_control
	modules/vtol_att_control

	#
	# Logging
	#
	modules/logger
	#modules/sdlog2

	#
	# Library modules
	#
	modules/systemlib/param
	modules/systemlib
	modules/systemlib/mixer
	modules/uORB
	modules/dataman

	#
	# Libraries
	#
	lib/controllib
	lib/mathlib
	lib/mathlib/math/filter
	lib/ecl
	lib/geo
	lib/geo_lookup
	lib/conversion
	lib/launchdetection
	lib/led
	lib/terrain_estimation
	lib/runway_takeoff
	lib/tailsitter_recovery
	lib/version
	lib/DriverFramework/framework
	platforms/nuttx

	# had to add for cmake, not sure why wasn't in original config
	platforms/common
	platforms/nuttx/px4_layer

	#
	# OBC challenge
	#
	#examples/bottle_drop

	#
	# Rover apps
	#
	#examples/rover_steering_control

	#
	# Demo apps
	#
	#examples/math_demo
	# Tutorial code from
	# https://px4.io/dev/px4_simple_app
	#examples/px4_simple_app

	# Tutorial code from
	# https://px4.io/dev/daemon
	#examples/px4_daemon_app

	# Tutorial code from
	# https://px4.io/dev/debug_values
	#examples/px4_mavlink_debug

	# Tutorial code from
	# https://px4.io/dev/example_fixedwing_control
	#examples/fixedwing_control

	# Hardware test
	#examples/hwtest
)

Maybe it’s possible to turn off something else? Or to do something else?