Merge branch 'main' into bpozzan/feat/failed_pos_reset
No files matched your search
@@ -210,7 +210,7 @@ define cmake-build
|
||||
|| (rm -rf $(BUILD_DIR)); \
|
||||
fi
|
||||
@# run the build for the specified target
|
||||
@cmake --build $(BUILD_DIR) -- $(PX4_MAKE_ARGS) $(ARGS)
|
||||
+@cmake --build $(BUILD_DIR) -- $(PX4_MAKE_ARGS) $(ARGS)
|
||||
endef
|
||||
|
||||
# check if the options we want to build with in CMAKE_ARGS match the ones which are already configured in the cache inside BUILD_DIR
|
||||
@@ -440,10 +440,12 @@ px4_metadata: parameters_metadata airframe_metadata module_documentation extract
|
||||
check_format:
|
||||
$(call colorecho,'Checking formatting with astyle')
|
||||
@"$(SRC_DIR)"/Tools/astyle/check_code_style_all.sh
|
||||
@"$(SRC_DIR)"/Tools/astyle/check_param_names.py
|
||||
@cd "$(SRC_DIR)" && git diff --check
|
||||
|
||||
format:
|
||||
$(call colorecho,'Formatting with astyle')
|
||||
@"$(SRC_DIR)"/Tools/astyle/check_param_names.py --fix
|
||||
@"$(SRC_DIR)"/Tools/astyle/check_code_style_all.sh --fix
|
||||
|
||||
format_changed:
|
||||
|
||||
@@ -125,6 +125,7 @@ add_custom_command(
|
||||
${romfs_copy_files}
|
||||
${jinja_templates}
|
||||
${module_config_files}
|
||||
${PX4_BINARY_DIR}/px4_boardconfig.h
|
||||
${romfs_cmake_files}
|
||||
${PX4_SOURCE_DIR}/Tools/px_process_airframes.py
|
||||
${PX4_SOURCE_DIR}/Tools/px4airframes/markdownout.py
|
||||
@@ -133,6 +134,7 @@ add_custom_command(
|
||||
${PX4_SOURCE_DIR}/Tools/px4airframes/srcscanner.py
|
||||
${PX4_SOURCE_DIR}/Tools/px4airframes/xmlout.py
|
||||
${PX4_SOURCE_DIR}/Tools/serial/generate_config.py
|
||||
${PX4_SOURCE_DIR}/Tools/module_config/output_groups_from_timer_config.py
|
||||
)
|
||||
|
||||
|
||||
@@ -153,7 +155,8 @@ add_custom_command(
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/serial/generate_config.py
|
||||
--rc-dir ${romfs_gen_root_dir}/init.d
|
||||
--serial-ports ${board_serial_ports} ${added_arguments}
|
||||
--config-files ${module_config_files} #--verbose
|
||||
--config-files ${module_config_files}
|
||||
--board-config ${BOARD_CONFIG} #--verbose
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/filepaths/generate_config.py
|
||||
--rc-dir ${romfs_gen_root_dir}/init.d
|
||||
--params-file ${CONFIG_BOARD_PARAM_FILE}
|
||||
|
||||
@@ -95,17 +95,6 @@ then
|
||||
gyro_calibration start
|
||||
fi
|
||||
|
||||
|
||||
if param compare -s MBE_ENABLE 1
|
||||
then
|
||||
# conservative mag bias estimation
|
||||
param set-default MBE_LEARN_GAIN 5
|
||||
param set-default IMU_GYRO_CUTOFF 20
|
||||
# nodes have no GCS calibration flow, persist the estimated bias
|
||||
param set-default SENS_MAG_AUTOCAL 1
|
||||
mag_bias_estimator start
|
||||
fi
|
||||
|
||||
param set-default SENS_MAG_RATE 100
|
||||
|
||||
sensors start
|
||||
|
||||
@@ -90,7 +90,3 @@ param set-default PWM_MAIN_FUNC8 108
|
||||
|
||||
# disable MC desaturation which improves attitude tracking
|
||||
param set-default CA_METHOD 0
|
||||
|
||||
# disable attitude failure detection
|
||||
param set-default FD_FAIL_P 0
|
||||
param set-default FD_FAIL_R 0
|
||||
@@ -0,0 +1,56 @@
|
||||
#!/bin/sh
|
||||
# @name Rover Differential
|
||||
# @type Rover
|
||||
# @class Rover
|
||||
|
||||
. ${R}etc/init.d/rc.rover_differential_defaults
|
||||
|
||||
PX4_SIMULATOR=${PX4_SIMULATOR:=sihsim}
|
||||
PX4_SIM_MODEL=${PX4_SIM_MODEL:=rover_differential}
|
||||
|
||||
param set-default SIH_VEHICLE_TYPE 6 # sih as rover differential
|
||||
|
||||
param set-default PWM_MAIN_FUNC1 101 # Right wheel
|
||||
param set-default PWM_MAIN_FUNC2 102 # Left wheel
|
||||
param set-default SIH_MASS 20
|
||||
param set-default SIH_IXX 0.75
|
||||
param set-default SIH_IYY 1.2167
|
||||
param set-default SIH_IZZ 1.6667
|
||||
param set-default SIH_IXZ 0
|
||||
param set-default SIH_KDW 1
|
||||
|
||||
param set-default SENS_EN_GPSSIM 1
|
||||
param set-default SENS_EN_BAROSIM 1
|
||||
param set-default SENS_EN_MAGSIM 1
|
||||
|
||||
# Differential Parameters
|
||||
param set-default RD_WHEEL_TRACK 0.6
|
||||
param set-default RD_TRANS_DRV_TRN 0.785398
|
||||
param set-default RD_TRANS_TRN_DRV 0.174533
|
||||
param set-default RD_YAW_STK_GAIN 0.6
|
||||
|
||||
# Rate Control Parameters
|
||||
param set-default RO_YAW_RATE_I 0.01
|
||||
param set-default RO_YAW_RATE_P 0.25
|
||||
param set-default RO_YAW_RATE_LIM 180
|
||||
param set-default RO_YAW_ACCEL_LIM 400
|
||||
param set-default RO_YAW_DECEL_LIM 800
|
||||
param set-default RO_YAW_RATE_CORR 1
|
||||
|
||||
# Attitude Control Parameters
|
||||
param set-default RO_YAW_P 5
|
||||
|
||||
# Velocity Control Parameters
|
||||
param set-default RO_ACCEL_LIM 3
|
||||
param set-default RO_DECEL_LIM 4
|
||||
param set-default RO_JERK_LIM 10
|
||||
param set-default RO_MAX_THR_SPEED 2
|
||||
param set-default RO_SPEED_LIM 1.8
|
||||
param set-default RO_SPEED_I 0.01
|
||||
param set-default RO_SPEED_P 0.01
|
||||
param set-default RO_SPEED_RED 1
|
||||
|
||||
# Pure Pursuit parameters
|
||||
param set-default PP_LOOKAHD_GAIN 1
|
||||
param set-default PP_LOOKAHD_MAX 10
|
||||
param set-default PP_LOOKAHD_MIN 1
|
||||
@@ -34,7 +34,7 @@ param set-default EKF2_GPS_CTRL 0
|
||||
param set-default EKF2_HGT_REF 0
|
||||
param set-default EKF2_EVP_NOISE 0.05
|
||||
param set-default EKF2_EVA_NOISE 0.05
|
||||
param set-default EKF2_OF_CTRL 1
|
||||
param set-default EKF2_OF0_CTRL 1
|
||||
|
||||
# LPE: Flow-only mode
|
||||
param set-default LPE_FUSION 242
|
||||
@@ -45,7 +45,7 @@ param set-default LPE_FAKE_ORIGIN 1
|
||||
|
||||
param set-default MPC_ALT_MODE 2
|
||||
|
||||
param set-default SENS_FLOW_ROT 6
|
||||
param set-default SENS_FLOW_MINHGT 0.7
|
||||
param set-default SENS_FLOW_MAXHGT 15
|
||||
param set-default SENS_FLOW_MAXR 2.5
|
||||
param set-default SENS_FLOW0_ROT 6
|
||||
param set-default SENS_FLOW0_HMIN 0.7
|
||||
param set-default SENS_FLOW0_HMAX 15
|
||||
param set-default SENS_FLOW0_MAXR 2.5
|
||||
@@ -31,7 +31,7 @@ param set-default PWM_MAIN_FUNC4 104
|
||||
|
||||
# EKF2
|
||||
param set-default EKF2_GPS_CTRL 0
|
||||
param set-default EKF2_OF_CTRL 1
|
||||
param set-default EKF2_OF0_CTRL 1
|
||||
|
||||
# LPE: Flow-only mode
|
||||
param set-default LPE_FUSION 242
|
||||
|
||||
@@ -33,8 +33,6 @@ param set-default PWM_MAIN_FUNC3 103
|
||||
param set-default PWM_MAIN_FUNC4 104
|
||||
param set-default PWM_MAIN_FUNC5 0
|
||||
|
||||
param set-default FD_FAIL_R 70
|
||||
|
||||
param set-default FW_P_TC 0.6
|
||||
|
||||
param set-default FW_PR_I 0.3
|
||||
|
||||
@@ -23,10 +23,10 @@ param set-default EKF2_IMU_POS_X 0.02
|
||||
param set-default SENS_GNSS0_OFFX 0.055
|
||||
param set-default SENS_GNSS0_OFFZ -0.15
|
||||
param set-default EKF2_MIN_RNG 0.03
|
||||
param set-default EKF2_OF_CTRL 1
|
||||
param set-default EKF2_OF_POS_X 0.055
|
||||
param set-default EKF2_OF_POS_Y 0.02
|
||||
param set-default EKF2_OF_POS_Z 0.065
|
||||
param set-default EKF2_OF0_CTRL 1
|
||||
param set-default SENS_FLOW0_POS_X 0.055
|
||||
param set-default SENS_FLOW0_POS_Y 0.02
|
||||
param set-default SENS_FLOW0_POS_Z 0.065
|
||||
param set-default GNSS_REQ_HDRIFT 0.3
|
||||
param set-default GNSS_REQ_SACC 1
|
||||
param set-default GNSS_REQ_VDRIFT 0.3
|
||||
@@ -84,8 +84,8 @@ param set-default SDLOG_PROFILE 131
|
||||
|
||||
# Sensors Parameters
|
||||
# param set-default SENS_CM8JL65_CFG 202 Not found
|
||||
param set-default SENS_FLOW_MAXHGT 25
|
||||
param set-default SENS_FLOW_MINHGT 0.5
|
||||
param set-default SENS_FLOW0_HMAX 25
|
||||
param set-default SENS_FLOW0_HMIN 0.5
|
||||
param set-default IMU_GYRO_CUTOFF 100
|
||||
# param set-default SENS_TFLOW_CFG 103 Not found
|
||||
|
||||
|
||||
@@ -48,8 +48,6 @@ param set-default SIM_GZ_EC_MAX2 1500
|
||||
param set-default SIM_GZ_EC_MAX3 1500
|
||||
param set-default SIM_GZ_EC_MAX4 1500
|
||||
|
||||
param set-default FD_FAIL_R 70
|
||||
|
||||
param set-default FW_P_TC 0.6
|
||||
|
||||
param set-default FW_PR_I 0.3
|
||||
|
||||
@@ -298,10 +298,8 @@ param set-default RTL_RETURN_ALT 180
|
||||
param set-default RTL_DESCEND_ALT 150
|
||||
param set-default RTL_MIN_DIST 50
|
||||
|
||||
param set-default FD_FAIL_R 85
|
||||
param set-default FD_FAIL_P 85
|
||||
param set-default FD_FAIL_R_TTRI 1.0
|
||||
param set-default FD_FAIL_P_TTRI 1.0
|
||||
param set-default FD_TILT_ERROR 85
|
||||
param set-default FD_TILT_ERROR_T 1
|
||||
param set-default WV_EN 0
|
||||
|
||||
################################################################################
|
||||
|
||||
@@ -35,8 +35,7 @@ param set-default GF_ACTION 1
|
||||
param set-default NAV_RCL_ACT 1
|
||||
|
||||
# disable attitude failure detection
|
||||
param set-default FD_FAIL_P 0
|
||||
param set-default FD_FAIL_R 0
|
||||
param set-default FD_TILT_ERROR -1
|
||||
|
||||
param set-default CA_ROTOR_COUNT 8
|
||||
param set-default CA_R_REV 255
|
||||
|
||||
@@ -30,8 +30,7 @@ param set-default SENS_EN_MAGSIM 0
|
||||
param set-default COM_RC_IN_MODE 1
|
||||
|
||||
# disable attitude failure detection
|
||||
param set-default FD_FAIL_P 0
|
||||
param set-default FD_FAIL_R 0
|
||||
param set-default FD_TILT_ERROR -1
|
||||
|
||||
# Disable magnetometer fusion in EKF2
|
||||
param set-default EKF2_MAG_TYPE 5
|
||||
|
||||
@@ -30,8 +30,7 @@ param set-default SENS_EN_MAGSIM 0
|
||||
param set-default COM_RC_IN_MODE 1
|
||||
|
||||
# disable attitude failure detection
|
||||
param set-default FD_FAIL_P 0
|
||||
param set-default FD_FAIL_R 0
|
||||
param set-default FD_TILT_ERROR -1
|
||||
|
||||
# Disable magnetometer fusion in EKF2
|
||||
param set-default EKF2_MAG_TYPE 5
|
||||
|
||||
@@ -112,7 +112,3 @@ param set-default SIM_GZ_EC_MAX7 1100
|
||||
param set-default SIM_GZ_EC_MAX8 1100
|
||||
# disable MC desaturation which improves attitude tracking
|
||||
param set-default CA_METHOD 0
|
||||
|
||||
# disable attitude failure detection
|
||||
param set-default FD_FAIL_P 0
|
||||
param set-default FD_FAIL_R 0
|
||||
@@ -114,6 +114,7 @@ px4_add_romfs_files(
|
||||
10045_sihsim_rover_ackermann
|
||||
10046_sihsim_quadx_flow
|
||||
10047_sihsim_standard_vtol_flow
|
||||
10048_sihsim_rover_differential
|
||||
|
||||
17001_flightgear_tf-g1
|
||||
17002_flightgear_tf-g2
|
||||
|
||||
@@ -22,10 +22,10 @@ param set-default EKF2_IMU_POS_X 0.02
|
||||
param set-default SENS_GNSS0_OFFX 0.055
|
||||
param set-default SENS_GNSS0_OFFZ -0.15
|
||||
param set-default EKF2_MIN_RNG 0.03
|
||||
param set-default EKF2_OF_CTRL 1
|
||||
param set-default EKF2_OF_POS_X 0.055
|
||||
param set-default EKF2_OF_POS_Y 0.02
|
||||
param set-default EKF2_OF_POS_Z 0.065
|
||||
param set-default EKF2_OF0_CTRL 1
|
||||
param set-default SENS_FLOW0_POS_X 0.055
|
||||
param set-default SENS_FLOW0_POS_Y 0.02
|
||||
param set-default SENS_FLOW0_POS_Z 0.065
|
||||
param set-default GNSS_REQ_HDRIFT 0.3
|
||||
param set-default GNSS_REQ_SACC 1
|
||||
param set-default GNSS_REQ_VDRIFT 0.3
|
||||
@@ -79,8 +79,8 @@ param set-default RTL_RETURN_ALT 5
|
||||
|
||||
# Sensors Parameters
|
||||
param set-default SENS_CM8JL65_CFG 104
|
||||
param set-default SENS_FLOW_MAXHGT 25
|
||||
param set-default SENS_FLOW_MINHGT 0.5
|
||||
param set-default SENS_FLOW0_HMAX 25
|
||||
param set-default SENS_FLOW0_HMIN 0.5
|
||||
param set-default IMU_GYRO_CUTOFF 100
|
||||
param set-default SENS_EN_PMW3901 1
|
||||
|
||||
|
||||
@@ -22,10 +22,10 @@ param set-default EKF2_IMU_POS_X 0.02
|
||||
param set-default SENS_GNSS0_OFFX 0.055
|
||||
param set-default SENS_GNSS0_OFFZ -0.15
|
||||
param set-default EKF2_MIN_RNG 0.03
|
||||
param set-default EKF2_OF_CTRL 1
|
||||
param set-default EKF2_OF_POS_X 0.055
|
||||
param set-default EKF2_OF_POS_Y 0.02
|
||||
param set-default EKF2_OF_POS_Z 0.065
|
||||
param set-default EKF2_OF0_CTRL 1
|
||||
param set-default SENS_FLOW0_POS_X 0.055
|
||||
param set-default SENS_FLOW0_POS_Y 0.02
|
||||
param set-default SENS_FLOW0_POS_Z 0.065
|
||||
param set-default GNSS_REQ_HDRIFT 0.3
|
||||
param set-default GNSS_REQ_SACC 1
|
||||
param set-default GNSS_REQ_VDRIFT 0.3
|
||||
@@ -80,8 +80,8 @@ param set-default RTL_RETURN_ALT 5
|
||||
|
||||
# Sensors Parameters
|
||||
param set-default SENS_CM8JL65_CFG 202
|
||||
param set-default SENS_FLOW_MAXHGT 25
|
||||
param set-default SENS_FLOW_MINHGT 0.5
|
||||
param set-default SENS_FLOW0_HMAX 25
|
||||
param set-default SENS_FLOW0_HMIN 0.5
|
||||
param set-default IMU_GYRO_CUTOFF 100
|
||||
param set-default SENS_TFLOW_CFG 103
|
||||
|
||||
|
||||
@@ -58,13 +58,13 @@ param set-default EKF2_MAG_NOISE 0.1
|
||||
|
||||
param set-default EKF2_MIN_RNG 0.15
|
||||
|
||||
param set-default EKF2_OF_DELAY 38
|
||||
param set-default EKF2_OF_GATE 2
|
||||
param set-default EKF2_OF_POS_X -0.035
|
||||
param set-default EKF2_OF_POS_Z 0.033
|
||||
param set-default SENS_FLOW0_DELAY 38
|
||||
param set-default EKF2_OF0_GATE 2
|
||||
param set-default SENS_FLOW0_POS_X -0.035
|
||||
param set-default SENS_FLOW0_POS_Z 0.033
|
||||
param set-default EKF2_OF_MIN_RNG 0.01
|
||||
param set-default EKF2_OF_A_HMAX 7
|
||||
param set-default EKF2_OF_QMIN 30
|
||||
param set-default EKF2_OF0_QMIN 30
|
||||
|
||||
param set-default EKF2_PCOEF_XN -0.3
|
||||
param set-default EKF2_PCOEF_XP -0.4
|
||||
@@ -147,9 +147,9 @@ param set-default RC_MAP_RETURN_SW 7
|
||||
param set-default RC1_TRIM 1000
|
||||
|
||||
# optical flow
|
||||
param set-default SENS_FLOW_MAXR 7.4
|
||||
param set-default SENS_FLOW_MINHGT 0.15
|
||||
param set-default SENS_FLOW_MAXHGT 5
|
||||
param set-default SENS_FLOW0_MAXR 7.4
|
||||
param set-default SENS_FLOW0_HMIN 0.15
|
||||
param set-default SENS_FLOW0_HMAX 5
|
||||
|
||||
# ignore the SD card errors and use normal startup sound
|
||||
set STARTUP_TUNE "1"
|
||||
|
||||
@@ -31,7 +31,7 @@ param set-default IMU_GYRO_CUTOFF 100
|
||||
# Sensors
|
||||
param set-default SENS_BOARD_ROT 10
|
||||
# Yaw 180
|
||||
param set-default SENS_FLOW_ROT 4
|
||||
param set-default SENS_FLOW0_ROT 4
|
||||
# TFMini on TELEM3
|
||||
param set-default SENS_TFMINI_CFG 103
|
||||
|
||||
@@ -43,8 +43,8 @@ param set-default EKF2_GND_EFF_DZ 6
|
||||
param set-default EKF2_MIN_RNG 0.3
|
||||
|
||||
# Flow
|
||||
param set-default EKF2_OF_CTRL 1
|
||||
param set-default EKF2_OF_QMIN 70
|
||||
param set-default EKF2_OF0_CTRL 1
|
||||
param set-default EKF2_OF0_QMIN 70
|
||||
|
||||
# Position control
|
||||
param set-default MPC_Z_P 1.1
|
||||
@@ -86,9 +86,9 @@ param set-default MAV_1_MODE 0
|
||||
param set-default SER_TEL2_BAUD 57600
|
||||
|
||||
# EKF OF POSITION
|
||||
param set-default EKF2_OF_POS_X 0.06
|
||||
param set-default EKF2_OF_POS_Y 0.03
|
||||
param set-default EKF2_OF_POS_Z -0.07
|
||||
param set-default SENS_FLOW0_POS_X 0.06
|
||||
param set-default SENS_FLOW0_POS_Y 0.03
|
||||
param set-default SENS_FLOW0_POS_Z -0.07
|
||||
|
||||
# Failsafe
|
||||
param set-default COM_LOW_BAT_ACT 3
|
||||
|
||||
@@ -47,9 +47,9 @@ param set-default PWM_MAIN_TIM0 -3
|
||||
param set-default DSHOT_TEL_CFG 104
|
||||
|
||||
param set-default EKF2_MIN_RNG 0.01
|
||||
param set-default EKF2_OF_POS_X 0.043
|
||||
param set-default EKF2_OF_POS_Y 0.011
|
||||
param set-default EKF2_OF_QMIN_GND 1
|
||||
param set-default SENS_FLOW0_POS_X 0.043
|
||||
param set-default SENS_FLOW0_POS_Y 0.011
|
||||
param set-default EKF2_OF0_QMINGND 1
|
||||
param set-default EKF2_RNG_POS_X 0.043
|
||||
param set-default EKF2_RNG_POS_Y 0
|
||||
param set-default EKF2_RNG_A_HMAX 25
|
||||
@@ -78,7 +78,7 @@ param set-default RC_CRSF_TEL_EN 1
|
||||
|
||||
param set-default RTL_RETURN_ALT 15
|
||||
|
||||
param set-default SENS_FLOW_MINHGT 0
|
||||
param set-default SENS_FLOW0_HMIN 0
|
||||
|
||||
param set-default SER_TEL2_BAUD 3000000
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
. ${R}etc/init.d/rc.mc_defaults
|
||||
|
||||
param set-default SYS_HAS_MAG 0
|
||||
param set-default EKF2_OF_CTRL 1
|
||||
param set-default EKF2_OF0_CTRL 1
|
||||
param set-default EKF2_GPS_CTRL 0
|
||||
param set-default EKF2_MAG_TYPE 5
|
||||
|
||||
|
||||
@@ -50,8 +50,7 @@ param set-default GF_ACTION 1
|
||||
param set-default NAV_RCL_ACT 1
|
||||
|
||||
# disable attitude failure detection
|
||||
param set-default FD_FAIL_P 0
|
||||
param set-default FD_FAIL_R 0
|
||||
param set-default FD_TILT_ERROR -1
|
||||
|
||||
param set-default CA_ROTOR_COUNT 8
|
||||
param set-default CA_R_REV 255
|
||||
|
||||
@@ -67,13 +67,13 @@ param set-default MIS_TAKEOFF_ALT 1.1
|
||||
#####################################
|
||||
# Enable optical flow and GPS
|
||||
param set-default EKF2_MAG_TYPE 1
|
||||
param set-default EKF2_OF_QMIN 80
|
||||
param set-default EKF2_OF0_QMIN 80
|
||||
|
||||
# default horizontal stablization sensors
|
||||
param set-default SENS_EN_PMW3901 1
|
||||
param set-default SENS_EN_PX4FLOW 1
|
||||
param set-default SENS_EN_LL40LS 2
|
||||
param set-default SENS_FLOW_ROT 2
|
||||
param set-default SENS_FLOW0_ROT 2
|
||||
|
||||
param set-default COM_DISARM_LAND 3
|
||||
|
||||
|
||||
@@ -25,8 +25,7 @@ param set-default UXRCE_DDS_AG_IP -1062731775
|
||||
param set-default UXRCE_DDS_CFG 1000
|
||||
|
||||
# disable attitude failure detection
|
||||
param set-default FD_FAIL_P 0
|
||||
param set-default FD_FAIL_R 0
|
||||
param set-default FD_TILT_ERROR -1
|
||||
|
||||
# Disable magnetometer fusion in EKF2
|
||||
param set-default EKF2_MAG_TYPE 5
|
||||
|
||||
@@ -29,8 +29,7 @@ param set-default UXRCE_DDS_AG_IP -1062731775
|
||||
param set-default UXRCE_DDS_CFG 1000
|
||||
|
||||
# disable attitude failure detection
|
||||
param set-default FD_FAIL_P 0
|
||||
param set-default FD_FAIL_R 0
|
||||
param set-default FD_TILT_ERROR -1
|
||||
|
||||
# Disable magnetometer fusion in EKF2
|
||||
param set-default EKF2_MAG_TYPE 5
|
||||
|
||||
@@ -10,9 +10,5 @@ keep-one-line-blocks
|
||||
keep-one-line-statements
|
||||
align-pointer=name
|
||||
align-reference=name
|
||||
-n #--suffix=none
|
||||
ignore-exclude-errors-x
|
||||
lineend=linux
|
||||
exclude=EASTL
|
||||
add-brackets
|
||||
max-code-length=140
|
||||
@@ -1,22 +1,42 @@
|
||||
#!/usr/bin/env bash
|
||||
# Check the formatting of the given files, print a diff for each badly formatted
|
||||
# one and fail. With PX4_ASTYLE_FIX=1 the files get fixed instead.
|
||||
#
|
||||
# All files are formatted in one batch on a temporary copy to keep the
|
||||
# formatter startup cost independent of the number of files.
|
||||
|
||||
FILE=$1
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
|
||||
CHECK_FAILED=$(${DIR}/fix_code_style.sh --dry-run --formatted $FILE)
|
||||
if [ -n "$CHECK_FAILED" ]; then
|
||||
${DIR}/fix_code_style.sh --quiet < $FILE > $FILE.pretty
|
||||
|
||||
echo -e 'Formatting issue found in' $FILE
|
||||
echo
|
||||
git --no-pager diff --no-index --minimal --histogram --color=always $FILE $FILE.pretty | grep -vE -e "^.{,4}diff.*\.pretty.{,3}$" -e "^.{,4}--- a/.*$" -e "^.{,4}\+\+\+ b/.*$" -e "^.{,5}@@ .* @@.*$" -e "^.{,4}index .{10}\.\."
|
||||
rm -f $FILE.pretty
|
||||
echo
|
||||
|
||||
if [[ $PX4_ASTYLE_FIX -eq 1 ]]; then
|
||||
${DIR}/fix_code_style.sh $FILE
|
||||
else
|
||||
echo 'to fix automatically run "make format", "make format_changed" or "./Tools/astyle/fix_code_style.sh' $FILE'"'
|
||||
exit 1
|
||||
fi
|
||||
if [[ $# -eq 0 ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
TMP_DIR=$(mktemp -d)
|
||||
trap 'rm -rf "$TMP_DIR"' EXIT
|
||||
|
||||
FORMATTED=()
|
||||
for FILE in "$@"; do
|
||||
mkdir -p "$TMP_DIR/$(dirname "$FILE")"
|
||||
cp "$FILE" "$TMP_DIR/$FILE"
|
||||
FORMATTED+=("$TMP_DIR/$FILE")
|
||||
done
|
||||
|
||||
"${DIR}/fix_code_style.sh" "${FORMATTED[@]}" || exit 1
|
||||
|
||||
CHECK_FAILED=0
|
||||
for FILE in "$@"; do
|
||||
if ! cmp -s "$FILE" "$TMP_DIR/$FILE"; then
|
||||
echo -e 'Formatting issue found in' "$FILE"
|
||||
echo
|
||||
git --no-pager diff --no-index --minimal --histogram --color=always "$FILE" "$TMP_DIR/$FILE" | tail -n +5
|
||||
echo
|
||||
|
||||
if [[ $PX4_ASTYLE_FIX -eq 1 ]]; then
|
||||
cp "$TMP_DIR/$FILE" "$FILE"
|
||||
else
|
||||
echo 'to fix automatically run "make format", "make format_changed" or "./Tools/astyle/fix_code_style.sh' "$FILE"'"'
|
||||
CHECK_FAILED=1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
exit $CHECK_FAILED
|
||||
@@ -1,40 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
|
||||
# Check for the latest astyle version
|
||||
ASTYLE_VER_REQUIRED_1="Artistic Style Version 2.06"
|
||||
ASTYLE_VER_REQUIRED_2="Artistic Style Version 3.0"
|
||||
ASTYLE_VER_REQUIRED_3="Artistic Style Version 3.0.1"
|
||||
ASTYLE_VER_REQUIRED_4="Artistic Style Version 3.1"
|
||||
DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
|
||||
|
||||
astyle_ver() {
|
||||
echo "PX4 requires at least ${ASTYLE_VER_REQUIRED_1}"
|
||||
echo "You can get the correct version here: https://sourceforge.net/projects/astyle/files/astyle/astyle%202.06/"
|
||||
}
|
||||
|
||||
# check if astyle is installed
|
||||
condition=$(which astyle 2>/dev/null | grep -v "not found" | wc -l)
|
||||
if [ $condition -eq 0 ]; then
|
||||
echo "astyle is not installed"
|
||||
astyle_ver
|
||||
exit 1
|
||||
else
|
||||
|
||||
ASTYLE_VER=`astyle --version`
|
||||
|
||||
if [ "$ASTYLE_VER" != "$ASTYLE_VER_REQUIRED_1" -a \
|
||||
"$ASTYLE_VER" != "$ASTYLE_VER_REQUIRED_2" -a \
|
||||
"$ASTYLE_VER" != "$ASTYLE_VER_REQUIRED_3" -a \
|
||||
"$ASTYLE_VER" != "$ASTYLE_VER_REQUIRED_4" ]
|
||||
then
|
||||
echo "Error: you're using ${ASTYLE_VER}"
|
||||
echo "but should be using ${ASTYLE_VER_REQUIRED_1}, ${ASTYLE_VER_REQUIRED_2}, ${ASTYLE_VER_REQUIRED_3}, or ${ASTYLE_VER_REQUIRED_4} instead"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
# fail early if no usable astyle is installed
|
||||
"${DIR}/fix_code_style.sh"
|
||||
|
||||
CI="${CI:-false}"
|
||||
DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
|
||||
|
||||
DIFF_ONLY=false
|
||||
for arg in "$@"; do
|
||||
@@ -80,7 +52,7 @@ if [ -z "$FILE_LIST" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "$FILE_LIST" | xargs -P 8 -I % ${DIR}/check_code_style.sh %
|
||||
echo "$FILE_LIST" | xargs -P 8 -n 100 "${DIR}/check_code_style.sh"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Format checks passed"
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Check that parameter members declared in DEFINE_PARAMETERS() follow the naming
|
||||
convention _param_<lower case parameter name>, e.g.
|
||||
|
||||
(ParamFloat<px4::params::MPC_XY_VEL_MAX>) _param_mpc_xy_vel_max
|
||||
|
||||
Usage:
|
||||
check_param_names.py report violations, exit 1 if there are any
|
||||
check_param_names.py --fix rename violating members
|
||||
|
||||
--fix renames the member in the declaring file and its implementation file
|
||||
(same stem, optionally with _main suffix). If the old name also appears in any
|
||||
other source file that does not declare it as a parameter member itself, it
|
||||
might be a use (e.g. a derived class or a helper file) or an unrelated member
|
||||
with the same name. Telling those apart needs a compiler, so such members are
|
||||
not renamed but reported for manual renaming, and --fix exits with an error.
|
||||
This keeps --fix from renaming a declaration while leaving its uses elsewhere
|
||||
behind, which would break code that compiled before.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
from collections import defaultdict
|
||||
|
||||
DECLARATION = re.compile(r'<\s*px4::params::(\w+)\s*>\s*\)\s*([A-Za-z_]\w*)')
|
||||
IDENTIFIER = re.compile(r'[A-Za-z_]\w*')
|
||||
SOURCE_EXTENSIONS = ('.c', '.cpp', '.h', '.hpp')
|
||||
|
||||
|
||||
def expected_name(param):
|
||||
return '_param_' + param.lower()
|
||||
|
||||
|
||||
def find_violations(files):
|
||||
violations = []
|
||||
|
||||
for path in files:
|
||||
with open(path, encoding='utf-8', errors='replace', newline='') as f:
|
||||
text = f.read()
|
||||
|
||||
if 'px4::params::' not in text:
|
||||
continue
|
||||
|
||||
for match in DECLARATION.finditer(text):
|
||||
param, member = match.groups()
|
||||
|
||||
if member != expected_name(param):
|
||||
line = text.count('\n', 0, match.start(2)) + 1
|
||||
violations.append((path, line, param, member))
|
||||
|
||||
return violations
|
||||
|
||||
|
||||
def stem(path):
|
||||
name = os.path.splitext(path)[0]
|
||||
return name[:-len('_main')] if name.endswith('_main') else name
|
||||
|
||||
|
||||
def stem_files(file_stem):
|
||||
return [file_stem + suffix + extension
|
||||
for suffix in ('', '_main')
|
||||
for extension in SOURCE_EXTENSIONS
|
||||
if os.path.isfile(file_stem + suffix + extension)]
|
||||
|
||||
|
||||
def all_sources():
|
||||
"""All tracked C/C++ sources as absolute path -> (identifiers used, parameter members declared)."""
|
||||
top = subprocess.run(['git', 'rev-parse', '--show-toplevel'],
|
||||
capture_output=True, text=True, check=True).stdout.strip()
|
||||
paths = subprocess.run(['git', 'ls-files', '-z', '--'] + ['*' + e for e in SOURCE_EXTENSIONS],
|
||||
cwd=top, capture_output=True, text=True, check=True).stdout.split('\0')
|
||||
sources = {}
|
||||
|
||||
for path in filter(None, paths):
|
||||
path = os.path.join(top, path)
|
||||
|
||||
if os.path.isfile(path):
|
||||
with open(path, encoding='utf-8', errors='replace', newline='') as f:
|
||||
text = f.read()
|
||||
|
||||
sources[path] = (set(IDENTIFIER.findall(text)), {m.group(2) for m in DECLARATION.finditer(text)})
|
||||
|
||||
# a class usually declares its parameters in the header and uses them in the implementation file
|
||||
declared_by_stem = defaultdict(set)
|
||||
|
||||
for path, (_, declared) in sources.items():
|
||||
declared_by_stem[stem(path)] |= declared
|
||||
|
||||
return {path: (identifiers, declared_by_stem[stem(path)]) for path, (identifiers, _) in sources.items()}
|
||||
|
||||
|
||||
def outside_references(member, own_files, sources):
|
||||
"""Files outside own_files mentioning member without their stem declaring it as own parameter member."""
|
||||
own_files = {os.path.abspath(path) for path in own_files}
|
||||
|
||||
return sorted(os.path.relpath(path) for path, (identifiers, declared) in sources.items()
|
||||
if path not in own_files and member in identifiers and member not in declared)
|
||||
|
||||
|
||||
def fix(violations):
|
||||
# old name -> new name per file stem
|
||||
renames = defaultdict(dict)
|
||||
ok = True
|
||||
|
||||
for path, line, param, member in violations:
|
||||
stem_renames = renames[stem(path)]
|
||||
new = expected_name(param)
|
||||
|
||||
if stem_renames.get(member, new) != new:
|
||||
print(f'{path}:{line}: {member} maps to both {stem_renames[member]} and {new}, rename manually')
|
||||
ok = False
|
||||
continue
|
||||
|
||||
stem_renames[member] = new
|
||||
|
||||
sources = all_sources() if renames else {}
|
||||
|
||||
for file_stem, stem_renames in renames.items():
|
||||
files = stem_files(file_stem)
|
||||
|
||||
for member in list(stem_renames):
|
||||
references = outside_references(member, files, sources)
|
||||
|
||||
if references:
|
||||
print(f'{member} is also used in {", ".join(references)}, rename to {stem_renames[member]} manually')
|
||||
del stem_renames[member]
|
||||
ok = False
|
||||
|
||||
if not stem_renames:
|
||||
continue
|
||||
|
||||
pattern = re.compile(r'\b(' + '|'.join(map(re.escape, stem_renames)) + r')\b')
|
||||
|
||||
for path in files:
|
||||
with open(path, encoding='utf-8', newline='') as f:
|
||||
text = f.read()
|
||||
|
||||
new_text = pattern.sub(lambda m: stem_renames[m.group(1)], text)
|
||||
|
||||
if new_text != text:
|
||||
with open(path, 'w', encoding='utf-8', newline='') as f:
|
||||
f.write(new_text)
|
||||
|
||||
print(f'renamed parameter members in {path}')
|
||||
|
||||
return ok
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description='Check parameter member naming')
|
||||
parser.add_argument('--fix', action='store_true', help='rename violating members')
|
||||
parser.add_argument('files', nargs='*', help='files to check (default: all checked by astyle)')
|
||||
args = parser.parse_args()
|
||||
|
||||
files = args.files
|
||||
|
||||
if not files:
|
||||
script_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
os.chdir(os.path.join(script_dir, '..', '..'))
|
||||
files = subprocess.run([os.path.join(script_dir, 'files_to_check_code_style.sh')],
|
||||
capture_output=True, text=True, check=True).stdout.split()
|
||||
|
||||
violations = find_violations(files)
|
||||
|
||||
if args.fix:
|
||||
return 0 if fix(violations) else 1
|
||||
|
||||
for path, line, param, member in violations:
|
||||
print(f'{path}:{line}: parameter member {member} should be named {expected_name(param)}')
|
||||
|
||||
if violations:
|
||||
print(f'{len(violations)} parameter members not named _param_<lower case parameter name>, '
|
||||
'run `make format` to fix')
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
||||
@@ -1,11 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ $# -eq 0 ]] ; then
|
||||
exit 0
|
||||
fi
|
||||
# Format the given files in place with astyle 3.1 and the PX4 rules in astylerc.
|
||||
#
|
||||
# Prefers astyle-py (pip install astyle-py, see Tools/setup/requirements.txt)
|
||||
# which bundles astyle 3.1 independent of the OS. Falls back to a natively
|
||||
# installed astyle of a supported version.
|
||||
#
|
||||
# Without file arguments it only checks that a usable astyle is available.
|
||||
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
astyle \
|
||||
--options=$DIR/astylerc \
|
||||
--preserve-date \
|
||||
$*
|
||||
ASTYLE_PY_VERSION="3.1"
|
||||
ASTYLE_NATIVE_VERSIONS=("2.06" "3.0" "3.0.1" "3.1")
|
||||
|
||||
if command -v astyle_py >/dev/null 2>&1; then
|
||||
ASTYLE=(astyle_py)
|
||||
elif python3 -c "import astyle_py" >/dev/null 2>&1; then
|
||||
ASTYLE=(python3 -m astyle_py)
|
||||
fi
|
||||
|
||||
if [[ -n "${ASTYLE[*]}" ]]; then
|
||||
ASTYLE+=("--astyle-version=${ASTYLE_PY_VERSION}" --options="${DIR}/astylerc" --quiet)
|
||||
else
|
||||
NATIVE_VERSION=$(astyle --version 2>/dev/null | sed -n 's/^Artistic Style Version //p')
|
||||
for v in "${ASTYLE_NATIVE_VERSIONS[@]}"; do
|
||||
if [[ "$NATIVE_VERSION" == "$v" ]]; then
|
||||
ASTYLE=(astyle --options="${DIR}/astylerc" --suffix=none --lineend=linux --preserve-date --quiet)
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ -z "${ASTYLE[*]}" ]]; then
|
||||
echo "Error: no usable astyle found${NATIVE_VERSION:+ (installed astyle ${NATIVE_VERSION} is not supported)}." >&2
|
||||
echo "Install astyle 3.1 via: python3 -m pip install -r ${DIR}/../setup/requirements.txt" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $# -eq 0 ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
"${ASTYLE[@]}" "$@" >/dev/null
|
||||
@@ -54,7 +54,7 @@ if [ $? -ne 0 ]; then
|
||||
fi
|
||||
|
||||
# Check for code style, only in changed files
|
||||
bash -c "comm -12 <(./Tools/astyle/files_to_check_code_style.sh | sort) <(git diff --cached --name-only --diff-filter=ACM) | xargs -P 8 -I % ./Tools/astyle/check_code_style.sh %"
|
||||
bash -c "comm -12 <(./Tools/astyle/files_to_check_code_style.sh | sort) <(git diff --cached --name-only --diff-filter=ACM) | xargs ./Tools/astyle/check_code_style.sh"
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "Pre-commit style error: Bad formatting according to astyle rules"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
# Container images
|
||||
containers:
|
||||
default: "ghcr.io/px4/px4-dev:v1.18.0-beta2"
|
||||
voxl2: "ghcr.io/px4/px4-dev-voxl2:v1.7"
|
||||
voxl2: "ghcr.io/px4/px4-dev-voxl2:v1.8"
|
||||
|
||||
# Runner specs
|
||||
runners:
|
||||
|
||||
@@ -8,7 +8,7 @@ import os
|
||||
import sys
|
||||
from copy import deepcopy
|
||||
|
||||
from output_groups_from_timer_config import get_timer_groups, get_output_groups
|
||||
from output_groups_from_timer_config import get_timer_groups, get_output_groups, load_board_config
|
||||
|
||||
try:
|
||||
import yaml
|
||||
@@ -29,7 +29,7 @@ parser.add_argument('--params-file', type=str, action='store',
|
||||
parser.add_argument('--timer-config', type=str, action='store',
|
||||
help='board-specific timer_config.cpp file')
|
||||
parser.add_argument('--board-config', type=str, action='store',
|
||||
help='board Kconfig boardconfig file, evaluates the timer_config.cpp preprocessor conditionals')
|
||||
help='board Kconfig boardconfig file, evaluates the timer_config.cpp preprocessor conditionals and Kconfig instance counts')
|
||||
parser.add_argument('--ethernet', action='store_true',
|
||||
help='Ethernet support')
|
||||
parser.add_argument('--board', type=str, action='store',
|
||||
@@ -52,6 +52,15 @@ board = args.board
|
||||
root_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)),"../..")
|
||||
output_functions_file = os.path.join(root_dir,"src/lib/mixer_module/output_functions.yaml")
|
||||
|
||||
board_config = load_board_config(args.board_config)
|
||||
|
||||
def get_num_instances(num_instances):
|
||||
""" num_instances is an integer or {kconfig: SYMBOL, default: N} """
|
||||
if isinstance(num_instances, dict):
|
||||
return int(board_config.get('CONFIG_' + num_instances['kconfig'],
|
||||
num_instances['default']))
|
||||
return num_instances
|
||||
|
||||
def process_module_name(module_name):
|
||||
if module_name == '${PWM_MAIN_OR_AUX}':
|
||||
if board_with_io: return 'PWM AUX'
|
||||
@@ -102,7 +111,8 @@ def parse_yaml_parameters_config(yaml_config, ethernet_supported):
|
||||
for param in param_list:
|
||||
if param.get('requires_ethernet', False) and not ethernet_supported:
|
||||
continue
|
||||
num_instances = param.get('num_instances', 1)
|
||||
num_instances_config = param.get('num_instances', 1)
|
||||
num_instances = get_num_instances(num_instances_config)
|
||||
instance_start = param.get('instance_start', 0) # offset
|
||||
instance_start_label = param.get('instance_start_label', instance_start)
|
||||
|
||||
@@ -146,10 +156,13 @@ def parse_yaml_parameters_config(yaml_config, ethernet_supported):
|
||||
# default value
|
||||
default_value = 0
|
||||
if 'default' in param:
|
||||
# default can be a list of num_instances or a single value
|
||||
# default can be a list of num_instances or a single value.
|
||||
# With a Kconfig count, instances past the end of the list
|
||||
# take its last entry.
|
||||
if type(param['default']) == list:
|
||||
assert len(param['default']) == num_instances
|
||||
default_value = param['default'][i]
|
||||
if not isinstance(num_instances_config, dict):
|
||||
assert len(param['default']) == num_instances
|
||||
default_value = param['default'][min(i, len(param['default']) - 1)]
|
||||
else:
|
||||
default_value = param['default']
|
||||
|
||||
|
||||
@@ -78,12 +78,13 @@ def imxrt_is_dshot(line):
|
||||
return False
|
||||
|
||||
def load_board_config(board_config):
|
||||
""" return the set of symbols assigned in a Kconfig .config style file
|
||||
(e.g. the boardconfig the build generates); None gives an empty set """
|
||||
""" return the symbols assigned in a Kconfig .config style file (e.g. the
|
||||
boardconfig the build generates) as a dict of symbol to value, with string
|
||||
quotes stripped; None gives an empty dict """
|
||||
if board_config is None:
|
||||
return set()
|
||||
return {}
|
||||
with open(board_config, 'r') as f:
|
||||
return {m.group(1) for m in (re.match(r'(\w+)=', l) for l in f) if m}
|
||||
return {m.group(1): m.group(2).strip('"') for m in (re.match(r'(\w+)=(.*)', l.strip()) for l in f) if m}
|
||||
|
||||
def preprocess(text, defined):
|
||||
""" return the lines of text the C preprocessor keeps, given the set of defined symbols.
|
||||
|
||||
@@ -18,10 +18,18 @@ apt-get install -y --no-install-recommends /ros2-apt-source.deb
|
||||
rm /ros2-apt-source.deb
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends \
|
||||
build-essential ccache cmake git ninja-build \
|
||||
astyle build-essential ccache cmake git ninja-build \
|
||||
python3-empy python3-pip ros-dev-tools "ros-${ROS_DISTRO}-ros-base" \
|
||||
"ros-${ROS_DISTRO}-rmw-zenoh-cpp"
|
||||
|
||||
# astyle-py requires PyYAML 6, which conflicts with the distro PyYAML pinned
|
||||
# below (5.4.1 on jammy). Rely on the distro astyle 3.1 installed above, which
|
||||
# Tools/astyle/fix_code_style.sh accepts. /px4-setup is a read-only bind mount,
|
||||
# so filter a copy of it.
|
||||
px4_setup_dir=$(mktemp -d)
|
||||
cp -r /px4-setup/. "${px4_setup_dir}"
|
||||
sed -i '/^astyle-py/d' "${px4_setup_dir}/requirements.txt"
|
||||
|
||||
# Keep Ubuntu/ROS Python packages while satisfying PX4's shared requirements.
|
||||
# Distro-only versions (e.g. ubuntu suffixes) cannot be pip constraints.
|
||||
python3 - <<'PY' > /px4-python-constraints.txt
|
||||
@@ -43,8 +51,8 @@ else
|
||||
extra_args=""
|
||||
fi
|
||||
RUNS_IN_DOCKER=true PIP_CONSTRAINT=/px4-python-constraints.txt PIP_NO_CACHE_DIR=1 \
|
||||
bash /px4-setup/ubuntu.sh --no-nuttx ${extra_args}
|
||||
rm /px4-python-constraints.txt
|
||||
bash "${px4_setup_dir}/ubuntu.sh" --no-nuttx ${extra_args}
|
||||
rm -rf /px4-python-constraints.txt "${px4_setup_dir}"
|
||||
|
||||
rosdep init
|
||||
rosdep update --rosdistro "${ROS_DISTRO}"
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (c) 2018 PX4 Development Team. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name PX4 nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
"""
|
||||
File: parameter_update.py
|
||||
Description:
|
||||
This script searches for declarations of BlockParam, creates a variable name of the
|
||||
form "_param_name_of_parameter" and replaces the old variable with the new one.
|
||||
|
||||
Example:
|
||||
(ParamExtFloat<px4::params::EKF2_GYR_NOISE>) _gyroNoise,
|
||||
[...]
|
||||
_gyroNoise.set(1.f);
|
||||
|
||||
is replaced by
|
||||
|
||||
(ParamExtFloat<px4::params::EKF2_GYR_NOISE>) _param_ekf2_gyr_noise,
|
||||
[...]
|
||||
_param_ekf2_gyr_noise.set(1.f);
|
||||
|
||||
Usage:
|
||||
The script needs a list of files as an input. To quickly find and feed all the file
|
||||
that it needs to inspect, one can simply pipe the result of a ripgrep -l command as follows:
|
||||
|
||||
rg -l '\.[gs]et\(|px4::params::' -tcpp | python3 parameter_update.py
|
||||
"""
|
||||
|
||||
import re
|
||||
import fileinput
|
||||
import sys
|
||||
|
||||
filenames = []
|
||||
for filename in sys.stdin:
|
||||
filenames.append(filename.rstrip())
|
||||
|
||||
pattern = r'^.*<px4::params::([A-Za-z0-9_]+)>\)\s*([A-Za-z0-9_]+)[,\s]?.*$'
|
||||
regex = re.compile(pattern, re.MULTILINE)
|
||||
|
||||
replace_dict = dict()
|
||||
|
||||
print("Searching for parameters...")
|
||||
for filename in filenames:
|
||||
print(filename)
|
||||
with open(filename, 'r') as f:
|
||||
text = f.read()
|
||||
for match in regex.finditer(text):
|
||||
replace_dict[match.group(2)] = "_param_" + match.group(1).strip().lower()
|
||||
|
||||
print("The following variables will be changed")
|
||||
for old_var in replace_dict:
|
||||
print("{} -> {}".format(old_var, replace_dict[old_var]))
|
||||
|
||||
for filename in filenames:
|
||||
print(filename)
|
||||
for old_var in replace_dict:
|
||||
for line in fileinput.input(filename, inplace=1):
|
||||
line = re.sub(r'(>\)\s*)\b' + old_var + r'\b', r'\1' + replace_dict[old_var], line.rstrip()) # replace the declaration
|
||||
line = re.sub(r'(^\s*)\b' + old_var + r'\b', r'\1' + replace_dict[old_var], line.rstrip()) # replace the 2 liner declaration and when the variable is used a the beginning of a new line
|
||||
line = re.sub(r'\b' + old_var + r'\b(\.([gs]et|commit)\()',replace_dict[old_var] + r'\1' , line.rstrip()) # replace the usages (with get/set/commit)
|
||||
line = re.sub(r'(\()\b' + old_var + r'\b', r'\1' + replace_dict[old_var], line.rstrip()) # replace the 2 liner declaration
|
||||
print(line)
|
||||
@@ -5,6 +5,9 @@ import argparse
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../module_config'))
|
||||
from output_groups_from_timer_config import load_board_config
|
||||
|
||||
try:
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
except ImportError as e:
|
||||
@@ -162,6 +165,8 @@ parser.add_argument('--params-file', type=str, action='store',
|
||||
help='Parameter output file', default=None)
|
||||
parser.add_argument('--ethernet', action='store_true',
|
||||
help='Ethernet support')
|
||||
parser.add_argument('--board-config', type=str, action='store', default=None,
|
||||
help='board Kconfig boardconfig file, for Kconfig instance counts')
|
||||
parser.add_argument('-v', '--verbose', dest='verbose', action='store_true',
|
||||
help='Verbose Output')
|
||||
|
||||
@@ -201,6 +206,15 @@ if ethernet_supported:
|
||||
'index': 1000
|
||||
})
|
||||
|
||||
board_config = load_board_config(args.board_config)
|
||||
|
||||
def get_num_instances(num_instances):
|
||||
""" num_instances is an integer or {kconfig: SYMBOL, default: N} """
|
||||
if isinstance(num_instances, dict):
|
||||
return int(board_config.get('CONFIG_' + num_instances['kconfig'],
|
||||
num_instances['default']))
|
||||
return num_instances
|
||||
|
||||
def parse_yaml_serial_config(yaml_config):
|
||||
""" parse the serial_config section from the yaml config file """
|
||||
if 'serial_config' not in yaml_config:
|
||||
@@ -247,7 +261,10 @@ for tag, device in board_ports:
|
||||
# construct commands based on selected board
|
||||
commands = []
|
||||
for serial_command in serial_commands:
|
||||
num_instances = serial_command.get('num_instances', 1)
|
||||
num_instances_config = serial_command.get('num_instances', 1)
|
||||
num_instances = get_num_instances(num_instances_config)
|
||||
# a Kconfig count of 1 still needs ${i} set in the script
|
||||
multi_instance = num_instances > 1 or isinstance(num_instances_config, dict)
|
||||
# TODO: use a loop in the script instead of explicitly enumerating all instances
|
||||
for i in range(num_instances):
|
||||
port_config = serial_command['port_config_param']
|
||||
@@ -264,8 +281,10 @@ for serial_command in serial_commands:
|
||||
default_port = 0 # disabled
|
||||
if 'default' in port_config:
|
||||
if type(port_config['default']) == list:
|
||||
assert len(port_config['default']) == num_instances
|
||||
default_port_str = port_config['default'][i]
|
||||
# with a Kconfig count, instances past the end of the list take its last entry
|
||||
if not isinstance(num_instances_config, dict):
|
||||
assert len(port_config['default']) == num_instances
|
||||
default_port_str = port_config['default'][min(i, len(port_config['default']) - 1)]
|
||||
else:
|
||||
default_port_str = port_config['default']
|
||||
|
||||
@@ -281,7 +300,7 @@ for serial_command in serial_commands:
|
||||
'command': serial_command['command'],
|
||||
'label': serial_command['label'],
|
||||
'instance': i,
|
||||
'multi_instance': num_instances > 1,
|
||||
'multi_instance': multi_instance,
|
||||
'port_param_name': port_param_name,
|
||||
'default_port': default_port,
|
||||
'param_group': port_config['group'],
|
||||
|
||||
@@ -44,7 +44,6 @@ echo
|
||||
echo "Installing PX4 general dependencies"
|
||||
|
||||
sudo pacman -Sy --noconfirm --needed \
|
||||
astyle \
|
||||
base-devel \
|
||||
clang \
|
||||
cmake \
|
||||
|
||||
@@ -84,7 +84,6 @@ brew tap PX4/px4
|
||||
# Package list. This replaces the px4-dev meta-formula, which is kept
|
||||
# as a deprecated no-op upstream. See PX4/homebrew-px4 for history.
|
||||
PX4_BREW_PACKAGES=(
|
||||
astyle
|
||||
bash-completion
|
||||
ccache
|
||||
cmake
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
argcomplete
|
||||
astyle-py==1.1.0
|
||||
cerberus
|
||||
coverage
|
||||
empy>=3.3,<4
|
||||
|
||||
@@ -79,7 +79,6 @@ echo "[ubuntu.sh] Installing PX4 general dependencies"
|
||||
|
||||
sudo apt-get update -y --quiet
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
|
||||
astyle \
|
||||
build-essential \
|
||||
ccache \
|
||||
cmake \
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
CONFIG_BOARD_TOOLCHAIN="arm-none-eabi"
|
||||
CONFIG_BOARD_ARCHITECTURE="cortex-m7"
|
||||
CONFIG_BOARD_ROMFSROOT=""
|
||||
@@ -0,0 +1,6 @@
|
||||
# Accton Godwit GFH7 debug build configuration
|
||||
# Build target: make accton-godwit_gfh7_debug
|
||||
# Merged on top of default.px4board, so only the differences belong here.
|
||||
|
||||
# UART4 (/dev/ttyS3) is the NuttX console in this build.
|
||||
# CONFIG_BOARD_SERIAL_TEL4 is not set
|
||||
@@ -0,0 +1,114 @@
|
||||
# Accton Godwit GFH7 default PX4 build configuration
|
||||
# Board path: boards/accton-godwit/gfh7/
|
||||
# Build target: make accton-godwit_gfh7_default
|
||||
# Board ID: 7122
|
||||
# MCU: STM32H753VIH6 (TFBGA100, 2MB Flash, 1MB RAM)
|
||||
|
||||
CONFIG_BOARD_TOOLCHAIN="arm-none-eabi"
|
||||
CONFIG_BOARD_ARCHITECTURE="cortex-m7"
|
||||
CONFIG_BOARD_COMPILE_DEFINITIONS="-DUSE_S_RGB_LED_DMA"
|
||||
CONFIG_BOARD_UAVCAN_INTERFACES=1
|
||||
CONFIG_BOARD_ROMFSROOT="px4fmu_common"
|
||||
CONFIG_BOARD_ETHERNET=n
|
||||
# USART1: ESC connector telemetry pin (RX only), ESC telemetry
|
||||
CONFIG_BOARD_SERIAL_EXT2="/dev/ttyS0"
|
||||
# USART2: T2/R2 pads
|
||||
CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS1"
|
||||
# USART3: GPS connector
|
||||
CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS2"
|
||||
# UART4: ELRS connector
|
||||
CONFIG_BOARD_SERIAL_TEL4="/dev/ttyS3"
|
||||
# UART5: SBUS connector (RX and TX), A-VTX connector (TX only, shared with the SBUS connector TX line)
|
||||
CONFIG_BOARD_SERIAL_RC="/dev/ttyS4"
|
||||
# UART7: TELEM connector
|
||||
CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS5"
|
||||
# UART8: D-VTX connector
|
||||
CONFIG_BOARD_SERIAL_TEL3="/dev/ttyS6"
|
||||
|
||||
# ============================================================================
|
||||
# Drivers - Sensors
|
||||
# ============================================================================
|
||||
CONFIG_DRIVERS_BAROMETER_DPS310=y
|
||||
CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8310=y
|
||||
CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y
|
||||
CONFIG_DRIVERS_IMU_ST_LSM6DSV=y
|
||||
CONFIG_DRIVERS_GPS=y
|
||||
|
||||
# ============================================================================
|
||||
# Drivers - I/O and Comms
|
||||
# ============================================================================
|
||||
CONFIG_COMMON_RC=y
|
||||
CONFIG_DRIVERS_PWM_OUT=y
|
||||
CONFIG_DRIVERS_DSHOT=y
|
||||
CONFIG_DRIVERS_TONE_ALARM=y
|
||||
CONFIG_DRIVERS_LIGHTS_NEOPIXEL=y
|
||||
CONFIG_DRIVERS_CDCACM_AUTOSTART=y
|
||||
CONFIG_DRIVERS_ADC_BOARD_ADC=y
|
||||
CONFIG_DRIVERS_HEATER=y
|
||||
CONFIG_DRIVERS_UAVCAN=y
|
||||
CONFIG_DRIVERS_OSD_MSP_OSD=y
|
||||
CONFIG_DRIVERS_OSD_ATXXXX=y
|
||||
|
||||
# ============================================================================
|
||||
# System commands (px4 command-line utilities)
|
||||
# ============================================================================
|
||||
CONFIG_SYSTEMCMDS_BL_UPDATE=y
|
||||
CONFIG_SYSTEMCMDS_BSONDUMP=y
|
||||
CONFIG_SYSTEMCMDS_DMESG=y
|
||||
CONFIG_SYSTEMCMDS_DUMPFILE=y
|
||||
CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y
|
||||
CONFIG_SYSTEMCMDS_LED_CONTROL=y
|
||||
CONFIG_SYSTEMCMDS_MFT=y
|
||||
CONFIG_SYSTEMCMDS_MTD=y
|
||||
CONFIG_SYSTEMCMDS_NSHTERM=y
|
||||
CONFIG_SYSTEMCMDS_PARAM=y
|
||||
CONFIG_SYSTEMCMDS_PERF=y
|
||||
CONFIG_SYSTEMCMDS_REBOOT=y
|
||||
CONFIG_SYSTEMCMDS_SD_BENCH=y
|
||||
CONFIG_SYSTEMCMDS_SD_STRESS=y
|
||||
CONFIG_SYSTEMCMDS_SERIAL_TEST=y
|
||||
CONFIG_SYSTEMCMDS_SYSTEM_TIME=y
|
||||
CONFIG_SYSTEMCMDS_TOP=y
|
||||
CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y
|
||||
CONFIG_SYSTEMCMDS_TUNE_CONTROL=y
|
||||
CONFIG_SYSTEMCMDS_UORB=y
|
||||
CONFIG_SYSTEMCMDS_USB_CONNECTED=y
|
||||
CONFIG_SYSTEMCMDS_VER=y
|
||||
CONFIG_SYSTEMCMDS_WORK_QUEUE=y
|
||||
|
||||
# ============================================================================
|
||||
# Modules - Flight stack
|
||||
# ============================================================================
|
||||
CONFIG_MODULES_AIRSPEED_SELECTOR=y
|
||||
CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y
|
||||
CONFIG_MODULES_BATTERY_STATUS=y
|
||||
CONFIG_MODULES_CAMERA_FEEDBACK=y
|
||||
CONFIG_MODULES_COMMANDER=y
|
||||
CONFIG_MODULES_CONTROL_ALLOCATOR=y
|
||||
CONFIG_MODULES_DATAMAN=y
|
||||
CONFIG_MODULES_EKF2=y
|
||||
CONFIG_MODULES_EVENTS=y
|
||||
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
|
||||
CONFIG_MODULES_FW_ATT_CONTROL=y
|
||||
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
|
||||
CONFIG_MODULES_FW_LATERAL_LONGITUDINAL_CONTROL=y
|
||||
CONFIG_MODULES_FW_MODE_MANAGER=y
|
||||
CONFIG_MODULES_FW_RATE_CONTROL=y
|
||||
CONFIG_MODULES_GIMBAL=y
|
||||
CONFIG_MODULES_LAND_DETECTOR=y
|
||||
CONFIG_MODULES_LOAD_MON=y
|
||||
CONFIG_MODULES_LOGGER=y
|
||||
CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y
|
||||
CONFIG_MODULES_MANUAL_CONTROL=y
|
||||
CONFIG_MODULES_MAVLINK=y
|
||||
CONFIG_MODULES_MC_ATT_CONTROL=y
|
||||
CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y
|
||||
CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y
|
||||
CONFIG_MODULES_MC_POS_CONTROL=y
|
||||
CONFIG_MODULES_MC_RATE_CONTROL=y
|
||||
CONFIG_MODULES_NAVIGATOR=y
|
||||
CONFIG_MODULES_RC_UPDATE=y
|
||||
CONFIG_MODULES_SENSORS=y
|
||||
CONFIG_MODULES_SIMULATION_BATTERY_SIMULATOR=n
|
||||
CONFIG_MODULES_UXRCE_DDS_CLIENT=y
|
||||
CONFIG_MODULES_VTOL_ATT_CONTROL=y
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"board_id": 7122,
|
||||
"magic": "PX4FWv1",
|
||||
"description": "Firmware for the Accton Godwit GFH7 flight controller",
|
||||
"image": "",
|
||||
"build_time": 0,
|
||||
"summary": "Accton-Godwit-GFH7",
|
||||
"version": "0.1",
|
||||
"image_size": 0,
|
||||
"image_maxsize": 1835008,
|
||||
"git_identity": "",
|
||||
"board_revision": 0
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Analog battery voltage input: PC0 / ADC1 channel 10, 160k/10k divider.
|
||||
param set-default BAT1_SOURCE 0
|
||||
param set-default BAT1_V_CHANNEL 10
|
||||
param set-default BAT1_V_DIV 17.0
|
||||
|
||||
# Enable the SPI1 MAX7456-compatible OSD in NTSC mode.
|
||||
param set-default OSD_ATXXXX_CFG 1
|
||||
|
||||
# S.BUS receiver on the SBUS connector (UART5) disabled: ELRS is the RC input.
|
||||
param set-default RC_SBUS_PRT_CFG 0
|
||||
|
||||
# ELRS (CRSF) receiver on the ELRS connector (UART4): 104 = TEL4 port.
|
||||
# The debug build has no TEL4 port (UART4 is the NuttX console), so CRSF does not start there.
|
||||
param set-default RC_CRSF_PRT_CFG 104
|
||||
# Send CRSF telemetry (battery, GPS, attitude, flight mode) back to the transmitter.
|
||||
param set-default RC_CRSF_TEL_EN 1
|
||||
|
||||
# Boot into Stabilized mode instead of Hold: 15 = Stabilized.
|
||||
param set-default COM_FLTMODE_BOOT 15
|
||||
|
||||
# ESC telemetry on the ESC connector (USART1, RX only): 401 = EXT2 port.
|
||||
param set-default DSHOT_TEL_CFG 401
|
||||
|
||||
# Heater (PE3) is supported but off by default. Set SENS_EN_THERMAL to 1 to enable it.
|
||||
param set-default SENS_EN_THERMAL 0
|
||||
# Heater target temperature (degC).
|
||||
param set-default HEATER1_TEMP 45
|
||||
|
||||
# Start all populated NeoPixels; PB10 is not exposed as a motor output.
|
||||
neopixel start
|
||||
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Start the SPI1 SW7456-compatible analog OSD when configured.
|
||||
if ! param compare OSD_ATXXXX_CFG 0
|
||||
then
|
||||
atxxxx start -s
|
||||
fi
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
# ICM-42688-P on SPI4, 32 kHz external clock on PD14.
|
||||
# Rotation 6 = ROTATION_YAW_270. The chip sits rotated 90 degrees in yaw
|
||||
# relative to the LSM6DSK320X on the PCB. The driver already flips y & z,
|
||||
# so only the mounting rotation belongs here.
|
||||
icm42688p -R 6 -C 32000 -s -b 4 start
|
||||
|
||||
# LSM6DSK320X (lsm6dsv driver) on SPI2.
|
||||
# Rotation 0 = ROTATION_NONE. Like the ICM-42688-P driver, this driver flips
|
||||
# y & z, and the chip is aligned with the board axes.
|
||||
lsm6dsv -R 0 -s -b 2 start
|
||||
|
||||
# DPS368 on internal I2C1 at 0x77; the DPS310 driver supports this variant.
|
||||
dps310 -I -b 1 -a 119 -8 start
|
||||
|
||||
# IST8310 on internal I2C1 at 0x0c.
|
||||
# Rotation 6 = ROTATION_YAW_270. The driver already flips z.
|
||||
ist8310 -I -b 1 -a 12 -R 6 start
|
||||
|
||||
board_adc start
|
||||
@@ -0,0 +1,94 @@
|
||||
#
|
||||
# This file is autogenerated: PLEASE DO NOT EDIT IT.
|
||||
#
|
||||
# You can use "make menuconfig" to make any modifications to the installed .config file.
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
# CONFIG_DEV_CONSOLE is not set
|
||||
# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set
|
||||
# CONFIG_SPI_EXCHANGE is not set
|
||||
# CONFIG_STM32H7_SYSCFG is not set
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD_CUSTOM=y
|
||||
CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/accton-godwit/gfh7/nuttx-config"
|
||||
CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
|
||||
CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
|
||||
CONFIG_ARCH_CHIP="stm32h7"
|
||||
CONFIG_ARCH_CHIP_STM32H753VI=y
|
||||
CONFIG_ARCH_CHIP_STM32H7=y
|
||||
CONFIG_ARCH_INTERRUPTSTACK=768
|
||||
CONFIG_ARMV7M_BASEPRI_WAR=y
|
||||
CONFIG_ARMV7M_ICACHE=y
|
||||
CONFIG_ARMV7M_MEMCPY=y
|
||||
CONFIG_ARMV7M_USEBASEPRI=y
|
||||
CONFIG_BOARDCTL=y
|
||||
CONFIG_BOARDCTL_RESET=y
|
||||
CONFIG_BOARD_ASSERT_RESET_VALUE=0
|
||||
CONFIG_BOARD_INITTHREAD_PRIORITY=254
|
||||
CONFIG_BOARD_LATE_INITIALIZE=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=22114
|
||||
CONFIG_BOARD_RESET_ON_ASSERT=2
|
||||
CONFIG_CDCACM=y
|
||||
CONFIG_CDCACM_IFLOWCONTROL=y
|
||||
CONFIG_CDCACM_PRODUCTID=0x1BD2
|
||||
CONFIG_CDCACM_PRODUCTSTR="PX4 BL Accton GFH7"
|
||||
CONFIG_CDCACM_RXBUFSIZE=600
|
||||
CONFIG_CDCACM_TXBUFSIZE=12000
|
||||
CONFIG_CDCACM_VENDORID=0x083A
|
||||
CONFIG_CDCACM_VENDORSTR="Accton"
|
||||
CONFIG_DEBUG_FULLOPT=y
|
||||
CONFIG_DEBUG_SYMBOLS=y
|
||||
CONFIG_DEBUG_TCBINFO=y
|
||||
CONFIG_DEFAULT_SMALL=y
|
||||
CONFIG_EXPERIMENTAL=y
|
||||
CONFIG_FDCLONE_DISABLE=y
|
||||
CONFIG_FDCLONE_STDIO=y
|
||||
CONFIG_FILE_STREAM=y
|
||||
CONFIG_HAVE_CXX=y
|
||||
CONFIG_HAVE_CXXINITIALIZE=y
|
||||
CONFIG_IDLETHREAD_STACKSIZE=750
|
||||
CONFIG_INIT_ENTRYPOINT="bootloader_main"
|
||||
CONFIG_INIT_STACKSIZE=3194
|
||||
CONFIG_LIBC_FLOATINGPOINT=y
|
||||
CONFIG_LIBC_LONG_LONG=y
|
||||
CONFIG_LIBC_STRERROR=y
|
||||
CONFIG_MEMSET_64BIT=y
|
||||
CONFIG_MEMSET_OPTSPEED=y
|
||||
CONFIG_PREALLOC_TIMERS=50
|
||||
CONFIG_PTHREAD_STACK_MIN=512
|
||||
CONFIG_RAM_SIZE=245760
|
||||
CONFIG_RAM_START=0x20010000
|
||||
CONFIG_RAW_BINARY=y
|
||||
CONFIG_SERIAL_TERMIOS=y
|
||||
CONFIG_SIG_DEFAULT=y
|
||||
CONFIG_SIG_SIGALRM_ACTION=y
|
||||
CONFIG_SIG_SIGUSR1_ACTION=y
|
||||
CONFIG_SIG_SIGUSR2_ACTION=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_STACK_COLORATION=y
|
||||
CONFIG_START_DAY=30
|
||||
CONFIG_START_MONTH=11
|
||||
CONFIG_STDIO_BUFFER_SIZE=32
|
||||
CONFIG_STM32H7_BKPSRAM=y
|
||||
CONFIG_STM32H7_DMA1=y
|
||||
CONFIG_STM32H7_DMA2=y
|
||||
CONFIG_STM32H7_OTGFS=y
|
||||
CONFIG_STM32H7_PROGMEM=y
|
||||
CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y
|
||||
CONFIG_STM32H7_TIM1=y
|
||||
CONFIG_STM32H7_UART7=y
|
||||
CONFIG_SYSTEMTICK_HOOK=y
|
||||
CONFIG_SYSTEM_CDCACM=y
|
||||
CONFIG_TASK_NAME_SIZE=24
|
||||
CONFIG_TTY_SIGINT=y
|
||||
CONFIG_TTY_SIGINT_CHAR=0x03
|
||||
CONFIG_TTY_SIGTSTP=y
|
||||
CONFIG_UART7_RXBUFSIZE=512
|
||||
CONFIG_UART7_RXDMA=y
|
||||
CONFIG_UART7_TXBUFSIZE=512
|
||||
CONFIG_UART7_TXDMA=y
|
||||
CONFIG_USBDEV=y
|
||||
CONFIG_USBDEV_BUSPOWERED=y
|
||||
CONFIG_USBDEV_MAXPOWER=500
|
||||
CONFIG_USEC_PER_TICK=1000
|
||||
@@ -0,0 +1,259 @@
|
||||
#
|
||||
# This file is autogenerated: PLEASE DO NOT EDIT IT.
|
||||
#
|
||||
# You can use "make menuconfig" to make any modifications to the installed .config file.
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
# CONFIG_DISABLE_ENVIRON is not set
|
||||
# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set
|
||||
# CONFIG_DISABLE_PTHREAD is not set
|
||||
# CONFIG_FS_PROCFS_EXCLUDE_BLOCKS is not set
|
||||
# CONFIG_FS_PROCFS_EXCLUDE_MEMINFO is not set
|
||||
# CONFIG_FS_PROCFS_EXCLUDE_MOUNT is not set
|
||||
# CONFIG_FS_PROCFS_EXCLUDE_USAGE is not set
|
||||
# CONFIG_LIBC_GAISTRERROR_ERRNUM is not set
|
||||
# CONFIG_LIBC_STRFTIME_C_STANDARD_FORMATS is not set
|
||||
# CONFIG_LIBC_STRFTIME_NONSTANDARD_FORMATS is not set
|
||||
# CONFIG_MMCSD_HAVE_CARDDETECT is not set
|
||||
# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set
|
||||
# CONFIG_MMCSD_IOCSUPPORT is not set
|
||||
# CONFIG_MMCSD_MMCSUPPORT is not set
|
||||
# CONFIG_MMCSD_SPI is not set
|
||||
# CONFIG_NSH_DISABLEBG is not set
|
||||
# CONFIG_NSH_DISABLESCRIPT is not set
|
||||
# CONFIG_NSH_DISABLE_ARP is not set
|
||||
# CONFIG_NSH_DISABLE_CAT is not set
|
||||
# CONFIG_NSH_DISABLE_CD is not set
|
||||
# CONFIG_NSH_DISABLE_CP is not set
|
||||
# CONFIG_NSH_DISABLE_DATE is not set
|
||||
# CONFIG_NSH_DISABLE_DF is not set
|
||||
# CONFIG_NSH_DISABLE_ECHO is not set
|
||||
# CONFIG_NSH_DISABLE_ENV is not set
|
||||
# CONFIG_NSH_DISABLE_ERROR_PRINT is not set
|
||||
# CONFIG_NSH_DISABLE_EXEC is not set
|
||||
# CONFIG_NSH_DISABLE_EXIT is not set
|
||||
# CONFIG_NSH_DISABLE_EXPORT is not set
|
||||
# CONFIG_NSH_DISABLE_FREE is not set
|
||||
# CONFIG_NSH_DISABLE_GET is not set
|
||||
# CONFIG_NSH_DISABLE_IFCONFIG is not set
|
||||
# CONFIG_NSH_DISABLE_IFUPDOWN is not set
|
||||
# CONFIG_NSH_DISABLE_ITEF is not set
|
||||
# CONFIG_NSH_DISABLE_KILL is not set
|
||||
# CONFIG_NSH_DISABLE_LOOPS is not set
|
||||
# CONFIG_NSH_DISABLE_LS is not set
|
||||
# CONFIG_NSH_DISABLE_MKDIR is not set
|
||||
# CONFIG_NSH_DISABLE_MKFATFS is not set
|
||||
# CONFIG_NSH_DISABLE_MOUNT is not set
|
||||
# CONFIG_NSH_DISABLE_MV is not set
|
||||
# CONFIG_NSH_DISABLE_PRINTF is not set
|
||||
# CONFIG_NSH_DISABLE_PS is not set
|
||||
# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set
|
||||
# CONFIG_NSH_DISABLE_PWD is not set
|
||||
# CONFIG_NSH_DISABLE_RM is not set
|
||||
# CONFIG_NSH_DISABLE_RMDIR is not set
|
||||
# CONFIG_NSH_DISABLE_SEMICOLON is not set
|
||||
# CONFIG_NSH_DISABLE_SET is not set
|
||||
# CONFIG_NSH_DISABLE_SLEEP is not set
|
||||
# CONFIG_NSH_DISABLE_SOURCE is not set
|
||||
# CONFIG_NSH_DISABLE_TEST is not set
|
||||
# CONFIG_NSH_DISABLE_TIME is not set
|
||||
# CONFIG_NSH_DISABLE_UMOUNT is not set
|
||||
# CONFIG_NSH_DISABLE_UNSET is not set
|
||||
# CONFIG_NSH_DISABLE_USLEEP is not set
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD_CUSTOM=y
|
||||
CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/accton-godwit/gfh7/nuttx-config"
|
||||
CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
|
||||
CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
|
||||
CONFIG_ARCH_CHIP="stm32h7"
|
||||
CONFIG_ARCH_CHIP_STM32H753VI=y
|
||||
CONFIG_ARCH_CHIP_STM32H7=y
|
||||
CONFIG_ARCH_CHIP_STM32H7_CORTEXM7=y
|
||||
CONFIG_ARCH_INTERRUPTSTACK=768
|
||||
CONFIG_ARCH_STACKDUMP=y
|
||||
CONFIG_ARMV7M_BASEPRI_WAR=y
|
||||
CONFIG_ARMV7M_DCACHE=y
|
||||
CONFIG_ARMV7M_DTCM=y
|
||||
CONFIG_ARMV7M_ICACHE=y
|
||||
CONFIG_ARMV7M_MEMCPY=y
|
||||
CONFIG_ARM_MPU_EARLY_RESET=y
|
||||
CONFIG_BOARDCTL_RESET=y
|
||||
CONFIG_BOARD_ASSERT_RESET_VALUE=0
|
||||
CONFIG_BOARD_CRASHDUMP_CUSTOM=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=95150
|
||||
CONFIG_BOARD_RESET_ON_ASSERT=2
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_CDCACM=y
|
||||
CONFIG_CDCACM_IFLOWCONTROL=y
|
||||
CONFIG_CDCACM_PRODUCTID=0x1BD2
|
||||
CONFIG_CDCACM_PRODUCTSTR="PX4 Accton GFH7"
|
||||
CONFIG_CDCACM_RXBUFSIZE=600
|
||||
CONFIG_CDCACM_TXBUFSIZE=12000
|
||||
CONFIG_CDCACM_VENDORID=0x083A
|
||||
CONFIG_CDCACM_VENDORSTR="Accton"
|
||||
CONFIG_DEBUG_FULLOPT=y
|
||||
CONFIG_DEBUG_HARDFAULT_ALERT=y
|
||||
CONFIG_DEBUG_MEMFAULT=y
|
||||
CONFIG_DEBUG_SYMBOLS=y
|
||||
CONFIG_DEFAULT_SMALL=y
|
||||
CONFIG_DEV_FIFO_SIZE=0
|
||||
CONFIG_DEV_PIPE_MAXSIZE=1024
|
||||
CONFIG_DEV_PIPE_SIZE=70
|
||||
CONFIG_ETC_CROMFS=y
|
||||
CONFIG_ETC_ROMFS=y
|
||||
CONFIG_ETC_ROMFSSECTSIZE=128
|
||||
CONFIG_EXPERIMENTAL=y
|
||||
CONFIG_FAT_DMAMEMORY=y
|
||||
CONFIG_FAT_LCNAMES=y
|
||||
CONFIG_FAT_LFN=y
|
||||
CONFIG_FAT_LFN_ALIAS_HASH=y
|
||||
CONFIG_FDCLONE_STDIO=y
|
||||
CONFIG_FILE_STREAM=y
|
||||
CONFIG_FS_BINFS=y
|
||||
CONFIG_FS_CROMFS=y
|
||||
CONFIG_FS_FAT=y
|
||||
CONFIG_FS_FATTIME=y
|
||||
CONFIG_FS_LARGEFILE=y
|
||||
CONFIG_FS_PROCFS=y
|
||||
CONFIG_FS_PROCFS_REGISTER=y
|
||||
CONFIG_GRAN=y
|
||||
CONFIG_GRAN_INTR=y
|
||||
CONFIG_HAVE_CXX=y
|
||||
CONFIG_HAVE_CXXINITIALIZE=y
|
||||
CONFIG_I2C=y
|
||||
CONFIG_I2C_RESET=y
|
||||
CONFIG_IDLETHREAD_STACKSIZE=750
|
||||
CONFIG_INIT_ENTRYPOINT="nsh_main"
|
||||
CONFIG_INIT_STACKSIZE=3194
|
||||
CONFIG_LIBC_FLOATINGPOINT=y
|
||||
CONFIG_LIBC_LONG_LONG=y
|
||||
CONFIG_LIBC_MAX_EXITFUNS=1
|
||||
CONFIG_LIBC_STRERROR=y
|
||||
CONFIG_LIBC_STRERROR_SHORT=y
|
||||
CONFIG_LIBM_TOOLCHAIN=y
|
||||
CONFIG_LINE_MAX=128
|
||||
CONFIG_MMCSD=y
|
||||
CONFIG_MMCSD_SDIO=y
|
||||
CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y
|
||||
CONFIG_MM_REGIONS=4
|
||||
CONFIG_MTD=y
|
||||
CONFIG_MTD_BYTE_WRITE=y
|
||||
CONFIG_MTD_PARTITION=y
|
||||
CONFIG_MTD_PROGMEM=y
|
||||
CONFIG_NAME_MAX=40
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
CONFIG_NSH_ARGCAT=y
|
||||
CONFIG_NSH_BUILTIN_APPS=y
|
||||
CONFIG_NSH_MAXARGUMENTS=15
|
||||
CONFIG_NSH_NESTDEPTH=8
|
||||
CONFIG_NSH_QUOTE=y
|
||||
CONFIG_NSH_STRERROR=y
|
||||
CONFIG_NSH_VARS=y
|
||||
CONFIG_OTG_ID_GPIO_DISABLE=y
|
||||
CONFIG_PIPES=y
|
||||
CONFIG_PRIORITY_INHERITANCE=y
|
||||
CONFIG_PTHREAD_MUTEX_ROBUST=y
|
||||
CONFIG_PTHREAD_MUTEX_TYPES=y
|
||||
CONFIG_PTHREAD_STACK_MIN=512
|
||||
CONFIG_RAM_SIZE=245760
|
||||
CONFIG_RAM_START=0x20010000
|
||||
CONFIG_RAW_BINARY=y
|
||||
CONFIG_READLINE_CMD_HISTORY=y
|
||||
CONFIG_READLINE_TABCOMPLETION=y
|
||||
CONFIG_RTC_DATETIME=y
|
||||
CONFIG_SCHED_HPWORK=y
|
||||
CONFIG_SCHED_HPWORKPRIORITY=249
|
||||
CONFIG_SCHED_HPWORKSTACKSIZE=1280
|
||||
CONFIG_SCHED_INSTRUMENTATION=y
|
||||
CONFIG_SCHED_INSTRUMENTATION_SWITCH=y
|
||||
CONFIG_SCHED_LPWORK=y
|
||||
CONFIG_SCHED_LPWORKPRIORITY=50
|
||||
CONFIG_SCHED_LPWORKSTACKSIZE=1632
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
CONFIG_SDMMC2_SDIO_PULLUP=y
|
||||
CONFIG_SEM_PREALLOCHOLDERS=32
|
||||
CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y
|
||||
CONFIG_SERIAL_TERMIOS=y
|
||||
CONFIG_SIG_DEFAULT=y
|
||||
CONFIG_SIG_SIGALRM_ACTION=y
|
||||
CONFIG_SIG_SIGUSR1_ACTION=y
|
||||
CONFIG_SIG_SIGUSR2_ACTION=y
|
||||
CONFIG_STACK_COLORATION=y
|
||||
CONFIG_START_DAY=30
|
||||
CONFIG_START_MONTH=11
|
||||
CONFIG_STDIO_BUFFER_SIZE=256
|
||||
CONFIG_STM32H7_ADC1=y
|
||||
CONFIG_STM32H7_ADC3=y
|
||||
CONFIG_STM32H7_BBSRAM=y
|
||||
CONFIG_STM32H7_BBSRAM_FILES=5
|
||||
CONFIG_STM32H7_BDMA=y
|
||||
CONFIG_STM32H7_BKPSRAM=y
|
||||
CONFIG_STM32H7_DMA1=y
|
||||
CONFIG_STM32H7_DMA2=y
|
||||
CONFIG_STM32H7_DMACAPABLE=y
|
||||
CONFIG_STM32H7_I2C1=y
|
||||
CONFIG_STM32H7_I2C4=y
|
||||
CONFIG_STM32H7_I2C_DYNTIMEO=y
|
||||
CONFIG_STM32H7_I2C_DYNTIMEO_STARTSTOP=10
|
||||
CONFIG_STM32H7_OTGFS=y
|
||||
CONFIG_STM32H7_PROGMEM=y
|
||||
CONFIG_STM32H7_RTC=y
|
||||
CONFIG_STM32H7_RTC_HSECLOCK=y
|
||||
CONFIG_STM32H7_RTC_MAGIC_REG=1
|
||||
CONFIG_STM32H7_SAVE_CRASHDUMP=y
|
||||
CONFIG_STM32H7_SDMMC2=y
|
||||
CONFIG_STM32H7_SERIALBRK_BSDCOMPAT=y
|
||||
CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y
|
||||
CONFIG_STM32H7_SPI1=y
|
||||
CONFIG_STM32H7_SPI1_DMA=y
|
||||
CONFIG_STM32H7_SPI1_DMA_BUFFER=1024
|
||||
CONFIG_STM32H7_SPI2=y
|
||||
CONFIG_STM32H7_SPI2_DMA=y
|
||||
CONFIG_STM32H7_SPI2_DMA_BUFFER=1024
|
||||
CONFIG_STM32H7_SPI4=y
|
||||
CONFIG_STM32H7_SPI4_DMA=y
|
||||
CONFIG_STM32H7_SPI4_DMA_BUFFER=1024
|
||||
CONFIG_STM32H7_UART4=y
|
||||
CONFIG_STM32H7_UART5=y
|
||||
CONFIG_STM32H7_UART7=y
|
||||
CONFIG_STM32H7_UART8=y
|
||||
CONFIG_STM32H7_USART1=y
|
||||
CONFIG_STM32H7_USART2=y
|
||||
CONFIG_STM32H7_USART3=y
|
||||
CONFIG_STM32H7_USART_BREAKS=y
|
||||
CONFIG_STM32H7_USART_INVERT=y
|
||||
CONFIG_STM32H7_USART_SINGLEWIRE=y
|
||||
CONFIG_STM32H7_USART_SWAP=y
|
||||
CONFIG_SYSTEM_CDCACM=y
|
||||
CONFIG_SYSTEM_NSH=y
|
||||
CONFIG_TASK_NAME_SIZE=24
|
||||
CONFIG_TTY_SIGINT=y
|
||||
CONFIG_TTY_SIGTSTP=y
|
||||
CONFIG_UART4_BAUD=57600
|
||||
CONFIG_UART4_SERIAL_CONSOLE=y
|
||||
CONFIG_UART4_RXBUFSIZE=600
|
||||
CONFIG_UART4_TXBUFSIZE=1500
|
||||
CONFIG_UART5_BAUD=57600
|
||||
CONFIG_UART5_RXBUFSIZE=600
|
||||
CONFIG_UART5_TXBUFSIZE=1500
|
||||
CONFIG_UART7_BAUD=57600
|
||||
CONFIG_UART7_RXBUFSIZE=600
|
||||
CONFIG_UART7_TXBUFSIZE=1500
|
||||
CONFIG_UART8_BAUD=57600
|
||||
CONFIG_UART8_RXBUFSIZE=600
|
||||
CONFIG_UART8_TXBUFSIZE=1500
|
||||
CONFIG_USART1_BAUD=57600
|
||||
CONFIG_USART1_RXBUFSIZE=600
|
||||
CONFIG_USART1_TXBUFSIZE=32
|
||||
CONFIG_USART2_BAUD=57600
|
||||
CONFIG_USART2_RXBUFSIZE=600
|
||||
CONFIG_USART2_TXBUFSIZE=1500
|
||||
CONFIG_USART3_BAUD=57600
|
||||
CONFIG_USART3_RXBUFSIZE=600
|
||||
CONFIG_USART3_TXBUFSIZE=1500
|
||||
CONFIG_USBDEV=y
|
||||
CONFIG_USBDEV_BUSPOWERED=y
|
||||
CONFIG_USBDEV_MAXPOWER=500
|
||||
CONFIG_USEC_PER_TICK=1000
|
||||
CONFIG_WATCHDOG=y
|
||||
@@ -0,0 +1,384 @@
|
||||
/************************************************************************************
|
||||
*
|
||||
* Copyright (C) 2026 Accton Technology Corporation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
#pragma once
|
||||
|
||||
#include "board_dma_map.h"
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
#include "stm32_rcc.h"
|
||||
#include "stm32_sdmmc.h"
|
||||
|
||||
/* Clocking *************************************************************************/
|
||||
/* The Accton Godwit GFH7 provides the following clock sources:
|
||||
*
|
||||
* X1: 16 MHz crystal for HSE
|
||||
*
|
||||
* So we have these clock source available within the STM32
|
||||
*
|
||||
* HSI: 16 MHz RC factory-trimmed
|
||||
* HSE: 16 MHz crystal for HSE
|
||||
*/
|
||||
|
||||
#define STM32_BOARD_XTAL 16000000ul
|
||||
|
||||
#define STM32_HSI_FREQUENCY 16000000ul
|
||||
#define STM32_LSI_FREQUENCY 32000
|
||||
#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL
|
||||
#define STM32_LSE_FREQUENCY 32768
|
||||
|
||||
/* Main PLL Configuration.
|
||||
*
|
||||
* PLL source is HSE = 16,000,000
|
||||
*
|
||||
* PLL_VCOx = (STM32_HSE_FREQUENCY / PLLM) * PLLN
|
||||
* Subject to:
|
||||
*
|
||||
* 1 <= PLLM <= 63
|
||||
* 4 <= PLLN <= 512
|
||||
* 150 MHz <= PLL_VCOL <= 420MHz
|
||||
* 192 MHz <= PLL_VCOH <= 836MHz
|
||||
*
|
||||
* SYSCLK = PLL_VCO / PLLP
|
||||
* CPUCLK = SYSCLK / D1CPRE
|
||||
* Subject to
|
||||
*
|
||||
* PLLP1 = {2, 4, 6, 8, ..., 128}
|
||||
* PLLP2,3 = {2, 3, 4, ..., 128}
|
||||
* CPUCLK <= 480 MHz
|
||||
*/
|
||||
|
||||
#define STM32_BOARD_USEHSE
|
||||
|
||||
#define STM32_PLLCFG_PLLSRC RCC_PLLCKSELR_PLLSRC_HSE
|
||||
|
||||
/* PLL1, wide 4 - 8 MHz input, enable DIVP, DIVQ, DIVR
|
||||
*
|
||||
* PLL1_VCO = (16,000,000 / 1) * 60 = 960 MHz
|
||||
*
|
||||
* PLL1P = PLL1_VCO/2 = 960 MHz / 2 = 480 MHz
|
||||
* PLL1Q = PLL1_VCO/4 = 960 MHz / 4 = 240 MHz
|
||||
* PLL1R = PLL1_VCO/8 = 960 MHz / 8 = 120 MHz
|
||||
*/
|
||||
|
||||
#define STM32_PLLCFG_PLL1CFG (RCC_PLLCFGR_PLL1VCOSEL_WIDE | \
|
||||
RCC_PLLCFGR_PLL1RGE_4_8_MHZ | \
|
||||
RCC_PLLCFGR_DIVP1EN | \
|
||||
RCC_PLLCFGR_DIVQ1EN | \
|
||||
RCC_PLLCFGR_DIVR1EN)
|
||||
#define STM32_PLLCFG_PLL1M RCC_PLLCKSELR_DIVM1(1)
|
||||
#define STM32_PLLCFG_PLL1N RCC_PLL1DIVR_N1(60)
|
||||
#define STM32_PLLCFG_PLL1P RCC_PLL1DIVR_P1(2)
|
||||
#define STM32_PLLCFG_PLL1Q RCC_PLL1DIVR_Q1(4)
|
||||
#define STM32_PLLCFG_PLL1R RCC_PLL1DIVR_R1(8)
|
||||
|
||||
#define STM32_VCO1_FREQUENCY ((STM32_HSE_FREQUENCY / 1) * 60)
|
||||
#define STM32_PLL1P_FREQUENCY (STM32_VCO1_FREQUENCY / 2)
|
||||
#define STM32_PLL1Q_FREQUENCY (STM32_VCO1_FREQUENCY / 4)
|
||||
#define STM32_PLL1R_FREQUENCY (STM32_VCO1_FREQUENCY / 8)
|
||||
|
||||
/* PLL2 */
|
||||
|
||||
#define STM32_PLLCFG_PLL2CFG (RCC_PLLCFGR_PLL2VCOSEL_WIDE | \
|
||||
RCC_PLLCFGR_PLL2RGE_4_8_MHZ | \
|
||||
RCC_PLLCFGR_DIVP2EN | \
|
||||
RCC_PLLCFGR_DIVQ2EN | \
|
||||
RCC_PLLCFGR_DIVR2EN)
|
||||
#define STM32_PLLCFG_PLL2M RCC_PLLCKSELR_DIVM2(4)
|
||||
#define STM32_PLLCFG_PLL2N RCC_PLL2DIVR_N2(48)
|
||||
#define STM32_PLLCFG_PLL2P RCC_PLL2DIVR_P2(2)
|
||||
#define STM32_PLLCFG_PLL2Q RCC_PLL2DIVR_Q2(2)
|
||||
#define STM32_PLLCFG_PLL2R RCC_PLL2DIVR_R2(2)
|
||||
|
||||
#define STM32_VCO2_FREQUENCY ((STM32_HSE_FREQUENCY / 4) * 48)
|
||||
#define STM32_PLL2P_FREQUENCY (STM32_VCO2_FREQUENCY / 2)
|
||||
#define STM32_PLL2Q_FREQUENCY (STM32_VCO2_FREQUENCY / 2)
|
||||
#define STM32_PLL2R_FREQUENCY (STM32_VCO2_FREQUENCY / 2)
|
||||
|
||||
/* PLL3 */
|
||||
|
||||
#define STM32_PLLCFG_PLL3CFG (RCC_PLLCFGR_PLL3VCOSEL_WIDE | \
|
||||
RCC_PLLCFGR_PLL3RGE_4_8_MHZ | \
|
||||
RCC_PLLCFGR_DIVQ3EN)
|
||||
#define STM32_PLLCFG_PLL3M RCC_PLLCKSELR_DIVM3(4)
|
||||
#define STM32_PLLCFG_PLL3N RCC_PLL3DIVR_N3(48)
|
||||
#define STM32_PLLCFG_PLL3P RCC_PLL3DIVR_P3(2)
|
||||
#define STM32_PLLCFG_PLL3Q RCC_PLL3DIVR_Q3(4)
|
||||
#define STM32_PLLCFG_PLL3R RCC_PLL3DIVR_R3(2)
|
||||
|
||||
#define STM32_VCO3_FREQUENCY ((STM32_HSE_FREQUENCY / 4) * 48)
|
||||
#define STM32_PLL3P_FREQUENCY (STM32_VCO3_FREQUENCY / 2)
|
||||
#define STM32_PLL3Q_FREQUENCY (STM32_VCO3_FREQUENCY / 4)
|
||||
#define STM32_PLL3R_FREQUENCY (STM32_VCO3_FREQUENCY / 2)
|
||||
|
||||
/* SYSCLK = PLL1P = 480MHz
|
||||
* CPUCLK = SYSCLK / 1 = 480 MHz
|
||||
*/
|
||||
|
||||
#define STM32_RCC_D1CFGR_D1CPRE (RCC_D1CFGR_D1CPRE_SYSCLK)
|
||||
#define STM32_SYSCLK_FREQUENCY (STM32_PLL1P_FREQUENCY)
|
||||
#define STM32_CPUCLK_FREQUENCY (STM32_SYSCLK_FREQUENCY / 1)
|
||||
|
||||
/* Configure Clock Assignments */
|
||||
|
||||
/* AHB clock (HCLK) is SYSCLK/2 (240 MHz max)
|
||||
* HCLK1 = HCLK2 = HCLK3 = HCLK4 = 240
|
||||
*/
|
||||
|
||||
#define STM32_RCC_D1CFGR_HPRE RCC_D1CFGR_HPRE_SYSCLKd2 /* HCLK = SYSCLK / 2 */
|
||||
#define STM32_ACLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* ACLK in D1, HCLK3 in D1 */
|
||||
#define STM32_HCLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* HCLK in D2, HCLK4 in D3 */
|
||||
#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */
|
||||
|
||||
/* APB1 clock (PCLK1) is HCLK/2 (120 MHz) */
|
||||
|
||||
#define STM32_RCC_D2CFGR_D2PPRE1 RCC_D2CFGR_D2PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */
|
||||
#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2)
|
||||
|
||||
/* APB2 clock (PCLK2) is HCLK/2 (120 MHz) */
|
||||
|
||||
#define STM32_RCC_D2CFGR_D2PPRE2 RCC_D2CFGR_D2PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */
|
||||
#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2)
|
||||
|
||||
/* APB3 clock (PCLK3) is HCLK/2 (120 MHz) */
|
||||
|
||||
#define STM32_RCC_D1CFGR_D1PPRE RCC_D1CFGR_D1PPRE_HCLKd2 /* PCLK3 = HCLK / 2 */
|
||||
#define STM32_PCLK3_FREQUENCY (STM32_HCLK_FREQUENCY/2)
|
||||
|
||||
/* APB4 clock (PCLK4) is HCLK/2 (120 MHz) */
|
||||
|
||||
#define STM32_RCC_D3CFGR_D3PPRE RCC_D3CFGR_D3PPRE_HCLKd2 /* PCLK4 = HCLK / 2 */
|
||||
#define STM32_PCLK4_FREQUENCY (STM32_HCLK_FREQUENCY/2)
|
||||
|
||||
/* Timer clock frequencies */
|
||||
|
||||
/* Timers driven from APB1 will be twice PCLK1 */
|
||||
|
||||
#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
||||
#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
||||
#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
||||
#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
||||
#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
||||
#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
||||
#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
||||
#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
||||
#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
||||
|
||||
/* Timers driven from APB2 will be twice PCLK2 */
|
||||
|
||||
#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY)
|
||||
#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY)
|
||||
#define STM32_APB2_TIM15_CLKIN (2*STM32_PCLK2_FREQUENCY)
|
||||
#define STM32_APB2_TIM16_CLKIN (2*STM32_PCLK2_FREQUENCY)
|
||||
#define STM32_APB2_TIM17_CLKIN (2*STM32_PCLK2_FREQUENCY)
|
||||
|
||||
/* Kernel Clock Configuration */
|
||||
|
||||
/* I2C123 clock source */
|
||||
|
||||
#define STM32_RCC_D2CCIP2R_I2C123SRC RCC_D2CCIP2R_I2C123SEL_HSI
|
||||
|
||||
/* I2C4 clock source */
|
||||
|
||||
#define STM32_RCC_D3CCIPR_I2C4SRC RCC_D3CCIPR_I2C4SEL_HSI
|
||||
|
||||
/* SPI123 clock source */
|
||||
|
||||
#define STM32_RCC_D2CCIP1R_SPI123SRC RCC_D2CCIP1R_SPI123SEL_PLL2
|
||||
|
||||
/* SPI45 clock source */
|
||||
|
||||
#define STM32_RCC_D2CCIP1R_SPI45SRC RCC_D2CCIP1R_SPI45SEL_PLL2
|
||||
|
||||
/* SPI6 clock source */
|
||||
|
||||
#define STM32_RCC_D3CCIPR_SPI6SRC RCC_D3CCIPR_SPI6SEL_PLL2
|
||||
|
||||
/* USB 1 and 2 clock source */
|
||||
|
||||
#define STM32_RCC_D2CCIP2R_USBSRC RCC_D2CCIP2R_USBSEL_PLL3
|
||||
|
||||
/* ADC 1 2 3 clock source */
|
||||
|
||||
#define STM32_RCC_D3CCIPR_ADCSRC RCC_D3CCIPR_ADCSEL_PLL2
|
||||
|
||||
/* FDCAN 1 2 clock source */
|
||||
|
||||
#define STM32_RCC_D2CCIP1R_FDCANSEL RCC_D2CCIP1R_FDCANSEL_HSE
|
||||
|
||||
#define STM32_FDCANCLK STM32_HSE_FREQUENCY
|
||||
|
||||
/* FLASH wait states */
|
||||
|
||||
#define BOARD_FLASH_WAITSTATES 2
|
||||
|
||||
/* SDMMC definitions ********************************************************/
|
||||
|
||||
/* Init 400kHz, freq = PLL1Q/(2*div) div = PLL1Q/(2*freq) */
|
||||
|
||||
#define STM32_SDMMC_INIT_CLKDIV (300 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT)
|
||||
|
||||
/* 25 MHz Max for now, 25 mHZ = PLL1Q/(2*div), div = PLL1Q/(2*freq)
|
||||
* div = 4.8 = 240 / 50, So round up to 5 for default speed 24 MB/s
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA)
|
||||
# define STM32_SDMMC_MMCXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT)
|
||||
#else
|
||||
# define STM32_SDMMC_MMCXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT)
|
||||
#endif
|
||||
#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA)
|
||||
# define STM32_SDMMC_SDXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT)
|
||||
#else
|
||||
# define STM32_SDMMC_SDXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT)
|
||||
#endif
|
||||
|
||||
#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE
|
||||
|
||||
/* LED definitions ******************************************************************/
|
||||
|
||||
/* LED index values for use with board_userled() */
|
||||
|
||||
#define BOARD_LED1 0
|
||||
#define BOARD_LED2 1
|
||||
#define BOARD_NLEDS 2
|
||||
|
||||
#define BOARD_LED_GREEN BOARD_LED1
|
||||
#define BOARD_LED_BLUE BOARD_LED2
|
||||
|
||||
/* LED bits for use with board_userled_all() */
|
||||
|
||||
#define BOARD_LED1_BIT (1 << BOARD_LED1)
|
||||
#define BOARD_LED2_BIT (1 << BOARD_LED2)
|
||||
|
||||
/* If CONFIG_ARCH_LEDS is defined, the usage by the board port is defined in
|
||||
* include/board.h and src/stm32_leds.c. The LEDs are used to encode OS-related
|
||||
* events as follows:
|
||||
*/
|
||||
|
||||
#define LED_STARTED 0 /* NuttX has been started OFF */
|
||||
#define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF */
|
||||
#define LED_IRQSENABLED 2 /* Interrupts enabled OFF */
|
||||
#define LED_STACKCREATED 3 /* Idle stack created ON */
|
||||
#define LED_INIRQ 4 /* In an interrupt N/C */
|
||||
#define LED_SIGNAL 5 /* In a signal handler N/C */
|
||||
#define LED_ASSERTION 6 /* An assertion failed GLOW */
|
||||
#define LED_PANIC 7 /* The system has crashed Blink */
|
||||
#define LED_IDLE 8 /* MCU is in sleep mode ON */
|
||||
|
||||
/* Alternate function pin selections ************************************************/
|
||||
|
||||
#define GPIO_USART1_TX 0 /* RX-only ESC telemetry */
|
||||
#define GPIO_USART1_RX GPIO_USART1_RX_2 /* PA10 */
|
||||
|
||||
#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */
|
||||
#define GPIO_USART2_RX GPIO_USART2_RX_1 /* PA3 */
|
||||
|
||||
#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */
|
||||
#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */
|
||||
|
||||
#define GPIO_UART4_TX GPIO_UART4_TX_4 /* PC10 */
|
||||
#define GPIO_UART4_RX GPIO_UART4_RX_4 /* PC11 */
|
||||
|
||||
#define GPIO_UART5_TX GPIO_UART5_TX_2 /* PB6 */
|
||||
#define GPIO_UART5_RX GPIO_UART5_RX_3 /* PD2 */
|
||||
|
||||
#define GPIO_UART7_TX GPIO_UART7_TX_3 /* PE8 */
|
||||
#define GPIO_UART7_RX GPIO_UART7_RX_3 /* PE7 */
|
||||
|
||||
#define GPIO_UART8_TX GPIO_UART8_TX_1 /* PE1 */
|
||||
#define GPIO_UART8_RX GPIO_UART8_RX_1 /* PE0 */
|
||||
|
||||
/* CAN */
|
||||
|
||||
#define GPIO_CAN1_RX GPIO_CAN1_RX_3 /* PD0 */
|
||||
#define GPIO_CAN1_TX GPIO_CAN1_TX_3 /* PD1 */
|
||||
|
||||
/* SPI */
|
||||
|
||||
#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 /* PA5 */
|
||||
#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */
|
||||
#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_3 /* PD7 */
|
||||
|
||||
#define GPIO_SPI2_SCK GPIO_SPI2_SCK_5 /* PD3 */
|
||||
#define GPIO_SPI2_MISO GPIO_SPI2_MISO_2 /* PC2 */
|
||||
#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_3 /* PC3 */
|
||||
|
||||
#define GPIO_SPI4_SCK GPIO_SPI4_SCK_2 /* PE2 */
|
||||
#define GPIO_SPI4_MISO GPIO_SPI4_MISO_2 /* PE5 */
|
||||
#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_2 /* PE6 */
|
||||
|
||||
/* I2C */
|
||||
|
||||
#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 /* PB8 */
|
||||
#define GPIO_I2C1_SDA GPIO_I2C1_SDA_1 /* PB7 */
|
||||
|
||||
#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN8)
|
||||
#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN7)
|
||||
|
||||
#define GPIO_I2C4_SCL GPIO_I2C4_SCL_1 /* PD12 */
|
||||
#define GPIO_I2C4_SDA GPIO_I2C4_SDA_1 /* PD13 */
|
||||
|
||||
#define GPIO_I2C4_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTD | GPIO_PIN12)
|
||||
#define GPIO_I2C4_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTD | GPIO_PIN13)
|
||||
|
||||
/* SDMMC2
|
||||
*
|
||||
* SDMMC2_CK PD6
|
||||
* SDMMC2_CMD PA0
|
||||
* SDMMC2_D0 PB14
|
||||
* SDMMC2_D1 PB15
|
||||
* SDMMC2_D2 PB3
|
||||
* SDMMC2_D3 PB4
|
||||
*/
|
||||
|
||||
#define GPIO_SDMMC2_CK GPIO_SDMMC2_CK_1 /* PD6 */
|
||||
#define GPIO_SDMMC2_CMD GPIO_SDMMC2_CMD_2 /* PA0 */
|
||||
#define GPIO_SDMMC2_D2 GPIO_SDMMC2_D2_2 /* PB3 */
|
||||
|
||||
/* USB
|
||||
*
|
||||
* OTG_FS_DM PA11
|
||||
* OTG_FS_DP PA12
|
||||
* VBUS PA9 (not sensed, R114 not fitted)
|
||||
*/
|
||||
|
||||
/* Board provides GPIO or other Hardware for signaling to timing analyzer */
|
||||
|
||||
#define PROBE_INIT(mask)
|
||||
#define PROBE(n,s)
|
||||
#define PROBE_MARK(n)
|
||||
@@ -0,0 +1,46 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (C) 2026 Accton Technology Corporation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
// DMAMUX1
|
||||
|
||||
#define DMAMAP_SPI1_RX DMAMAP_DMA12_SPI1RX_1 /* DMA2: OSD */
|
||||
#define DMAMAP_SPI1_TX DMAMAP_DMA12_SPI1TX_1 /* DMA2: OSD */
|
||||
#define DMAMAP_SPI2_RX DMAMAP_DMA12_SPI2RX_1 /* DMA2: LSM6DSK320X */
|
||||
#define DMAMAP_SPI2_TX DMAMAP_DMA12_SPI2TX_1 /* DMA2: LSM6DSK320X */
|
||||
#define DMAMAP_SPI4_RX DMAMAP_DMA12_SPI4RX_1 /* DMA2 */
|
||||
#define DMAMAP_SPI4_TX DMAMAP_DMA12_SPI4TX_1 /* DMA2 */
|
||||
|
||||
#define DMAMAP_UART7_RX DMAMAP_DMA12_UART7RX_1 /* DMA2: TEL1 bootloader */
|
||||
#define DMAMAP_UART7_TX DMAMAP_DMA12_UART7TX_1 /* DMA2: TEL1 bootloader */
|
||||
@@ -0,0 +1,259 @@
|
||||
#
|
||||
# This file is autogenerated: PLEASE DO NOT EDIT IT.
|
||||
#
|
||||
# You can use "make menuconfig" to make any modifications to the installed .config file.
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
# CONFIG_DISABLE_ENVIRON is not set
|
||||
# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set
|
||||
# CONFIG_DISABLE_PTHREAD is not set
|
||||
# CONFIG_FS_PROCFS_EXCLUDE_BLOCKS is not set
|
||||
# CONFIG_FS_PROCFS_EXCLUDE_MEMINFO is not set
|
||||
# CONFIG_FS_PROCFS_EXCLUDE_MOUNT is not set
|
||||
# CONFIG_FS_PROCFS_EXCLUDE_USAGE is not set
|
||||
# CONFIG_LIBC_GAISTRERROR_ERRNUM is not set
|
||||
# CONFIG_LIBC_STRFTIME_C_STANDARD_FORMATS is not set
|
||||
# CONFIG_LIBC_STRFTIME_NONSTANDARD_FORMATS is not set
|
||||
# CONFIG_MMCSD_HAVE_CARDDETECT is not set
|
||||
# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set
|
||||
# CONFIG_MMCSD_IOCSUPPORT is not set
|
||||
# CONFIG_MMCSD_MMCSUPPORT is not set
|
||||
# CONFIG_MMCSD_SPI is not set
|
||||
# CONFIG_NSH_DISABLEBG is not set
|
||||
# CONFIG_NSH_DISABLESCRIPT is not set
|
||||
# CONFIG_NSH_DISABLE_ARP is not set
|
||||
# CONFIG_NSH_DISABLE_CAT is not set
|
||||
# CONFIG_NSH_DISABLE_CD is not set
|
||||
# CONFIG_NSH_DISABLE_CP is not set
|
||||
# CONFIG_NSH_DISABLE_DATE is not set
|
||||
# CONFIG_NSH_DISABLE_DF is not set
|
||||
# CONFIG_NSH_DISABLE_ECHO is not set
|
||||
# CONFIG_NSH_DISABLE_ENV is not set
|
||||
# CONFIG_NSH_DISABLE_ERROR_PRINT is not set
|
||||
# CONFIG_NSH_DISABLE_EXEC is not set
|
||||
# CONFIG_NSH_DISABLE_EXIT is not set
|
||||
# CONFIG_NSH_DISABLE_EXPORT is not set
|
||||
# CONFIG_NSH_DISABLE_FREE is not set
|
||||
# CONFIG_NSH_DISABLE_GET is not set
|
||||
# CONFIG_NSH_DISABLE_IFCONFIG is not set
|
||||
# CONFIG_NSH_DISABLE_IFUPDOWN is not set
|
||||
# CONFIG_NSH_DISABLE_ITEF is not set
|
||||
# CONFIG_NSH_DISABLE_KILL is not set
|
||||
# CONFIG_NSH_DISABLE_LOOPS is not set
|
||||
# CONFIG_NSH_DISABLE_LS is not set
|
||||
# CONFIG_NSH_DISABLE_MKDIR is not set
|
||||
# CONFIG_NSH_DISABLE_MKFATFS is not set
|
||||
# CONFIG_NSH_DISABLE_MOUNT is not set
|
||||
# CONFIG_NSH_DISABLE_MV is not set
|
||||
# CONFIG_NSH_DISABLE_PRINTF is not set
|
||||
# CONFIG_NSH_DISABLE_PS is not set
|
||||
# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set
|
||||
# CONFIG_NSH_DISABLE_PWD is not set
|
||||
# CONFIG_NSH_DISABLE_RM is not set
|
||||
# CONFIG_NSH_DISABLE_RMDIR is not set
|
||||
# CONFIG_NSH_DISABLE_SEMICOLON is not set
|
||||
# CONFIG_NSH_DISABLE_SET is not set
|
||||
# CONFIG_NSH_DISABLE_SLEEP is not set
|
||||
# CONFIG_NSH_DISABLE_SOURCE is not set
|
||||
# CONFIG_NSH_DISABLE_TEST is not set
|
||||
# CONFIG_NSH_DISABLE_TIME is not set
|
||||
# CONFIG_NSH_DISABLE_UMOUNT is not set
|
||||
# CONFIG_NSH_DISABLE_UNSET is not set
|
||||
# CONFIG_NSH_DISABLE_USLEEP is not set
|
||||
# CONFIG_DEV_CONSOLE is not set
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD_CUSTOM=y
|
||||
CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/accton-godwit/gfh7/nuttx-config"
|
||||
CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
|
||||
CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
|
||||
CONFIG_ARCH_CHIP="stm32h7"
|
||||
CONFIG_ARCH_CHIP_STM32H753VI=y
|
||||
CONFIG_ARCH_CHIP_STM32H7=y
|
||||
CONFIG_ARCH_CHIP_STM32H7_CORTEXM7=y
|
||||
CONFIG_ARCH_INTERRUPTSTACK=768
|
||||
CONFIG_ARCH_STACKDUMP=y
|
||||
CONFIG_ARMV7M_BASEPRI_WAR=y
|
||||
CONFIG_ARMV7M_DCACHE=y
|
||||
CONFIG_ARMV7M_DTCM=y
|
||||
CONFIG_ARMV7M_ICACHE=y
|
||||
CONFIG_ARMV7M_MEMCPY=y
|
||||
CONFIG_ARM_MPU_EARLY_RESET=y
|
||||
CONFIG_BOARDCTL_RESET=y
|
||||
CONFIG_BOARD_ASSERT_RESET_VALUE=0
|
||||
CONFIG_BOARD_CRASHDUMP_CUSTOM=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=95150
|
||||
CONFIG_BOARD_RESET_ON_ASSERT=2
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_CDCACM=y
|
||||
CONFIG_CDCACM_IFLOWCONTROL=y
|
||||
CONFIG_CDCACM_PRODUCTID=0x1BD2
|
||||
CONFIG_CDCACM_PRODUCTSTR="PX4 Accton GFH7"
|
||||
CONFIG_CDCACM_RXBUFSIZE=600
|
||||
CONFIG_CDCACM_TXBUFSIZE=12000
|
||||
CONFIG_CDCACM_VENDORID=0x083A
|
||||
CONFIG_CDCACM_VENDORSTR="Accton"
|
||||
CONFIG_DEBUG_FULLOPT=y
|
||||
CONFIG_DEBUG_HARDFAULT_ALERT=y
|
||||
CONFIG_DEBUG_MEMFAULT=y
|
||||
CONFIG_DEBUG_SYMBOLS=y
|
||||
CONFIG_DEFAULT_SMALL=y
|
||||
CONFIG_DEV_FIFO_SIZE=0
|
||||
CONFIG_DEV_PIPE_MAXSIZE=1024
|
||||
CONFIG_DEV_PIPE_SIZE=70
|
||||
CONFIG_ETC_CROMFS=y
|
||||
CONFIG_ETC_ROMFS=y
|
||||
CONFIG_ETC_ROMFSSECTSIZE=128
|
||||
CONFIG_EXPERIMENTAL=y
|
||||
CONFIG_FAT_DMAMEMORY=y
|
||||
CONFIG_FAT_LCNAMES=y
|
||||
CONFIG_FAT_LFN=y
|
||||
CONFIG_FAT_LFN_ALIAS_HASH=y
|
||||
CONFIG_FDCLONE_STDIO=y
|
||||
CONFIG_FILE_STREAM=y
|
||||
CONFIG_FS_BINFS=y
|
||||
CONFIG_FS_CROMFS=y
|
||||
CONFIG_FS_FAT=y
|
||||
CONFIG_FS_FATTIME=y
|
||||
CONFIG_FS_LARGEFILE=y
|
||||
CONFIG_FS_PROCFS=y
|
||||
CONFIG_FS_PROCFS_REGISTER=y
|
||||
CONFIG_GRAN=y
|
||||
CONFIG_GRAN_INTR=y
|
||||
CONFIG_HAVE_CXX=y
|
||||
CONFIG_HAVE_CXXINITIALIZE=y
|
||||
CONFIG_I2C=y
|
||||
CONFIG_I2C_RESET=y
|
||||
CONFIG_IDLETHREAD_STACKSIZE=750
|
||||
CONFIG_INIT_ENTRYPOINT="nsh_main"
|
||||
CONFIG_INIT_STACKSIZE=3194
|
||||
CONFIG_LIBC_FLOATINGPOINT=y
|
||||
CONFIG_LIBC_LONG_LONG=y
|
||||
CONFIG_LIBC_MAX_EXITFUNS=1
|
||||
CONFIG_LIBC_STRERROR=y
|
||||
CONFIG_LIBC_STRERROR_SHORT=y
|
||||
CONFIG_LIBM_TOOLCHAIN=y
|
||||
CONFIG_LINE_MAX=128
|
||||
CONFIG_MMCSD=y
|
||||
CONFIG_MMCSD_SDIO=y
|
||||
CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y
|
||||
CONFIG_MM_REGIONS=4
|
||||
CONFIG_MTD=y
|
||||
CONFIG_MTD_BYTE_WRITE=y
|
||||
CONFIG_MTD_PARTITION=y
|
||||
CONFIG_MTD_PROGMEM=y
|
||||
CONFIG_NAME_MAX=40
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
CONFIG_NSH_ARGCAT=y
|
||||
CONFIG_NSH_BUILTIN_APPS=y
|
||||
CONFIG_NSH_MAXARGUMENTS=15
|
||||
CONFIG_NSH_NESTDEPTH=8
|
||||
CONFIG_NSH_QUOTE=y
|
||||
CONFIG_NSH_STRERROR=y
|
||||
CONFIG_NSH_VARS=y
|
||||
CONFIG_OTG_ID_GPIO_DISABLE=y
|
||||
CONFIG_PIPES=y
|
||||
CONFIG_PRIORITY_INHERITANCE=y
|
||||
CONFIG_PTHREAD_MUTEX_ROBUST=y
|
||||
CONFIG_PTHREAD_MUTEX_TYPES=y
|
||||
CONFIG_PTHREAD_STACK_MIN=512
|
||||
CONFIG_RAM_SIZE=245760
|
||||
CONFIG_RAM_START=0x20010000
|
||||
CONFIG_RAW_BINARY=y
|
||||
CONFIG_READLINE_CMD_HISTORY=y
|
||||
CONFIG_READLINE_TABCOMPLETION=y
|
||||
CONFIG_RTC_DATETIME=y
|
||||
CONFIG_SCHED_HPWORK=y
|
||||
CONFIG_SCHED_HPWORKPRIORITY=249
|
||||
CONFIG_SCHED_HPWORKSTACKSIZE=1280
|
||||
CONFIG_SCHED_INSTRUMENTATION=y
|
||||
CONFIG_SCHED_INSTRUMENTATION_SWITCH=y
|
||||
CONFIG_SCHED_LPWORK=y
|
||||
CONFIG_SCHED_LPWORKPRIORITY=50
|
||||
CONFIG_SCHED_LPWORKSTACKSIZE=1632
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
CONFIG_SDMMC2_SDIO_PULLUP=y
|
||||
CONFIG_SEM_PREALLOCHOLDERS=32
|
||||
CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y
|
||||
CONFIG_SERIAL_TERMIOS=y
|
||||
CONFIG_SIG_DEFAULT=y
|
||||
CONFIG_SIG_SIGALRM_ACTION=y
|
||||
CONFIG_SIG_SIGUSR1_ACTION=y
|
||||
CONFIG_SIG_SIGUSR2_ACTION=y
|
||||
CONFIG_STACK_COLORATION=y
|
||||
CONFIG_START_DAY=30
|
||||
CONFIG_START_MONTH=11
|
||||
CONFIG_STDIO_BUFFER_SIZE=256
|
||||
CONFIG_STM32H7_ADC1=y
|
||||
CONFIG_STM32H7_ADC3=y
|
||||
CONFIG_STM32H7_BBSRAM=y
|
||||
CONFIG_STM32H7_BBSRAM_FILES=5
|
||||
CONFIG_STM32H7_BDMA=y
|
||||
CONFIG_STM32H7_BKPSRAM=y
|
||||
CONFIG_STM32H7_DMA1=y
|
||||
CONFIG_STM32H7_DMA2=y
|
||||
CONFIG_STM32H7_DMACAPABLE=y
|
||||
CONFIG_STM32H7_I2C1=y
|
||||
CONFIG_STM32H7_I2C4=y
|
||||
CONFIG_STM32H7_I2C_DYNTIMEO=y
|
||||
CONFIG_STM32H7_I2C_DYNTIMEO_STARTSTOP=10
|
||||
CONFIG_STM32H7_OTGFS=y
|
||||
CONFIG_STM32H7_PROGMEM=y
|
||||
CONFIG_STM32H7_RTC=y
|
||||
CONFIG_STM32H7_RTC_HSECLOCK=y
|
||||
CONFIG_STM32H7_RTC_MAGIC_REG=1
|
||||
CONFIG_STM32H7_SAVE_CRASHDUMP=y
|
||||
CONFIG_STM32H7_SDMMC2=y
|
||||
CONFIG_STM32H7_SERIALBRK_BSDCOMPAT=y
|
||||
CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y
|
||||
CONFIG_STM32H7_SPI1=y
|
||||
CONFIG_STM32H7_SPI1_DMA=y
|
||||
CONFIG_STM32H7_SPI1_DMA_BUFFER=1024
|
||||
CONFIG_STM32H7_SPI2=y
|
||||
CONFIG_STM32H7_SPI2_DMA=y
|
||||
CONFIG_STM32H7_SPI2_DMA_BUFFER=1024
|
||||
CONFIG_STM32H7_SPI4=y
|
||||
CONFIG_STM32H7_SPI4_DMA=y
|
||||
CONFIG_STM32H7_SPI4_DMA_BUFFER=1024
|
||||
CONFIG_STM32H7_UART4=y
|
||||
CONFIG_STM32H7_UART5=y
|
||||
CONFIG_STM32H7_UART7=y
|
||||
CONFIG_STM32H7_UART8=y
|
||||
CONFIG_STM32H7_USART1=y
|
||||
CONFIG_STM32H7_USART2=y
|
||||
CONFIG_STM32H7_USART3=y
|
||||
CONFIG_STM32H7_USART_BREAKS=y
|
||||
CONFIG_STM32H7_USART_INVERT=y
|
||||
CONFIG_STM32H7_USART_SINGLEWIRE=y
|
||||
CONFIG_STM32H7_USART_SWAP=y
|
||||
CONFIG_SYSTEM_CDCACM=y
|
||||
CONFIG_SYSTEM_NSH=y
|
||||
CONFIG_TASK_NAME_SIZE=24
|
||||
CONFIG_TTY_SIGINT=y
|
||||
CONFIG_TTY_SIGTSTP=y
|
||||
CONFIG_UART4_BAUD=57600
|
||||
CONFIG_UART4_RXBUFSIZE=600
|
||||
CONFIG_UART4_TXBUFSIZE=1500
|
||||
CONFIG_UART5_BAUD=57600
|
||||
CONFIG_UART5_RXBUFSIZE=600
|
||||
CONFIG_UART5_TXBUFSIZE=1500
|
||||
CONFIG_UART7_BAUD=57600
|
||||
CONFIG_UART7_RXBUFSIZE=600
|
||||
CONFIG_UART7_TXBUFSIZE=1500
|
||||
CONFIG_UART8_BAUD=57600
|
||||
CONFIG_UART8_RXBUFSIZE=600
|
||||
CONFIG_UART8_TXBUFSIZE=1500
|
||||
CONFIG_USART1_BAUD=57600
|
||||
CONFIG_USART1_RXBUFSIZE=600
|
||||
CONFIG_USART1_TXBUFSIZE=32
|
||||
CONFIG_USART2_BAUD=57600
|
||||
CONFIG_USART2_RXBUFSIZE=600
|
||||
CONFIG_USART2_TXBUFSIZE=1500
|
||||
CONFIG_USART3_BAUD=57600
|
||||
CONFIG_USART3_RXBUFSIZE=600
|
||||
CONFIG_USART3_TXBUFSIZE=1500
|
||||
CONFIG_USBDEV=y
|
||||
CONFIG_USBDEV_BUSPOWERED=y
|
||||
CONFIG_USBDEV_MAXPOWER=500
|
||||
CONFIG_USEC_PER_TICK=1000
|
||||
CONFIG_WATCHDOG=y
|
||||
@@ -0,0 +1,142 @@
|
||||
/****************************************************************************
|
||||
* scripts/bootloader_script.ld
|
||||
*
|
||||
* Copyright (C) 2026 Accton Technology Corporation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/* The Accton Godwit GFH7 uses an STM32H753VI with 2048Kb of main FLASH.
|
||||
* The bootloader uses the first sector of flash, which is 128K in length.
|
||||
*/
|
||||
|
||||
MEMORY
|
||||
{
|
||||
itcm (rwx) : ORIGIN = 0x00000000, LENGTH = 64K
|
||||
flash (rx) : ORIGIN = 0x08000000, LENGTH = 128K
|
||||
dtcm1 (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
|
||||
dtcm2 (rwx) : ORIGIN = 0x20010000, LENGTH = 64K
|
||||
sram (rwx) : ORIGIN = 0x24000000, LENGTH = 512K
|
||||
sram1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K
|
||||
sram2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K
|
||||
sram3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K
|
||||
sram4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K
|
||||
bbram (rwx) : ORIGIN = 0x38800000, LENGTH = 4K
|
||||
}
|
||||
|
||||
OUTPUT_ARCH(arm)
|
||||
EXTERN(_vectors)
|
||||
ENTRY(_stext)
|
||||
|
||||
/*
|
||||
* Ensure that abort() is present in the final object. The exception handling
|
||||
* code pulled in by libgcc.a requires it (and that code cannot be easily avoided).
|
||||
*/
|
||||
EXTERN(abort)
|
||||
EXTERN(_bootdelay_signature)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text : {
|
||||
_stext = ABSOLUTE(.);
|
||||
*(.vectors)
|
||||
. = ALIGN(32);
|
||||
/*
|
||||
This signature provides the bootloader with a way to delay booting
|
||||
*/
|
||||
_bootdelay_signature = ABSOLUTE(.);
|
||||
FILL(0xffecc2925d7d05c5)
|
||||
. += 8;
|
||||
*(.text .text.*)
|
||||
*(.fixup)
|
||||
*(.gnu.warning)
|
||||
*(.rodata .rodata.*)
|
||||
*(.gnu.linkonce.t.*)
|
||||
*(.glue_7)
|
||||
*(.glue_7t)
|
||||
*(.got)
|
||||
*(.gcc_except_table)
|
||||
*(.gnu.linkonce.r.*)
|
||||
_etext = ABSOLUTE(.);
|
||||
|
||||
} > flash
|
||||
|
||||
/*
|
||||
* Init functions (static constructors and the like)
|
||||
*/
|
||||
.init_section : {
|
||||
_sinit = ABSOLUTE(.);
|
||||
KEEP(*(.init_array .init_array.*))
|
||||
_einit = ABSOLUTE(.);
|
||||
} > flash
|
||||
|
||||
|
||||
.ARM.extab : {
|
||||
*(.ARM.extab*)
|
||||
} > flash
|
||||
|
||||
__exidx_start = ABSOLUTE(.);
|
||||
.ARM.exidx : {
|
||||
*(.ARM.exidx*)
|
||||
} > flash
|
||||
__exidx_end = ABSOLUTE(.);
|
||||
|
||||
_eronly = ABSOLUTE(.);
|
||||
|
||||
.data : {
|
||||
_sdata = ABSOLUTE(.);
|
||||
*(.data .data.*)
|
||||
*(.gnu.linkonce.d.*)
|
||||
CONSTRUCTORS
|
||||
_edata = ABSOLUTE(.);
|
||||
} > sram AT > flash
|
||||
|
||||
.bss : {
|
||||
_sbss = ABSOLUTE(.);
|
||||
*(.bss .bss.*)
|
||||
*(.gnu.linkonce.b.*)
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
_ebss = ABSOLUTE(.);
|
||||
} > sram
|
||||
|
||||
/* Stabs debugging sections. */
|
||||
.stab 0 : { *(.stab) }
|
||||
.stabstr 0 : { *(.stabstr) }
|
||||
.stab.excl 0 : { *(.stab.excl) }
|
||||
.stab.exclstr 0 : { *(.stab.exclstr) }
|
||||
.stab.index 0 : { *(.stab.index) }
|
||||
.stab.indexstr 0 : { *(.stab.indexstr) }
|
||||
.comment 0 : { *(.comment) }
|
||||
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||
.debug_info 0 : { *(.debug_info) }
|
||||
.debug_line 0 : { *(.debug_line) }
|
||||
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||
.debug_aranges 0 : { *(.debug_aranges) }
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
/****************************************************************************
|
||||
* scripts/script.ld
|
||||
*
|
||||
* Copyright (C) 2026 Accton Technology Corporation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/* The Accton Godwit GFH7 uses an STM32H753VI with 2048Kb of main FLASH.
|
||||
* The flash memory is partitioned into 16 sectors of 128Kb each:
|
||||
*
|
||||
* Sector 0 (128K): Bootloader
|
||||
* Sectors 1-14 (1792K): Firmware
|
||||
* Sector 15 (128K): Flash-based parameter storage
|
||||
*
|
||||
* The STM32H753VI has 1024Kb of data SRAM:
|
||||
*
|
||||
* 128Kb DTCM-RAM at 0x20000000
|
||||
* 64Kb ITCM-RAM at 0x00000000
|
||||
* 512Kb AXI SRAM at 0x24000000
|
||||
* 128Kb SRAM1 at 0x30000000
|
||||
* 128Kb SRAM2 at 0x30020000
|
||||
* 32Kb SRAM3 at 0x30040000
|
||||
* 64Kb SRAM4 at 0x38000000
|
||||
* 4Kb Backup RAM at 0x38800000
|
||||
*/
|
||||
|
||||
MEMORY
|
||||
{
|
||||
ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K
|
||||
FLASH (rx) : ORIGIN = 0x08020000, LENGTH = 1792K
|
||||
|
||||
DTCM1_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
|
||||
DTCM2_RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 64K
|
||||
AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */
|
||||
SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */
|
||||
SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */
|
||||
SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */
|
||||
SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */
|
||||
BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K
|
||||
}
|
||||
|
||||
OUTPUT_ARCH(arm)
|
||||
EXTERN(_vectors)
|
||||
ENTRY(_stext)
|
||||
|
||||
/*
|
||||
* Ensure that abort() is present in the final object. The exception handling
|
||||
* code pulled in by libgcc.a requires it (and that code cannot be easily avoided).
|
||||
*/
|
||||
EXTERN(abort)
|
||||
EXTERN(_bootdelay_signature)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text : {
|
||||
_stext = ABSOLUTE(.);
|
||||
*(.vectors)
|
||||
. = ALIGN(32);
|
||||
/*
|
||||
This signature provides the bootloader with a way to delay booting
|
||||
*/
|
||||
_bootdelay_signature = ABSOLUTE(.);
|
||||
FILL(0xffecc2925d7d05c5)
|
||||
. += 8;
|
||||
*(.text .text.*)
|
||||
*(.fixup)
|
||||
*(.gnu.warning)
|
||||
*(.rodata .rodata.*)
|
||||
*(.gnu.linkonce.t.*)
|
||||
*(.glue_7)
|
||||
*(.glue_7t)
|
||||
*(.got)
|
||||
*(.gcc_except_table)
|
||||
*(.gnu.linkonce.r.*)
|
||||
_etext = ABSOLUTE(.);
|
||||
|
||||
} > FLASH
|
||||
|
||||
/*
|
||||
* Init functions (static constructors and the like)
|
||||
*/
|
||||
.init_section : {
|
||||
_sinit = ABSOLUTE(.);
|
||||
KEEP(*(.init_array .init_array.*))
|
||||
_einit = ABSOLUTE(.);
|
||||
} > FLASH
|
||||
|
||||
|
||||
.ARM.extab : {
|
||||
*(.ARM.extab*)
|
||||
} > FLASH
|
||||
|
||||
__exidx_start = ABSOLUTE(.);
|
||||
.ARM.exidx : {
|
||||
*(.ARM.exidx*)
|
||||
} > FLASH
|
||||
__exidx_end = ABSOLUTE(.);
|
||||
|
||||
_eronly = ABSOLUTE(.);
|
||||
|
||||
.data : {
|
||||
_sdata = ABSOLUTE(.);
|
||||
*(.data .data.*)
|
||||
*(.gnu.linkonce.d.*)
|
||||
CONSTRUCTORS
|
||||
_edata = ABSOLUTE(.);
|
||||
|
||||
/* Pad out last section as the STM32H7 Flash write size is 256 bits. 32 bytes */
|
||||
. = ALIGN(16);
|
||||
FILL(0xffff)
|
||||
. += 16;
|
||||
} > AXI_SRAM AT > FLASH = 0xffff
|
||||
|
||||
.bss : {
|
||||
_sbss = ABSOLUTE(.);
|
||||
*(.bss .bss.*)
|
||||
*(.gnu.linkonce.b.*)
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
_ebss = ABSOLUTE(.);
|
||||
} > AXI_SRAM
|
||||
|
||||
/* Emit the the D3 power domain section for locating BDMA data */
|
||||
|
||||
.sram4_reserve (NOLOAD) :
|
||||
{
|
||||
*(.sram4)
|
||||
. = ALIGN(4);
|
||||
_sram4_heap_start = ABSOLUTE(.);
|
||||
} > SRAM4
|
||||
|
||||
/* Stabs debugging sections. */
|
||||
.stab 0 : { *(.stab) }
|
||||
.stabstr 0 : { *(.stabstr) }
|
||||
.stab.excl 0 : { *(.stab.excl) }
|
||||
.stab.exclstr 0 : { *(.stab.exclstr) }
|
||||
.stab.index 0 : { *(.stab.index) }
|
||||
.stab.indexstr 0 : { *(.stab.indexstr) }
|
||||
.comment 0 : { *(.comment) }
|
||||
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||
.debug_info 0 : { *(.debug_info) }
|
||||
.debug_line 0 : { *(.debug_line) }
|
||||
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||
.debug_aranges 0 : { *(.debug_aranges) }
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (c) 2026 PX4 Development Team. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name PX4 nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
if("${PX4_BOARD_LABEL}" STREQUAL "bootloader")
|
||||
add_library(drivers_board
|
||||
bootloader_main.c
|
||||
usb.c
|
||||
)
|
||||
target_link_libraries(drivers_board
|
||||
PRIVATE
|
||||
nuttx_arch
|
||||
nuttx_drivers
|
||||
bootloader
|
||||
)
|
||||
target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/bootloader/common)
|
||||
|
||||
else()
|
||||
add_library(drivers_board
|
||||
board_clock.c
|
||||
i2c.cpp
|
||||
init.c
|
||||
led.c
|
||||
sdio.c
|
||||
spi.cpp
|
||||
timer_config.cpp
|
||||
usb.c
|
||||
)
|
||||
add_dependencies(drivers_board nuttx_arch_build)
|
||||
|
||||
target_link_libraries(drivers_board
|
||||
PRIVATE
|
||||
arch_board_reset
|
||||
arch_io_pins
|
||||
arch_spi
|
||||
drivers__led
|
||||
nuttx_arch
|
||||
nuttx_drivers
|
||||
px4_layer
|
||||
systemlib
|
||||
)
|
||||
|
||||
target_include_directories(drivers_board INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
endif()
|
||||
@@ -0,0 +1,65 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2026 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#include <px4_platform_common/px4_config.h>
|
||||
#include <px4_platform/gpio.h>
|
||||
|
||||
#include <arm_internal.h>
|
||||
#include <stm32_gpio.h>
|
||||
#include <stm32_rcc.h>
|
||||
#include <hardware/stm32_tim.h>
|
||||
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#define TIM4_REG(offset) (*(volatile uint32_t *)(STM32_TIM4_BASE + (offset)))
|
||||
|
||||
void board_clock_outputs_initialize(void)
|
||||
{
|
||||
/* PA8/MCO1 is left unused: the STM32G431 OSD co-processor runs from its
|
||||
* own crystal (X2), and R80, which would route MCO1 to it, is not fitted.
|
||||
*/
|
||||
|
||||
/* ICM-42688-P CLKIN: 240 MHz / (15 * 500) = 32 kHz on TIM4_CH3/PD14. */
|
||||
modifyreg32(STM32_RCC_APB1LENR, 0, RCC_APB1LENR_TIM4EN);
|
||||
TIM4_REG(STM32_GTIM_CR1_OFFSET) = 0;
|
||||
TIM4_REG(STM32_GTIM_CCER_OFFSET) = 0;
|
||||
TIM4_REG(STM32_GTIM_CCMR2_OFFSET) =
|
||||
(GTIM_CCMR_MODE_PWM1 << GTIM_CCMR2_OC3M_SHIFT) | GTIM_CCMR2_OC3PE;
|
||||
TIM4_REG(STM32_GTIM_PSC_OFFSET) = 14;
|
||||
TIM4_REG(STM32_GTIM_ARR_OFFSET) = 499;
|
||||
TIM4_REG(STM32_GTIM_CCR3_OFFSET) = 250;
|
||||
TIM4_REG(STM32_GTIM_EGR_OFFSET) = GTIM_EGR_UG;
|
||||
TIM4_REG(STM32_GTIM_CCER_OFFSET) = GTIM_CCER_CC3E;
|
||||
px4_arch_configgpio(GPIO_TIM4_CH3OUT_2);
|
||||
TIM4_REG(STM32_GTIM_CR1_OFFSET) = GTIM_CR1_ARPE | GTIM_CR1_CEN;
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2026 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <px4_platform_common/px4_config.h>
|
||||
#include <nuttx/compiler.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stm32_gpio.h>
|
||||
|
||||
/* Status LEDs, active low. */
|
||||
#define GPIO_nLED_GREEN /* PC13 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN13)
|
||||
#define GPIO_nLED_BLUE /* PE10 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN10)
|
||||
|
||||
#define BOARD_HAS_CONTROL_STATUS_LEDS 1
|
||||
#define BOARD_OVERLOAD_LED LED_GREEN
|
||||
#define BOARD_ARMED_STATE_LED LED_BLUE
|
||||
|
||||
/* ADC1 inputs. */
|
||||
#define PX4_ADC_GPIO \
|
||||
GPIO_ADC123_INP10, /* PC0: voltage */ \
|
||||
GPIO_ADC12_INP9, /* PB0: current */ \
|
||||
GPIO_ADC12_INP5 /* PB1: RSSI */
|
||||
|
||||
#define ADC_BATTERY_VOLTAGE_CHANNEL 10
|
||||
#define ADC_BATTERY_CURRENT_CHANNEL 9
|
||||
#define ADC_RSSI_IN_CHANNEL 5
|
||||
#define ADC_CHANNELS ((1 << ADC_BATTERY_VOLTAGE_CHANNEL) | \
|
||||
(1 << ADC_BATTERY_CURRENT_CHANNEL) | \
|
||||
(1 << ADC_RSSI_IN_CHANNEL))
|
||||
|
||||
/* 160 kOhm / 10 kOhm divider. Current scaling remains intentionally unset. */
|
||||
#define BOARD_BATTERY1_V_DIV 17.0f
|
||||
|
||||
/* Eight motor outputs: TIM1 CH1-4 and TIM8 CH1-4. */
|
||||
#define DIRECT_PWM_OUTPUT_CHANNELS 8
|
||||
#define BOARD_NUM_IO_TIMERS 2
|
||||
|
||||
/* TIM3 is free from TIM2 NeoPixel and TIM4 IMU clock duties. */
|
||||
#define HRT_TIMER 3
|
||||
#define HRT_TIMER_CHANNEL 1
|
||||
|
||||
/* PE12 drives the external buzzer transistor. GPIO mode supports active buzzers. */
|
||||
#define GPIO_TONE_ALARM_IDLE /* PE12 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN12)
|
||||
#define GPIO_TONE_ALARM_GPIO GPIO_TONE_ALARM_IDLE
|
||||
|
||||
/* Board controls. */
|
||||
/* Heater: PE3 high turns on low-side N-MOSFET Q2. The gate has a pull-down
|
||||
* and the pin starts low, so the heater is off through reset and boot.
|
||||
*/
|
||||
#define GPIO_HEATER_OUTPUT
|
||||
#define HEATER_NUM 1
|
||||
#define GPIO_HEATER1_OUTPUT /* PE3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN3)
|
||||
#define HEATER1_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER1_OUTPUT, (on_true))
|
||||
/* 12 V BEC enable, active low: PC12 high turns Q3 on and the 12 V output off.
|
||||
* The pin starts low, so 12 V is on at boot.
|
||||
*/
|
||||
#define GPIO_n12V_EN /* PC12 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN12)
|
||||
#define PAYLOAD_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_n12V_EN, !(on_true))
|
||||
#define GPIO_HW_VER0 /* PC14 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTC|GPIO_PIN14)
|
||||
#define GPIO_HW_VER1 /* PC15 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTC|GPIO_PIN15)
|
||||
#define GPIO_PHY_RST_SAFE /* PD15 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTD|GPIO_PIN15)
|
||||
|
||||
/* USB VBUS is not sensed: PA9 is a test point and the VBUS sense resistor
|
||||
* (R114) is not fitted. The pull-up keeps PA9 high, so PX4 treats USB as
|
||||
* always attached.
|
||||
*/
|
||||
#define BOARD_USB_VBUS_SENSE_DISABLED 1
|
||||
#define GPIO_OTGFS_VBUS /* PA9 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN9)
|
||||
#define BOARD_ADC_USB_CONNECTED (1)
|
||||
#define BOARD_ADC_USB_VALID BOARD_ADC_USB_CONNECTED
|
||||
|
||||
/* SDMMC2, card detect is active low. */
|
||||
#define SDIO_SLOTNO 0
|
||||
#define SDIO_MINOR 0
|
||||
#define GPIO_SDMMC2_NCD /* PA15 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_EXTI|GPIO_PORTA|GPIO_PIN15)
|
||||
|
||||
/* Up to eight WS2812/SK6812-compatible LEDs on TIM2 CH3 / PB10. */
|
||||
#if defined(USE_S_RGB_LED_DMA)
|
||||
# define BOARD_HAS_N_S_RGB_LED 8
|
||||
# define BOARD_MAX_LEDS BOARD_HAS_N_S_RGB_LED
|
||||
# define S_RGB_LED_DMA DMAMAP_DMA12_TIM2CH3_0
|
||||
# define S_RGB_LED_TIMER 2
|
||||
# define S_RGB_LED_CHANNEL 3
|
||||
# define S_RGB_LED_TIM_GPIO GPIO_TIM2_CH3OUT_2
|
||||
#endif
|
||||
|
||||
#define BOARD_DMA_ALLOC_POOL_SIZE 5120
|
||||
#define BOARD_HAS_ON_RESET 1
|
||||
#define BOARD_ENABLE_CONSOLE_BUFFER
|
||||
#define FLASH_BASED_PARAMS
|
||||
|
||||
#define BOARD_ADC_BRICK_VALID (true)
|
||||
|
||||
#define PX4_GPIO_INIT_LIST { \
|
||||
PX4_ADC_GPIO, \
|
||||
GPIO_CAN1_TX, GPIO_CAN1_RX, \
|
||||
GPIO_HEATER1_OUTPUT, GPIO_n12V_EN, GPIO_TONE_ALARM_IDLE, \
|
||||
GPIO_HW_VER0, GPIO_HW_VER1, GPIO_PHY_RST_SAFE \
|
||||
}
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
int stm32_sdio_initialize(void);
|
||||
extern void stm32_spiinitialize(void);
|
||||
extern void stm32_usbinitialize(void);
|
||||
extern void board_peripheral_reset(int ms);
|
||||
|
||||
#include <px4_platform_common/board_common.h>
|
||||
|
||||
__END_DECLS
|
||||
@@ -0,0 +1,75 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (C) 2026 Accton Technology Corporation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/**
|
||||
* @file bootloader_main.c
|
||||
*
|
||||
* Accton Godwit GFH7 bootloader entry point.
|
||||
*/
|
||||
|
||||
#include "board_config.h"
|
||||
#include "bl.h"
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/board.h>
|
||||
#include <chip.h>
|
||||
#include <stm32_uart.h>
|
||||
#include <arch/board/board.h>
|
||||
#include "arm_internal.h"
|
||||
#include <px4_platform_common/init.h>
|
||||
|
||||
extern int sercon_main(int c, char **argv);
|
||||
|
||||
__EXPORT void board_on_reset(int status) {}
|
||||
|
||||
__EXPORT void stm32_boardinitialize(void)
|
||||
{
|
||||
/* configure USB interfaces */
|
||||
stm32_usbinitialize();
|
||||
}
|
||||
|
||||
__EXPORT int board_app_initialize(uintptr_t arg)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void board_late_initialize(void)
|
||||
{
|
||||
sercon_main(0, NULL);
|
||||
}
|
||||
|
||||
extern void sys_tick_handler(void);
|
||||
void board_timerhook(void)
|
||||
{
|
||||
sys_tick_handler();
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2026 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define USB0_DEV 0x01
|
||||
#define SERIAL0_DEV 0x02
|
||||
|
||||
#define APP_LOAD_ADDRESS 0x08020000
|
||||
#define BOOTLOADER_DELAY 5000
|
||||
#define INTERFACE_USB 1
|
||||
#define INTERFACE_USB_CONFIG "/dev/ttyACM0"
|
||||
#define INTERFACE_USART 1
|
||||
#define INTERFACE_USART_CONFIG "/dev/ttyS0,115200"
|
||||
|
||||
#define BOOT_DELAY_ADDRESS 0x000001a0
|
||||
#define BOARD_TYPE 7122
|
||||
#define BOARD_FLASH_SECTORS 14
|
||||
#define BOARD_FLASH_SIZE (16 * 128 * 1024)
|
||||
#define APP_RESERVATION_SIZE (1 * 128 * 1024)
|
||||
#define OSC_FREQ 16
|
||||
|
||||
#define BOARD_PIN_LED_ACTIVITY GPIO_nLED_BLUE
|
||||
#define BOARD_PIN_LED_BOOTLOADER GPIO_nLED_GREEN
|
||||
#define BOARD_LED_ON 0
|
||||
#define BOARD_LED_OFF 1
|
||||
|
||||
#define SERIAL_BREAK_DETECT_DISABLED 1
|
||||
|
||||
#if !defined(ARCH_SN_MAX_LENGTH)
|
||||
# define ARCH_SN_MAX_LENGTH 12
|
||||
#endif
|
||||
|
||||
#if !defined(BOARD_FIRST_FLASH_SECTOR_TO_ERASE)
|
||||
# define BOARD_FIRST_FLASH_SECTOR_TO_ERASE 1
|
||||
#endif
|
||||
|
||||
#if !defined(USB_DATA_ALIGN)
|
||||
# define USB_DATA_ALIGN
|
||||
#endif
|
||||
|
||||
#ifndef BOOT_DEVICES_SELECTION
|
||||
# define BOOT_DEVICES_SELECTION (USB0_DEV | SERIAL0_DEV)
|
||||
#endif
|
||||
|
||||
#ifndef BOOT_DEVICES_FILTER_ONUSB
|
||||
# define BOOT_DEVICES_FILTER_ONUSB (USB0_DEV | SERIAL0_DEV)
|
||||
#endif
|
||||
@@ -0,0 +1,39 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2026 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#include <px4_arch/i2c_hw_description.h>
|
||||
|
||||
constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = {
|
||||
initI2CBusInternal(1),
|
||||
initI2CBusExternal(4),
|
||||
};
|
||||
@@ -0,0 +1,199 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2026 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/**
|
||||
* @file init.c
|
||||
*
|
||||
* Accton Godwit GFH7 board-specific early startup.
|
||||
*
|
||||
* Two hooks are provided here:
|
||||
* - stm32_boardinitialize(): called very early by NuttX, before device
|
||||
* drivers exist. Only GPIO / pin-mux work allowed.
|
||||
* - board_app_initialize(): called once NuttX user space is up; starts
|
||||
* platform services (HRT, DMA pool, LED device, hardfault logger,
|
||||
* parameter flash store, HW manifest).
|
||||
*/
|
||||
|
||||
#include "board_config.h"
|
||||
|
||||
#include <px4_platform_common/px4_config.h>
|
||||
#include <px4_platform_common/init.h>
|
||||
#include <px4_platform/gpio.h>
|
||||
#include <px4_platform/board_dma_alloc.h>
|
||||
#include <px4_arch/io_timer.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
#include <syslog.h>
|
||||
|
||||
#include <nuttx/board.h>
|
||||
#include <nuttx/spi/spi.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include <stm32_uart.h>
|
||||
#include <stm32_gpio.h>
|
||||
|
||||
#include <drivers/drv_board_led.h>
|
||||
#include <drivers/drv_hrt.h>
|
||||
#include <systemlib/px4_macros.h>
|
||||
#include <parameters/flashparams/flashfs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern void led_init(void);
|
||||
extern void led_on(int led);
|
||||
extern void led_off(int led);
|
||||
extern void board_clock_outputs_initialize(void);
|
||||
__END_DECLS
|
||||
|
||||
__EXPORT int board_app_initialize(uintptr_t arg);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_peripheral_reset
|
||||
*
|
||||
* Description:
|
||||
* Called by PX4 system-reset to power-cycle external peripherals.
|
||||
* GFH7 has no general peripheral power-cycle rail, so this is a no-op.
|
||||
****************************************************************************/
|
||||
__EXPORT void board_peripheral_reset(int ms)
|
||||
{
|
||||
UNUSED(ms);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_on_reset
|
||||
*
|
||||
* Description:
|
||||
* Put PWM outputs into a safe (input) state on reset. When reset comes
|
||||
* from the running system (status >= 0), hold low for 100 ms to ensure
|
||||
* ESCs are disarmed before further init continues.
|
||||
****************************************************************************/
|
||||
__EXPORT void board_on_reset(int status)
|
||||
{
|
||||
for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) {
|
||||
px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i)));
|
||||
}
|
||||
|
||||
if (status >= 0) {
|
||||
up_mdelay(100);
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_boardinitialize
|
||||
****************************************************************************/
|
||||
__EXPORT void stm32_boardinitialize(void)
|
||||
{
|
||||
/* Keep the debug port available across low-power states. */
|
||||
*(volatile uint32_t *)0x5C001004 |= (1u << 0) | (1u << 1) | (1u << 2);
|
||||
|
||||
board_on_reset(-1);
|
||||
|
||||
/* LEDs - NuttX arch-level hook (no-op unless CONFIG_ARCH_LEDS=y, which is
|
||||
* off on this port; real LED setup happens later via drv_led_start() in
|
||||
* board_app_initialize) */
|
||||
board_autoled_initialize();
|
||||
|
||||
/* Configure ADC, CAN, board controls and revision straps. */
|
||||
const uint32_t gpio[] = PX4_GPIO_INIT_LIST;
|
||||
px4_gpio_init(gpio, arraySize(gpio));
|
||||
|
||||
board_clock_outputs_initialize();
|
||||
|
||||
/* USB OTG_FS. VBUS is not sensed on this board, see board_config.h. */
|
||||
stm32_usbinitialize();
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_app_initialize
|
||||
****************************************************************************/
|
||||
__EXPORT int board_app_initialize(uintptr_t arg)
|
||||
{
|
||||
/* Need HRT running before ADC / workqueues can be used */
|
||||
px4_platform_init();
|
||||
|
||||
/* SPI buses so onboard devices can probe. */
|
||||
stm32_spiinitialize();
|
||||
|
||||
/* DMA allocator pool (required for SPI / UART DMA buffers on H7) */
|
||||
if (board_dma_alloc_init() < 0) {
|
||||
syslog(LOG_ERR, "[boot] DMA alloc FAILED\n");
|
||||
}
|
||||
|
||||
#if defined(SERIAL_HAVE_RXDMA)
|
||||
static struct hrt_call serial_dma_call;
|
||||
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||
#endif
|
||||
|
||||
/* Register LED device and set initial state (all off) */
|
||||
drv_led_start();
|
||||
led_off(LED_GREEN);
|
||||
led_off(LED_BLUE);
|
||||
|
||||
/* BBSRAM crash-dump logger */
|
||||
if (board_hardfault_init(2, true) != 0) {
|
||||
led_on(LED_GREEN);
|
||||
}
|
||||
|
||||
/* SDMMC2 / SD card bring-up. */
|
||||
#ifdef CONFIG_MMCSD
|
||||
int sd_ret = stm32_sdio_initialize();
|
||||
|
||||
if (sd_ret != OK) {
|
||||
syslog(LOG_ERR, "[boot] SDIO init FAILED: %d\n", sd_ret);
|
||||
led_on(LED_GREEN);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* Parameters in internal flash: sector 15 at 0x081E0000 (128 KB) --
|
||||
* matches bootloader's APP_RESERVATION_SIZE. */
|
||||
#if defined(FLASH_BASED_PARAMS)
|
||||
static sector_descriptor_t params_sector_map[] = {
|
||||
{15, 128 * 1024, 0x081E0000},
|
||||
{0, 0, 0},
|
||||
};
|
||||
|
||||
if (parameter_flashfs_init(params_sector_map, NULL, 0) != OK) {
|
||||
syslog(LOG_ERR, "[boot] parameter_flashfs_init FAILED\n");
|
||||
led_on(LED_GREEN);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* Configure HW per manifest (must be last) */
|
||||
px4_platform_configure();
|
||||
|
||||
return OK;
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2026 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/**
|
||||
* @file led.c
|
||||
*
|
||||
* LED backend.
|
||||
*/
|
||||
|
||||
#include <px4_platform_common/px4_config.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "chip.h"
|
||||
#include "stm32_gpio.h"
|
||||
#include "board_config.h"
|
||||
|
||||
#include <nuttx/board.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
/*
|
||||
* Ideally we'd be able to get these from arm_internal.h,
|
||||
* but since we want to be able to disable the NuttX use
|
||||
* of leds for system indication at will and there is no
|
||||
* separate switch, we need to build independent of the
|
||||
* CONFIG_ARCH_LEDS configuration switch.
|
||||
*/
|
||||
__BEGIN_DECLS
|
||||
extern void led_init(void);
|
||||
extern void led_on(int led);
|
||||
extern void led_off(int led);
|
||||
extern void led_toggle(int led);
|
||||
__END_DECLS
|
||||
|
||||
# define xlat(p) (p)
|
||||
// index: 0=BLUE, 1=RED, 2=SAFETY, 3=GREEN
|
||||
static uint32_t g_ledmap[] = {
|
||||
GPIO_nLED_BLUE, // LED_BLUE (0)
|
||||
0, // LED_RED (1)
|
||||
0, // LED_SAFETY (2)
|
||||
GPIO_nLED_GREEN, // LED_GREEN (3)
|
||||
};
|
||||
|
||||
#ifndef arraySize
|
||||
#define arraySize(a) (sizeof((a))/sizeof(((a)[0])))
|
||||
#endif
|
||||
|
||||
static inline bool valid_led_index(int led)
|
||||
{
|
||||
return (led >= 0) && ((size_t)led < arraySize(g_ledmap));
|
||||
}
|
||||
|
||||
__EXPORT void led_init(void)
|
||||
{
|
||||
/* Configure LED GPIOs for output */
|
||||
for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) {
|
||||
if (g_ledmap[l] != 0) {
|
||||
stm32_configgpio(g_ledmap[l]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void phy_set_led(int led, bool state)
|
||||
{
|
||||
if (!valid_led_index(led)) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Drive Low to switch on */
|
||||
if (g_ledmap[led] != 0) {
|
||||
stm32_gpiowrite(g_ledmap[led], !state);
|
||||
}
|
||||
}
|
||||
|
||||
static bool phy_get_led(int led)
|
||||
{
|
||||
if (!valid_led_index(led)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* If Low it is on */
|
||||
if (g_ledmap[led] != 0) {
|
||||
return !stm32_gpioread(g_ledmap[led]);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
__EXPORT void led_on(int led)
|
||||
{
|
||||
phy_set_led(xlat(led), true);
|
||||
}
|
||||
|
||||
__EXPORT void led_off(int led)
|
||||
{
|
||||
phy_set_led(xlat(led), false);
|
||||
}
|
||||
|
||||
__EXPORT void led_toggle(int led)
|
||||
{
|
||||
phy_set_led(xlat(led), !phy_get_led(xlat(led)));
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <board_config.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/sdio.h>
|
||||
#include <nuttx/mmcsd.h>
|
||||
|
||||
#include "chip.h"
|
||||
#include "board_config.h"
|
||||
#include "stm32_gpio.h"
|
||||
#include "stm32_sdmmc.h"
|
||||
|
||||
#ifdef CONFIG_MMCSD
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Card detections requires card support and a card detection GPIO */
|
||||
|
||||
#define HAVE_NCD 1
|
||||
#if !defined(GPIO_SDMMC2_NCD)
|
||||
# undef HAVE_NCD
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static FAR struct sdio_dev_s *sdio_dev;
|
||||
#ifdef HAVE_NCD
|
||||
static bool g_sd_inserted = 0xff; /* Impossible value */
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_ncd_interrupt
|
||||
*
|
||||
* Description:
|
||||
* Card detect interrupt handler.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef HAVE_NCD
|
||||
static int stm32_ncd_interrupt(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
bool present;
|
||||
|
||||
present = !stm32_gpioread(GPIO_SDMMC2_NCD);
|
||||
|
||||
if (sdio_dev && present != g_sd_inserted) {
|
||||
sdio_mediachange(sdio_dev, present);
|
||||
g_sd_inserted = present;
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_sdio_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize SDIO-based MMC/SD card support
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int stm32_sdio_initialize(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
#ifdef HAVE_NCD
|
||||
/* Card detect */
|
||||
|
||||
bool cd_status;
|
||||
|
||||
/* Configure the card detect GPIO */
|
||||
|
||||
stm32_configgpio(GPIO_SDMMC2_NCD);
|
||||
|
||||
/* Register an interrupt handler for the card detect pin */
|
||||
|
||||
stm32_gpiosetevent(GPIO_SDMMC2_NCD, true, true, true, stm32_ncd_interrupt, NULL);
|
||||
#endif
|
||||
|
||||
/* Mount the SDIO-based MMC/SD block driver */
|
||||
/* First, get an instance of the SDIO interface */
|
||||
|
||||
finfo("Initializing SDIO slot %d\n", SDIO_SLOTNO);
|
||||
|
||||
sdio_dev = sdio_initialize(SDIO_SLOTNO);
|
||||
|
||||
if (!sdio_dev) {
|
||||
syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", SDIO_SLOTNO);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Now bind the SDIO interface to the MMC/SD driver */
|
||||
|
||||
finfo("Bind SDIO to the MMC/SD driver, minor=%d\n", SDIO_MINOR);
|
||||
|
||||
ret = mmcsd_slotinitialize(SDIO_MINOR, sdio_dev);
|
||||
|
||||
if (ret != OK) {
|
||||
syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
finfo("Successfully bound SDIO to the MMC/SD driver\n");
|
||||
|
||||
#ifdef HAVE_NCD
|
||||
/* Use SD card detect pin to check if a card is g_sd_inserted */
|
||||
|
||||
cd_status = !stm32_gpioread(GPIO_SDMMC2_NCD);
|
||||
finfo("Card detect : %d\n", cd_status);
|
||||
|
||||
sdio_mediachange(sdio_dev, cd_status);
|
||||
#else
|
||||
/* Assume that the SD card is inserted. What choice do we have? */
|
||||
|
||||
sdio_mediachange(sdio_dev, true);
|
||||
#endif
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_MMCSD */
|
||||
@@ -0,0 +1,52 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2026 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#include <px4_arch/spi_hw_description.h>
|
||||
#include <drivers/drv_sensor.h>
|
||||
#include <nuttx/spi/spi.h>
|
||||
|
||||
constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = {
|
||||
initSPIBus(SPI::Bus::SPI1, {
|
||||
initSPIDevice(DRV_OSD_DEVTYPE_ATXXXX, SPI::CS{GPIO::PortA, GPIO::Pin4}),
|
||||
}),
|
||||
initSPIBus(SPI::Bus::SPI2, {
|
||||
initSPIDevice(DRV_IMU_DEVTYPE_ST_LSM6DSV, SPI::CS{GPIO::PortB, GPIO::Pin9},
|
||||
SPI::DRDY{GPIO::PortD, GPIO::Pin11}),
|
||||
}),
|
||||
initSPIBus(SPI::Bus::SPI4, {
|
||||
initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortE, GPIO::Pin4},
|
||||
SPI::DRDY{GPIO::PortD, GPIO::Pin10}),
|
||||
}),
|
||||
};
|
||||
|
||||
static constexpr bool unused = validateSPIConfig(px4_spi_buses);
|
||||
@@ -0,0 +1,53 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2026 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#include <px4_arch/io_timer_hw_description.h>
|
||||
|
||||
constexpr io_timers_t io_timers[MAX_IO_TIMERS] = {
|
||||
initIOTimer(Timer::Timer1, DMA{DMA::Index1}),
|
||||
initIOTimer(Timer::Timer8, DMA{DMA::Index1}),
|
||||
};
|
||||
|
||||
constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = {
|
||||
initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}),
|
||||
initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}),
|
||||
initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortE, GPIO::Pin13}),
|
||||
initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}),
|
||||
initIOTimerChannel(io_timers, {Timer::Timer8, Timer::Channel1}, {GPIO::PortC, GPIO::Pin6}),
|
||||
initIOTimerChannel(io_timers, {Timer::Timer8, Timer::Channel2}, {GPIO::PortC, GPIO::Pin7}),
|
||||
initIOTimerChannel(io_timers, {Timer::Timer8, Timer::Channel3}, {GPIO::PortC, GPIO::Pin8}),
|
||||
initIOTimerChannel(io_timers, {Timer::Timer8, Timer::Channel4}, {GPIO::PortC, GPIO::Pin9}),
|
||||
};
|
||||
|
||||
constexpr io_timers_channel_mapping_t io_timers_channel_mapping =
|
||||
initIOTimerChannelMapping(io_timers, timer_io_channels);
|
||||
@@ -0,0 +1,70 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (C) 2026 Accton Technology Corporation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/**
|
||||
* @file usb.c
|
||||
*
|
||||
* Board-specific USB functions.
|
||||
*/
|
||||
|
||||
#include <px4_platform_common/px4_config.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/usb/usbdev.h>
|
||||
#include <nuttx/usb/usbdev_trace.h>
|
||||
|
||||
#include <arm_internal.h>
|
||||
#include <chip.h>
|
||||
#include <stm32_gpio.h>
|
||||
#include <stm32_otg.h>
|
||||
#include "board_config.h"
|
||||
|
||||
__EXPORT void stm32_usbinitialize(void)
|
||||
{
|
||||
/* The OTG FS has an internal soft pull-up */
|
||||
|
||||
/* Configure the OTG FS VBUS sensing GPIO, Power On, and Overcurrent GPIOs */
|
||||
|
||||
#ifdef CONFIG_STM32H7_OTGFS
|
||||
stm32_configgpio(GPIO_OTGFS_VBUS);
|
||||
#endif
|
||||
}
|
||||
|
||||
__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume)
|
||||
{
|
||||
uinfo("resume: %d\n", resume);
|
||||
}
|
||||
@@ -77,6 +77,7 @@ CONFIG_MODULES_LOGGER=y
|
||||
CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y
|
||||
CONFIG_MODULES_MANUAL_CONTROL=y
|
||||
CONFIG_MODULES_MAVLINK=y
|
||||
CONFIG_MAVLINK_NUM_CONFIG_INSTANCES=5
|
||||
CONFIG_MODULES_MC_ATT_CONTROL=y
|
||||
CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y
|
||||
CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y
|
||||
|
||||
@@ -516,7 +516,7 @@
|
||||
*(.text._ZN13NavigatorMode3runEb)
|
||||
*(.text._ZL19param_find_internalPKcb)
|
||||
*(.text.uart_datasent)
|
||||
*(.text._ZN4EKF221PublishOpticalFlowVelERKy)
|
||||
*(.text._ZN17OpticalFlowSource7publishERK3Ekf)
|
||||
*(.text.nxsem_destroy)
|
||||
*(.text.file_write)
|
||||
*(.text._ZN21MavlinkStreamAltitude4sendEv)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
param set-default IMU_GYRO_RATEMAX 1000
|
||||
param set-default SENS_FLOW_RATE 150
|
||||
param set-default SENS_FLOW0_RATE 150
|
||||
param set-default SENS_IMU_CLPNOTI 0
|
||||
|
||||
# Internal SPI
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
param set-default IMU_GYRO_RATEMAX 1000
|
||||
param set-default SENS_FLOW_RATE 150
|
||||
param set-default SENS_FLOW0_RATE 150
|
||||
param set-default SENS_IMU_CLPNOTI 0
|
||||
|
||||
# Internal SPI
|
||||
|
||||
@@ -22,7 +22,6 @@ CONFIG_UAVCANNODE_SAFETY_BUTTON=y
|
||||
CONFIG_UAVCANNODE_STATIC_PRESSURE=y
|
||||
CONFIG_UAVCANNODE_STATIC_TEMPERATURE=y
|
||||
CONFIG_MODULES_GYRO_CALIBRATION=y
|
||||
CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y
|
||||
CONFIG_MODULES_SENSORS=y
|
||||
# CONFIG_SENSORS_VEHICLE_AIRSPEED is not set
|
||||
# CONFIG_SENSORS_VEHICLE_AIR_DATA is not set
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
# board specific defaults
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
param set-default MBE_ENABLE 0
|
||||
param set-default SENS_IMU_CLPNOTI 0
|
||||
|
||||
safety_button start
|
||||
|
||||
@@ -25,7 +25,6 @@ CONFIG_UAVCANNODE_SAFETY_BUTTON=y
|
||||
CONFIG_UAVCANNODE_STATIC_PRESSURE=y
|
||||
CONFIG_UAVCANNODE_STATIC_TEMPERATURE=y
|
||||
CONFIG_MODULES_GYRO_CALIBRATION=y
|
||||
CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y
|
||||
CONFIG_MODULES_SENSORS=y
|
||||
# CONFIG_SENSORS_VEHICLE_AIRSPEED is not set
|
||||
# CONFIG_SENSORS_VEHICLE_AIR_DATA is not set
|
||||
|
||||
@@ -7,7 +7,6 @@ param set-default CANNODE_SUB_MBD 1
|
||||
param set-default CANNODE_SUB_RTCM 1
|
||||
param set-default GPS_1_GNSS 63
|
||||
param set-default GPS_UBX_BAUD1 921600
|
||||
param set-default MBE_ENABLE 0
|
||||
param set-default SENS_IMU_CLPNOTI 0
|
||||
|
||||
safety_button start
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
# board specific defaults
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
param set-default MBE_ENABLE 0
|
||||
param set-default SENS_IMU_CLPNOTI 0
|
||||
|
||||
pwm_out start
|
||||
|
||||
@@ -502,7 +502,7 @@
|
||||
*(.text._ZN13NavigatorMode3runEb)
|
||||
*(.text._ZL19param_find_internalPKcb)
|
||||
*(.text.uart_datasent)
|
||||
*(.text._ZN4EKF221PublishOpticalFlowVelERKy)
|
||||
*(.text._ZN17OpticalFlowSource7publishERK3Ekf)
|
||||
*(.text.nxsem_destroy)
|
||||
*(.text.file_write)
|
||||
*(.text._ZN21MavlinkStreamAltitude4sendEv)
|
||||
|
||||
@@ -42,10 +42,10 @@ then
|
||||
fi
|
||||
|
||||
param set-default EKF2_MULTI_IMU 0
|
||||
param set-default EKF2_OF_CTRL 1
|
||||
param set-default EKF2_OF_N_MIN 0.05
|
||||
param set-default EKF2_OF0_CTRL 1
|
||||
param set-default EKF2_OF0_N_MIN 0.05
|
||||
param set-default EKF2_RNG_A_HMAX 25
|
||||
param set-default EKF2_RNG_QLTY_T 0.1
|
||||
|
||||
param set-default SENS_FLOW_RATE 150
|
||||
param set-default SENS_FLOW0_RATE 150
|
||||
param set-default SENS_IMU_MODE 1
|
||||
@@ -23,7 +23,6 @@ CONFIG_UAVCANNODE_STATIC_PRESSURE=y
|
||||
CONFIG_UAVCANNODE_STATIC_TEMPERATURE=y
|
||||
CONFIG_MODULES_EKF2=y
|
||||
CONFIG_MODULES_GYRO_CALIBRATION=y
|
||||
CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y
|
||||
CONFIG_MODULES_SENSORS=y
|
||||
# CONFIG_SENSORS_VEHICLE_AIRSPEED is not set
|
||||
# CONFIG_SENSORS_VEHICLE_AIR_DATA is not set
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
param set-default CANNODE_SUB_MBD 1
|
||||
param set-default CANNODE_SUB_RTCM 1
|
||||
param set-default MBE_ENABLE 0
|
||||
param set-default SENS_IMU_CLPNOTI 0
|
||||
|
||||
safety_button start
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
param set-default CANNODE_SUB_MBD 1
|
||||
param set-default CANNODE_SUB_RTCM 1
|
||||
param set-default MBE_ENABLE 0
|
||||
param set-default SENS_IMU_CLPNOTI 0
|
||||
|
||||
tone_alarm start
|
||||
|
||||
@@ -20,7 +20,6 @@ CONFIG_UAVCANNODE_SAFETY_BUTTON=y
|
||||
CONFIG_UAVCANNODE_STATIC_PRESSURE=y
|
||||
CONFIG_UAVCANNODE_STATIC_TEMPERATURE=y
|
||||
CONFIG_MODULES_GYRO_CALIBRATION=y
|
||||
CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y
|
||||
CONFIG_MODULES_SENSORS=y
|
||||
# CONFIG_SENSORS_VEHICLE_AIRSPEED is not set
|
||||
# CONFIG_SENSORS_VEHICLE_AIR_DATA is not set
|
||||
|
||||
@@ -21,7 +21,6 @@ CONFIG_UAVCANNODE_SAFETY_BUTTON=y
|
||||
CONFIG_UAVCANNODE_STATIC_PRESSURE=y
|
||||
CONFIG_UAVCANNODE_STATIC_TEMPERATURE=y
|
||||
CONFIG_MODULES_GYRO_CALIBRATION=y
|
||||
CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y
|
||||
CONFIG_MODULES_SENSORS=y
|
||||
# CONFIG_SENSORS_VEHICLE_AIRSPEED is not set
|
||||
# CONFIG_SENSORS_VEHICLE_AIR_DATA is not set
|
||||
|
||||
@@ -21,7 +21,6 @@ CONFIG_UAVCANNODE_SAFETY_BUTTON=y
|
||||
CONFIG_UAVCANNODE_STATIC_PRESSURE=y
|
||||
CONFIG_UAVCANNODE_STATIC_TEMPERATURE=y
|
||||
CONFIG_MODULES_GYRO_CALIBRATION=y
|
||||
CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y
|
||||
CONFIG_MODULES_SENSORS=y
|
||||
# CONFIG_SENSORS_VEHICLE_AIRSPEED is not set
|
||||
# CONFIG_SENSORS_VEHICLE_AIR_DATA is not set
|
||||
|
||||
@@ -446,7 +446,7 @@
|
||||
*(.text._ZN13NavigatorMode3runEb)
|
||||
*(.text._ZL19param_find_internalPKcb)
|
||||
*(.text.uart_datasent)
|
||||
*(.text._ZN4EKF221PublishOpticalFlowVelERKy)
|
||||
*(.text._ZN17OpticalFlowSource7publishERK3Ekf)
|
||||
*(.text.nxsem_destroy)
|
||||
*(.text._ZN21MavlinkStreamAltitude4sendEv)
|
||||
*(.text._ZN7sensors14VehicleAirData12UpdateStatusEv)
|
||||
|
||||
@@ -171,7 +171,8 @@
|
||||
*(.text._ZN28MavlinkStreamGpsGlobalOrigin4sendEv)
|
||||
*(.text._ZN11ControlMath15bodyzToAttitudeEN6matrix7Vector3IfEEfR27vehicle_attitude_setpoint_s)
|
||||
*(.text._ZN4EKF217UpdateRangeSampleER17ekf2_timestamps_s)
|
||||
*(.text._ZN3Ekf24controlOpticalFlowFusionERKN9estimator9imuSampleE)
|
||||
*(.text._ZN17OpticalFlowAiding6updateER3EkfRKN9estimator9imuSampleE)
|
||||
*(.text._ZN17OpticalFlowSource6updateER3EkfRKN9estimator9imuSampleEb)
|
||||
*(.text._ZN19MavlinkStreamRawRpm4sendEv)
|
||||
*(.text._ZN13MavlinkStream10const_rateEv)
|
||||
*(.text._ZN4EKF215PublishOdometryERKyRKN9estimator9imuSampleERKN6matrix7Vector3IfEE)
|
||||
@@ -338,7 +339,6 @@
|
||||
*(.text._ZN14FlightTaskAutoD1Ev)
|
||||
*(.text._ZN4uORB10DeviceNode22get_initial_generationEv)
|
||||
*(.text._ZN3Ekf23controlGnssHeightFusionERKN9estimator10gnssSampleE)
|
||||
*(.text._ZN3Ekf40updateOnGroundMotionForOpticalFlowChecksEv)
|
||||
*(.text._ZN6matrix6MatrixIfLj3ELj1EEC1Ev)
|
||||
*(.text._ZN14ZeroGyroUpdate6updateER3EkfRKN9estimator9imuSampleE)
|
||||
*(.text._ZN30MavlinkStreamOpenDroneIdSystem4sendEv)
|
||||
@@ -401,7 +401,7 @@
|
||||
*(.text.nxsem_set_protocol)
|
||||
*(.text.write)
|
||||
*(.text._ZN22MavlinkStreamSysStatus4sendEv)
|
||||
*(.text._ZN4EKF216UpdateFlowSampleER17ekf2_timestamps_s)
|
||||
*(.text._ZN17OpticalFlowAiding13updateSamplesER3Ekf)
|
||||
*(.text._ZN4cdevL10cdev_ioctlEP4fileim)
|
||||
*(.text._ZN7Mavlink10send_bytesEPKhj)
|
||||
*(.text._ZNK8Failsafe17checkModeFallbackERK16failsafe_flags_sh)
|
||||
@@ -507,7 +507,7 @@
|
||||
*(.text._ZN13NavigatorMode3runEb)
|
||||
*(.text._ZL19param_find_internalPKcb)
|
||||
*(.text.uart_datasent)
|
||||
*(.text._ZN4EKF221PublishOpticalFlowVelERKy)
|
||||
*(.text._ZN17OpticalFlowSource7publishERK3Ekf)
|
||||
*(.text.nxsem_destroy)
|
||||
*(.text.file_write)
|
||||
*(.text._ZN21MavlinkStreamAltitude4sendEv)
|
||||
|
||||
@@ -171,7 +171,8 @@
|
||||
*(.text._ZN28MavlinkStreamGpsGlobalOrigin4sendEv)
|
||||
*(.text._ZN11ControlMath15bodyzToAttitudeEN6matrix7Vector3IfEEfR27vehicle_attitude_setpoint_s)
|
||||
*(.text._ZN4EKF217UpdateRangeSampleER17ekf2_timestamps_s)
|
||||
*(.text._ZN3Ekf24controlOpticalFlowFusionERKN9estimator9imuSampleE)
|
||||
*(.text._ZN17OpticalFlowAiding6updateER3EkfRKN9estimator9imuSampleE)
|
||||
*(.text._ZN17OpticalFlowSource6updateER3EkfRKN9estimator9imuSampleEb)
|
||||
*(.text._ZN19MavlinkStreamRawRpm4sendEv)
|
||||
*(.text._ZN13MavlinkStream10const_rateEv)
|
||||
*(.text._ZN4EKF215PublishOdometryERKyRKN9estimator9imuSampleERKN6matrix7Vector3IfEE)
|
||||
@@ -338,7 +339,6 @@
|
||||
*(.text._ZN14FlightTaskAutoD1Ev)
|
||||
*(.text._ZN4uORB10DeviceNode22get_initial_generationEv)
|
||||
*(.text._ZN3Ekf23controlGnssHeightFusionERKN9estimator10gnssSampleE)
|
||||
*(.text._ZN3Ekf40updateOnGroundMotionForOpticalFlowChecksEv)
|
||||
*(.text._ZN6matrix6MatrixIfLj3ELj1EEC1Ev)
|
||||
*(.text._ZN14ZeroGyroUpdate6updateER3EkfRKN9estimator9imuSampleE)
|
||||
*(.text._ZN30MavlinkStreamOpenDroneIdSystem4sendEv)
|
||||
@@ -401,7 +401,7 @@
|
||||
*(.text.nxsem_set_protocol)
|
||||
*(.text.write)
|
||||
*(.text._ZN22MavlinkStreamSysStatus4sendEv)
|
||||
*(.text._ZN4EKF216UpdateFlowSampleER17ekf2_timestamps_s)
|
||||
*(.text._ZN17OpticalFlowAiding13updateSamplesER3Ekf)
|
||||
*(.text._ZN4cdevL10cdev_ioctlEP4fileim)
|
||||
*(.text._ZN7Mavlink10send_bytesEPKhj)
|
||||
*(.text._ZNK8Failsafe17checkModeFallbackERK16failsafe_flags_sh)
|
||||
@@ -506,7 +506,7 @@
|
||||
*(.text._ZN13NavigatorMode3runEb)
|
||||
*(.text._ZL19param_find_internalPKcb)
|
||||
*(.text.uart_datasent)
|
||||
*(.text._ZN4EKF221PublishOpticalFlowVelERKy)
|
||||
*(.text._ZN17OpticalFlowSource7publishERK3Ekf)
|
||||
*(.text.nxsem_destroy)
|
||||
*(.text.file_write)
|
||||
*(.text._ZN21MavlinkStreamAltitude4sendEv)
|
||||
|
||||
@@ -173,7 +173,8 @@
|
||||
*(.text._ZN28MavlinkStreamGpsGlobalOrigin4sendEv)
|
||||
*(.text._ZN11ControlMath15bodyzToAttitudeEN6matrix7Vector3IfEEfR27vehicle_attitude_setpoint_s)
|
||||
*(.text._ZN4EKF217UpdateRangeSampleER17ekf2_timestamps_s)
|
||||
*(.text._ZN3Ekf24controlOpticalFlowFusionERKN9estimator9imuSampleE)
|
||||
*(.text._ZN17OpticalFlowAiding6updateER3EkfRKN9estimator9imuSampleE)
|
||||
*(.text._ZN17OpticalFlowSource6updateER3EkfRKN9estimator9imuSampleEb)
|
||||
*(.text._ZN19MavlinkStreamRawRpm4sendEv)
|
||||
*(.text._ZN13MavlinkStream10const_rateEv)
|
||||
*(.text._ZN4EKF215PublishOdometryERKyRKN9estimator9imuSampleERKN6matrix7Vector3IfEE)
|
||||
@@ -344,7 +345,6 @@
|
||||
*(.text._ZN14FlightTaskAutoD1Ev)
|
||||
*(.text._ZN4uORB10DeviceNode22get_initial_generationEv)
|
||||
*(.text._ZN3Ekf23controlGnssHeightFusionERKN9estimator10gnssSampleE)
|
||||
*(.text._ZN3Ekf40updateOnGroundMotionForOpticalFlowChecksEv)
|
||||
*(.text._ZN6matrix6MatrixIfLj3ELj1EEC1Ev)
|
||||
*(.text._ZN14ZeroGyroUpdate6updateER3EkfRKN9estimator9imuSampleE)
|
||||
*(.text._ZN30MavlinkStreamOpenDroneIdSystem4sendEv)
|
||||
@@ -408,7 +408,7 @@
|
||||
*(.text.nxsem_set_protocol)
|
||||
*(.text.write)
|
||||
*(.text._ZN22MavlinkStreamSysStatus4sendEv)
|
||||
*(.text._ZN4EKF216UpdateFlowSampleER17ekf2_timestamps_s)
|
||||
*(.text._ZN17OpticalFlowAiding13updateSamplesER3Ekf)
|
||||
*(.text._ZN4cdevL10cdev_ioctlEP4fileim)
|
||||
*(.text._ZN7Mavlink10send_bytesEPKhj)
|
||||
*(.text._ZNK8Failsafe17checkModeFallbackERK16failsafe_flags_sh)
|
||||
@@ -516,7 +516,7 @@
|
||||
*(.text._ZN13NavigatorMode3runEb)
|
||||
*(.text._ZL19param_find_internalPKcb)
|
||||
*(.text.uart_datasent)
|
||||
*(.text._ZN4EKF221PublishOpticalFlowVelERKy)
|
||||
*(.text._ZN17OpticalFlowSource7publishERK3Ekf)
|
||||
*(.text.nxsem_destroy)
|
||||
*(.text.file_write)
|
||||
*(.text._ZN21MavlinkStreamAltitude4sendEv)
|
||||
|
||||
@@ -808,7 +808,7 @@
|
||||
},
|
||||
{
|
||||
"type": "UrlToLocalSite",
|
||||
"fileRelativeToRoot": "en\\gps_compass\\rtk_gps_hex_hereplus.md",
|
||||
"fileRelativeToRoot": "en\\gps_compass\\rtk_gps_cubepilot_hereplus.md",
|
||||
"link": {
|
||||
"url": "https://docs.px4.io/v1.11/en/gps_compass/rtk_gps_hex_hereplus.html",
|
||||
"text": "PX4v1.11 docs"
|
||||
@@ -1598,7 +1598,7 @@
|
||||
},
|
||||
{
|
||||
"type": "UrlToLocalSite",
|
||||
"fileRelativeToRoot": "en\\gps_compass\\rtk_gps_hex_hereplus.md",
|
||||
"fileRelativeToRoot": "en\\gps_compass\\rtk_gps_cubepilot_hereplus.md",
|
||||
"link": {
|
||||
"url": "https://docs.px4.io/v1.11/en/gps_compass/rtk_gps_hex_hereplus",
|
||||
"text": "PX4v1.11 docs"
|
||||
|
||||
|
After Width: | Height: | Size: 206 KiB |
|
After Width: | Height: | Size: 239 KiB |
|
After Width: | Height: | Size: 109 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 355 KiB |
|
After Width: | Height: | Size: 333 KiB |
|
After Width: | Height: | Size: 174 KiB |
|
After Width: | Height: | Size: 84 KiB |
|
After Width: | Height: | Size: 51 KiB |