[Kconfig] Merge/diff fixes and added some FMUv5 targets

This commit is contained in:
Peter van der Perk 2021-08-06 11:43:46 +02:00 committed by Daniel Agar
parent ea393b54d9
commit 82888d3320
12 changed files with 85 additions and 457 deletions

View File

@ -59,6 +59,8 @@ def print_config(op, config, value, new_value):
if merge_style: if merge_style:
if op=="-" and value=="y": if op=="-" and value=="y":
print("CONFIG_%s=n" % (config)) print("CONFIG_%s=n" % (config))
elif op=="-" and not new_value:
print("# CONFIG_%s is not set" % (config))
elif new_value: elif new_value:
if new_value=="n": if new_value=="n":
print("# CONFIG_%s is not set" % config) print("# CONFIG_%s is not set" % config)

View File

@ -72,6 +72,11 @@
from __future__ import print_function from __future__ import print_function
import sys import sys
import re
import pprint
def _re_match(regex):
return re.compile(regex, re.ASCII).match
from kconfiglib import Kconfig, BOOL, TRISTATE, TRI_TO_STR from kconfiglib import Kconfig, BOOL, TRISTATE, TRI_TO_STR
@ -99,6 +104,21 @@ kconf.warn_assign_redun = False
for config in sys.argv[3:]: for config in sys.argv[3:]:
print(kconf.load_config(config, replace=False)) print(kconf.load_config(config, replace=False))
# Modification for PX4 unset all symbols (INT,HEX etc) from 2nd config
f = open(sys.argv[4], 'r')
unset_match = re.compile(r"# {}([^ ]+) is not set".format("CONFIG_"), re.ASCII).match
for line in f:
match = unset_match(line)
pprint.pprint(match)
if match is not None:
sym_name = match.group(1)
kconf.syms[sym_name].unset_value()
f.close()
# Write the merged configuration # Write the merged configuration
print(kconf.write_config(sys.argv[2])) print(kconf.write_config(sys.argv[2]))

View File

@ -1,35 +1,3 @@
include (${CMAKE_CURRENT_LIST_DIR}/uavcan_board_identity) include (${CMAKE_CURRENT_LIST_DIR}/uavcan_board_identity)
add_definitions(-DUSE_S_RGB_LED_DMA) add_definitions(-DUSE_S_RGB_LED_DMA)
px4_add_board(
PLATFORM nuttx
TOOLCHAIN arm-none-eabi
ARCHITECTURE cortex-m4
CONSTRAINED_MEMORY
ROMFSROOT cannode
UAVCAN_INTERFACES 1
DRIVERS
barometer/ms5611
bootloaders
gps
lights/neopixel
magnetometer/rm3100
safety_button
tone_alarm
uavcannode
MODULES
#load_mon
SYSTEMCMDS
#i2cdetect
#led_control
param
#perf
#reboot
#top
#topic_listener
#tune_control
#uorb
#ver
#work_queue
)

View File

@ -0,0 +1,13 @@
CONFIG_ARCHITECTURE_CORTEX_M4=y
CONFIG_BOARD_ROMFSROOT="cannode"
CONFIG_BOARD_CONSTRAINED_MEMORY=y
CONFIG_DRIVERS_BAROMETER_MS5611=y
CONFIG_DRIVERS_BOOTLOADERS=y
CONFIG_DRIVERS_GPS=y
CONFIG_DRIVERS_LIGHTS_NEOPIXEL=y
CONFIG_DRIVERS_MAGNETOMETER_RM3100=y
CONFIG_DRIVERS_SAFETY_BUTTON=y
CONFIG_DRIVERS_TONE_ALARM=y
CONFIG_BOARD_UAVCAN_INTERFACES=1
CONFIG_DRIVERS_UAVCANNODE=y
CONFIG_SYSTEMCMDS_PARAM=y

View File

