WIP: common board init

This commit is contained in:
Daniel Agar 2022-05-04 18:04:45 -04:00
parent 2cc25f0763
commit a1fa3cc699
No known key found for this signature in database
GPG Key ID: FD3CBA98017A69DE
25 changed files with 176 additions and 419 deletions

View File

@ -46,6 +46,7 @@ add_dependencies(drivers_board arch_board_hw_info)
target_link_libraries(drivers_board
PRIVATE
arch_board_hw_info
arch_init
arch_spi
drivers__led # drv_led_start
nuttx_arch # sdio

View File

@ -190,7 +190,6 @@
GPIO_HW_VER_DRIVE, \
GPIO_HEATER_OUTPUT, \
GPIO_VDD_3V3_SD_CARD_EN, \
GPIO_OTGFS_VBUS \
}
#define BOARD_ENABLE_CONSOLE_BUFFER

View File

@ -149,27 +149,6 @@ __EXPORT void board_on_reset(int status)
{
}
/************************************************************************************
* Name: stm32_boardinitialize
*
* Description:
* All STM32 architectures must provide the following entry point. This entry point
* is called early in the initialization -- after all memory has been configured
* and mapped but before any devices have been initialized.
*
************************************************************************************/
__EXPORT void stm32_boardinitialize(void)
{
/* Hold power state */
board_pwr_init(0);
/* configure pins */
const uint32_t gpio[] = PX4_GPIO_INIT_LIST;
px4_gpio_init(gpio, arraySize(gpio));
board_control_spi_sensors_power_configgpio();
}
/****************************************************************************
* Name: board_app_initialize
*

View File

@ -42,6 +42,7 @@ add_library(drivers_board
target_link_libraries(drivers_board
PRIVATE
arch_init
arch_spi
drivers__led # drv_led_start
nuttx_arch # sdio

View File

@ -149,10 +149,6 @@
#define PX4_GPIO_INIT_LIST { \
PX4_ADC_GPIO, \
GPIO_CAN1_TX, \
GPIO_CAN1_RX, \
GPIO_CAN2_TX, \
GPIO_CAN2_RX, \
GPIO_PWM_VOLT_SEL, \
GPIO_nVDD_BRICK1_VALID, \
GPIO_nVDD_BRICK1_VALID, \

View File

@ -107,29 +107,6 @@ __EXPORT void board_on_reset(int status)
}
}
/************************************************************************************
* Name: stm32_boardinitialize
*
* Description:
* All STM32 architectures must provide the following entry point. This entry point
* is called early in the initialization -- after all memory has been configured
* and mapped but before any devices have been initialized.
*
************************************************************************************/
__EXPORT void stm32_boardinitialize(void)
{
/* Reset PWM first thing */
board_on_reset(-1);
/* configure pins */
const uint32_t gpio[] = PX4_GPIO_INIT_LIST;
px4_gpio_init(gpio, arraySize(gpio));
board_control_spi_sensors_power_configgpio();
/* configure LEDs */
board_autoled_initialize();
}
/****************************************************************************
* Name: board_app_initialize
*

View File

@ -37,13 +37,21 @@
* Board-specific USB functions.
*/
#include "board_config.h"
#include <px4_platform_common/px4_config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <debug.h>
#include <nuttx/usb/usbdev.h>
#include <nuttx/usb/usbdev_trace.h>
#include <stm32_otg.h>
#include <debug.h>
#include <syslog.h>
#include <arm_arch.h>
#include <chip.h>
#include <stm32_gpio.h>
#include <stm32_otg.h>
#include "board_config.h"
/************************************************************************************
* Name: stm32_usbsuspend
@ -55,6 +63,7 @@
* while the USB is suspended.
*
************************************************************************************/
__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume)
{
uinfo("resume: %d\n", resume);

View File

@ -42,6 +42,7 @@ add_library(drivers_board
target_link_libraries(drivers_board
PRIVATE
arch_init
arch_spi
drivers__led # drv_led_start
nuttx_arch # sdio

View File

@ -132,37 +132,11 @@
#define BOARD_NUM_IO_TIMERS 4
__BEGIN_DECLS
/****************************************************************************************************
* Public Types
****************************************************************************************************/
/****************************************************************************************************
* Public data
****************************************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************************************
* Public Functions
****************************************************************************************************/
/****************************************************************************************************
* Name: stm32_spiinitialize
*
* Description:
* Called to configure SPI chip select GPIO pins for the board.
*
****************************************************************************************************/
extern void stm32_spiinitialize(void);
extern void stm32_usbinitialize(void);
extern void board_peripheral_reset(int ms);
#include <px4_platform_common/board_common.h>
#endif /* __ASSEMBLY__ */
__END_DECLS

View File

@ -37,10 +37,6 @@
* Board-specific USB functions.
*/
/************************************************************************************
* Included Files
************************************************************************************/
#include <px4_platform_common/px4_config.h>
#include <sys/types.h>
@ -57,37 +53,6 @@
#include <stm32_otg.h>
#include "board_config.h"
/************************************************************************************
* Definitions
************************************************************************************/
/************************************************************************************
* Private Functions
************************************************************************************/
/************************************************************************************
* Public Functions
************************************************************************************/
/************************************************************************************
* Name: stm32_usbinitialize
*
* Description:
* Called to setup USB-related GPIO pins for the board.
*
************************************************************************************/
__EXPORT void stm32_usbinitialize(void)
{
/* The OTG FS has an internal soft pull-up */
/* Configure the OTG FS VBUS sensing GPIO, Power On, and Overcurrent GPIOs */
#ifdef CONFIG_STM32F7_OTGFS
stm32_configgpio(GPIO_OTGFS_VBUS);
#endif
}
/************************************************************************************
* Name: stm32_usbsuspend
*

View File

@ -46,6 +46,7 @@ add_dependencies(drivers_board arch_board_hw_info)
target_link_libraries(drivers_board
PRIVATE
arch_init
arch_spi
arch_board_hw_info
drivers__led # drv_led_start

View File

@ -246,8 +246,6 @@
#define PX4_GPIO_INIT_LIST { \
PX4_ADC_GPIO, \
GPIO_HW_VER_REV_DRIVE, \
GPIO_CAN1_TX, \
GPIO_CAN1_RX, \
GPIO_VDD_3V3_SPEKTRUM_POWER_EN, \
GPIO_VDD_3V3_SD_CARD_EN, \
GPIO_A71CH_nRST, \
@ -299,8 +297,6 @@ int stm32_sdio_initialize(void);
extern void stm32_spiinitialize(void);
extern void stm32_usbinitialize(void);
extern void board_peripheral_reset(int ms);
#include <px4_platform_common/board_common.h>

View File

@ -146,64 +146,6 @@ __EXPORT void board_on_reset(int status)
}
}
/****************************************************************************
* Name: board_app_finalinitialize
*
* Description:
* Perform application specific initialization. This function is never
* called directly from application code, but only indirectly via the
* (non-standard) boardctl() interface using the command
* BOARDIOC_FINALINIT.
*
* Input Parameters:
* arg - The argument has no meaning.
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned on
* any failure to indicate the nature of the failure.
*
****************************************************************************/
#ifdef CONFIG_BOARDCTL_FINALINIT
int board_app_finalinitialize(uintptr_t arg)
{
return 0;
}
#endif
/************************************************************************************
* Name: stm32_boardinitialize
*
* Description:
* All STM32 architectures must provide the following entry point. This entry point
* is called early in the initialization -- after all memory has been configured
* and mapped but before any devices have been initialized.
*
************************************************************************************/
__EXPORT void
stm32_boardinitialize(void)
{
board_on_reset(-1); /* Reset PWM first thing */
/* configure LEDs */
board_autoled_initialize();
/* configure pins */
const uint32_t gpio[] = PX4_GPIO_INIT_LIST;
px4_gpio_init(gpio, arraySize(gpio));
/* configure SPI interfaces */
stm32_spiinitialize();
/* configure USB interfaces */
stm32_usbinitialize();
}
/****************************************************************************
* Name: board_app_initialize
@ -234,12 +176,10 @@ stm32_boardinitialize(void)
__EXPORT int board_app_initialize(uintptr_t arg)
{
/* Power on Interfaces */
VDD_3V3_SD_CARD_EN(true);
VDD_3V3_SPEKTRUM_POWER_EN(true);
/* Need hrt running before using the ADC */
px4_platform_init();
if (OK == board_determine_hw_info()) {
@ -250,8 +190,9 @@ __EXPORT int board_app_initialize(uintptr_t arg)
syslog(LOG_ERR, "[boot] Failed to read HW revision and version\n");
}
/* configure the DMA allocator */
stm32_spiinitialize();
/* configure the DMA allocator */
if (board_dma_alloc_init() < 0) {
syslog(LOG_ERR, "[boot] DMA alloc FAILED\n");
}

View File

@ -37,10 +37,6 @@
* Board-specific USB functions.
*/
/************************************************************************************
* Included Files
************************************************************************************/
#include <px4_platform_common/px4_config.h>
#include <sys/types.h>
@ -57,37 +53,6 @@
#include <stm32_otg.h>
#include "board_config.h"
/************************************************************************************
* Definitions
************************************************************************************/
/************************************************************************************
* Private Functions
************************************************************************************/
/************************************************************************************
* Public Functions
************************************************************************************/
/************************************************************************************
* Name: stm32_usbinitialize
*
* Description:
* Called to setup USB-related GPIO pins for the PX4FMU board.
*
************************************************************************************/
__EXPORT void stm32_usbinitialize(void)
{
/* The OTG FS has an internal soft pull-up */
/* Configure the OTG FS VBUS sensing GPIO, Power On, and Overcurrent GPIOs */
#ifdef CONFIG_STM32F7_OTGFS
stm32_configgpio(GPIO_OTGFS_VBUS);
#endif
}
/************************************************************************************
* Name: stm32_usbsuspend
*

View File

@ -381,12 +381,6 @@
#define GPIO_SPI6_SCK GPIO_SPI6_SCK_1 /* PG13 */
/* I2C
*
* Each I2C is associated with a U[S]ART
* hence the naming I2C2_SDA_UART4 in FMU USAGE spreadsheet
*
*
* I2C3 is not pined out on FMUv5 on 144 pin packages
*
* The optional _GPIO configurations allow the I2C driver to manually
* reset the bus to clear stuck slaves. They match the pin configuration,

View File

@ -52,6 +52,7 @@ add_dependencies(drivers_board nuttx_context)
target_link_libraries(drivers_board
PRIVATE
arch_board_hw_info
arch_init
arch_spi
drivers__led # drv_led_start
nuttx_arch # sdio

View File

@ -434,15 +434,6 @@ static inline bool board_get_external_lockout_state(void)
PX4_ADC_GPIO, \
GPIO_HW_REV_DRIVE, \
GPIO_HW_VER_DRIVE, \
GPIO_CAN1_TX, \
GPIO_CAN1_RX, \
GPIO_CAN2_TX, \
GPIO_CAN2_RX, \
GPIO_CAN3_TX, \
GPIO_CAN3_RX, \
GPIO_CAN1_SILENT_S0, \
GPIO_CAN2_SILENT_S1, \
GPIO_CAN3_SILENT_S2, \
GPIO_HEATER_OUTPUT, \
GPIO_nPOWER_IN_A, \
GPIO_nPOWER_IN_B, \
@ -460,14 +451,6 @@ static inline bool board_get_external_lockout_state(void)
GPIO_nSAFETY_SWITCH_LED_OUT_INIT, \
GPIO_SAFETY_SWITCH_IN, \
GPIO_nARMED_INIT, \
PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C1_SCL), \
PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C1_SDA), \
PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C2_SCL), \
PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C2_SDA), \
PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C3_SCL), \
PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C3_SDA), \
PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C4_SCL), \
PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C4_SDA), \
}
#define BOARD_ENABLE_CONSOLE_BUFFER
@ -511,8 +494,6 @@ int stm32_sdio_initialize(void);
extern void stm32_spiinitialize(void);
extern void stm32_usbinitialize(void);
extern void board_peripheral_reset(int ms);
#include <px4_platform_common/board_common.h>

View File

@ -148,37 +148,6 @@ __EXPORT void board_on_reset(int status)
}
}
/************************************************************************************
* Name: stm32_boardinitialize
*
* Description:
* All STM32 architectures must provide the following entry point. This entry point
* is called early in the initialization -- after all memory has been configured
* and mapped but before any devices have been initialized.
*
************************************************************************************/
__EXPORT void
stm32_boardinitialize(void)
{
board_on_reset(-1); /* Reset PWM first thing */
/* configure LEDs */
board_autoled_initialize();
/* configure pins */
const uint32_t gpio[] = PX4_GPIO_INIT_LIST;
px4_gpio_init(gpio, arraySize(gpio));
board_control_spi_sensors_power_configgpio();
/* configure USB interfaces */
stm32_usbinitialize();
}
/****************************************************************************
* Name: board_app_initialize
*

View File

@ -37,10 +37,6 @@
* Board-specific USB functions.
*/
/************************************************************************************
* Included Files
************************************************************************************/
#include <px4_platform_common/px4_config.h>
#include <sys/types.h>
@ -57,37 +53,6 @@
#include <stm32_otg.h>
#include "board_config.h"
/************************************************************************************
* Definitions
************************************************************************************/
/************************************************************************************
* Private Functions
************************************************************************************/
/************************************************************************************
* Public Functions
************************************************************************************/
/************************************************************************************
* Name: stm32_usbinitialize
*
* Description:
* Called to setup USB-related GPIO pins for the PX4FMU board.
*
************************************************************************************/
__EXPORT void stm32_usbinitialize(void)
{
/* The OTG FS has an internal soft pull-up */
/* Configure the OTG FS VBUS sensing GPIO, Power On, and Overcurrent GPIOs */
#ifdef CONFIG_STM32F7_OTGFS
stm32_configgpio(GPIO_OTGFS_VBUS);
#endif
}
/************************************************************************************
* Name: stm32_usbsuspend
*

View File

@ -48,6 +48,7 @@ add_dependencies(drivers_board platform_gpio_mcp23009)
target_link_libraries(drivers_board
PRIVATE
arch_init
arch_io_pins
arch_spi
arch_board_hw_info

View File

@ -250,7 +250,7 @@
/* ETHERNET GPIO */
#define GPIO_ETH_POWER_EN /* PG15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN15)
#define GPIO_ETH_POWER_EN /* PG15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN15)
/* NFC GPIO */
@ -399,10 +399,6 @@
#define PX4_GPIO_INIT_LIST { \
PX4_ADC_GPIO, \
GPIO_HW_VER_REV_DRIVE, \
GPIO_CAN1_TX, \
GPIO_CAN1_RX, \
GPIO_CAN2_TX, \
GPIO_CAN2_RX, \
GPIO_HEATER_OUTPUT, \
GPIO_nPOWER_IN_A, \
GPIO_nPOWER_IN_B, \
@ -424,14 +420,6 @@
GPIO_SAFETY_SWITCH_IN, \
GPIO_PG6, \
GPIO_nARMED_INIT, \
PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C1_SCL), \
PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C1_SDA), \
PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C2_SCL), \
PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C2_SDA), \
PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C3_SCL), \
PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C3_SDA), \
PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C4_SCL), \
PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C4_SDA), \
}
#define BOARD_ENABLE_CONSOLE_BUFFER
@ -442,47 +430,13 @@
#define PX4_I2C_BUS_MTD 4,5
__BEGIN_DECLS
/****************************************************************************************************
* Public Types
****************************************************************************************************/
/****************************************************************************************************
* Public data
****************************************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************************************
* Public Functions
****************************************************************************************************/
/****************************************************************************
* Name: stm32_sdio_initialize
*
* Description:
* Initialize SDIO-based MMC/SD card support
*
****************************************************************************/
int stm32_sdio_initialize(void);
/****************************************************************************************************
* Name: stm32_spiinitialize
*
* Description:
* Called to configure SPI chip select GPIO pins for the PX4FMU board.
*
****************************************************************************************************/
extern void stm32_spiinitialize(void);
extern void stm32_usbinitialize(void);
extern void board_peripheral_reset(int ms);
#include <px4_platform_common/board_common.h>
#endif /* __ASSEMBLY__ */
__END_DECLS

