diff --git a/libraries/AP_HAL_ChibiOS/hwdef/luminousbee5/defaults.parm b/libraries/AP_HAL_ChibiOS/hwdef/luminousbee5/defaults.parm new file mode 100644 index 0000000000..cd5343174d --- /dev/null +++ b/libraries/AP_HAL_ChibiOS/hwdef/luminousbee5/defaults.parm @@ -0,0 +1,211 @@ +AHRS_GPS_USE,2 +AHRS_ORIENTATION,6 +ANGLE_MAX,4500 +ARMING_CHECK,13822 +ATC_ACCEL_P_MAX,200000 +ATC_ACCEL_R_MAX,200000 +ATC_ACCEL_Y_MAX,50000 +ATC_ANG_PIT_P,18 +ATC_ANG_RLL_P,18 +ATC_ANG_YAW_P,10 +ATC_RAT_PIT_D,0.003 +ATC_RAT_PIT_FLTD,50 +ATC_RAT_PIT_FLTT,25 +ATC_RAT_PIT_I,0.14 +ATC_RAT_PIT_P,0.14 +ATC_RAT_RLL_D,0.003 +ATC_RAT_RLL_FLTD,50 +ATC_RAT_RLL_FLTT,25 +ATC_RAT_RLL_I,0.14 +ATC_RAT_RLL_P,0.14 +ATC_RAT_YAW_D,0 +ATC_RAT_YAW_FLTD,50 +ATC_RAT_YAW_FLTE,3.7 +ATC_RAT_YAW_FLTT,25 +ATC_RAT_YAW_I,0.05 +ATC_RAT_YAW_P,0.5 +AUTOTUNE_AGGR,0.075 +AUTOTUNE_MIN_D,0.0003 +AVOID_ENABLE,0 +BATT_AMP_OFFSET,0 +BATT_AMP_PERVLT,4.6135 +BATT_ARM_MAH,0 +BATT_ARM_VOLT,7.2 +BATT_CAPACITY,3400 +BATT_CRT_MAH,0 +BATT_CRT_VOLT,6 +BATT_CURR_PIN,15 +BATT_FS_CRT_ACT,1 +BATT_FS_LOW_ACT,2 +BATT_FS_VOLTSRC,0 +BATT_LOW_MAH,0 +BATT_LOW_TIMER,10 +BATT_LOW_VOLT,6.2 +BATT_MONITOR,4 +BATT_OPTIONS,0 +BATT_SERIAL_NUM,-1 +BATT_VOLT_MULT,3.28 +BATT_VOLT_PIN,14 +BRD_SAFETYENABLE,0 +BRD_SAFETYOPTION,0 +CAN_D1_PROTOCOL,0 +CAN_D2_PROTOCOL,0 +COMPASS_AUTODEC,1 +COMPASS_EXTERNAL,1 +COMPASS_ORIENT,12 +COMPASS_TYPEMASK,510846 +COMPASS_USE2,0 +COMPASS_USE3,0 +COMPASS_CAL_FIT,16 +DISARM_DELAY,10 +EK3_IMU_MASK,1 +EK3_POSNE_M_NSE,0.1 +EK3_SRC1_POSXY,3 +EK3_SRC1_POSZ,3 +EK3_SRC1_VELXY,3 +EK3_SRC1_VELZ,3 +EK3_SRC3_POSZ,1 +EK3_ALT_M_NSE,2 +ESC_CALIBRATION,9 +FLTMODE3,2 +FLTMODE4,2 +FLTMODE5,5 +FLTMODE6,5 +FRAME_CLASS,1 +FRSKY_DNLINK1_ID,-1 +FRSKY_DNLINK2_ID,-1 +FRSKY_DNLINK_ID,-1 +FRSKY_UPLINK_ID,-1 +FS_OPTIONS,20 +FS_THR_ENABLE,0 +FS_VIBE_ENABLE,0 +GND_EFFECT_COMP,0 +GPS_AUTO_SWITCH,0 +GPS_GNSS_MODE,9 +GPS_RATE_MS,100 +GPS_SBAS_MODE,0 +GPS_TYPE,2 +INS_ACC_BODYFIX,1 +INS_ACCEL_FILTER,10 +INS_ENABLE_MASK,1 +INS_FAST_SAMPLE,1 +INS_GYRO_FILTER,80 +INS_GYRO_RATE,2 +INS_HNTC2_ATT,16 +INS_HNTC2_BW,50 +INS_HNTC2_ENABLE,0 +INS_HNTC2_FREQ,103 +INS_HNTC2_HMNCS,1 +INS_HNTC2_MODE,0 +INS_HNTC2_OPTS,0 +INS_HNTC2_REF,0 +INS_HNTCH_ATT,40 +INS_HNTCH_BW,10 +INS_HNTCH_ENABLE,1 +INS_HNTCH_FREQ,50 +INS_HNTCH_HMNCS,22 +INS_HNTCH_MODE,3 +INS_HNTCH_OPTS,22 +INS_HNTCH_REF,1 +INS_LOG_BAT_CNT,32 +INS_LOG_BAT_OPT,2 +LAND_ALT_LOW,500 +LAND_SPEED,80 +LAND_SPEED_HIGH,300 +LOG_BITMASK,141310 +LOG_FILE_DSRMROT,1 +LOIT_SPEED,2000 +MOT_BAT_VOLT_MAX,7.56 +MOT_BAT_VOLT_MIN,5.2 +MOT_HOVER_LEARN,1 +MOT_PWM_MAX,2000 +MOT_PWM_MIN,1000 +MOT_PWM_TYPE,6 +MOT_SPIN_ARM,0.05 +MOT_SPIN_MIN,0.16 +MOT_THST_EXPO,0.55 +MOT_THST_HOVER,0.47 +NTF_BUZZ_TYPES,1 +NTF_LED_BRIGHT,1 +NTF_LED_TYPES,1 +PSC_ACCZ_I,0.94 +PSC_ACCZ_P,0.47 +PSC_JERK_XY,6 +PSC_JERK_Z,6 +PSC_POSZ_P,1 +RC1_MAX,1900 +RC1_MIN,1100 +RC2_MAX,1900 +RC2_MIN,1100 +RC3_MAX,1900 +RC3_MIN,1100 +RC4_MAX,1900 +RC4_MIN,1100 +RC6_OPTION,5 +RC_PROTOCOLS,0 +RELAY_PIN,-1 +RELAY_PIN2,-1 +RTL_ALT,1500 +SCHED_LOOP_RATE,800 +SERIAL1_BAUD,921 +SERIAL1_PROTOCOL,2 +SERIAL2_OPTIONS,8 +SERIAL2_PROTOCOL,2 +SERIAL4_BAUD,115 +SERIAL4_PROTOCOL,16 +SERIAL5_BAUD,921 +SERIAL5_PROTOCOL,-1 +SERIAL6_BAUD,921 +SERIAL6_PROTOCOL,-1 +SERVO1_FUNCTION,33 +SERVO1_MAX,2000 +SERVO1_MIN,1000 +SERVO1_TRIM,1500 +SERVO2_FUNCTION,34 +SERVO2_MAX,2000 +SERVO2_MIN,1000 +SERVO2_TRIM,1500 +SERVO3_FUNCTION,35 +SERVO3_MAX,2000 +SERVO3_MIN,1000 +SERVO3_TRIM,1500 +SERVO4_FUNCTION,36 +SERVO4_MAX,2000 +SERVO4_MIN,1000 +SERVO4_TRIM,1500 +SERVO_BLH_AUTO,1 +SERVO_BLH_BDMASK,15 +SERVO_BLH_POLES,12 +SERVO_BLH_TRATE,0 +SERVO_DSHOT_ESC,1 +SERVO_DSHOT_RATE,2 +SHOW_CTRL_MODE,1 +SHOW_CTRL_RATE,10 +SHOW_GROUP,0 +SHOW_LED0_CHAN,7 +SHOW_LED0_COUNT,100 +SHOW_LED0_GAMMA,2.2 +SHOW_LED0_TYPE,2 +SHOW_MAX_XY_ERR,3 +SHOW_MODE_BOOT,2 +SHOW_PRE_LIGHTS,2 +SHOW_START_AUTH,0 +SHOW_SYNC_MODE,1 +SHOW_TAKEOFF_ALT,2.5 +SHOW_VEL_FF_GAIN,1 +SR1_EXT_STAT,0 +SR1_EXTRA1,0 +SR1_EXTRA2,0 +SR1_EXTRA3,0 +SR1_POSITION,0 +SR1_RAW_SENS,0 +SR1_RC_CHAN,0 +SRTL_POINTS,0 +TERRAIN_ENABLE,0 +WP_YAW_BEHAVIOR,0 +WPNAV_ACCEL,300 +WPNAV_ACCEL_Z,300 +WPNAV_JERK,6 +WPNAV_SPEED,1000 +WPNAV_SPEED_DN,300 +WPNAV_SPEED_UP,300 \ No newline at end of file diff --git a/libraries/AP_HAL_ChibiOS/hwdef/luminousbee5/hwdef-bl.dat b/libraries/AP_HAL_ChibiOS/hwdef/luminousbee5/hwdef-bl.dat index aeede2355d..b6d3d1b569 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/luminousbee5/hwdef-bl.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/luminousbee5/hwdef-bl.dat @@ -1,5 +1,8 @@ -# LUMINOUS BEE 5.1 +# LUMINOUS BEE 5.32/5.4 # hw definition file for processing by chibios_hwdef.py +#define new bootloader baudrate + +define BOOTLOADER_BAUDRATE 921600 # MCU class and specific type MCU STM32H7xx STM32H743xx @@ -26,7 +29,13 @@ I2C_ORDER I2C1 define HAL_I2C_INTERNAL_MASK 0 # order of UARTs (and USB) for bootloading -SERIAL_ORDER OTG1 UART7 +SERIAL_ORDER USART2 OTG1 + +# USART2 serial2 telem1 + + +PD5 USART2_TX USART2 +PD6 USART2_RX USART2 # UART7 is debug PE7 UART7_RX UART7 NODMA @@ -41,11 +50,11 @@ PA13 JTMS-SWDIO SWD PA14 JTCK-SWCLK SWD # CS lines -PB4 UWB_CS CS +#PB4 UWB_CS CS PC2 BMI088_ACCEL_CS CS PC15 BMI088_GYRO_CS CS PD7 BARO_CS CS PE15 MAG_CS CS PB11 LED_BOOTLOADER OUTPUT -define HAL_LED_ON 0 +define HAL_LED_ON 0 \ No newline at end of file diff --git a/libraries/AP_HAL_ChibiOS/hwdef/luminousbee5/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/luminousbee5/hwdef.dat index 836dd20448..75edf91bee 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/luminousbee5/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/luminousbee5/hwdef.dat @@ -1,6 +1,10 @@ -# LUMINOUS BEE 5.1 +#42605 AND 42688 TOGETHER +# With suggestions by Andy +# LUMINOUS BEE 5.32/5.4 bidirectional telemetry # hw definition file for processing by chibios_hwdef.py +MCU_CLOCKRATE_MHZ 480 + # MCU class and specific type MCU STM32H7xx STM32H743xx @@ -20,8 +24,13 @@ FLASH_RESERVE_START_KB 128 define HAL_STORAGE_SIZE 16384 +#define FAST_MCU 1 # HAL_HAVE_FAST_MCU 1 # 480 Mhz + # only one I2C bus I2C_ORDER I2C1 +NODMA I2C* +define STM32_I2C_USE_DMA FALSE + define HAL_I2C_INTERNAL_MASK 0 @@ -42,6 +51,9 @@ PA5 SPI1_SCK SPI1 PA6 SPI1_MISO SPI1 PA7 SPI1_MOSI SPI1 +# optional baro2 +PA8 BARO2_CS CS + # This is the pin that senses USB being connected. It is an input pin # setup as OPENDRAIN. PA9 VBUS INPUT #OPENDRAIN @@ -62,21 +74,21 @@ PB2 BOOT1 INPUT PB5 VDD_BRICK_VALID INPUT PULLDOWN # USART1 TX now as led strip control -PB6 TIM4_CH1 TIM4 PWM(7) GPIO(56) # PB6 +PB6 TIM4_CH1 TIM4 PWM(7) GPIO(56) # PB6 USART1_TX USART1 PB7 USART1_RX USART1 # UWB DW1000 -PB4 UWB_CS CS +#PB4 UWB_CS CS PB8 I2C1_SCL I2C1 PB9 I2C1_SDA I2C1 # SPI2 is FRAM PB10 SPI2_SCK SPI2 -PB12 CAN2_RX CAN2 -PB13 CAN2_TX CAN2 # this is SPI2_SCK on beta board +#PB12 CAN2_RX CAN2 +#PB13 CAN2_TX CAN2 # this is SPI2_SCK on beta board PB14 SPI2_MISO SPI2 PB15 SPI2_MOSI SPI2 @@ -84,13 +96,15 @@ PB15 SPI2_MOSI SPI2 PC0 VBUS_VALID INPUT PULLDOWN #BMI088 CS -PC2 BMI088_ACCEL_CS CS -PC15 BMI088_GYRO_CS CS +#PC2 BMI088_ACCEL_CS CS #opt. second imu +#PC15 BMI088_GYRO_CS CS #opt. second imu PC3 LED_SAFETY OUTPUT PC4 SAFETY_IN INPUT PULLDOWN PC5 VDD_PERIPH_EN OUTPUT HIGH -PC7 TIM3_CH2 TIM3 RCININT PULLDOWN LOW # also USART6_RX for serial RC +PC7 TIM3_CH2 TIM3 RCININT PULLDOWN LOW # also USART6_RX for serial + + # Now setup the pins for the microSD card, if available. PC8 SDMMC1_D0 SDMMC1 @@ -101,14 +115,15 @@ PC12 SDMMC1_CK SDMMC1 PD2 SDMMC1_CMD SDMMC1 -PC13 SBUS_INV OUTPUT +#PC13 SBUS_INV OUTPUT -PD0 CAN1_RX CAN1 -PD1 CAN1_TX CAN1 +#PD0 CAN1_RX CAN1 +#PD1 CAN1_TX CAN1 -# USART2 serial2 telem1 +# USART2 serial1 telem1 +PD3 IMU_CS CS # ex usart2 RTS PD5 USART2_TX USART2 PD6 USART2_RX USART2 @@ -116,7 +131,7 @@ PD6 USART2_RX USART2 PD7 BARO_CS CS -# USART3 serial3 telem2 +# USART3 serial2 telem2 PD8 USART3_TX USART3 PD9 USART3_RX USART3 PD11 USART3_CTS USART3 @@ -127,35 +142,40 @@ PD12 USART3_RTS USART3 PD10 FRAM_CS CS SPEED_VERYLOW -PD15 20608_DRDY INPUT # IMU Luminous Bee -# UART8 serial4 FrSky +#PD15 20608_DRDY INPUT # IMU Luminous Bee +# CROSSFIRE RX PE0 UART8_RX UART8 +# CROSSFIRE TX PE1 UART8_TX UART8 -#set up SPI bus4 for UWB +#set up SPI bus4 PE2 SPI4_SCK SPI4 PE5 SPI4_MISO SPI4 PE6 SPI4_MOSI SPI4 +DMA_NOSHARE for SPI4* #ANDY -PE3 VDD_SENSORS_EN OUTPUT HIGH -PE4 SPEKTRUM_PWR OUTPUT HIGH -# UART7 is debug +#PE3 VDD_SENSORS_EN OUTPUT HIGH +#PE4 SPEKTRUM_PWR OUTPUT HIGH + +# UART7 FOR REMOTE ID OPTIONS PE7 UART7_RX UART7 NODMA PE8 UART7_TX UART7 NODMA -PE11 TIM1_CH2 TIM1 PWM(1) GPIO(50) #52 -PE14 TIM1_CH4 TIM1 PWM(2) GPIO(51) #50 +PE11 TIM1_CH2 TIM1 PWM(1) GPIO(50) BIDIR #52 +PE14 TIM1_CH4 TIM1 PWM(2) GPIO(51) BIDIR #50 PE9 TIM1_CH1 TIM1 PWM(3) GPIO(52) #53 PE13 TIM1_CH3 TIM1 PWM(4) GPIO(53) #51 PD13 TIM4_CH2 TIM4 PWM(5) GPIO(54) PD14 TIM4_CH3 TIM4 PWM(6) GPIO(55) +DMA_PRIORITY TIM1_UP TIM1_CH4 TIM1_CH2 -PE12 MAG_DRDY INPUT + +#PE12 MAG_DRDY INPUT PE15 MAG_CS CS # SPI device table. The DEVID values are chosen to match the PX4 port @@ -165,10 +185,13 @@ PE15 MAG_CS CS SPIDEV dps310 SPI2 DEVID3 BARO_CS MODE3 5*MHZ 5*MHZ #SPIDEV icm20608 SPI1 DEVID6 20608_CS MODE3 2*MHZ 8*MHZ SPIDEV hmc5843 SPI1 DEVID5 MAG_CS MODE3 11*MHZ 11*MHZ -SPIDEV bmi088_g SPI1 DEVID1 BMI088_GYRO_CS MODE3 10*MHZ 10*MHZ -SPIDEV bmi088_a SPI1 DEVID2 BMI088_ACCEL_CS MODE3 10*MHZ 10*MHZ +#SPIDEV bmi088_g SPI1 DEVID1 BMI088_GYRO_CS MODE3 10*MHZ 10*MHZ +#SPIDEV bmi088_a SPI1 DEVID2 BMI088_ACCEL_CS MODE3 10*MHZ 10*MHZ SPIDEV ramtron SPI2 DEVID10 FRAM_CS MODE3 8*MHZ 8*MHZ -SPIDEV dwm1000 SPI4 DEVID5 UWB_CS MODE0 3*MHZ 20*MHZ +#SPIDEV dwm1000 SPI4 DEVID5 UWB_CS MODE0 3*MHZ 20*MHZ +SPIDEV icm42605 SPI4 DEVID4 IMU_CS MODE3 2*MHZ 16*MHZ +SPIDEV icm42688 SPI4 DEVID4 IMU_CS MODE3 2*MHZ 16*MHZ + define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS" define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN" @@ -179,7 +202,7 @@ define HAL_STORAGE_SIZE 16384 define HAL_WITH_RAMTRON 1 # fallback to flash is no FRAM fitted -#STORAGE_FLASH_PAGE 22 +#define STORAGE_FLASH_PAGE 22 # Enable FAT filesystem support (needs a microSD defined via SDMMC). define HAL_OS_FATFS_IO 1 @@ -202,16 +225,22 @@ define HAL_GPIO_C_LED_PIN 2 # battery setup define HAL_BATT_VOLT_PIN 14 define HAL_BATT_CURR_PIN 15 -define HAL_BATT_VOLT_SCALE 10.1 -define HAL_BATT_CURR_SCALE 17.0 +define HAL_BATT_VOLT_SCALE 3.28 +define HAL_BATT_CURR_SCALE 3.06 # setup serial port defaults for ESP8266 define DEFAULT_SERIAL5_PROTOCOL SerialProtocol_MAVLink define DEFAULT_SERIAL5_BAUD 921600 +# 6 PWM available by default +define BOARD_PWM_COUNT_DEFAULT 7 + + # two IMUs #IMU Invensense SPI:icm20608 ROTATION_YAW_180 -IMU BMI088 SPI:bmi088_a SPI:bmi088_g ROTATION_ROLL_180_YAW_90 +IMU Invensensev3 SPI:icm42605 ROTATION_NONE +IMU Invensensev3 SPI:icm42688 ROTATION_NONE +#IMU BMI088 SPI:bmi088_a SPI:bmi088_g ROTATION_ROLL_180_YAW_90 define HAL_DEFAULT_INS_FAST_SAMPLE 1 # 2 compasses. R15 has LIS3MDL instead of HMC5843 @@ -222,5 +251,5 @@ COMPASS HMC5843 SPI:hmc5843 false ROTATION_PITCH_180 # also probe all types of external I2C compasses define HAL_PROBE_EXTERNAL_I2C_COMPASSES -# TWO barometer +# ONE barometer BARO DPS280 SPI:dps310