Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JFB-100 board support #23652

Merged
merged 9 commits into from May 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file added Tools/bootloaders/JFB100_bl.bin
Binary file not shown.
1,047 changes: 1,047 additions & 0 deletions Tools/bootloaders/JFB100_bl.hex

Large diffs are not rendered by default.

123 changes: 123 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/JFB100/README.md
@@ -0,0 +1,123 @@
# JFB-100 Flight Controller

The JFB-100 flight controller is sold by [JAE](https://www.jae.com/files/user/motion-sense-control/catalog/jfb-100-ja.pdf)

## Features

- STM32F765 microcontroller
- Two IMUs: ICM20602 and SCHA63T
- MS5611 SPI barometer
- builtin I2C IST8310 magnetometer
- microSD card slot
- 6 UARTs plus USB
- 8 PWM outputs
- Four I2C and two CAN ports
- External Buzzer
- external safety Switch
- voltage monitoring for servo rail and Vcc
- two dedicated power input ports for external power bricks

## UART Mapping

- SERIAL0 -> USB
- SERIAL1 -> UART2 (Telem1)
- SERIAL2 -> UART3 (Telem2)
- SERIAL3 -> UART1 (GPS)
- SERIAL4 -> UART4 (GPS2, marked UART/I2CB)
- SERIAL5 -> UART6 (RC)
- SERIAL6 -> UART7 (spare, debug)

The Telem1 and Telem2 ports have RTS/CTS pins, the other UARTs do not
have RTS/CTS.

The UART7 connector is labelled debug, but is available as a general
purpose UART with ArduPilot.

## RC Input

RC input is configured on the port marked DSM/SBUS RC. This connector
supports all RC protocols. Two cables are available for this port. To
use software binding of Spektrum satellite receivers you need to use
the Spektrum satellite cable.

## PWM Output

The JFB-100 supports up to 8 PWM outputs.
These are directly attached to the STM32F765 and support all
PWM protocols. The first 4 of the PWM outputs support DShot.

The 8 PWM outputs are in 3 groups:

- PWM 1, 2, 3 and 4 in group1
- PWM 5 and 6 in group2
- PWM 7 and 8 in group3

Channels within the same group need to use the same output rate. If
any channel in a group uses DShot then all channels in the group need
to use DShot.

## Battery Monitoring

The board has two dedicated power monitor ports on 8 pin
connectors. The correct battery setting parameters are dependent on
the type of power brick which is connected.

## Compass

The JFB-100 has a builtin IST8310 compass. Due to potential
interference the board is usually used with an external I2C compass as
part of a GPS/Compass combination.

## GPIOs

The 6 PWM ports can be used as GPIOs (relays, buttons, RPM etc). To
use them you need to limit the number of these pins that is used for
PWM by setting the BRD_PWM_COUNT to a number less than 6. For example
if you set BRD_PWM_COUNT to 4 then PWM5 and PWM6 will be available for
use as GPIOs.

The numbering of the GPIOs for PIN variables in ArduPilot is:

- AUX1 50
- AUX2 51
- AUX3 52
- AUX4 53
- AUX5 54
- AUX6 55

## Analog inputs

The JFB-100 has 7 analog inputs

- ADC Pin0 -> Battery Voltage
- ADC Pin1 -> Battery Current Sensor
- ADC Pin2 -> Battery Voltage 2
- ADC Pin3 -> Battery Current Sensor 2
- ADC Pin4 -> ADC port pin 2
- ADC Pin14 -> ADC port pin 3
- ADC Pin10 -> ADC 5V Sense
- ADC Pin11 -> ADC 3.3V Sense
- ADC Pin103 -> RSSI voltage monitoring

## I2C Buses

- the internal I2C port is bus 0 in ArduPilot (I2C3 in hardware)
- the port labelled I2CA is bus 3 in ArduPilot (I2C4 in hardware)
- the port labelled I2CB is bus 2 in ArduPilot (I2c2 in hardware)
- the port labelled GPS is bus 1 in ArduPilot (I2c1 in hardware)


## CAN

The JFB-100 has two independent CAN buses, with the following pinouts.

## Debug

The JFB-100 supports SWD debugging on the debug port


## Loading Firmware

The board comes pre-installed with an ArduPilot compatible bootloader,
allowing the loading of *.apj firmware files with any ArduPilot
compatible ground station.
3 changes: 3 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/JFB100/defaults.parm
@@ -0,0 +1,3 @@
# JFB-100 board default definition
SERIAL5_OPTIONS,8
SERIAL5_PROTOCOL,23
57 changes: 57 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/JFB100/hwdef-bl.dat
@@ -0,0 +1,57 @@
# hw definition file for processing by chibios_hwdef.py
# for F765 bootloader

# MCU class and specific type
MCU STM32F7xx STM32F767xx

# crystal frequency
OSCILLATOR_HZ 16000000

# board ID for firmware load
APJ_BOARD_ID 1084

FLASH_SIZE_KB 2048

# bootloader is installed at zero offset
FLASH_RESERVE_START_KB 0

# the location where the bootloader will put the firmware
FLASH_BOOTLOADER_LOAD_KB 32

PC6 LED_BOOTLOADER OUTPUT HIGH
PC7 LED_ACTIVITY OUTPUT HIGH
define HAL_LED_ON 0


# order of UARTs (and USB)
SERIAL_ORDER OTG1 USART2 UART7

# USART2 is telem1
PD6 USART2_RX USART2
PD5 USART2_TX USART2
PD3 USART2_CTS USART2
PD4 USART2_RTS USART2

PF6 UART7_RX UART7 NODMA
PE8 UART7_TX UART7 NODMA

PA11 OTG_FS_DM OTG1
PA12 OTG_FS_DP OTG1

PA13 JTMS-SWDIO SWD
PA14 JTCK-SWCLK SWD

# Add CS pins to ensure they are high in bootloader
PF10 MS5611_CS CS
PF2 SCHA63T_G_CS CS
PF3 ICM20602_CS CS SPEED_VERYLOW
PF4 SCHA63T_A_CS CS
PF5 FRAM_CS CS SPEED_VERYLOW
# PF11 SPARE_CS CS (using for WA6)
PH5 AUXMEM_CS CS
PI4 EXTERNAL1_CS1 CS
PI10 EXTERNAL1_CS2 CS
PI11 EXTERNAL1_CS3 CS
PI6 EXTERNAL2_CS1 CS
PI7 EXTERNAL2_CS2 CS
PI8 EXTERNAL2_CS3 CS