Skip to content

Development

Janek edited this page Dec 17, 2024 · 66 revisions

ST-Link pinout

ST-Link is not required, you can flash using DFU mode without any additional hardware.

ST-Link pinout

Selected build time options

Option Values Description
DFPLAYER NO/YES Enable DFPlayer Voice support (1.11.0+)
FLYSKY_GIMBAL NO/YES Enable FlySky FS-HZCZ03-ADJ gimbal support (Since 1.11.0+)
PCBI6X_ELRS NO/YES Enable ExpressLRS/CRSF configuration tool (LUA alternative)
PCBI6X_INAV NO/YES Enable INAV Lite radar screen
PCBI6X_HELLO NO/YES Example "Hello World" radio tool to help interested programmers to create their own
USB_SERIAL NO/YES Enable USB Serial modes - Telemetry mirror or debug in DEBUG build.
USB_MSD NO/YES Enable USB Mass Storage mode.
AFHDS2A_LQI_CH 1-17 Injects RSSI at channel, default: 17
SBUS_TRAINER NO/YES Enable SBUS Trainer mode and trainer connected/disconnected sounds. (1.13.0+)
CRSF_UNINVERTED NO/YES Disable inversion of S.Port(CRSF), useful if you want to use ExpressLRS RX as TX option.(1.11.0-1.12.1)
CRSF_FULLDUPLEX NO/YES Enable CRSF full duplex mode with RX pin at PA15 pad. Removes inversion. Use with i.e.: ELRS RX as TX configuration. (1.13.0+)
CRSF_EXTENDED_TYPES NO/YES Enable CRSF configuration parameters STRING and FLOAT types support.
FAKE_RSSI NO/YES Converts TRSS to RSSI data for receivers not sending RSSI.
EXTPWR_INVERT NO/YES Invert ext module power pin PC13 to allow use of P-MOSFET. (1.12.0+)
MENU_DIAG_ANAS_KEYS NO/YES Enable Keys and analogs diagnostics screens
PPM_UNIT US/PERCENT_PREC0/PERCENT_PREC1 Channel value unit
DEBUG NO/YES Enable DEBUG serial output
GVARS NO/YES Enable Global Variables
HELI NO/YES Enable Heli menu

Compile

docker run --rm -it -e "BOARD_NAME=i6x" -e "CMAKE_FLAGS=PCB=I6X HELI=NO GVARS=YES PCBI6X_INAV=NO PCBI6X_ELRS=YES DEBUG=NO" -v ${PWD}:/opentx ajjjjjjjj/opentx-docker-i6x

Images to use:

ajjjjjjjj/opentx-docker-i6x - to compile using recent GCC version with LTO, this is current default.

vitass/opentx-fw-build - to compile older versions (1.8.0 and older) using GCC 4.7.

Flash

ST-Link: sudo st-flash write <file_to_flash>.bin 0x08000000

STM32 USB DFU Mode: dfu-util -a0 -s 0x08000000:leave -d 0483:df11 -D <file_to_flash>.bin

APM32 USB DFU Mode: dfu-util -a0 -s 0x08000000:leave -d 314b:0106 -D <file_to_flash>.bin

Debug port

Use USB Serial mode for debug log or AUX Serial port TX located at PA9 PCB pad. Serial port runs @115200 bauds, 8N1.

STM32F072 hardware mappings

GPIO / Exposed pads

Pad label AF Usage
PA9 USART1_TX AUX Serial TX
PA10 USART1_RX AUX Serial RX
PB8 TIM16_CH1, I2C1_SCL
PB9 TIM17_CH1, I2C1_SDA
TX2 (PD5) USART2_TX CRSF/Telemetry TX
PA15 USART2_RX CRSF/Telemetry RX (CRSF_FULLDUPLEX mode)
PC9 TIM3_CH4 Backlight PWM
PC12 No useful AF
PC13 No AF EXTMODULE Power switch
PC14 No AF DFPLAYER BUSY
PC15 No AF
PD0 SPI2_NSS (Slave select)
PD1 SPI2_SCK (Clock)
PD3 SPI2_MISO (Out)
PD4 SPI2_MOSI (In)
PD11 No useful AF
PF9 TIM15_CH1 PPM IN
PF10 TIM15_CH2 PPM OUT
TXD4 USART3/4_TX AUX3 Serial TX - DFPlayer
RXD4 USART3/4_RX AUX4 Serial RX - FS-HZCZ03-ADJ Gimbal

DMA

Channel Mapping Usage
1 ADC ADC
2 TX1, TX3, SPI1_RX
3 RX1, RX3, SPI1_TX AUX Serial RX (USART1)
4 TX1, TX2, SPI2_RX Telemetry TX DMA (TX2) (USART2)
5 RX1, RX2, SPI2_TX Telemetry RX DMA (RX2) (USART2)
6 RX2, RX3, RX4, SPI2_RX AUX4 Serial RX (USART4)
7 TX2, TX3, TX4, SPI2_TX

Timers

Timer Usage
TIM1 Buzzer PWM
TIM2
TIM3 BACKLIGHT_TIMER PWM
TIM6 STM32F0 delays
TIM7 TIMER_2MHz
TIM14 INTERRUPT_xMS
TIM15 EXTMODULE_TIMER (PPM + Trainer)
TIM16 INTMODULE_TIMER
TIM17 MIXER_SCHEDULER

NVIC priorities

Cortex-M0 (2 bits) Cortex-M3/4 (4 bits)
0 0
1 1
2 2-6
3 7-15