Skip to content

Commit 4c37a27

Browse files
Huibeantridge
authored andcommitted
AP_HAL_ChibiOS:add vimdrones ap_periph pico and servo hub 4chp
1 parent 828c130 commit 4c37a27

16 files changed

+2826
-0
lines changed
20.3 KB
Binary file not shown.

Tools/bootloaders/VM-L431-Periph-Pico_bl.hex

Lines changed: 1303 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
20.3 KB
Binary file not shown.

Tools/bootloaders/VM-L431-SRV-Hub-4CHP_bl.hex

Lines changed: 1303 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
### VM-L431-Periph-Pico
2+
3+
Vimdrones AP_Periph Pico board to convert serial(GPS) and I2C(COMPASS/Air Speed) device in to Dronecan device.
4+
5+
#### Hardware Features
6+
7+
- STM32L431 microcontroller
8+
- CAN bus interface
9+
- 1 Telem with I2C
10+
- 1 Telem with Flow Control
11+
12+
#### Wiring Diagram
13+
14+
![Vimdrones AP_Periph Pico Wiring Diagram](vimdrones_ap_periph_pico_wiring.png)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FORMAT_VERSION 2
2+
CAN_NODE 0
3+
CAN_BAUDRATE 1000000
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include ../VM-L431/hwdef-bl.inc
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
include ../VM-L431/hwdef.inc
2+
3+
define CAN_APP_NODE_NAME "com.vimdrones.periph_pico"
4+
SERIAL_ORDER EMPTY USART1 USART2
5+
PB6 USART1_TX USART1
6+
PB7 USART1_RX USART1
7+
PB4 USART1_CTS USART1
8+
PB3 USART1_RTS USART1
9+
10+
PA2 USART2_TX USART2
11+
PA3 USART2_RX USART2
12+
13+
# one I2C bus
14+
I2C_ORDER I2C1
15+
PA9 I2C1_SCL I2C1
16+
PA10 I2C1_SDA I2C1
17+
18+
define HAL_USE_ADC FALSE
19+
20+
# GPS / default enable
21+
define AP_PERIPH_GPS_ENABLED 1
22+
define GPS_MAX_RATE_MS 200
23+
24+
define GPS_MAX_RECEIVERS 1
25+
define GPS_MAX_INSTANCES 1
26+
27+
define HAL_PERIPH_GPS_PORT_DEFAULT 2
28+
29+
# Compass / default enable
30+
define AP_PERIPH_MAG_ENABLED 1
31+
define HAL_COMPASS_MAX_SENSORS 1
32+
define HAL_PROBE_EXTERNAL_I2C_COMPASSES
33+
34+
define AP_PERIPH_SERIAL_OPTIONS_ENABLED 1
35+
36+
# Rangefinder
37+
define AP_PERIPH_RANGEFINDER_ENABLED 1
38+
# disable rangefinder by default
39+
define AP_PERIPH_RANGEFINDER_PORT_DEFAULT -1
40+
41+
# MSP
42+
define AP_PERIPH_MSP_ENABLED 1
43+
define HAL_MSP_ENABLED 1
44+
define AP_PERIPH_MSP_PORT_DEFAULT -1
45+
46+
# ADSB
47+
define AP_PERIPH_ADSB_ENABLED 1
48+
define HAL_PERIPH_ADSB_PORT_DEFAULT -1
49+
50+
# BARO
51+
define AP_PERIPH_BARO_ENABLED 1
52+
define BARO_MAX_INSTANCES 1
53+
54+
# bootloader embedding / bootloader flashing not available
55+
define AP_BOOTLOADER_FLASHING_ENABLED 0
Loading
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
### VM-L431-SRV-Hub-4CHP
2+
3+
Vimdrones CAN Servo Hub peripheral with 4 channels PWM output and 4 channel Servo VCC current measure (4CHP).
4+
5+
#### Hardware Features
6+
7+
- STM32L431 microcontroller
8+
- CAN bus interface
9+
- 4 PWM output channels
10+
- 4 ADC inputs for current sensing
11+
12+
#### Wiring Diagram
13+
14+
![Vimdrones CAN Servo Hub 4CHP Wiring Diagram](vimdrones_can_servo_hub_4chp_wiring.png)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FORMAT_VERSION 2
2+
CAN_NODE 0
3+
CAN_BAUDRATE 1000000
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include ../VM-L431/hwdef-bl.inc
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
include ../VM-L431/hwdef.inc
2+
3+
define CAN_APP_NODE_NAME "com.vimdrones.srv-hub-4ch-p"
4+
SERIAL_ORDER USART1
5+
PB6 USART1_TX USART1 NODMA
6+
PB7 USART1_RX USART1 NODMA
7+
8+
STDOUT_SERIAL SD1
9+
STDOUT_BAUDRATE 57600
10+
11+
define HAL_USE_ADC FALSE
12+
13+
#Servo VCC Current Sampling, for future development
14+
# define STM32_ADC_USE_ADC1 TRUE
15+
# PA4 SPARE1_ADC1 ADC1 SCALE(1) # Current Sampling on PWM(1)
16+
# PA5 SPARE2_ADC1 ADC1 SCALE(1) # Current Sampling on PWM(2)
17+
# PA6 SPARE3_ADC1 ADC1 SCALE(1) # Current Sampling on PWM(3)
18+
# PA7 SPARE4_ADC1 ADC1 SCALE(1) # Current Sampling on PWM(4)
19+
20+
define AP_PERIPH_RC_OUT_ENABLED 1
21+
22+
# --------------------- PWM -----------------------
23+
PA15 TIM2_CH1 TIM2 PWM(1) GPIO(50)
24+
PB3 TIM2_CH2 TIM2 PWM(2) GPIO(51)
25+
PA2 TIM2_CH3 TIM2 PWM(3) GPIO(52)
26+
PA3 TIM2_CH4 TIM2 PWM(4) GPIO(53)
27+
28+
# bootloader embedding / bootloader flashing not available
29+
define AP_BOOTLOADER_FLASHING_ENABLED 0
Loading
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# hw definition file Vimdrones L431 CAN node
2+
3+
# MCU class and specific type
4+
MCU STM32L431 STM32L431xx
5+
6+
# crystal frequency
7+
OSCILLATOR_HZ 24000000
8+
define STM32_HSE_BYPASS
9+
10+
# board ID for firmware load
11+
APJ_BOARD_ID 1407
12+
13+
# setup build for a peripheral firmware
14+
env AP_PERIPH 1
15+
16+
FLASH_RESERVE_START_KB 0
17+
FLASH_BOOTLOADER_LOAD_KB 36
18+
FLASH_SIZE_KB 256
19+
20+
# reserve some space for params
21+
APP_START_OFFSET_KB 4
22+
23+
# enable CAN support
24+
define CAN_APP_NODE_NAME "com.vimdrones.periph_bl"
25+
PA11 CAN1_RX CAN1
26+
PA12 CAN1_TX CAN1
27+
# PC13 GPIO_CAN1_SILENT OUTPUT PUSHPULL SPEED_LOW LOW
28+
29+
CAN_ORDER 1
30+
31+
# ---------------------------------------------
32+
33+
# make bl baudrate match debug baudrate for easier debugging
34+
define BOOTLOADER_BAUDRATE 57600
35+
36+
# use a small bootloader timeout
37+
define HAL_BOOTLOADER_TIMEOUT 1000
38+
39+
define HAL_USE_SERIAL FALSE
40+
41+
MAIN_STACK 0x800
42+
PROCESS_STACK 0x800
43+
44+
# debugger support
45+
PA13 JTMS-SWDIO SWD
46+
PA14 JTCK-SWCLK SWD
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# hw definition file for Vimdrones L431 CAN node
2+
3+
# MCU class and specific type
4+
MCU STM32L431 STM32L431xx
5+
6+
# bootloader starts firmware at 36k + 4k (STORAGE_FLASH)
7+
FLASH_RESERVE_START_KB 40
8+
FLASH_SIZE_KB 256
9+
10+
# store parameters in pages 18 and 19
11+
STORAGE_FLASH_PAGE 18
12+
define HAL_STORAGE_SIZE 800
13+
14+
# ChibiOS system timer
15+
STM32_ST_USE_TIMER 15
16+
define CH_CFG_ST_RESOLUTION 16
17+
18+
# board ID for firmware load
19+
APJ_BOARD_ID 1407
20+
21+
# crystal frequency
22+
OSCILLATOR_HZ 24000000
23+
define STM32_HSE_BYPASS
24+
25+
env AP_PERIPH 1
26+
27+
define HAL_NO_GPIO_IRQ
28+
define HAL_USE_EMPTY_IO TRUE
29+
define DMA_RESERVE_SIZE 0
30+
31+
# MAIN_STACK is stack for ISR handlers
32+
MAIN_STACK 0x300
33+
34+
# PROCESS_STACK controls stack for main thread
35+
PROCESS_STACK 0xA00
36+
37+
# we setup a small defaults.parm
38+
define AP_PARAM_MAX_EMBEDDED_PARAM 512
39+
40+
# debugger support
41+
PA13 JTMS-SWDIO SWD
42+
PA14 JTCK-SWCLK SWD
43+
44+
# ---------------------- CAN bus -------------------------
45+
CAN_ORDER 1
46+
47+
PA11 CAN1_RX CAN1
48+
PA12 CAN1_TX CAN1
49+
50+
define HAL_CAN_POOL_SIZE 6000
51+
52+
# keep ROMFS uncompressed as we don't have enough RAM
53+
# to uncompress the bootloader at runtime
54+
env ROMFS_UNCOMPRESSED True

0 commit comments

Comments
 (0)