Skip to content

Commit 4001681

Browse files
Merge pull request iNavFlight#11082 from functionpointer/vantac_rf007
New target: FrSky/Rotorflight Vantac RF007
2 parents 8892021 + 0fca2e4 commit 4001681

5 files changed

Lines changed: 300 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target_stm32f722xe(VANTAC_RF007)
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
FrSky/Rotorflight VANTAC RF007
2+
==============================
3+
4+
Family of flight controllers originally designed for helicopters using Rotorflight.
5+
There are three versions available, the only difference is the type of integrated FrSky receiver.
6+
All versions share the same target in INAV.
7+
8+
Rotorflight's site: https://www.rotorflight.org/docs/controllers/frsky-007
9+
10+
FrSky's manual: https://www.frsky-rc.com/wp-content/uploads/Downloads/Amanual/VANTAC%20RF007%20Manual.pdf
11+
12+
Built-in receiver
13+
-------------------
14+
15+
The built-in receiver is connected to UART5 and uses FrSky FBUS.
16+
Only the RxUG update port is connected to the receiver directly.
17+
All other pins are connected to the STM32F7 running INAV.
18+
19+
The receiver has a bind button labelled "Rx".
20+
To bind the Archer+ version, the button needs to be held while power gets connected.
21+
The Archer+ version will bind to Multiprotocol Module FrSky X2 D16 mode, among other options.
22+
For more information, see the manufacturer's manual.
23+
24+
Pin configuration
25+
-----------------
26+
27+
The RPM, TLM, AUX and SBUS pins are Servo/Motor outputs by default.
28+
However, when UART1 or UART2 are assigned a function in the ports tab, the pins will become a UART instead.
29+
See the table below.
30+
31+
| Marking on the case | Both UART1 and UART2 unused | UART1 in use | UART2 in use | Both UART1 and UART2 in use |
32+
|---------------------|------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
33+
| S1 | Output S1 | Output S1 | Output S1 | Output S1 |
34+
| S2 | Output S2 | Output S2 | Output S2 | Output S2 |
35+
| S3 | Output S3 | Output S3 | Output S3 | Output S3 |
36+
| TAIL | Output S4 | Output S4 | Output S4 | Output S4 |
37+
| ESC | Output S5 | Output S5 | Output S5 | Output S5 |
38+
| RPM | Output S6 | Output S6 | UART2 TX | UART2 TX |
39+
| TLM | Output S7 | Output S7 | UART2 RX | UART2 RX |
40+
| AUX | Output S8 | UART1 TX | Output S6 | UART1 TX |
41+
| SBUS | Output S9 | UART1 RX | Output S7 | UART1 RX |
42+
| A | UART4<br>pin order:<br>TX, RX, 5V, GND | UART4<br>pin order:<br>TX, RX, 5V, GND | UART4<br>pin order:<br>TX, RX, 5V, GND | UART4<br>pin order:<br>TX, RX, 5V, GND |
43+
| C | I2C<br>pin order:<br>**SDA, SCL, 5V, GND**<br>or<br>UART3<br>pin order:<br>**RX, TX, 5V, GND** | I2C<br>pin order:<br>**SDA, SCL, 5V, GND**<br>or<br>UART3<br>pin order:<br>**RX, TX, 5V, GND** | I2C<br>pin order:<br>**SDA, SCL, 5V, GND**<br>or<br>UART3<br>pin order:<br>**RX, TX, 5V, GND** | I2C<br>pin order:<br>**SDA, SCL, 5V, GND**<br>or<br>UART3<br>pin order:<br>**RX, TX, 5V, GND** |
44+
| EXT-V | battery voltage<br>max 80V<br>pin order:<br>Vbat, GND | battery voltage<br>max 80V<br>pin order:<br>Vbat, GND | battery voltage<br>max 80V<br>pin order:<br>Vbat, GND | battery voltage<br>max 80V<br>pin order:<br>Vbat, GND |
45+
| built-in receiver | UART5 | UART5 | UART5 | UART5 |
46+
47+
All pin orders are from left to right, when looking at the connector on the flight controller.
48+
49+
**Port "C" has the data pins swapped. The manufacturers documentation is incorrect.**
50+
Port "A" is wired correctly.
51+
52+
Hardware layout
53+
---------------
54+
55+
56+
| Marking on the case | STM32 pin | Servo | UART | I2C |
57+
|---------------------|-----------|------------------------------:|---------------:|---------:|
58+
| S1 | PB4 | TIM3CH1 | n/a | n/a |
59+
| S2 | PB5 | TIM3CH2 | n/a | n/a |
60+
| S3 | PB0 | TIM3CH3 | n/a | n/a |
61+
| TAIL | PA15 | TIM2CH1 | n/a | n/a |
62+
| ESC | PA9 | TIM1CH2 | UART1 TX | n/a |
63+
| RPM | PA2 | TIM2CH3<br>TIM5CH3<br>TIM9CH1 | UART2 TX | n/a |
64+
| TLM | PA3 | TIM2CH4<br>TIM5CH4<br>TIM9CH2 | UART2 RX | n/a |
65+
| AUX | PB6 | TIM4CH1 | UART1 TX | I2C1 SCL |
66+
| SBUS | PB7 | TIM4CH2 | UART1 RX | I2C1 SDA |
67+
| A | PA0/PA1 | TIM1<br>TIM5 | UART2<br>UART4 | n/a |
68+
| C | PB10/PB11 | TIM2 | UART3 | I2C2 |
69+
| EXT-V | PC0 | n/a | n/a | n/a |
70+
| built-in receiver | PC12/PD2 | n/a | UART5 | n/a |
71+
72+
The pinout is extremely similar to the F7B5 reference design from Rotorflight.
73+
https://github.com/rotorflight/rotorflight-ref-design/blob/master/Reference-Design-F7B.md
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* This file is part of INAV Project.
3+
*
4+
* This Source Code Form is subject to the terms of the Mozilla Public
5+
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
6+
* You can obtain one at http://mozilla.org/MPL/2.0/.
7+
*
8+
* Alternatively, the contents of this file may be used under the terms
9+
* of the GNU General Public License Version 3, as described below:
10+
*
11+
* This file is free software: you may copy, redistribute and/or modify
12+
* it under the terms of the GNU General Public License as published by the
13+
* Free Software Foundation, either version 3 of the License, or (at your
14+
* option) any later version.
15+
*
16+
* This file is distributed in the hope that it will be useful, but
17+
* WITHOUT ANY WARRANTY; without even the implied warranty of
18+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
19+
* Public License for more details.
20+
*
21+
* You should have received a copy of the GNU General Public License
22+
* along with this program. If not, see http://www.gnu.org/licenses/.
23+
*/
24+
25+
#include <platform.h>
26+
#include "drivers/pwm_mapping.h"
27+
28+
void targetConfiguration(void)
29+
{
30+
// default "ESC" pin to be a motor
31+
timerOverridesMutable(timer2id(TIM1))->outputMode = OUTPUT_MODE_MOTORS;
32+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* This file is part of INAV.
3+
*
4+
* INAV is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* INAV is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with INAV. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
#include <stdint.h>
19+
20+
#include "platform.h"
21+
22+
#include "drivers/io.h"
23+
#include "drivers/pwm_mapping.h"
24+
#include "drivers/timer.h"
25+
#include "target.h"
26+
27+
timerHardware_t timerHardware[] = {
28+
DEF_TIM(TIM3, CH1, PB4, TIM_USE_OUTPUT_AUTO, 0, 0), // labelled "S1"
29+
DEF_TIM(TIM3, CH2, PB5, TIM_USE_OUTPUT_AUTO, 0, 0), // labelled "S2"
30+
DEF_TIM(TIM3, CH3, PB0, TIM_USE_OUTPUT_AUTO, 0, 0), // labelled "S3"
31+
32+
DEF_TIM(TIM2, CH1, PA15, TIM_USE_OUTPUT_AUTO, 0, 0), // labelled "TAIL"
33+
34+
DEF_TIM(TIM1, CH2, PA9, TIM_USE_OUTPUT_AUTO, 0, 0), // labelled "ESC"
35+
36+
DEF_TIM(TIM2, CH3, PA2, TIM_USE_OUTPUT_AUTO, 0, 0), // labelled "RPM", clashes with UART2 TX
37+
DEF_TIM(TIM2, CH4, PA3, TIM_USE_OUTPUT_AUTO, 0, 0), // labelled "TLM", clashes with UART2 RX
38+
39+
DEF_TIM(TIM4, CH1, PB6, TIM_USE_OUTPUT_AUTO, 0, 0), // labelled "AUX", clashes with UART1 TX and I2C1 SCL
40+
DEF_TIM(TIM4, CH2, PB7, TIM_USE_OUTPUT_AUTO, 0, 0), // labelled "SBUS", clashes with UART1 RX and I2C1 SDA
41+
};
42+
43+
const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
/*
2+
* This file is part of INAV.
3+
*
4+
* INAV is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* INAV is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with INAV. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
19+
#pragma once
20+
21+
#define TARGET_BOARD_IDENTIFIER "F7B5"
22+
23+
#define USBD_PRODUCT_STRING "VANTAC_RF007"
24+
25+
#define LED0 PC14
26+
#define LED1 PC15
27+
28+
#define USE_SPI
29+
#define USE_SPI_DEVICE_1
30+
#define SPI1_SCK_PIN PA5
31+
#define SPI1_MISO_PIN PA6
32+
#define SPI1_MOSI_PIN PA7
33+
34+
#define USE_IMU_ICM42605 // is actually ICM42688P
35+
#define IMU_ICM42605_ALIGN CW90_DEG
36+
#define ICM42605_CS_PIN PA4
37+
#define ICM42605_EXTI_PIN PB2
38+
#define ICM42605_SPI_BUS BUS_SPI1
39+
40+
// *************** I2C /Baro/Mag *********************
41+
#define USE_I2C
42+
#define USE_I2C_DEVICE_1
43+
#define I2C1_SCL PB8
44+
#define I2C1_SDA PB9
45+
// alternate pin assignment
46+
// clashes with UART1
47+
// also won't allow the built-in barometer to be used
48+
//#define I2C1_SCL PB6
49+
//#define I2C1_SDA PB7
50+
51+
#define USE_I2C_DEVICE_2 // clashes with UART3
52+
#define I2C2_SCL PB10
53+
#define I2C2_SDA PB11
54+
#define EXTERNAL_I2C BUS_I2C2
55+
#define I2C_DEVICE_2_SHARES_UART3
56+
57+
#define USE_BARO
58+
#define BARO_I2C_BUS BUS_I2C1
59+
#define USE_BARO_SPL06
60+
#define SPL06_I2C_ADDR 119
61+
62+
#define USE_MAG
63+
#define MAG_I2C_BUS EXTERNAL_I2C
64+
#define USE_MAG_ALL
65+
66+
#define TEMPERATURE_I2C_BUS EXTERNAL_I2C
67+
68+
#define PITOT_I2C_BUS EXTERNAL_I2C
69+
70+
#define USE_RANGEFINDER
71+
#define RANGEFINDER_I2C_BUS EXTERNAL_I2C
72+
73+
// *************** SPI2 Blackbox *******************
74+
#define USE_SPI_DEVICE_2
75+
#define SPI2_SCK_PIN PB13
76+
#define SPI2_MISO_PIN PB14
77+
#define SPI2_MOSI_PIN PB15
78+
79+
#define USE_FLASHFS
80+
#define USE_FLASH_W25N01G
81+
#define W25N01G_SPI_BUS BUS_SPI2
82+
#define W25N01G_CS_PIN PB12
83+
#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
84+
85+
// *************** UART *****************************
86+
#define USE_VCP
87+
88+
#define USE_UART1 // clashes with I2C1
89+
#define UART1_TX_PIN PB6
90+
#define UART1_RX_PIN PB7 // pin labelled "SBUS"
91+
92+
#define USE_UART2
93+
#define UART2_TX_PIN PA2 // pin labelled as "RPM"
94+
#define UART2_RX_PIN PA3 // pin labelled as "TLM"
95+
96+
#define USE_UART3 // clashes with I2C2
97+
// port labelled "C"
98+
#define UART3_TX_PIN PB10
99+
#define UART3_RX_PIN PB11
100+
101+
#define USE_UART4
102+
// port labelled "A"
103+
#define UART4_TX_PIN PA0
104+
#define UART4_RX_PIN PA1
105+
106+
#define USE_UART5
107+
// port internal receiver
108+
#define UART5_TX_PIN PC12
109+
#define UART5_RX_PIN PD2
110+
111+
#define SERIAL_PORT_COUNT 6
112+
113+
#define DEFAULT_RX_TYPE RX_TYPE_SERIAL
114+
#define SERIALRX_PROVIDER SERIALRX_FBUS
115+
#define SERIALRX_UART SERIAL_PORT_USART5
116+
117+
#define SENSORS_SET (SENSOR_ACC|SENSOR_BARO)
118+
119+
// *************** ADC *****************************
120+
#define USE_ADC
121+
#define ADC_INSTANCE ADC1
122+
#define ADC1_DMA_STREAM DMA2_Stream0
123+
124+
#define ADC_CHANNEL_1_PIN PC2
125+
#define ADC_CHANNEL_2_PIN PC1
126+
#define ADC_CHANNEL_3_PIN PC0
127+
128+
#define VBAT_ADC_CHANNEL ADC_CHN_3 // port labelled "EXT-V"
129+
//BEC ADC is ADC_CHN_2
130+
//BUS ADC is ADC_CHN_1
131+
132+
#define VBAT_SCALE_DEFAULT 2464
133+
134+
#define DEFAULT_FEATURES (FEATURE_TELEMETRY | FEATURE_VBAT | FEATURE_TX_PROF_SEL)
135+
136+
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
137+
138+
#define TARGET_IO_PORTA 0xffff
139+
#define TARGET_IO_PORTB 0xffff
140+
#define TARGET_IO_PORTC 0xffff
141+
#define TARGET_IO_PORTD 0xffff
142+
143+
#define MAX_PWM_OUTPUT_PORTS 9
144+
145+
#define USE_DSHOT
146+
#define USE_SERIALSHOT
147+
#define USE_ESC_SENSOR
148+
#define USE_SMARTPORT_MASTER // no internal current sensor, enable SMARTPORT_MASTER so external ones can be used
149+
150+
#define USE_DSHOT_DMAR
151+

0 commit comments

Comments
 (0)