View File

@ -151,37 +151,6 @@ __EXPORT void board_on_reset(int status)
}
}
/************************************************************************************
* Name: stm32_boardinitialize
*
* Description:
* All STM32 architectures must provide the following entry point. This entry point
* is called early in the initialization -- after all memory has been configured
* and mapped but before any devices have been initialized.
*
************************************************************************************/
extern "C" __EXPORT void
stm32_boardinitialize(void)
{
board_on_reset(-1); /* Reset PWM first thing */
/* configure LEDs */
board_autoled_initialize();
/* configure pins */
const uint32_t gpio[] = PX4_GPIO_INIT_LIST;
px4_gpio_init(gpio, arraySize(gpio));
/* configure USB interfaces */
stm32_usbinitialize();
VDD_3V3_ETH_POWER_EN(true);
}
/****************************************************************************
* Name: board_app_initialize

View File

@ -32,15 +32,11 @@
****************************************************************************/
/**
* @file px4fmu_usb.c
* @file usb.c
*
* Board-specific USB functions.
*/
/************************************************************************************
* Included Files
************************************************************************************/
#include <px4_platform_common/px4_config.h>
#include <sys/types.h>
@ -57,37 +53,6 @@
#include <stm32_otg.h>
#include "board_config.h"
/************************************************************************************
* Definitions
************************************************************************************/
/************************************************************************************
* Private Functions
************************************************************************************/
/************************************************************************************
* Public Functions
************************************************************************************/
/************************************************************************************
* Name: stm32_usbinitialize
*
* Description:
* Called to setup USB-related GPIO pins for the PX4FMU board.
*
************************************************************************************/
__EXPORT void stm32_usbinitialize(void)
{
/* The OTG FS has an internal soft pull-up */
/* Configure the OTG FS VBUS sensing GPIO, Power On, and Overcurrent GPIOs */
#ifdef CONFIG_STM32F7_OTGFS
stm32_configgpio(GPIO_OTGFS_VBUS);
#endif
}
/************************************************************************************
* Name: stm32_usbsuspend
*

View File

@ -46,3 +46,9 @@ add_subdirectory(../stm32_common/version version)
add_subdirectory(px4io_serial)
add_subdirectory(watchdog)
px4_add_library(arch_init
init.cpp
)
target_link_libraries(arch_init PRIVATE px4_layer)

View File

@ -0,0 +1,147 @@
/****************************************************************************
*
* Copyright (c) 2022 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#include "board_config.h"
#include <px4_platform_common/px4_config.h>
#include <px4_platform/gpio.h>
#include <lib/systemlib/px4_macros.h>
extern "C" __EXPORT void stm32_boardinitialize(void)
{
#if defined(BOARD_HAS_ON_RESET)
// Reset PWM first thing
board_on_reset(-1);
#endif // BOARD_HAS_ON_RESET
#if defined(PX4_GPIO_INIT_LIST)
// configure pins
static constexpr uint32_t gpio_init_list[] = PX4_GPIO_INIT_LIST;
for (const auto &gpio : gpio_init_list) {
px4_arch_configgpio(gpio);
}
#endif // PX4_GPIO_INIT_LIST
board_control_spi_sensors_power_configgpio();
// I2C
#if defined(CONFIG_STM32F7_I2C1)
px4_arch_configgpio(PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C1_SCL));
px4_arch_configgpio(PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C1_SDA));
#endif // CONFIG_STM32F7_I2C1
#if defined(CONFIG_STM32F7_I2C2)
px4_arch_configgpio(PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C2_SCL));
px4_arch_configgpio(PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C2_SDA));
#endif // CONFIG_STM32F7_I2C2
#if defined(CONFIG_STM32F7_I2C3)
px4_arch_configgpio(PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C3_SCL));
px4_arch_configgpio(PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C3_SDA));
#endif // CONFIG_STM32F7_I2C3
#if defined(CONFIG_STM32F7_I2C4)
px4_arch_configgpio(PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C4_SCL));
px4_arch_configgpio(PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C4_SDA));
#endif // CONFIG_STM32F7_I2C4
// SPI
#if defined(CONFIG_STM32F7_SPI1)
px4_arch_configgpio(PX4_GPIO_PIN_OFF(GPIO_SPI1_SCK));
px4_arch_configgpio(PX4_GPIO_PIN_OFF(GPIO_SPI1_MISO));
px4_arch_configgpio(PX4_GPIO_PIN_OFF(GPIO_SPI1_MOSI));
#endif // CONFIG_STM32F7_SPI1
#if defined(CONFIG_STM32F7_SPI2)
px4_arch_configgpio(PX4_GPIO_PIN_OFF(GPIO_SPI2_SCK));
px4_arch_configgpio(PX4_GPIO_PIN_OFF(GPIO_SPI2_MISO));
px4_arch_configgpio(PX4_GPIO_PIN_OFF(GPIO_SPI2_MOSI));
#endif // CONFIG_STM32F7_SPI2
#if defined(CONFIG_STM32F7_SPI3)
px4_arch_configgpio(PX4_GPIO_PIN_OFF(GPIO_SPI3_SCK));
px4_arch_configgpio(PX4_GPIO_PIN_OFF(GPIO_SPI3_MISO));
px4_arch_configgpio(PX4_GPIO_PIN_OFF(GPIO_SPI3_MOSI));
#endif // CONFIG_STM32F7_SPI3
#if defined(CONFIG_STM32F7_SPI4)
px4_arch_configgpio(PX4_GPIO_PIN_OFF(GPIO_SPI4_SCK));
px4_arch_configgpio(PX4_GPIO_PIN_OFF(GPIO_SPI4_MISO));
px4_arch_configgpio(PX4_GPIO_PIN_OFF(GPIO_SPI4_MOSI));
#endif // CONFIG_STM32F7_SPI4
#if defined(CONFIG_STM32F7_SPI5)
px4_arch_configgpio(PX4_GPIO_PIN_OFF(GPIO_SPI5_SCK));
px4_arch_configgpio(PX4_GPIO_PIN_OFF(GPIO_SPI5_MISO));
px4_arch_configgpio(PX4_GPIO_PIN_OFF(GPIO_SPI5_MOSI));
#endif // CONFIG_STM32F7_SPI5
#if defined(CONFIG_STM32F7_SPI6)
px4_arch_configgpio(PX4_GPIO_PIN_OFF(GPIO_SPI6_SCK));
px4_arch_configgpio(PX4_GPIO_PIN_OFF(GPIO_SPI6_MISO));
px4_arch_configgpio(PX4_GPIO_PIN_OFF(GPIO_SPI6_MOSI));
#endif // CONFIG_STM32F7_SPI6
// CAN
#if defined(GPIO_CAN1_TX) && defined(GPIO_CAN1_RX)
px4_arch_configgpio(GPIO_CAN1_TX);
px4_arch_configgpio(GPIO_CAN1_RX);
# if defined(GPIO_CAN1_SILENT_S0)
px4_arch_configgpio(GPIO_CAN1_SILENT_S0);
# endif // GPIO_CAN1_SILENT_S0
#endif // GPIO_CAN1_TX && GPIO_CAN1_RX
#if defined(GPIO_CAN2_TX) && defined(GPIO_CAN2_RX)
px4_arch_configgpio(GPIO_CAN2_TX);
px4_arch_configgpio(GPIO_CAN2_RX);
# if defined(GPIO_CAN2_SILENT_S0)
px4_arch_configgpio(GPIO_CAN2_SILENT_S0);
# endif // GPIO_CAN2_SILENT_S0
#endif // GPIO_CAN2_TX && GPIO_CAN2_RX
#if defined(GPIO_CAN3_TX) && defined(GPIO_CAN3_RX)
px4_arch_configgpio(GPIO_CAN3_TX);
px4_arch_configgpio(GPIO_CAN3_RX);
# if defined(GPIO_CAN3_SILENT_S0)
px4_arch_configgpio(GPIO_CAN3_SILENT_S0);
# endif // GPIO_CAN3_SILENT_S0
#endif // GPIO_CAN3_TX && GPIO_CAN3_RX
#if defined(CONFIG_STM32F7_OTGFS)
// configure USB interfaces
stm32_configgpio(GPIO_OTGFS_VBUS);
#endif // CONFIG_STM32F7_OTGFS
#if defined(CONFIG_ARCH_LEDS)
// configure LEDs
board_autoled_initialize();
#endif // CONFIG_ARCH_LEDS
}