@ -1,130 +0,0 @@
px4_add_board(
PLATFORM nuttx
TOOLCHAIN arm-none-eabi
ARCHITECTURE cortex-m7
ROMFSROOT px4fmu_common
IO px4_io-v2_default
UAVCAN_INTERFACES 2
UAVCAN_TIMER_OVERRIDE 6
SERIAL_PORTS
GPS1:/dev/ttyS0
TEL1:/dev/ttyS1
TEL2:/dev/ttyS2
TEL4:/dev/ttyS3
DRIVERS
adc/board_adc
barometer # all available barometer drivers
batt_smbus
camera_capture
camera_trigger
differential_pressure # all available differential pressure drivers
distance_sensor # all available distance sensor drivers
dshot
gps
#heater
#imu # all available imu drivers
imu/analog_devices/adis16448
imu/bosch/bmi055
imu/invensense/icm20602
imu/invensense/icm20689
imu/invensense/icm20948 # required for ak09916 mag
irlock
lights # all available light drivers
lights/rgbled_pwm
magnetometer # all available magnetometer drivers
optical_flow # all available optical flow drivers
#osd
pca9685
power_monitor/ina226
protocol_splitter
pwm_input
pwm_out_sim
pwm_out
px4io
rc_input
roboclaw
rpm
safety_button
smart_battery/batmon
telemetry # all available telemetry drivers
tone_alarm
uavcan
MODULES
airspeed_selector
attitude_estimator_q
battery_status
camera_feedback
commander
dataman
ekf2
events
flight_mode_manager
fw_att_control
fw_pos_control_l1
gyro_calibration
gyro_fft
land_detector
landing_target_estimator
load_mon
local_position_estimator
logger
mag_bias_estimator
mavlink
mc_att_control
mc_autotune_attitude_control
mc_hover_thrust_estimator
mc_pos_control
mc_rate_control
micrortps_bridge
navigator
rc_update
rover_pos_control
sensors
sih
temperature_compensation
vmount
vtol_att_control
SYSTEMCMDS
bl_update
dmesg
dumpfile
esc_calib
hardfault_log
i2cdetect
led_control
mft
mixer
motor_ramp
motor_test
mtd
nshterm
param
perf
pwm
reboot
reflect
sd_bench
sd_stress
system_time
top
topic_listener
tune_control
uorb
usb_connected
ver
work_queue
EXAMPLES
fake_gps
#fake_imu
#fake_magnetometer
#fixedwing_control # Tutorial code from https://px4.io/dev/example_fixedwing_control
#hello
#hwtest # Hardware test
#matlab_csv_serial
#px4_mavlink_debug # Tutorial code from http://dev.px4.io/en/debug/debug_values.html
#px4_simple_app # Tutorial code from http://dev.px4.io/en/apps/hello_sky.html
#rover_steering_control # Rover example app
#uuv_example_app
#work_item
)

View File

@ -0,0 +1,3 @@
CONFIG_DRIVERS_HEATER=n
CONFIG_DRIVERS_OSD=n
CONFIG_MODULES_MICRORTPS_BRIDGE=y

View File

