Skip to content

Commit 592e92f

Browse files
committed
Revert "Merge pull request #27 from emuflight/Removing-f1/f3-Code"
This reverts commit edc5489, reversing changes made to 5bf2d27.
1 parent edc5489 commit 592e92f

File tree

774 files changed

+499427
-29
lines changed

Some content is hidden

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

774 files changed

+499427
-29
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
.cproject
1313
obj/
1414
patches/
15+
startup_stm32f10x_md_gcc.s
1516
.idea
1617

1718
# script-generated files

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,9 @@ targets-by-mcu:
498498
fi; \
499499
done
500500

501+
## targets-f3 : make all F3 targets
502+
targets-f3:
503+
$(V1) $(MAKE) -s targets-by-mcu MCU_TYPE=STM32F3
501504

502505
## targets-f4 : make all F4 targets
503506
targets-f4:

docs/boards/Board - AlienFlight.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Board - AlienFlight (ALIENFLIGHTF1 and ALIENFLIGHTF3 target)
2+
3+
AlienWii is now AlienFlight. This target supports various variants of brushed and brusless flight controllers. The designs for them are released for public use at:
4+
5+
http://www.alienflight.com
6+
7+
All published designs are flight tested by various people. The intention here is to make this flight controllers available and enable skilled users or RC vendors to build this designs.
8+
9+
Here are the general hardware specifications for this boards:
10+
11+
- STM32F103CBT6 MCU (ALIENFLIGHTF1)
12+
- STM32F303CCT6 MCU (ALIENFLIGHTF3)
13+
- MPU6050/6500/9250 accelerometer/gyro(/mag) sensor unit
14+
- The MPU sensor interrupt is connected to the MCU for all new F3 designs and enabled in the firmware
15+
- 4-8 x 4.2A to 9.5A brushed ESCs, integrated, to run the strongest micro motors
16+
- extra-wide traces on the PCB, for maximum power throughput
17+
- USB port, integrated
18+
- (*) serial connection for external DSM2/DSMX sat receiver (e.g. Spektrum SAT, OrangeRx R100, Lemon RX or Deltang Rx31)
19+
- CPPM input
20+
- ground and 3.3V for the receiver
21+
- hardware bind plug for easy binding
22+
- motor connections are at the corners for a clean look with reduced wiring
23+
- small footprint
24+
- direct operation from an single cell lipoly battery
25+
- 3.3V LDO power regulator (older prototypes)
26+
- 3.3V buck-boost power converter (all new versions)
27+
- 5V buck-boost power converter for FPV (some versions)
28+
- battery monitoring with an LED for buzzer functionality (actually for some ALIENFLIGHTF3 variants only)
29+
30+
(*) Spektrum Compatible DSM2 satellites are supported out of the box. DSMX sat will work with DSM2 protocol with default settings (DSM2, 11bit, 11ms is preset). This is chosen for maximum compatibility. For optimal connection it is recommended to adjust settings to match the capabilities of your transmitter and satellite receiver. If possible it is recommended to use the DSMX protocol since it is known as more reliable. Also to make use of additional channels you should adjust the following two parameters with the Cleanflight Configurator.
31+
32+
set serialrx_provider = 1 (0 for 1024bit, 1 for 2048bit)
33+
set spektrum_sat_bind = 5
34+
35+
For more detail of the different bind modes please refer the [Spektrum Bind](Spektrum%20bind.md) document
36+
37+
Deltang receivers in serial mode will work like any other Spektrum satellite receiver (10bit, 22ms) only the bind process will be different.
38+
39+
The pin layout for the ALIENFLIGHTF1 is very similar to NAZE32 or the related clones (MW32, Flip32, etc.). The hardware bind pin is connected to pin 41 (PB5). The pin layout for the ALIENFLIGHTF3 is similar to Sparky. The hardware bind pin is connected to pin 25 (PB12). The new AlienFlightF3 V2 design have the sensor connected via SPI and some slightly different pin layout. All AlienFlight/AlienWii F3 layouts running the same firmware which takes care on the differences with an hardware detection.
40+
41+
The AlienFlight firmware will be built as target ALIENFLIGHTF1 or ALIENFLIGHTF3. The firmware image will come with alternative default settings which will give the user a plug and play experience. There is no computer needed to get this into the air with an small Quadcopter. An preconfigured custom mixer for an Octocopter is part of the default settings to allow clean straight wiring with the AlienFlight. The mixer can be activated with "mixer custom" in the CLI. To use the AlienFlight in an Hexa- or Octocopter or to do some more tuning. Additional configuration changes can be done as usual in the CLI or the Cleanflight configurator.
42+
43+
## Flashing the firmware
44+
45+
The firmware can be updated with the Cleanflight configurator as for any other target. All AlienFlight boards have an boot jumper which need to be closed for the initial flashing or for recovery from an broken firmware.

