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

hwdef: Add support for Sierra-F1 #24695

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

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

Large diffs are not rendered by default.

Binary file added libraries/AP_HAL_ChibiOS/hwdef/Sierra-F1/F1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
233 changes: 233 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/Sierra-F1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
# Sierra-F1 Autopilot by Sierra Aerospace
https://www.sierraaerospace.in/

## Features
# Main Board:
- STM32H743 microcontroller
- 32MB QSPI flash
- BMI088+ICM42688 IMUs
- DPS310 barometer on SPI
- SDMMC support
- 4 UARTs- 2 with HW flow control
- 6 PWM outputs with DSHOT capability
- Dual FDCAN
- RCIN port
- Dual power input with 2xI2C
- No co-processor

# Expansion board:
- Ethernet PHY
- ICM42688/ICM45686/ADIS16507
- DPS310
- More PWMs with ALT function

## Physical spec:
- Weight: 15g, Dimension: 35x45mm

## UART Mapping
- SERIAL0 -> USB
- SERIAL1 -> UART2 (Telem1, DMA-enabled)
- SERIAL2 -> UART8 (Telem2, DMA-enabled)
- SERIAL3 -> UART7 (GPS, NODMA)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not the order you defined them in in the hwdef!

- SERIAL4 -> UART6 (UART or RCIN, DMA-enabled)
- SERIAL7 -> USB2 (virtual port on same connector)

The Telem1 & Telem2 port has RTS/CTS pins, the other UARTs do not have RTS/CTS.

## Connectors
MallikarjunSE marked this conversation as resolved.
Show resolved Hide resolved

-All JST-GH 6 and 4 pin connectors with FMUv6 standard pinout
-USB-C

### TELEM1

<table border="1" class="docutils">
<tbody>
<tr>
<th>Pin </th>
<th>Signal </th>
<th>Volt </th>
</tr>
<tr>
<td>1 (red)</td>
<td>VCC</td>
<td>+5V</td>
</tr>
<tr>
<td>2 (blk)</td>
<td>TX (OUT)</td>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TX2

<td>+3.3V</td>
</tr>
<tr>
<td>3 (blk)</td>
<td>RX (IN)</td>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RX2

<td>+3.3V</td>
</tr>
<tr>
<td>4 (blk)</td>
<td>CTS</td>
<td>+3.3V</td>
</tr>
<tr>
<td>5 (blk)</td>
<td>RTS</td>
<td>+3.3V</td>
</tr>
<tr>
<td>6 (blk)</td>
<td>GND</td>
<td>GND</td>
</tr>
</tbody>
</table>


### GPS + RCIN(UART6)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not correct, right? no I2C for compass, UART6 RX is not on the connector

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Henry, just checked. We have I2C only on power ports. This connector has UART6 or RCIN.

Copy link
Collaborator

@Hwurzburg Hwurzburg Aug 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's unfortunate....so external GPS/compass modules (the typical kind) cant connect to the GPS connector....so only CAN GPS/Compass can be used (using an internal compass is usually too prone to motor interference)....
in any case the GPS/RC connector show TX1/TX2 and RX1/RX2 not UART6 and UART7(GPS)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Most of our customers use CAN RM3100 for magnetometer. And I2C is there on Power ports for smart battery SMBus few our customers use.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, GPS is TX7/RX7 and RC is RX6....that is not what is listed below


<table border="1" class="docutils">
<tbody>
<tr>
<th>Pin</th>
<th>Signal</th>
<th>Volt</th>
</tr>
<tr>
<td>1 (red)</td>
<td>VCC</td>
<td>+5V</td>
</tr>
<tr>
<td>2 (blk)</td>
<td>TX1 (OUT)</td>
<td>+3.3V</td>
</tr>
<tr>
<td>3 (blk)</td>
<td>RX1 (IN)</td>
<td>+3.3V</td>
</tr>
<tr>
<td>4 (blk)</td>
<td>TX2 (OUT)</td>
<td>+3.3V</td>
</tr>
<tr>
<td>5 (blk)</td>
<td>RX2 (IN)</td>
<td>+3.3V</td>
</tr>
<tr>
<td>6 (blk)</td>
<td>GND</td>
<td>GND</td>
</tr>
</tbody>
</table>

### CAN1&2

<table border="1" class="docutils">
<tbody>
<tr>
<th>Pin</th>
<th>Signal</th>
<th>Volt</th>
</tr>
<tr>
<td>1 (red)</td>
<td>VCC</td>
<td>+5V</td>
</tr>
<tr>
<td>2 (blk)</td>
<td>CAN_H</td>
<td>+12V</td>
</tr>
<tr>
<td>3 (blk)</td>
<td>CAN_L</td>
<td>+12V</td>
</tr>
<tr>
<td>4 (blk)</td>
<td>GND</td>
<td>GND</td>
</tr>
</tbody>
</table>

