Skip to content

Commit 25f8eeb

Browse files
committed
ChibiOS: add support and bootloader for PilotGaeaSH7V1-bdshot
1 parent 92b0cd7 commit 25f8eeb

7 files changed

Lines changed: 480 additions & 8 deletions

File tree

20.2 KB
Binary file not shown.

libraries/AP_DDS/AP_DDS_Client.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -910,13 +910,13 @@ void AP_DDS_Client::on_request(uxrSession* uxr_session, uxrObjectId object_id, u
910910
bool param_isinf = true;
911911
float param_value;
912912
switch (param.value.type) {
913-
case PARAMETER_INTEGER: {
913+
case ParameterType::PARAMETER_INTEGER: {
914914
param_isnan = isnan(param.value.integer_value);
915915
param_isinf = isinf(param.value.integer_value);
916916
param_value = float(param.value.integer_value);
917917
break;
918918
}
919-
case PARAMETER_DOUBLE: {
919+
case ParameterType::PARAMETER_DOUBLE: {
920920
param_isnan = isnan(param.value.double_value);
921921
param_isinf = isinf(param.value.double_value);
922922
param_value = float(param.value.double_value);
@@ -1009,38 +1009,38 @@ void AP_DDS_Client::on_request(uxrSession* uxr_session, uxrObjectId object_id, u
10091009

10101010
vp = AP_Param::find(param_key, &var_type);
10111011
if (vp == nullptr) {
1012-
get_parameters_response.values[i].type = PARAMETER_NOT_SET;
1012+
get_parameters_response.values[i].type = ParameterType::PARAMETER_NOT_SET;
10131013
successful_read &= false;
10141014
continue;
10151015
}
10161016

10171017
switch (var_type) {
10181018
case AP_PARAM_INT8: {
1019-
get_parameters_response.values[i].type = PARAMETER_INTEGER;
1019+
get_parameters_response.values[i].type = ParameterType::PARAMETER_INTEGER;
10201020
get_parameters_response.values[i].integer_value = ((AP_Int8 *)vp)->get();
10211021
successful_read &= true;
10221022
break;
10231023
}
10241024
case AP_PARAM_INT16: {
1025-
get_parameters_response.values[i].type = PARAMETER_INTEGER;
1025+
get_parameters_response.values[i].type = ParameterType::PARAMETER_INTEGER;
10261026
get_parameters_response.values[i].integer_value = ((AP_Int16 *)vp)->get();
10271027
successful_read &= true;
10281028
break;
10291029
}
10301030
case AP_PARAM_INT32: {
1031-
get_parameters_response.values[i].type = PARAMETER_INTEGER;
1031+
get_parameters_response.values[i].type = ParameterType::PARAMETER_INTEGER;
10321032
get_parameters_response.values[i].integer_value = ((AP_Int32 *)vp)->get();
10331033
successful_read &= true;
10341034
break;
10351035
}
10361036
case AP_PARAM_FLOAT: {
1037-
get_parameters_response.values[i].type = PARAMETER_DOUBLE;
1037+
get_parameters_response.values[i].type = ParameterType::PARAMETER_DOUBLE;
10381038
get_parameters_response.values[i].double_value = vp->cast_to_float(var_type);
10391039
successful_read &= true;
10401040
break;
10411041
}
10421042
default: {
1043-
get_parameters_response.values[i].type = PARAMETER_NOT_SET;
1043+
get_parameters_response.values[i].type = ParameterType::PARAMETER_NOT_SET;
10441044
successful_read &= false;
10451045
break;
10461046
}
530 KB
Loading
708 KB
Loading
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# PilotGaeaSH7V1 Flight Controller
2+
3+
The PilotGaeaSH7V1 is a flight controller designed and produced by PilotGaea
4+
5+
## Features
6+
7+
- STM32H743 microcontroller
8+
- Dual ICM42688P IMUs
9+
- DPS310 barometer
10+
- AT7456E OSD
11+
- MicroSD card slot
12+
- Dual camera input
13+
- 1 USB
14+
- 5.5 UARTs, one with CTS/RTS flow control pins
15+
- 10 PWM / Dshot outputs
16+
- 1 I2C
17+
- 1 CAN
18+
- 5 ADC inputs
19+
- 5V/1.5A BEC for main power supply
20+
- 8V/1.5A BEC for powering Video Transmitter
21+
22+
## Mechanical
23+
24+
- Dimensions: 36 x 36 x 17 mm
25+
- Weight: 10.5g
26+
27+
## Physical and pinout
28+
29+
![PilotGaeaSH7V1 front view](./PilotGaea_front_view_Pin.jpg)
30+
31+
![PilotGaeaSH7V1 rear view](./PilotGaea_rear_view_Pin.jpg)
32+
33+
## Power supply
34+
35+
The PilotGaeaSH7V1 supports 3-8s Li battery input. It has 2 ways of BEC, which result in 3 ways of power supplys. Please see the table below.
36+
37+
| Power symbol | Power source | Max power (current) |
38+
|--------------|---------------------------------------------------|---------------------|
39+
| BAT | directly from battery | |
40+
| 5V | from 5V BEC | 7.5W (1.5A) |
41+
| 8V | from 8V BEC, controlled by MCU | 12W (1.5A) |
42+
| 4V5 | from USB or 5V BEC, diodes isolate the two powers | 4.7W (1A) |
43+
44+
## UART Mapping
45+
46+
The UARTs are marked RXn and TXn in the above pinouts. The RXn pin is the receive pin for UARTn. The TXn pin is the transmit pin for UARTn.
47+
48+
| ArduPilot Serial | Hardware UART | Default Function | DMA Support | DMA Stream (Shared/Dedicated) |
49+
|------------------|----------------|------------------|-------------|------------------------------------------------|
50+
| SERIAL0 | OTG1 | USB | No | Handled by USB Controller |
51+
| SERIAL1 | UART7(CTS/RTS) | Telem 1 | Yes | Shared TX (Stream 7) / Dedicated RX (Stream 0) |
52+
| SERIAL2 | USART1 | GPS | Yes | Shared TX (Stream 7) / Shared RX (Stream 5) |
53+
| SERIAL3 | USART2 | Telem 2 | Yes | Shared TX (Stream 7) / Shared RX (Stream 6) |
54+
| SERIAL4 | USART3 | not available | Yes | Shared TX (Stream 7) / Shared RX (Stream 7) |
55+
| SERIAL5 | UART8 | ESC Telem | No (NODMA) | (CPU-based PIO) |
56+
| SERIAL6 | UART4 | User Port | No (NODMA) | (CPU-based PIO) |
57+
| SERIAL7 | USART6 | RCIN | Yes | Shared TX (Stream 7) / Shared RX (Stream 1) |
58+
59+
Any UART can be re-tasked by changing its protocol parameter.
60+
61+
## RC Input
62+
63+
The default RC input is configured on the UART6 and supports all RC protocols except PPM. The SBUS pin is inverted and connected to RX6. RC can be attached to any UART port as long as the serial port protocol is set to `SERIALn_PROTOCOL=23` and SERIAL6_Protocol is changed to something other than '23'.
64+
65+
## OSD Support
66+
67+
The PilotGaeaSH7V1 Supports onboard analog OSD using the AT7456 chip.The composited image is output via the VTX pin.
68+
69+
## PWM Output and DShot
70+
71+
The PilotGaeaSH7V1 supports up to **11 physical PWM outputs**, organized into **6 independent timer groups**. All groups support DShot, but **Bi-directional DShot (BDShot)** is fully optimized for **Groups 1-4 (Outputs 1-8)**.
72+
73+
### PWM Grouping Table
74+
75+
| Group | PWM Output | Timer | BDShot Support | Recommended Use |
76+
| :--- | :--- | :--- | :--- | :--- |
77+
| **1** | 1, 2 | TIM3 | **Full (DMA)** | Motors 1-2 (BDShot) |
78+
| **2** | 3, 4 | TIM2 | **Full (DMA)** | Motors 3-4 (BDShot) |
79+
| **3** | 5, 6 | TIM5 | **Full (DMA)** | Motors 5-6 (BDShot) |
80+
| **4** | 7, 8 | TIM4 | **Full (DMA)** | Motors 7-8 (BDShot) |
81+
| **5** | 11, 12 | TIM15 | No (NODMA) | Auxiliary / Servos |
82+
| **6** | 13 | TIM1 | No (NODMA) | NeoPixel / LED |
83+
84+
### Bi-directional DShot Configuration
85+
To use BDShot for RPM filtering, you must flash the `PilotGaeaSH7V1-bdshot` firmware.
86+
- **Outputs 1-8:** Fully optimized with dedicated DMA resources to ensure stable DShot600 performance and telemetry feedback.
87+
- **Outputs 11-13:** Configured with `NODMA`. While they support standard PWM/DShot, they do not support RPM telemetry. This design prioritizes DMA bandwidth for the primary IMU (SPI1) and core motor functions.
88+
89+
> **Note:** PWM 9 and 10 are defined in firmware but not physically broken out.
90+
91+
> **Important:** Every output within a timer group must use the same protocol (e.g., Output 3 & 4 must both be DShot).
92+
93+
## Battery Monitoring
94+
95+
The board has two internal voltage sensors and two external current sensor input.
96+
The voltage sensors can handle up to 8S LiPo batteries.
97+
98+
Primary Battery (BATT):
99+
Enable Battery monitor with these parameter settings :
100+
* BATT_MONITOR 4 (Then reboot)
101+
* BATT_VOLT_PIN 10
102+
* BATT_CURR_PIN 11
103+
* BATT_VOLT_MULT 11.0
104+
* BATT_AMP_PERVLT 40.0
105+
106+
Secondary Battery (BATT2):
107+
* BATT2_VOLT_PIN 18
108+
* BATT2_CURR_PIN 7
109+
* BATT2_VOLT_MULT 21.0 (Must be manually set to 21.0)
110+
* BATT2_AMP_PERVLT 40.0
111+
112+
### Battery Monitoring (BATT2) Setup
113+
The second battery monitor is **disabled** by default. To use it:
114+
1. Set `BATT2_MONITOR` = **4** (Analog Voltage and Current) and reboot.
115+
2. **Crucial:** Change `BATT2_VOLT_MULT` to **21.0** in Mission Planner.
116+
*(The firmware default is 11.0, but the physical circuit on this board requires 21.0 for correct readings).*
117+
118+
## Compass
119+
120+
The PilotGaeaSH7V1 has no built-in compass, so if needed, you should use an external compass.
121+
122+
## Analog cameras
123+
124+
The PilotGaeaSH7V1 supports up to 2 cameras, connected to pin C1 and C2. You can select the video signal to VTX from camera by an RC channel. Set the parameters below:
125+
- RELAY2_FUNCTION 1
126+
- RELAY_PIN2 82
127+
- RC8_OPTION 34
128+
129+
## 8V switch
130+
131+
The 8V power supply can be controlled by an RC channel. Set the parameters below:
132+
- RELAY1_FUNCTION 1
133+
- RELAY_PIN 81
134+
- RC7_OPTION 28
135+
136+
## Loading Firmware
137+
138+
Initial firmware load can be done with DFU by plugging in USB with the bootloader button pressed.Then you should load the "*with_bl.hex" firmware, using your favourite DFU loading tool.
139+
Once the initial firmware is loaded you can update the firmware using any ArduPilot ground station software. Updates should be done with the "\*.apj" firmware files.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# hw definition file for processing by chibios_pins.py
2+
# for PilotGaea SH743-V1 bootloader
3+
4+
# MCU class and specific type
5+
MCU STM32H7xx STM32H743xx
6+
7+
# board ID for firmware load
8+
APJ_BOARD_ID 1213
9+
10+
# crystal frequency, setup to use external oscillator
11+
OSCILLATOR_HZ 8000000
12+
13+
FLASH_SIZE_KB 2048
14+
15+
# bootloader starts at zero offset
16+
FLASH_RESERVE_START_KB 0
17+
18+
# the location where the bootloader will put the firmware
19+
# the H743 has 128k sectors
20+
FLASH_BOOTLOADER_LOAD_KB 128
21+
22+
23+
# order of UARTs (and USB). Allow bootloading on USB and telem1
24+
SERIAL_ORDER OTG1 UART7
25+
26+
# UART7 (telem1)
27+
PE7 UART7_RX UART7 NODMA
28+
PE8 UART7_TX UART7 NODMA
29+
30+
# PA10 IO-debug-console
31+
PA11 OTG_FS_DM OTG1
32+
PA12 OTG_FS_DP OTG1
33+
34+
PA13 JTMS-SWDIO SWD
35+
PA14 JTCK-SWCLK SWD
36+
37+
# make sure Vsw is on during bootloader
38+
PD10 PINIO1 OUTPUT LOW
39+
40+
PE3 LED_BOOTLOADER OUTPUT LOW
41+
define HAL_LED_ON 0
42+
43+
# Add CS pins to ensure they are high in bootloader
44+
PC15 IMU1_CS CS
45+
PB12 MAX7456_CS CS
46+
PE11 IMU2_CS CS
47+
PD4 EXT_CS1 CS
48+
PE2 EXT_CS2 CS
49+
PC13 IMU3_CS CS

0 commit comments

Comments
 (0)