docs/boards/Board - CC3D.md

+177
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
# Board - CC3D
2+
3+
The OpenPilot Copter Control 3D aka CC3D is a board more tuned to Acrobatic flying or GPS based
4+
auto-piloting. It only has one sensor, the MPU6000 SPI based Accelerometer/Gyro.
5+
It also features a 16Mbit SPI based EEPROM chip. It has 6 ports labeled as inputs (one pin each)
6+
and 6 ports labeled as motor/servo outputs (3 pins each).
7+
8+
If issues are found with this board please report via the [github issue tracker](https://github.com/cleanflight/cleanflight/issues).
9+
10+
The board has a USB port directly connected to the processor. Other boards like the Naze and Flip32
11+
have an on-board USB to uart adapter which connect to the processor's serial port instead.
12+
13+
The board cannot currently be used for hexacopters/octocopters.
14+
15+
Tricopter & Airplane support is untested, please report success or failure if you try it.
16+
17+
# Pinouts
18+
19+
The 8 pin RC_Input connector has the following pinouts when used in RX_PPM/RX_SERIAL mode
20+
21+
| Pin | Function | Notes |
22+
| --- | --------- | -------------------------------- |
23+
| 1 | Ground | |
24+
| 2 | +5V | |
25+
| 3 | Unused | |
26+
| 4 | SoftSerial1 TX / Sonar trigger | |
27+
| 5 | SoftSerial1 RX / Sonar Echo / RSSI_ADC | Used either for SOFTSERIAL, SONAR or RSSI_ADC*. Only one feature can be enabled at any time. |
28+
| 6 | Current | Enable `feature CURRENT_METER`. Connect to the output of a current sensor, 0v-3.3v input |
29+
| 7 | Battery Voltage sensor | Enable `feature VBAT`. Connect to main battery using a voltage divider, 0v-3.3v input |
30+
| 8 | PPM Input | Enable `feature RX_PPM` |
31+
32+
*Connect to the output of a PWM-RSSI conditioner, 0v-3.3v input.
33+
34+
The 6 pin RC_Output connector has the following pinouts when used in RX_PPM/RX_SERIAL mode
35+
36+
| Pin | Function | Notes |
37+
| --- | ----------| ------|
38+
| 1 | MOTOR 1 | |
39+
| 2 | MOTOR 2 | |
40+
| 3 | MOTOR 3 | |
41+
| 4 | MOTOR 4 | |
42+
| 5 | LED Strip | |
43+
| 6 | Unused | |
44+
45+
The 8 pin RC_Input connector has the following pinouts when used in RX_PARALLEL_PWM mode
46+
47+
| Pin | Function | Notes |
48+
| --- | ---------| ------|
49+
| 1 | Ground | |
50+
| 2 | +5V | |
51+
| 3 | Unused | |
52+
| 4 | CH1 | |
53+
| 5 | CH2 | |
54+
| 6 | CH3 | |
55+
| 7 | CH4/Battery Voltage sensor | CH4 if battery voltage sensor is disabled |
56+
| 8 | CH5/CH4 | CH4 if battery voltage monitor is enabled|
57+
58+
The 6 pin RC_Output connector has the following pinouts when used in RX_PARALLEL_PWM mode
59+
60+
| Pin | Function | Notes |
61+
| --- | ---------| ------|
62+
| 1 | MOTOR 1 | |
63+
| 2 | MOTOR 2 | |
64+
| 3 | MOTOR 3 | |
65+
| 4 | MOTOR 4 | |
66+
| 5 | Unused | |
67+
| 6 | Unused | |
68+
69+
# Serial Ports
70+
71+
| Value | Identifier | Board Markings | Notes |
72+
| ----- | ------------ | -------------- | ------------------------------------------|
73+
| 1 | VCP | USB PORT | |
74+
| 2 | USART1 | MAIN PORT | Connected to an MCU controllable inverter |
75+
| 3 | USART3 | FLEX PORT | |
76+
| 4 | SoftSerial | RC connector | Pins 4 and 5 (Tx and Rx respectively) |
77+
78+
The SoftSerial port is not available when RX_PARALLEL_PWM is used. The transmission data rate is limited to 19200 baud.
79+
80+
To connect the GUI to the flight controller you just need a USB cable to use the Virtual Com Port (VCP) or you can use UART1 (Main Port).
81+
82+
CLI access is only available via the VCP by default.
83+
84+
# Main Port
85+
86+
The main port has MSP support enabled on it by default.
87+
88+
The main port is connected to an inverter which is automatically enabled as required. For example, if the main port is used for SBus Serial RX then an external inverter is not required.
89+
90+
# Flex Port
91+
92+
The flex port will be enabled in I2C mode unless USART3 is used. You can connect external I2C sensors and displays to this port.
93+
94+
You cannot use USART3 and I2C at the same time.
95+
96+
## Flex port pinout
97+
98+
| Pin | Signal | Notes |
99+
| --- | ------------------ | ----------------------- |
100+
| 1 | GND | |
101+
| 2 | VCC unregulated | |
102+
| 3 | I2C SCL / UART3 TX | 3.3v level |
103+
| 4 | I2C SDA / UART3 RX | 3.3v level (5v tolerant |
104+
105+
106+
# Flashing
107+
108+
Since CleanFlight version 1.11.0 "single binary image mode" is the only way to get CleanFlight on CC3D. Prior the version 1.11.0 there was a possibility to use "OpenPilot Bootloader compatible image mode", which allows you to easily switch between OpenPilot and CleanFlight, please refer to documentation from releases prior to 1.11.0 for more details.
109+
110+
## Single binary image mode.
111+
112+
The entire flash ram on the target processor is flashed with a single image.
113+
114+
The image can be flashed by using a USB to UART adapter connected to the main port when the CC3D is put into the STM32 bootloader mode, achieved by powering on the CC3D with the SBL/3.3v pads bridged.
115+
116+
# Restoring OpenPilot bootloader
117+
118+
If you have a JLink debugger, you can use JLinkExe to flash the open pilot bootloader.
119+
120+
1. Run JLinkExe `/Applications/SEGGER/JLink/JLinkExe`
121+
2. `device STM32F103CB`
122+
3. `r`
123+
4. `h`
124+
5. `loadbin opbl.bin, 0x08000000`
125+
6. `q`
126+
7. Re-plug CC3D.
127+
128+
Here's an example session:
129+
130+
```
131+
$ /Applications/SEGGER/JLink/JLinkExe
132+
SEGGER J-Link Commander V4.90c ('?' for help)
133+
Compiled Aug 29 2014 09:52:38
134+
DLL version V4.90c, compiled Aug 29 2014 09:52:33
135+
Firmware: J-Link ARM-OB STM32 compiled Aug 22 2012 19:52:04
136+
Hardware: V7.00
137+
S/N: -1
138+
Feature(s): RDI,FlashDL,FlashBP,JFlash,GDBFull
139+
VTarget = 3.300V
140+
Info: Could not measure total IR len. TDO is constant high.
141+
Info: Could not measure total IR len. TDO is constant high.
142+
No devices found on JTAG chain. Trying to find device on SWD.
143+
Info: Found SWD-DP with ID 0x1BA01477
144+
Info: Found Cortex-M3 r1p1, Little endian.
145+
Info: FPUnit: 6 code (BP) slots and 2 literal slots
146+
Info: TPIU fitted.
147+
Cortex-M3 identified.
148+
Target interface speed: 100 kHz
149+
J-Link>device STM32F103CB
150+
Info: Device "STM32F103CB" selected (128 KB flash, 20 KB RAM).
151+
Reconnecting to target...
152+
Info: Found SWD-DP with ID 0x1BA01477
153+
Info: Found SWD-DP with ID 0x1BA01477
154+
Info: Found Cortex-M3 r1p1, Little endian.
155+
Info: FPUnit: 6 code (BP) slots and 2 literal slots
156+
Info: TPIU fitted.
157+
J-Link>r
158+
Reset delay: 0 ms
159+
Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
160+
J-Link>h
161+
PC = 0800010C, CycleCnt = 00000000
162+
R0 = 0000000C, R1 = 0000003F, R2 = 00000000, R3 = 00000008
163+
R4 = 00003000, R5 = 023ACEFC, R6 = 200000F0, R7 = 20000304
164+
R8 = 023B92BC, R9 = 00000000, R10= ED691105, R11= F626177C
165+
R12= 000F0000
166+
SP(R13)= 20000934, MSP= 20000934, PSP= 20000934, R14(LR) = FFFFFFFF
167+
XPSR = 01000000: APSR = nzcvq, EPSR = 01000000, IPSR = 000 (NoException)
168+
CFBP = 00000000, CONTROL = 00, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 00
169+
J-Link>loadbin opbl.bin, 0x08000000
170+
Downloading file [opbl.bin]...
171+
WARNING: CPU is running at low speed (8004 kHz).
172+
Info: J-Link: Flash download: Flash download into internal flash skipped. Flash contents already match
173+
Info: J-Link: Flash download: Total time needed: 0.898s (Prepare: 0.709s, Compare: 0.128s, Erase: 0.000s, Program: 0.000s, Verify: 0.000s, Restore: 0.059s)
174+
O.K.
175+
J-Link>q
176+
$
177+
```

docs/boards/Board - CJMCU.md

+145
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# Board - CJMCU
2+
3+
The CJMCU is a tiny (80mm) board running a STM32F103, which contains a 3-Axis Compass (HMC5883L)
4+
and an Accelerometer/Gyro (MPU6050).
5+
6+
This board does not have an onboard USB-Serial converter, so an external adapter is needed.
7+
8+
# Hardware revisions
9+
10+
| Revision | Notes |
11+
| -------- | ----- |
12+
| 1 | No boot jumper pads by LED1. Uses blue and red LEDs |
13+
| 2 | Boot jumper pads presoldered with pins and a jumper by LED1. Uses green and red LEDs. |
14+
15+
Version 2 boards are supported from firmware v1.4.0 onwards, do NOT flash earlier versions to version 2 boards.
16+
17+
# Pins
18+
19+
## RX Connections
20+
21+
| Pin Label | Description |
22+
| --------- | ------------------------ |
23+
| PA0 | RC Channel 1 |
24+
| PA1 | RC Channel 2 |
25+
| PA2 | RC Channel 3 / USART2 TX |
26+
| PA3 | RC Channel 4 / USART2 RX |
27+
| VCC | Power (See note) |
28+
| GND | Ground |
29+
30+
NOTE: The VCC RX Pin is not regulated and will supply what ever voltage is provided to the board, this will mean it'll provide 5v if a 5v serial connection is used. Be careful if you are using a voltage sensitive RX. A regulated 3.3v supply can be found on the top pin of column 1, just below the RX GND pin.
31+
32+
## Serial Connections
33+
34+
USART1 (along with power) is on the following pins.
35+
36+
| Pin Label | Description |
37+
| --------- | --------------- |
38+
| TX1 | UART1 TX |
39+
| RX1 | UART2 RX |
40+
| GND | Ground |
41+
| 3V3 | Power +3.3v |
42+
| 5V | Power +5v |
43+
44+
USART2 is the following pins.
45+
46+
| Pin Label | Description |
47+
| --------- | ----------- |
48+
| PA2 | USART2 TX |
49+
| PA3 | USART2 RX |
50+
51+
52+
## Power Connections
53+
54+
| Pin Label | Description |
55+
| --------- | ----------------------- |
56+
| Power + | Power - 1 Cell 3.7v Max |
57+
| Power - | Ground |
58+
59+
## Motor Connections
60+
61+
In standard QUADX configuration, the motors are mapped:
62+
63+
| Cleanflight | CJMCU |
64+
| ----------- | ------ |
65+
| Motor 1 | Motor3 |
66+
| Motor 2 | Motor2 |
67+
| Motor 3 | Motor4 |
68+
| Motor 4 | Motor1 |
69+
70+
It is therefore simplest to wire the motors:
71+
* Motor 1 -> Clockwise
72+
* Motor 2 -> Anti-Clockwise
73+
* Motor 3 -> Clockwise
74+
* Motor 4 -> Anti-Clockwise
75+
76+
If you are using the Hubsan x4/Ladybird motors, clockwise are Blue (GND) / Red (VCC) wires, anticlockwise
77+
are Black (GND) / White (VCC).
78+
i.e. there is one wire on each motor out of the standard RED/BLACK VCC/GND polarity colors that can be used to identify polarity.
79+
80+
If you have wired as above, Motor1/Motor2 on the board will be forward.
81+
82+
# Connecting a Serial-USB Adapter
83+
84+
You will need a USB -> Serial UART adapter. Connect:
85+
86+
| Adapter | CJMCU |
87+
| ----------------- | -------------------------- |
88+
| Either 3.3v OR 5v | The correct 3.3v OR 5v pin |
89+
| RX | TX |
90+
| TX | RX |
91+
92+
When first connected this should power up the board, and will be in bootloader mode. If this does not happen, check
93+
the charge switch is set to POW.
94+
After the flashing process has been completed, this will allow access via the cleanflight configurator to change
95+
settings or flash a new firmware.
96+
97+
WARNING: If the motors are connected and the board boots into the bootloader, they will start
98+
to spin after around 20 seconds, it is recommended not to connect the motors until the board
99+
is flashed.
100+
101+
# Flashing
102+
103+
To flash the board:
104+
* Open Cleanflight Configurator
105+
* Choose the latest CJMCU firmware from the list.
106+
* Select "Load Firmware [Online]" and wait for the firmware to download.
107+
* Tick "No Reboot Sequence" and "Full Chip Erase"
108+
* Connect the USB->Serial adapter to the board
109+
* Select the USB-UART adapter from the top left box
110+
* Click "Flash Firmware"
111+
* You should see "Programming: SUCCESSFUL" in the log box
112+
* Click "Connect" -> This should open the "Initial Setup" tab and you should see sensor data from the quad shown
113+
* Unplug the quad and short the 2 "BOOT0" pins. Revision 1 boards require this to be soldered, revision 2 boards can connect the included jumper to the two pre-soldered pins - This prevents the board from going into bootloader mode on next
114+
boot, if anything goes wrong, simply disconnect these two pins and the bootloader will start, allowing you to reflash. You cannot
115+
overwrite the bootloader.
116+
117+
# Charging
118+
119+
The CJMCU has on it a TP4056 Lithium battery charging IC that can charge a 1S battery at 1A using a provided 5v supply attached to the 5v serial pin.
120+
121+
To charge an attached battery:
122+
* Set the power switch to OFF
123+
* Set the charge switch to CHG
124+
* Plug in a 1S battery to the battery pins
125+
* Plug in a 5v supply to the 5v serial pins
126+
127+
The charger will finish when either the battery reaches 4.2v, or the battery's voltage is greater than the charger's input voltage.
128+
129+
The two nearby LEDs will show the status of charging:
130+
131+
| Status | Green LED | Red LED |
132+
|--------------------|-----------|-----------|
133+
| Charging | On | Off |
134+
| Finished | Off | On |
135+
| 5v not connected | Off | Off |
136+
| Batt not connected | Flashing | On |
137+
138+
139+
# Helpful Hints
140+
141+
* If you are only using a 4 channel RX, in the auxiliary configuration tab, you can add a "Horizon" mode range around 1500
142+
for one of the the AUX channels which will result in it being always on
143+
* Enabling the feature MOTOR_STOP helps with crashes so it doesn't try to keep spinning on its back
144+
* When the power runs low, the quad will start jumping around a bit, if the flight behaviour seems strange, check your batteries charge
145+

0 commit comments

Comments
 (0)