@ -1,140 +0,0 @@
px4_add_board(
PLATFORM nuttx
TOOLCHAIN arm-none-eabi
ARCHITECTURE cortex-m7
ROMFSROOT px4fmu_common
IO px4_io-v2_default
UAVCAN_INTERFACES 2
UAVCAN_TIMER_OVERRIDE 6
UAVCAN_PERIPHERALS
cuav_can-gps-v1_default
SERIAL_PORTS
GPS1:/dev/ttyS0
TEL1:/dev/ttyS1
TEL2:/dev/ttyS2
TEL4:/dev/ttyS3
DRIVERS
adc/board_adc
#adc/ads1115
barometer # all available barometer drivers
batt_smbus
camera_capture
camera_trigger
differential_pressure # all available differential pressure drivers
distance_sensor # all available distance sensor drivers
dshot
gps
#heater
#imu # all available imu drivers
#imu/adis16448
#imu/adis16477
#imu/adis16497
imu/bosch/bmi055
imu/invensense/icm20602
imu/invensense/icm20689
#imu/invensense/icm20948 # required for ak09916 mag
#irlock
lights # all available light drivers
lights/rgbled_pwm
magnetometer # all available magnetometer drivers
optical_flow # all available optical flow drivers
#osd
pca9685
#pca9685_pwm_out
power_monitor/ina226
#protocol_splitter
#pwm_input
pwm_out_sim
pwm_out
px4io
rc_input
#roboclaw
#rpm
safety_button
smart_battery/batmon
telemetry # all available telemetry drivers
tone_alarm
uavcan
MODULES
airspeed_selector
attitude_estimator_q
battery_status
camera_feedback
commander
dataman
ekf2
#esc_battery
events
flight_mode_manager
fw_att_control
fw_pos_control_l1
gyro_calibration
#gyro_fft
land_detector
landing_target_estimator
load_mon
#local_position_estimator
logger
mag_bias_estimator
mavlink
mc_att_control
mc_autotune_attitude_control
mc_hover_thrust_estimator
mc_pos_control
mc_rate_control
#micrortps_bridge
navigator
rc_update
#rover_pos_control
sensors
#sih
temperature_compensation
#uuv_att_control
#uuv_pos_control
vmount
vtol_att_control
SYSTEMCMDS
#bl_update
dmesg
#dumpfile
esc_calib
#gpio
hardfault_log
i2cdetect
led_control
mft
mixer
motor_ramp
motor_test
mtd
nshterm
param
perf
pwm
reboot
reflect
sd_bench
sd_stress
system_time
top
topic_listener
tune_control
uorb
usb_connected
ver
work_queue
EXAMPLES
fake_gps
#fake_imu
#fake_magnetometer
#fixedwing_control # Tutorial code from https://px4.io/dev/example_fixedwing_control
#hello
#hwtest # Hardware test
#matlab_csv_serial
#px4_mavlink_debug # Tutorial code from http://dev.px4.io/en/debug/debug_values.html
#px4_simple_app # Tutorial code from http://dev.px4.io/en/apps/hello_sky.html
#rover_steering_control # Rover example app
#uuv_example_app
#work_item
)

View File

@ -0,0 +1,22 @@
# CONFIG_BOARD_UAVCAN_TIMER_OVERRIDE is not set
CONFIG_DRIVERS_ADC_ADS1115=n
CONFIG_DRIVERS_HEATER=n
CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=n
CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=n
CONFIG_DRIVERS_IRLOCK=n
CONFIG_DRIVERS_OSD=n
CONFIG_DRIVERS_PCA9685_PWM_OUT=n
CONFIG_DRIVERS_PWM_INPUT=n
CONFIG_DRIVERS_ROBOCLAW=n
CONFIG_DRIVERS_RPM=n
CONFIG_MODULES_ESC_BATTERY=n
CONFIG_MODULES_GYRO_FFT=n
CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=n
CONFIG_MODULES_ROVER_POS_CONTROL=n
CONFIG_MODULES_SIH=n
CONFIG_MODULES_UUV_ATT_CONTROL=n
CONFIG_MODULES_UUV_POS_CONTROL=n
CONFIG_SYSTEMCMDS_BL_UPDATE=n
CONFIG_SYSTEMCMDS_DUMPFILE=n
CONFIG_SYSTEMCMDS_GPIO=n
CONFIG_BOARD_UAVCAN_PERIPHERALS="cuav_can-gps-v1_default"

View File

