Skip to content

Commit adae9de

Browse files
authored
Merge pull request #167 from Firmament-Autopilot/staging/x1
Staging/x1
2 parents 9b36742 + 4d190d1 commit adae9de

1,353 files changed

Lines changed: 1431501 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.vscode/launch.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,21 @@
107107
"serialNumber": "", //If you have more than one J-Link probe, add the serial number here.
108108
"svdFile": "target/amov/icf5/GD32F4xx.svd",
109109
"runToMain": true
110-
}
110+
},
111+
{
112+
"name": "X1 Debug J-Link",
113+
"type": "cortex-debug",
114+
"request": "launch",
115+
"cwd": "${workspaceRoot}",
116+
"executable": "target/yundrone/x1/build/fmt_yundrone-x1.elf",
117+
"serverpath": "${env:JLINK_SERVER}",
118+
"servertype": "jlink",
119+
"device": "STM32H743II",
120+
"interface": "swd",
121+
"armToolchainPath": "${env:RTT_EXEC_PATH}",
122+
"serialNumber": "", //If you have more than one J-Link probe, add the serial number here.
123+
"svdFile": "target/yundrone/x1/STM32H7x3.svd",
124+
"runToMain": true
125+
},
111126
]
112127
}

target/yundrone/x1/BuildLists.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# FMT Build Lists
2+
3+
from config.driver import *
4+
from config.hal import *
5+
from config.module import *
6+
from config.protocol import *
7+
from config.library import *
8+
from config.model import *
9+
from config.task import *