### POWER1&2

<table border="1" class="docutils">
<tbody>
<tr>
<th>Pin</th>
<th>Signal</th>
<th>Volt</th>
</tr>
<tr>
<td>1 (red)</td>
<td>VCC</td>
<td>+5V</td>
</tr>
<tr>
<td>2 (red)</td>
<td>VCC</td>
<td>+5V</td>
</tr>
<tr>
<td>3 (blk)</td>
<td>SCL I2C</td>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should note which I2C bus....3 or 4 on the SCL and SDA pins

<td>up to +3.3V</td>
</tr>
<tr>
<td>4 (blk)</td>
<td>SDA I2C</td>
<td>up to +3.3V</td>
</tr>
<td>5 (blk)</td>
<td>GND</td>
<td>GND</td>
</tr>
<td>6 (blk)</td>
<td>GND</td>
<td>GND</td>
</tr>
</tbody>
</table>

## RC Input

RC input is configured on UART6 Rx pin.

## PWM Output

The Sierra-F1 supports up to 6 PWM outputs and DSHOT. Additional PWMs can be accessed via daugter board with ALT function.
The 6 PWM outputs are in 2 groups:

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

# PWM channels
- PE9 TIM1_CH1 TIM1 PWM(1) GPIO(50)
- PE11 TIM1_CH2 TIM1 PWM(2) GPIO(51)
- PE13 TIM1_CH3 TIM1 PWM(3) GPIO(52)
- PE14 TIM1_CH4 TIM1 PWM(4) GPIO(53)
- PB0 TIM3_CH3 TIM3 PWM(5) GPIO(54)
- PB1 TIM3_CH4 TIM3 PWM(6) GPIO(55)

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 a 6 pin
connector. The pinout on PWR1 and PWR2 follows FMUv6 standard.
- Vcc, Vcc, I2Cx_SCL, I2Cx_SDA, GND, GND

## 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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/Sierra-F1/defaults.parm
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Serial3 default to GPS
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my mistake....SERIAL3 already defaults to GPS....so not needed.....but need to fix UART order in hwdef so that UART7 is third and UART6 is forth, not the other way around...

SERIAL3_PROTOCOL 5

# Enable CAN1 and CAN2
CAN_P1_DRIVER 1
CAN_P2_DRIVER 2

# LED drivers
NTF_LED_TYPES 289

# EKF setup
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are not required.....already defaults

EK3_IMU_MASK 7
EK3_PRIMARY 1
72 changes: 72 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/Sierra-F1/hwdef-bl.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# hw definition file for processing by chibios_hwdef.py
# for Sierra-F1 autopilot

# MCU class and specific type
MCU STM32H7xx STM32H743xx

# crystal frequency
OSCILLATOR_HZ 24000000

# board ID for firmware load
APJ_BOARD_ID 1087

# USB setup
USB_STRING_MANUFACTURER "Sierra Aerospace"
USB_STRING_PRODUCT "Sierra-F1-BL"

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 128

# LEDs
PE15 LED_BOOTLOADER OUTPUT
define HAL_LED_ON 0

PD5 USART2_TX USART2
PA3 USART2_RX USART2

PA13 JTMS-SWDIO SWD
PA14 JTCK-SWCLK SWD

PA11 OTG_FS_DM OTG1
PA12 OTG_FS_DP OTG1
PA9 VBUS INPUT OPENDRAIN

# order of UARTs (and USB)
SERIAL_ORDER OTG1 USART2

define STM32_SERIAL_USE_USART2 TRUE
define HAL_USE_SERIAL TRUE

define BOOTLOADER_DEBUG SD2

# reserve 256 bytes for comms between app and bootloader
RAM_RESERVE_START 256

# QSPI Flash
PD11 QUADSPI_BK1_IO0 QUADSPI1
PD12 QUADSPI_BK1_IO1 QUADSPI1
PE2 QUADSPI_BK1_IO2 QUADSPI1
PD13 QUADSPI_BK1_IO3 QUADSPI1
PB10 QUADSPI_BK1_NCS QUADSPI1
PB2 QUADSPI_CLK QUADSPI1

EXT_FLASH_SIZE_MB 32
INT_FLASH_PRIMARY 1

QSPIDEV w25q QUADSPI1 MODE1 100*MHZ 22 1

# disable peripheral and sensor power in the bootloader
PC14 VDD_3V3_SENSORS_EN OUTPUT HIGH
PC15 EXT_LDO_EN OUTPUT LOW

PA4 ICM42688_CS CS
PC13 BMI088_A_CS CS
PE3 BMI088_G_CS CS
PA15 ICM42688ext_CS CS
PA10 DPS310ext_CS CS
PE4 DPS310_CS CS
Loading
Loading