@ -1,138 +0,0 @@
px4_add_board(
PLATFORM nuttx
TOOLCHAIN arm-none-eabi
ARCHITECTURE cortex-m7
ROMFSROOT px4fmu_common
IO px4_io-v2_default
UAVCAN_INTERFACES 2
UAVCAN_TIMER_OVERRIDE 6
SERIAL_PORTS
GPS1:/dev/ttyS0
TEL1:/dev/ttyS1
TEL2:/dev/ttyS2
TEL4:/dev/ttyS3
DRIVERS
adc/ads1115
adc/board_adc
barometer # all available barometer drivers
batt_smbus
camera_capture
camera_trigger
differential_pressure # all available differential pressure drivers
distance_sensor # all available distance sensor drivers
dshot
gps
#heater
#imu # all available imu drivers
imu/analog_devices/adis16448
imu/bosch/bmi055
imu/invensense/icm20602
imu/invensense/icm20689
imu/invensense/icm20948 # required for ak09916 mag
irlock
lights # all available light drivers
lights/rgbled_pwm
magnetometer # all available magnetometer drivers
optical_flow # all available optical flow drivers
#osd
pca9685
pca9685_pwm_out
power_monitor/ina226
#protocol_splitter
pwm_input
pwm_out_sim
pwm_out
px4io
rc_input
roboclaw
rpm
safety_button
smart_battery/batmon
telemetry # all available telemetry drivers
tone_alarm
#uavcan # legacy v0
uavcan_v1
MODULES
airspeed_selector
attitude_estimator_q
battery_status
camera_feedback
commander
dataman
ekf2
esc_battery
events
flight_mode_manager
fw_att_control
fw_pos_control_l1
gyro_calibration
gyro_fft
land_detector
landing_target_estimator
load_mon
local_position_estimator
logger
mag_bias_estimator
mavlink
mc_att_control
mc_autotune_attitude_control
mc_hover_thrust_estimator
mc_pos_control
mc_rate_control
#micrortps_bridge
navigator
rc_update
rover_pos_control
sensors
sih
temperature_compensation
uuv_att_control
uuv_pos_control
vmount
vtol_att_control
SYSTEMCMDS
bl_update
dmesg
dumpfile
esc_calib
gpio
hardfault_log
i2cdetect
led_control
mft
mixer
motor_ramp
motor_test
mtd
nshterm
param
perf
pwm
reboot
reflect
sd_bench
sd_stress
serial_test
system_time
top
topic_listener
tune_control
uorb
usb_connected
ver
work_queue
EXAMPLES
fake_gps
#fake_imu
#fake_magnetometer
#fixedwing_control # Tutorial code from https://px4.io/dev/example_fixedwing_control
#hello
#hwtest # Hardware test
#matlab_csv_serial
#px4_mavlink_debug # Tutorial code from http://dev.px4.io/en/debug/debug_values.html
#px4_simple_app # Tutorial code from http://dev.px4.io/en/apps/hello_sky.html
#rover_steering_control # Rover example app
#uuv_example_app
#work_item
)

View File

@ -0,0 +1,4 @@
CONFIG_DRIVERS_HEATER=n
CONFIG_DRIVERS_OSD=n
CONFIG_DRIVERS_UAVCAN=n
CONFIG_DRIVERS_UAVCAN_V1=y

View File