target/yundrone/x1/README.md

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
SIEON S1 Flight Controller
2+
============================
3+
4+
The SIEON S1 is an advanced STM32H743 autopilot designed and made by FMT team.
5+
6+
<div align=center><img src="https://docs.sieon.net/product/figures/s1.jpg" width="50%"></div>
7+
8+
## Feature
9+
10+
Main FMU Processor: STM32F743◦32 Bit Arm® Cortex®-M7, 480MHz, 2MB Flash, 512KB RAM
11+
12+
- **On-board sensors:**
13+
- Accel/Gyro: BMI088
14+
- Accel/Gyro: ICM-42688
15+
- Magnetometer: BMM150
16+
- Barometer: SPL06
17+
- **Interfaces:**
18+
- Up to 16 PWM outputs(12 standard pwm output + 4 Optional pwm output )
19+
- R/C input for S.Bus/PPM
20+
- analog / PWM RSSI input
21+
- 6 general purpose serial ports
22+
- 2 GPS ports
23+
- 3 I2C ports
24+
- 1 SPI buses (3 chip select pins)
25+
- 2 CAN Buses
26+
- 1 ETH port
27+
- Analog inputs for voltage / current of battery
28+
- 1 Debug port (Jlink-SWD)
29+
- **Power System:**
30+
- Power Brick Input: 4.75~5.5V
31+
- USB Power Input: 4.75~5.25V
32+
- Servo Rail Input: 0~36V
33+
- **Weight and Dimensions:**
34+
- Dimensions: 56mm * 37mm * 13mm
35+
- Weight: 40.5g
36+
- **Other Characteristics:**
37+
- Operating temperature: -20 ~ 65°c(Measured value)
38+
39+
## Wiki
40+
41+
https://docs.sieon.net/product
42+
43+
## Where to Buy
44+
[taobao](https://e.tb.cn/h.6wnwfCVJ03YmIe2?tk=n1T1VmRQHeK)
45+
46+
## Build
47+
Build fmu firmware for quadcopter
48+
49+
```
50+
cd FMT-Firmware/taget/sieon/s1
51+
scons -j4
52+
```
53+
54+
> -jN allows N jobs at once which makes your build process quicker.
55+
56+
For other vehicle, such as fixwing, using
57+
58+
```
59+
scons -j4 --vehicle=Fixwing
60+
```
61+
62+
## Download
63+
64+
### Download FMU Firmware
65+
Currently there are 3 ways to download fmu firmware to hardware.
66+
67+
1. **Donwload Script**: Enter `python3 uploader.py` in the Cubeorange directory. Then connect your hardware via usb.
68+
69+
```
70+
(fmt) E:\GitRepository\FMT-Firmware\target\cubepilot\cubeorange>python uploader.py
71+
waiting for the bootloader...
72+
Attempting reboot on COM30 with baudrate=57600...
73+
If the board does not respond, unplug and re-plug the USB connector.
74+
Not found fmt_fmu,please connect fmt_fmu!
75+
Not found fmt_fmu,please connect fmt_fmu!
76+
Attempting reboot on COM3 with baudrate=57600...
77+
If the board does not respond, unplug and re-plug the USB connector.
78+
Not found fmt_fmu,please connect fmt_fmu!
79+
80+
Found board id: 140,0 bootloader version: 5 on COM29
81+
sn: 002700493430511030383637
82+
chip: 20036450
83+
family: b'STM32H743/753'
84+
revision: b'V'
85+
flash: 1966080 bytes
86+
Windowed mode: False
87+
88+
Erase : [====================] 100.0%
89+
Program: [====================] 100.0%
90+
Verify : [====================] 100.0%
91+
Rebooting. Elapsed Time 12.231
92+
```
93+
94+
> If the `"ModuleNotFoundError: No module named 'serial'"` error occurs, indicating that the **pyserial** component is missing, enter `pip3 install pyserial` to install.
95+
96+
2. **QGC**: Go to *Firmware Setup* page,then connect your hardware to PC with a usb cable. In pop-up diaglog,select *Advanced Settings->Custom firmware file* with FMT firmware to download.
97+
98+
![qgc_download](https://firmament-autopilot.github.io/FMT-DOCS/figures/qgc_download.png)
99+
100+
3. **J-Link**: If you have a JLink, you can connect it to board debug port download the firmware. For more information, please check the [Debug](https://firmament-autopilot.github.io/FMT-DOCS/#/introduction/debug) section.
101+
102+
> Be careful do not override the bootloader!
103+
104+
When system is up and running, the system banner is output via serial0 or you can view it by entering `boot_log` in QGC Mavlink Console.
105+
106+
```
107+
_____ __
108+
/ __(_)_____ _ ___ ___ _ ___ ___ / /_
109+
/ _// / __/ ' \/ _ `/ ' \/ -_) _ \/ __/
110+
/_/ /_/_/ /_/_/_/\_,_/_/_/_/\__/_//_/\__/
111+
Firmware.....................FMT FW v1.1.0
112+
Kernel....................RT-Thread v4.0.3
113+
RAM.................................512 KB
114+
Target............................SIEON S1
115+
Vehicle........................Multicopter
116+
Airframe.................................1
117+
INS Model..................Base INS v1.0.0
118+
FMS Model..................Base FMS v1.0.0
119+
Control Model.......Base Controller v1.0.0
120+
Task Initialize:
121+
mavobc................................OK
122+
mavgcs................................OK
123+
logger................................OK
124+
status................................OK
125+
vehicle...............................OK
126+
```
127+
128+
## Port Mapping
129+
130+
| UART | Device | Port |
131+
| ----- | ------- | -------- |
132+
| UART1 | serial0 | DEBUG |
133+
| UART6 | serial1 | TELEM1 |
134+
| UART2 | serial2 | TELEM2 |
135+
| UART3 | serial3 | GPS1 |
136+
| UART4 | serial4 | GPS2 |
137+
| UART7 | serial5 | UART/I2C |
138+
139+
| SPI | Device | Port |
140+
| ---- | --------- | ------- |
141+
| SPI2 | spi2_dev1 | SPI CS1 |
142+
| SPI2 | spi2_dev2 | SPI CS2 |
143+
| SPI2 | spi2_dev3 | SPI CS3 |
144+
145+
| I2C | Device | Port |
146+
| ---- | ------ | -------- |
147+
| I2C1 | i2c1 | GPS1 |
148+
| I2C2 | i2c2 | GPS2 |
149+
| I2C3 | i2c3 | UART/I2C |
150+
151+
| CAN | Device | Port |
152+
| ---- | ------ | ---- |
153+
| CAN1 | can1 | CAN1 |
154+
| CAN2 | can2 | CAN2 |
155+
156+
| PWM | Device | Port |
157+
| -------- | -------- | ---------- |
158+
| MAIN OUT | main_out | M1-M12 |
159+
| AUX OUT | aux_out | PWM(A1-A4) |
160+

target/yundrone/x1/SConscript

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# for module compiling
2+
import os
3+
from building import *
4+
5+
cwd = GetCurrentDir()
6+
objs = []
7+
list = os.listdir(cwd)
8+
9+
for d in list:
10+
path = os.path.join(cwd, d)
11+
if os.path.isfile(os.path.join(path, 'SConscript')):
12+
objs = objs + SConscript(os.path.join(d, 'SConscript'))
13+
14+
Return('objs')

target/yundrone/x1/SConstruct

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
import os
2+
import sys
3+
import rtconfig
4+
5+
# FMT path
6+
FMU_ROOT = os.path.normpath(os.getcwd() + '/../../..')
7+
# RTOS path
8+
RTT_ROOT = FMU_ROOT + '/rtos/rt-thread'
9+
10+
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
11+
try:
12+
from building import *
13+
except:
14+
print('Cannot found RT-Thread root directory, please check RTT_ROOT')
15+
print(RTT_ROOT)
16+
exit(-1)
17+
18+
TARGET = 'build/fmt_' + rtconfig.BOARD + '.' + rtconfig.TARGET_EXT
19+
20+
# ===== Add option to SCons =====
21+
AddOption('--vehicle',
22+
dest = 'vehicle',
23+
type = 'string',
24+
default = 'Multicopter',
25+
help = 'Specify the vehicle type')
26+
27+
AddOption('--airframe',
28+
dest='airframe',
29+
type='int',
30+
nargs=1,
31+
default = 1,
32+
action='store',
33+
help='Specify the airframe value')
34+
35+
AddOption('--sim',
36+
dest = 'sim',
37+
type = 'string',
38+
default = 'None',
39+
help = 'Specify the simulation mode')
40+
41+
env = Environment(tools=['mingw'],
42+
AS=rtconfig.AS, ASFLAGS=rtconfig.AFLAGS,
43+
CC=rtconfig.CC, CFLAGS=rtconfig.CFLAGS,
44+
AR=rtconfig.AR, ARFLAGS='-rc',
45+
CXX=rtconfig.CXX, CXXFLAGS=rtconfig.CXXFLAGS,
46+
LINK=rtconfig.LINK, LINKFLAGS=rtconfig.LFLAGS)
47+
48+
# set VEHICLE_TYPE macro for low-level usage
49+
env.Append(CPPDEFINES = [('VEHICLE_TYPE', GetOption('vehicle'))])
50+
env.Append(CPPDEFINES = [('AIRFRAME', GetOption('airframe'))])
51+
52+
sim_mode = GetOption('sim')
53+
if sim_mode == 'SIH':
54+
print("Build in SIH mode")
55+
env.Append(CPPDEFINES = 'FMT_USING_SIH')
56+
elif sim_mode == 'HIL':
57+
print("Build in HIL mode")
58+
env.Append(CPPDEFINES = 'FMT_USING_HIL')
59+
60+
# Add sys execute PATH to env PATH
61+
env.PrependENVPath('PATH', os.getenv('PATH'))
62+
63+
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
64+
65+
if rtconfig.PLATFORM == 'iar':
66+
env.Replace(
67+
CCCOM=['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES'])
68+
env.Replace(ARFLAGS=[''])
69+
env.Replace(
70+
LINKCOM=['$LINK $SOURCES $LINKFLAGS -o $TARGET --map project.map'])
71+
72+
Export('RTT_ROOT')
73+
Export('rtconfig')
74+
75+
# prepare building environment
76+
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
77+
78+
cwd = str(Dir('#'))
79+
list = os.listdir(FMU_ROOT)
80+
vdir = 'build/fmt'
81+
for d in list:
82+
path = os.path.join(FMU_ROOT, d)
83+
if os.path.isfile(os.path.join(path, 'SConscript')):
84+
objs.extend(SConscript(os.path.join(path, 'SConscript'),
85+
variant_dir=vdir + '/' + d, duplicate=0))
86+
87+
# print env.get('CPPPATH', [''])
88+
89+
# make a building
90+
DoBuilding(TARGET, objs)

0 commit comments

Comments
 (0)