@ -63,6 +63,7 @@ if(NOT PX4_CONFIG_FILE)
) )
set(PX4_CONFIG_FILE "${PX4_SOURCE_DIR}/boards/${filename}" CACHE FILEPATH "path to PX4 CONFIG file" FORCE) set(PX4_CONFIG_FILE "${PX4_SOURCE_DIR}/boards/${filename}" CACHE FILEPATH "path to PX4 CONFIG file" FORCE)
set(PX4_BOARD_DIR "${PX4_SOURCE_DIR}/boards/${vendor}/${model}" CACHE STRING "PX4 board directory" FORCE) set(PX4_BOARD_DIR "${PX4_SOURCE_DIR}/boards/${vendor}/${model}" CACHE STRING "PX4 board directory" FORCE)
set(PX4_BOARD_CMAKE "${PX4_SOURCE_DIR}/boards/${vendor}/${model}/default.cmake" CACHE FILEPATH "path to PX4 CONFIG file" FORCE)
set(MODEL "${model}" CACHE STRING "PX4 board model" FORCE) set(MODEL "${model}" CACHE STRING "PX4 board model" FORCE)
set(VENDOR "${vendor}" CACHE STRING "PX4 board vendor" FORCE) set(VENDOR "${vendor}" CACHE STRING "PX4 board vendor" FORCE)
set(LABEL "${label}" CACHE STRING "PX4 board vendor" FORCE) set(LABEL "${label}" CACHE STRING "PX4 board vendor" FORCE)
@ -75,6 +76,7 @@ if(NOT PX4_CONFIG_FILE)
((${label} STREQUAL "default") AND (${CONFIG} STREQUAL "${board}")) # default label can be omitted ((${label} STREQUAL "default") AND (${CONFIG} STREQUAL "${board}")) # default label can be omitted
) )
set(PX4_CONFIG_FILE "${PX4_SOURCE_DIR}/boards/${filename}" CACHE FILEPATH "path to PX4 CONFIG file" FORCE) set(PX4_CONFIG_FILE "${PX4_SOURCE_DIR}/boards/${filename}" CACHE FILEPATH "path to PX4 CONFIG file" FORCE)
set(PX4_BOARD_CMAKE "${PX4_SOURCE_DIR}/boards/${vendor}/${model}/default.cmake" CACHE FILEPATH "path to PX4 CONFIG file" FORCE)
set(PX4_BOARD_DIR "${PX4_SOURCE_DIR}/boards/${vendor}/${model}" CACHE STRING "PX4 board directory" FORCE) set(PX4_BOARD_DIR "${PX4_SOURCE_DIR}/boards/${vendor}/${model}" CACHE STRING "PX4 board directory" FORCE)
set(MODEL "${model}" CACHE STRING "PX4 board model" FORCE) set(MODEL "${model}" CACHE STRING "PX4 board model" FORCE)
set(VENDOR "${vendor}" CACHE STRING "PX4 board vendor" FORCE) set(VENDOR "${vendor}" CACHE STRING "PX4 board vendor" FORCE)
@ -107,3 +109,7 @@ set(PX4_BOARD_MODEL ${MODEL} CACHE STRING "PX4 board model" FORCE)
set(PX4_BOARD_LABEL ${LABEL} CACHE STRING "PX4 board label" FORCE) set(PX4_BOARD_LABEL ${LABEL} CACHE STRING "PX4 board label" FORCE)
set(PX4_CONFIG "${PX4_BOARD_VENDOR}_${PX4_BOARD_MODEL}_${PX4_BOARD_LABEL}" CACHE STRING "PX4 config" FORCE) set(PX4_CONFIG "${PX4_BOARD_VENDOR}_${PX4_BOARD_MODEL}_${PX4_BOARD_LABEL}" CACHE STRING "PX4 config" FORCE)
if(EXISTS ${PX4_BOARD_CMAKE})
include (${PX4_BOARD_CMAKE})
endif()

View File

@ -4,23 +4,21 @@ menuconfig DRIVERS_UAVCAN
---help--- ---help---
Enable support for uavcan Enable support for uavcan
if DRIVERS_UAVCAN
menuconfig BOARD_UAVCAN_INTERFACES menuconfig BOARD_UAVCAN_INTERFACES
depends on DRIVERS_UAVCAN depends on DRIVERS_UAVCAN || DRIVERS_UAVCANNODE
int "UAVCANv0 interface count" int "UAVCANv0 interface count"
default 2 default 2
---help--- ---help---
Interface count for UAVCANv0 Interface count for UAVCANv0
menuconfig BOARD_UAVCAN_PERIPHERALS menuconfig BOARD_UAVCAN_PERIPHERALS
depends on DRIVERS_UAVCAN depends on DRIVERS_UAVCAN
string "UAVCAN peripheral firmware" string "UAVCAN peripheral firmware"
help help
list of UAVCAN peripheral firmware to build and embed list of UAVCAN peripheral firmware to build and embed
menuconfig BOARD_UAVCAN_TIMER_OVERRIDE menuconfig BOARD_UAVCAN_TIMER_OVERRIDE
depends on DRIVERS_UAVCAN depends on DRIVERS_UAVCAN
int "UAVCAN timer override" int "UAVCAN timer override"
default 0 default 0
endif #DRIVERS_UAVCAN