diff --git a/.gitmodules b/.gitmodules index 6ecc529..76c72ed 100644 --- a/.gitmodules +++ b/.gitmodules @@ -62,3 +62,6 @@ path = src/modules/uxrce_dds_client/Micro-XRCE-DDS-Client url = https://github.com/PX4/Micro-XRCE-DDS-Client.git branch = px4 +[submodule "src/modules/mavlink/mavlink_nimbus"] + path = src/modules/mavlink/mavlink_nimbus + url = git@bitbucket.org:nimbussrl/mavlinknimbusc.git diff --git a/boards/airmind/mindpx-v2/default.px4board b/boards/airmind/mindpx-v2/default.px4board deleted file mode 100644 index a95ace0..0000000 --- a/boards/airmind/mindpx-v2/default.px4board +++ /dev/null @@ -1,101 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS3" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS2" -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_COMMON_BAROMETERS=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU6000=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU6500=y -CONFIG_DRIVERS_IMU_L3GD20=y -CONFIG_DRIVERS_IMU_LSM303D=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_PWM_INPUT=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_BOARD_UAVCAN_INTERFACES=1 -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UUV_ATT_CONTROL=y -CONFIG_MODULES_UUV_POS_CONTROL=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BL_UPDATE=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SERIAL_TEST=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_FAKE_GPS=y diff --git a/boards/airmind/mindpx-v2/extras/airmind_mindpx-v2_bootloader.bin b/boards/airmind/mindpx-v2/extras/airmind_mindpx-v2_bootloader.bin deleted file mode 100644 index 591d039..0000000 Binary files a/boards/airmind/mindpx-v2/extras/airmind_mindpx-v2_bootloader.bin and /dev/null differ diff --git a/boards/airmind/mindpx-v2/firmware.prototype b/boards/airmind/mindpx-v2/firmware.prototype deleted file mode 100644 index 0030e92..0000000 --- a/boards/airmind/mindpx-v2/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 88, - "magic": "MindPX", - "description": "Firmware for the MindPXFMUv2 board", - "image": "", - "build_time": 0, - "summary": "MindPXFMUv2", - "version": "2.1", - "image_size": 0, - "image_maxsize": 2080768, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/airmind/mindpx-v2/init/rc.board_defaults b/boards/airmind/mindpx-v2/init/rc.board_defaults deleted file mode 100644 index 5d576dd..0000000 --- a/boards/airmind/mindpx-v2/init/rc.board_defaults +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 10.177939394 -param set-default BAT1_A_PER_V 15.391030303 diff --git a/boards/airmind/mindpx-v2/init/rc.board_sensors b/boards/airmind/mindpx-v2/init/rc.board_sensors deleted file mode 100644 index 30fca7a..0000000 --- a/boards/airmind/mindpx-v2/init/rc.board_sensors +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# -# Airmind Mindpx-v2 specific board sensors init -#------------------------------------------------------------------------------ - -board_adc start - -# Internal I2C bus -hmc5883 -T -I -R 12 start -qmc5883l -I -R 6 start - -mpu6000 -s -R 2 start -mpu6500 -s -R 2 start -lsm303d -s -R 10 start -l3gd20 -s -R 14 start - -# Internal SPI -ms5611 -s start diff --git a/boards/airmind/mindpx-v2/nuttx-config/include/board.h b/boards/airmind/mindpx-v2/nuttx-config/include/board.h deleted file mode 100644 index 45432af..0000000 --- a/boards/airmind/mindpx-v2/nuttx-config/include/board.h +++ /dev/null @@ -1,271 +0,0 @@ -/************************************************************************************ - * configs/px4fmu/include/board.h - * include/arch/board/board.h - * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ************************************************************************************/ - -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ -#include "board_dma_map.h" - -#include -#ifndef __ASSEMBLY__ -# include -#endif - -#include - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The MINDPX uses a 8MHz crystal connected to the HSE. - * - * This is the "standard" configuration as set up by arch/arm/src/stm32f40xx_rcc.c: - * System Clock source : PLL (HSE) - * SYSCLK(Hz) : 168000000 Determined by PLL configuration - * HCLK(Hz) : 168000000 (STM32_RCC_CFGR_HPRE) - * AHB Prescaler : 1 (STM32_RCC_CFGR_HPRE) - * APB1 Prescaler : 4 (STM32_RCC_CFGR_PPRE1) - * APB2 Prescaler : 2 (STM32_RCC_CFGR_PPRE2) - * HSE Frequency(Hz) : 8000000 (STM32_BOARD_XTAL) - * PLLM : 8 (STM32_PLLCFG_PLLM) - * PLLN : 336 (STM32_PLLCFG_PLLN) - * PLLP : 2 (STM32_PLLCFG_PLLP) - * PLLQ : 7 (STM32_PLLCFG_PPQ) - * Main regulator output voltage : Scale1 mode Needed for high speed SYSCLK - * Flash Latency(WS) : 5 - * Prefetch Buffer : OFF - * Instruction cache : ON - * Data cache : ON - * Require 48MHz for USB OTG FS, : Enabled - * SDIO and RNG clock - */ - -/* HSI - 16 MHz RC factory-trimmed - * LSI - 32 KHz RC - * HSE - On-board crystal frequency is 8MHz - * LSE - not installed - */ - -#define STM32_BOARD_XTAL 8000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -//#define STM32_LSE_FREQUENCY 32768 - -/* Main PLL Configuration. - * - * PLL source is HSE - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * = (8,000,000 / 8) * 336 - * = 336,000,000 - * SYSCLK = PLL_VCO / PLLP - * = 336,000,000 / 2 = 168,000,000 - * USB OTG FS, SDIO and RNG Clock - * = PLL_VCO / PLLQ - * = 48,000,000 - */ - -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(8) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(336) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(7) - -#define STM32_SYSCLK_FREQUENCY 168000000ul - -/* AHB clock (HCLK) is SYSCLK (168MHz) */ - -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (42MHz) */ - -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (84MHz) */ - -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx - * otherwise frequency is 2xAPBx. - * Note: TIM1,8-11 are on APB2, others on APB1 - */ - -#define BOARD_TIM1_FREQUENCY STM32_APB2_TIM1_CLKIN -#define BOARD_TIM2_FREQUENCY STM32_APB1_TIM2_CLKIN -#define BOARD_TIM3_FREQUENCY STM32_APB1_TIM3_CLKIN -#define BOARD_TIM4_FREQUENCY STM32_APB1_TIM4_CLKIN -#define BOARD_TIM5_FREQUENCY STM32_APB1_TIM5_CLKIN -#define BOARD_TIM6_FREQUENCY STM32_APB1_TIM6_CLKIN -#define BOARD_TIM7_FREQUENCY STM32_APB1_TIM7_CLKIN -#define BOARD_TIM8_FREQUENCY STM32_APB2_TIM8_CLKIN -#define BOARD_TIM9_FREQUENCY STM32_APB2_TIM9_CLKIN -#define BOARD_TIM10_FREQUENCY STM32_APB2_TIM10_CLKIN -#define BOARD_TIM11_FREQUENCY STM32_APB2_TIM11_CLKIN -#define BOARD_TIM12_FREQUENCY STM32_APB1_TIM12_CLKIN -#define BOARD_TIM13_FREQUENCY STM32_APB1_TIM13_CLKIN -#define BOARD_TIM14_FREQUENCY STM32_APB1_TIM14_CLKIN - -/* SDIO dividers. Note that slower clocking is required when DMA is disabled - * in order to avoid RX overrun/TX underrun errors due to delayed responses - * to service FIFOs in interrupt driven mode. These values have not been - * tuned!!! - * - * SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(118+2)=400 KHz - */ - -#define SDIO_INIT_CLKDIV (118 << SDIO_CLKCR_CLKDIV_SHIFT) - -/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz - * DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32_SDIO_DMA -# define SDIO_MMCXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) -#else -# define SDIO_MMCXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) -#endif - -/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz - * DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32_SDIO_DMA -# define SDIO_SDXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) -#else -# define SDIO_SDXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) -#endif - -/* Alternate function pin selections ************************************************/ - -/* - * UARTs. - */ -#define GPIO_USART1_RX GPIO_USART1_RX_2 /* RC_INPUT */ -#define GPIO_USART1_TX GPIO_USART1_TX_2 - -#define GPIO_USART2_RX GPIO_USART2_RX_2 -#define GPIO_USART2_TX GPIO_USART2_TX_2 -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 -#define GPIO_USART2_CTS GPIO_USART2_CTS_2 - -#define GPIO_USART3_RX GPIO_USART3_RX_3 -#define GPIO_USART3_TX GPIO_USART3_TX_3 -#define GPIO_USART3_CTS 0 // unused -#define GPIO_USART3_RTS 0 // unused - -#define GPIO_UART4_RX GPIO_UART4_RX_1 -#define GPIO_UART4_TX GPIO_UART4_TX_1 - -#define GPIO_USART6_RX GPIO_USART6_RX_2 -#define GPIO_USART6_TX GPIO_USART6_TX_2 - -#define GPIO_UART7_RX GPIO_UART7_RX_1 -#define GPIO_UART7_TX GPIO_UART7_TX_1 - -/* UART8 has no alternate pin config */ - -/* - * CAN - * - * CAN1 is routed to the onboard transceiver. - */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 - -/* - * I2C - * - * The optional _GPIO configurations allow the I2C driver to manually - * reset the bus to clear stuck slaves. They match the pin configuration, - * but are normally-high GPIOs. - */ -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN8) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN9) - -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_1 -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_1 -#define GPIO_I2C2_SCL_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN10) -#define GPIO_I2C2_SDA_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN11) - -/* - * SPI - * - * There are sensors on SPI1, and SPI2 is connected to the FRAM. - */ -#define GPIO_SPI1_MISO (GPIO_SPI1_MISO_1|GPIO_SPEED_50MHz) -#define GPIO_SPI1_MOSI (GPIO_SPI1_MOSI_2|GPIO_SPEED_50MHz) -#define GPIO_SPI1_SCK (GPIO_SPI1_SCK_1|GPIO_SPEED_50MHz) - -#define GPIO_SPI2_MISO (GPIO_SPI2_MISO_1|GPIO_SPEED_50MHz) -#define GPIO_SPI2_MOSI (GPIO_SPI2_MOSI_1|GPIO_SPEED_50MHz) -#define GPIO_SPI2_SCK (GPIO_SPI2_SCK_2|GPIO_SPEED_50MHz) - -#define GPIO_SPI4_MISO (GPIO_SPI4_MISO_1|GPIO_SPEED_50MHz) -#define GPIO_SPI4_MOSI (GPIO_SPI4_MOSI_1|GPIO_SPEED_50MHz) -#define GPIO_SPI4_SCK (GPIO_SPI4_SCK_1|GPIO_SPEED_50MHz) - - -#endif /* __ARCH_BOARD_BOARD_H */ diff --git a/boards/airmind/mindpx-v2/nuttx-config/include/board_dma_map.h b/boards/airmind/mindpx-v2/nuttx-config/include/board_dma_map.h deleted file mode 100644 index a00e649..0000000 --- a/boards/airmind/mindpx-v2/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - - -/* -| DMA1 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | SPI3_RX_1 | - | SPI3_RX_2 | SPI2_RX | SPI2_TX | SPI3_TX_1 | - | SPI3_TX_2 | -| Channel 1 | I2C1_RX | - | TIM7_UP_1 | - | TIM7_UP_2 | I2C1_RX_1 | I2C1_TX | I2C1_TX_1 | -| Channel 2 | TIM4_CH1 | - | I2C4_RX | TIM4_CH2 | - | I2C4_RX | TIM4_UP | TIM4_CH3 | -| Channel 3 | - | TIM2_UP_1 | I2C3_RX_1 | I2C2_EXT_RX | I2C3_TX | TIM2_CH1 | TIM2_CH2 | TIM2_UP_2 | -| | | TIM2_CH3 | | | | | TIM2_CH4_1 | TIM2_CH4_2 | -| Channel 4 | UART5_RX | USART3_RX | UART4_RX | USART3_TX_1 | UART4_TX | USART2_RX | USART2_TX | UART5_TX | -| Channel 5 | UART8_TX | UART7_TX | TIM3_CH4 | UART7_RX | TIM3_CH1 | TIM3_CH2 | UART8_RX | TIM3_CH3 | -| | | | TIM3_UP | | TIM3_TRIG | | | | -| Channel 6 | TIM5_CH3 | TIM5_CH4_1 | TIM5_CH1 | TIM5_CH4_2 | TIM5_CH2 | - | TIM5_UP_2 | - | -| | TIM5_UP_1 | TIM5_TRIG_1 | | TIM5_TRIG_2 | | | | | -| Channel 7 | - | TIM6_UP | I2C2_RX | I2C2_RX_1 | USART3_TX_2 | DAC1 | DAC2 | I2C2_TX | -| | | | | | | | | | -| Usage | | | | | | | | | - - -| DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | ADC1_1 | SAI1_A | TIM8_CH1_1 | SAI1_A_1 | ADC1_2 | SAI1_B_1 | TIM1_CH1_1 | - | -| | | | TIM8_CH2_1 | | | | TIM1_CH2_1 | | -| | | | TIM8_CH3_1 | | | | TIM1_CH3_1 | | -| Channel 1 | - | DCMI_1 | ADC2_1 | ADC2_2 | SAI1_B | SPI6_TX | SPI6_RX | DCMI_2 | -| Channel 2 | ADC3_1 | ADC3_2 | - | SPI5_RX_1 | SPI5_TX_1 | CRYP_OUT | CRYP_IN | HASH_IN | -| Channel 3 | SPI1_RX_1 | - | SPI1_RX_2 | SPI1_TX_1 | - | SPI1_TX_2 | - | QUADSPI | -| Channel 4 | SPI4_RX_1 | SPI4_TX_1 | USART1_RX_1 | SDIO | - | USART1_RX_2 | SDIO | USART1_TX | -| Channel 5 | - | USART6_RX_1 | USART6_RX_2 | SPI4_RX_2 | SPI4_TX_2 | - | USART6_TX_1 | USART6_TX_2 | -| Channel 6 | TIM1_TRIG_1 | TIM1_CH1_2 | TIM1_CH2_2 | TIM1_CH1 | TIM1_CH4 | TIM1_UP | TIM1_CH3_2 | - | -| | | | | | TIM1_TRIG_2 | | | | -| | | | | | TIM1_COM | | | | -| Channel 7 | - | TIM8_UP | TIM8_CH1_2 | TIM8_CH2_2 | TIM8_CH3_2 | SPI5_RX_2 | SPI5_TX_2 | TIM8_CH4 | -| | | | | | | | | TIM8_TRIG | -| | | | | | | | | TIM8_COM | -| | | | | | | | | | -| Usage | SPI4_RX_1 | USART6_RX_1 | USART1_RX_1 | | SPI4_TX_2 | | SDIO | | - */ - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- - - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMACHAN_SPI4_RX DMAMAP_SPI4_RX_1 // DMA2, Stream 0, Channel 4 (SPI sensors RX) -#define DMAMAP_USART6_RX DMAMAP_USART6_RX_1 // DMA2, Stream 1, Channel 4 -#define DMAMAP_USART1_RX DMAMAP_USART1_RX_1 // DMA2, Stream 2, Channel 4 -// AVAILABLE // DMA2, Stream 3 -#define DMACHAN_SPI4_TX DMAMAP_SPI4_TX_2 // DMA2, Stream 4, Channel 5 (SPI sensors TX) -// AVAILABLE // DMA2, Stream 5, Channel 6 -#define DMAMAP_SDIO DMAMAP_SDIO_2 // DMA2, Stream 6, Channel 4 diff --git a/boards/airmind/mindpx-v2/nuttx-config/nsh/defconfig b/boards/airmind/mindpx-v2/nuttx-config/nsh/defconfig deleted file mode 100644 index 9a19661..0000000 --- a/boards/airmind/mindpx-v2/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,253 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_STM32_CCMEXCLUDE is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/airmind/mindpx-v2/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F427V=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0030 -CONFIG_CDCACM_PRODUCTSTR="MindPX FMU v2.x" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=2000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="3D Robotics" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=2 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDIO_BLOCKSETUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32_ADC1=y -CONFIG_STM32_BBSRAM=y -CONFIG_STM32_BBSRAM_FILES=5 -CONFIG_STM32_BKPSRAM=y -CONFIG_STM32_CCMDATARAM=y -CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y -CONFIG_STM32_DMA1=y -CONFIG_STM32_DMA2=y -CONFIG_STM32_FLASH_CONFIG_I=y -CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_STM32_I2C1=y -CONFIG_STM32_I2C2=y -CONFIG_STM32_I2CTIMEOMS=10 -CONFIG_STM32_I2CTIMEOTICKS=10 -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_OTGFS=y -CONFIG_STM32_PWR=y -CONFIG_STM32_RTC=y -CONFIG_STM32_RTC_HSECLOCK=y -CONFIG_STM32_RTC_MAGIC=0xfacefeee -CONFIG_STM32_RTC_MAGIC_REG=1 -CONFIG_STM32_RTC_MAGIC_TIME_SET=0xfacefeef -CONFIG_STM32_SAVE_CRASHDUMP=y -CONFIG_STM32_SDIO=y -CONFIG_STM32_SDIO_CARD=y -CONFIG_STM32_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32_SPI1=y -CONFIG_STM32_SPI2=y -CONFIG_STM32_SPI4=y -CONFIG_STM32_SPI4_DMA=y -CONFIG_STM32_SPI4_DMA_BUFFER=512 -CONFIG_STM32_SPI_DMATHRESHOLD=8 -CONFIG_STM32_TIM10=y -CONFIG_STM32_TIM11=y -CONFIG_STM32_TIM3=y -CONFIG_STM32_TIM9=y -CONFIG_STM32_UART4=y -CONFIG_STM32_UART7=y -CONFIG_STM32_UART8=y -CONFIG_STM32_USART1=y -CONFIG_STM32_USART2=y -CONFIG_STM32_USART3=y -CONFIG_STM32_USART6=y -CONFIG_STM32_USART_BREAKS=y -CONFIG_STM32_USART_SINGLEWIRE=y -CONFIG_STM32_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=300 -CONFIG_UART4_RXDMA=y -CONFIG_UART4_TXBUFSIZE=300 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=300 -CONFIG_UART7_RXDMA=y -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=300 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=300 -CONFIG_UART8_TXBUFSIZE=300 -CONFIG_USART1_RXBUFSIZE=128 -CONFIG_USART1_RXDMA=y -CONFIG_USART1_TXBUFSIZE=32 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=1100 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_RXBUFSIZE=300 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=300 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=300 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/airmind/mindpx-v2/nuttx-config/scripts/script.ld b/boards/airmind/mindpx-v2/nuttx-config/scripts/script.ld deleted file mode 100644 index 6d92733..0000000 --- a/boards/airmind/mindpx-v2/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************************** - * scripts/ld.script - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F427 has 2048Kb of FLASH beginning at address 0x0800:0000 and - * 256Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of SRAM beginning at address 0x2002:0000 - * 4) 64Kb of TCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 0x4000 of flash is reserved for the bootloader. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08004000, LENGTH = 2032K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 192K - ccsram (rwx) : ORIGIN = 0x10000000, LENGTH = 64K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/airmind/mindpx-v2/src/CMakeLists.txt b/boards/airmind/mindpx-v2/src/CMakeLists.txt deleted file mode 100644 index e28e360..0000000 --- a/boards/airmind/mindpx-v2/src/CMakeLists.txt +++ /dev/null @@ -1,51 +0,0 @@ -############################################################################ -# -# Copyright (c) 2015 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. -# -############################################################################ - -add_library(drivers_board - can.c - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - usb.c -) - -target_link_libraries(drivers_board - PRIVATE - arch_spi - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer -) diff --git a/boards/airmind/mindpx-v2/src/board_config.h b/boards/airmind/mindpx-v2/src/board_config.h deleted file mode 100644 index 65d587f..0000000 --- a/boards/airmind/mindpx-v2/src/board_config.h +++ /dev/null @@ -1,193 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2015, 2016 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * MINDPXv2 internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ -/* Configuration ************************************************************************************/ - - -/* PX4FMU GPIOs ***********************************************************************************/ -/* LEDs */ -#define GPIO_LED1 (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN8) -#define BOARD_OVERLOAD_LED LED_RED - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that can be used by the Px4 Firmware in the adc driver - */ -#define ADC_CHANNELS (1 << 4) | (1 << 10) | (1 << 11) | (1 << 12) | (1 << 13) | (1 << 14) | (1 << 15) - -// ADC defines to be used in sensors.cpp to read from a particular channel -#define ADC_5V_RAIL_SENSE 4 -#define ADC_BATTERY_CURRENT_CHANNEL 10 -#define ADC_BATTERY_VOLTAGE_CHANNEL 12 -#define ADC_RC_RSSI_CHANNEL 11 -#define ADC_AIRSPEED_VOLTAGE_CHANNEL 15 - -/* Power supply control and monitoring GPIOs */ -// #define GPIO_VDD_5V_PERIPH_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN8) -// #define GPIO_VDD_BRICK_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5) -// #define GPIO_VDD_SERVO_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN7) -// #define GPIO_VDD_3V3_SENSORS_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN3) -// #define GPIO_VDD_5V_HIPOWER_OC (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN10) -// #define GPIO_VDD_5V_PERIPH_OC (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN15) - -/* Tone alarm output */ -#define TONE_ALARM_TIMER 14 /* timer 14 */ -#define TONE_ALARM_CHANNEL 1 /* channel 1 */ -#define GPIO_TONE_ALARM_IDLE (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN7) -#define GPIO_TONE_ALARM (GPIO_ALT|GPIO_AF9|GPIO_SPEED_2MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN7) - -/* AUX PWMs - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 8 - -/* USB OTG FS - * - * PA9 OTG_FS_VBUS VBUS sensing - */ -#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN9) - - - -/* High-resolution timer */ -#define HRT_TIMER 8 /* use timer8 for the HRT */ -#define HRT_TIMER_CHANNEL 2 /* use capture/compare channel */ - -#define HRT_PPM_CHANNEL 1 -#define GPIO_PPM_IN GPIO_TIM8_CH1IN_1 - -/* PWM input driver. Use FMU AUX5 pins attached to timer4 channel 1 */ -#define PWMIN_TIMER 4 -#define PWMIN_TIMER_CHANNEL 1 -#define GPIO_PWM_IN GPIO_TIM1_CH1IN_2 - -#define RC_SERIAL_PORT "/dev/ttyS0" - -// #define GPIO_RSSI_IN (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN1) -#define GPIO_SBUS_INV (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN10) -#define RC_INVERT_INPUT(_invert_true) px4_arch_gpiowrite(GPIO_SBUS_INV, _invert_true); - -#define GPIO_FRSKY_INV (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN12) -#define INVERT_FRSKY(_invert_true) px4_arch_gpiowrite(GPIO_FRSKY_INV, _invert_true); - -/* Power switch controls */ -#define SPEKTRUM_POWER(_on_true) do { } while (0) - -/* - * MindPXv2 has one RC_IN - * - * GPIO PPM_IN on PC6 T8CH1 - * SPEKTRUM_RX (it's TX or RX in Bind) on PC6 UART1 - * Inversion is possible via the 74LVC2G86 controlled by the FMU - * The FMU can drive GPIO PPM_IN as an output - */ - -#define GPIO_PPM_IN_AS_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN6) -#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_PPM_IN_AS_OUT) -#define SPEKTRUM_RX_AS_UART() px4_arch_configgpio(GPIO_USART1_RX) -#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true)) - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_BRICK_VALID (1) -#define BOARD_ADC_SERVO_VALID (1) -#define BOARD_ADC_PERIPH_5V_OC (0) -#define BOARD_ADC_HIPOWER_5V_OC (0) - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ - -#define BOARD_HAS_ON_RESET 1 - -__BEGIN_DECLS - -/**************************************************************************************************** - * Public Types - ****************************************************************************************************/ - -/**************************************************************************************************** - * Public data - ****************************************************************************************************/ - -#ifndef __ASSEMBLY__ - -/**************************************************************************************************** - * Public Functions - ****************************************************************************************************/ - -/**************************************************************************************************** - * 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); - - -#define board_peripheral_reset(ms) - - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/airmind/mindpx-v2/src/can.c b/boards/airmind/mindpx-v2/src/can.c deleted file mode 100644 index b826cf0..0000000 --- a/boards/airmind/mindpx-v2/src/can.c +++ /dev/null @@ -1,129 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2015, 2016 Airmind 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 Airmind 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. - * - ****************************************************************************/ - -/** - * @file mindpx_can.c - * - * Board-specific CAN functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include - -#include -#include - -#include "chip.h" -#include "arm_internal.h" - -#include "stm32.h" -#include "stm32_can.h" -#include "board_config.h" - -#ifdef CONFIG_CAN - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) -# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." -# undef CONFIG_STM32_CAN2 -#endif - -#ifdef CONFIG_STM32_CAN1 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} - -#endif diff --git a/boards/airmind/mindpx-v2/src/i2c.cpp b/boards/airmind/mindpx-v2/src/i2c.cpp deleted file mode 100644 index 5802883..0000000 --- a/boards/airmind/mindpx-v2/src/i2c.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusInternal(1), - initI2CBusExternal(2), -}; - diff --git a/boards/airmind/mindpx-v2/src/init.c b/boards/airmind/mindpx-v2/src/init.c deleted file mode 100644 index 836bea7..0000000 --- a/boards/airmind/mindpx-v2/src/init.c +++ /dev/null @@ -1,299 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2015, 2016 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. - * - ****************************************************************************/ - -/** - * @file mindpx2_init.c - * - * MINDPX-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include "board_config.h" -#include - -#include - -#include -#include - -#include -#include -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - /* configure the GPIO pins to outputs and keep them low */ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(io_timer_channel_get_gpio_output(i)); - } - - /** - * On resets invoked from system (not boot) insure we establish a low - * output state (discharge the pins) on PWM pins before they become inputs. - */ - - if (status >= 0) { - up_mdelay(400); - } -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ -/************************************************************************************ - * Name: stm32_boardinitialize - * - * Description: - * All STM32 architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. - * - ************************************************************************************/ - -__EXPORT void -stm32_boardinitialize(void) -{ - // Reset all PWM to Low outputs. - - board_on_reset(-1); - - /* configure LEDs */ - - board_autoled_initialize(); - - /* configure ADC pins */ - - stm32_configgpio(GPIO_ADC1_IN4); /* VDD_5V_SENS */ - stm32_configgpio(GPIO_ADC1_IN10); /* BATT_CURRENT_SENS */ - stm32_configgpio(GPIO_ADC1_IN12); /* BATT_VOLTAGE_SENS */ - stm32_configgpio(GPIO_ADC1_IN11); /* RSSI analog in */ - stm32_configgpio(GPIO_ADC1_IN13); /* FMU_AUX_ADC_1 */ - stm32_configgpio(GPIO_ADC1_IN14); /* FMU_AUX_ADC_2 */ - stm32_configgpio(GPIO_ADC1_IN15); /* PRESSURE_SENS */ - - /* configure power supply control/sense pins */ - - stm32_configgpio(GPIO_SBUS_INV); - stm32_configgpio(GPIO_FRSKY_INV); - - /* configure CAN interface */ - - stm32_configgpio(GPIO_CAN1_RX); - stm32_configgpio(GPIO_CAN1_TX); - - /* configure SPI interfaces */ - - stm32_spiinitialize(); - - stm32_configgpio(GPIO_I2C2_SCL); - stm32_configgpio(GPIO_I2C2_SDA); - - stm32_configgpio(GPIO_I2C1_SCL); - stm32_configgpio(GPIO_I2C1_SDA); - -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -static struct spi_dev_s *spi1; -static struct spi_dev_s *spi2; -static struct spi_dev_s *spi4; -static struct sdio_dev_s *sdio; - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - px4_platform_init(); - - /* configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_AMBER); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_AMBER); - } - - /* Configure SPI-based devices */ - - spi4 = px4_spibus_initialize(4); - - if (!spi4) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 4\n"); - board_autoled_on(LED_AMBER); - } - - /* Default SPI4 to 10MHz and de-assert the known chip selects. */ - SPI_SETFREQUENCY(spi4, 10000000); - SPI_SETBITS(spi4, 8); - SPI_SETMODE(spi4, SPIDEV_MODE3); - up_udelay(20); - - /* Get the SPI port for the FRAM */ - - spi1 = stm32_spibus_initialize(1); - - if (!spi1) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 1\n"); - board_autoled_on(LED_AMBER); - } - - /* Default SPI1 to 37.5 MHz (40 MHz rounded to nearest valid divider, F4 max) - * and de-assert the known chip selects. */ - - // XXX start with 10.4 MHz in FRAM usage and go up to 37.5 once validated - SPI_SETFREQUENCY(spi1, 24 * 1000 * 1000); - SPI_SETBITS(spi1, 8); - - - spi2 = px4_spibus_initialize(2); - - /* Default SPI2 to 10MHz and de-assert the known chip selects. */ - SPI_SETFREQUENCY(spi2, 10000000); - SPI_SETBITS(spi2, 8); - - -#ifdef CONFIG_MMCSD - /* First, get an instance of the SDIO interface */ - - sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO); - - if (!sdio) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", CONFIG_NSH_MMCSDSLOTNO); - } - - /* Now bind the SDIO interface to the MMC/SD driver */ - int ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio); - - if (ret != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); - } - - /* Then let's guess and say that there is a card in the slot. There is no card detect GPIO. */ - sdio_mediachange(sdio, true); - -#endif - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/airmind/mindpx-v2/src/led.c b/boards/airmind/mindpx-v2/src/led.c deleted file mode 100644 index fd26ceb..0000000 --- a/boards/airmind/mindpx-v2/src/led.c +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2015, 2016 Airmind 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 Airmind 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. - * - ****************************************************************************/ - -/** - * @file mindpx2_led.c - * - * PX4FMU LED backend. - */ - -#include - -#include - -#include "stm32.h" -#include "board_config.h" - -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -__EXPORT void led_init() -{ - /* Configure LED1 GPIO for output */ - - stm32_configgpio(GPIO_LED1); -} - -__EXPORT void led_on(int led) -{ - if (led == 1) { - /* Pull down to switch on */ - stm32_gpiowrite(GPIO_LED1, false); - } -} - -__EXPORT void led_off(int led) -{ - if (led == 1) { - /* Pull up to switch off */ - stm32_gpiowrite(GPIO_LED1, true); - } -} - -__EXPORT void led_toggle(int led) -{ - if (led == 1) { - if (stm32_gpioread(GPIO_LED1)) { - stm32_gpiowrite(GPIO_LED1, false); - - } else { - stm32_gpiowrite(GPIO_LED1, true); - } - } -} diff --git a/boards/airmind/mindpx-v2/src/spi.cpp b/boards/airmind/mindpx-v2/src/spi.cpp deleted file mode 100644 index 2d44f1d..0000000 --- a/boards/airmind/mindpx-v2/src/spi.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortE, GPIO::Pin12}), - }), - initSPIBusExternal(SPI::Bus::SPI2, { - initSPIConfigExternal(SPI::CS{GPIO::PortD, GPIO::Pin7}), - }), - initSPIBus(SPI::Bus::SPI4, { - initSPIDevice(DRV_GYR_DEVTYPE_L3GD20, SPI::CS{GPIO::PortB, GPIO::Pin2}, SPI::DRDY{GPIO::PortE, GPIO::Pin4}), - initSPIDevice(DRV_IMU_DEVTYPE_LSM303D, SPI::CS{GPIO::PortD, GPIO::Pin11}), - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortC, GPIO::Pin15}), - initSPIDevice(DRV_IMU_DEVTYPE_MPU6000, SPI::CS{GPIO::PortE, GPIO::Pin3}, SPI::DRDY{GPIO::PortE, GPIO::Pin10}), - initSPIDevice(DRV_IMU_DEVTYPE_MPU6500, SPI::CS{GPIO::PortE, GPIO::Pin3}, SPI::DRDY{GPIO::PortE, GPIO::Pin10}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/airmind/mindpx-v2/src/timer_config.cpp b/boards/airmind/mindpx-v2/src/timer_config.cpp deleted file mode 100644 index 6f917d6..0000000 --- a/boards/airmind/mindpx-v2/src/timer_config.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2015, 2016 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1), - initIOTimer(Timer::Timer4), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortE, GPIO::Pin13}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer4, Timer::Channel1}, {GPIO::PortD, GPIO::Pin12}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer4, Timer::Channel4}, {GPIO::PortD, GPIO::Pin15}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/airmind/mindpx-v2/src/usb.c b/boards/airmind/mindpx-v2/src/usb.c deleted file mode 100644 index 93a008c..0000000 --- a/boards/airmind/mindpx-v2/src/usb.c +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2015, 2016 Airmind 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 Airmind 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. - * - ****************************************************************************/ - -/** - * @file mindpx_usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#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_STM32_OTGFS - stm32_configgpio(GPIO_OTGFS_VBUS); - /* XXX We only support device mode - stm32_configgpio(GPIO_OTGFS_PWRON); - stm32_configgpio(GPIO_OTGFS_OVER); - */ -#endif -} - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} - diff --git a/boards/ark/can-flow/canbootloader.px4board b/boards/ark/can-flow/canbootloader.px4board deleted file mode 100644 index 4691728..0000000 --- a/boards/ark/can-flow/canbootloader.px4board +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_ROMFSROOT="" -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_DRIVERS_BOOTLOADERS=y diff --git a/boards/ark/can-flow/default.px4board b/boards/ark/can-flow/default.px4board deleted file mode 100644 index a120df6..0000000 --- a/boards/ark/can-flow/default.px4board +++ /dev/null @@ -1,32 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_ROMFSROOT="cannode" -CONFIG_BOARD_CONSTRAINED_FLASH=y -CONFIG_BOARD_NO_HELP=y -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_DRIVERS_BOOTLOADERS=y -CONFIG_DRIVERS_DISTANCE_SENSOR_BROADCOM_AFBRS50=y -CONFIG_DRIVERS_IMU_BOSCH_BMI088=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y -CONFIG_DRIVERS_IMU_INVENSENSE_IIM42652=y -CONFIG_DRIVERS_OPTICAL_FLOW_PAA3905=y -CONFIG_DRIVERS_OPTICAL_FLOW_PAW3902=y -CONFIG_BOARD_UAVCAN_INTERFACES=1 -CONFIG_DRIVERS_UAVCANNODE=y -CONFIG_UAVCANNODE_FLOW_MEASUREMENT=y -CONFIG_UAVCANNODE_RANGE_SENSOR_MEASUREMENT=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_SENSORS=y -# CONFIG_SENSORS_VEHICLE_AIRSPEED is not set -# CONFIG_SENSORS_VEHICLE_AIR_DATA is not set -# CONFIG_SENSORS_VEHICLE_ACCELERATION is not set -# CONFIG_SENSORS_VEHICLE_GPS_POSITION is not set -# CONFIG_SENSORS_VEHICLE_MAGNETOMETER is not set -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/ark/can-flow/firmware.prototype b/boards/ark/can-flow/firmware.prototype deleted file mode 100644 index a59e1ad..0000000 --- a/boards/ark/can-flow/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 80, - "magic": "PX4FWv1", - "description": "Firmware for the ARK flow board", - "image": "", - "build_time": 0, - "summary": "ARFFLOW", - "version": "0.1", - "image_size": 0, - "image_maxsize": 2080768, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/ark/can-flow/init/rc.board_sensors b/boards/ark/can-flow/init/rc.board_sensors deleted file mode 100644 index 9099c97..0000000 --- a/boards/ark/can-flow/init/rc.board_sensors +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# -# board sensors init -#------------------------------------------------------------------------------ - -param set-default IMU_GYRO_RATEMAX 1000 - -# Internal SPI -if ! paw3902 -s start -Y 180 -then - paa3905 -s start -Y 180 -fi - -if ! icm42688p -R 0 -s start -then - if ! iim42652 -R 0 -s start - then - bmi088 -A -s -R 4 start - bmi088 -G -s -R 4 start - fi -fi - -afbrs50 start diff --git a/boards/ark/can-flow/nuttx-config/canbootloader/defconfig b/boards/ark/can-flow/nuttx-config/canbootloader/defconfig deleted file mode 100644 index 16ff05d..0000000 --- a/boards/ark/can-flow/nuttx-config/canbootloader/defconfig +++ /dev/null @@ -1,56 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/ark/can-flow/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F412CE=y -CONFIG_ARCH_INTERRUPTSTACK=4096 -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BINFMT_DISABLE=y -CONFIG_BOARDCTL=y -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DISABLE_MOUNTPOINT=y -CONFIG_EXPERIMENTAL=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=4096 -CONFIG_INIT_STACKSIZE=4096 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_MM_REGIONS=2 -CONFIG_NAME_MAX=0 -CONFIG_NUNGET_CHARS=0 -CONFIG_PREALLOC_TIMERS=0 -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_DISABLE_BUFFERING=y -CONFIG_STM32_NOEXT_VECTORS=y -CONFIG_STM32_TIM8=y -CONFIG_TASK_NAME_SIZE=0 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/ark/can-flow/nuttx-config/include/board.h b/boards/ark/can-flow/nuttx-config/include/board.h deleted file mode 100644 index 09db41d..0000000 --- a/boards/ark/can-flow/nuttx-config/include/board.h +++ /dev/null @@ -1,136 +0,0 @@ -/************************************************************************************ - * configs/px4fmu/include/board.h - * include/arch/board/board.h - * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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_dma_map.h" - -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H - -#include -#ifndef __ASSEMBLY__ -# include -#endif - -#include - -/* HSI - 8 MHz RC factory-trimmed - * LSI - 32 KHz RC - * HSE - 8 MHz Crystal - * LSE - not installed - */ -#define STM32_BOARD_USEHSE 1 -#define STM32_BOARD_XTAL 8000000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 - -/* Main PLL Configuration */ -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(8) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(384) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_4 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(8) -#define STM32_PLLCFG_PLLR RCC_PLLCFG_PLLR(2) - -#define STM32_RCC_PLLI2SCFGR_PLLI2SM RCC_PLLI2SCFGR_PLLI2SM(16) -#define STM32_RCC_PLLI2SCFGR_PLLI2SN RCC_PLLI2SCFGR_PLLI2SN(192) -#define STM32_RCC_PLLI2SCFGR_PLLI2SQ RCC_PLLI2SCFGR_PLLI2SQ(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SR RCC_PLLI2SCFGR_PLLI2SR(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SSRC RCC_PLLI2SCFGR_PLLI2SSRC(0) /* HSE or HSI depending on PLLSRC of PLLCFGR*/ - -#define STM32_RCC_DCKCFGR2_CK48MSEL RCC_DCKCFGR2_CK48MSEL_PLL -#define STM32_RCC_DCKCFGR2_FMPI2C1SEL RCC_DCKCFGR2_FMPI2C1SEL_APB -#define STM32_RCC_DCKCFGR2_SDIOSEL RCC_DCKCFGR2_SDIOSEL_48MHZ - -#define STM32_SYSCLK_FREQUENCY 96000000ul - -/* AHB clock (HCLK) is SYSCLK (96MHz) */ -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* Same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/2 (48MHz) */ -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB1 will be twice PCLK1 (see page 112 of reference manual) */ -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK (96MHz) */ -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLK /* PCLK2 = HCLK */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY) - -/* Timers driven from APB2 will be PCLK2 since no prescale division */ -#define STM32_APB2_TIM1_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (STM32_PCLK2_FREQUENCY) - -/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx otherwise frequency is 2xAPBx. */ -#define BOARD_TIM2_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM3_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM4_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM5_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM6_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM7_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM8_FREQUENCY (2 * STM32_PCLK2_FREQUENCY) - -/* Alternate function pin selections ************************************************/ - -/* UARTs */ -#define GPIO_USART2_RX GPIO_USART2_RX_1 -#define GPIO_USART2_TX GPIO_USART2_TX_1 - -/* CAN */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_2 -#define GPIO_CAN1_TX GPIO_CAN1_TX_2 - -/* SPI */ -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 - -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 /* PB14 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 /* PB15 */ -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_1 /* PB10 */ - -#endif /* __ARCH_BOARD_BOARD_H */ diff --git a/boards/ark/can-flow/nuttx-config/include/board_dma_map.h b/boards/ark/can-flow/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 0eb81fc..0000000 --- a/boards/ark/can-flow/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -#pragma once - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMACHAN_SPI2_RX DMAMAP_SPI2_RX // DMA1, Stream 3, Channel 0 -#define DMACHAN_SPI2_TX DMAMAP_SPI2_TX // DMA1, Stream 4, Channel 0 - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMACHAN_SPI1_RX DMAMAP_SPI1_RX_2 // DMA2, Stream 2, Channel 3 -#define DMACHAN_SPI1_TX DMAMAP_SPI1_TX_2 // DMA2, Stream 5, Channel 3 diff --git a/boards/ark/can-flow/nuttx-config/nsh/defconfig b/boards/ark/can-flow/nuttx-config/nsh/defconfig deleted file mode 100644 index 15d1458..0000000 --- a/boards/ark/can-flow/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,175 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/ark/can-flow/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F412CE=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2624 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MM_REGIONS=2 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=254 -CONFIG_SCHED_HPWORKSTACKSIZE=3000 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32_ADC1=y -CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y -CONFIG_STM32_DMA1=y -CONFIG_STM32_DMA2=y -CONFIG_STM32_FLASH_PREFETCH=y -CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_PWR=y -CONFIG_STM32_RTC=y -CONFIG_STM32_RTC_HSECLOCK=y -CONFIG_STM32_RTC_MAGIC=0xfacefeee -CONFIG_STM32_RTC_MAGIC_REG=1 -CONFIG_STM32_RTC_MAGIC_TIME_SET=0xfacefeef -CONFIG_STM32_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32_SPI1=y -CONFIG_STM32_SPI1_DMA=y -CONFIG_STM32_SPI1_DMA_BUFFER=2048 -CONFIG_STM32_SPI2=y -CONFIG_STM32_SPI2_DMA=y -CONFIG_STM32_SPI2_DMA_BUFFER=2048 -CONFIG_STM32_TIM8=y -CONFIG_STM32_USART2=y -CONFIG_STM32_USART_BREAKS=y -CONFIG_STM32_WWDG=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_SERIAL_CONSOLE=y -CONFIG_USART2_TXBUFSIZE=1100 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/ark/can-flow/nuttx-config/scripts/canbootloader_script.ld b/boards/ark/can-flow/nuttx-config/scripts/canbootloader_script.ld deleted file mode 100644 index cbf9fdd..0000000 --- a/boards/ark/can-flow/nuttx-config/scripts/canbootloader_script.ld +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** - * nuttx-config/scripts/canbootloader_script.ld - * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F412 has 512Kb of FLASH beginning at address 0x0800:0000 and - * 256Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of SRAM beginning at address 0x2002:0000 - * 4) 64Kb of TCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 0x10000 of flash is reserved for the bootloader. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08000000, LENGTH = 32K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 192K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/ark/can-flow/nuttx-config/scripts/script.ld b/boards/ark/can-flow/nuttx-config/scripts/script.ld deleted file mode 100644 index c63c749..0000000 --- a/boards/ark/can-flow/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************************** - * scripts/ld.script - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F412 has 512Kb of FLASH beginning at address 0x0800:0000 and - * 256Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of SRAM beginning at address 0x2002:0000 - * 4) 64Kb of TCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 0x10000 of flash is reserved for the bootloader. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08010000, LENGTH = 448K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 192K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(8); - /* - * This section positions the app_descriptor_t used - * by the make_can_boot_descriptor.py tool to set - * the application image's descriptor so that the - * uavcan bootloader has the ability to validate the - * image crc, size etc - */ - KEEP(*(.app_descriptor)) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/ark/can-flow/src/CMakeLists.txt b/boards/ark/can-flow/src/CMakeLists.txt deleted file mode 100644 index 4fae41f..0000000 --- a/boards/ark/can-flow/src/CMakeLists.txt +++ /dev/null @@ -1,65 +0,0 @@ -############################################################################ -# -# Copyright (c) 2020 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. -# -############################################################################ - -if("${PX4_BOARD_LABEL}" STREQUAL "canbootloader") - - add_library(drivers_board - boot_config.h - boot.c - led.c - ) - target_link_libraries(drivers_board - PRIVATE - nuttx_arch - nuttx_drivers - canbootloader - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/canbootloader) - -else() - add_library(drivers_board - can.c - init.c - led.c - spi.cpp - ) - - target_link_libraries(drivers_board - PRIVATE - arch_spi - drivers__led # drv_led_start - nuttx_arch - nuttx_drivers - px4_layer - ) -endif() diff --git a/boards/ark/can-flow/src/board_config.h b/boards/ark/can-flow/src/board_config.h deleted file mode 100644 index 40f302e..0000000 --- a/boards/ark/can-flow/src/board_config.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * board internal definitions - */ - -#pragma once - -#include -#include -#include - -/* CAN Silent mode control */ -#define GPIO_CAN1_SILENT_S0 /* PA9 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN9) - -/* CAN termination software control */ -#define GPIO_CAN1_TERMINATION /* PB13 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN13) -#define GPIO_CAN_TERM GPIO_CAN1_TERMINATION - -/* Boot config */ -#define GPIO_BOOT_CONFIG /* PC15 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN15|GPIO_EXTI) - -/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */ -#define GPIO_nLED_RED /* PB3 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN3) -#define GPIO_nLED_BLUE /* PA8 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN8) - -#define BROADCOM_AFBR_S50_S2PI_SPI_BUS 2 -#define BROADCOM_AFBR_S50_S2PI_CS /* PB12 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN12) -#define BROADCOM_AFBR_S50_S2PI_IRQ /* PB4 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN4|GPIO_EXTI) -#define BROADCOM_AFBR_S50_S2PI_CLK /* PB10 */ GPIO_SPI2_SCK_1 -#define BROADCOM_AFBR_S50_S2PI_MOSI /* PB15 */ GPIO_SPI2_MOSI_1 -#define BROADCOM_AFBR_S50_S2PI_MISO /* PB14 */ GPIO_SPI2_MISO_1 - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_OVERLOAD_LED LED_RED -#define BOARD_ARMED_STATE_LED LED_BLUE - -#define FLASH_BASED_PARAMS - -/* High-resolution timer */ -#define HRT_TIMER 3 /* use timer 3 for the HRT */ -#define HRT_TIMER_CHANNEL 4 /* use capture/compare channel 4 */ - -__BEGIN_DECLS - -#ifndef __ASSEMBLY__ - -extern void stm32_spiinitialize(void); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/ark/can-flow/src/boot.c b/boards/ark/can-flow/src/boot.c deleted file mode 100644 index a0716b9..0000000 --- a/boards/ark/can-flow/src/boot.c +++ /dev/null @@ -1,186 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 PX4 Development Team. All rights reserved. - * Author: Ben Dyer - * Pavel Kirienko - * David Sidrane - * - * 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include "boot_config.h" -#include "board.h" - -#include -#include -#include - -#include - -__BEGIN_DECLS -extern void led_init(void); -extern void bootloader_led_on(int led); -extern void bootloader_led_off(int led); -__END_DECLS - -/************************************************************************************ - * 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) -{ - putreg32(getreg32(STM32_RCC_APB1ENR) | RCC_APB1ENR_CAN1EN, STM32_RCC_APB1ENR); - stm32_configgpio(GPIO_CAN1_RX); - stm32_configgpio(GPIO_CAN1_TX); - stm32_configgpio(GPIO_CAN1_SILENT_S0); - stm32_configgpio(GPIO_CAN1_TERMINATION); - putreg32(getreg32(STM32_RCC_APB1RSTR) | RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR); - putreg32(getreg32(STM32_RCC_APB1RSTR) & ~RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR); - - led_init(); - -#if defined(OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO) - stm32_configgpio(GPIO_GETNODEINFO_JUMPER); -#endif - -} - -/************************************************************************************ - * Name: board_deinitialize - * - * Description: - * This function is called by the bootloader code prior to booting - * the application. Is should place the HW into an benign initialized state. - * - ************************************************************************************/ - -void board_deinitialize(void) -{ - putreg32(getreg32(STM32_RCC_APB1RSTR) | RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR); -} - -/**************************************************************************** - * Name: board_get_product_name - * - * Description: - * Called to retrieve the product name. The returned value is a assumed - * to be written to a pascal style string that will be length prefixed - * and not null terminated - * - * Input Parameters: - * product_name - A pointer to a buffer to write the name. - * maxlen - The maximum number of charter that can be written - * - * Returned Value: - * The length of characters written to the buffer. - * - ****************************************************************************/ - -uint8_t board_get_product_name(uint8_t *product_name, size_t maxlen) -{ - DEBUGASSERT(maxlen > UAVCAN_STRLEN(HW_UAVCAN_NAME)); - memcpy(product_name, HW_UAVCAN_NAME, UAVCAN_STRLEN(HW_UAVCAN_NAME)); - return UAVCAN_STRLEN(HW_UAVCAN_NAME); -} - -/**************************************************************************** - * Name: board_get_hardware_version - * - * Description: - * Called to retrieve the hardware version information. The function - * will first initialize the the callers struct to all zeros. - * - * Input Parameters: - * hw_version - A pointer to a uavcan_hardwareversion_t. - * - * Returned Value: - * Length of the unique_id - * - ****************************************************************************/ - -size_t board_get_hardware_version(uavcan_HardwareVersion_t *hw_version) -{ - memset(hw_version, 0, sizeof(uavcan_HardwareVersion_t)); - - hw_version->major = HW_VERSION_MAJOR; - hw_version->minor = HW_VERSION_MINOR; - - return board_get_mfguid(*(mfguid_t *) hw_version->unique_id); -} - -/**************************************************************************** - * Name: board_indicate - * - * Description: - * Provides User feedback to indicate the state of the bootloader - * on board specific hardware. - * - * Input Parameters: - * indication - A member of the uiindication_t - * - * Returned Value: - * None - * - ****************************************************************************/ -void board_indicate(uiindication_t indication) -{ - if (indication == off) { - bootloader_led_off(GPIO_nLED_RED); - bootloader_led_off(GPIO_nLED_BLUE); - - } else if (indication == fw_update_start) { - bootloader_led_on(GPIO_nLED_RED); - bootloader_led_on(GPIO_nLED_BLUE); - - } else if ((indication == fw_update_erase_fail) || (indication == fw_update_invalid_response) - || (indication == fw_update_timeout) || (indication == fw_update_invalid_crc)) { - bootloader_led_on(GPIO_nLED_RED); - bootloader_led_off(GPIO_nLED_BLUE); - - } else if (indication == allocation_start) { - bootloader_led_on(GPIO_nLED_RED); - bootloader_led_off(GPIO_nLED_BLUE); - - } else { - bootloader_led_off(GPIO_nLED_RED); - bootloader_led_on(GPIO_nLED_BLUE); - } -} diff --git a/boards/ark/can-flow/src/boot_config.h b/boards/ark/can-flow/src/boot_config.h deleted file mode 100644 index eab3c76..0000000 --- a/boards/ark/can-flow/src/boot_config.h +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/* - * @file boot_config.h - * - * bootloader definitions that configures the behavior and options - * of the Boot loader - * This file is relies on the parent folder's boot_config.h file and defines - * different usages of the hardware for bootloading - */ - -#pragma once - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -/* Bring in the board_config.h definitions - * todo:make this be pulled in from a targed's build - * files in nuttx*/ - -#include "board_config.h" -#include "uavcan.h" -#include - -#include - -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define OPT_PREFERRED_NODE_ID ANY_NODE_ID - -//todo:wrap OPT_x in in ifdefs for command line definitions -#define OPT_TBOOT_MS 5000 -#define OPT_NODE_STATUS_RATE_MS 800 -#define OPT_NODE_INFO_RATE_MS 50 -#define OPT_BL_NUMBER_TIMERS 7 - -/* - * This Option set is set to 1 ensure a provider of firmware has an - * opportunity update the node's firmware. - * This Option is the default policy and can be overridden by - * a jumper - * When this Policy is set, the node will ignore tboot and - * wait indefinitely for a GetNodeInfo request before booting. - * - * OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO_INVERT is used to allow - * the polarity of the jumper to be True Active - * - * wait OPT_WAIT_FOR_GETNODEINFO OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO - * Jumper - * yes 1 0 x - * yes 1 1 Active - * no 1 1 Not Active - * no 0 0 X - * yes 0 1 Active - * no 0 1 Not Active - * - */ -#define OPT_WAIT_FOR_GETNODEINFO 0 -#define OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO 1 -#define OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO_INVERT 0 - -#define OPT_ENABLE_WD 1 - -#define OPT_RESTART_TIMEOUT_MS 20000 - -/* Reserved for the Booloader */ -#define OPT_BOOTLOADER_SIZE_IN_K (1024*64) - -/* Reserved for the application out of the total - * system flash minus the BOOTLOADER_SIZE_IN_K - */ -#define OPT_APPLICATION_RESERVER_IN_K 0 - -#define OPT_APPLICATION_IMAGE_OFFSET OPT_BOOTLOADER_SIZE_IN_K -#define OPT_APPLICATION_IMAGE_LENGTH (FLASH_SIZE-(OPT_BOOTLOADER_SIZE_IN_K+OPT_APPLICATION_RESERVER_IN_K)) - - -#define FLASH_BASE STM32_FLASH_BASE -#define FLASH_SIZE STM32_FLASH_SIZE - -#define APPLICATION_LOAD_ADDRESS (FLASH_BASE + OPT_APPLICATION_IMAGE_OFFSET) -#define APPLICATION_SIZE (FLASH_SIZE-OPT_APPLICATION_IMAGE_OFFSET) -#define APPLICATION_LAST_8BIT_ADDRRESS ((uint8_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint8_t))) -#define APPLICATION_LAST_32BIT_ADDRRESS ((uint32_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint32_t))) -#define APPLICATION_LAST_64BIT_ADDRRESS ((uint64_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint64_t))) - -/* If this board uses big flash that have large sectors */ - -#define OPT_USE_YIELD - -/* Bootloader Option***************************************************************** - * - */ -#define GPIO_GETNODEINFO_JUMPER (GPIO_BOOT_CONFIG & ~GPIO_EXTI) diff --git a/boards/ark/can-flow/src/can.c b/boards/ark/can-flow/src/can.c deleted file mode 100644 index 7737965..0000000 --- a/boards/ark/can-flow/src/can.c +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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. - * - ****************************************************************************/ - -/** - * @file can.c - * - * Board-specific CAN functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include - -#include -#include - -#include "chip.h" -#include "arm_internal.h" - -#include "stm32.h" -#include "stm32_can.h" -#include "board_config.h" - -#ifdef CONFIG_CAN - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) -# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." -# undef CONFIG_STM32_CAN2 -#endif - -#ifdef CONFIG_STM32_CAN1 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); - -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} - -#endif diff --git a/boards/ark/can-flow/src/init.c b/boards/ark/can-flow/src/init.c deleted file mode 100644 index 8b1662d..0000000 --- a/boards/ark/can-flow/src/init.c +++ /dev/null @@ -1,163 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * board specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include "board_config.h" -#include - -#include - -#include -#include -#include - -#include - -#include - -# if defined(FLASH_BASED_PARAMS) -# include -#endif - -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/************************************************************************************ - * 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) -{ - watchdog_init(); - - // Configure CAN interface - stm32_configgpio(GPIO_CAN1_RX); - stm32_configgpio(GPIO_CAN1_TX); - - stm32_configgpio(GPIO_CAN1_SILENT_S0); - stm32_configgpio(GPIO_CAN1_TERMINATION); - - // Configure SPI all interfaces GPIO & enable power. - stm32_spiinitialize(); -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - px4_platform_init(); - - // Configure LEDs. - board_autoled_initialize(); - -#if defined(FLASH_BASED_PARAMS) - static sector_descriptor_t params_sector_map[] = { - {2, 16 * 1024, 0x08008000}, - {3, 16 * 1024, 0x0800C000}, - {0, 0, 0}, - }; - - /* Initialize the flashfs layer to use heap allocated memory */ - int result = parameter_flashfs_init(params_sector_map, NULL, 0); - - if (result != OK) { - syslog(LOG_ERR, "[boot] FAILED to init params in FLASH %d\n", result); - } - -#endif // FLASH_BASED_PARAMS - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_on(LED_BLUE); - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/ark/can-flow/src/led.c b/boards/ark/can-flow/src/led.c deleted file mode 100644 index aa47eda..0000000 --- a/boards/ark/can-flow/src/led.c +++ /dev/null @@ -1,115 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * board LED backend. - */ - -#include - -#include - -#include "stm32.h" -#include "board_config.h" - -#include - -/* - * Ideally we'd be able to get these from up_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void bootloader_led_on(int led); -extern void bootloader_led_off(int led); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -# define xlat(p) (p) -static uint32_t g_ledmap[] = { - GPIO_nLED_BLUE, - GPIO_nLED_RED, -}; - -__EXPORT void led_init(void) -{ - /* Configure LED GPIOs for output */ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - stm32_configgpio(g_ledmap[l]); - } -} - -__EXPORT void bootloader_led_on(int led) -{ - /* Pull Down to switch on */ - stm32_gpiowrite(led, false); -} - -__EXPORT void bootloader_led_off(int led) -{ - /* Pull Up to switch on */ - stm32_gpiowrite(led, true); -} - -static void phy_set_led(int led, bool state) -{ - /* Pull Down to switch on */ - stm32_gpiowrite(g_ledmap[led], !state); -} - -static bool phy_get_led(int led) -{ - return !stm32_gpioread(g_ledmap[led]); -} - -__EXPORT void led_on(int led) -{ - phy_set_led(xlat(led), true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(xlat(led), false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(xlat(led), !phy_get_led(xlat(led))); -} diff --git a/boards/ark/can-flow/src/spi.cpp b/boards/ark/can-flow/src/spi.cpp deleted file mode 100644 index 4d8f546..0000000 --- a/boards/ark/can-flow/src/spi.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_GYR_DEVTYPE_BMI088, SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortA, GPIO::Pin10}), - initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::PortA, GPIO::Pin4}, SPI::DRDY{GPIO::PortB, GPIO::Pin0}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortA, GPIO::Pin4}, SPI::DRDY{GPIO::PortB, GPIO::Pin0}), - initSPIDevice(DRV_IMU_DEVTYPE_IIM42652, SPI::CS{GPIO::PortA, GPIO::Pin4}, SPI::DRDY{GPIO::PortB, GPIO::Pin0}), - initSPIDevice(DRV_FLOW_DEVTYPE_PAW3902, SPI::CS{GPIO::PortB, GPIO::Pin5}, SPI::DRDY{GPIO::PortB, GPIO::Pin2}), - initSPIDevice(DRV_FLOW_DEVTYPE_PAA3905, SPI::CS{GPIO::PortB, GPIO::Pin5}, SPI::DRDY{GPIO::PortB, GPIO::Pin2}), - }), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_DEVTYPE_UNUSED, SPI::CS{GPIO::PortB, GPIO::Pin12}, SPI::DRDY{GPIO::PortB, GPIO::Pin4}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/ark/can-flow/uavcan_board_identity b/boards/ark/can-flow/uavcan_board_identity deleted file mode 100644 index 8f389d0..0000000 --- a/boards/ark/can-flow/uavcan_board_identity +++ /dev/null @@ -1,17 +0,0 @@ -# UAVCAN boot loadable Module ID -set(uavcanblid_sw_version_major 0) -set(uavcanblid_sw_version_minor 1) -add_definitions( - -DAPP_VERSION_MAJOR=${uavcanblid_sw_version_major} - -DAPP_VERSION_MINOR=${uavcanblid_sw_version_minor} -) - -set(uavcanblid_hw_version_major 0) -set(uavcanblid_hw_version_minor 80) -set(uavcanblid_name "\"org.ark.can-flow\"") - -add_definitions( - -DHW_UAVCAN_NAME=${uavcanblid_name} - -DHW_VERSION_MAJOR=${uavcanblid_hw_version_major} - -DHW_VERSION_MINOR=${uavcanblid_hw_version_minor} -) \ No newline at end of file diff --git a/boards/ark/can-gps/canbootloader.px4board b/boards/ark/can-gps/canbootloader.px4board deleted file mode 100644 index 4691728..0000000 --- a/boards/ark/can-gps/canbootloader.px4board +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_ROMFSROOT="" -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_DRIVERS_BOOTLOADERS=y diff --git a/boards/ark/can-gps/default.px4board b/boards/ark/can-gps/default.px4board deleted file mode 100644 index 86af457..0000000 --- a/boards/ark/can-gps/default.px4board +++ /dev/null @@ -1,37 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_ROMFSROOT="cannode" -CONFIG_BOARD_CONSTRAINED_FLASH=y -CONFIG_BOARD_NO_HELP=y -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_DRIVERS_BAROMETER_BMP388=y -CONFIG_DRIVERS_BOOTLOADERS=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y -CONFIG_DRIVERS_MAGNETOMETER_BOSCH_BMM150=y -CONFIG_DRIVERS_SAFETY_BUTTON=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_BOARD_UAVCAN_INTERFACES=1 -CONFIG_DRIVERS_UAVCANNODE=y -CONFIG_UAVCANNODE_BEEP_COMMAND=y -CONFIG_UAVCANNODE_GNSS_FIX=y -CONFIG_UAVCANNODE_LIGHTS_COMMAND=y -CONFIG_UAVCANNODE_MAGNETIC_FIELD_STRENGTH=y -CONFIG_UAVCANNODE_SAFETY_BUTTON=y -CONFIG_UAVCANNODE_STATIC_PRESSURE=y -CONFIG_UAVCANNODE_STATIC_TEMPERATURE=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_SENSORS=y -# CONFIG_SENSORS_VEHICLE_AIRSPEED is not set -# CONFIG_SENSORS_VEHICLE_AIR_DATA is not set -# CONFIG_SENSORS_VEHICLE_GPS_POSITION is not set -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/ark/can-gps/firmware.prototype b/boards/ark/can-gps/firmware.prototype deleted file mode 100644 index d7b32b3..0000000 --- a/boards/ark/can-gps/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 81, - "magic": "PX4FWv1", - "description": "Firmware for the ARK gps board", - "image": "", - "build_time": 0, - "summary": "ARKGPS", - "version": "0.1", - "image_size": 0, - "image_maxsize": 2080768, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/ark/can-gps/init/rc.board_defaults b/boards/ark/can-gps/init/rc.board_defaults deleted file mode 100644 index 480d2c9..0000000 --- a/boards/ark/can-gps/init/rc.board_defaults +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default CBRK_IO_SAFETY 0 -param set-default MBE_ENABLE 1 - -safety_button start -tone_alarm start diff --git a/boards/ark/can-gps/init/rc.board_sensors b/boards/ark/can-gps/init/rc.board_sensors deleted file mode 100644 index d74d5f7..0000000 --- a/boards/ark/can-gps/init/rc.board_sensors +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# -# board sensors init -#------------------------------------------------------------------------------ -gps start -d /dev/ttyS0 -p ubx - -icm42688p -R 0 -s start - -bmp388 -I -b 2 start - -bmm150 -I -b 1 start diff --git a/boards/ark/can-gps/nuttx-config/canbootloader/defconfig b/boards/ark/can-gps/nuttx-config/canbootloader/defconfig deleted file mode 100644 index 925ad9b..0000000 --- a/boards/ark/can-gps/nuttx-config/canbootloader/defconfig +++ /dev/null @@ -1,56 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/ark/can-gps/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F412CE=y -CONFIG_ARCH_INTERRUPTSTACK=4096 -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BINFMT_DISABLE=y -CONFIG_BOARDCTL=y -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DISABLE_MOUNTPOINT=y -CONFIG_EXPERIMENTAL=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=4096 -CONFIG_INIT_STACKSIZE=4096 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_MM_REGIONS=2 -CONFIG_NAME_MAX=0 -CONFIG_NUNGET_CHARS=0 -CONFIG_PREALLOC_TIMERS=0 -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_DISABLE_BUFFERING=y -CONFIG_STM32_NOEXT_VECTORS=y -CONFIG_STM32_TIM8=y -CONFIG_TASK_NAME_SIZE=0 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/ark/can-gps/nuttx-config/include/board.h b/boards/ark/can-gps/nuttx-config/include/board.h deleted file mode 100644 index 526392b..0000000 --- a/boards/ark/can-gps/nuttx-config/include/board.h +++ /dev/null @@ -1,152 +0,0 @@ -/************************************************************************************ - * configs/px4fmu/include/board.h - * include/arch/board/board.h - * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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_dma_map.h" - -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H - -#include -#ifndef __ASSEMBLY__ -# include -#endif - -#include - -/* HSI - 8 MHz RC factory-trimmed - * LSI - 32 KHz RC - * HSE - 8 MHz Crystal - * LSE - not installed - */ -#define STM32_BOARD_USEHSE 1 -#define STM32_BOARD_XTAL 8000000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 - -/* Main PLL Configuration */ -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(8) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(384) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_4 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(8) -#define STM32_PLLCFG_PLLR RCC_PLLCFG_PLLR(2) - -#define STM32_RCC_PLLI2SCFGR_PLLI2SM RCC_PLLI2SCFGR_PLLI2SM(16) -#define STM32_RCC_PLLI2SCFGR_PLLI2SN RCC_PLLI2SCFGR_PLLI2SN(192) -#define STM32_RCC_PLLI2SCFGR_PLLI2SQ RCC_PLLI2SCFGR_PLLI2SQ(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SR RCC_PLLI2SCFGR_PLLI2SR(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SSRC RCC_PLLI2SCFGR_PLLI2SSRC(0) /* HSE or HSI depending on PLLSRC of PLLCFGR*/ - -#define STM32_RCC_DCKCFGR2_CK48MSEL RCC_DCKCFGR2_CK48MSEL_PLL -#define STM32_RCC_DCKCFGR2_FMPI2C1SEL RCC_DCKCFGR2_FMPI2C1SEL_APB -#define STM32_RCC_DCKCFGR2_SDIOSEL RCC_DCKCFGR2_SDIOSEL_48MHZ - -#define STM32_SYSCLK_FREQUENCY 96000000ul - -/* AHB clock (HCLK) is SYSCLK (96MHz) */ -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* Same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/2 (48MHz) */ -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB1 will be twice PCLK1 (see page 112 of reference manual) */ -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK (96MHz) */ -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLK /* PCLK2 = HCLK */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY) - -/* Timers driven from APB2 will be PCLK2 since no prescale division */ -#define STM32_APB2_TIM1_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (STM32_PCLK2_FREQUENCY) - -/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx otherwise frequency is 2xAPBx. */ -#define BOARD_TIM2_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM3_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM4_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM5_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM6_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM7_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM8_FREQUENCY (2 * STM32_PCLK2_FREQUENCY) - -/* Alternate function pin selections ************************************************/ - -/* UARTs */ -#define GPIO_USART1_RX GPIO_USART1_RX_2 -#define GPIO_USART1_TX GPIO_USART1_TX_3 - -#define GPIO_USART2_RX GPIO_USART2_RX_1 -#define GPIO_USART2_TX GPIO_USART2_TX_1 - -/* CAN */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_1 -#define GPIO_CAN1_TX GPIO_CAN1_TX_1 - -/* I2C */ - -#define GPIO_MCU_I2C1_SCL -#define GPIO_MCU_I2C1_SDA - -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_1 -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_1 - -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN6) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN7) - -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_1 -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_4 - -#define GPIO_I2C2_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN9) -#define GPIO_I2C2_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN10) - -/* SPI */ -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 - -#endif /* __ARCH_BOARD_BOARD_H */ diff --git a/boards/ark/can-gps/nuttx-config/include/board_dma_map.h b/boards/ark/can-gps/nuttx-config/include/board_dma_map.h deleted file mode 100644 index f6e577b..0000000 --- a/boards/ark/can-gps/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -#pragma once - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- - - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMACHAN_SPI1_RX DMAMAP_SPI1_RX_2 // DMA2, Stream 2, Channel 3 -#define DMACHAN_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 5, Channel 3 diff --git a/boards/ark/can-gps/nuttx-config/nsh/defconfig b/boards/ark/can-gps/nuttx-config/nsh/defconfig deleted file mode 100644 index f734bc8..0000000 --- a/boards/ark/can-gps/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,180 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/ark/can-gps/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F412CE=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2624 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MM_REGIONS=2 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32_ADC1=y -CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y -CONFIG_STM32_DMA1=y -CONFIG_STM32_DMA2=y -CONFIG_STM32_FLASH_PREFETCH=y -CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_STM32_I2C1=y -CONFIG_STM32_I2C2=y -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_PWR=y -CONFIG_STM32_RTC=y -CONFIG_STM32_RTC_HSECLOCK=y -CONFIG_STM32_RTC_MAGIC=0xfacefeee -CONFIG_STM32_RTC_MAGIC_REG=1 -CONFIG_STM32_RTC_MAGIC_TIME_SET=0xfacefeef -CONFIG_STM32_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32_SPI1=y -CONFIG_STM32_SPI1_DMA=y -CONFIG_STM32_SPI1_DMA_BUFFER=1024 -CONFIG_STM32_TIM8=y -CONFIG_STM32_USART1=y -CONFIG_STM32_USART2=y -CONFIG_STM32_USART_BREAKS=y -CONFIG_STM32_WWDG=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1100 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_SERIAL_CONSOLE=y -CONFIG_USART2_TXBUFSIZE=1100 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/ark/can-gps/nuttx-config/scripts/canbootloader_script.ld b/boards/ark/can-gps/nuttx-config/scripts/canbootloader_script.ld deleted file mode 100644 index cbf9fdd..0000000 --- a/boards/ark/can-gps/nuttx-config/scripts/canbootloader_script.ld +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** - * nuttx-config/scripts/canbootloader_script.ld - * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F412 has 512Kb of FLASH beginning at address 0x0800:0000 and - * 256Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of SRAM beginning at address 0x2002:0000 - * 4) 64Kb of TCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 0x10000 of flash is reserved for the bootloader. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08000000, LENGTH = 32K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 192K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/ark/can-gps/nuttx-config/scripts/script.ld b/boards/ark/can-gps/nuttx-config/scripts/script.ld deleted file mode 100644 index c63c749..0000000 --- a/boards/ark/can-gps/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************************** - * scripts/ld.script - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F412 has 512Kb of FLASH beginning at address 0x0800:0000 and - * 256Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of SRAM beginning at address 0x2002:0000 - * 4) 64Kb of TCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 0x10000 of flash is reserved for the bootloader. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08010000, LENGTH = 448K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 192K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(8); - /* - * This section positions the app_descriptor_t used - * by the make_can_boot_descriptor.py tool to set - * the application image's descriptor so that the - * uavcan bootloader has the ability to validate the - * image crc, size etc - */ - KEEP(*(.app_descriptor)) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/ark/can-gps/src/CMakeLists.txt b/boards/ark/can-gps/src/CMakeLists.txt deleted file mode 100644 index 06bd981..0000000 --- a/boards/ark/can-gps/src/CMakeLists.txt +++ /dev/null @@ -1,67 +0,0 @@ -############################################################################ -# -# Copyright (c) 2020 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. -# -############################################################################ - -if("${PX4_BOARD_LABEL}" STREQUAL "canbootloader") - - add_library(drivers_board - boot_config.h - boot.c - led.c - led.h - ) - target_link_libraries(drivers_board - PRIVATE - nuttx_arch - nuttx_drivers - canbootloader - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/canbootloader) - -else() - add_library(drivers_board - can.c - i2c.cpp - init.c - led.c - spi.cpp - ) - - target_link_libraries(drivers_board - PRIVATE - arch_spi - drivers__led # drv_led_start - nuttx_arch - nuttx_drivers - px4_layer - ) -endif() diff --git a/boards/ark/can-gps/src/board_config.h b/boards/ark/can-gps/src/board_config.h deleted file mode 100644 index 7233104..0000000 --- a/boards/ark/can-gps/src/board_config.h +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * board internal definitions - */ - -#pragma once - -#include -#include -#include - -/* BUTTON */ -#define GPIO_BTN_SAFETY /* PB15 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTB|GPIO_PIN15) - -/* Safety LED */ -#define GPIO_LED_SAFETY /* PA1 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN1) - -/* Tone alarm output. */ -#define TONE_ALARM_TIMER 2 /* timer 2 */ -#define TONE_ALARM_CHANNEL 1 /* channel 1 */ -#define GPIO_TONE_ALARM_IDLE /* PA0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN0) -#define GPIO_TONE_ALARM /* PA0 */ (GPIO_ALT|GPIO_AF1|GPIO_SPEED_2MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN0) - -/* CAN Silent mode control */ -#define GPIO_CAN1_SILENT_S0 /* PB12 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN12) - -/* CAN termination software control */ -#define GPIO_CAN1_TERMINATION /* PB13 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN13) -#define GPIO_CAN_TERM GPIO_CAN1_TERMINATION - -/* ICM42688p FSYNC */ -#define GPIO_42688P_FSYNC /* PB8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN8) - -/* Boot config */ -#define GPIO_BOOT_CONFIG /* PC15 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN15|GPIO_EXTI) - -/* LEDs are driven with open drain to support Anode to 5V or 3.3V */ -#define GPIO_TIM1_CH1 /* PA8 */ (GPIO_TIM1_CH1_1|GPIO_OPENDRAIN|GPIO_SPEED_2MHz) -#define GPIO_TIM1_CH2 /* PA9 */ (GPIO_TIM1_CH2_1|GPIO_OPENDRAIN|GPIO_SPEED_2MHz) -#define GPIO_TIM1_CH3 /* PA10 */ (GPIO_TIM1_CH3_1|GPIO_OPENDRAIN|GPIO_SPEED_2MHz) - -#define GPIO_I2C1_SCL_RESET /* PB6 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN6) -#define GPIO_I2C1_SDA_RESET /* PB7 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN7) - -#define GPIO_I2C2_SCL_RESET /* PB10 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN10) -#define GPIO_I2C2_SDA_RESET /* PB9 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN9) - -#define GPIO_USART1_RX_GPIO (GPIO_INPUT|GPIO_PULLUP|GPIO_SPEED_50MHz|GPIO_PORTB|GPIO_PIN3) -#define GPIO_USART1_TX_GPIO (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_PULLUP|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN15) - -#define GPIO_USART2_RX_GPIO (GPIO_INPUT|GPIO_PULLUP|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN3) -#define GPIO_USART2_TX_GPIO (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_PULLUP|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN2) - -#define FLASH_BASED_PARAMS - -/* High-resolution timer */ -#define HRT_TIMER 3 /* use timer 3 for the HRT */ -#define HRT_TIMER_CHANNEL 4 /* use capture/compare channel 4 */ - -#define PX4_GPIO_INIT_LIST { \ - GPIO_BTN_SAFETY, \ - GPIO_LED_SAFETY, \ - GPIO_I2C1_SCL_RESET, \ - GPIO_I2C1_SDA_RESET, \ - GPIO_I2C2_SCL_RESET, \ - GPIO_I2C2_SDA_RESET, \ - GPIO_42688P_FSYNC, \ - GPIO_BOOT_CONFIG, \ - GPIO_CAN1_TX, \ - GPIO_CAN1_RX, \ - GPIO_CAN1_SILENT_S0, \ - GPIO_CAN1_TERMINATION, \ - } - -__BEGIN_DECLS - -#define BOARD_HAS_N_S_RGB_LED 1 -#define BOARD_MAX_LEDS BOARD_HAS_N_S_RGB_LED - -#ifndef __ASSEMBLY__ - -extern void stm32_spiinitialize(void); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/ark/can-gps/src/boot.c b/boards/ark/can-gps/src/boot.c deleted file mode 100644 index a26034e..0000000 --- a/boards/ark/can-gps/src/boot.c +++ /dev/null @@ -1,188 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 PX4 Development Team. All rights reserved. - * Author: Ben Dyer - * Pavel Kirienko - * David Sidrane - * - * 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include "boot_config.h" -#include "board.h" - -#include -#include -#include - -#include -#include "led.h" - -/************************************************************************************ - * 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) -{ - putreg32(getreg32(STM32_RCC_APB1ENR) | RCC_APB1ENR_CAN1EN, STM32_RCC_APB1ENR); - stm32_configgpio(GPIO_CAN1_RX); - stm32_configgpio(GPIO_CAN1_TX); - stm32_configgpio(GPIO_CAN1_SILENT_S0); - stm32_configgpio(GPIO_CAN1_TERMINATION); - putreg32(getreg32(STM32_RCC_APB1RSTR) | RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR); - putreg32(getreg32(STM32_RCC_APB1RSTR) & ~RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR); - -#if defined(OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO) - stm32_configgpio(GPIO_GETNODEINFO_JUMPER); -#endif - -} - -/************************************************************************************ - * Name: board_deinitialize - * - * Description: - * This function is called by the bootloader code prior to booting - * the application. Is should place the HW into an benign initialized state. - * - ************************************************************************************/ - -void board_deinitialize(void) -{ - putreg32(getreg32(STM32_RCC_APB1RSTR) | RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR); -} - -/**************************************************************************** - * Name: board_get_product_name - * - * Description: - * Called to retrieve the product name. The returned value is a assumed - * to be written to a pascal style string that will be length prefixed - * and not null terminated - * - * Input Parameters: - * product_name - A pointer to a buffer to write the name. - * maxlen - The maximum number of charter that can be written - * - * Returned Value: - * The length of characters written to the buffer. - * - ****************************************************************************/ - -uint8_t board_get_product_name(uint8_t *product_name, size_t maxlen) -{ - DEBUGASSERT(maxlen > UAVCAN_STRLEN(HW_UAVCAN_NAME)); - memcpy(product_name, HW_UAVCAN_NAME, UAVCAN_STRLEN(HW_UAVCAN_NAME)); - return UAVCAN_STRLEN(HW_UAVCAN_NAME); -} - -/**************************************************************************** - * Name: board_get_hardware_version - * - * Description: - * Called to retrieve the hardware version information. The function - * will first initialize the the callers struct to all zeros. - * - * Input Parameters: - * hw_version - A pointer to a uavcan_hardwareversion_t. - * - * Returned Value: - * Length of the unique_id - * - ****************************************************************************/ - -size_t board_get_hardware_version(uavcan_HardwareVersion_t *hw_version) -{ - memset(hw_version, 0, sizeof(uavcan_HardwareVersion_t)); - - hw_version->major = HW_VERSION_MAJOR; - hw_version->minor = HW_VERSION_MINOR; - - return board_get_mfguid(*(mfguid_t *) hw_version->unique_id); -} - -/**************************************************************************** - * Name: board_indicate - * - * Description: - * Provides User feedback to indicate the state of the bootloader - * on board specific hardware. - * - * Input Parameters: - * indication - A member of the uiindication_t - * - * Returned Value: - * None - * - ****************************************************************************/ -#define led(n, code, r , g , b, h) {.red = (r),.green = (g), .blue = (b),.hz = (h)} - -typedef begin_packed_struct struct led_t { - uint8_t red; - uint8_t green; - uint8_t blue; - uint8_t hz; -} end_packed_struct led_t; - -static const led_t i2l[] = { - - led(0, off, 0, 0, 0, 0), - led(1, reset, 128, 128, 128, 30), - led(2, autobaud_start, 0, 128, 0, 1), - led(3, autobaud_end, 0, 128, 0, 2), - led(4, allocation_start, 0, 0, 64, 2), - led(5, allocation_end, 0, 128, 64, 3), - led(6, fw_update_start, 32, 128, 64, 3), - led(7, fw_update_erase_fail, 32, 128, 32, 3), - led(8, fw_update_invalid_response, 64, 0, 0, 1), - led(9, fw_update_timeout, 64, 0, 0, 2), - led(a, fw_update_invalid_crc, 64, 0, 0, 4), - led(b, jump_to_app, 0, 128, 0, 10), - -}; - -void board_indicate(uiindication_t indication) -{ - rgb_led(i2l[indication].red, - i2l[indication].green, - i2l[indication].blue, - i2l[indication].hz); -} diff --git a/boards/ark/can-gps/src/boot_config.h b/boards/ark/can-gps/src/boot_config.h deleted file mode 100644 index eab3c76..0000000 --- a/boards/ark/can-gps/src/boot_config.h +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/* - * @file boot_config.h - * - * bootloader definitions that configures the behavior and options - * of the Boot loader - * This file is relies on the parent folder's boot_config.h file and defines - * different usages of the hardware for bootloading - */ - -#pragma once - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -/* Bring in the board_config.h definitions - * todo:make this be pulled in from a targed's build - * files in nuttx*/ - -#include "board_config.h" -#include "uavcan.h" -#include - -#include - -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define OPT_PREFERRED_NODE_ID ANY_NODE_ID - -//todo:wrap OPT_x in in ifdefs for command line definitions -#define OPT_TBOOT_MS 5000 -#define OPT_NODE_STATUS_RATE_MS 800 -#define OPT_NODE_INFO_RATE_MS 50 -#define OPT_BL_NUMBER_TIMERS 7 - -/* - * This Option set is set to 1 ensure a provider of firmware has an - * opportunity update the node's firmware. - * This Option is the default policy and can be overridden by - * a jumper - * When this Policy is set, the node will ignore tboot and - * wait indefinitely for a GetNodeInfo request before booting. - * - * OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO_INVERT is used to allow - * the polarity of the jumper to be True Active - * - * wait OPT_WAIT_FOR_GETNODEINFO OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO - * Jumper - * yes 1 0 x - * yes 1 1 Active - * no 1 1 Not Active - * no 0 0 X - * yes 0 1 Active - * no 0 1 Not Active - * - */ -#define OPT_WAIT_FOR_GETNODEINFO 0 -#define OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO 1 -#define OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO_INVERT 0 - -#define OPT_ENABLE_WD 1 - -#define OPT_RESTART_TIMEOUT_MS 20000 - -/* Reserved for the Booloader */ -#define OPT_BOOTLOADER_SIZE_IN_K (1024*64) - -/* Reserved for the application out of the total - * system flash minus the BOOTLOADER_SIZE_IN_K - */ -#define OPT_APPLICATION_RESERVER_IN_K 0 - -#define OPT_APPLICATION_IMAGE_OFFSET OPT_BOOTLOADER_SIZE_IN_K -#define OPT_APPLICATION_IMAGE_LENGTH (FLASH_SIZE-(OPT_BOOTLOADER_SIZE_IN_K+OPT_APPLICATION_RESERVER_IN_K)) - - -#define FLASH_BASE STM32_FLASH_BASE -#define FLASH_SIZE STM32_FLASH_SIZE - -#define APPLICATION_LOAD_ADDRESS (FLASH_BASE + OPT_APPLICATION_IMAGE_OFFSET) -#define APPLICATION_SIZE (FLASH_SIZE-OPT_APPLICATION_IMAGE_OFFSET) -#define APPLICATION_LAST_8BIT_ADDRRESS ((uint8_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint8_t))) -#define APPLICATION_LAST_32BIT_ADDRRESS ((uint32_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint32_t))) -#define APPLICATION_LAST_64BIT_ADDRRESS ((uint64_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint64_t))) - -/* If this board uses big flash that have large sectors */ - -#define OPT_USE_YIELD - -/* Bootloader Option***************************************************************** - * - */ -#define GPIO_GETNODEINFO_JUMPER (GPIO_BOOT_CONFIG & ~GPIO_EXTI) diff --git a/boards/ark/can-gps/src/can.c b/boards/ark/can-gps/src/can.c deleted file mode 100644 index 7737965..0000000 --- a/boards/ark/can-gps/src/can.c +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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. - * - ****************************************************************************/ - -/** - * @file can.c - * - * Board-specific CAN functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include - -#include -#include - -#include "chip.h" -#include "arm_internal.h" - -#include "stm32.h" -#include "stm32_can.h" -#include "board_config.h" - -#ifdef CONFIG_CAN - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) -# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." -# undef CONFIG_STM32_CAN2 -#endif - -#ifdef CONFIG_STM32_CAN1 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); - -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} - -#endif diff --git a/boards/ark/can-gps/src/i2c.cpp b/boards/ark/can-gps/src/i2c.cpp deleted file mode 100644 index 76486af..0000000 --- a/boards/ark/can-gps/src/i2c.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusInternal(1), - initI2CBusInternal(2), -}; diff --git a/boards/ark/can-gps/src/init.c b/boards/ark/can-gps/src/init.c deleted file mode 100644 index f6b32dd..0000000 --- a/boards/ark/can-gps/src/init.c +++ /dev/null @@ -1,163 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * board specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include "board_config.h" -#include "led.h" -#include - -#include - -#include -#include -#include - -#include - -#include -#include - -# if defined(FLASH_BASED_PARAMS) -# include -#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) -{ - watchdog_init(); - - /* configure pins */ - const uint32_t gpio[] = PX4_GPIO_INIT_LIST; - px4_gpio_init(gpio, arraySize(gpio)); - - // Configure SPI all interfaces GPIO & enable power. - stm32_spiinitialize(); - - // Check if button is held. If so go into gps passthrough mode - if (stm32_gpioread(GPIO_BTN_SAFETY)) { - rgb_led(128, 128, 128, 10); - stm32_configgpio(GPIO_USART1_TX_GPIO); - stm32_configgpio(GPIO_USART1_RX_GPIO); - stm32_configgpio(GPIO_USART2_TX_GPIO); - stm32_configgpio(GPIO_USART2_RX_GPIO); - - while (1) { - watchdog_pet(); - stm32_gpiowrite(GPIO_USART2_TX_GPIO, stm32_gpioread(GPIO_USART1_RX_GPIO)); - stm32_gpiowrite(GPIO_USART1_TX_GPIO, stm32_gpioread(GPIO_USART2_RX_GPIO)); - } - } -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - px4_platform_init(); - -#if defined(FLASH_BASED_PARAMS) - static sector_descriptor_t params_sector_map[] = { - {2, 16 * 1024, 0x08008000}, - {3, 16 * 1024, 0x0800C000}, - {0, 0, 0}, - }; - - /* Initialize the flashfs layer to use heap allocated memory */ - int result = parameter_flashfs_init(params_sector_map, NULL, 0); - - if (result != OK) { - syslog(LOG_ERR, "[boot] FAILED to init params in FLASH %d\n", result); - } - -#endif // FLASH_BASED_PARAMS - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/ark/can-gps/src/led.c b/boards/ark/can-gps/src/led.c deleted file mode 100644 index 9a80cae..0000000 --- a/boards/ark/can-gps/src/led.c +++ /dev/null @@ -1,124 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -#include "led.h" - -#define TMR_BASE STM32_TIM1_BASE -#define TMR_FREQUENCY STM32_APB2_TIM1_CLKIN -#define TMR_REG(o) (TMR_BASE+(o)) - -void rgb_led(int r, int g, int b, int freqs) -{ - - long fosc = TMR_FREQUENCY; - long prescale = 2048; - long p1s = fosc / prescale; - long p0p5s = p1s / 2; - uint16_t val; - static bool once = 0; - - if (!once) { - once = 1; - - /* Enabel Clock to Block */ - modifyreg32(STM32_RCC_APB2ENR, 0, RCC_APB2ENR_TIM1EN); - - /* Reload */ - - val = getreg16(TMR_REG(STM32_BTIM_EGR_OFFSET)); - val |= ATIM_EGR_UG; - putreg16(val, TMR_REG(STM32_BTIM_EGR_OFFSET)); - - /* Set Prescaler STM32_TIM_SETCLOCK */ - - putreg16(prescale, TMR_REG(STM32_BTIM_PSC_OFFSET)); - - /* Enable STM32_TIM_SETMODE*/ - - putreg16(ATIM_CR1_CEN | ATIM_CR1_ARPE, TMR_REG(STM32_BTIM_CR1_OFFSET)); - - - putreg16((ATIM_CCMR_MODE_PWM1 << ATIM_CCMR1_OC1M_SHIFT) | ATIM_CCMR1_OC1PE | - (ATIM_CCMR_MODE_PWM1 << ATIM_CCMR1_OC2M_SHIFT) | ATIM_CCMR1_OC2PE, TMR_REG(STM32_GTIM_CCMR1_OFFSET)); - putreg16((ATIM_CCMR_MODE_PWM1 << ATIM_CCMR2_OC3M_SHIFT) | ATIM_CCMR2_OC3PE, TMR_REG(STM32_GTIM_CCMR2_OFFSET)); - putreg16(ATIM_CCER_CC3E | ATIM_CCER_CC3P | - ATIM_CCER_CC2E | ATIM_CCER_CC2P | - ATIM_CCER_CC1E | ATIM_CCER_CC1P, TMR_REG(STM32_GTIM_CCER_OFFSET)); - - - stm32_configgpio(GPIO_TIM1_CH1); - stm32_configgpio(GPIO_TIM1_CH2); - stm32_configgpio(GPIO_TIM1_CH3); - - /* master output enable = on */ - putreg16(ATIM_BDTR_MOE, (TMR_REG(STM32_ATIM_BDTR_OFFSET))); - } - - long p = freqs == 0 ? p1s : p1s / freqs; - putreg32(p, TMR_REG(STM32_BTIM_ARR_OFFSET)); - - p = freqs == 0 ? p1s + 1 : p0p5s / freqs; - - putreg32((r * p) / 255, TMR_REG(STM32_GTIM_CCR1_OFFSET)); - putreg32((g * p) / 255, TMR_REG(STM32_GTIM_CCR2_OFFSET)); - putreg32((b * p) / 255, TMR_REG(STM32_GTIM_CCR3_OFFSET)); - - val = getreg16(TMR_REG(STM32_BTIM_CR1_OFFSET)); - - if (freqs == 0) { - val &= ~ATIM_CR1_CEN; - - } else { - val |= ATIM_CR1_CEN; - } - - putreg16(val, TMR_REG(STM32_BTIM_CR1_OFFSET)); - -} diff --git a/boards/ark/can-gps/src/led.h b/boards/ark/can-gps/src/led.h deleted file mode 100644 index b68e4aa..0000000 --- a/boards/ark/can-gps/src/led.h +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2015 PX4 Development Team. All rights reserved. - * Author: David Sidrane - * - * 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. - * - ****************************************************************************/ - -__BEGIN_DECLS -void rgb_led(int r, int g, int b, int freqs); -__END_DECLS diff --git a/boards/ark/can-gps/src/spi.cpp b/boards/ark/can-gps/src/spi.cpp deleted file mode 100644 index baafb03..0000000 --- a/boards/ark/can-gps/src/spi.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortB, GPIO::Pin0}, SPI::DRDY{GPIO::PortB, GPIO::Pin1}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/ark/can-gps/uavcan_board_identity b/boards/ark/can-gps/uavcan_board_identity deleted file mode 100644 index ca6d098..0000000 --- a/boards/ark/can-gps/uavcan_board_identity +++ /dev/null @@ -1,17 +0,0 @@ -# UAVCAN boot loadable Module ID -set(uavcanblid_sw_version_major 0) -set(uavcanblid_sw_version_minor 1) -add_definitions( - -DAPP_VERSION_MAJOR=${uavcanblid_sw_version_major} - -DAPP_VERSION_MINOR=${uavcanblid_sw_version_minor} -) - -set(uavcanblid_hw_version_major 0) -set(uavcanblid_hw_version_minor 81) -set(uavcanblid_name "\"org.ark.can-gps\"") - -add_definitions( - -DHW_UAVCAN_NAME=${uavcanblid_name} - -DHW_VERSION_MAJOR=${uavcanblid_hw_version_major} - -DHW_VERSION_MINOR=${uavcanblid_hw_version_minor} -) diff --git a/boards/ark/can-rtk-gps/canbootloader.px4board b/boards/ark/can-rtk-gps/canbootloader.px4board deleted file mode 100644 index 4691728..0000000 --- a/boards/ark/can-rtk-gps/canbootloader.px4board +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_ROMFSROOT="" -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_DRIVERS_BOOTLOADERS=y diff --git a/boards/ark/can-rtk-gps/default.px4board b/boards/ark/can-rtk-gps/default.px4board deleted file mode 100644 index b74e74a..0000000 --- a/boards/ark/can-rtk-gps/default.px4board +++ /dev/null @@ -1,38 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_ROMFSROOT="cannode" -CONFIG_BOARD_CONSTRAINED_FLASH=y -CONFIG_BOARD_NO_HELP=y -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_DRIVERS_BAROMETER_BMP388=y -CONFIG_DRIVERS_BOOTLOADERS=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y -CONFIG_DRIVERS_MAGNETOMETER_BOSCH_BMM150=y -CONFIG_DRIVERS_SAFETY_BUTTON=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_BOARD_UAVCAN_INTERFACES=1 -CONFIG_DRIVERS_UAVCANNODE=y -CONFIG_UAVCANNODE_BEEP_COMMAND=y -CONFIG_UAVCANNODE_GNSS_FIX=y -CONFIG_UAVCANNODE_LIGHTS_COMMAND=y -CONFIG_UAVCANNODE_MAGNETIC_FIELD_STRENGTH=y -CONFIG_UAVCANNODE_RTK_DATA=y -CONFIG_UAVCANNODE_SAFETY_BUTTON=y -CONFIG_UAVCANNODE_STATIC_PRESSURE=y -CONFIG_UAVCANNODE_STATIC_TEMPERATURE=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_SENSORS=y -# CONFIG_SENSORS_VEHICLE_AIRSPEED is not set -# CONFIG_SENSORS_VEHICLE_AIR_DATA is not set -# CONFIG_SENSORS_VEHICLE_GPS_POSITION is not set -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/ark/can-rtk-gps/firmware.prototype b/boards/ark/can-rtk-gps/firmware.prototype deleted file mode 100644 index f8a96f3..0000000 --- a/boards/ark/can-rtk-gps/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 82, - "magic": "PX4FWv1", - "description": "Firmware for the ARK RTK GPS board", - "image": "", - "build_time": 0, - "summary": "ARKRTKGPS", - "version": "0.1", - "image_size": 0, - "image_maxsize": 2080768, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/ark/can-rtk-gps/init/rc.board_defaults b/boards/ark/can-rtk-gps/init/rc.board_defaults deleted file mode 100644 index 10419ce..0000000 --- a/boards/ark/can-rtk-gps/init/rc.board_defaults +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default CBRK_IO_SAFETY 0 -param set-default CANNODE_SUB_MBD 1 -param set-default CANNODE_SUB_RTCM 1 -param set-default MBE_ENABLE 1 - -safety_button start -tone_alarm start diff --git a/boards/ark/can-rtk-gps/init/rc.board_sensors b/boards/ark/can-rtk-gps/init/rc.board_sensors deleted file mode 100644 index d74d5f7..0000000 --- a/boards/ark/can-rtk-gps/init/rc.board_sensors +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# -# board sensors init -#------------------------------------------------------------------------------ -gps start -d /dev/ttyS0 -p ubx - -icm42688p -R 0 -s start - -bmp388 -I -b 2 start - -bmm150 -I -b 1 start diff --git a/boards/ark/can-rtk-gps/nuttx-config/canbootloader/defconfig b/boards/ark/can-rtk-gps/nuttx-config/canbootloader/defconfig deleted file mode 100644 index 5c1f3b5..0000000 --- a/boards/ark/can-rtk-gps/nuttx-config/canbootloader/defconfig +++ /dev/null @@ -1,56 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/ark/can-rtk-gps/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F412CE=y -CONFIG_ARCH_INTERRUPTSTACK=4096 -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BINFMT_DISABLE=y -CONFIG_BOARDCTL=y -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DISABLE_MOUNTPOINT=y -CONFIG_EXPERIMENTAL=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=4096 -CONFIG_INIT_STACKSIZE=4096 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_MM_REGIONS=2 -CONFIG_NAME_MAX=0 -CONFIG_NUNGET_CHARS=0 -CONFIG_PREALLOC_TIMERS=0 -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_DISABLE_BUFFERING=y -CONFIG_STM32_NOEXT_VECTORS=y -CONFIG_STM32_TIM8=y -CONFIG_TASK_NAME_SIZE=0 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/ark/can-rtk-gps/nuttx-config/include/board.h b/boards/ark/can-rtk-gps/nuttx-config/include/board.h deleted file mode 100644 index 526392b..0000000 --- a/boards/ark/can-rtk-gps/nuttx-config/include/board.h +++ /dev/null @@ -1,152 +0,0 @@ -/************************************************************************************ - * configs/px4fmu/include/board.h - * include/arch/board/board.h - * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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_dma_map.h" - -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H - -#include -#ifndef __ASSEMBLY__ -# include -#endif - -#include - -/* HSI - 8 MHz RC factory-trimmed - * LSI - 32 KHz RC - * HSE - 8 MHz Crystal - * LSE - not installed - */ -#define STM32_BOARD_USEHSE 1 -#define STM32_BOARD_XTAL 8000000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 - -/* Main PLL Configuration */ -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(8) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(384) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_4 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(8) -#define STM32_PLLCFG_PLLR RCC_PLLCFG_PLLR(2) - -#define STM32_RCC_PLLI2SCFGR_PLLI2SM RCC_PLLI2SCFGR_PLLI2SM(16) -#define STM32_RCC_PLLI2SCFGR_PLLI2SN RCC_PLLI2SCFGR_PLLI2SN(192) -#define STM32_RCC_PLLI2SCFGR_PLLI2SQ RCC_PLLI2SCFGR_PLLI2SQ(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SR RCC_PLLI2SCFGR_PLLI2SR(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SSRC RCC_PLLI2SCFGR_PLLI2SSRC(0) /* HSE or HSI depending on PLLSRC of PLLCFGR*/ - -#define STM32_RCC_DCKCFGR2_CK48MSEL RCC_DCKCFGR2_CK48MSEL_PLL -#define STM32_RCC_DCKCFGR2_FMPI2C1SEL RCC_DCKCFGR2_FMPI2C1SEL_APB -#define STM32_RCC_DCKCFGR2_SDIOSEL RCC_DCKCFGR2_SDIOSEL_48MHZ - -#define STM32_SYSCLK_FREQUENCY 96000000ul - -/* AHB clock (HCLK) is SYSCLK (96MHz) */ -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* Same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/2 (48MHz) */ -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB1 will be twice PCLK1 (see page 112 of reference manual) */ -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK (96MHz) */ -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLK /* PCLK2 = HCLK */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY) - -/* Timers driven from APB2 will be PCLK2 since no prescale division */ -#define STM32_APB2_TIM1_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (STM32_PCLK2_FREQUENCY) - -/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx otherwise frequency is 2xAPBx. */ -#define BOARD_TIM2_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM3_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM4_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM5_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM6_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM7_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM8_FREQUENCY (2 * STM32_PCLK2_FREQUENCY) - -/* Alternate function pin selections ************************************************/ - -/* UARTs */ -#define GPIO_USART1_RX GPIO_USART1_RX_2 -#define GPIO_USART1_TX GPIO_USART1_TX_3 - -#define GPIO_USART2_RX GPIO_USART2_RX_1 -#define GPIO_USART2_TX GPIO_USART2_TX_1 - -/* CAN */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_1 -#define GPIO_CAN1_TX GPIO_CAN1_TX_1 - -/* I2C */ - -#define GPIO_MCU_I2C1_SCL -#define GPIO_MCU_I2C1_SDA - -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_1 -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_1 - -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN6) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN7) - -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_1 -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_4 - -#define GPIO_I2C2_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN9) -#define GPIO_I2C2_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN10) - -/* SPI */ -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 - -#endif /* __ARCH_BOARD_BOARD_H */ diff --git a/boards/ark/can-rtk-gps/nuttx-config/include/board_dma_map.h b/boards/ark/can-rtk-gps/nuttx-config/include/board_dma_map.h deleted file mode 100644 index efa3d82..0000000 --- a/boards/ark/can-rtk-gps/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -#pragma once - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- - - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMACHAN_SPI1_RX DMAMAP_SPI1_RX_1 // DMA2, Stream 0, Channel 3 -#define DMACHAN_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 3, Channel 3 -#define DMACHAN_USART1_RX DMAMAP_USART1_RX_1 // DMA2, Stream 2, Channel 4 -#define DMAMAP_USART1_RX DMAMAP_USART1_RX_1 -//#define DMACHAN_USART1_TX DMAMAP_USART1_TX // DMA2, Stream 7, Channel 4 diff --git a/boards/ark/can-rtk-gps/nuttx-config/nsh/defconfig b/boards/ark/can-rtk-gps/nuttx-config/nsh/defconfig deleted file mode 100644 index ba2d6f2..0000000 --- a/boards/ark/can-rtk-gps/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,181 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/ark/can-rtk-gps/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F412CE=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2624 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MM_REGIONS=2 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32_ADC1=y -CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y -CONFIG_STM32_DMA1=y -CONFIG_STM32_DMA2=y -CONFIG_STM32_FLASH_PREFETCH=y -CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_STM32_I2C1=y -CONFIG_STM32_I2C2=y -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_PWR=y -CONFIG_STM32_RTC=y -CONFIG_STM32_RTC_HSECLOCK=y -CONFIG_STM32_RTC_MAGIC=0xfacefeee -CONFIG_STM32_RTC_MAGIC_REG=1 -CONFIG_STM32_RTC_MAGIC_TIME_SET=0xfacefeef -CONFIG_STM32_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32_SPI1=y -CONFIG_STM32_SPI1_DMA=y -CONFIG_STM32_SPI1_DMA_BUFFER=1024 -CONFIG_STM32_TIM8=y -CONFIG_STM32_USART1=y -CONFIG_STM32_USART2=y -CONFIG_STM32_USART_BREAKS=y -CONFIG_STM32_WWDG=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=2000 -CONFIG_USART1_RXDMA=y -CONFIG_USART1_TXBUFSIZE=2000 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_SERIAL_CONSOLE=y -CONFIG_USART2_TXBUFSIZE=1100 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/ark/can-rtk-gps/nuttx-config/scripts/canbootloader_script.ld b/boards/ark/can-rtk-gps/nuttx-config/scripts/canbootloader_script.ld deleted file mode 100644 index cbf9fdd..0000000 --- a/boards/ark/can-rtk-gps/nuttx-config/scripts/canbootloader_script.ld +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** - * nuttx-config/scripts/canbootloader_script.ld - * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F412 has 512Kb of FLASH beginning at address 0x0800:0000 and - * 256Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of SRAM beginning at address 0x2002:0000 - * 4) 64Kb of TCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 0x10000 of flash is reserved for the bootloader. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08000000, LENGTH = 32K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 192K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/ark/can-rtk-gps/nuttx-config/scripts/script.ld b/boards/ark/can-rtk-gps/nuttx-config/scripts/script.ld deleted file mode 100644 index c63c749..0000000 --- a/boards/ark/can-rtk-gps/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************************** - * scripts/ld.script - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F412 has 512Kb of FLASH beginning at address 0x0800:0000 and - * 256Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of SRAM beginning at address 0x2002:0000 - * 4) 64Kb of TCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 0x10000 of flash is reserved for the bootloader. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08010000, LENGTH = 448K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 192K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(8); - /* - * This section positions the app_descriptor_t used - * by the make_can_boot_descriptor.py tool to set - * the application image's descriptor so that the - * uavcan bootloader has the ability to validate the - * image crc, size etc - */ - KEEP(*(.app_descriptor)) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/ark/can-rtk-gps/src/CMakeLists.txt b/boards/ark/can-rtk-gps/src/CMakeLists.txt deleted file mode 100644 index 06bd981..0000000 --- a/boards/ark/can-rtk-gps/src/CMakeLists.txt +++ /dev/null @@ -1,67 +0,0 @@ -############################################################################ -# -# Copyright (c) 2020 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. -# -############################################################################ - -if("${PX4_BOARD_LABEL}" STREQUAL "canbootloader") - - add_library(drivers_board - boot_config.h - boot.c - led.c - led.h - ) - target_link_libraries(drivers_board - PRIVATE - nuttx_arch - nuttx_drivers - canbootloader - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/canbootloader) - -else() - add_library(drivers_board - can.c - i2c.cpp - init.c - led.c - spi.cpp - ) - - target_link_libraries(drivers_board - PRIVATE - arch_spi - drivers__led # drv_led_start - nuttx_arch - nuttx_drivers - px4_layer - ) -endif() diff --git a/boards/ark/can-rtk-gps/src/board_config.h b/boards/ark/can-rtk-gps/src/board_config.h deleted file mode 100644 index 2263956..0000000 --- a/boards/ark/can-rtk-gps/src/board_config.h +++ /dev/null @@ -1,125 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * board internal definitions - */ - -#pragma once - -#include -#include -#include - -/* BUTTON */ -#define GPIO_BTN_SAFETY /* PB15 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTB|GPIO_PIN15) - -/* Safety LED */ -#define GPIO_LED_SAFETY /* PA1 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN1) - -/* Tone alarm output. */ -#define TONE_ALARM_TIMER 2 /* timer 2 */ -#define TONE_ALARM_CHANNEL 1 /* channel 1 */ -#define GPIO_TONE_ALARM_IDLE /* PA0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN0) -#define GPIO_TONE_ALARM /* PA0 */ (GPIO_ALT|GPIO_AF1|GPIO_SPEED_2MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN0) - -/* CAN Silent mode control */ -#define GPIO_CAN1_SILENT_S0 /* PB12 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN12) - -/* CAN termination software control */ -#define GPIO_CAN1_TERMINATION /* PB13 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN13) -#define GPIO_CAN_TERM GPIO_CAN1_TERMINATION - -/* ICM42688p FSYNC */ -#define GPIO_42688P_FSYNC /* PB8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN8) - -/* Boot config */ -#define GPIO_BOOT_CONFIG /* PC15 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN15|GPIO_EXTI) - -/* LEDs are driven with open drain to support Anode to 5V or 3.3V */ -#define GPIO_TIM1_CH1 /* PA8 */ (GPIO_TIM1_CH1_1|GPIO_OPENDRAIN|GPIO_SPEED_2MHz) -#define GPIO_TIM1_CH2 /* PA9 */ (GPIO_TIM1_CH2_1|GPIO_OPENDRAIN|GPIO_SPEED_2MHz) -#define GPIO_TIM1_CH3 /* PA10 */ (GPIO_TIM1_CH3_1|GPIO_OPENDRAIN|GPIO_SPEED_2MHz) - -#define GPIO_I2C1_SCL_RESET /* PB6 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN6) -#define GPIO_I2C1_SDA_RESET /* PB7 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN7) - -#define GPIO_I2C2_SCL_RESET /* PB10 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN10) -#define GPIO_I2C2_SDA_RESET /* PB9 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN9) - -#define GPIO_I2C2_SCL_RESET /* PB10 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN10) -#define GPIO_I2C2_SDA_RESET /* PB9 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN9) - -#define GPIO_USART1_RX_GPIO (GPIO_INPUT|GPIO_PULLUP|GPIO_SPEED_50MHz|GPIO_PORTB|GPIO_PIN3) -#define GPIO_USART1_TX_GPIO (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_PULLUP|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN15) - -#define GPIO_USART2_RX_GPIO (GPIO_INPUT|GPIO_PULLUP|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN3) -#define GPIO_USART2_TX_GPIO (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_PULLUP|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN2) - -#define FLASH_BASED_PARAMS - -/* High-resolution timer */ -#define HRT_TIMER 3 /* use timer 3 for the HRT */ -#define HRT_TIMER_CHANNEL 4 /* use capture/compare channel 4 */ - -#define PX4_GPIO_INIT_LIST { \ - GPIO_BTN_SAFETY, \ - GPIO_LED_SAFETY, \ - GPIO_I2C1_SCL_RESET, \ - GPIO_I2C1_SDA_RESET, \ - GPIO_I2C2_SCL_RESET, \ - GPIO_I2C2_SDA_RESET, \ - GPIO_42688P_FSYNC, \ - GPIO_BOOT_CONFIG, \ - GPIO_CAN1_TX, \ - GPIO_CAN1_RX, \ - GPIO_CAN1_SILENT_S0, \ - GPIO_CAN1_TERMINATION, \ - } - -__BEGIN_DECLS - -#define BOARD_HAS_N_S_RGB_LED 1 -#define BOARD_MAX_LEDS BOARD_HAS_N_S_RGB_LED - -#ifndef __ASSEMBLY__ - -extern void stm32_spiinitialize(void); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/ark/can-rtk-gps/src/boot.c b/boards/ark/can-rtk-gps/src/boot.c deleted file mode 100644 index a26034e..0000000 --- a/boards/ark/can-rtk-gps/src/boot.c +++ /dev/null @@ -1,188 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 PX4 Development Team. All rights reserved. - * Author: Ben Dyer - * Pavel Kirienko - * David Sidrane - * - * 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include "boot_config.h" -#include "board.h" - -#include -#include -#include - -#include -#include "led.h" - -/************************************************************************************ - * 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) -{ - putreg32(getreg32(STM32_RCC_APB1ENR) | RCC_APB1ENR_CAN1EN, STM32_RCC_APB1ENR); - stm32_configgpio(GPIO_CAN1_RX); - stm32_configgpio(GPIO_CAN1_TX); - stm32_configgpio(GPIO_CAN1_SILENT_S0); - stm32_configgpio(GPIO_CAN1_TERMINATION); - putreg32(getreg32(STM32_RCC_APB1RSTR) | RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR); - putreg32(getreg32(STM32_RCC_APB1RSTR) & ~RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR); - -#if defined(OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO) - stm32_configgpio(GPIO_GETNODEINFO_JUMPER); -#endif - -} - -/************************************************************************************ - * Name: board_deinitialize - * - * Description: - * This function is called by the bootloader code prior to booting - * the application. Is should place the HW into an benign initialized state. - * - ************************************************************************************/ - -void board_deinitialize(void) -{ - putreg32(getreg32(STM32_RCC_APB1RSTR) | RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR); -} - -/**************************************************************************** - * Name: board_get_product_name - * - * Description: - * Called to retrieve the product name. The returned value is a assumed - * to be written to a pascal style string that will be length prefixed - * and not null terminated - * - * Input Parameters: - * product_name - A pointer to a buffer to write the name. - * maxlen - The maximum number of charter that can be written - * - * Returned Value: - * The length of characters written to the buffer. - * - ****************************************************************************/ - -uint8_t board_get_product_name(uint8_t *product_name, size_t maxlen) -{ - DEBUGASSERT(maxlen > UAVCAN_STRLEN(HW_UAVCAN_NAME)); - memcpy(product_name, HW_UAVCAN_NAME, UAVCAN_STRLEN(HW_UAVCAN_NAME)); - return UAVCAN_STRLEN(HW_UAVCAN_NAME); -} - -/**************************************************************************** - * Name: board_get_hardware_version - * - * Description: - * Called to retrieve the hardware version information. The function - * will first initialize the the callers struct to all zeros. - * - * Input Parameters: - * hw_version - A pointer to a uavcan_hardwareversion_t. - * - * Returned Value: - * Length of the unique_id - * - ****************************************************************************/ - -size_t board_get_hardware_version(uavcan_HardwareVersion_t *hw_version) -{ - memset(hw_version, 0, sizeof(uavcan_HardwareVersion_t)); - - hw_version->major = HW_VERSION_MAJOR; - hw_version->minor = HW_VERSION_MINOR; - - return board_get_mfguid(*(mfguid_t *) hw_version->unique_id); -} - -/**************************************************************************** - * Name: board_indicate - * - * Description: - * Provides User feedback to indicate the state of the bootloader - * on board specific hardware. - * - * Input Parameters: - * indication - A member of the uiindication_t - * - * Returned Value: - * None - * - ****************************************************************************/ -#define led(n, code, r , g , b, h) {.red = (r),.green = (g), .blue = (b),.hz = (h)} - -typedef begin_packed_struct struct led_t { - uint8_t red; - uint8_t green; - uint8_t blue; - uint8_t hz; -} end_packed_struct led_t; - -static const led_t i2l[] = { - - led(0, off, 0, 0, 0, 0), - led(1, reset, 128, 128, 128, 30), - led(2, autobaud_start, 0, 128, 0, 1), - led(3, autobaud_end, 0, 128, 0, 2), - led(4, allocation_start, 0, 0, 64, 2), - led(5, allocation_end, 0, 128, 64, 3), - led(6, fw_update_start, 32, 128, 64, 3), - led(7, fw_update_erase_fail, 32, 128, 32, 3), - led(8, fw_update_invalid_response, 64, 0, 0, 1), - led(9, fw_update_timeout, 64, 0, 0, 2), - led(a, fw_update_invalid_crc, 64, 0, 0, 4), - led(b, jump_to_app, 0, 128, 0, 10), - -}; - -void board_indicate(uiindication_t indication) -{ - rgb_led(i2l[indication].red, - i2l[indication].green, - i2l[indication].blue, - i2l[indication].hz); -} diff --git a/boards/ark/can-rtk-gps/src/boot_config.h b/boards/ark/can-rtk-gps/src/boot_config.h deleted file mode 100644 index eab3c76..0000000 --- a/boards/ark/can-rtk-gps/src/boot_config.h +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/* - * @file boot_config.h - * - * bootloader definitions that configures the behavior and options - * of the Boot loader - * This file is relies on the parent folder's boot_config.h file and defines - * different usages of the hardware for bootloading - */ - -#pragma once - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -/* Bring in the board_config.h definitions - * todo:make this be pulled in from a targed's build - * files in nuttx*/ - -#include "board_config.h" -#include "uavcan.h" -#include - -#include - -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define OPT_PREFERRED_NODE_ID ANY_NODE_ID - -//todo:wrap OPT_x in in ifdefs for command line definitions -#define OPT_TBOOT_MS 5000 -#define OPT_NODE_STATUS_RATE_MS 800 -#define OPT_NODE_INFO_RATE_MS 50 -#define OPT_BL_NUMBER_TIMERS 7 - -/* - * This Option set is set to 1 ensure a provider of firmware has an - * opportunity update the node's firmware. - * This Option is the default policy and can be overridden by - * a jumper - * When this Policy is set, the node will ignore tboot and - * wait indefinitely for a GetNodeInfo request before booting. - * - * OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO_INVERT is used to allow - * the polarity of the jumper to be True Active - * - * wait OPT_WAIT_FOR_GETNODEINFO OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO - * Jumper - * yes 1 0 x - * yes 1 1 Active - * no 1 1 Not Active - * no 0 0 X - * yes 0 1 Active - * no 0 1 Not Active - * - */ -#define OPT_WAIT_FOR_GETNODEINFO 0 -#define OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO 1 -#define OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO_INVERT 0 - -#define OPT_ENABLE_WD 1 - -#define OPT_RESTART_TIMEOUT_MS 20000 - -/* Reserved for the Booloader */ -#define OPT_BOOTLOADER_SIZE_IN_K (1024*64) - -/* Reserved for the application out of the total - * system flash minus the BOOTLOADER_SIZE_IN_K - */ -#define OPT_APPLICATION_RESERVER_IN_K 0 - -#define OPT_APPLICATION_IMAGE_OFFSET OPT_BOOTLOADER_SIZE_IN_K -#define OPT_APPLICATION_IMAGE_LENGTH (FLASH_SIZE-(OPT_BOOTLOADER_SIZE_IN_K+OPT_APPLICATION_RESERVER_IN_K)) - - -#define FLASH_BASE STM32_FLASH_BASE -#define FLASH_SIZE STM32_FLASH_SIZE - -#define APPLICATION_LOAD_ADDRESS (FLASH_BASE + OPT_APPLICATION_IMAGE_OFFSET) -#define APPLICATION_SIZE (FLASH_SIZE-OPT_APPLICATION_IMAGE_OFFSET) -#define APPLICATION_LAST_8BIT_ADDRRESS ((uint8_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint8_t))) -#define APPLICATION_LAST_32BIT_ADDRRESS ((uint32_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint32_t))) -#define APPLICATION_LAST_64BIT_ADDRRESS ((uint64_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint64_t))) - -/* If this board uses big flash that have large sectors */ - -#define OPT_USE_YIELD - -/* Bootloader Option***************************************************************** - * - */ -#define GPIO_GETNODEINFO_JUMPER (GPIO_BOOT_CONFIG & ~GPIO_EXTI) diff --git a/boards/ark/can-rtk-gps/src/can.c b/boards/ark/can-rtk-gps/src/can.c deleted file mode 100644 index 7737965..0000000 --- a/boards/ark/can-rtk-gps/src/can.c +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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. - * - ****************************************************************************/ - -/** - * @file can.c - * - * Board-specific CAN functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include - -#include -#include - -#include "chip.h" -#include "arm_internal.h" - -#include "stm32.h" -#include "stm32_can.h" -#include "board_config.h" - -#ifdef CONFIG_CAN - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) -# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." -# undef CONFIG_STM32_CAN2 -#endif - -#ifdef CONFIG_STM32_CAN1 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); - -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} - -#endif diff --git a/boards/ark/can-rtk-gps/src/i2c.cpp b/boards/ark/can-rtk-gps/src/i2c.cpp deleted file mode 100644 index 76486af..0000000 --- a/boards/ark/can-rtk-gps/src/i2c.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusInternal(1), - initI2CBusInternal(2), -}; diff --git a/boards/ark/can-rtk-gps/src/init.c b/boards/ark/can-rtk-gps/src/init.c deleted file mode 100644 index 7405575..0000000 --- a/boards/ark/can-rtk-gps/src/init.c +++ /dev/null @@ -1,169 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * board specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include "board_config.h" -#include "led.h" -#include - -#include - -#include -#include -#include - -#include - -#include -#include - -# if defined(FLASH_BASED_PARAMS) -# include -#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) -{ - watchdog_init(); - - /* configure pins */ - const uint32_t gpio[] = PX4_GPIO_INIT_LIST; - px4_gpio_init(gpio, arraySize(gpio)); - - // Configure SPI all interfaces GPIO & enable power. - stm32_spiinitialize(); - - // Check if button is held. If so go into gps passthrough mode - if (stm32_gpioread(GPIO_BTN_SAFETY)) { - rgb_led(128, 128, 128, 10); - stm32_configgpio(GPIO_USART1_TX_GPIO); - stm32_configgpio(GPIO_USART1_RX_GPIO); - stm32_configgpio(GPIO_USART2_TX_GPIO); - stm32_configgpio(GPIO_USART2_RX_GPIO); - - while (1) { - watchdog_pet(); - stm32_gpiowrite(GPIO_USART2_TX_GPIO, stm32_gpioread(GPIO_USART1_RX_GPIO)); - stm32_gpiowrite(GPIO_USART1_TX_GPIO, stm32_gpioread(GPIO_USART2_RX_GPIO)); - } - } -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - px4_platform_init(); - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - -#if defined(FLASH_BASED_PARAMS) - static sector_descriptor_t params_sector_map[] = { - {2, 16 * 1024, 0x08008000}, - {3, 16 * 1024, 0x0800C000}, - {0, 0, 0}, - }; - - /* Initialize the flashfs layer to use heap allocated memory */ - int result = parameter_flashfs_init(params_sector_map, NULL, 0); - - if (result != OK) { - syslog(LOG_ERR, "[boot] FAILED to init params in FLASH %d\n", result); - } - -#endif // FLASH_BASED_PARAMS - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/ark/can-rtk-gps/src/led.c b/boards/ark/can-rtk-gps/src/led.c deleted file mode 100644 index 9a80cae..0000000 --- a/boards/ark/can-rtk-gps/src/led.c +++ /dev/null @@ -1,124 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -#include "led.h" - -#define TMR_BASE STM32_TIM1_BASE -#define TMR_FREQUENCY STM32_APB2_TIM1_CLKIN -#define TMR_REG(o) (TMR_BASE+(o)) - -void rgb_led(int r, int g, int b, int freqs) -{ - - long fosc = TMR_FREQUENCY; - long prescale = 2048; - long p1s = fosc / prescale; - long p0p5s = p1s / 2; - uint16_t val; - static bool once = 0; - - if (!once) { - once = 1; - - /* Enabel Clock to Block */ - modifyreg32(STM32_RCC_APB2ENR, 0, RCC_APB2ENR_TIM1EN); - - /* Reload */ - - val = getreg16(TMR_REG(STM32_BTIM_EGR_OFFSET)); - val |= ATIM_EGR_UG; - putreg16(val, TMR_REG(STM32_BTIM_EGR_OFFSET)); - - /* Set Prescaler STM32_TIM_SETCLOCK */ - - putreg16(prescale, TMR_REG(STM32_BTIM_PSC_OFFSET)); - - /* Enable STM32_TIM_SETMODE*/ - - putreg16(ATIM_CR1_CEN | ATIM_CR1_ARPE, TMR_REG(STM32_BTIM_CR1_OFFSET)); - - - putreg16((ATIM_CCMR_MODE_PWM1 << ATIM_CCMR1_OC1M_SHIFT) | ATIM_CCMR1_OC1PE | - (ATIM_CCMR_MODE_PWM1 << ATIM_CCMR1_OC2M_SHIFT) | ATIM_CCMR1_OC2PE, TMR_REG(STM32_GTIM_CCMR1_OFFSET)); - putreg16((ATIM_CCMR_MODE_PWM1 << ATIM_CCMR2_OC3M_SHIFT) | ATIM_CCMR2_OC3PE, TMR_REG(STM32_GTIM_CCMR2_OFFSET)); - putreg16(ATIM_CCER_CC3E | ATIM_CCER_CC3P | - ATIM_CCER_CC2E | ATIM_CCER_CC2P | - ATIM_CCER_CC1E | ATIM_CCER_CC1P, TMR_REG(STM32_GTIM_CCER_OFFSET)); - - - stm32_configgpio(GPIO_TIM1_CH1); - stm32_configgpio(GPIO_TIM1_CH2); - stm32_configgpio(GPIO_TIM1_CH3); - - /* master output enable = on */ - putreg16(ATIM_BDTR_MOE, (TMR_REG(STM32_ATIM_BDTR_OFFSET))); - } - - long p = freqs == 0 ? p1s : p1s / freqs; - putreg32(p, TMR_REG(STM32_BTIM_ARR_OFFSET)); - - p = freqs == 0 ? p1s + 1 : p0p5s / freqs; - - putreg32((r * p) / 255, TMR_REG(STM32_GTIM_CCR1_OFFSET)); - putreg32((g * p) / 255, TMR_REG(STM32_GTIM_CCR2_OFFSET)); - putreg32((b * p) / 255, TMR_REG(STM32_GTIM_CCR3_OFFSET)); - - val = getreg16(TMR_REG(STM32_BTIM_CR1_OFFSET)); - - if (freqs == 0) { - val &= ~ATIM_CR1_CEN; - - } else { - val |= ATIM_CR1_CEN; - } - - putreg16(val, TMR_REG(STM32_BTIM_CR1_OFFSET)); - -} diff --git a/boards/ark/can-rtk-gps/src/led.h b/boards/ark/can-rtk-gps/src/led.h deleted file mode 100644 index b68e4aa..0000000 --- a/boards/ark/can-rtk-gps/src/led.h +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2015 PX4 Development Team. All rights reserved. - * Author: David Sidrane - * - * 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. - * - ****************************************************************************/ - -__BEGIN_DECLS -void rgb_led(int r, int g, int b, int freqs); -__END_DECLS diff --git a/boards/ark/can-rtk-gps/src/spi.cpp b/boards/ark/can-rtk-gps/src/spi.cpp deleted file mode 100644 index baafb03..0000000 --- a/boards/ark/can-rtk-gps/src/spi.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortB, GPIO::Pin0}, SPI::DRDY{GPIO::PortB, GPIO::Pin1}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/ark/can-rtk-gps/uavcan_board_identity b/boards/ark/can-rtk-gps/uavcan_board_identity deleted file mode 100644 index 5db21a4..0000000 --- a/boards/ark/can-rtk-gps/uavcan_board_identity +++ /dev/null @@ -1,17 +0,0 @@ -# UAVCAN boot loadable Module ID -set(uavcanblid_sw_version_major 0) -set(uavcanblid_sw_version_minor 1) -add_definitions( - -DAPP_VERSION_MAJOR=${uavcanblid_sw_version_major} - -DAPP_VERSION_MINOR=${uavcanblid_sw_version_minor} -) - -set(uavcanblid_hw_version_major 0) -set(uavcanblid_hw_version_minor 82) -set(uavcanblid_name "\"org.ark.can-rtk-gps\"") - -add_definitions( - -DHW_UAVCAN_NAME=${uavcanblid_name} - -DHW_VERSION_MAJOR=${uavcanblid_hw_version_major} - -DHW_VERSION_MINOR=${uavcanblid_hw_version_minor} -) diff --git a/boards/ark/cannode/canbootloader.px4board b/boards/ark/cannode/canbootloader.px4board deleted file mode 100644 index 4691728..0000000 --- a/boards/ark/cannode/canbootloader.px4board +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_ROMFSROOT="" -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_DRIVERS_BOOTLOADERS=y diff --git a/boards/ark/cannode/default.px4board b/boards/ark/cannode/default.px4board deleted file mode 100644 index c72afa6..0000000 --- a/boards/ark/cannode/default.px4board +++ /dev/null @@ -1,52 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_ROMFSROOT="cannode" -CONFIG_BOARD_CONSTRAINED_FLASH=y -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_BOARD_EXTERNAL_METADATA=y -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS0" -CONFIG_COMMON_BAROMETERS=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_BOOTLOADERS=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_COMMON_HYGROMETERS=y -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_BOARD_UAVCAN_INTERFACES=1 -CONFIG_DRIVERS_UAVCANNODE=y -CONFIG_UAVCANNODE_ARMING_STATUS=y -CONFIG_UAVCANNODE_BEEP_COMMAND=y -CONFIG_UAVCANNODE_ESC_RAW_COMMAND=y -CONFIG_UAVCANNODE_ESC_STATUS=y -CONFIG_UAVCANNODE_FLOW_MEASUREMENT=y -CONFIG_UAVCANNODE_GNSS_FIX=y -CONFIG_UAVCANNODE_HYGROMETER_MEASUREMENT=y -CONFIG_UAVCANNODE_LIGHTS_COMMAND=y -CONFIG_UAVCANNODE_MAGNETIC_FIELD_STRENGTH=y -CONFIG_UAVCANNODE_RANGE_SENSOR_MEASUREMENT=y -CONFIG_UAVCANNODE_RAW_AIR_DATA=y -CONFIG_UAVCANNODE_RTK_DATA=y -CONFIG_UAVCANNODE_SERVO_ARRAY_COMMAND=y -CONFIG_UAVCANNODE_STATIC_PRESSURE=y -CONFIG_UAVCANNODE_STATIC_TEMPERATURE=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_SENSORS=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/ark/cannode/firmware.prototype b/boards/ark/cannode/firmware.prototype deleted file mode 100644 index 8b149d8..0000000 --- a/boards/ark/cannode/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 83, - "magic": "PX4FWv1", - "description": "Firmware for the ARK CANnode board", - "image": "", - "build_time": 0, - "summary": "ARKCANNODE", - "version": "0.1", - "image_size": 0, - "image_maxsize": 2080768, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/ark/cannode/init/rc.board_defaults b/boards/ark/cannode/init/rc.board_defaults deleted file mode 100644 index 7de93ad..0000000 --- a/boards/ark/cannode/init/rc.board_defaults +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -pwm_out start - -dshot start diff --git a/boards/ark/cannode/init/rc.board_sensors b/boards/ark/cannode/init/rc.board_sensors deleted file mode 100644 index e9cf85f..0000000 --- a/boards/ark/cannode/init/rc.board_sensors +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/sh -# -# board sensors init -#------------------------------------------------------------------------------ -icm42688p -R 0 -s start - -if param compare -s SENS_EN_BATT 1 -then - batt_smbus start -X -fi - -# Lidar-Lite on I2C -if param compare -s SENS_EN_LL40LS 2 -then - ll40ls start -X -fi - -# mappydot lidar sensor -if param compare -s SENS_EN_MPDT 1 -then - mappydot start -X -fi - -# mb12xx sonar sensor -if param greater -s SENS_EN_MB12XX 0 -then - mb12xx start -X -fi - -# Lightware i2c lidar sensor -if param greater -s SENS_EN_SF1XX 0 -then - lightware_laser_i2c start -X -fi - -# vl53l1x i2c distance sensor -if param compare -s SENS_EN_VL53L1X 1 -then - vl53l1x start -X -fi - -# ADIS16448 spi external IMU -if param compare -s SENS_EN_ADIS164X 1 -then - if param compare -s SENS_OR_ADIS164X 0 - then - adis16448 -S start - fi - if param compare -s SENS_OR_ADIS164X 4 - then - adis16448 -S start -R 4 - fi -fi - -# Eagle Tree airspeed sensor external I2C -if param compare -s SENS_EN_ETSASPD 1 -then - ets_airspeed start -X -fi - -# Sensirion SDP3X differential pressure sensor external I2C -if param compare -s SENS_EN_SDP3X 1 -then - if ! sdp3x start -X - then - # try another common address - sdp3x start -X -a 0x22 - fi -fi - -# SHT3x temperature and hygrometer sensor, external I2C -if param compare -s SENS_EN_SHT3X 1 -then - sht3x start -X - sht3x start -X -a 0x45 -fi - -# TE MS4525DO differential pressure sensor external I2C -if param compare -s SENS_EN_MS4525DO 1 -then - ms4525do start -X -fi - -# TE MS5525DSO differential pressure sensor external I2C -if param compare -s SENS_EN_MS5525DS 1 -then - ms5525dso start -X -fi - -# IR-LOCK sensor external I2C -if param compare -s SENS_EN_IRLOCK 1 -then - irlock start -X -fi - -# SPL06 sensor external I2C -if param compare -s SENS_EN_SPL06 1 -then - spl06 -X start - spl06 -X -a 0x77 start -fi - -# probe for optional external I2C devices -icm20948_i2c_passthrough -X -q start - -# compasses -hmc5883 -T -X -q start -ist8308 -X -q start -ist8310 -X -q start -lis2mdl -X -q start -lis3mdl -X -q start -qmc5883l -X -q start -rm3100 -X -q start - -# start last (wait for possible icm20948 passthrough mode) -ak09916 -X -q start diff --git a/boards/ark/cannode/nuttx-config/canbootloader/defconfig b/boards/ark/cannode/nuttx-config/canbootloader/defconfig deleted file mode 100644 index 219ecf9..0000000 --- a/boards/ark/cannode/nuttx-config/canbootloader/defconfig +++ /dev/null @@ -1,56 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/ark/cannode/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F412CE=y -CONFIG_ARCH_INTERRUPTSTACK=4096 -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BINFMT_DISABLE=y -CONFIG_BOARDCTL=y -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DISABLE_MOUNTPOINT=y -CONFIG_EXPERIMENTAL=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=4096 -CONFIG_INIT_STACKSIZE=4096 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_MM_REGIONS=2 -CONFIG_NAME_MAX=0 -CONFIG_NUNGET_CHARS=0 -CONFIG_PREALLOC_TIMERS=0 -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_DISABLE_BUFFERING=y -CONFIG_STM32_FLASH_CONFIG_G=y -CONFIG_STM32_NOEXT_VECTORS=y -CONFIG_TASK_NAME_SIZE=0 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/ark/cannode/nuttx-config/include/board.h b/boards/ark/cannode/nuttx-config/include/board.h deleted file mode 100644 index aa06711..0000000 --- a/boards/ark/cannode/nuttx-config/include/board.h +++ /dev/null @@ -1,149 +0,0 @@ -/************************************************************************************ - * configs/px4fmu/include/board.h - * include/arch/board/board.h - * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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_dma_map.h" - -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H - -#include -#ifndef __ASSEMBLY__ -# include -#endif - -#include - -/* HSI - 8 MHz RC factory-trimmed - * LSI - 32 KHz RC - * HSE - 8 MHz Crystal - * LSE - not installed - */ -#define STM32_BOARD_USEHSE 1 -#define STM32_BOARD_XTAL 8000000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 - -/* Main PLL Configuration */ -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(8) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(384) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_4 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(8) -#define STM32_PLLCFG_PLLR RCC_PLLCFG_PLLR(2) - -#define STM32_RCC_PLLI2SCFGR_PLLI2SM RCC_PLLI2SCFGR_PLLI2SM(16) -#define STM32_RCC_PLLI2SCFGR_PLLI2SN RCC_PLLI2SCFGR_PLLI2SN(192) -#define STM32_RCC_PLLI2SCFGR_PLLI2SQ RCC_PLLI2SCFGR_PLLI2SQ(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SR RCC_PLLI2SCFGR_PLLI2SR(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SSRC RCC_PLLI2SCFGR_PLLI2SSRC(0) /* HSE or HSI depending on PLLSRC of PLLCFGR*/ - -#define STM32_RCC_DCKCFGR2_CK48MSEL RCC_DCKCFGR2_CK48MSEL_PLL -#define STM32_RCC_DCKCFGR2_FMPI2C1SEL RCC_DCKCFGR2_FMPI2C1SEL_APB -#define STM32_RCC_DCKCFGR2_SDIOSEL RCC_DCKCFGR2_SDIOSEL_48MHZ - -#define STM32_SYSCLK_FREQUENCY 96000000ul - -/* AHB clock (HCLK) is SYSCLK (96MHz) */ -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* Same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/2 (48MHz) */ -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB1 will be twice PCLK1 (see page 112 of reference manual) */ -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK (96MHz) */ -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLK /* PCLK2 = HCLK */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY) - -/* Timers driven from APB2 will be PCLK2 since no prescale division */ -#define STM32_APB2_TIM1_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (STM32_PCLK2_FREQUENCY) - -/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx otherwise frequency is 2xAPBx. */ -#define BOARD_TIM2_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM3_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM4_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM5_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM6_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM7_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM8_FREQUENCY (2 * STM32_PCLK2_FREQUENCY) - -/* Alternate function pin selections ************************************************/ - -/* UARTs */ -#define GPIO_USART1_RX GPIO_USART1_RX_2 -#define GPIO_USART1_TX GPIO_USART1_TX_3 - -#define GPIO_USART2_RX GPIO_USART2_RX_1 -#define GPIO_USART2_TX GPIO_USART2_TX_1 - -/* CAN */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_1 -#define GPIO_CAN1_TX GPIO_CAN1_TX_1 - -/* SPI */ -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 - -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 /* PB14 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 /* PB15 */ -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_2 /* PB13 */ - -/* I2C */ -#define GPIO_MCU_I2C1_SCL -#define GPIO_MCU_I2C1_SDA - -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_1 -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 - -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN6) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN7) - -#endif /* __ARCH_BOARD_BOARD_H */ diff --git a/boards/ark/cannode/nuttx-config/include/board_dma_map.h b/boards/ark/cannode/nuttx-config/include/board_dma_map.h deleted file mode 100644 index e598299..0000000 --- a/boards/ark/cannode/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -#pragma once - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMACHAN_SPI2_RX DMAMAP_SPI2_RX // DMA1, Stream 3, Channel 0 -#define DMACHAN_SPI2_TX DMAMAP_SPI2_TX // DMA1, Stream 4, Channel 0 - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMACHAN_SPI1_RX DMAMAP_SPI1_RX_2 // DMA2, Stream 2, Channel 3 -#define DMACHAN_SPI1_TX DMAMAP_SPI1_TX_2 // DMA2, Stream 5, Channel 3 - -// Assigned in timer_config.cpp - -// Timer 2 /* DMA1, Stream 7, Channel 3 DMAMAP_TIM2_UP_2 */ -// Timer 3 /* DMA1, Stream 2, Channel 5 DMAMAP_TIM3_UP */ -// Timer 4 /* DMA1, Stream 6, Channel 2 DMAMAP_TIM4_UP */ diff --git a/boards/ark/cannode/nuttx-config/nsh/defconfig b/boards/ark/cannode/nuttx-config/nsh/defconfig deleted file mode 100644 index a0882b7..0000000 --- a/boards/ark/cannode/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,182 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/ark/cannode/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F412CE=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2624 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MM_REGIONS=2 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=254 -CONFIG_SCHED_HPWORKSTACKSIZE=3000 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32_ADC1=y -CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y -CONFIG_STM32_DMA1=y -CONFIG_STM32_DMA2=y -CONFIG_STM32_FLASH_CONFIG_G=y -CONFIG_STM32_FLASH_PREFETCH=y -CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_STM32_I2C1=y -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_PWR=y -CONFIG_STM32_RTC=y -CONFIG_STM32_RTC_HSECLOCK=y -CONFIG_STM32_RTC_MAGIC=0xfacefeee -CONFIG_STM32_RTC_MAGIC_REG=1 -CONFIG_STM32_RTC_MAGIC_TIME_SET=0xfacefeef -CONFIG_STM32_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32_SPI1=y -CONFIG_STM32_SPI1_DMA=y -CONFIG_STM32_SPI1_DMA_BUFFER=2048 -CONFIG_STM32_SPI2=y -CONFIG_STM32_SPI2_DMA=y -CONFIG_STM32_SPI2_DMA_BUFFER=2048 -CONFIG_STM32_USART1=y -CONFIG_STM32_USART2=y -CONFIG_STM32_USART_BREAKS=y -CONFIG_STM32_WWDG=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1100 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_SERIAL_CONSOLE=y -CONFIG_USART2_TXBUFSIZE=1100 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/ark/cannode/nuttx-config/scripts/canbootloader_script.ld b/boards/ark/cannode/nuttx-config/scripts/canbootloader_script.ld deleted file mode 100644 index cbf9fdd..0000000 --- a/boards/ark/cannode/nuttx-config/scripts/canbootloader_script.ld +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** - * nuttx-config/scripts/canbootloader_script.ld - * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F412 has 512Kb of FLASH beginning at address 0x0800:0000 and - * 256Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of SRAM beginning at address 0x2002:0000 - * 4) 64Kb of TCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 0x10000 of flash is reserved for the bootloader. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08000000, LENGTH = 32K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 192K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/ark/cannode/nuttx-config/scripts/script.ld b/boards/ark/cannode/nuttx-config/scripts/script.ld deleted file mode 100644 index daf33d4..0000000 --- a/boards/ark/cannode/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************************** - * scripts/ld.script - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F412CG has 1Mb of FLASH beginning at address 0x0800:0000 and - * 256Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of SRAM beginning at address 0x2002:0000 - * 4) 64Kb of TCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 0x10000 of flash is reserved for the bootloader. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08010000, LENGTH = 928K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 192K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(8); - /* - * This section positions the app_descriptor_t used - * by the make_can_boot_descriptor.py tool to set - * the application image's descriptor so that the - * uavcan bootloader has the ability to validate the - * image crc, size etc - */ - KEEP(*(.app_descriptor)) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/ark/cannode/src/CMakeLists.txt b/boards/ark/cannode/src/CMakeLists.txt deleted file mode 100644 index 2f1b301..0000000 --- a/boards/ark/cannode/src/CMakeLists.txt +++ /dev/null @@ -1,68 +0,0 @@ -############################################################################ -# -# Copyright (c) 2020 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. -# -############################################################################ - -if("${PX4_BOARD_LABEL}" STREQUAL "canbootloader") - - add_library(drivers_board - boot_config.h - boot.c - led.c - led.h - ) - target_link_libraries(drivers_board - PRIVATE - nuttx_arch - nuttx_drivers - canbootloader - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/canbootloader) - -else() - add_library(drivers_board - can.c - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - ) - - target_link_libraries(drivers_board - PRIVATE - arch_spi - drivers__led # drv_led_start - nuttx_arch - nuttx_drivers - px4_layer - ) -endif() diff --git a/boards/ark/cannode/src/board_config.h b/boards/ark/cannode/src/board_config.h deleted file mode 100644 index 03e0137..0000000 --- a/boards/ark/cannode/src/board_config.h +++ /dev/null @@ -1,115 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * board internal definitions - */ - -#pragma once - -#include -#include -#include - -/* CAN Silent mode control */ -#define GPIO_CAN1_SILENT_S0 /* PC14 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN14) - -/* CAN termination software control */ -#define GPIO_CAN1_TERMINATION /* PC15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN15) -#define GPIO_CAN_TERM GPIO_CAN1_TERMINATION - -/* Boot config */ -#define GPIO_BOOT_CONFIG /* PH1 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTH|GPIO_PIN1|GPIO_EXTI) - -/* ICM42688p FSYNC */ -#define GPIO_42688P_FSYNC /* PB8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN8) - -/* LEDs are driven with open drain to support Anode to 5V or 3.3V */ -#define GPIO_TIM1_CH1 /* PA8 */ (GPIO_TIM1_CH1_1|GPIO_OPENDRAIN|GPIO_SPEED_2MHz) -#define GPIO_TIM1_CH2 /* PA9 */ (GPIO_TIM1_CH2_1|GPIO_OPENDRAIN|GPIO_SPEED_2MHz) -#define GPIO_TIM1_CH3 /* PA10 */ (GPIO_TIM1_CH3_1|GPIO_OPENDRAIN|GPIO_SPEED_2MHz) - -/* PWM Outputs */ -#define BOARD_NUM_IO_TIMERS 3 -#define DIRECT_PWM_OUTPUT_CHANNELS 8 - -#define GPIO_TIM2_CH1_RESET /* PA0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN0) -#define GPIO_TIM2_CH2_RESET /* PA1 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN1) -#define GPIO_TIM2_CH3_RESET /* PB10 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN10) -#define GPIO_TIM3_CH1_RESET /* PB4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN4) -#define GPIO_TIM3_CH2_RESET /* PB5 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN5) -#define GPIO_TIM3_CH3_RESET /* PB0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN0) -#define GPIO_TIM3_CH4_RESET /* PB1 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN1) -#define GPIO_TIM4_CH4_RESET /* PB7 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN7) - -#define GPIO_I2C1_SCL_RESET /* PB6 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN6) -#define GPIO_I2C1_SDA_RESET /* PB9 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN9) - -#define GPIO_USART1_RX_GPIO /* PB3 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_SPEED_50MHz|GPIO_PORTB|GPIO_PIN3) -#define GPIO_USART1_TX_GPIO /* PA15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_PULLUP|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN15) - -#define GPIO_USART2_RX_GPIO /* PA3 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN3) -#define GPIO_USART2_TX_GPIO /* PA2 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_PULLUP|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN2) - -#define FLASH_BASED_PARAMS - -/* High-resolution timer */ -#define HRT_TIMER 8 /* use timer 8 for the HRT */ -#define HRT_TIMER_CHANNEL 1 /* use capture/compare channel 1 */ - -#define PX4_GPIO_INIT_LIST { \ - GPIO_CAN1_SILENT_S0, \ - GPIO_CAN1_TERMINATION, \ - GPIO_42688P_FSYNC, \ - GPIO_CAN1_TX, \ - GPIO_CAN1_RX, \ - GPIO_I2C1_SCL_RESET, \ - GPIO_I2C1_SDA_RESET, \ - } - -__BEGIN_DECLS - -#define BOARD_HAS_N_S_RGB_LED 1 -#define BOARD_MAX_LEDS BOARD_HAS_N_S_RGB_LED - -#ifndef __ASSEMBLY__ - -extern void stm32_spiinitialize(void); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/ark/cannode/src/boot.c b/boards/ark/cannode/src/boot.c deleted file mode 100644 index a26034e..0000000 --- a/boards/ark/cannode/src/boot.c +++ /dev/null @@ -1,188 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 PX4 Development Team. All rights reserved. - * Author: Ben Dyer - * Pavel Kirienko - * David Sidrane - * - * 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include "boot_config.h" -#include "board.h" - -#include -#include -#include - -#include -#include "led.h" - -/************************************************************************************ - * 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) -{ - putreg32(getreg32(STM32_RCC_APB1ENR) | RCC_APB1ENR_CAN1EN, STM32_RCC_APB1ENR); - stm32_configgpio(GPIO_CAN1_RX); - stm32_configgpio(GPIO_CAN1_TX); - stm32_configgpio(GPIO_CAN1_SILENT_S0); - stm32_configgpio(GPIO_CAN1_TERMINATION); - putreg32(getreg32(STM32_RCC_APB1RSTR) | RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR); - putreg32(getreg32(STM32_RCC_APB1RSTR) & ~RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR); - -#if defined(OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO) - stm32_configgpio(GPIO_GETNODEINFO_JUMPER); -#endif - -} - -/************************************************************************************ - * Name: board_deinitialize - * - * Description: - * This function is called by the bootloader code prior to booting - * the application. Is should place the HW into an benign initialized state. - * - ************************************************************************************/ - -void board_deinitialize(void) -{ - putreg32(getreg32(STM32_RCC_APB1RSTR) | RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR); -} - -/**************************************************************************** - * Name: board_get_product_name - * - * Description: - * Called to retrieve the product name. The returned value is a assumed - * to be written to a pascal style string that will be length prefixed - * and not null terminated - * - * Input Parameters: - * product_name - A pointer to a buffer to write the name. - * maxlen - The maximum number of charter that can be written - * - * Returned Value: - * The length of characters written to the buffer. - * - ****************************************************************************/ - -uint8_t board_get_product_name(uint8_t *product_name, size_t maxlen) -{ - DEBUGASSERT(maxlen > UAVCAN_STRLEN(HW_UAVCAN_NAME)); - memcpy(product_name, HW_UAVCAN_NAME, UAVCAN_STRLEN(HW_UAVCAN_NAME)); - return UAVCAN_STRLEN(HW_UAVCAN_NAME); -} - -/**************************************************************************** - * Name: board_get_hardware_version - * - * Description: - * Called to retrieve the hardware version information. The function - * will first initialize the the callers struct to all zeros. - * - * Input Parameters: - * hw_version - A pointer to a uavcan_hardwareversion_t. - * - * Returned Value: - * Length of the unique_id - * - ****************************************************************************/ - -size_t board_get_hardware_version(uavcan_HardwareVersion_t *hw_version) -{ - memset(hw_version, 0, sizeof(uavcan_HardwareVersion_t)); - - hw_version->major = HW_VERSION_MAJOR; - hw_version->minor = HW_VERSION_MINOR; - - return board_get_mfguid(*(mfguid_t *) hw_version->unique_id); -} - -/**************************************************************************** - * Name: board_indicate - * - * Description: - * Provides User feedback to indicate the state of the bootloader - * on board specific hardware. - * - * Input Parameters: - * indication - A member of the uiindication_t - * - * Returned Value: - * None - * - ****************************************************************************/ -#define led(n, code, r , g , b, h) {.red = (r),.green = (g), .blue = (b),.hz = (h)} - -typedef begin_packed_struct struct led_t { - uint8_t red; - uint8_t green; - uint8_t blue; - uint8_t hz; -} end_packed_struct led_t; - -static const led_t i2l[] = { - - led(0, off, 0, 0, 0, 0), - led(1, reset, 128, 128, 128, 30), - led(2, autobaud_start, 0, 128, 0, 1), - led(3, autobaud_end, 0, 128, 0, 2), - led(4, allocation_start, 0, 0, 64, 2), - led(5, allocation_end, 0, 128, 64, 3), - led(6, fw_update_start, 32, 128, 64, 3), - led(7, fw_update_erase_fail, 32, 128, 32, 3), - led(8, fw_update_invalid_response, 64, 0, 0, 1), - led(9, fw_update_timeout, 64, 0, 0, 2), - led(a, fw_update_invalid_crc, 64, 0, 0, 4), - led(b, jump_to_app, 0, 128, 0, 10), - -}; - -void board_indicate(uiindication_t indication) -{ - rgb_led(i2l[indication].red, - i2l[indication].green, - i2l[indication].blue, - i2l[indication].hz); -} diff --git a/boards/ark/cannode/src/boot_config.h b/boards/ark/cannode/src/boot_config.h deleted file mode 100644 index eab3c76..0000000 --- a/boards/ark/cannode/src/boot_config.h +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/* - * @file boot_config.h - * - * bootloader definitions that configures the behavior and options - * of the Boot loader - * This file is relies on the parent folder's boot_config.h file and defines - * different usages of the hardware for bootloading - */ - -#pragma once - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -/* Bring in the board_config.h definitions - * todo:make this be pulled in from a targed's build - * files in nuttx*/ - -#include "board_config.h" -#include "uavcan.h" -#include - -#include - -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define OPT_PREFERRED_NODE_ID ANY_NODE_ID - -//todo:wrap OPT_x in in ifdefs for command line definitions -#define OPT_TBOOT_MS 5000 -#define OPT_NODE_STATUS_RATE_MS 800 -#define OPT_NODE_INFO_RATE_MS 50 -#define OPT_BL_NUMBER_TIMERS 7 - -/* - * This Option set is set to 1 ensure a provider of firmware has an - * opportunity update the node's firmware. - * This Option is the default policy and can be overridden by - * a jumper - * When this Policy is set, the node will ignore tboot and - * wait indefinitely for a GetNodeInfo request before booting. - * - * OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO_INVERT is used to allow - * the polarity of the jumper to be True Active - * - * wait OPT_WAIT_FOR_GETNODEINFO OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO - * Jumper - * yes 1 0 x - * yes 1 1 Active - * no 1 1 Not Active - * no 0 0 X - * yes 0 1 Active - * no 0 1 Not Active - * - */ -#define OPT_WAIT_FOR_GETNODEINFO 0 -#define OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO 1 -#define OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO_INVERT 0 - -#define OPT_ENABLE_WD 1 - -#define OPT_RESTART_TIMEOUT_MS 20000 - -/* Reserved for the Booloader */ -#define OPT_BOOTLOADER_SIZE_IN_K (1024*64) - -/* Reserved for the application out of the total - * system flash minus the BOOTLOADER_SIZE_IN_K - */ -#define OPT_APPLICATION_RESERVER_IN_K 0 - -#define OPT_APPLICATION_IMAGE_OFFSET OPT_BOOTLOADER_SIZE_IN_K -#define OPT_APPLICATION_IMAGE_LENGTH (FLASH_SIZE-(OPT_BOOTLOADER_SIZE_IN_K+OPT_APPLICATION_RESERVER_IN_K)) - - -#define FLASH_BASE STM32_FLASH_BASE -#define FLASH_SIZE STM32_FLASH_SIZE - -#define APPLICATION_LOAD_ADDRESS (FLASH_BASE + OPT_APPLICATION_IMAGE_OFFSET) -#define APPLICATION_SIZE (FLASH_SIZE-OPT_APPLICATION_IMAGE_OFFSET) -#define APPLICATION_LAST_8BIT_ADDRRESS ((uint8_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint8_t))) -#define APPLICATION_LAST_32BIT_ADDRRESS ((uint32_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint32_t))) -#define APPLICATION_LAST_64BIT_ADDRRESS ((uint64_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint64_t))) - -/* If this board uses big flash that have large sectors */ - -#define OPT_USE_YIELD - -/* Bootloader Option***************************************************************** - * - */ -#define GPIO_GETNODEINFO_JUMPER (GPIO_BOOT_CONFIG & ~GPIO_EXTI) diff --git a/boards/ark/cannode/src/can.c b/boards/ark/cannode/src/can.c deleted file mode 100644 index 7737965..0000000 --- a/boards/ark/cannode/src/can.c +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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. - * - ****************************************************************************/ - -/** - * @file can.c - * - * Board-specific CAN functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include - -#include -#include - -#include "chip.h" -#include "arm_internal.h" - -#include "stm32.h" -#include "stm32_can.h" -#include "board_config.h" - -#ifdef CONFIG_CAN - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) -# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." -# undef CONFIG_STM32_CAN2 -#endif - -#ifdef CONFIG_STM32_CAN1 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); - -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} - -#endif diff --git a/boards/ark/cannode/src/i2c.cpp b/boards/ark/cannode/src/i2c.cpp deleted file mode 100644 index e71caa4..0000000 --- a/boards/ark/cannode/src/i2c.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), -}; diff --git a/boards/ark/cannode/src/init.c b/boards/ark/cannode/src/init.c deleted file mode 100644 index 7eb98e4..0000000 --- a/boards/ark/cannode/src/init.c +++ /dev/null @@ -1,187 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * board specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include "board_config.h" -#include "led.h" -#include - -#include - -#include -#include -#include - -#include - -#include -#include - -#include - -# if defined(FLASH_BASED_PARAMS) -# include -#endif - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - // Configure the GPIO pins to outputs and keep them low. - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(io_timer_channel_get_gpio_output(i)); - } - - /* - * On resets invoked from system (not boot) insure we establish a low - * output state (discharge the pins) on PWM pins before they become inputs. - */ - - if (status >= 0) { - up_mdelay(400); - } -} - -/************************************************************************************ - * 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 all PWM to Low outputs. - board_on_reset(-1); - - watchdog_init(); - - /* configure pins */ - const uint32_t gpio[] = PX4_GPIO_INIT_LIST; - px4_gpio_init(gpio, arraySize(gpio)); - - // Configure SPI all interfaces GPIO & enable power. - stm32_spiinitialize(); -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - px4_platform_init(); - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - -#if defined(FLASH_BASED_PARAMS) - static sector_descriptor_t params_sector_map[] = { - {2, 16 * 1024, 0x08008000}, - {3, 16 * 1024, 0x0800C000}, - {0, 0, 0}, - }; - - /* Initialize the flashfs layer to use heap allocated memory */ - int result = parameter_flashfs_init(params_sector_map, NULL, 0); - - if (result != OK) { - syslog(LOG_ERR, "[boot] FAILED to init params in FLASH %d\n", result); - } - -#endif // FLASH_BASED_PARAMS - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/ark/cannode/src/led.c b/boards/ark/cannode/src/led.c deleted file mode 100644 index 9a80cae..0000000 --- a/boards/ark/cannode/src/led.c +++ /dev/null @@ -1,124 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -#include "led.h" - -#define TMR_BASE STM32_TIM1_BASE -#define TMR_FREQUENCY STM32_APB2_TIM1_CLKIN -#define TMR_REG(o) (TMR_BASE+(o)) - -void rgb_led(int r, int g, int b, int freqs) -{ - - long fosc = TMR_FREQUENCY; - long prescale = 2048; - long p1s = fosc / prescale; - long p0p5s = p1s / 2; - uint16_t val; - static bool once = 0; - - if (!once) { - once = 1; - - /* Enabel Clock to Block */ - modifyreg32(STM32_RCC_APB2ENR, 0, RCC_APB2ENR_TIM1EN); - - /* Reload */ - - val = getreg16(TMR_REG(STM32_BTIM_EGR_OFFSET)); - val |= ATIM_EGR_UG; - putreg16(val, TMR_REG(STM32_BTIM_EGR_OFFSET)); - - /* Set Prescaler STM32_TIM_SETCLOCK */ - - putreg16(prescale, TMR_REG(STM32_BTIM_PSC_OFFSET)); - - /* Enable STM32_TIM_SETMODE*/ - - putreg16(ATIM_CR1_CEN | ATIM_CR1_ARPE, TMR_REG(STM32_BTIM_CR1_OFFSET)); - - - putreg16((ATIM_CCMR_MODE_PWM1 << ATIM_CCMR1_OC1M_SHIFT) | ATIM_CCMR1_OC1PE | - (ATIM_CCMR_MODE_PWM1 << ATIM_CCMR1_OC2M_SHIFT) | ATIM_CCMR1_OC2PE, TMR_REG(STM32_GTIM_CCMR1_OFFSET)); - putreg16((ATIM_CCMR_MODE_PWM1 << ATIM_CCMR2_OC3M_SHIFT) | ATIM_CCMR2_OC3PE, TMR_REG(STM32_GTIM_CCMR2_OFFSET)); - putreg16(ATIM_CCER_CC3E | ATIM_CCER_CC3P | - ATIM_CCER_CC2E | ATIM_CCER_CC2P | - ATIM_CCER_CC1E | ATIM_CCER_CC1P, TMR_REG(STM32_GTIM_CCER_OFFSET)); - - - stm32_configgpio(GPIO_TIM1_CH1); - stm32_configgpio(GPIO_TIM1_CH2); - stm32_configgpio(GPIO_TIM1_CH3); - - /* master output enable = on */ - putreg16(ATIM_BDTR_MOE, (TMR_REG(STM32_ATIM_BDTR_OFFSET))); - } - - long p = freqs == 0 ? p1s : p1s / freqs; - putreg32(p, TMR_REG(STM32_BTIM_ARR_OFFSET)); - - p = freqs == 0 ? p1s + 1 : p0p5s / freqs; - - putreg32((r * p) / 255, TMR_REG(STM32_GTIM_CCR1_OFFSET)); - putreg32((g * p) / 255, TMR_REG(STM32_GTIM_CCR2_OFFSET)); - putreg32((b * p) / 255, TMR_REG(STM32_GTIM_CCR3_OFFSET)); - - val = getreg16(TMR_REG(STM32_BTIM_CR1_OFFSET)); - - if (freqs == 0) { - val &= ~ATIM_CR1_CEN; - - } else { - val |= ATIM_CR1_CEN; - } - - putreg16(val, TMR_REG(STM32_BTIM_CR1_OFFSET)); - -} diff --git a/boards/ark/cannode/src/led.h b/boards/ark/cannode/src/led.h deleted file mode 100644 index b68e4aa..0000000 --- a/boards/ark/cannode/src/led.h +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2015 PX4 Development Team. All rights reserved. - * Author: David Sidrane - * - * 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. - * - ****************************************************************************/ - -__BEGIN_DECLS -void rgb_led(int r, int g, int b, int freqs); -__END_DECLS diff --git a/boards/ark/cannode/src/spi.cpp b/boards/ark/cannode/src/spi.cpp deleted file mode 100644 index ab7d82a..0000000 --- a/boards/ark/cannode/src/spi.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortA, GPIO::Pin4}, SPI::DRDY{GPIO::PortB, GPIO::Pin2}), - }), - initSPIBusExternal(SPI::Bus::SPI2, { - initSPIConfigExternal(SPI::CS{GPIO::PortB, GPIO::Pin12}), - initSPIConfigExternal(SPI::CS{GPIO::PortC, GPIO::Pin13}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/ark/cannode/src/timer_config.cpp b/boards/ark/cannode/src/timer_config.cpp deleted file mode 100644 index 5f24fea..0000000 --- a/boards/ark/cannode/src/timer_config.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer2, DMA{DMA::Index1, DMA::Stream7, DMA::Channel3}), - initIOTimer(Timer::Timer3, DMA{DMA::Index1, DMA::Stream2, DMA::Channel5}), - initIOTimer(Timer::Timer4, DMA{DMA::Index1, DMA::Stream6, DMA::Channel2}), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel1}, {GPIO::PortA, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel2}, {GPIO::PortA, GPIO::Pin1}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel3}, {GPIO::PortB, GPIO::Pin10}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel1}, {GPIO::PortB, GPIO::Pin4}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel2}, {GPIO::PortB, GPIO::Pin5}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel3}, {GPIO::PortB, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel4}, {GPIO::PortB, GPIO::Pin1}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortB, GPIO::Pin7}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/ark/cannode/uavcan_board_identity b/boards/ark/cannode/uavcan_board_identity deleted file mode 100644 index 44ea18c..0000000 --- a/boards/ark/cannode/uavcan_board_identity +++ /dev/null @@ -1,17 +0,0 @@ -# UAVCAN boot loadable Module ID -set(uavcanblid_sw_version_major 0) -set(uavcanblid_sw_version_minor 1) -add_definitions( - -DAPP_VERSION_MAJOR=${uavcanblid_sw_version_major} - -DAPP_VERSION_MINOR=${uavcanblid_sw_version_minor} -) - -set(uavcanblid_hw_version_major 0) -set(uavcanblid_hw_version_minor 83) -set(uavcanblid_name "\"org.ark.cannode\"") - -add_definitions( - -DHW_UAVCAN_NAME=${uavcanblid_name} - -DHW_VERSION_MAJOR=${uavcanblid_hw_version_major} - -DHW_VERSION_MINOR=${uavcanblid_hw_version_minor} -) diff --git a/boards/ark/fmu-v6x/bootloader.px4board b/boards/ark/fmu-v6x/bootloader.px4board deleted file mode 100644 index 19b6e66..0000000 --- a/boards/ark/fmu-v6x/bootloader.px4board +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_ROMFSROOT="" diff --git a/boards/ark/fmu-v6x/default.px4board b/boards/ark/fmu-v6x/default.px4board deleted file mode 100644 index 4018e49..0000000 --- a/boards/ark/fmu-v6x/default.px4board +++ /dev/null @@ -1,92 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_ETHERNET=y -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS0" -CONFIG_BOARD_SERIAL_GPS2="/dev/ttyS7" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS6" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS4" -CONFIG_BOARD_SERIAL_TEL3="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL4="/dev/ttyS3" -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_BAROMETER_BMP388=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_HEATER=y -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16507=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y -CONFIG_DRIVERS_IMU_INVENSENSE_IIM42652=y -CONFIG_DRIVERS_IMU_INVENSENSE_IIM42653=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_POWER_MONITOR_INA228=y -CONFIG_DRIVERS_POWER_MONITOR_INA238=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_PX4IO=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SAFETY_BUTTON=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_BOARD_UAVCAN_TIMER_OVERRIDE=2 -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NETMAN=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/ark/fmu-v6x/extras/ark_fmu-v6x_bootloader.bin b/boards/ark/fmu-v6x/extras/ark_fmu-v6x_bootloader.bin deleted file mode 100755 index bbe99d9..0000000 Binary files a/boards/ark/fmu-v6x/extras/ark_fmu-v6x_bootloader.bin and /dev/null differ diff --git a/boards/ark/fmu-v6x/firmware.prototype b/boards/ark/fmu-v6x/firmware.prototype deleted file mode 100644 index 39718c3..0000000 --- a/boards/ark/fmu-v6x/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 57, - "magic": "ARKFWv1", - "description": "Firmware for the ARKFMUv6X board", - "image": "", - "build_time": 0, - "summary": "ARKFMUv6X", - "version": "0.1", - "image_size": 0, - "image_maxsize": 1966080, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/ark/fmu-v6x/init/rc.board_defaults b/boards/ark/fmu-v6x/init/rc.board_defaults deleted file mode 100644 index 7a26ee0..0000000 --- a/boards/ark/fmu-v6x/init/rc.board_defaults +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -# Mavlink ethernet (CFG 1000) -param set-default MAV_2_CONFIG 1000 -param set-default MAV_2_BROADCAST 1 -param set-default MAV_2_MODE 0 -param set-default MAV_2_RADIO_CTL 0 -param set-default MAV_2_RATE 100000 -param set-default MAV_2_REMOTE_PRT 14550 -param set-default MAV_2_UDP_PRT 14550 - -param set-default SENS_EN_INA238 0 -param set-default SENS_EN_INA228 0 -param set-default SENS_EN_INA226 1 - -param set-default SENS_EN_THERMAL 1 -param set-default SENS_IMU_TEMP 10.0 -#param set-default SENS_IMU_TEMP_FF 0.0 -#param set-default SENS_IMU_TEMP_I 0.025 -#param set-default SENS_IMU_TEMP_P 1.0 - -if ver hwtypecmp ARKV6X000000 ARKV6X001000 ARKV6X002000 ARKV6X003000 ARKV6X004000 ARKV6X005000 ARKV6X006000 ARKV6X007000 -then - param set-default SENS_TEMP_ID 2818058 -fi - -if ver hwtypecmp ARKV6X000001 ARKV6X001001 ARKV6X002001 ARKV6X003001 ARKV6X004001 ARKV6X005001 ARKV6X006001 ARKV6X007001 -then - param set-default SENS_TEMP_ID 3014666 -fi - -if ver hwtypecmp ARKV6X001000 ARKV6X001001 ARKV6X001002 ARKV6X001003 ARKV6X001004 ARKV6X001005 ARKV6X001006 ARKV6X001007 -then - param set-default SYS_USE_IO 0 -else - param set-default SYS_USE_IO 1 -fi - -safety_button start diff --git a/boards/ark/fmu-v6x/init/rc.board_sensors b/boards/ark/fmu-v6x/init/rc.board_sensors deleted file mode 100644 index a2b993f..0000000 --- a/boards/ark/fmu-v6x/init/rc.board_sensors +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/sh -# -# ARK FMUARKV6X specific board sensors init -#------------------------------------------------------------------------------ -set HAVE_PM2 yes - -if ver hwtypecmp ARKV6X005000 ARKV6X005001 ARKV6X005002 ARKV6X005003 ARKV6X005004 -then - set HAVE_PM2 no -fi - -if param compare -s ADC_ADS1115_EN 1 -then - ads1115 start -X -else - board_adc start -fi - -if param compare SENS_EN_INA226 1 -then - # Start Digital power monitors - ina226 -X -b 1 -t 1 -k start - - if [ $HAVE_PM2 = yes ] - then - ina226 -X -b 2 -t 2 -k start - fi -fi - -if param compare SENS_EN_INA228 1 -then - # Start Digital power monitors - ina228 -X -b 1 -t 1 -k start - if [ $HAVE_PM2 = yes ] - then - ina228 -X -b 2 -t 2 -k start - fi -fi - -if param compare SENS_EN_INA238 1 -then - # Start Digital power monitors - ina238 -X -b 1 -t 1 -k start - if [ $HAVE_PM2 = yes ] - then - ina238 -X -b 2 -t 2 -k start - fi -fi - -if ver hwtypecmp ARKV6X000000 ARKV6X001000 ARKV6X002000 ARKV6X003000 ARKV6X004000 ARKV6X005000 ARKV6X006000 ARKV6X007000 -then - # Internal SPI bus IIM42652 with SPIX measured frequency of 32.051kHz - iim42652 -R 3 -s -b 1 -C 32051 start - - # Internal SPI bus ICM42688p with SPIX measured frequency of 32.051kHz - icm42688p -R 9 -s -b 2 -C 32051 start - - # Internal SPI bus ICM42688p with SPIX measured frequency of 32.051kHz - icm42688p -R 6 -s -b 3 -C 32051 start -fi - -if ver hwtypecmp ARKV6X000001 ARKV6X001001 ARKV6X002001 ARKV6X003001 ARKV6X004001 ARKV6X005001 ARKV6X006001 ARKV6X007001 -then - # Internal SPI bus IIM42653 with SPIX measured frequency of 32.051kHz - iim42653 -R 3 -s -b 1 -C 32051 start - - # Internal SPI bus IIM42653 with SPIX measured frequency of 32.051kHz - iim42653 -R 9 -s -b 2 -C 32051 start - - # Internal SPI bus IIM42653 with SPIX measured frequency of 32.051kHz - iim42653 -R 6 -s -b 3 -C 32051 start -fi - -# Internal magnetometer on I2C -bmm150 -I start - -# Internal Baro on I2C -bmp388 -I start - -unset HAVE_PM2 diff --git a/boards/ark/fmu-v6x/nuttx-config/Kconfig b/boards/ark/fmu-v6x/nuttx-config/Kconfig deleted file mode 100644 index bb33d3c..0000000 --- a/boards/ark/fmu-v6x/nuttx-config/Kconfig +++ /dev/null @@ -1,17 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see misc/tools/kconfig-language.txt. -# -config BOARD_HAS_PROBES - bool "Board provides GPIO or other Hardware for signaling to timing analyze." - default y - ---help--- - This board provides GPIO FMU-CH1-5, CAP1-6 as PROBE_1-11 to provide timing signals from selected drivers. - -config BOARD_USE_PROBES - bool "Enable the use the board provided FMU-CH1-5, CAP1-6 as PROBE_1-11" - default n - depends on BOARD_HAS_PROBES - - ---help--- - Select to use GPIO FMU-CH1-5, CAP1-6 to provide timing signals from selected drivers. diff --git a/boards/ark/fmu-v6x/nuttx-config/bootloader/defconfig b/boards/ark/fmu-v6x/nuttx-config/bootloader/defconfig deleted file mode 100644 index 97fe8b7..0000000 --- a/boards/ark/fmu-v6x/nuttx-config/bootloader/defconfig +++ /dev/null @@ -1,93 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_CONSOLE is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_SPI_EXCHANGE is not set -# CONFIG_STM32H7_SYSCFG is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/ark/fmu-v6x/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="ark" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H753II=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_INITTHREAD_PRIORITY=254 -CONFIG_BOARD_LATE_INITIALIZE=y -CONFIG_BOARD_LOOPSPERMSEC=95150 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0039 -CONFIG_CDCACM_PRODUCTSTR="ARK BL FMU v6X.x" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x3185 -CONFIG_CDCACM_VENDORSTR="ARK" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_EXPERIMENTAL=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="bootloader_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SPI=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_DMA2=y -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_UART7=y -CONFIG_SYSTEMTICK_HOOK=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGINT_CHAR=0x03 -CONFIG_TTY_SIGTSTP=y -CONFIG_UART7_RXBUFSIZE=512 -CONFIG_UART7_RXDMA=y -CONFIG_UART7_TXBUFSIZE=512 -CONFIG_UART7_TXDMA=y -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/ark/fmu-v6x/nuttx-config/include/board.h b/boards/ark/fmu-v6x/nuttx-config/include/board.h deleted file mode 100644 index 70dcd64..0000000 --- a/boards/ark/fmu-v6x/nuttx-config/include/board.h +++ /dev/null @@ -1,559 +0,0 @@ -/************************************************************************************ - * nuttx-configs/px4_fmu-v6x/include/board.h - * - * Copyright (C) 2016-2022 Gregory Nutt. All rights reserved. - * Authors: David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ -#ifndef __NUTTX_CONFIG_PX4_FMU_V6X_INCLUDE_BOARD_H -#define __NUTTX_CONFIG_PX4_FMU_V6X_INCLUDE_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The px4_fmu-v6X board provides the following clock sources: - * - * X1: 16 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 16 MHz RC factory-trimmed - * HSE: 16 MHz crystal for HSE - */ - -#define STM32_BOARD_XTAL 16000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 32768 - -/* Main PLL Configuration. - * - * PLL source is HSE = 16,000,000 - * - * PLL_VCOx = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 1 <= PLLM <= 63 - * 4 <= PLLN <= 512 - * 150 MHz <= PLL_VCOL <= 420MHz - * 192 MHz <= PLL_VCOH <= 836MHz - * - * SYSCLK = PLL_VCO / PLLP - * CPUCLK = SYSCLK / D1CPRE - * Subject to - * - * PLLP1 = {2, 4, 6, 8, ..., 128} - * PLLP2,3 = {2, 3, 4, ..., 128} - * CPUCLK <= 480 MHz - */ - -//#define STM32_BOARD_USEHSE -#define STM32_BOARD_USEHSI - -#define STM32_PLLCFG_PLLSRC RCC_PLLCKSELR_PLLSRC_HSE - -/* PLL1, wide 4 - 8 MHz input, enable DIVP, DIVQ, DIVR - * - * PLL1_VCO = (16,000,000 / 1) * 60 = 960 MHz - * - * PLL1P = PLL1_VCO/2 = 960 MHz / 2 = 480 MHz - * PLL1Q = PLL1_VCO/4 = 960 MHz / 4 = 240 MHz - * PLL1R = PLL1_VCO/8 = 960 MHz / 8 = 120 MHz - */ - -#define STM32_PLLCFG_PLL1CFG (RCC_PLLCFGR_PLL1VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL1RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVP1EN | \ - RCC_PLLCFGR_DIVQ1EN | \ - RCC_PLLCFGR_DIVR1EN) -#define STM32_PLLCFG_PLL1M RCC_PLLCKSELR_DIVM1(1) -#define STM32_PLLCFG_PLL1N RCC_PLL1DIVR_N1(60) -#define STM32_PLLCFG_PLL1P RCC_PLL1DIVR_P1(2) -#define STM32_PLLCFG_PLL1Q RCC_PLL1DIVR_Q1(4) -#define STM32_PLLCFG_PLL1R RCC_PLL1DIVR_R1(8) - -#define STM32_VCO1_FREQUENCY ((STM32_HSE_FREQUENCY / 1) * 60) -#define STM32_PLL1P_FREQUENCY (STM32_VCO1_FREQUENCY / 2) -#define STM32_PLL1Q_FREQUENCY (STM32_VCO1_FREQUENCY / 4) -#define STM32_PLL1R_FREQUENCY (STM32_VCO1_FREQUENCY / 8) - -/* PLL2 */ - -#define STM32_PLLCFG_PLL2CFG (RCC_PLLCFGR_PLL2VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL2RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVP2EN | \ - RCC_PLLCFGR_DIVQ2EN | \ - RCC_PLLCFGR_DIVR2EN) -#define STM32_PLLCFG_PLL2M RCC_PLLCKSELR_DIVM2(4) -#define STM32_PLLCFG_PLL2N RCC_PLL2DIVR_N2(48) -#define STM32_PLLCFG_PLL2P RCC_PLL2DIVR_P2(2) -#define STM32_PLLCFG_PLL2Q RCC_PLL2DIVR_Q2(2) -#define STM32_PLLCFG_PLL2R RCC_PLL2DIVR_R2(2) - -#define STM32_VCO2_FREQUENCY ((STM32_HSE_FREQUENCY / 4) * 48) -#define STM32_PLL2P_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2Q_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2R_FREQUENCY (STM32_VCO2_FREQUENCY / 2) - -/* PLL3 */ - -#define STM32_PLLCFG_PLL3CFG (RCC_PLLCFGR_PLL3VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL3RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVQ3EN) -#define STM32_PLLCFG_PLL3M RCC_PLLCKSELR_DIVM3(4) -#define STM32_PLLCFG_PLL3N RCC_PLL3DIVR_N3(48) -#define STM32_PLLCFG_PLL3P RCC_PLL3DIVR_P3(2) -#define STM32_PLLCFG_PLL3Q RCC_PLL3DIVR_Q3(4) -#define STM32_PLLCFG_PLL3R RCC_PLL3DIVR_R3(2) - -#define STM32_VCO3_FREQUENCY ((STM32_HSE_FREQUENCY / 4) * 48) -#define STM32_PLL3P_FREQUENCY (STM32_VCO3_FREQUENCY / 2) -#define STM32_PLL3Q_FREQUENCY (STM32_VCO3_FREQUENCY / 4) -#define STM32_PLL3R_FREQUENCY (STM32_VCO3_FREQUENCY / 2) - -/* SYSCLK = PLL1P = 480MHz - * CPUCLK = SYSCLK / 1 = 480 MHz - */ - -#define STM32_RCC_D1CFGR_D1CPRE (RCC_D1CFGR_D1CPRE_SYSCLK) -#define STM32_SYSCLK_FREQUENCY (STM32_PLL1P_FREQUENCY) -#define STM32_CPUCLK_FREQUENCY (STM32_SYSCLK_FREQUENCY / 1) - -/* Configure Clock Assignments */ - -/* AHB clock (HCLK) is SYSCLK/2 (240 MHz max) - * HCLK1 = HCLK2 = HCLK3 = HCLK4 = 240 - */ - -#define STM32_RCC_D1CFGR_HPRE RCC_D1CFGR_HPRE_SYSCLKd2 /* HCLK = SYSCLK / 2 */ -#define STM32_ACLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* ACLK in D1, HCLK3 in D1 */ -#define STM32_HCLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* HCLK in D2, HCLK4 in D3 */ -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D2CFGR_D2PPRE1 RCC_D2CFGR_D2PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB2 clock (PCLK2) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D2CFGR_D2PPRE2 RCC_D2CFGR_D2PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB3 clock (PCLK3) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D1CFGR_D1PPRE RCC_D1CFGR_D1PPRE_HCLKd2 /* PCLK3 = HCLK / 2 */ -#define STM32_PCLK3_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB4 clock (PCLK4) is HCLK/4 (120 MHz) */ - -#define STM32_RCC_D3CFGR_D3PPRE RCC_D3CFGR_D3PPRE_HCLKd2 /* PCLK4 = HCLK / 2 */ -#define STM32_PCLK4_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timer clock frequencies */ - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM15_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM16_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM17_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Kernel Clock Configuration - * - * Note: look at Table 54 in ST Manual - */ - -/* I2C123 clock source */ - -#define STM32_RCC_D2CCIP2R_I2C123SRC RCC_D2CCIP2R_I2C123SEL_HSI - -/* I2C4 clock source */ - -#define STM32_RCC_D3CCIPR_I2C4SRC RCC_D3CCIPR_I2C4SEL_HSI - -/* SPI123 clock source */ - -#define STM32_RCC_D2CCIP1R_SPI123SRC RCC_D2CCIP1R_SPI123SEL_PLL2 - -/* SPI45 clock source */ - -#define STM32_RCC_D2CCIP1R_SPI45SRC RCC_D2CCIP1R_SPI45SEL_PLL2 - -/* SPI6 clock source */ - -#define STM32_RCC_D3CCIPR_SPI6SRC RCC_D3CCIPR_SPI6SEL_PLL2 - -/* USB 1 and 2 clock source */ - -#define STM32_RCC_D2CCIP2R_USBSRC RCC_D2CCIP2R_USBSEL_PLL3 - -/* ADC 1 2 3 clock source */ - -#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2 - -/* FDCAN 1 2 clock source */ - -#define STM32_RCC_D2CCIP1R_FDCANSEL RCC_D2CCIP1R_FDCANSEL_HSE /* FDCAN 1 2 clock source */ - -#define STM32_FDCANCLK STM32_HSE_FREQUENCY - -/* FLASH wait states - * - * ------------ ---------- ----------- - * Vcore MAX ACLK WAIT STATES - * ------------ ---------- ----------- - * 1.15-1.26 V 70 MHz 0 - * (VOS1 level) 140 MHz 1 - * 210 MHz 2 - * 1.05-1.15 V 55 MHz 0 - * (VOS2 level) 110 MHz 1 - * 165 MHz 2 - * 220 MHz 3 - * 0.95-1.05 V 45 MHz 0 - * (VOS3 level) 90 MHz 1 - * 135 MHz 2 - * 180 MHz 3 - * 225 MHz 4 - * ------------ ---------- ----------- - */ - -#define BOARD_FLASH_WAITSTATES 2 - -/* SDMMC definitions ********************************************************/ - -/* Init 400kHz, freq = PLL1Q/(2*div) div = PLL1Q/(2*freq) */ - -#define STM32_SDMMC_INIT_CLKDIV (300 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* 25 MHz Max for now, 25 mHZ = PLL1Q/(2*div), div = PLL1Q/(2*freq) - * div = 4.8 = 240 / 50, So round up to 5 for default speed 24 MB/s - */ - -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_MMCXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_SDXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - -/* LED definitions ******************************************************************/ -/* The ARKV6X board has three, LED_GREEN a Green LED, LED_BLUE a Blue LED and - * LED_RED a Red LED, that can be controlled by software. - * - * If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any way. - * The following definitions are used to access individual LEDs. - */ - -/* LED index values for use with board_userled() */ - -/* LED definitions ******************************************************************/ -/* The px4_fmu-v6x board has three, LED_GREEN a Green LED, LED_BLUE a Blue LED and - * LED_RED a Red LED, that can be controlled by software. - * - * If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any way. - * The following definitions are used to access individual LEDs. - */ - -/* LED index values for use with board_userled() */ - -#define BOARD_LED1 0 -#define BOARD_LED2 1 -#define BOARD_LED3 2 -#define BOARD_NLEDS 3 - -#define BOARD_LED_RED BOARD_LED1 -#define BOARD_LED_GREEN BOARD_LED2 -#define BOARD_LED_BLUE BOARD_LED3 - -/* LED bits for use with board_userled_all() */ - -#define BOARD_LED1_BIT (1 << BOARD_LED1) -#define BOARD_LED2_BIT (1 << BOARD_LED2) -#define BOARD_LED3_BIT (1 << BOARD_LED3) - -/* If CONFIG_ARCH_LEDS is defined, the usage by the board port is defined in - * include/board.h and src/stm32_leds.c. The LEDs are used to encode OS-related - * events as follows: - * - * - * SYMBOL Meaning LED state - * Red Green Blue - * ---------------------- -------------------------- ------ ------ ----*/ - -#define LED_STARTED 0 /* NuttX has been started OFF OFF OFF */ -#define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF OFF ON */ -#define LED_IRQSENABLED 2 /* Interrupts enabled OFF ON OFF */ -#define LED_STACKCREATED 3 /* Idle stack created OFF ON ON */ -#define LED_INIRQ 4 /* In an interrupt N/C N/C GLOW */ -#define LED_SIGNAL 5 /* In a signal handler N/C GLOW N/C */ -#define LED_ASSERTION 6 /* An assertion failed GLOW N/C GLOW */ -#define LED_PANIC 7 /* The system has crashed Blink OFF N/C */ -#define LED_IDLE 8 /* MCU is is sleep mode ON OFF OFF */ - -/* Thus if the Green LED is statically on, NuttX has successfully booted and - * is, apparently, running normally. If the Red LED is flashing at - * approximately 2Hz, then a fatal error has been detected and the system - * has halted. - */ - -/* Alternate function pin selections ************************************************/ - -#define GPIO_USART1_RX GPIO_USART1_RX_3 /* PB7 */ -#define GPIO_USART1_TX GPIO_USART1_TX_3 /* PB6 */ - -#define GPIO_USART2_RX GPIO_USART2_RX_1 /* PA3 */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 /* PD4 */ -#define GPIO_USART2_CTS GPIO_USART2_CTS_NSS_2 /* PD3 */ - -#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ -#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ - -#define GPIO_UART4_RX GPIO_UART4_RX_6 /* PH14 */ -#define GPIO_UART4_TX GPIO_UART4_TX_6 /* PH13 */ - -#define GPIO_UART5_RX GPIO_UART5_RX_3 /* PD2 */ -#define GPIO_UART5_TX GPIO_UART5_TX_3 /* PC12 */ -// GPIO_UART5_RTS No remap /* PC8 */ -// GPIO_UART5_CTS No remap /* PC9 */ - -#define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC7 */ -#define GPIO_USART6_TX GPIO_USART6_TX_1 /* PC6 */ - -#define GPIO_UART7_RX GPIO_UART7_RX_4 /* PF6 */ -#define GPIO_UART7_TX GPIO_UART7_TX_3 /* PE8 */ -#define GPIO_UART7_RTS (GPIO_UART7_RTS_2 | GPIO_PULLDOWN) /* PF8 */ -#define GPIO_UART7_CTS (GPIO_UART7_CTS_1 | GPIO_PULLDOWN) /* PE10 */ - -#define GPIO_UART8_RX GPIO_UART8_RX_1 /* PE0 */ -#define GPIO_UART8_TX GPIO_UART8_TX_1 /* PE1 */ - - -/* CAN - * - * CAN1 is routed to transceiver. - * CAN2 is routed to transceiver. - */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 /* PD0 */ -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 /* PD1 */ -#define GPIO_CAN2_RX GPIO_CAN2_RX_1 /* PB12 */ -#define GPIO_CAN2_TX GPIO_CAN2_TX_1 /* PB13 */ - -/* SPI - * SPI1 is sensors1 - * SPI2 is sensors2 - * SPI3 is sensors3 - * SPI4 is Not Used - * SPI5 is FRAM - * SPI6 is EXTERNAL1 - * - */ - -#define ADJ_SLEW_RATE(p) (((p) & ~GPIO_SPEED_MASK) | (GPIO_SPEED_2MHz)) - -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_3 /* PG9 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_2 /* PB5 */ -#define GPIO_SPI1_SCK ADJ_SLEW_RATE(GPIO_SPI1_SCK_1) /* PA5 */ - -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_3 /* PI2 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_4 /* PI3 */ -#define GPIO_SPI2_SCK ADJ_SLEW_RATE(GPIO_SPI2_SCK_6) /* PI1 */ - -#define GPIO_SPI3_MISO GPIO_SPI3_MISO_2 /* PC11 */ -#define GPIO_SPI3_MOSI GPIO_SPI3_MOSI_3 /* PB2 */ -#define GPIO_SPI3_SCK ADJ_SLEW_RATE(GPIO_SPI3_SCK_2) /* PC10 */ - -#define GPIO_SPI5_MISO GPIO_SPI5_MISO_2 /* PH7 */ -#define GPIO_SPI5_MOSI GPIO_SPI5_MOSI_1 /* PF11 */ -#define GPIO_SPI5_SCK ADJ_SLEW_RATE(GPIO_SPI5_SCK_1) /* PF7 */ - -#define GPIO_SPI6_MISO GPIO_SPI6_MISO_2 /* PA6 */ -#define GPIO_SPI6_MOSI GPIO_SPI6_MOSI_1 /* PG14 */ -#define GPIO_SPI6_SCK ADJ_SLEW_RATE(GPIO_SPI6_SCK_3) /* PB3 */ - -/* I2C - * - * The optional _GPIO configurations allow the I2C driver to manually - * reset the bus to clear stuck slaves. They match the pin configuration, - * but are normally-high GPIOs. - * - */ - -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 /* PB8 */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 /* PB9 */ - -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN8) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN9) - -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_2 /* PF1 */ -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_2 /* PF0 */ - -#define GPIO_I2C2_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTF | GPIO_PIN1) -#define GPIO_I2C2_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTF | GPIO_PIN0) - -#define GPIO_I2C3_SCL GPIO_I2C3_SCL_1 /* PA8 */ -#define GPIO_I2C3_SDA GPIO_I2C3_SDA_2 /* PH8 */ - -#define GPIO_I2C3_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTA | GPIO_PIN8) -#define GPIO_I2C3_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTH | GPIO_PIN8) - -#define GPIO_I2C4_SCL GPIO_I2C4_SCL_2 /* PF14 */ -#define GPIO_I2C4_SDA GPIO_I2C4_SDA_2 /* PF15 */ - -#define GPIO_I2C4_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTF | GPIO_PIN14) -#define GPIO_I2C4_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTF | GPIO_PIN15) - -/* SDMMC2 - * - * VDD 3.3 - * GND - * SDMMC2_CK PD6 - * SDMMC2_CMD PD7 - * SDMMC2_D0 PB14 - * SDMMC2_D1 PB15 - * SDMMC2_D2 PG11 - * SDMMC2_D3 PB4 - */ - -#define GPIO_SDMMC2_CK GPIO_SDMMC2_CK_1 /* PD6 */ -#define GPIO_SDMMC2_CMD GPIO_SDMMC2_CMD_1 /* PD7 */ -// GPIO_SDMMC2_D0 No Remap /* PB14 */ -// GPIO_SDMMC2_D1 No Remap /* PB15 */ -#define GPIO_SDMMC2_D2 GPIO_SDMMC2_D2_1 /* PG11 */ -// GPIO_SDMMC2_D3 No Remap /* PB4 */ - -/* The STM32 H7 connects to a TI DP83848TSQ/NOPB - * using RMII - * - * STM32 H7 BOARD DP83848TSQ/NOPB - * GPIO SIGNAL PIN NAME - * -------- ------------ ------------- - * PA7 ETH_CRS_DV CRS_DV - * PC1 ETH_MDC MDC - * PA2 ETH_MDIO MDIO - * PA1 ETH_REF_CL X1 - * PC4 ETH_RXD0 RX_D0 - * PC5 ETH_RXD1 RX_D1 - * PB11 ETH_TX_EN TX_EN - * PG13 ETH_TXD0 TX_D0 - * PG12 ETH_TXD1 TX_D1 - * - * The PHY address is 1, since COL/PHYAD0 features a pull up. - */ - -#define GPIO_ETH_RMII_TX_EN GPIO_ETH_RMII_TX_EN_1 /* PB11 */ -#define GPIO_ETH_RMII_TXD0 GPIO_ETH_RMII_TXD0_2 /* PG13 */ -#define GPIO_ETH_RMII_TXD1 GPIO_ETH_RMII_TXD1_2 /* PG12 */ - - -/* USB - * - * OTG_FS_DM PA11 - * OTG_FS_DP PA12 - * VBUS PA9 - */ - - -/* Board provides GPIO or other Hardware for signaling to timing analyzer */ - -#if defined(CONFIG_BOARD_USE_PROBES) -# include "stm32_gpio.h" -# define PROBE_N(n) (1<<((n)-1)) -# define PROBE_1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTI|GPIO_PIN0) /* PI0 AUX1 */ -# define PROBE_2 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN12) /* PH12 AUX2 */ -# define PROBE_3 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN11) /* PH11 AUX3 */ -# define PROBE_4 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN10) /* PH10 AUX4 */ -# define PROBE_5 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN13) /* PD13 AUX5 */ -# define PROBE_6 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN14) /* PD14 AUX6 */ -# define PROBE_7 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN6) /* PH6 AUX7 */ -# define PROBE_8 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN9) /* PH9 AUX8 */ -# define PROBE_9 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN11) /* PE11 CAP1 */ - -# define PROBE_INIT(mask) \ - do { \ - if ((mask)& PROBE_N(1)) { stm32_configgpio(PROBE_1); } \ - if ((mask)& PROBE_N(2)) { stm32_configgpio(PROBE_2); } \ - if ((mask)& PROBE_N(3)) { stm32_configgpio(PROBE_3); } \ - if ((mask)& PROBE_N(4)) { stm32_configgpio(PROBE_4); } \ - if ((mask)& PROBE_N(5)) { stm32_configgpio(PROBE_5); } \ - if ((mask)& PROBE_N(6)) { stm32_configgpio(PROBE_6); } \ - if ((mask)& PROBE_N(7)) { stm32_configgpio(PROBE_7); } \ - if ((mask)& PROBE_N(8)) { stm32_configgpio(PROBE_8); } \ - if ((mask)& PROBE_N(9)) { stm32_configgpio(PROBE_9); } \ - } while(0) - -# define PROBE(n,s) do {stm32_gpiowrite(PROBE_##n,(s));}while(0) -# define PROBE_MARK(n) PROBE(n,false);PROBE(n,true) -#else -# define PROBE_INIT(mask) -# define PROBE(n,s) -# define PROBE_MARK(n) -#endif - -#endif /*__NUTTX_CONFIG_PX4_FMU_V6X_INCLUDE_BOARD_H */ diff --git a/boards/ark/fmu-v6x/nuttx-config/include/board_dma_map.h b/boards/ark/fmu-v6x/nuttx-config/include/board_dma_map.h deleted file mode 100644 index f1a9493..0000000 --- a/boards/ark/fmu-v6x/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** - * - * 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. - * - ****************************************************************************/ - -#pragma once - -// DMAMUX1 Using at most 8 Channels on DMA1 -------- Assigned -// V - -#define DMAMAP_SPI1_RX DMAMAP_DMA12_SPI1RX_0 /* 1 DMA1:37 ICM-20649 */ -#define DMAMAP_SPI1_TX DMAMAP_DMA12_SPI1TX_0 /* 2 DMA1:38 ICM-20649 */ - -#define DMAMAP_SPI2_RX DMAMAP_DMA12_SPI2RX_0 /* 3 DMA1:39 ICM-42688-P */ -#define DMAMAP_SPI2_TX DMAMAP_DMA12_SPI2TX_0 /* 4 DMA1:40 ICM-42688-P */ - -//#define DMAMAP_USART1_RX DMAMAP_DMA12_USART1RX_0 /* DMA1:41 GPS1 */ -//#define DMAMAP_USART1_TX DMAMAP_DMA12_USART1TX_0 /* DMA1:42 GPS1 */ - -//#define DMAMAP_USART2_RX DMAMAP_DMA12_USART2RX_0 /* DMA1:43 Telem3 */ -//#define DMAMAP_USART2_TX DMAMAP_DMA12_USART2TX_0 /* DMA1:44 Telem3 */ - -//#define DMAMAP_USART3_RX DMAMAP_DMA12_USART3RX_0 /* DMA1:45 DEBUG */ -//#define DMAMAP_USART3_TX DMAMAP_DMA12_USART3TX_0 /* DMA1:46 DEBUG */ - -//#define DMAMAP_UART4_RX DMAMAP_DMA12_UART4RX_0 /* DMA1:63 EXT2 */ -//#define DMAMAP_UART4_TX DMAMAP_DMA12_UART4TX_0 /* DMA1:64 EXT2 */ - -#define DMAMAP_USART6_RX DMAMAP_DMA12_USART6RX_0 /* 5 DMA1:71 PX4IO */ -#define DMAMAP_USART6_TX DMAMAP_DMA12_USART6TX_0 /* 6 DMA1:72 PX4IO */ - -// Assigned in timer_config.cpp - -// Timer 4 /* 7 DMA1:32 TIM4UP */ -// Timer 5 /* 8 DMA1:50 TIM5UP */ - -// DMAMUX2 Using at most 8 Channels on DMA2 -------- Assigned -// V - -#define DMAMAP_SPI3_RX DMAMAP_DMA12_SPI3RX_1 /* 1 DMA2:61 BMI088 */ -#define DMAMAP_SPI3_TX DMAMAP_DMA12_SPI3TX_1 /* 2 DMA2:62 BMI088 */ - -#define DMAMAP_USART3_RX DMAMAP_DMA12_USART3RX_1 /* 3 DMA2:45 DEBUG */ -#define DMAMAP_USART3_TX DMAMAP_DMA12_USART3TX_1 /* 4 DMA2:46 DEBUG */ - -#define DMAMAP_UART5_RX DMAMAP_DMA12_UART5RX_1 /* 5 DMA2:65 TELEM2 */ -#define DMAMAP_UART5_TX DMAMAP_DMA12_UART5TX_1 /* 6 DMA2:66 TELEM2 */ - -#define DMAMAP_UART7_RX DMAMAP_DMA12_UART7RX_1 /* 7 DMA1:79 TELEM1 */ -#define DMAMAP_UART7_TX DMAMAP_DMA12_UART7TX_1 /* 8 DMA1:80 TELEM1 */ - -//#define DMAMAP_UART8_RX DMAMAP_DMA12_UART8RX_1 /* DMA1:81 GPS2 */ -//#define DMAMAP_UART8_TX DMAMAP_DMA12_UART8TX_1 /* DMA1:82 GPS2 */ - -// DMAMUX2 Using at most 8 Channels on BDMA -------- Assigned -// V - -#define DMAMAP_SPI6_RX DMAMAP_BDMA_SPI6_RX /* 1 BDMA:11 SPI J11 */ -#define DMAMAP_SPI6_TX DMAMAP_BDMA_SPI6_TX /* 2 BDMA:12 SPI J11 */ diff --git a/boards/ark/fmu-v6x/nuttx-config/nsh/defconfig b/boards/ark/fmu-v6x/nuttx-config/nsh/defconfig deleted file mode 100644 index 212213f..0000000 --- a/boards/ark/fmu-v6x/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,328 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_ARP is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_IFCONFIG is not set -# CONFIG_NSH_DISABLE_IFUPDOWN is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_NSLOOKUP is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TELNETD is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/ark/fmu-v6x/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="ark" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H753II=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=95751 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0039 -CONFIG_CDCACM_PRODUCTSTR="ARK FMU v6X.x" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x3185 -CONFIG_CDCACM_VENDORSTR="ARK" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_MEMFAULT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_ETH0_PHY_LAN8742A=y -CONFIG_EXPERIMENTAL=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FSUTILS_IPCFG=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_IOB_NBUFFERS=24 -CONFIG_IOB_THROTTLE=0 -CONFIG_IPCFG_BINARY=y -CONFIG_IPCFG_CHARDEV=y -CONFIG_IPCFG_PATH="/fs/mtd_net" -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=4 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_PROGMEM=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NET=y -CONFIG_NETDB_DNSCLIENT=y -CONFIG_NETDB_DNSCLIENT_ENTRIES=8 -CONFIG_NETDB_DNSSERVER_NOADDR=y -CONFIG_NETDEV_PHY_IOCTL=y -CONFIG_NETINIT_DHCPC=y -CONFIG_NETINIT_DNS=y -CONFIG_NETINIT_DNSIPADDR=0XC0A800FE -CONFIG_NETINIT_DRIPADDR=0XC0A800FE -CONFIG_NETINIT_MONITOR=y -CONFIG_NETINIT_THREAD=y -CONFIG_NETINIT_THREAD_PRIORITY=49 -CONFIG_NETUTILS_TELNETD=y -CONFIG_NET_ARP_IPIN=y -CONFIG_NET_ARP_SEND=y -CONFIG_NET_BROADCAST=y -CONFIG_NET_ETH_PKTSIZE=1518 -CONFIG_NET_ICMP=y -CONFIG_NET_ICMP_SOCKET=y -CONFIG_NET_NACTIVESOCKETS=16 -CONFIG_NET_SOLINGER=y -CONFIG_NET_TCP=y -CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_DELAYED_ACK=y -CONFIG_NET_TCP_WRITE_BUFFERS=y -CONFIG_NET_UDP=y -CONFIG_NET_UDP_CHECKSUMS=y -CONFIG_NET_UDP_WRITE_BUFFERS=y -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_TELNET=y -CONFIG_NSH_TELNET_LOGIN=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC2_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32H7_ADC1=y -CONFIG_STM32H7_ADC3=y -CONFIG_STM32H7_BBSRAM=y -CONFIG_STM32H7_BBSRAM_FILES=5 -CONFIG_STM32H7_BDMA=y -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_DMA2=y -CONFIG_STM32H7_DMACAPABLE=y -CONFIG_STM32H7_ETHMAC=y -CONFIG_STM32H7_FLASH_OVERRIDE_I=y -CONFIG_STM32H7_FLOWCONTROL_BROKEN=y -CONFIG_STM32H7_I2C1=y -CONFIG_STM32H7_I2C2=y -CONFIG_STM32H7_I2C3=y -CONFIG_STM32H7_I2C4=y -CONFIG_STM32H7_I2C_DYNTIMEO=y -CONFIG_STM32H7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PHYSR=31 -CONFIG_STM32H7_PHYSR_100MBPS=0x8 -CONFIG_STM32H7_PHYSR_FULLDUPLEX=0x10 -CONFIG_STM32H7_PHYSR_MODE=0x10 -CONFIG_STM32H7_PHYSR_SPEED=0x8 -CONFIG_STM32H7_PHY_POLLING=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_RTC=y -CONFIG_STM32H7_RTC_AUTO_LSECLOCK_START_DRV_CAPABILITY=y -CONFIG_STM32H7_RTC_MAGIC_REG=1 -CONFIG_STM32H7_SAVE_CRASHDUMP=y -CONFIG_STM32H7_SDMMC2=y -CONFIG_STM32H7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_SPI1=y -CONFIG_STM32H7_SPI1_DMA=y -CONFIG_STM32H7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32H7_SPI2=y -CONFIG_STM32H7_SPI2_DMA=y -CONFIG_STM32H7_SPI2_DMA_BUFFER=4096 -CONFIG_STM32H7_SPI3=y -CONFIG_STM32H7_SPI3_DMA=y -CONFIG_STM32H7_SPI3_DMA_BUFFER=1024 -CONFIG_STM32H7_SPI5=y -CONFIG_STM32H7_SPI6=y -CONFIG_STM32H7_SPI6_DMA=y -CONFIG_STM32H7_SPI6_DMA_BUFFER=1024 -CONFIG_STM32H7_TIM12=y -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_TIM4=y -CONFIG_STM32H7_TIM5=y -CONFIG_STM32H7_UART4=y -CONFIG_STM32H7_UART5=y -CONFIG_STM32H7_UART7=y -CONFIG_STM32H7_UART8=y -CONFIG_STM32H7_USART1=y -CONFIG_STM32H7_USART2=y -CONFIG_STM32H7_USART3=y -CONFIG_STM32H7_USART6=y -CONFIG_STM32H7_USART_BREAKS=y -CONFIG_STM32H7_USART_INVERT=y -CONFIG_STM32H7_USART_SINGLEWIRE=y -CONFIG_STM32H7_USART_SWAP=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_DHCPC_RENEW=y -CONFIG_SYSTEM_NSH=y -CONFIG_SYSTEM_PING=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART5_IFLOWCONTROL=y -CONFIG_UART5_OFLOWCONTROL=y -CONFIG_UART5_RXDMA=y -CONFIG_UART5_TXBUFSIZE=3000 -CONFIG_UART5_TXDMA=y -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_IFLOWCONTROL=y -CONFIG_UART7_OFLOWCONTROL=y -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_RXDMA=y -CONFIG_UART7_TXBUFSIZE=3000 -CONFIG_UART7_TXDMA=y -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_TXBUFSIZE=3000 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_RXBUFSIZE=180 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_SERIAL_CONSOLE=y -CONFIG_USART3_TXBUFSIZE=1500 -CONFIG_USART3_TXDMA=y -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 -CONFIG_WATCHDOG=y diff --git a/boards/ark/fmu-v6x/nuttx-config/scripts/bootloader_script.ld b/boards/ark/fmu-v6x/nuttx-config/scripts/bootloader_script.ld deleted file mode 100644 index 5b1bb4c..0000000 --- a/boards/ark/fmu-v6x/nuttx-config/scripts/bootloader_script.ld +++ /dev/null @@ -1,215 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016, 2022 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The ARKV6X uses an STM32H753II has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * The ARKV6X has a test point on board, the BOOT0 pin is at ground so by - * default, the STM32 will boot to address 0x0800:0000 in FLASH unless the test - * point is pulled to 3.3V.then the boot will be from 0x1FF0:0000 - * - * The STM32H743II also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The bootloader uses the first sector of the flash, which is 128K in length. - */ - -MEMORY -{ - itcm (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - flash (rx) : ORIGIN = 0x08000000, LENGTH = 128K - dtcm1 (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - dtcm2 (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - sram (rwx) : ORIGIN = 0x24000000, LENGTH = 512K - sram1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K - sram2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K - sram3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K - sram4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K - bbram (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/ark/fmu-v6x/nuttx-config/scripts/script.ld b/boards/ark/fmu-v6x/nuttx-config/scripts/script.ld deleted file mode 100644 index d06a7d7..0000000 --- a/boards/ark/fmu-v6x/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,229 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016, 2022 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The ARKV6X uses an STM32H753II has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * The ARKV6X has a test point on board, the BOOT0 pin is at ground so by - * default, the STM32 will boot to address 0x0800:0000 in FLASH unless the test - * point is pulled to 3.3V.then the boot will be from 0x1FF0:0000 - * - * The STM32H743II also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - FLASH (rx) : ORIGIN = 0x08020000, LENGTH = 1920K - - DTCM1_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - DTCM2_RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */ - SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */ - SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */ - BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) -EXTERN(board_get_manifest) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH - - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - - /* Pad out last section as the STM32H7 Flash write size is 256 bits. 32 bytes */ - . = ALIGN(16); - FILL(0xffff) - . += 16; - } > AXI_SRAM AT > FLASH = 0xffff - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > AXI_SRAM - - /* Emit the the D3 power domain section for locating BDMA data */ - - .sram4_reserve (NOLOAD) : - { - *(.sram4) - . = ALIGN(4); - _sram4_heap_start = ABSOLUTE(.); - } > SRAM4 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/ark/fmu-v6x/src/CMakeLists.txt b/boards/ark/fmu-v6x/src/CMakeLists.txt deleted file mode 100644 index 3135751..0000000 --- a/boards/ark/fmu-v6x/src/CMakeLists.txt +++ /dev/null @@ -1,78 +0,0 @@ -############################################################################ -# -# Copyright (c) 2016 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. -# -############################################################################ -if("${PX4_BOARD_LABEL}" STREQUAL "bootloader") - add_compile_definitions(BOOTLOADER) - add_library(drivers_board - bootloader_main.c - init.c - usb.c - timer_config.cpp - ) - target_link_libraries(drivers_board - PRIVATE - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer #gpio - arch_io_pins # iotimer - bootloader - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/bootloader/common) - -else() - add_library(drivers_board - can.c - i2c.cpp - init.c - led.c - mtd.cpp - manifest.c - sdio.c - spi.cpp - spix_sync.c - spix_sync.h - timer_config.cpp - usb.c - ) - add_dependencies(drivers_board arch_board_hw_info) - - target_link_libraries(drivers_board - PRIVATE - arch_io_pins - arch_spi - arch_board_hw_info - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer - ) -endif() diff --git a/boards/ark/fmu-v6x/src/board_config.h b/boards/ark/fmu-v6x/src/board_config.h deleted file mode 100644 index 001a31a..0000000 --- a/boards/ark/fmu-v6x/src/board_config.h +++ /dev/null @@ -1,539 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2016-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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * ARKFMU-v6x internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - - -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ - -#undef TRACE_PINS - -/* PX4IO connection configuration */ - -#define BOARD_USES_PX4IO_VERSION 2 -#define PX4IO_SERIAL_DEVICE "/dev/ttyS5" -#define PX4IO_SERIAL_TX_GPIO GPIO_USART6_TX -#define PX4IO_SERIAL_RX_GPIO GPIO_USART6_RX -#define PX4IO_SERIAL_BASE STM32_USART6_BASE -#define PX4IO_SERIAL_VECTOR STM32_IRQ_USART6 -#define PX4IO_SERIAL_TX_DMAMAP DMAMAP_USART6_TX -#define PX4IO_SERIAL_RX_DMAMAP DMAMAP_USART6_RX -#define PX4IO_SERIAL_RCC_REG STM32_RCC_APB2ENR -#define PX4IO_SERIAL_RCC_EN RCC_APB2ENR_USART6EN -#define PX4IO_SERIAL_CLOCK STM32_PCLK2_FREQUENCY -#define PX4IO_SERIAL_BITRATE 1500000 /* 1.5Mbps -> max rate for IO */ - -/* Configuration ************************************************************************************/ - -#define BOARD_HAS_LTC44XX_VALIDS 2 // N Bricks -#define BOARD_HAS_USB_VALID 1 // LTC Has USB valid -#define BOARD_HAS_NBAT_V 2d // 2 Digital Voltage -#define BOARD_HAS_NBAT_I 2d // 2 Digital Current - -/* PX4FMU GPIOs ***********************************************************************************/ - -/* Trace Clock and D0-D3 are available on the trace connector - * - * TRACECLK PE2 - Dedicated - Trace Connector Pin 1 - * TRACED0 PE3 - nLED_RED - Trace Connector Pin 3 - * TRACED1 PE4 - nLED_GREEN - Trace Connector Pin 5 - * TRACED2 PE5 - nLED_BLUE - Trace Connector Pin 7 - * TRACED3 PE6 - nARMED - Trace Connector Pin 8 - - */ - -/* LEDs are driven with push open drain to support Anode to 5V or 3.3V or used as TRACE0-2 */ - -#if !defined(TRACE_PINS) -# define GPIO_nLED_RED /* PE3 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN3) -# define GPIO_nLED_GREEN /* PE4 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN4) -# define GPIO_nLED_BLUE /* PE5 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN5) - -# define BOARD_HAS_CONTROL_STATUS_LEDS 1 -# define BOARD_OVERLOAD_LED LED_RED -# define BOARD_ARMED_STATE_LED LED_BLUE - -#else - -# define GPIO_TRACECLK1 (GPIO_TRACECLK |GPIO_PULLUP|GPIO_SPEED_100MHz|GPIO_PUSHPULL) //(GPIO_ALT|GPIO_AF0|GPIO_PORTE|GPIO_PIN2) -# define GPIO_TRACED0 (GPIO_TRACED0_2|GPIO_PULLUP|GPIO_SPEED_100MHz|GPIO_PUSHPULL) //(GPIO_ALT|GPIO_AF0|GPIO_PORTE|GPIO_PIN3) -# define GPIO_TRACED1 (GPIO_TRACED1_2|GPIO_PULLUP|GPIO_SPEED_100MHz|GPIO_PUSHPULL) //(GPIO_ALT|GPIO_AF0|GPIO_PORTE|GPIO_PIN4) -# define GPIO_TRACED2 (GPIO_TRACED2_2|GPIO_PULLUP|GPIO_SPEED_100MHz|GPIO_PUSHPULL) //(GPIO_ALT|GPIO_AF0|GPIO_PORTE|GPIO_PIN5) -# define GPIO_TRACED3 (GPIO_TRACED3_2|GPIO_PULLUP|GPIO_SPEED_100MHz|GPIO_PUSHPULL) //(GPIO_ALT|GPIO_AF0|GPIO_PORTE|GPIO_PIN6) -//#define GPIO_TRACESWO //(GPIO_ALT|GPIO_AF0|GPIO_PORTB|GPIO_PIN3) - -# undef BOARD_HAS_CONTROL_STATUS_LEDS -# undef BOARD_OVERLOAD_LED -# undef BOARD_ARMED_STATE_LED - -# define GPIO_nLED_RED GPIO_TRACED0 -# define GPIO_nLED_GREEN GPIO_TRACED1 -# define GPIO_nLED_BLUE GPIO_TRACED2 -# define GPIO_nARMED GPIO_TRACED3 -# define GPIO_nARMED_INIT GPIO_TRACED3 -#endif - - -/* SPI */ - -#define SPI6_nRESET_EXTERNAL1 /* PF10 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTF|GPIO_PIN10) -#define SPI6_RESET(on_true) px4_arch_gpiowrite(SPI6_nRESET_EXTERNAL1, !(on_true)) - -/* I2C busses */ - -/* Devices on the onboard buses. - * - * Note that these are unshifted addresses. - */ -#define PX4_I2C_OBDEV_SE050 0x48 - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that - * can be used by the Px4 Firmware in the adc driver - */ - -/* ADC defines to be used in sensors.cpp to read from a particular channel */ - -#define ADC1_CH(n) (n) - -/* N.B. there is no offset mapping needed for ADC3 because */ -#define ADC3_CH(n) (n) - -/* We are only use ADC3 for REV/VER. - * ADC3_6V6 and ADC3_3V3 are mapped back to ADC1 - * To do this We are relying on PC2_C, PC3_C being connected to PC2, PC3 - * respectively by the SYSCFG_PMCR default of setting for PC3SO PC2SO PA1SO - * PA0SO of 0. - * - * 0 Analog switch closed (pads are connected through the analog switch) - * - * So ADC3_INP0 is GPIO_ADC123_INP12 - * ADC3_INP1 is GPIO_ADC12_INP13 - */ - -/* Define GPIO pins used as ADC N.B. Channel numbers must match below */ - -#define PX4_ADC_GPIO \ - /* PA0 */ GPIO_ADC1_INP16, \ - /* PA4 */ GPIO_ADC12_INP18, \ - /* PB0 */ GPIO_ADC12_INP9, \ - /* PB1 */ GPIO_ADC12_INP5, \ - /* PC2 */ GPIO_ADC123_INP12, \ - /* PC3 */ GPIO_ADC12_INP13, \ - /* PF12 */ GPIO_ADC1_INP6, \ - /* PH3 */ GPIO_ADC3_INP14, \ - /* PH4 */ GPIO_ADC3_INP15 - -/* Define Channel numbers must match above GPIO pin IN(n)*/ -#define ADC_SCALED_VDD_3V3_SENSORS1_CHANNEL /* PA0 */ ADC1_CH(16) -#define ADC_SCALED_VDD_3V3_SENSORS2_CHANNEL /* PA4 */ ADC1_CH(18) -#define ADC_SCALED_VDD_3V3_SENSORS3_CHANNEL /* PB0 */ ADC1_CH(9) -#define ADC_SCALED_V5_CHANNEL /* PB1 */ ADC1_CH(5) -#define ADC_ADC3_6V6_CHANNEL /* PC2 */ ADC3_CH(12) -#define ADC_ADC3_3V3_CHANNEL /* PC3 */ ADC3_CH(13) -#define ADC_SCALED_VDD_3V3_SENSORS4_CHANNEL /* PF12 */ ADC1_CH(6) -#define ADC_HW_VER_SENSE_CHANNEL /* PH3 */ ADC3_CH(14) -#define ADC_HW_REV_SENSE_CHANNEL /* PH4 */ ADC3_CH(15) - -#define ADC_CHANNELS \ - ((1 << ADC_SCALED_VDD_3V3_SENSORS1_CHANNEL) | \ - (1 << ADC_SCALED_VDD_3V3_SENSORS2_CHANNEL) | \ - (1 << ADC_SCALED_VDD_3V3_SENSORS3_CHANNEL) | \ - (1 << ADC_SCALED_V5_CHANNEL) | \ - (1 << ADC_ADC3_6V6_CHANNEL) | \ - (1 << ADC_ADC3_3V3_CHANNEL)) | \ - (1 << ADC_SCALED_VDD_3V3_SENSORS4_CHANNEL) - -/* HW has to large of R termination on ADC todo:change when HW value is chosen */ - -#define HW_REV_VER_ADC_BASE STM32_ADC3_BASE - -#define SYSTEM_ADC_BASE STM32_ADC1_BASE - -/* HW has to large of R termination on ADC todo:change when HW value is chosen */ -#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f) - -/* HW Version and Revision drive signals Default to 1 to detect */ -#define BOARD_HAS_HW_VERSIONING - -#define GPIO_HW_VER_REV_DRIVE /* PG0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN0) -#define GPIO_HW_REV_SENSE /* PH4 */ GPIO_ADC3_INP15 -#define GPIO_HW_VER_SENSE /* PH3 */ GPIO_ADC3_INP14 -#define HW_INFO_INIT_PREFIX "ARKV6X" - -#define BOARD_NUM_SPI_CFG_HW_VERSIONS 8 // Rev 0 and Rev 1 -// Base/FMUM -#define ARKV6X00 HW_VER_REV(0x0,0x0) // ARKV6X, Sensor Set Rev 0 -#define ARKV6X01 HW_VER_REV(0x0,0x1) // ARKV6X, Sensor Set Rev 1 -//#define ARKV6X03 HW_VER_REV(0x0,0x3) // ARKV6X, Sensor Set Rev 3 -//#define ARKV6X04 HW_VER_REV(0x0,0x4) // ARKV6X, Sensor Set Rev 4 -#define ARKV6X10 HW_VER_REV(0x1,0x0) // NO PX4IO, Sensor Set Rev 0 -#define ARKV6X11 HW_VER_REV(0x1,0x1) // NO PX4IO, Sensor Set Rev 1 -#define ARKV6X40 HW_VER_REV(0x4,0x0) // ARKV6X, Sensor Set Rev 0 HB CM4 base Rev 3 -#define ARKV6X41 HW_VER_REV(0x4,0x1) // ARKV6X, Sensor Set Rev 1 HB CM4 base Rev 4 -#define ARKV6X50 HW_VER_REV(0x5,0x0) // ARKV6X, Sensor Set Rev 0 HB Mini Rev 5 -#define ARKV6X51 HW_VER_REV(0x5,0x1) // ARKV6X, Sensor Set Rev 1 HB Mini Rev 1 // never shipped - -#define UAVCAN_NUM_IFACES_RUNTIME 1 - -/* HEATER - * PWM in future - */ -#define GPIO_HEATER_OUTPUT /* PB10 T2CH3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN10) -#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true)) - -/* PE6 is nARMED - * The GPIO will be set as input while not armed HW will have external HW Pull UP. - * While armed it shall be configured at a GPIO OUT set LOW - */ -#if !defined(TRACE_PINS) -#define GPIO_nARMED_INIT /* PE6 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN6) -#define GPIO_nARMED /* PE6 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN6) -#define BOARD_INDICATE_EXTERNAL_LOCKOUT_STATE(enabled) px4_arch_configgpio((enabled) ? GPIO_nARMED : GPIO_nARMED_INIT) -#define BOARD_GET_EXTERNAL_LOCKOUT_STATE() px4_arch_gpioread(GPIO_nARMED) -#endif - - -/* PWM - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 8 -#define BOARD_PWM_FREQ 1024000 - -#define GPIO_FMU_CH1 /* PI0 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTI|GPIO_PIN0) -#define GPIO_FMU_CH2 /* PH12 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTH|GPIO_PIN12) -#define GPIO_FMU_CH3 /* PH11 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTH|GPIO_PIN11) -#define GPIO_FMU_CH4 /* PH10 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTH|GPIO_PIN10) -#define GPIO_FMU_CH5 /* PD13 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTD|GPIO_PIN13) -#define GPIO_FMU_CH6 /* PD14 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTD|GPIO_PIN14) -#define GPIO_FMU_CH7 /* PH6 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTH|GPIO_PIN6) -#define GPIO_FMU_CH8 /* PH9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTH|GPIO_PIN9) - -#define GPIO_FMU_CAP /* PE11 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTE|GPIO_PIN11) -#define GPIO_SPIX_SYNC /* PE9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTE|GPIO_PIN9) - -/* Power supply control and monitoring GPIOs */ - -#define GPIO_nPOWER_IN_A /* PG1 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN1) -#define GPIO_nPOWER_IN_B /* PG2 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN2) -#define GPIO_nPOWER_IN_C /* PG3 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN3) - -#define GPIO_nVDD_BRICK1_VALID GPIO_nPOWER_IN_A /* Brick 1 Is Chosen */ -#define GPIO_nVDD_BRICK2_VALID GPIO_nPOWER_IN_B /* Brick 2 Is Chosen */ -#define BOARD_NUMBER_BRICKS 2 -#define BOARD_NUMBER_DIGITAL_BRICKS 2 -#define GPIO_nVDD_USB_VALID GPIO_nPOWER_IN_C /* USB Is Chosen */ - -#define GPIO_VDD_5V_PERIPH_nEN /* PG4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN4) -#define GPIO_VDD_5V_PERIPH_nOC /* PE15 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTE|GPIO_PIN15) -#define GPIO_VDD_5V_HIPOWER_nEN /* PG10 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN10) -#define GPIO_VDD_5V_HIPOWER_nOC /* PF13 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTF|GPIO_PIN13) -#define GPIO_VDD_3V3_SENSORS4_EN /* PG8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN8) -#define GPIO_VDD_3V3_SPEKTRUM_POWER_EN /* PH2 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN2) -#define GPIO_VDD_3V3_SD_CARD_EN /* PC13 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN13) - -/* Spare GPIO */ - -#define GPIO_PG6 /* PG6 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN6) -#define GPIO_PD15 /* PD15 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTD|GPIO_PIN15) - -/* ETHERNET GPIO */ - -#define GPIO_ETH_POWER_EN /* PG15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN15) - -/* NFC GPIO */ - -#define GPIO_NFC_GPIO /* PC0 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTC|GPIO_PIN0) - - -/* Define True logic Power Control in arch agnostic form */ - -#define VDD_5V_PERIPH_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_PERIPH_nEN, !(on_true)) -#define VDD_5V_HIPOWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_HIPOWER_nEN, !(on_true)) -#define VDD_3V3_SENSORS4_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS4_EN, (on_true)) -#define VDD_3V3_SPEKTRUM_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SPEKTRUM_POWER_EN, (on_true)) -#define READ_VDD_3V3_SPEKTRUM_POWER_EN() px4_arch_gpioread(GPIO_VDD_3V3_SPEKTRUM_POWER_EN) -#define VDD_3V3_SD_CARD_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SD_CARD_EN, (on_true)) -#define VDD_3V3_ETH_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_ETH_POWER_EN, (on_true)) - -/* Tone alarm output */ - -#define TONE_ALARM_TIMER 14 /* Timer 14 */ -#define TONE_ALARM_CHANNEL 1 /* PF9 GPIO_TIM14_CH1OUT_2 */ - -#define GPIO_BUZZER_1 /* PF9 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTF|GPIO_PIN9) - -#define GPIO_TONE_ALARM_IDLE GPIO_BUZZER_1 -#define GPIO_TONE_ALARM GPIO_TIM14_CH1OUT_2 - -/* USB OTG FS - * - * PA9 OTG_FS_VBUS VBUS sensing - */ -#define GPIO_OTGFS_VBUS /* PA9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 8 /* use timer8 for the HRT */ -#define HRT_TIMER_CHANNEL 3 /* use capture/compare channel 3 */ - -#define HRT_PPM_CHANNEL /* T8C1 */ 1 /* use capture/compare channel 1 */ -#define GPIO_PPM_IN /* PI5 T8C1 */ GPIO_TIM8_CH1IN_2 - -/* RC Serial port */ - -#define RC_SERIAL_PORT "/dev/ttyS5" - -/* Input Capture Channels. */ -#define INPUT_CAP1_TIMER 1 -#define INPUT_CAP1_CHANNEL /* T1C2 */ 2 -#define GPIO_INPUT_CAP1 /* PE11 */ GPIO_TIM1_CH2IN - -/* PWM input driver. Use FMU AUX5 pins attached to timer4 channel 2 */ -#define PWMIN_TIMER 4 -#define PWMIN_TIMER_CHANNEL /* T4C2 */ 2 -#define GPIO_PWM_IN /* PD13 */ GPIO_TIM4_CH2IN_2 - -/* Safety Switch is HW version dependent on having an PX4IO - * So we init to a benign state with the _INIT definition - * and provide the the non _INIT one for the driver to make a run time - * decision to use it. - */ -#define GPIO_nSAFETY_SWITCH_LED_OUT_INIT /* PD10 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTD|GPIO_PIN10) -#define GPIO_nSAFETY_SWITCH_LED_OUT /* PD10 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTD|GPIO_PIN10) - -/* Enable the FMU to control it if there is no px4io fixme:This should be BOARD_SAFETY_LED(__ontrue) */ -#define GPIO_LED_SAFETY GPIO_nSAFETY_SWITCH_LED_OUT - -#define GPIO_SAFETY_SWITCH_IN /* PF5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTF|GPIO_PIN5) -/* Enable the FMU to use the switch it if there is no px4io fixme:This should be BOARD_SAFTY_BUTTON() */ -#define GPIO_BTN_SAFETY GPIO_SAFETY_SWITCH_IN /* Enable the FMU to control it if there is no px4io */ - -/* Power switch controls ******************************************************/ - -#define SPEKTRUM_POWER(_on_true) VDD_3V3_SPEKTRUM_POWER_EN(_on_true) - -/* - * ARKV6X has a separate RC_IN - * - * GPIO PPM_IN on PI5 T8CH1 - * SPEKTRUM_RX (it's TX or RX in Bind) on UART6 PC7 - * Inversion is possible in the UART and can drive GPIO PPM_IN as an output - */ - -#define GPIO_PPM_IN_AS_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTI|GPIO_PIN5) -#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_PPM_IN_AS_OUT) -#define SPEKTRUM_RX_AS_UART() /* Can be left as uart */ -#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true)) - -#define SDIO_SLOTNO 0 /* Only one slot */ -#define SDIO_MINOR 0 - -/* SD card bringup does not work if performed on the IDLE thread because it - * will cause waiting. Use either: - * - * CONFIG_BOARDCTL=y, OR - * CONFIG_BOARD_INITIALIZE=y && CONFIG_BOARD_INITTHREAD=y - */ - -#if defined(CONFIG_BOARD_INITIALIZE) && !defined(CONFIG_BOARDCTL) && \ - !defined(CONFIG_BOARD_INITTHREAD) -# warning SDIO initialization cannot be perfomed on the IDLE thread -#endif - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID)) - -/* ARKV6X never powers off the Servo rail */ - -#define BOARD_ADC_SERVO_VALID (1) - -#if !defined(BOARD_HAS_LTC44XX_VALIDS) || BOARD_HAS_LTC44XX_VALIDS == 0 -# define BOARD_ADC_BRICK1_VALID (1) -# define BOARD_ADC_BRICK2_VALID (0) -#elif BOARD_HAS_LTC44XX_VALIDS == 1 -# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -# define BOARD_ADC_BRICK2_VALID (0) -#elif BOARD_HAS_LTC44XX_VALIDS == 2 -# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -# define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID)) -#elif BOARD_HAS_LTC44XX_VALIDS == 3 -# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -# define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID)) -# define BOARD_ADC_BRICK3_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK3_VALID)) -#elif BOARD_HAS_LTC44XX_VALIDS == 4 -# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -# define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID)) -# define BOARD_ADC_BRICK3_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK3_VALID)) -# define BOARD_ADC_BRICK4_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK4_VALID)) -#else -# error Unsupported BOARD_HAS_LTC44XX_VALIDS value -#endif - -#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_VDD_5V_PERIPH_nOC)) -#define BOARD_ADC_HIPOWER_5V_OC (!px4_arch_gpioread(GPIO_VDD_5V_HIPOWER_nOC)) - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ - -#define BOARD_HAS_ON_RESET 1 - -#if defined(TRACE_PINS) -#define GPIO_TRACE \ - GPIO_TRACECLK1, \ - GPIO_TRACED0, \ - GPIO_TRACED1, \ - GPIO_TRACED2, \ - GPIO_TRACED3 -#else -#define GPIO_TRACE (GPIO_OUTPUT|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN2) -#endif - -#define PX4_GPIO_INIT_LIST { \ - GPIO_TRACE, \ - 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, \ - GPIO_nPOWER_IN_C, \ - GPIO_VDD_5V_PERIPH_nEN, \ - GPIO_VDD_5V_PERIPH_nOC, \ - GPIO_VDD_5V_HIPOWER_nEN, \ - GPIO_VDD_5V_HIPOWER_nOC, \ - GPIO_VDD_3V3_SENSORS4_EN, \ - GPIO_VDD_3V3_SPEKTRUM_POWER_EN, \ - GPIO_VDD_3V3_SD_CARD_EN, \ - GPIO_PD15, \ - SPI6_nRESET_EXTERNAL1, \ - GPIO_ETH_POWER_EN, \ - GPIO_NFC_GPIO, \ - GPIO_TONE_ALARM_IDLE, \ - GPIO_nSAFETY_SWITCH_LED_OUT_INIT, \ - GPIO_SAFETY_SWITCH_IN, \ - GPIO_PG6, \ - GPIO_nARMED_INIT, \ - GPIO_FMU_CH1, \ - GPIO_FMU_CH2, \ - GPIO_FMU_CH3, \ - GPIO_FMU_CH4, \ - GPIO_FMU_CH5, \ - GPIO_FMU_CH6, \ - GPIO_FMU_CH7, \ - GPIO_FMU_CH8, \ - GPIO_FMU_CAP, \ - GPIO_SPIX_SYNC \ - } - -#define BOARD_ENABLE_CONSOLE_BUFFER - -#define PX4_I2C_BUS_MTD 4,5 - - -#define BOARD_NUM_IO_TIMERS 3 -#define BOARD_SPIX_SYNC_FREQ 32000 - -__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 - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/ark/fmu-v6x/src/bootloader_main.c b/boards/ark/fmu-v6x/src/bootloader_main.c deleted file mode 100644 index 7a3ef5e..0000000 --- a/boards/ark/fmu-v6x/src/bootloader_main.c +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** - * - * 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. - * - ****************************************************************************/ - -/** - * @file bootloader_main.c - * - * FMU-specific early startup code for bootloader -*/ - -#include "board_config.h" -#include "bl.h" - -#include -#include -#include -#include -#include -#include "arm_internal.h" -#include -#include - -extern int sercon_main(int c, char **argv); - -__EXPORT void board_on_reset(int status) {} - -__EXPORT void stm32_boardinitialize(void) -{ - /* configure pins */ - const uint32_t list[] = PX4_GPIO_INIT_LIST; - - for (size_t gpio = 0; gpio < arraySize(list); gpio++) { - if (list[gpio] != 0) { - px4_arch_configgpio(list[gpio]); - } - } - - /* configure USB interfaces */ - stm32_usbinitialize(); -} - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - return 0; -} - -void board_late_initialize(void) -{ - sercon_main(0, NULL); -} - -extern void sys_tick_handler(void); -void board_timerhook(void) -{ - sys_tick_handler(); -} diff --git a/boards/ark/fmu-v6x/src/can.c b/boards/ark/fmu-v6x/src/can.c deleted file mode 100644 index cdebe7a..0000000 --- a/boards/ark/fmu-v6x/src/can.c +++ /dev/null @@ -1,142 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file can.c - * - * Board-specific CAN functions. - */ - -#if !defined(CONFIG_CAN) - -#include - -#include "board_config.h" - - -__EXPORT -uint16_t board_get_can_interfaces(void) -{ - uint16_t enabled_interfaces = 0x3; - - if (!PX4_MFT_HW_SUPPORTED(PX4_MFT_CAN2)) { - enabled_interfaces &= ~(1 << 1); - } - - return enabled_interfaces; -} - -#else - -#include -#include - -#include -#include - -#include "chip.h" -#include "arm_internal.h" - -#include "chip.h" -#include "stm32_can.h" -#include "board_config.h" - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) -# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." -# undef CONFIG_STM32_CAN2 -#endif - -#ifdef CONFIG_STM32_CAN1 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); - -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} -#endif /* CONFIG_CAN */ diff --git a/boards/ark/fmu-v6x/src/hw_config.h b/boards/ark/fmu-v6x/src/hw_config.h deleted file mode 100644 index 3a0205c..0000000 --- a/boards/ark/fmu-v6x/src/hw_config.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * hw_config.h - * - * Created on: May 17, 2015 - * Author: david_s5 - */ - -#ifndef HW_CONFIG_H_ -#define HW_CONFIG_H_ - -/**************************************************************************** - * 10-8--2016: - * To simplify the ripple effect on the tools, we will be using - * /dev/serial/by-id/PX4 to locate PX4 devices. Therefore - * moving forward all Bootloaders must contain the prefix "PX4 BL " - * in the USBDEVICESTRING - * This Change will be made in an upcoming BL release - ****************************************************************************/ -/* - * Define usage to configure a bootloader - * - * - * Constant example Usage - * APP_LOAD_ADDRESS 0x08004000 - The address in Linker Script, where the app fw is org-ed - * BOOTLOADER_DELAY 5000 - Ms to wait while under USB pwr or bootloader request - * BOARD_FMUV2 - * INTERFACE_USB 1 - (Optional) Scan and use the USB interface for bootloading - * INTERFACE_USART 1 - (Optional) Scan and use the Serial interface for bootloading - * USBDEVICESTRING "PX4 BL FMU v2.x" - USB id string - * USBPRODUCTID 0x0011 - PID Should match defconfig - * BOOT_DELAY_ADDRESS 0x000001a0 - (Optional) From the linker script from Linker Script to get a custom - * delay provided by an APP FW - * BOARD_TYPE 9 - Must match .prototype boad_id - * _FLASH_KBYTES (*(uint16_t *)0x1fff7a22) - Run time flash size detection - * BOARD_FLASH_SECTORS ((_FLASH_KBYTES == 0x400) ? 11 : 23) - Run time determine the physical last sector - * BOARD_FLASH_SECTORS 11 - Hard coded zero based last sector - * BOARD_FLASH_SIZE (_FLASH_KBYTES*1024)- Total Flash size of device, determined at run time. - * (1024 * 1024) - Hard coded Total Flash of device - The bootloader and app reserved will be deducted - * programmatically - * - * BOARD_FIRST_FLASH_SECTOR_TO_ERASE 2 - Optional sectors index in the flash_sectors table (F4 only), to begin erasing. - * This is to allow sectors to be reserved for app fw usage. That will NOT be erased - * during a FW upgrade. - * The default is 0, and selects the first sector to be erased, as the 0th entry in the - * flash_sectors table. Which is the second physical sector of FLASH in the device. - * The first physical sector of FLASH is used by the bootloader, and is not defined - * in the table. - * - * APP_RESERVATION_SIZE (BOARD_FIRST_FLASH_SECTOR_TO_ERASE * 16 * 1024) - Number of bytes reserved by the APP FW. This number plus - * BOOTLOADER_RESERVATION_SIZE will be deducted from - * BOARD_FLASH_SIZE to determine the size of the App FW - * and hence the address space of FLASH to erase and program. - * USBMFGSTRING "PX4 AP" - Optional USB MFG string (default is '3D Robotics' if not defined.) - * SERIAL_BREAK_DETECT_DISABLED - Optional prevent break selection on Serial port from entering or staying in BL - * - * * Other defines are somewhat self explanatory. - */ - -/* Boot device selection list*/ -#define USB0_DEV 0x01 -#define SERIAL0_DEV 0x02 -#define SERIAL1_DEV 0x04 - -#define APP_LOAD_ADDRESS 0x08020000 -#define BOOTLOADER_DELAY 5000 -#define INTERFACE_USB 1 -#define INTERFACE_USB_CONFIG "/dev/ttyACM0" -#define BOARD_VBUS MK_GPIO_INPUT(GPIO_OTGFS_VBUS) - -//#define USE_VBUS_PULL_DOWN -#define INTERFACE_USART 1 -#define INTERFACE_USART_CONFIG "/dev/ttyS0,115200" -#define BOOT_DELAY_ADDRESS 0x000001a0 -#define BOARD_TYPE 57 -#define _FLASH_KBYTES (*(uint32_t *)0x1FF1E880) -#define BOARD_FLASH_SECTORS (15) -#define BOARD_FLASH_SIZE (_FLASH_KBYTES * 1024) - -#define OSC_FREQ 16 - -#define BOARD_PIN_LED_ACTIVITY GPIO_nLED_BLUE // BLUE -#define BOARD_PIN_LED_BOOTLOADER GPIO_nLED_GREEN // GREEN -#define BOARD_LED_ON 0 -#define BOARD_LED_OFF 1 - -#define SERIAL_BREAK_DETECT_DISABLED 1 - -/* - * Uncommenting this allows to force the bootloader through - * a PWM output pin. As this can accidentally initialize - * an ESC prematurely, it is not recommended. This feature - * has not been used and hence defaults now to off. - * - * # define BOARD_FORCE_BL_PIN_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN14) - * # define BOARD_FORCE_BL_PIN_IN (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN11) - * - * # define BOARD_POWER_PIN_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN4) - * # define BOARD_POWER_ON 1 - * # define BOARD_POWER_OFF 0 - * # undef BOARD_POWER_PIN_RELEASE // Leave pin enabling Power - un comment to release (disable power) - * -*/ - -#if !defined(ARCH_SN_MAX_LENGTH) -# define ARCH_SN_MAX_LENGTH 12 -#endif - -#if !defined(APP_RESERVATION_SIZE) -# define APP_RESERVATION_SIZE 0 -#endif - -#if !defined(BOARD_FIRST_FLASH_SECTOR_TO_ERASE) -# define BOARD_FIRST_FLASH_SECTOR_TO_ERASE 1 -#endif - -#if !defined(USB_DATA_ALIGN) -# define USB_DATA_ALIGN -#endif - -#ifndef BOOT_DEVICES_SELECTION -# define BOOT_DEVICES_SELECTION USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif - -#ifndef BOOT_DEVICES_FILTER_ONUSB -# define BOOT_DEVICES_FILTER_ONUSB USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif - -#endif /* HW_CONFIG_H_ */ diff --git a/boards/ark/fmu-v6x/src/i2c.cpp b/boards/ark/fmu-v6x/src/i2c.cpp deleted file mode 100644 index eb200ca..0000000 --- a/boards/ark/fmu-v6x/src/i2c.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** - * - * 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), - initI2CBusExternal(2), - initI2CBusExternal(3), - initI2CBusInternal(4), -}; diff --git a/boards/ark/fmu-v6x/src/init.c b/boards/ark/fmu-v6x/src/init.c deleted file mode 100644 index 56c94f8..0000000 --- a/boards/ark/fmu-v6x/src/init.c +++ /dev/null @@ -1,293 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * ARKFMU-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include "board_config.h" -#include "spix_sync.h" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* Configuration ************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - /* set the peripheral rails off */ - - VDD_5V_HIPOWER_EN(false); - VDD_5V_PERIPH_EN(false); - board_control_spi_sensors_power(false, 0xffff); - VDD_3V3_SENSORS4_EN(false); - SPI6_RESET(true); - - bool last = READ_VDD_3V3_SPEKTRUM_POWER_EN(); - /* Keep Spektum on to discharge rail*/ - VDD_3V3_SPEKTRUM_POWER_EN(false); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ - VDD_3V3_SPEKTRUM_POWER_EN(last); - board_control_spi_sensors_power(true, 0xffff); - VDD_3V3_SENSORS4_EN(true); - VDD_5V_HIPOWER_EN(true); - VDD_5V_PERIPH_EN(true); - - /* Release SPI6 Reset */ - SPI6_RESET(false); -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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 USB interfaces */ - - stm32_usbinitialize(); - - VDD_3V3_ETH_POWER_EN(true); - -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Power on Interfaces */ - VDD_5V_PERIPH_EN(true); - VDD_5V_HIPOWER_EN(true); - VDD_3V3_SENSORS4_EN(true); - VDD_3V3_SPEKTRUM_POWER_EN(true); - - SPI6_RESET(false); - - /* Need hrt running before using the ADC */ - - px4_platform_init(); - - // Use the default HW_VER_REV(0x0,0x0) for Ramtron - - stm32_spiinitialize(); - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - if (OK == board_determine_hw_info()) { - syslog(LOG_INFO, "[boot] Rev 0x%1x : Ver 0x%1x %s\n", board_get_hw_revision(), board_get_hw_version(), - board_get_hw_type_name()); - - } else { - syslog(LOG_ERR, "[boot] Failed to read HW revision and version\n"); - } - - /* Configure the Actual SPI interfaces (after we determined the HW version) */ - - stm32_spiinitialize(); - - board_spi_reset(10, 0xffff); - - /* Configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_on(LED_GREEN); // Indicate Power. - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - - // Ensure Power is off for > 10 mS - usleep(15 * 1000); - VDD_3V3_SD_CARD_EN(true); - usleep(500 * 1000); - -#ifdef CONFIG_MMCSD - int ret = stm32_sdio_initialize(); - - if (ret != OK) { - led_on(LED_RED); - return ret; - } - -#endif /* CONFIG_MMCSD */ - - /* Configure the SPIX_SYNC output */ - spix_sync_servo_init(BOARD_SPIX_SYNC_FREQ); - spix_sync_servo_set(0, 150); - - return OK; -} diff --git a/boards/ark/fmu-v6x/src/led.c b/boards/ark/fmu-v6x/src/led.c deleted file mode 100644 index 7730150..0000000 --- a/boards/ark/fmu-v6x/src/led.c +++ /dev/null @@ -1,235 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * ARKFMU LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -#ifdef CONFIG_ARCH_LEDS -static bool nuttx_owns_leds = true; -// B R S G -// 0 1 2 3 -static const uint8_t xlatpx4[] = {1, 2, 4, 0}; -# define xlat(p) xlatpx4[(p)] -static uint32_t g_ledmap[] = { - GPIO_nLED_GREEN, // Indexed by BOARD_LED_GREEN - GPIO_nLED_BLUE, // Indexed by BOARD_LED_BLUE - GPIO_nLED_RED, // Indexed by BOARD_LED_RED - GPIO_nSAFETY_SWITCH_LED_OUT, // Indexed by LED_SAFETY by xlatpx4 -}; - -#else - -# define xlat(p) (p) -static uint32_t g_ledmap[] = { - GPIO_nLED_BLUE, // Indexed by LED_BLUE - GPIO_nLED_RED, // Indexed by LED_RED, LED_AMBER - 0, // Indexed by LED_SAFETY (defaulted to an input) - GPIO_nLED_GREEN, // Indexed by LED_GREEN -}; - -#endif - -__EXPORT void led_init(void) -{ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - if (g_ledmap[l] != 0) { - stm32_configgpio(g_ledmap[l]); - } - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - - if (g_ledmap[led] != 0) { - stm32_gpiowrite(g_ledmap[led], !state); - } -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - if (g_ledmap[led] != 0) { - return !stm32_gpioread(g_ledmap[led]); - } - - return false; -} - -__EXPORT void led_on(int led) -{ - phy_set_led(xlat(led), true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(xlat(led), false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(xlat(led), !phy_get_led(xlat(led))); -} - -#ifdef CONFIG_ARCH_LEDS -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_autoled_initialize - ****************************************************************************/ - -void board_autoled_initialize(void) -{ - led_init(); -} - -/**************************************************************************** - * Name: board_autoled_on - ****************************************************************************/ - -void board_autoled_on(int led) -{ - if (!nuttx_owns_leds) { - return; - } - - switch (led) { - default: - break; - - case LED_HEAPALLOCATE: - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_IRQSENABLED: - phy_set_led(BOARD_LED_BLUE, false); - phy_set_led(BOARD_LED_GREEN, true); - break; - - case LED_STACKCREATED: - phy_set_led(BOARD_LED_GREEN, true); - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_INIRQ: - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_SIGNAL: - phy_set_led(BOARD_LED_GREEN, true); - break; - - case LED_ASSERTION: - phy_set_led(BOARD_LED_RED, true); - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_PANIC: - phy_set_led(BOARD_LED_RED, true); - break; - - case LED_IDLE : /* IDLE */ - phy_set_led(BOARD_LED_RED, true); - break; - } -} - -/**************************************************************************** - * Name: board_autoled_off - ****************************************************************************/ - -void board_autoled_off(int led) -{ - if (!nuttx_owns_leds) { - return; - } - - switch (led) { - default: - break; - - case LED_SIGNAL: - phy_set_led(BOARD_LED_GREEN, false); - break; - - case LED_INIRQ: - phy_set_led(BOARD_LED_BLUE, false); - break; - - case LED_ASSERTION: - phy_set_led(BOARD_LED_RED, false); - phy_set_led(BOARD_LED_BLUE, false); - break; - - case LED_PANIC: - phy_set_led(BOARD_LED_RED, false); - break; - - case LED_IDLE : /* IDLE */ - phy_set_led(BOARD_LED_RED, false); - break; - } -} - -#endif /* CONFIG_ARCH_LEDS */ diff --git a/boards/ark/fmu-v6x/src/manifest.c b/boards/ark/fmu-v6x/src/manifest.c deleted file mode 100644 index f4e012b..0000000 --- a/boards/ark/fmu-v6x/src/manifest.c +++ /dev/null @@ -1,216 +0,0 @@ -/**************************************************************************** - * - * 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. - * - ****************************************************************************/ - -/** - * @file manifest.c - * - * This module supplies the interface to the manifest of hardware that is - * optional and dependent on the HW REV and HW VER IDs - * - * The manifest allows the system to know whether a hardware option - * say for example the PX4IO is an no-pop option vs it is broken. - * - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include - -#include "systemlib/px4_macros.h" - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -typedef struct { - uint32_t hw_ver_rev; /* the version and revision */ - const px4_hw_mft_item_t *mft; /* The first entry */ - uint32_t entries; /* the lenght of the list */ -} px4_hw_mft_list_entry_t; - -typedef px4_hw_mft_list_entry_t *px4_hw_mft_list_entry; -#define px4_hw_mft_list_uninitialized (px4_hw_mft_list_entry) -1 - -static const px4_hw_mft_item_t device_unsupported = {0, 0, 0}; - -// List of components on a specific board configuration -// The index of those components is given by the enum (px4_hw_mft_item_id_t) -// declared in board_common.h -static const px4_hw_mft_item_t hw_mft_list_v0600[] = { - { - // PX4_MFT_PX4IO - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, - { - // PX4_MFT_USB - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, - { - // PX4_MFT_CAN2 - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, -}; - -static const px4_hw_mft_item_t hw_mft_list_v0610[] = { - { - // PX4_MFT_PX4IO - .present = 0, - .mandatory = 0, - .connection = px4_hw_con_unknown, - }, - { - // PX4_MFT_USB - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, - { - // PX4_MFT_CAN2 - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, -}; - -static const px4_hw_mft_item_t hw_mft_list_v0640[] = { - { - // PX4_MFT_PX4IO - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, - { - // PX4_MFT_USB - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, - { - // PX4_MFT_CAN2 - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, -}; - -static const px4_hw_mft_item_t hw_mft_list_v0650[] = { - { - // PX4_MFT_PX4IO - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_unknown, - }, - { - // PX4_MFT_USB - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, - { - // PX4_MFT_CAN2 - .present = 0, - .mandatory = 0, - .connection = px4_hw_con_unknown, - }, -}; - - -static px4_hw_mft_list_entry_t mft_lists[] = { -// ver_rev - {ARKV6X00, hw_mft_list_v0600, arraySize(hw_mft_list_v0600)}, // ARKV6X, Sensor Set Rev 0 - {ARKV6X01, hw_mft_list_v0600, arraySize(hw_mft_list_v0600)}, // ARKV6X, Sensor Set Rev 1 - {ARKV6X10, hw_mft_list_v0610, arraySize(hw_mft_list_v0610)}, // NO PX4IO, Sensor Set Rev 0 - {ARKV6X11, hw_mft_list_v0610, arraySize(hw_mft_list_v0610)}, // NO PX4IO, Sensor Set Rev 1 - {ARKV6X40, hw_mft_list_v0640, arraySize(hw_mft_list_v0640)}, // ARKV6X, Sensor Set Rev 0 HB CM4 base Rev 3 - {ARKV6X41, hw_mft_list_v0640, arraySize(hw_mft_list_v0640)}, // ARKV6X, Sensor Set Rev 1 HB CM4 base Rev 4 - {ARKV6X50, hw_mft_list_v0650, arraySize(hw_mft_list_v0650)}, // ARKV6X, Sensor Set Rev 0 HB Mini Rev 5 - {ARKV6X51, hw_mft_list_v0650, arraySize(hw_mft_list_v0650)}, // ARKV6X, Sensor Set Rev 1 HB Mini Rev 1 // never shipped -}; - -/************************************************************************************ - * Name: board_query_manifest - * - * Description: - * Optional returns manifest item. - * - * Input Parameters: - * manifest_id - the ID for the manifest item to retrieve - * - * Returned Value: - * 0 - item is not in manifest => assume legacy operations - * pointer to a manifest item - * - ************************************************************************************/ - -__EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) -{ - static px4_hw_mft_list_entry boards_manifest = px4_hw_mft_list_uninitialized; - - if (boards_manifest == px4_hw_mft_list_uninitialized) { - uint32_t ver_rev = board_get_hw_version() << 16; - ver_rev |= board_get_hw_revision(); - - for (unsigned i = 0; i < arraySize(mft_lists); i++) { - if (mft_lists[i].hw_ver_rev == ver_rev) { - boards_manifest = &mft_lists[i]; - break; - } - } - - if (boards_manifest == px4_hw_mft_list_uninitialized) { - syslog(LOG_ERR, "[boot] Board %08" PRIx32 " is not supported!\n", ver_rev); - } - } - - px4_hw_mft_item rv = &device_unsupported; - - if (boards_manifest != px4_hw_mft_list_uninitialized && - id < boards_manifest->entries) { - rv = &boards_manifest->mft[id]; - } - - return rv; -} diff --git a/boards/ark/fmu-v6x/src/mtd.cpp b/boards/ark/fmu-v6x/src/mtd.cpp deleted file mode 100644 index 3ece10a..0000000 --- a/boards/ark/fmu-v6x/src/mtd.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** - * - * 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 -#include -// KiB BS nB -static const px4_mft_device_t spi5 = { // FM25V02A on FMUM 32K 512 X 64 - .bus_type = px4_mft_device_t::SPI, - .devid = SPIDEV_FLASH(0) -}; -static const px4_mft_device_t i2c3 = { // 24LC64T on Base 8K 32 X 256 - .bus_type = px4_mft_device_t::I2C, - .devid = PX4_MK_I2C_DEVID(3, 0x51) -}; - -static const px4_mtd_entry_t fmum_fram = { - .device = &spi5, - .npart = 2, - .partd = { - { - .type = MTD_PARAMETERS, - .path = "/fs/mtd_params", - .nblocks = 32 - }, - { - .type = MTD_WAYPOINTS, - .path = "/fs/mtd_waypoints", - .nblocks = 32 - - } - }, -}; - -static const px4_mtd_entry_t base_eeprom = { - .device = &i2c3, - .npart = 2, - .partd = { - { - .type = MTD_MFT_VER, - .path = "/fs/mtd_mft_ver", - .nblocks = 248 - }, - { - .type = MTD_NET, - .path = "/fs/mtd_net", - .nblocks = 8 // 256 = 32 * 8 - - } - }, -}; - -static const px4_mtd_manifest_t board_mtd_config = { - .nconfigs = 2, - .entries = { - &fmum_fram, - &base_eeprom, - } -}; - -static const px4_mft_entry_s mtd_mft = { - .type = MTD, - .pmft = (void *) &board_mtd_config, -}; - -static const px4_mft_s mft = { - .nmft = 1, - .mfts = { - &mtd_mft - } -}; - -const px4_mft_s *board_get_manifest(void) -{ - return &mft; -} diff --git a/boards/ark/fmu-v6x/src/sdio.c b/boards/ark/fmu-v6x/src/sdio.c deleted file mode 100644 index 869d757..0000000 --- a/boards/ark/fmu-v6x/src/sdio.c +++ /dev/null @@ -1,177 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include "chip.h" -#include "board_config.h" -#include "stm32_gpio.h" -#include "stm32_sdmmc.h" - -#ifdef CONFIG_MMCSD - - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Card detections requires card support and a card detection GPIO */ - -#define HAVE_NCD 1 -#if !defined(GPIO_SDMMC1_NCD) -# undef HAVE_NCD -#endif - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -static FAR struct sdio_dev_s *sdio_dev; -#ifdef HAVE_NCD -static bool g_sd_inserted = 0xff; /* Impossible value */ -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_ncd_interrupt - * - * Description: - * Card detect interrupt handler. - * - ****************************************************************************/ - -#ifdef HAVE_NCD -static int stm32_ncd_interrupt(int irq, FAR void *context) -{ - bool present; - - present = !stm32_gpioread(GPIO_SDMMC1_NCD); - - if (sdio_dev && present != g_sd_inserted) { - sdio_mediachange(sdio_dev, present); - g_sd_inserted = present; - } - - return OK; -} -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_sdio_initialize - * - * Description: - * Initialize SDIO-based MMC/SD card support - * - ****************************************************************************/ - -int stm32_sdio_initialize(void) -{ - int ret; - -#ifdef HAVE_NCD - /* Card detect */ - - bool cd_status; - - /* Configure the card detect GPIO */ - - stm32_configgpio(GPIO_SDMMC1_NCD); - - /* Register an interrupt handler for the card detect pin */ - - stm32_gpiosetevent(GPIO_SDMMC1_NCD, true, true, true, stm32_ncd_interrupt); -#endif - - /* Mount the SDIO-based MMC/SD block driver */ - /* First, get an instance of the SDIO interface */ - - finfo("Initializing SDIO slot %d\n", SDIO_SLOTNO); - - sdio_dev = sdio_initialize(SDIO_SLOTNO); - - if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", SDIO_SLOTNO); - return -ENODEV; - } - - /* Now bind the SDIO interface to the MMC/SD driver */ - - finfo("Bind SDIO to the MMC/SD driver, minor=%d\n", SDIO_MINOR); - - ret = mmcsd_slotinitialize(SDIO_MINOR, sdio_dev); - - if (ret != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); - return ret; - } - - finfo("Successfully bound SDIO to the MMC/SD driver\n"); - -#ifdef HAVE_NCD - /* Use SD card detect pin to check if a card is g_sd_inserted */ - - cd_status = !stm32_gpioread(GPIO_SDMMC1_NCD); - finfo("Card detect : %d\n", cd_status); - - sdio_mediachange(sdio_dev, cd_status); -#else - /* Assume that the SD card is inserted. What choice do we have? */ - - sdio_mediachange(sdio_dev, true); -#endif - - return OK; -} - -#endif /* CONFIG_MMCSD */ diff --git a/boards/ark/fmu-v6x/src/spi.cpp b/boards/ark/fmu-v6x/src/spi.cpp deleted file mode 100644 index f83a5a9..0000000 --- a/boards/ark/fmu-v6x/src/spi.cpp +++ /dev/null @@ -1,224 +0,0 @@ -/**************************************************************************** - * - * 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 -#include -#include - -constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSIONS] = { - initSPIHWVersion(ARKV6X00, { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_IIM42652, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}), - }, {GPIO::PortI, GPIO::Pin11}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortA, GPIO::Pin10}), - }, {GPIO::PortF, GPIO::Pin4}), - initSPIBus(SPI::Bus::SPI3, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortI, GPIO::Pin4}, SPI::DRDY{GPIO::PortI, GPIO::Pin6}), - }, {GPIO::PortE, GPIO::Pin7}), - // initSPIBus(SPI::Bus::SPI4, { - // // no devices - // TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h - // }, {GPIO::PortG, GPIO::Pin8}), - initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7}) - }), - initSPIBusExternal(SPI::Bus::SPI6, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}, SPI::DRDY{GPIO::PortD, GPIO::Pin11}), - initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}), - }), - }), - - initSPIHWVersion(ARKV6X01, { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_IIM42653, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}), - }, {GPIO::PortI, GPIO::Pin11}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_IMU_DEVTYPE_IIM42653, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortA, GPIO::Pin10}), - }, {GPIO::PortF, GPIO::Pin4}), - initSPIBus(SPI::Bus::SPI3, { - initSPIDevice(DRV_IMU_DEVTYPE_IIM42653, SPI::CS{GPIO::PortI, GPIO::Pin4}, SPI::DRDY{GPIO::PortI, GPIO::Pin6}), - }, {GPIO::PortE, GPIO::Pin7}), - // initSPIBus(SPI::Bus::SPI4, { - // // no devices - // TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h - // }, {GPIO::PortG, GPIO::Pin8}), - initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7}) - }), - initSPIBusExternal(SPI::Bus::SPI6, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}, SPI::DRDY{GPIO::PortD, GPIO::Pin11}), - initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}), - }), - }), - - initSPIHWVersion(ARKV6X10, { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_IIM42652, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}), - }, {GPIO::PortI, GPIO::Pin11}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortA, GPIO::Pin10}), - }, {GPIO::PortF, GPIO::Pin4}), - initSPIBus(SPI::Bus::SPI3, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortI, GPIO::Pin4}, SPI::DRDY{GPIO::PortI, GPIO::Pin6}), - }, {GPIO::PortE, GPIO::Pin7}), - // initSPIBus(SPI::Bus::SPI4, { - // // no devices - // TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h - // }, {GPIO::PortG, GPIO::Pin8}), - initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7}) - }), - initSPIBusExternal(SPI::Bus::SPI6, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}, SPI::DRDY{GPIO::PortD, GPIO::Pin11}), - initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}), - }), - }), - - initSPIHWVersion(ARKV6X11, { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_IIM42653, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}), - }, {GPIO::PortI, GPIO::Pin11}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_IMU_DEVTYPE_IIM42653, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortA, GPIO::Pin10}), - }, {GPIO::PortF, GPIO::Pin4}), - initSPIBus(SPI::Bus::SPI3, { - initSPIDevice(DRV_IMU_DEVTYPE_IIM42653, SPI::CS{GPIO::PortI, GPIO::Pin4}, SPI::DRDY{GPIO::PortI, GPIO::Pin6}), - }, {GPIO::PortE, GPIO::Pin7}), - // initSPIBus(SPI::Bus::SPI4, { - // // no devices - // TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h - // }, {GPIO::PortG, GPIO::Pin8}), - initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7}) - }), - initSPIBusExternal(SPI::Bus::SPI6, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}, SPI::DRDY{GPIO::PortD, GPIO::Pin11}), - initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}), - }), - }), - - initSPIHWVersion(ARKV6X40, { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_IIM42652, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}), - }, {GPIO::PortI, GPIO::Pin11}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortA, GPIO::Pin10}), - }, {GPIO::PortF, GPIO::Pin4}), - initSPIBus(SPI::Bus::SPI3, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortI, GPIO::Pin4}, SPI::DRDY{GPIO::PortI, GPIO::Pin6}), - }, {GPIO::PortE, GPIO::Pin7}), - // initSPIBus(SPI::Bus::SPI4, { - // // no devices - // TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h - // }, {GPIO::PortG, GPIO::Pin8}), - initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7}) - }), - initSPIBusExternal(SPI::Bus::SPI6, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}, SPI::DRDY{GPIO::PortD, GPIO::Pin11}), - initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}), - }), - }), - - initSPIHWVersion(ARKV6X41, { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_IIM42653, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}), - }, {GPIO::PortI, GPIO::Pin11}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_IMU_DEVTYPE_IIM42653, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortA, GPIO::Pin10}), - }, {GPIO::PortF, GPIO::Pin4}), - initSPIBus(SPI::Bus::SPI3, { - initSPIDevice(DRV_IMU_DEVTYPE_IIM42653, SPI::CS{GPIO::PortI, GPIO::Pin4}, SPI::DRDY{GPIO::PortI, GPIO::Pin6}), - }, {GPIO::PortE, GPIO::Pin7}), - // initSPIBus(SPI::Bus::SPI4, { - // // no devices - // TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h - // }, {GPIO::PortG, GPIO::Pin8}), - initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7}) - }), - initSPIBusExternal(SPI::Bus::SPI6, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}, SPI::DRDY{GPIO::PortD, GPIO::Pin11}), - initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}), - }), - }), - - initSPIHWVersion(ARKV6X50, { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_IIM42652, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}), - }, {GPIO::PortI, GPIO::Pin11}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortA, GPIO::Pin10}), - }, {GPIO::PortF, GPIO::Pin4}), - initSPIBus(SPI::Bus::SPI3, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortI, GPIO::Pin4}, SPI::DRDY{GPIO::PortI, GPIO::Pin6}), - }, {GPIO::PortE, GPIO::Pin7}), - // initSPIBus(SPI::Bus::SPI4, { - // // no devices - // TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h - // }, {GPIO::PortG, GPIO::Pin8}), - initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7}) - }), - initSPIBusExternal(SPI::Bus::SPI6, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}, SPI::DRDY{GPIO::PortD, GPIO::Pin11}), - initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}), - }), - }), - - initSPIHWVersion(ARKV6X51, { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_IIM42653, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}), - }, {GPIO::PortI, GPIO::Pin11}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_IMU_DEVTYPE_IIM42653, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortA, GPIO::Pin10}), - }, {GPIO::PortF, GPIO::Pin4}), - initSPIBus(SPI::Bus::SPI3, { - initSPIDevice(DRV_IMU_DEVTYPE_IIM42653, SPI::CS{GPIO::PortI, GPIO::Pin4}, SPI::DRDY{GPIO::PortI, GPIO::Pin6}), - }, {GPIO::PortE, GPIO::Pin7}), - // initSPIBus(SPI::Bus::SPI4, { - // // no devices - // TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h - // }, {GPIO::PortG, GPIO::Pin8}), - initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7}) - }), - initSPIBusExternal(SPI::Bus::SPI6, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}, SPI::DRDY{GPIO::PortD, GPIO::Pin11}), - initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}), - }), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses_all_hw); diff --git a/boards/ark/fmu-v6x/src/spix_sync.c b/boards/ark/fmu-v6x/src/spix_sync.c deleted file mode 100644 index 2bda386..0000000 --- a/boards/ark/fmu-v6x/src/spix_sync.c +++ /dev/null @@ -1,311 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2023 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 Airmind 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. - * - ****************************************************************************/ - -/** -* @file spix_sync.c -* -* -*/ - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#include -#include -#include - -#include - -#include "spix_sync.h" - -#define REG(_tmr, _reg) (*(volatile uint32_t *)(spix_sync_timers[_tmr].base + _reg)) - -#define rCR1(_tmr) REG(_tmr, STM32_GTIM_CR1_OFFSET) -#define rCR2(_tmr) REG(_tmr, STM32_GTIM_CR2_OFFSET) -#define rSMCR(_tmr) REG(_tmr, STM32_GTIM_SMCR_OFFSET) -#define rDIER(_tmr) REG(_tmr, STM32_GTIM_DIER_OFFSET) -#define rSR(_tmr) REG(_tmr, STM32_GTIM_SR_OFFSET) -#define rEGR(_tmr) REG(_tmr, STM32_GTIM_EGR_OFFSET) -#define rCCMR1(_tmr) REG(_tmr, STM32_GTIM_CCMR1_OFFSET) -#define rCCMR2(_tmr) REG(_tmr, STM32_GTIM_CCMR2_OFFSET) -#define rCCER(_tmr) REG(_tmr, STM32_GTIM_CCER_OFFSET) -#define rCNT(_tmr) REG(_tmr, STM32_GTIM_CNT_OFFSET) -#define rPSC(_tmr) REG(_tmr, STM32_GTIM_PSC_OFFSET) -#define rARR(_tmr) REG(_tmr, STM32_GTIM_ARR_OFFSET) -#define rCCR1(_tmr) REG(_tmr, STM32_GTIM_CCR1_OFFSET) -#define rCCR2(_tmr) REG(_tmr, STM32_GTIM_CCR2_OFFSET) -#define rCCR3(_tmr) REG(_tmr, STM32_GTIM_CCR3_OFFSET) -#define rCCR4(_tmr) REG(_tmr, STM32_GTIM_CCR4_OFFSET) -#define rDCR(_tmr) REG(_tmr, STM32_GTIM_DCR_OFFSET) -#define rDMAR(_tmr) REG(_tmr, STM32_GTIM_DMAR_OFFSET) -#define rBDTR(_tmr) REG(_tmr, STM32_ATIM_BDTR_OFFSET) - -#if !defined(BOARD_PWM_FREQ) -#define BOARD_PWM_FREQ 1000000 -#endif - -unsigned -spix_sync_timer_get_period(unsigned timer) -{ - return (rARR(timer)); -} - -static void spix_sync_timer_init_timer(unsigned timer, unsigned rate) -{ - if (spix_sync_timers[timer].base) { - - irqstate_t flags = px4_enter_critical_section(); - - /* enable the timer clock before we try to talk to it */ - - modifyreg32(spix_sync_timers[timer].clock_register, 0, spix_sync_timers[timer].clock_bit); - - /* disable and configure the timer */ - rCR1(timer) = 0; - rCR2(timer) = 0; - rSMCR(timer) = 0; - rDIER(timer) = 0; - rCCER(timer) = 0; - rCCMR1(timer) = 0; - rCCMR2(timer) = 0; - rCCR1(timer) = 0; - rCCR2(timer) = 0; - rCCR3(timer) = 0; - rCCR4(timer) = 0; - rCCER(timer) = 0; - rDCR(timer) = 0; - - if ((spix_sync_timers[timer].base == STM32_TIM1_BASE) || (spix_sync_timers[timer].base == STM32_TIM8_BASE)) { - - /* master output enable = on */ - - rBDTR(timer) = ATIM_BDTR_MOE; - } - - /* If the timer clock source provided as clock_freq is the STM32_APBx_TIMx_CLKIN - * then configure the timer to free-run at 1MHz. - * Otherwise, other frequencies are attainable by adjusting .clock_freq accordingly. - */ - - rPSC(timer) = (spix_sync_timers[timer].clock_freq / BOARD_PWM_FREQ) - 1; - - /* configure the timer to update at the desired rate */ - - rARR(timer) = (BOARD_PWM_FREQ / rate) - 1; - - /* generate an update event; reloads the counter and all registers */ - rEGR(timer) = GTIM_EGR_UG; - - px4_leave_critical_section(flags); - } - -} - -void spix_sync_channel_init(unsigned channel) -{ - /* Only initialize used channels */ - - if (spix_sync_channels[channel].timer_channel) { - - unsigned timer = spix_sync_channels[channel].timer_index; - - /* configure the GPIO first */ - px4_arch_configgpio(spix_sync_channels[channel].gpio_out); - - uint16_t polarity = spix_sync_channels[channel].masks; - - /* configure the channel */ - switch (spix_sync_channels[channel].timer_channel) { - case 1: - rCCMR1(timer) |= (GTIM_CCMR_MODE_PWM1 << GTIM_CCMR1_OC1M_SHIFT) | GTIM_CCMR1_OC1PE; - rCCER(timer) |= polarity | GTIM_CCER_CC1E; - break; - - case 2: - rCCMR1(timer) |= (GTIM_CCMR_MODE_PWM1 << GTIM_CCMR1_OC2M_SHIFT) | GTIM_CCMR1_OC2PE; - rCCER(timer) |= polarity | GTIM_CCER_CC2E; - break; - - case 3: - rCCMR2(timer) |= (GTIM_CCMR_MODE_PWM1 << GTIM_CCMR2_OC3M_SHIFT) | GTIM_CCMR2_OC3PE; - rCCER(timer) |= polarity | GTIM_CCER_CC3E; - break; - - case 4: - rCCMR2(timer) |= (GTIM_CCMR_MODE_PWM1 << GTIM_CCMR2_OC4M_SHIFT) | GTIM_CCMR2_OC4PE; - rCCER(timer) |= polarity | GTIM_CCER_CC4E; - break; - } - } -} - -int -spix_sync_servo_set(unsigned channel, uint8_t cvalue) -{ - if (channel >= arraySize(spix_sync_channels)) { - return -1; - } - - unsigned timer = spix_sync_channels[channel].timer_index; - - /* test timer for validity */ - if ((spix_sync_timers[timer].base == 0) || - (spix_sync_channels[channel].gpio_out == 0)) { - return -1; - } - - unsigned period = spix_sync_timer_get_period(timer); - - unsigned value = (unsigned)cvalue * period / 255; - - /* configure the channel */ - if (value > 0) { - value--; - } - - - switch (spix_sync_channels[channel].timer_channel) { - case 1: - rCCR1(timer) = value; - break; - - case 2: - rCCR2(timer) = value; - break; - - case 3: - rCCR3(timer) = value; - break; - - case 4: - rCCR4(timer) = value; - break; - - default: - return -1; - } - - return 0; -} - -unsigned spix_sync_servo_get(unsigned channel) -{ - if (channel >= 3) { - return 0; - } - - unsigned timer = spix_sync_channels[channel].timer_index; - uint16_t value = 0; - - /* test timer for validity */ - if ((spix_sync_timers[timer].base == 0) || - (spix_sync_channels[channel].timer_channel == 0)) { - return 0; - } - - /* configure the channel */ - switch (spix_sync_channels[channel].timer_channel) { - case 1: - value = rCCR1(timer); - break; - - case 2: - value = rCCR2(timer); - break; - - case 3: - value = rCCR3(timer); - break; - - case 4: - value = rCCR4(timer); - break; - } - - unsigned period = spix_sync_timer_get_period(timer); - return ((value + 1) * 255 / period); -} - -int spix_sync_servo_init(unsigned rate) -{ - /* do basic timer initialisation first */ - for (unsigned i = 0; i < arraySize(spix_sync_timers); i++) { - spix_sync_timer_init_timer(i, rate); - } - - /* now init channels */ - for (unsigned i = 0; i < arraySize(spix_sync_channels); i++) { - spix_sync_channel_init(i); - } - - spix_sync_servo_arm(true); - return OK; -} - -void -spix_sync_servo_deinit(void) -{ - /* disable the timers */ - spix_sync_servo_arm(false); -} -void -spix_sync_servo_arm(bool armed) -{ - /* iterate timers and arm/disarm appropriately */ - for (unsigned i = 0; i < arraySize(spix_sync_timers); i++) { - if (spix_sync_timers[i].base != 0) { - if (armed) { - /* force an update to preload all registers */ - rEGR(i) = GTIM_EGR_UG; - - /* arm requires the timer be enabled */ - rCR1(i) |= GTIM_CR1_CEN | GTIM_CR1_ARPE; - - } else { - rCR1(i) = 0; - } - } - } -} diff --git a/boards/ark/fmu-v6x/src/spix_sync.h b/boards/ark/fmu-v6x/src/spix_sync.h deleted file mode 100644 index 2e37c89..0000000 --- a/boards/ark/fmu-v6x/src/spix_sync.h +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2023 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. - * - ****************************************************************************/ - -__BEGIN_DECLS -void spix_sync_channel_init(unsigned channel); -int spix_sync_servo_set(unsigned channel, uint8_t value); -unsigned spix_sync_servo_get(unsigned channel); -int spix_sync_servo_init(unsigned rate); -void spix_sync_servo_deinit(void); -void spix_sync_servo_arm(bool armed); -unsigned spix_sync_timer_get_period(unsigned timer); -__END_DECLS diff --git a/boards/ark/fmu-v6x/src/timer_config.cpp b/boards/ark/fmu-v6x/src/timer_config.cpp deleted file mode 100644 index 3504c35..0000000 --- a/boards/ark/fmu-v6x/src/timer_config.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 - -/* Timer allocation - * - * TIM5_CH4 T FMU_CH1 - * TIM5_CH3 T FMU_CH2 - * TIM5_CH2 T FMU_CH3 - * TIM5_CH1 T FMU_CH4 - * - * TIM4_CH2 T FMU_CH5 - * TIM4_CH3 T FMU_CH6 - * - * TIM12_CH1 T FMU_CH7 - * TIM12_CH2 T FMU_CH8 - * - * TIM1_CH2 T FMU_CAP1 < Capture - * TIM1_CH3 T SPI2_DRDY2_ISM330_INT2 < Capture or GPIO INT - * TIM1_CH1 T SPIX_SYNC > Pulse or GPIO strobe - * - * TIM2_CH3 T HEATER > PWM OUT or GPIO - * - * TIM14_CH1 T BUZZER_1 - Driven by other driver - * TIM8_CH1_IN T FMU_PPM_INPUT - Sampled byt HRT by other driver - */ - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer5, DMA{DMA::Index1}), - initIOTimer(Timer::Timer4, DMA{DMA::Index1}), - initIOTimer(Timer::Timer12), - //initIOTimer(Timer::Timer1), - //initIOTimer(Timer::Timer2), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel4}, {GPIO::PortI, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel3}, {GPIO::PortH, GPIO::Pin12}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel2}, {GPIO::PortH, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel1}, {GPIO::PortH, GPIO::Pin10}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer12, Timer::Channel1}, {GPIO::PortH, GPIO::Pin6}), - initIOTimerChannel(io_timers, {Timer::Timer12, Timer::Channel2}, {GPIO::PortH, GPIO::Pin9}), - //initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - //initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); - - -constexpr io_timers_t spix_sync_timers[MAX_SPIX_SYNC_TIMERS] = { - initIOTimer(Timer::Timer1), -}; - -constexpr timer_io_channels_t spix_sync_channels[MAX_SPIX_SYNC_TIMERS] = { - initIOTimerChannel(spix_sync_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), -}; diff --git a/boards/ark/fmu-v6x/src/usb.c b/boards/ark/fmu-v6x/src/usb.c deleted file mode 100644 index 1c64e94..0000000 --- a/boards/ark/fmu-v6x/src/usb.c +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include "arm_internal.h" -#include -#include -#include -#include "board_config.h" - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -/************************************************************************************ - * Name: stm32_usbinitialize - * - * Description: - * Called to setup USB-related GPIO pins for the ARKFMU 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_STM32H7_OTGFS - stm32_configgpio(GPIO_OTGFS_VBUS); -#endif -} - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/atl/mantis-edu/cmake/upload.cmake b/boards/atl/mantis-edu/cmake/upload.cmake deleted file mode 100644 index b85bacd..0000000 --- a/boards/atl/mantis-edu/cmake/upload.cmake +++ /dev/null @@ -1,46 +0,0 @@ -############################################################################ -# -# Copyright (c) 2021 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. -# -############################################################################ - - -set(PX4_FW_NAME ${PX4_BINARY_DIR}/${PX4_BOARD_VENDOR}_${PX4_BOARD_MODEL}_${PX4_BOARD_LABEL}.px4) - -# The file needs to have that name in order to be updated automatically. -set(UPLOAD_NAME autopilot.px4) - -add_custom_target(upload_wifi - COMMAND ${CMAKE_COMMAND} -E copy ${PX4_FW_NAME} ${UPLOAD_NAME} - COMMAND ${PX4_SOURCE_DIR}/boards/atl/mantis-edu/upload.sh ${UPLOAD_NAME} - DEPENDS ${PX4_FW_NAME} - COMMENT "uploading autopilot.px4 file" - USES_TERMINAL -) diff --git a/boards/atl/mantis-edu/default.px4board b/boards/atl/mantis-edu/default.px4board deleted file mode 100644 index 58fcec7..0000000 --- a/boards/atl/mantis-edu/default.px4board +++ /dev/null @@ -1,51 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_BAROMETER_MAIERTEK_MPC2520=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8310=y -CONFIG_DRIVERS_TAP_ESC=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BL_UPDATE=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_SHUTDOWN=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/atl/mantis-edu/extras/atl_mantis-edu_bootloader.bin b/boards/atl/mantis-edu/extras/atl_mantis-edu_bootloader.bin deleted file mode 100755 index 554ae89..0000000 Binary files a/boards/atl/mantis-edu/extras/atl_mantis-edu_bootloader.bin and /dev/null differ diff --git a/boards/atl/mantis-edu/firmware.prototype b/boards/atl/mantis-edu/firmware.prototype deleted file mode 100644 index 5c37f43..0000000 --- a/boards/atl/mantis-edu/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 97, - "magic": "PX4FWv1", - "description": "Firmware for the Advanced Technology Labs (ATL) Mantis EDU (V18S) board", - "image": "", - "build_time": 0, - "summary": "atl_mantis-edu", - "version": "0.1", - "image_size": 0, - "image_maxsize": 2064384, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/atl/mantis-edu/init/rc.board_defaults b/boards/atl/mantis-edu/init/rc.board_defaults deleted file mode 100644 index 2264eb7..0000000 --- a/boards/atl/mantis-edu/init/rc.board_defaults +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default SYS_AUTOSTART 4061 - -param set-default BAT1_V_DIV 9.0 - -param set-default COM_ARM_SDCARD 0 - -param set-default SENS_EXT_I2C_PRB 0 - -param set-default EV_TSK_STAT_DIS 1 - -param set-default SYS_DM_BACKEND 1 - -# Use MAVLink log streaming -set LOGGER_ARGS "-m mavlink -c 0.5" diff --git a/boards/atl/mantis-edu/init/rc.board_extras b/boards/atl/mantis-edu/init/rc.board_extras deleted file mode 100644 index 36f70eb..0000000 --- a/boards/atl/mantis-edu/init/rc.board_extras +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -tap_esc start -d /dev/ttyS4 -n 4 diff --git a/boards/atl/mantis-edu/init/rc.board_mavlink b/boards/atl/mantis-edu/init/rc.board_mavlink deleted file mode 100644 index ff6262d..0000000 --- a/boards/atl/mantis-edu/init/rc.board_mavlink +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -# -# board specific MAVLink startup script. -#------------------------------------------------------------------------------ - -# MAVLink instance for Gimbal control & generic WiFi connection (e.g. QGC) -set GIMBAL_TTY /dev/ttyS3 -set MAV_RATE 40000 -set BAUDRATE 500000 - -mavlink start -r ${MAV_RATE} -d ${GIMBAL_TTY} -b ${BAUDRATE} -x -mavlink stream -d ${GIMBAL_TTY} -s SYSTEM_TIME -r 0.5 -mavlink stream -d ${GIMBAL_TTY} -s AUTOPILOT_STATE_FOR_GIMBAL_DEVICE -r 20 -mavlink stream -d ${GIMBAL_TTY} -s GIMBAL_DEVICE_SET_ATTITUDE -r 20 - -# optical flow -mavlink start -d /dev/ttyS2 -m custom -b 500000 diff --git a/boards/atl/mantis-edu/init/rc.board_sensors b/boards/atl/mantis-edu/init/rc.board_sensors deleted file mode 100644 index 6c07fa1..0000000 --- a/boards/atl/mantis-edu/init/rc.board_sensors +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -# -# board specific sensors init -#------------------------------------------------------------------------------ - -board_adc start - -# SPI1 icm20602 IMU -icm20602 start -s -b 1 -R 8 - -# I2C2 ist8310 magnetometer -ist8310 start -I -b 2 -R 14 - -# I2C4 mpc2520 barometer -mpc2520 start -I -b 4 - -gps start -d /dev/ttyS0 -p ubx diff --git a/boards/atl/mantis-edu/nuttx-config/include/board.h b/boards/atl/mantis-edu/nuttx-config/include/board.h deleted file mode 100644 index 291c3e7..0000000 --- a/boards/atl/mantis-edu/nuttx-config/include/board.h +++ /dev/null @@ -1,332 +0,0 @@ -/************************************************************************************ - * nuttx-configs/px4_fmu-v5/include/board.h - * - * Copyright (C) 2016-2018 Gregory Nutt. All rights reserved. - * Authors: David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ -#ifndef __NUTTX_CONFIG_PX4_FMU_V5_INCLUDE_BOARD_H -#define __NUTTX_CONFIG_PX4_FMU_V5_INCLUDE_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The px4_fmu-v5 board provides the following clock sources: - * - * X301: 16 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 16 MHz RC factory-trimmed - * HSE: 16 MHz crystal for HSE - */ - -#define STM32_BOARD_XTAL 16000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 0 - -/* Main PLL Configuration. - * - * PLL source is HSE = 16,000,000 - * - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 2 <= PLLM <= 63 - * 192 <= PLLN <= 432 - * 192 MHz <= PLL_VCO <= 432MHz - * - * SYSCLK = PLL_VCO / PLLP - * Subject to - * - * PLLP = {2, 4, 6, 8} - * SYSCLK <= 216 MHz - * - * USB OTG FS, SDMMC and RNG Clock = PLL_VCO / PLLQ - * Subject to - * The USB OTG FS requires a 48 MHz clock to work correctly. The SDMMC - * and the random number generator need a frequency lower than or equal - * to 48 MHz to work correctly. - * - * 2 <= PLLQ <= 15 - */ - -/* Highest SYSCLK with USB OTG FS clock = 48 MHz - * - * PLL_VCO = (16,000,000 / 8) * 216 = 432 MHz - * SYSCLK = 432 MHz / 2 = 216 MHz - * USB OTG FS, SDMMC and RNG Clock = 432 MHz / 9 = 48 MHz - */ -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(8) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(216) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(9) - -#define STM32_VCO_FREQUENCY ((STM32_HSE_FREQUENCY / 8) * 216) -#define STM32_SYSCLK_FREQUENCY (STM32_VCO_FREQUENCY / 2) -#define STM32_OTGFS_FREQUENCY (STM32_VCO_FREQUENCY / 9) - -/* Configure factors for PLLSAI clock */ -#define CONFIG_STM32F7_PLLSAI 1 -#define STM32_RCC_PLLSAICFGR_PLLSAIN RCC_PLLSAICFGR_PLLSAIN(192) -#define STM32_RCC_PLLSAICFGR_PLLSAIP RCC_PLLSAICFGR_PLLSAIP(8) -#define STM32_RCC_PLLSAICFGR_PLLSAIQ RCC_PLLSAICFGR_PLLSAIQ(4) -#define STM32_RCC_PLLSAICFGR_PLLSAIR RCC_PLLSAICFGR_PLLSAIR(2) - -/* Configure Dedicated Clock Configuration Register */ -#define STM32_RCC_DCKCFGR1_PLLI2SDIVQ RCC_DCKCFGR1_PLLI2SDIVQ(1) -#define STM32_RCC_DCKCFGR1_PLLSAIDIVQ RCC_DCKCFGR1_PLLSAIDIVQ(1) -#define STM32_RCC_DCKCFGR1_PLLSAIDIVR RCC_DCKCFGR1_PLLSAIDIVR(0) -#define STM32_RCC_DCKCFGR1_SAI1SRC RCC_DCKCFGR1_SAI1SEL(0) -#define STM32_RCC_DCKCFGR1_SAI2SRC RCC_DCKCFGR1_SAI2SEL(0) -#define STM32_RCC_DCKCFGR1_TIMPRESRC 0 -#define STM32_RCC_DCKCFGR1_DFSDM1SRC 0 -#define STM32_RCC_DCKCFGR1_ADFSDM1SRC 0 - - -/* Configure factors for PLLI2S clock */ -#define CONFIG_STM32F7_PLLI2S 1 -#define STM32_RCC_PLLI2SCFGR_PLLI2SN RCC_PLLI2SCFGR_PLLI2SN(192) -#define STM32_RCC_PLLI2SCFGR_PLLI2SP RCC_PLLI2SCFGR_PLLI2SP(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SQ RCC_PLLI2SCFGR_PLLI2SQ(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SR RCC_PLLI2SCFGR_PLLI2SR(2) - -/* Configure Dedicated Clock Configuration Register 2 */ -#define STM32_RCC_DCKCFGR2_USART1SRC RCC_DCKCFGR2_USART1SEL_APB -#define STM32_RCC_DCKCFGR2_USART2SRC RCC_DCKCFGR2_USART2SEL_APB -#define STM32_RCC_DCKCFGR2_UART4SRC RCC_DCKCFGR2_UART4SEL_APB -#define STM32_RCC_DCKCFGR2_UART5SRC RCC_DCKCFGR2_UART5SEL_APB -#define STM32_RCC_DCKCFGR2_USART6SRC RCC_DCKCFGR2_USART6SEL_APB -#define STM32_RCC_DCKCFGR2_UART7SRC RCC_DCKCFGR2_UART7SEL_APB -#define STM32_RCC_DCKCFGR2_UART8SRC RCC_DCKCFGR2_UART8SEL_APB -#define STM32_RCC_DCKCFGR2_I2C1SRC RCC_DCKCFGR2_I2C1SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C2SRC RCC_DCKCFGR2_I2C2SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C3SRC RCC_DCKCFGR2_I2C3SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C4SRC RCC_DCKCFGR2_I2C4SEL_HSI -#define STM32_RCC_DCKCFGR2_LPTIM1SRC RCC_DCKCFGR2_LPTIM1SEL_APB -#define STM32_RCC_DCKCFGR2_CECSRC RCC_DCKCFGR2_CECSEL_HSI -#define STM32_RCC_DCKCFGR2_CK48MSRC RCC_DCKCFGR2_CK48MSEL_PLL -#define STM32_RCC_DCKCFGR2_SDMMCSRC RCC_DCKCFGR2_SDMMCSEL_48MHZ -#define STM32_RCC_DCKCFGR2_SDMMC2SRC RCC_DCKCFGR2_SDMMC2SEL_48MHZ -#define STM32_RCC_DCKCFGR2_DSISRC RCC_DCKCFGR2_DSISEL_PHY - - -/* Several prescalers allow the configuration of the two AHB buses, the - * high-speed APB (APB2) and the low-speed APB (APB1) domains. The maximum - * frequency of the two AHB buses is 216 MHz while the maximum frequency of - * the high-speed APB domains is 108 MHz. The maximum allowed frequency of - * the low-speed APB domain is 54 MHz. - */ - -/* AHB clock (HCLK) is SYSCLK (216 MHz) */ -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (54 MHz) */ -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (108MHz) */ -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* SDMMC dividers. Note that slower clocking is required when DMA is disabled - * in order to avoid RX overrun/TX underrun errors due to delayed responses - * to service FIFOs in interrupt driven mode. These values have not been - * tuned!!! - * - * SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(118+2)=400 KHz - */ - -/* Use the Falling edge of the SDIO_CLK clock to change the edge the - * data and commands are change on - */ - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - -#define STM32_SDMMC_INIT_CLKDIV (118 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* DMA ON: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(1+2)=16 MHz - * DMA OFF: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32F7_SDMMC_DMA -# define STM32_SDMMC_MMCXFR_CLKDIV (1 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (2 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -/* DMA ON: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(1+2)=16 MHz - * DMA OFF: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(2+2)=12 MHz - */ -//TODO #warning "Check Freq for 24mHz" - -#ifdef CONFIG_STM32F7_SDMMC_DMA -# define STM32_SDMMC_SDXFR_CLKDIV (1 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (2 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -/* FLASH wait states - * - * --------- ---------- ----------- - * VDD MAX SYSCLK WAIT STATES - * --------- ---------- ----------- - * 1.7-2.1 V 180 MHz 8 - * 2.1-2.4 V 216 MHz 9 - * 2.4-2.7 V 216 MHz 8 - * 2.7-3.6 V 216 MHz 7 - * --------- ---------- ----------- - */ - -#define BOARD_FLASH_WAITSTATES 7 - -/* LED index values for use with board_userled() */ - -#define BOARD_LED1 0 -#define BOARD_LED2 1 -#define BOARD_LED3 2 -#define BOARD_NLEDS 3 - -#define BOARD_LED_RED BOARD_LED1 -#define BOARD_LED_GREEN BOARD_LED2 -#define BOARD_LED_BLUE BOARD_LED3 - -/* Thus if the Green LED is statically on, NuttX has successfully booted and - * is, apparently, running normally. If the Red LED is flashing at - * approximately 2Hz, then a fatal error has been detected and the system - * has halted. - */ - -/* Alternate function pin selections ************************************************/ - -#define GPIO_USART1_RX GPIO_USART1_RX_2 /* PB7 */ -#define GPIO_USART1_TX GPIO_USART1_TX_2 /* PB6 */ - -#define GPIO_USART2_RX GPIO_USART2_RX_2 /* PD6 */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 /* PD4 */ -#define GPIO_USART2_CTS GPIO_USART2_CTS_2 /* PD3 */ - -#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ -#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ -#define GPIO_USART3_RTS GPIO_USART3_RTS_2 /* PD12 */ -#define GPIO_USART3_CTS GPIO_USART3_CTS_2 /* PD11 */ - -#define GPIO_UART4_RX GPIO_UART4_RX_4 /* PD0 */ -#define GPIO_UART4_TX GPIO_UART4_TX_4 /* PD1 */ - -#define GPIO_UART5_RX GPIO_UART5_RX_3 /* PB12 */ -#define GPIO_UART5_TX GPIO_UART5_TX_3 /* PB13 */ - -#define GPIO_USART6_RX GPIO_USART6_RX_2 /* PG9 */ -#define GPIO_USART6_TX GPIO_USART6_TX_2 /* PG14 */ -#define GPIO_USART6_RTS GPIO_USART6_RTS_2 /* PG8 */ -#define GPIO_USART6_CTS GPIO_USART6_CTS_2 /* PG15 */ - -#define GPIO_UART7_RX GPIO_UART7_RX_2 /* PF6 */ -#define GPIO_UART7_TX GPIO_UART7_TX_1 /* PE8 */ - -/* USART8: has no remap - * - * GPIO_UART8_RX PE0[CN12-64] - * GPIO_UART8_TX PE1[CN11-61] - */ - - -/* SPI */ -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_3 /* PD7 */ -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_3 /* PG11 */ - -#define GPIO_SPI4_MISO GPIO_SPI4_MISO_2 /* PE13 */ -#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_1 /* PE6 */ -#define GPIO_SPI4_SCK GPIO_SPI4_SCK_1 /* PE2 */ - - -/* I2C */ -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_2 /* PF1 */ -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_2 /* PF0 */ - -#define GPIO_I2C4_SCL GPIO_I2C4_SCL_2 /* PF14 */ -#define GPIO_I2C4_SDA GPIO_I2C4_SDA_2 /* PF15 */ - -/* SDMMC1 - * - * VDD 3.3 - * GND - * SDMMC1_CK PC12 - * SDMMC1_CMD PD2 - * SDMMC1_D0 PC8 - * SDMMC1_D1 PC9 - * SDMMC1_D2 PC10 - * SDMMC1_D3 PC11 - * GPIO_SDMMC1_NCD PG0 - */ - -#endif /*__NUTTX_CONFIG_PX4_FMU_V5_INCLUDE_BOARD_H */ diff --git a/boards/atl/mantis-edu/nuttx-config/include/board_dma_map.h b/boards/atl/mantis-edu/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 2a017ed..0000000 --- a/boards/atl/mantis-edu/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/* -| DMA1 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | SPI3_RX_1 | SPDIFRX_DT | SPI3_RX_2 | SPI2_RX | SPI2_TX | SPI3_TX_1 | SPDIFRX_CS | SPI3_TX_2 | -| Channel 1 | I2C1_RX | I2C3_RX | TIM7_UP_1 | - | TIM7_UP_2 | I2C1_RX_1 | I2C1_TX | I2C1_TX_1 | -| Channel 2 | TIM4_CH1 | - | I2C4_RX | TIM4_CH2 | - | I2C4_TX | TIM4_UP | TIM4_CH3 | -| Channel 3 | - | TIM2_UP_1 | I2C3_RX_1 | - | I2C3_TX | TIM2_CH1 | TIM2_CH2 | TIM2_UP_2 | -| | | TIM2_CH3 | | | | | TIM2_CH4_1 | TIM2_CH4_2 | -| Channel 4 | UART5_RX | USART3_RX | UART4_RX | USART3_TX_1 | UART4_TX | USART2_RX | USART2_TX | UART5_TX | -| Channel 5 | UART8_TX | UART7_TX | TIM3_CH4 | UART7_RX | TIM3_CH1 | TIM3_CH2 | UART8_RX | TIM3_CH3 | -| | | | TIM3_UP | | TIM3_TRIG | | | | -| Channel 6 | TIM5_CH3 | TIM5_CH4_1 | TIM5_CH1 | TIM5_CH4_2 | TIM5_CH2 | - | TIM5_UP_2 | - | -| | TIM5_UP_1 | TIM5_TRIG_1 | | TIM5_TRIG_2 | | | | | -| Channel 7 | - | TIM6_UP | I2C2_RX | I2C2_RX_1 | USART3_TX_2 | DAC1 | DAC2 | I2C2_TX | -| Channel 8 | I2C3_TX_1 | I2C4_RX_1 | - | - | I2C2_TX_1 | - | I2C4_TX_1 | - | -| Channel 9 | - | SPI2_RX | - | - | - | - | SPI2_TX | - | -| | | | | | | | | | -| Usage | UART8_TX | USART3_RX | UART4_RX | USART3_TX_1 | | USART2_RX | UART8_RX | | - - -| DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | ADC1_1 | SAI1_A | TIM8_CH1_1 | SAI1_A_2 | ADC1_2 | SAI1_B_1 | TIM1_CH1_1 | SAI1_B_2 | -| | | | TIM8_CH2_1 | | | | TIM1_CH2_1 | | -| | | | TIM8_CH3_1 | | | | TIM1_CH3_1 | | -| Channel 1 | - | DCMI_1 | ADC2_1 | ADC2_2 | SAI1_B | SPI6_TX | SPI6_RX | DCMI_2 | -| Channel 2 | ADC3_1 | ADC3_2 | - | SPI5_RX_1 | SPI5_TX_1 | CRYP_OUT | CRYP_IN | HASH_IN | -| Channel 3 | SPI1_RX_1 | - | SPI1_RX_2 | SPI1_TX_1 | SAI2_A | SPI1_TX_2 | SAI2_B | QUADSPI | -| Channel 4 | SPI4_RX_1 | SPI4_TX_1 | USART1_RX_1 | SDMMC1_1 | - | USART1_RX_2 | SDMMC1_2 | USART1_TX | -| Channel 5 | - | USART6_RX_1 | USART6_RX_2 | SPI4_RX_2 | SPI4_TX_2 | - | USART6_TX_1 | USART6_TX_2 | -| Channel 6 | TIM1_TRIG_1 | TIM1_CH1_2 | TIM1_CH2_2 | TIM1_CH1 | TIM1_CH4 | TIM1_UP | TIM1_CH3_2 | - | -| | | | | | TIM1_TRIG_2 | | | | -| | | | | | TIM1_COM | | | | -| Channel 7 | - | TIM8_UP | TIM8_CH1_2 | TIM8_CH2_2 | TIM8_CH3_2 | SPI5_RX_2 | SPI5_TX_2 | TIM8_CH4 | -| | | | | | | | | TIM8_TRIG | -| | | | | | | | | TIM8_COM | -| Channel 8 | DFSDM1_FLT0_1 | DFSDM1_FLT1_1 | DFSDM1_FLT2_1 | DFSDM1_FLT3_1 | DFSDM1_FLT0_2 | DFSDM1_FLT1_2 | DFSDM1_FLT2_2 | DFSDM1_FLT3_2 | -| Channel 9 | JPEG_IN_1 | JPEG_OUT | SPI4_TX_3 | JPEG_IN_2 | JPEG_OUT_2 | SPI5_RX_3 | - | - | -| Channel 10 | SAI1_B_3 | SAI2_B_1 | SAI2_A_1 | - | - | - | SAI1_A_3 | - | -| Channel 11 | SDMMC2_1 | - | QUADSPI_1 | - | - | SDMMC2_2 | - | - | -| | | | | | | | | | -| Usage | SPI1_RX_1 | | USART6_RX_2 | SPI1_TX_1 | | TIM1_UP | SDMMC1_2 | | - */ - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// DMAMAP_UART8_TX // DMA1, Stream 0, Channel 5 (PX4IO TX) -// DMAMAP_USART3_RX // DMA1, Stream 1, Channel 4 (TELEM2 RX) -// DMAMAP_UART4_RX // DMA1, Stream 2, Channel 4 (TELEM4 RX) -#define DMAMAP_USART3_TX DMAMAP_USART3_TX_1 // DMA1, Stream 3, Channel 4 (TELEM2 TX) -// DMAMAP_USART2_RX // DMA1, Stream 5, Channel 4 (TELEM1 RX) -// DMAMAP_UART8_RX // DMA1, Stream 6, Channel 5 (PX4IO RX) - - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMAMAP_SPI1_RX DMAMAP_SPI1_RX_1 // DMA2, Stream 0, Channel 3 (SPI sensors RX) -// AVAILABLE // DMA2, Stream 1 -#define DMAMAP_USART6_RX DMAMAP_USART6_RX_2 // DMA2, Stream 2, Channel 5 -#define DMAMAP_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 3, Channel 3 (SPI sensors TX) -// AVAILABLE // DMA2, Stream 4 -// DMAMAP_TIM1_UP // DMA2, Stream 5, Channel 6 (DSHOT) -#define DMAMAP_SDMMC1 DMAMAP_SDMMC1_2 // DMA2, Stream 6, Channel 4 -// AVAILABLE // DMA2, Stream 7 diff --git a/boards/atl/mantis-edu/nuttx-config/nsh/defconfig b/boards/atl/mantis-edu/nuttx-config/nsh/defconfig deleted file mode 100644 index 3368ce4..0000000 --- a/boards/atl/mantis-edu/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,261 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_FS_PROCFS_EXCLUDE_ENVIRON is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/atl/mantis-edu/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32f7" -CONFIG_ARCH_CHIP_STM32F765II=y -CONFIG_ARCH_CHIP_STM32F7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0061 -CONFIG_CDCACM_PRODUCTSTR="PX4 ATL Mantis-EDU" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="Advanced Technology Labs" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=3 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_MODE=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32F7_ADC1=y -CONFIG_STM32F7_BBSRAM=y -CONFIG_STM32F7_BBSRAM_FILES=5 -CONFIG_STM32F7_BKPSRAM=y -CONFIG_STM32F7_DMA1=y -CONFIG_STM32F7_DMA2=y -CONFIG_STM32F7_DMACAPABLE=y -CONFIG_STM32F7_FLOWCONTROL_BROKEN=y -CONFIG_STM32F7_I2C2=y -CONFIG_STM32F7_I2C4=y -CONFIG_STM32F7_I2C_DYNTIMEO=y -CONFIG_STM32F7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32F7_OTGFS=y -CONFIG_STM32F7_PROGMEM=y -CONFIG_STM32F7_PWR=y -CONFIG_STM32F7_RTC=y -CONFIG_STM32F7_RTC_AUTO_LSECLOCK_START_DRV_CAPABILITY=y -CONFIG_STM32F7_RTC_MAGIC_REG=1 -CONFIG_STM32F7_SAVE_CRASHDUMP=y -CONFIG_STM32F7_SDMMC1=y -CONFIG_STM32F7_SDMMC_DMA=y -CONFIG_STM32F7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32F7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32F7_SPI1=y -CONFIG_STM32F7_SPI1_DMA=y -CONFIG_STM32F7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI4=y -CONFIG_STM32F7_SPI_DMATHRESHOLD=8 -CONFIG_STM32F7_TIM10=y -CONFIG_STM32F7_TIM11=y -CONFIG_STM32F7_TIM3=y -CONFIG_STM32F7_UART4=y -CONFIG_STM32F7_UART5=y -CONFIG_STM32F7_UART7=y -CONFIG_STM32F7_UART8=y -CONFIG_STM32F7_USART1=y -CONFIG_STM32F7_USART2=y -CONFIG_STM32F7_USART3=y -CONFIG_STM32F7_USART6=y -CONFIG_STM32F7_USART_BREAKS=y -CONFIG_STM32F7_USART_INVERT=y -CONFIG_STM32F7_USART_SINGLEWIRE=y -CONFIG_STM32F7_USART_SWAP=y -CONFIG_STM32F7_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_RXDMA=y -CONFIG_UART4_TXBUFSIZE=3000 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_SERIAL_CONSOLE=y -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=3000 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/atl/mantis-edu/nuttx-config/scripts/script.ld b/boards/atl/mantis-edu/nuttx-config/scripts/script.ld deleted file mode 100644 index fc70ef1..0000000 --- a/boards/atl/mantis-edu/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,191 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F765IIT6 has 2048 KiB of main FLASH memory. This FLASH memory - * can be accessed from either the AXIM interface at address 0x0800:0000 or - * from the ITCM interface at address 0x0020:0000. - * - * Additional information, including the option bytes, is available at at - * FLASH at address 0x1ff0:0000 (AXIM) or 0x0010:0000 (ITCM). - * - * In the STM32F765IIT6, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash on ITCM at 0x0020:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x0010:0000 - * - * NuttX does not modify these option byes. On the unmodified NUCLEO-144 - * board, the BOOT0 pin is at ground so by default, the STM32F765IIT6 will - * boot from address 0x0020:0000 in ITCM FLASH. - * - * The STM32F765IIT6 also has 512 KiB of data SRAM (in addition to ITCM SRAM). - * SRAM is split up into three blocks: - * - * 1) 128 KiB of DTCM SRM beginning at address 0x2000:0000 - * 2) 368 KiB of SRAM1 beginning at address 0x2002:0000 - * 3) 16 KiB of SRAM2 beginning at address 0x2007:c000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * Bootloader reserves the first 32K bank (2 Mbytes Flash memory single bank) - * organization (256 bits read width) - * The next 2 32K sectors are reserved for parameters. - */ - -MEMORY -{ - FLASH_ITCM (rx) : ORIGIN = 0x00218000, LENGTH = 1952K - FLASH_AXIM (rx) : ORIGIN = 0x08018000, LENGTH = 1952K - - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 16K - DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - SRAM1 (rwx) : ORIGIN = 0x20020000, LENGTH = 368K - SRAM2 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) -EXTERN(_main_toc) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xb4ecc2925d7d05c5) - . += 8; - *(.main_toc) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH_AXIM - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH_AXIM - - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH_AXIM - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH_AXIM - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > SRAM1 AT > FLASH_AXIM - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > SRAM1 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } - - .ramfunc : { - _sramfuncs = .; - *(.ramfunc .ramfunc.*) - . = ALIGN(4); - _eramfuncs = .; - } > ITCM_RAM AT > FLASH_AXIM - - _framfuncs = LOADADDR(.ramfunc); - - /* Start of the image signature. This - * has to be in the end of the image - */ - .signature : { - _boot_signature = ALIGN(4); - } > FLASH_AXIM -} diff --git a/boards/atl/mantis-edu/src/CMakeLists.txt b/boards/atl/mantis-edu/src/CMakeLists.txt deleted file mode 100644 index 398389f..0000000 --- a/boards/atl/mantis-edu/src/CMakeLists.txt +++ /dev/null @@ -1,54 +0,0 @@ -############################################################################ -# -# Copyright (c) 2016 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. -# -############################################################################ - -add_library(drivers_board - i2c.cpp - init.c - led.c - sdio.c - spi.cpp - timer_config.cpp - usb.c - pwr.cpp -) -add_dependencies(drivers_board arch_board_hw_info) - -target_link_libraries(drivers_board - PRIVATE - arch_board_hw_info - arch_spi - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer -) diff --git a/boards/atl/mantis-edu/src/board_config.h b/boards/atl/mantis-edu/src/board_config.h deleted file mode 100644 index 8b8a99b..0000000 --- a/boards/atl/mantis-edu/src/board_config.h +++ /dev/null @@ -1,227 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2016 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * PX4FMU-v5 internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -#include - -/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */ -#define GPIO_nLED_RED /* PB1 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN1) -#define GPIO_nLED_GREEN /* PC6 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN6) -#define GPIO_nLED_BLUE /* PC7 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN7) - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_OVERLOAD_LED LED_RED -#define BOARD_ARMED_STATE_LED LED_BLUE - -#define FLASH_BASED_PARAMS -#define RAM_BASED_MISSIONS - -// Hacks for MAVLink RC button input -#define ATL_MANTIS_RC_INPUT_HACKS - -// Hacks for MAVLink RC button input -#define ATL_MANTIS_RC_INPUT_HACKS - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that - * can be used by the Px4 Firmware in the adc driver - */ - -/* ADC defines to be used in sensors.cpp to read from a particular channel */ -#define ADC1_CH(n) (n) -#define ADC1_GPIO(n) GPIO_ADC1_IN##n - -/* Define GPIO pins used as ADC N.B. Channel numbers must match below */ - -#define PX4_ADC_GPIO \ - /* PA0 */ ADC1_GPIO(0), \ - /* PC0 */ ADC1_GPIO(10), \ - /* PC1 */ ADC1_GPIO(11), \ - /* PC2 */ ADC1_GPIO(12), \ - /* PC3 */ ADC1_GPIO(13), \ - /* PC4 */ ADC1_GPIO(14) - -/* Define Channel numbers must match above GPIO pin IN(n)*/ -#define ADC_BATTERY_VOLTAGE_CHANNEL /* PA0 */ ADC1_CH(0) -#define ADC_BATTERY_CURRENT_CHANNEL 0 -#define ADC_SCALED_V5_CHANNEL /* PC0 */ ADC1_CH(10) -#define ADC_SCALED_VDD_3V3_SENSORS_CHANNEL /* PC1 */ ADC1_CH(11) -#define ADC_HW_VER_SENSE_CHANNEL /* PC2 */ ADC1_CH(12) -#define ADC_HW_REV_SENSE_CHANNEL /* PC3 */ ADC1_CH(13) -#define ADC1_SPARE_1_CHANNEL /* PC4 */ ADC1_CH(14) // POWER_AD - -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY_VOLTAGE_CHANNEL) | \ - (1 << ADC_SCALED_V5_CHANNEL) | \ - (1 << ADC_SCALED_VDD_3V3_SENSORS_CHANNEL) | \ - (1 << ADC_HW_VER_SENSE_CHANNEL) | \ - (1 << ADC_HW_REV_SENSE_CHANNEL) | \ - (1 << ADC1_SPARE_1_CHANNEL)) - -/* HW has to large of R termination on ADC todo:change when HW value is chosen */ -#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f) - -/* HW Version and Revision drive signals Default to 1 to detect */ -#define BOARD_HAS_HW_VERSIONING - -#define GPIO_HW_REV_DRIVE /* PH14 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTH|GPIO_PIN14) -#define GPIO_HW_REV_SENSE /* PC3 */ ADC1_GPIO(13) -#define GPIO_HW_VER_DRIVE /* PG0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN0) -#define GPIO_HW_VER_SENSE /* PC2 */ ADC1_GPIO(12) -#define HW_INFO_INIT_PREFIX "VAM" - -#define BOARD_TAP_ESC_MODE 2 // select closed-loop control mode for the esc -// #define BOARD_USE_ESC_CURRENT_REPORT - -// LED mapping -#define BOARD_FRONT_LED_MASK (1 << 0) | (1 << 3) -#define BOARD_REAR_LED_MASK (1 << 1) | (1 << 2) - -/* HEATER */ -#define GPIO_HEATER_OUTPUT /* PA7 T14CH1 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN7) - -#define BOARD_HAS_LED_PWM 1 -#define BOARD_LED_PWM_DRIVE_ACTIVE_LOW 1 - -#define BOARD_UI_LED_PWM_DRIVE_ACTIVE_LOW 1 - -#define BOARD_ADC_BRICK_VALID 1 -#define BOARD_NUMBER_BRICKS 1 - -#define GPIO_VDD_3V3_SD_CARD_EN /* PG7 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN7) -#define VDD_3V3_SD_CARD_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SD_CARD_EN, (on_true)) - -/* USB OTG FS */ -#define GPIO_OTGFS_VBUS /* PA9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 8 /* use timer8 for the HRT */ -#define HRT_TIMER_CHANNEL 3 /* use capture/compare channel 3 */ - -/* RC Serial port */ -#define RC_SERIAL_PORT "/dev/ttyS5" -#define RC_SERIAL_SINGLEWIRE - -/* power on/off */ -#define MS_PWR_BUTTON_DOWN 750 -#define KEY_AD_GPIO (GPIO_INPUT|GPIO_PULLUP|GPIO_EXTI|GPIO_PORTC|GPIO_PIN4) -#define POWER_ON_GPIO (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN5) -#define POWER_OFF_GPIO (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTC|GPIO_PIN5) -#define POWER_CHECK_GPIO (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTF|GPIO_PIN0) - -#define SDIO_SLOTNO 0 /* Only one slot */ -#define SDIO_MINOR 0 - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_USB_VALID BOARD_ADC_USB_CONNECTED - -/* FMUv5 never powers odd the Servo rail */ -#define BOARD_ADC_SERVO_VALID (1) - -#define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -#define BOARD_ADC_BRICK2_VALID (0) - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ -#define BOARD_HAS_ON_RESET 1 -#define BOARD_HAS_POWER_CONTROL 1 - -#define GPIO_CAM_PWR_ON_H /* PB0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN0) -#define GPIO_CAM_PWR_ON_L /* PB0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN0) - -#define PX4_GPIO_INIT_LIST { \ - PX4_ADC_GPIO, \ - GPIO_HW_REV_DRIVE, \ - GPIO_HW_VER_DRIVE, \ - GPIO_HEATER_OUTPUT, \ - GPIO_VDD_3V3_SD_CARD_EN, \ - GPIO_OTGFS_VBUS \ - } - -#define BOARD_ENABLE_CONSOLE_BUFFER - -#define BOARD_NUM_IO_TIMERS 1 - -__BEGIN_DECLS - -#ifndef __ASSEMBLY__ - -int stm32_sdio_initialize(void); - -extern void stm32_spiinitialize(void); - -extern void stm32_usbinitialize(void); - -extern void board_peripheral_reset(int ms); - -/************************************************************************************ - * Name: board_pwr_init() - * - * Description: - * Called to configure power control for the tap-v2 board. - * - * Input Parameters: - * stage- 0 for boot, 1 for board init - * - ************************************************************************************/ - -void board_pwr_init(int stage); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/atl/mantis-edu/src/i2c.cpp b/boards/atl/mantis-edu/src/i2c.cpp deleted file mode 100644 index 781fbaf..0000000 --- a/boards/atl/mantis-edu/src/i2c.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusInternal(2), - initI2CBusInternal(4), -}; diff --git a/boards/atl/mantis-edu/src/init.c b/boards/atl/mantis-edu/src/init.c deleted file mode 100644 index 461c163..0000000 --- a/boards/atl/mantis-edu/src/init.c +++ /dev/null @@ -1,271 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-2019 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * PX4FMU-specific early startup code. This file implements the - * board_app_initializ() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include "board_config.h" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -# if defined(FLASH_BASED_PARAMS) -# include -#endif - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ -#define _GPIO_PULL_DOWN_INPUT(def) (((def) & (GPIO_PORT_MASK | GPIO_PIN_MASK)) | (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_2MHz)) - -/* Configuration ************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/***************cam_pwr_on_pulse***************************************************** - * Name: cam_pwr_on_pulse() - * - * Description: - * Camera power is controlled by flight control, send a risingedge pulse to enable it - * - * - * Input Parameters: - * Not used - * - ************************************************************************************/ -static void cam_pwr_on_pulse(void) -{ - static bool pwr_on_flag = false; - - if (pwr_on_flag == false) { - // This is now done in the bootloader. - // However, for transition we can leave it in. - up_mdelay(700); - stm32_configgpio(GPIO_CAM_PWR_ON_H); - up_mdelay(20); - stm32_configgpio(GPIO_CAM_PWR_ON_L); - - pwr_on_flag = true; - } -} -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__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 - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Power on Interfaces */ - VDD_3V3_SD_CARD_EN(true); - - /* Need hrt running before using the ADC */ - px4_platform_init(); - - if (OK == board_determine_hw_info()) { - syslog(LOG_INFO, "[boot] Rev 0x%1x : Ver 0x%1x %s\n", board_get_hw_revision(), board_get_hw_version(), - board_get_hw_type_name()); - - } else { - syslog(LOG_ERR, "[boot] Failed to read HW revision and version\n"); - } - - /* configure SPI interfaces (after we determined the HW version) */ - stm32_spiinitialize(); - - /* configure the DMA allocator */ - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - board_pwr_init(1); - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_on(LED_GREEN); // Indicate Power. - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - -#if defined(CONFIG_MMCSD) - int ret = stm32_sdio_initialize(); - - if (ret != OK) { - led_on(LED_RED); - } - -#endif /* CONFIG_MMCSD */ - - /* Camera power is controlled by flight control, send a risingedge pulse to enable it */ - cam_pwr_on_pulse(); - -#if defined(FLASH_BASED_PARAMS) - static sector_descriptor_t params_sector_map[] = { - {1, 32 * 1024, 0x08008000}, - {2, 32 * 1024, 0x08010000}, - {0, 0, 0}, - }; - - /* Initialize the flashfs layer to use heap allocated memory */ - int result = parameter_flashfs_init(params_sector_map, NULL, 0); - - if (result != OK) { - syslog(LOG_ERR, "[boot] FAILED to init params in FLASH %d\n", result); - led_on(LED_AMBER); - return result; - } - -#endif /* FLASH_BASED_PARAMS */ - - return OK; -} diff --git a/boards/atl/mantis-edu/src/led.c b/boards/atl/mantis-edu/src/led.c deleted file mode 100644 index bafff9c..0000000 --- a/boards/atl/mantis-edu/src/led.c +++ /dev/null @@ -1,104 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * PX4FMU LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -#define xlat(p) (p) -static uint32_t g_ledmap[] = { - GPIO_nLED_BLUE, // Indexed by LED_BLUE - GPIO_nLED_RED, // Indexed by LED_RED, LED_AMBER - GPIO_nLED_GREEN, // Indexed by LED_GREEN -}; - -__EXPORT void led_init(void) -{ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - stm32_configgpio(g_ledmap[l]); - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - stm32_gpiowrite(g_ledmap[led], !state); -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - return !stm32_gpioread(g_ledmap[led]); -} - -__EXPORT void led_on(int led) -{ - phy_set_led(xlat(led), true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(xlat(led), false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(xlat(led), !phy_get_led(xlat(led))); -} diff --git a/boards/atl/mantis-edu/src/pwr.cpp b/boards/atl/mantis-edu/src/pwr.cpp deleted file mode 100644 index d732370..0000000 --- a/boards/atl/mantis-edu/src/pwr.cpp +++ /dev/null @@ -1,176 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2016 PX4 Development Team. All rights reserved. - * Author: David Sidrane - * - * 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. - * - ****************************************************************************/ - -/** - * @file pwr.c - * - * Board-specific power button functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include - -#include -#include "board_config.h" -#include - -extern void led_on(int led); -extern void led_off(int led); - -static struct timespec time_down; - - -static int default_power_button_state_notification(board_power_button_state_notification_e request) -{ -// syslog(0,"%d\n", request); - return PWR_BUTTON_RESPONSE_SHUT_DOWN_NOW; -} - - -static power_button_state_notification_t power_state_notification = default_power_button_state_notification; - -/**************************************************************************** - * Name: board_pwr_button_down - * - * Description: - * Called to Read the logical state of the active low power button. - * - ****************************************************************************/ - -static bool board_pwr_button_down(void) -{ - return 0 == stm32_gpioread(KEY_AD_GPIO); -} - -int board_register_power_state_notification_cb(power_button_state_notification_t cb) -{ - power_state_notification = cb; - - if (board_pwr_button_down() && (time_down.tv_nsec != 0 || time_down.tv_sec != 0)) { - // make sure we don't miss the first event - power_state_notification(PWR_BUTTON_DOWN); - } - - return OK; -} - -int board_power_off(int status) -{ - led_on(BOARD_LED_BLUE); - - // disable the interrups - px4_enter_critical_section(); - - stm32_configgpio(POWER_OFF_GPIO); - - while (1); - - return 0; -} - -static int board_button_irq(int irq, FAR void *context, FAR void *args) -{ - if (board_pwr_button_down()) { - - led_on(BOARD_LED_RED); - clock_gettime(CLOCK_REALTIME, &time_down); - power_state_notification(PWR_BUTTON_DOWN); - - } else { - power_state_notification(PWR_BUTTON_UP); - - led_off(BOARD_LED_RED); - - struct timespec now; - clock_gettime(CLOCK_REALTIME, &now); - - uint64_t tdown_ms = time_down.tv_sec * 1000 + time_down.tv_nsec / 1000000; - - uint64_t tnow_ms = now.tv_sec * 1000 + now.tv_nsec / 1000000; - - if (tdown_ms != 0 && (tnow_ms - tdown_ms) >= MS_PWR_BUTTON_DOWN) { - - led_on(BOARD_LED_BLUE); - - if (power_state_notification(PWR_BUTTON_REQUEST_SHUT_DOWN) == PWR_BUTTON_RESPONSE_SHUT_DOWN_NOW) { - up_mdelay(200); - board_power_off(0); - } - - } else { - power_state_notification(PWR_BUTTON_IDEL); - } - - } - - return OK; -} - -/************************************************************************************ - * Name: board_pwr_init() - * - * Description: - * Called to configure power control - * - * Input Parameters: - * stage- 0 for boot, 1 for board init - * - ************************************************************************************/ - -void board_pwr_init(int stage) -{ - if (stage == 0) { - stm32_configgpio(POWER_ON_GPIO); - stm32_configgpio(KEY_AD_GPIO); - stm32_configgpio(POWER_CHECK_GPIO); - } - - if (stage == 1) { - stm32_gpiosetevent(KEY_AD_GPIO, true, true, true, board_button_irq, NULL); - } -} diff --git a/boards/atl/mantis-edu/src/sdio.c b/boards/atl/mantis-edu/src/sdio.c deleted file mode 100644 index 869d757..0000000 --- a/boards/atl/mantis-edu/src/sdio.c +++ /dev/null @@ -1,177 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include "chip.h" -#include "board_config.h" -#include "stm32_gpio.h" -#include "stm32_sdmmc.h" - -#ifdef CONFIG_MMCSD - - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Card detections requires card support and a card detection GPIO */ - -#define HAVE_NCD 1 -#if !defined(GPIO_SDMMC1_NCD) -# undef HAVE_NCD -#endif - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -static FAR struct sdio_dev_s *sdio_dev; -#ifdef HAVE_NCD -static bool g_sd_inserted = 0xff; /* Impossible value */ -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_ncd_interrupt - * - * Description: - * Card detect interrupt handler. - * - ****************************************************************************/ - -#ifdef HAVE_NCD -static int stm32_ncd_interrupt(int irq, FAR void *context) -{ - bool present; - - present = !stm32_gpioread(GPIO_SDMMC1_NCD); - - if (sdio_dev && present != g_sd_inserted) { - sdio_mediachange(sdio_dev, present); - g_sd_inserted = present; - } - - return OK; -} -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_sdio_initialize - * - * Description: - * Initialize SDIO-based MMC/SD card support - * - ****************************************************************************/ - -int stm32_sdio_initialize(void) -{ - int ret; - -#ifdef HAVE_NCD - /* Card detect */ - - bool cd_status; - - /* Configure the card detect GPIO */ - - stm32_configgpio(GPIO_SDMMC1_NCD); - - /* Register an interrupt handler for the card detect pin */ - - stm32_gpiosetevent(GPIO_SDMMC1_NCD, true, true, true, stm32_ncd_interrupt); -#endif - - /* Mount the SDIO-based MMC/SD block driver */ - /* First, get an instance of the SDIO interface */ - - finfo("Initializing SDIO slot %d\n", SDIO_SLOTNO); - - sdio_dev = sdio_initialize(SDIO_SLOTNO); - - if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", SDIO_SLOTNO); - return -ENODEV; - } - - /* Now bind the SDIO interface to the MMC/SD driver */ - - finfo("Bind SDIO to the MMC/SD driver, minor=%d\n", SDIO_MINOR); - - ret = mmcsd_slotinitialize(SDIO_MINOR, sdio_dev); - - if (ret != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); - return ret; - } - - finfo("Successfully bound SDIO to the MMC/SD driver\n"); - -#ifdef HAVE_NCD - /* Use SD card detect pin to check if a card is g_sd_inserted */ - - cd_status = !stm32_gpioread(GPIO_SDMMC1_NCD); - finfo("Card detect : %d\n", cd_status); - - sdio_mediachange(sdio_dev, cd_status); -#else - /* Assume that the SD card is inserted. What choice do we have? */ - - sdio_mediachange(sdio_dev, true); -#endif - - return OK; -} - -#endif /* CONFIG_MMCSD */ diff --git a/boards/atl/mantis-edu/src/spi.cpp b/boards/atl/mantis-edu/src/spi.cpp deleted file mode 100644 index 5aceef3..0000000 --- a/boards/atl/mantis-edu/src/spi.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortF, GPIO::Pin3}), - }), - initSPIBus(SPI::Bus::SPI4, { - initSPIDevice(DRV_DEVTYPE_UNUSED, SPI::CS{GPIO::PortF, GPIO::Pin10}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/atl/mantis-edu/src/timer_config.cpp b/boards/atl/mantis-edu/src/timer_config.cpp deleted file mode 100644 index 8227734..0000000 --- a/boards/atl/mantis-edu/src/timer_config.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 - -constexpr io_timers_t led_pwm_timers[MAX_LED_TIMERS] = { -# if defined(BOARD_HAS_LED_PWM) && !defined(BOARD_HAS_CONTROL_STATUS_LEDS) - initIOTimer(Timer::Timer3), -# endif -}; - -/* Support driving active low (preferred) or active high LED - * on both the onboard status LEDs or the [n]UI_LED_[_EXTERNAL] - * - * Use open drain to drive the LED. This will ensure that - * if the LED has a 5 Volt supply that the LED will be - * off when high. - */ -#define CCER_C1_NUM_BITS 4 -#define ACTIVE_LOW(c) (GTIM_CCER_CC1P << (((c)-1) * CCER_C1_NUM_BITS)) -#define ACTIVE_HIGH(c) 0 - -#if defined(BOARD_LED_PWM_DRIVE_ACTIVE_LOW) -# define POLARITY(c) ACTIVE_LOW(c) -# define DRIVE_TYPE(p) ((p)|GPIO_OPENDRAIN) -#else -# define POLARITY(c) ACTIVE_HIGH((c)) -# define DRIVE_TYPE(p) (p) -#endif - -#if defined(BOARD_UI_LED_PWM_DRIVE_ACTIVE_LOW) -# define UI_POLARITY(c) ACTIVE_LOW(c) -# define UI_DRIVE_TYPE(p) ((p)|GPIO_OPENDRAIN) -#else -# define UI_POLARITY(c) ACTIVE_HIGH((c)) -# define UI_DRIVE_TYPE(p) (p) -#endif - -static inline constexpr timer_io_channels_t initIOTimerChannelUILED(const io_timers_t io_timers_conf[MAX_LED_TIMERS], - Timer::TimerChannel timer, GPIO::GPIOPin pin, int ui_polarity) -{ - timer_io_channels_t ret = initIOTimerChannel(io_timers_conf, timer, pin); - ret.gpio_out = UI_DRIVE_TYPE(ret.gpio_out); - ret.masks = UI_POLARITY(ui_polarity); - return ret; -} - -static inline constexpr timer_io_channels_t initIOTimerChannelControlLED(const io_timers_t - io_timers_conf[MAX_LED_TIMERS], Timer::TimerChannel timer, GPIO::GPIOPin pin, int polarity) -{ - timer_io_channels_t ret = initIOTimerChannel(io_timers_conf, timer, pin); - ret.gpio_out = DRIVE_TYPE(ret.gpio_out); - ret.masks = POLARITY(polarity); - return ret; -} - -constexpr timer_io_channels_t led_pwm_channels[MAX_TIMER_LED_CHANNELS] = { -# if defined(BOARD_HAS_LED_PWM) && !defined(BOARD_HAS_CONTROL_STATUS_LEDS) - initIOTimerChannelControlLED(led_pwm_timers, {Timer::Timer3, Timer::Channel4}, {GPIO::PortB, GPIO::Pin1}, 4), - initIOTimerChannelControlLED(led_pwm_timers, {Timer::Timer3, Timer::Channel1}, {GPIO::PortC, GPIO::Pin6}, 1), - initIOTimerChannelControlLED(led_pwm_timers, {Timer::Timer3, Timer::Channel2}, {GPIO::PortC, GPIO::Pin7}, 2), -# endif -}; diff --git a/boards/atl/mantis-edu/src/usb.c b/boards/atl/mantis-edu/src/usb.c deleted file mode 100644 index a10bf16..0000000 --- a/boards/atl/mantis-edu/src/usb.c +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -#include "board_config.h" -#include -#include -#include -#include -#include - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/atl/mantis-edu/upload.sh b/boards/atl/mantis-edu/upload.sh deleted file mode 100755 index 98e2a06..0000000 --- a/boards/atl/mantis-edu/upload.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -set -e - -PX4_BINARY_FILE="$1" - -echo "uploading: $PX4_BINARY_FILE" - -PX4_BINARY_FILE_SIZE=$(stat -c%s "$PX4_BINARY_FILE") -curl -v -F "image=@$PX4_BINARY_FILE" -H "Expect:" -H "File-Size:$PX4_BINARY_FILE_SIZE" http://192.168.42.1/cgi-bin/upload - diff --git a/boards/av/x-v1/default.px4board b/boards/av/x-v1/default.px4board deleted file mode 100644 index 9336bc7..0000000 --- a/boards/av/x-v1/default.px4board +++ /dev/null @@ -1,97 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_ETHERNET=y -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS6" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS0" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL3="/dev/ttyS2" -CONFIG_BOARD_SERIAL_TEL4="/dev/ttyS3" -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_COMMON_BAROMETERS=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_ADIS16477=y -CONFIG_DRIVERS_IMU_ADIS16497=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UUV_ATT_CONTROL=y -CONFIG_MODULES_UUV_POS_CONTROL=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BL_UPDATE=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_NETMAN=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SERIAL_TEST=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_FAKE_GPS=y diff --git a/boards/av/x-v1/extras/av_x-v1_bootloader.bin b/boards/av/x-v1/extras/av_x-v1_bootloader.bin deleted file mode 100644 index 69bb5ce..0000000 Binary files a/boards/av/x-v1/extras/av_x-v1_bootloader.bin and /dev/null differ diff --git a/boards/av/x-v1/firmware.prototype b/boards/av/x-v1/firmware.prototype deleted file mode 100644 index 7400b6b..0000000 --- a/boards/av/x-v1/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 50, - "magic": "AV-Xv1", - "description": "Firmware for the AV-Xv1 board", - "image": "", - "build_time": 0, - "summary": "AV-Xv1", - "version": "0.1", - "image_size": 0, - "image_maxsize": 2064384, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/av/x-v1/init/rc.board_defaults b/boards/av/x-v1/init/rc.board_defaults deleted file mode 100644 index 120085d..0000000 --- a/boards/av/x-v1/init/rc.board_defaults +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -# system_power unavailable -param set-default CBRK_SUPPLY_CHK 894281 - -param set-default BAT1_V_DIV 10.13 diff --git a/boards/av/x-v1/init/rc.board_mavlink b/boards/av/x-v1/init/rc.board_mavlink deleted file mode 100644 index 339d114..0000000 --- a/boards/av/x-v1/init/rc.board_mavlink +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# av_x1-v1 specific board MAVLink startup script. -#------------------------------------------------------------------------------ - -# AV-X: start MAVLink to companion (connected to TX2) -mavlink start -d /dev/ttyS5 -b 500000 -m osd -mavlink stream -d /dev/ttyS5 -s HIGHRES_IMU -r 250 -mavlink stream -d /dev/ttyS5 -s CAMERA_TRIGGER -r 100 -mavlink stream -d /dev/ttyS5 -s LOCAL_POSITION_NED -r 50 - - -# AV-X: start MAVLink UDP port 14570 -mavlink start -x -u 14570 -p diff --git a/boards/av/x-v1/init/rc.board_sensors b/boards/av/x-v1/init/rc.board_sensors deleted file mode 100644 index 86caac9..0000000 --- a/boards/av/x-v1/init/rc.board_sensors +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -# -# av_x1-v1 specific board sensors init -#------------------------------------------------------------------------------ - -board_adc start - -adis16477 -s -R 8 start - -lps22hb -s start - -lsm303agr -s -R 4 start - -ms4515 -I -b 3 start - -if ! param greater SENS_EN_PMW3901 0 -then - # try to start adis16497 only if pmw3901 isn't enabled, or parameter doesn't exists - adis16497 -S start -fi diff --git a/boards/av/x-v1/nuttx-config/include/board.h b/boards/av/x-v1/nuttx-config/include/board.h deleted file mode 100644 index a1cdc16..0000000 --- a/boards/av/x-v1/nuttx-config/include/board.h +++ /dev/null @@ -1,377 +0,0 @@ -/************************************************************************************ - * nuttx-configs/av-x-v1/include/board.h - * - * Copyright (C) 2016 Gregory Nutt. 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 NuttX 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. - * - ************************************************************************************/ - -#pragma once - -/************************************************************************************ - * Included Files - ************************************************************************************/ -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The av-x-v1 board provides the following clock sources: - * - * X2: 16 MHz oscillator for STM32F777NI microcontroller and Ethernet PHY. - * X1: 32.768 KHz crystal for STM32F777NI embedded RTC - * - * So we have these clock source available within the STM32 - * - * HSI: 16 MHz RC factory-trimmed - * LSI: 32 KHz RC - * HSE: 16 MHz crystal for HSE - */ - -#define STM32_BOARD_XTAL 16000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 0 - -/* Main PLL Configuration. - * - * PLL source is HSE = 25,000,000 - * - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 2 <= PLLM <= 63 - * 192 <= PLLN <= 432 - * 192 MHz <= PLL_VCO <= 432MHz - * - * SYSCLK = PLL_VCO / PLLP - * Subject to - * - * PLLP = {2, 4, 6, 8} - * SYSCLK <= 216 MHz - * - * SDMMC and RNG Clock = PLL_VCO / PLLQ - * Subject to - * The SDMMC and the random number generator need a frequency lower than or equal - * to 48 MHz to work correctly. - * - * 2 <= PLLQ <= 15 - */ - -/* SDMMCCLK (= USB OTG FS clock = RNGCLK) should be <= 48MHz - * - * PLL_VCO = (16,000,000 / 8) * 216 = 432 MHz - * SYSCLK = 432 MHz / 2 = 216 MHz - * SDMMC and RNG Clock = 432 MHz / 9 = 48 MHz - */ - -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(8) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(216) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(9) - -#define STM32_VCO_FREQUENCY ((STM32_HSE_FREQUENCY / 8) * 216) -#define STM32_SYSCLK_FREQUENCY (STM32_VCO_FREQUENCY / 2) -#define STM32_OTGFS_FREQUENCY (STM32_VCO_FREQUENCY / 9) - -/* Configure factors for PLLSAI clock */ - -#define CONFIG_STM32F7_PLLSAI 1 -#define STM32_RCC_PLLSAICFGR_PLLSAIN RCC_PLLSAICFGR_PLLSAIN(192) -#define STM32_RCC_PLLSAICFGR_PLLSAIP RCC_PLLSAICFGR_PLLSAIP(8) -#define STM32_RCC_PLLSAICFGR_PLLSAIQ RCC_PLLSAICFGR_PLLSAIQ(4) -#define STM32_RCC_PLLSAICFGR_PLLSAIR RCC_PLLSAICFGR_PLLSAIR(2) - -/* Configure Dedicated Clock Configuration Register */ - -#define STM32_RCC_DCKCFGR1_PLLI2SDIVQ RCC_DCKCFGR1_PLLI2SDIVQ(1) -#define STM32_RCC_DCKCFGR1_PLLSAIDIVQ RCC_DCKCFGR1_PLLSAIDIVQ(1) -#define STM32_RCC_DCKCFGR1_PLLSAIDIVR RCC_DCKCFGR1_PLLSAIDIVR(0) -#define STM32_RCC_DCKCFGR1_SAI1SRC RCC_DCKCFGR1_SAI1SEL(0) -#define STM32_RCC_DCKCFGR1_SAI2SRC RCC_DCKCFGR1_SAI2SEL(0) -#define STM32_RCC_DCKCFGR1_TIMPRESRC 0 -#define STM32_RCC_DCKCFGR1_DFSDM1SRC 0 -#define STM32_RCC_DCKCFGR1_ADFSDM1SRC 0 - - - -/* Configure factors for PLLI2S clock */ - -#define CONFIG_STM32F7_PLLI2S 1 -#define STM32_RCC_PLLI2SCFGR_PLLI2SN RCC_PLLI2SCFGR_PLLI2SN(192) -#define STM32_RCC_PLLI2SCFGR_PLLI2SP RCC_PLLI2SCFGR_PLLI2SP(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SQ RCC_PLLI2SCFGR_PLLI2SQ(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SR RCC_PLLI2SCFGR_PLLI2SR(2) - -/* Configure Dedicated Clock Configuration Register 2 */ - -#define STM32_RCC_DCKCFGR2_USART1SRC RCC_DCKCFGR2_USART1SEL_APB -#define STM32_RCC_DCKCFGR2_USART2SRC RCC_DCKCFGR2_USART2SEL_APB -#define STM32_RCC_DCKCFGR2_UART4SRC RCC_DCKCFGR2_UART4SEL_APB -#define STM32_RCC_DCKCFGR2_UART5SRC RCC_DCKCFGR2_UART5SEL_APB -#define STM32_RCC_DCKCFGR2_USART6SRC RCC_DCKCFGR2_USART6SEL_APB -#define STM32_RCC_DCKCFGR2_UART7SRC RCC_DCKCFGR2_UART7SEL_APB -#define STM32_RCC_DCKCFGR2_UART8SRC RCC_DCKCFGR2_UART8SEL_APB -#define STM32_RCC_DCKCFGR2_I2C1SRC RCC_DCKCFGR2_I2C1SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C2SRC RCC_DCKCFGR2_I2C2SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C3SRC RCC_DCKCFGR2_I2C3SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C4SRC RCC_DCKCFGR2_I2C4SEL_HSI -#define STM32_RCC_DCKCFGR2_LPTIM1SRC RCC_DCKCFGR2_LPTIM1SEL_APB -#define STM32_RCC_DCKCFGR2_CECSRC RCC_DCKCFGR2_CECSEL_HSI -#define STM32_RCC_DCKCFGR2_CK48MSRC RCC_DCKCFGR2_CK48MSEL_PLL -#define STM32_RCC_DCKCFGR2_SDMMCSRC RCC_DCKCFGR2_SDMMCSEL_48MHZ -#define STM32_RCC_DCKCFGR2_SDMMC2SRC RCC_DCKCFGR2_SDMMC2SEL_48MHZ -#define STM32_RCC_DCKCFGR2_DSISRC RCC_DCKCFGR2_DSISEL_PHY - - -/* Several prescalers allow the configuration of the two AHB buses, the - * high-speed APB (APB2) and the low-speed APB (APB1) domains. The maximum - * frequency of the two AHB buses is 216 MHz while the maximum frequency of - * the high-speed APB domains is 108 MHz. The maximum allowed frequency of - * the low-speed APB domain is 54 MHz. - */ - -/* AHB clock (HCLK) is SYSCLK (216 MHz) */ - -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (54 MHz) */ - -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (108MHz) */ - -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* SDMMC dividers. Note that slower clocking is required when DMA is disabled - * in order to avoid RX overrun/TX underrun errors due to delayed responses - * to service FIFOs in interrupt driven mode. These values have not been - * tuned!!! - * - * SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(118+2)=400 KHz - */ - -/* Use the Falling edge of the SDIO_CLK clock to change the edge the - * data and commands are change on - */ - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - -#define STM32_SDMMC_INIT_CLKDIV (118 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* DMA ON: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(1+2)=16 MHz - * DMA OFF: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32F7_SDMMC_DMA -# define STM32_SDMMC_MMCXFR_CLKDIV (1 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (2 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -/* DMA ON: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(1+2)=16 MHz - * DMA OFF: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(2+2)=12 MHz - */ -//TODO #warning "Check Freq for 24mHz" - -#ifdef CONFIG_STM32F7_SDMMC_DMA -# define STM32_SDMMC_SDXFR_CLKDIV (1 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (2 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -/* FLASH wait states - * - * --------- ---------- ----------- - * VDD MAX SYSCLK WAIT STATES - * --------- ---------- ----------- - * 1.7-2.1 V 180 MHz 8 - * 2.1-2.4 V 216 MHz 9 - * 2.4-2.7 V 216 MHz 8 - * 2.7-3.6 V 216 MHz 7 - * --------- ---------- ----------- - */ - -#define BOARD_FLASH_WAITSTATES 7 - -/* Alternate function pin selections ************************************************/ - -#define GPIO_USART1_RX GPIO_USART1_RX_2 /* PB7 */ -#define GPIO_USART1_TX GPIO_USART1_TX_2 /* PB6 */ - -#define GPIO_USART2_RX GPIO_USART2_RX_2 /* PD6 */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ - -#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ -#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ - -#define GPIO_UART4_RX GPIO_UART4_RX_4 /* PD0 */ -#define GPIO_UART4_TX GPIO_UART4_TX_3 /* PA12 */ -#define GPIO_UART4_RS485_DIR GPIO_UART4_RTS_2 /* PB14 */ - -#define GPIO_UART5_RX GPIO_UART5_RX_4 /* PB8 */ -#define GPIO_UART5_TX GPIO_UART5_TX_4 /* PB9 */ - -#define GPIO_USART6_RX GPIO_USART6_RX_2 /* PG9 */ -#define GPIO_USART6_TX GPIO_USART6_TX_2 /* PG14 */ - -#define GPIO_UART7_RX GPIO_UART7_RX_1 /* PE8 */ -#define GPIO_UART7_TX GPIO_UART7_TX_1 /* PE7 */ - -/* USART8: has no remap - * - * GPIO_UART8_RX PE0 - * GPIO_UART8_TX PE1 - */ - -/* CAN - * - * CAN1 is routed to transceiver. - */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_5 /* PI9 */ -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 /* PD1 */ - -/* SPI - * SPI1-SPI4 sensors - */ - -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_2 /* PB5 */ -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 /* PA5 */ - -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_3 /* PI2 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_3 /* PI3 */ -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_4 /* PD3 */ - -#define GPIO_SPI4_MISO GPIO_SPI4_MISO_1 /* PE5 */ -#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_1 /* PE6 */ -#define GPIO_SPI4_SCK GPIO_SPI4_SCK_1 /* PE2 */ - -#define GPIO_SPI5_MISO GPIO_SPI5_MISO_1 /* PF8 */ -#define GPIO_SPI5_MOSI GPIO_SPI5_MOSI_2 /* PF11 */ -#define GPIO_SPI5_SCK GPIO_SPI5_SCK_2 /* PH6 */ - -/* The STM32 F7 connects to a SMSC LAN8720A PHY using these pins: - * - * STM32 F7 BOARD LAN8720A - * GPIO SIGNAL PIN NAME - * -------- ------------ ------------- - * PB11 RMII_TX_EN TXEN - * PB12 RMII_TXD0 TXD0 - * PB13 RMII_TXD1 TXD1 - * PC4 RMII_RXD0 RXD0/MODE0 - * PC5 RMII_RXD1 RXD1/MODE1 - * PD5 RMII_RXER RXER/PHYAD0 - * PA7 RMII_CRS_DV CRS_DV/MODE2 - * PC1 RMII_MDC MDC - * PA2 RMII_MDIO MDIO - * N/A NRST nRST - * PA1 RMII_REF_CLK nINT/REFCLK0 - * N/A OSC_25M XTAL1/CLKIN - * - * The PHY address is 0, since RMII_RXER/PHYAD0 features a pull down. - * After reset, RMII_RXER/PHYAD0 switches to the RXER function, - * receive errors can be detected using GPIO pin PD5 - */ - -#define GPIO_ETH_RMII_TX_EN GPIO_ETH_RMII_TX_EN_1 -#define GPIO_ETH_RMII_TXD0 GPIO_ETH_RMII_TXD0_1 -#define GPIO_ETH_RMII_TXD1 GPIO_ETH_RMII_TXD1_1 - -/* I2C Mapping - * - */ - -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_2 /* PF1 */ -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_2 /* PF0 */ - -#define GPIO_I2C2_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET |GPIO_PORTF | GPIO_PIN1) -#define GPIO_I2C2_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET |GPIO_PORTF | GPIO_PIN0) - -#define GPIO_I2C3_SCL GPIO_I2C3_SCL_2 /* PH7 */ -#define GPIO_I2C3_SDA GPIO_I2C3_SDA_2 /* PH8 */ - -#define GPIO_I2C3_SCL_GPIO (GPIO_OUTPUT |GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTH | GPIO_PIN7) -#define GPIO_I2C3_SDA_GPIO (GPIO_OUTPUT |GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTH | GPIO_PIN8) - -#define GPIO_I2C4_SCL GPIO_I2C4_SCL_2 /* PF14 */ -#define GPIO_I2C4_SDA GPIO_I2C4_SDA_2 /* PF15 */ - -#define GPIO_I2C4_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTF | GPIO_PIN14) -#define GPIO_I2C4_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTF | GPIO_PIN15) - -/* SDMMC1 - * - * VDD 3.3 - * GND - * SDMMC1_CK PC12 - * SDMMC1_CMD PD2 - * SDMMC1_D0 PC8 - * SDMMC1_D1 PC9 - * SDMMC1_D2 PC10 - * SDMMC1_D3 PC11 - */ - diff --git a/boards/av/x-v1/nuttx-config/include/board_dma_map.h b/boards/av/x-v1/nuttx-config/include/board_dma_map.h deleted file mode 100644 index bf44e58..0000000 --- a/boards/av/x-v1/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/* -| DMA1 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | SPI3_RX_1 | SPDIFRX_DT | SPI3_RX_2 | SPI2_RX | SPI2_TX | SPI3_TX_1 | SPDIFRX_CS | SPI3_TX_2 | -| Channel 1 | I2C1_RX | I2C3_RX | TIM7_UP_1 | - | TIM7_UP_2 | I2C1_RX_1 | I2C1_TX | I2C1_TX_1 | -| Channel 2 | TIM4_CH1 | - | I2C4_RX | TIM4_CH2 | - | I2C4_RX | TIM4_UP | TIM4_CH3 | -| Channel 3 | - | TIM2_UP_1 | I2C3_RX_1 | - | I2C3_TX | TIM2_CH1 | TIM2_CH2 | TIM2_UP_2 | -| | | TIM2_CH3 | | | | | TIM2_CH4_1 | TIM2_CH4_2 | -| Channel 4 | UART5_RX | USART3_RX | UART4_RX | USART3_TX_1 | UART4_TX | USART2_RX | USART2_TX | UART5_TX | -| Channel 5 | UART8_TX | UART7_TX | TIM3_CH4 | UART7_RX | TIM3_CH1 | TIM3_CH2 | UART8_RX | TIM3_CH3 | -| | | | TIM3_UP | | TIM3_TRIG | | | | -| Channel 6 | TIM5_CH3 | TIM5_CH4_1 | TIM5_CH1 | TIM5_CH4_2 | TIM5_CH2 | - | TIM5_UP_2 | - | -| | TIM5_UP_1 | TIM5_TRIG_1 | | TIM5_TRIG_2 | | | | | -| Channel 7 | - | TIM6_UP | I2C2_RX | I2C2_RX_1 | USART3_TX_2 | DAC1 | DAC2 | I2C2_TX | -| | | | | | | | | | -| Usage | UART5_RX | USART3_RX | | SPI2_RX | SPI2_TX | USART2_RX | UART8_RX | | - - -| DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | ADC1_1 | SAI1_A | TIM8_CH1_1 | SAI1_A_1 | ADC1_2 | SAI1_B_1 | TIM1_CH1_1 | SAI2_B_2 | -| | | | TIM8_CH2_1 | | | | TIM1_CH2_1 | | -| | | | TIM8_CH3_1 | | | | TIM1_CH3_1 | | -| Channel 1 | - | DCMI_1 | ADC2_1 | ADC2_2 | SAI1_B | SPI6_TX | SPI6_RX | DCMI_2 | -| Channel 2 | ADC3_1 | ADC3_2 | - | SPI5_RX_1 | SPI5_TX_1 | CRYP_OUT | CRYP_IN | HASH_IN | -| Channel 3 | SPI1_RX_1 | - | SPI1_RX_2 | SPI1_TX_1 | SAI2_A | SPI1_TX_2 | SAI2_B | QUADSPI | -| Channel 4 | SPI4_RX_1 | SPI4_TX_1 | USART1_RX_1 | SDMMC1_1 | - | USART1_RX_2 | SDMMC1_2 | USART1_TX | -| Channel 5 | - | USART6_RX_1 | USART6_RX_2 | SPI4_RX_2 | SPI4_TX_2 | - | USART6_TX_1 | USART6_TX_2 | -| Channel 6 | TIM1_TRIG_1 | TIM1_CH1_2 | TIM1_CH2_2 | TIM1_CH1 | TIM1_CH4 | TIM1_UP | TIM1_CH3_2 | - | -| | | | | | TIM1_TRIG_2 | | | | -| | | | | | TIM1_COM | | | | -| Channel 7 | - | TIM8_UP | TIM8_CH1_2 | TIM8_CH2_2 | TIM8_CH3_2 | SPI5_RX_2 | SPI5_TX_2 | TIM8_CH4 | -| | | | | | | | | TIM8_TRIG | -| | | | | | | | | TIM8_COM | -| | | | | | | | | | -| Usage | SPI1_RX_1 | | USART6_RX_2 | SPI1_TX_1 | | USART1_RX_2 | SDMMC1_2 | | - */ - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// DMAMAP_UART5_RX // DMA1, Stream 0, Channel 4 -// DMAMAP_USART3_RX // DMA1, Stream 1, Channel 4 -// AVAILABLE // DMA1, Stream 2, Channel 4 -#define DMAMAP_SPI2_RX DMAMAP_SPI2_RX_2 // DMA1, Stream 3, Channel 0 (SPI2 RX) -#define DMAMAP_SPI2_TX DMAMAP_SPI2_TX_2 // DMA1, Stream 4, Channel 0 (SPI2 TX) -// DMAMAP_USART2_RX // DMA1, Stream 5, Channel 4 -// DMAMAP_UART8_RX // DMA1, Stream 6, Channel 5 (CONSOLE) - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMAMAP_SPI1_RX DMAMAP_SPI1_RX_1 // DMA2, Stream 0, Channel 3 (SPI1 RX) -// AVAILABLE // DMA2, Stream 1 -#define DMAMAP_USART6_RX DMAMAP_USART6_RX_2 // DMA2, Stream 2, Channel 5 -#define DMAMAP_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 3, Channel 3 (SPI1 TX) -// AVAILABLE // DMA2, Stream 4 -#define DMAMAP_USART1_RX DMAMAP_USART1_RX_2 // DMA2, Stream 5, Channel 4 -#define DMAMAP_SDMMC1 DMAMAP_SDMMC1_2 // DMA2, Stream 6, Channel 4 diff --git a/boards/av/x-v1/nuttx-config/nsh/defconfig b/boards/av/x-v1/nuttx-config/nsh/defconfig deleted file mode 100644 index 73efed9..0000000 --- a/boards/av/x-v1/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,300 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_FS_PROCFS_EXCLUDE_ENVIRON is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_ARP is not set -# CONFIG_NSH_DISABLE_BASENAME is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CMP is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DD is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_DIRNAME is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_HEXDUMP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LOSETUP is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MKFIFO is not set -# CONFIG_NSH_DISABLE_MKRD is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_NSLOOKUP is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PUT is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNAME is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_NSH_DISABLE_WGET is not set -# CONFIG_NSH_DISABLE_XD is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/av/x-v1/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32f7" -CONFIG_ARCH_CHIP_STM32F777NI=y -CONFIG_ARCH_CHIP_STM32F7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_ETH0_PHY_LAN8720=y -CONFIG_EXAMPLES_CALIB_UDELAY=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FSUTILS_IPCFG=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_IOB_NBUFFERS=24 -CONFIG_IOB_THROTTLE=0 -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=3 -CONFIG_NET=y -CONFIG_NETDB_DNSCLIENT=y -CONFIG_NETDB_DNSCLIENT_ENTRIES=8 -CONFIG_NETDB_DNSSERVER_NOADDR=y -CONFIG_NETDEV_PHY_IOCTL=y -CONFIG_NETINIT_DHCPC=y -CONFIG_NETINIT_DNS=y -CONFIG_NETINIT_DNSIPADDR=0XC0A800FE -CONFIG_NETINIT_DRIPADDR=0XC0A800FE -CONFIG_NETINIT_THREAD=y -CONFIG_NETINIT_THREAD_PRIORITY=49 -CONFIG_NETUTILS_TELNETD=y -CONFIG_NET_ARP_IPIN=y -CONFIG_NET_ARP_SEND=y -CONFIG_NET_BROADCAST=y -CONFIG_NET_ICMP=y -CONFIG_NET_ICMP_SOCKET=y -CONFIG_NET_NACTIVESOCKETS=16 -CONFIG_NET_SOLINGER=y -CONFIG_NET_TCP=y -CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_WRITE_BUFFERS=y -CONFIG_NET_UDP=y -CONFIG_NET_UDP_CHECKSUMS=y -CONFIG_NET_UDP_WRITE_BUFFERS=y -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_TELNET=y -CONFIG_NSH_TELNET_LOGIN=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_MODE=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32F7_ADC1=y -CONFIG_STM32F7_BBSRAM=y -CONFIG_STM32F7_BBSRAM_FILES=5 -CONFIG_STM32F7_BKPSRAM=y -CONFIG_STM32F7_DMA1=y -CONFIG_STM32F7_DMA2=y -CONFIG_STM32F7_DMACAPABLE=y -CONFIG_STM32F7_ETHMAC=y -CONFIG_STM32F7_I2C2=y -CONFIG_STM32F7_I2C3=y -CONFIG_STM32F7_I2C4=y -CONFIG_STM32F7_I2C_DYNTIMEO=y -CONFIG_STM32F7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32F7_PHYADDR=0 -CONFIG_STM32F7_PHYSR=31 -CONFIG_STM32F7_PHYSR_100FD=0x18 -CONFIG_STM32F7_PHYSR_100HD=0x8 -CONFIG_STM32F7_PHYSR_10FD=0x14 -CONFIG_STM32F7_PHYSR_10HD=0x4 -CONFIG_STM32F7_PHYSR_ALTCONFIG=y -CONFIG_STM32F7_PHYSR_ALTMODE=0x1C -CONFIG_STM32F7_PROGMEM=y -CONFIG_STM32F7_PWR=y -CONFIG_STM32F7_RTC=y -CONFIG_STM32F7_RTC_HSECLOCK=y -CONFIG_STM32F7_RTC_MAGIC_REG=1 -CONFIG_STM32F7_SAVE_CRASHDUMP=y -CONFIG_STM32F7_SDMMC1=y -CONFIG_STM32F7_SDMMC_DMA=y -CONFIG_STM32F7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32F7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32F7_SPI1=y -CONFIG_STM32F7_SPI1_DMA=y -CONFIG_STM32F7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI2=y -CONFIG_STM32F7_SPI2_DMA=y -CONFIG_STM32F7_SPI2_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI4=y -CONFIG_STM32F7_SPI5=y -CONFIG_STM32F7_SPI_DMATHRESHOLD=8 -CONFIG_STM32F7_TIM14=y -CONFIG_STM32F7_TIM3=y -CONFIG_STM32F7_UART4=y -CONFIG_STM32F7_UART5=y -CONFIG_STM32F7_UART7=y -CONFIG_STM32F7_UART8=y -CONFIG_STM32F7_USART1=y -CONFIG_STM32F7_USART2=y -CONFIG_STM32F7_USART3=y -CONFIG_STM32F7_USART6=y -CONFIG_STM32F7_USART_BREAKS=y -CONFIG_STM32F7_USART_INVERT=y -CONFIG_STM32F7_USART_SINGLEWIRE=y -CONFIG_STM32F7_USART_SWAP=y -CONFIG_STM32F7_WWDG=y -CONFIG_SYSTEM_DHCPC_RENEW=y -CONFIG_SYSTEM_NSH=y -CONFIG_SYSTEM_PING=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RS485=y -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART5_BAUD=57600 -CONFIG_UART5_RXBUFSIZE=600 -CONFIG_UART5_RXDMA=y -CONFIG_UART5_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_RXDMA=y -CONFIG_UART8_SERIAL_CONSOLE=y -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_RXDMA=y -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=1500 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/av/x-v1/nuttx-config/scripts/script.ld b/boards/av/x-v1/nuttx-config/scripts/script.ld deleted file mode 100644 index db0f740..0000000 --- a/boards/av/x-v1/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,181 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F765IIT6 has 2048 KiB of main FLASH memory. This FLASH memory - * can be accessed from either the AXIM interface at address 0x0800:0000 or - * from the ITCM interface at address 0x0020:0000. - * - * Additional information, including the option bytes, is available at at - * FLASH at address 0x1ff0:0000 (AXIM) or 0x0010:0000 (ITCM). - * - * In the STM32F765IIT6, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash on ITCM at 0x0020:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x0010:0000 - * - * NuttX does not modify these option byes. On the unmodified NUCLEO-144 - * board, the BOOT0 pin is at ground so by default, the STM32F765IIT6 will - * boot from address 0x0020:0000 in ITCM FLASH. - * - * The STM32F765IIT6 also has 512 KiB of data SRAM (in addition to ITCM SRAM). - * SRAM is split up into three blocks: - * - * 1) 128 KiB of DTCM SRM beginning at address 0x2000:0000 - * 2) 368 KiB of SRAM1 beginning at address 0x2002:0000 - * 3) 16 KiB of SRAM2 beginning at address 0x2007:c000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * Bootloader reserves the first 32K bank (2 Mbytes Flash memory single bank) - * organization (256 bits read width) - */ - -MEMORY -{ - FLASH_ITCM (rx) : ORIGIN = 0x00208000, LENGTH = 2016K - FLASH_AXIM (rx) : ORIGIN = 0x08008000, LENGTH = 2016K - - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 16K - DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - SRAM1 (rwx) : ORIGIN = 0x20020000, LENGTH = 368K - SRAM2 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH_AXIM - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH_AXIM - - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH_AXIM - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH_AXIM - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > SRAM1 AT > FLASH_AXIM - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > SRAM1 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } - - .ramfunc : { - _sramfuncs = .; - *(.ramfunc .ramfunc.*) - . = ALIGN(4); - _eramfuncs = .; - } > ITCM_RAM AT > FLASH_AXIM - - _framfuncs = LOADADDR(.ramfunc); -} diff --git a/boards/av/x-v1/src/CMakeLists.txt b/boards/av/x-v1/src/CMakeLists.txt deleted file mode 100644 index c8e0738..0000000 --- a/boards/av/x-v1/src/CMakeLists.txt +++ /dev/null @@ -1,50 +0,0 @@ -############################################################################ -# -# Copyright (c) 2016 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. -# -############################################################################ - -add_library(drivers_board - i2c.cpp - init.c - sdio.c - spi.cpp - timer_config.cpp -) - -target_link_libraries(drivers_board - PRIVATE - arch_io_pins - arch_spi - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer -) diff --git a/boards/av/x-v1/src/board_config.h b/boards/av/x-v1/src/board_config.h deleted file mode 100644 index b87abf2..0000000 --- a/boards/av/x-v1/src/board_config.h +++ /dev/null @@ -1,196 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2018 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * av_x-v1 internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -#include - -/* Configuration ************************************************************************************/ - -#define BOARD_HAS_NBAT_V 1 // Only one Vbat to ADC -#define BOARD_HAS_NBAT_I 0 // No Ibat ADC - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that - * can be used by the Px4 Firmware in the adc driver - */ - -/* ADC defines to be used in sensors.cpp to read from a particular channel */ - -#define ADC1_CH(n) (n) -#define ADC1_GPIO(n) GPIO_ADC1_IN##n - -/* Define GPIO pins used as ADC N.B. Channel numbers must match below */ - -#define PX4_ADC_GPIO \ - /* PA0 */ ADC1_GPIO(0), \ - /* PA1 */ ADC1_GPIO(1), \ - /* PA2 */ ADC1_GPIO(2), \ - /* PA3 */ ADC1_GPIO(3), \ - /* PA4 */ ADC1_GPIO(4), \ - /* PB8 */ ADC1_GPIO(8), \ - /* PC0 */ ADC1_GPIO(10), \ - /* PC1 */ ADC1_GPIO(11), \ - /* PC2 */ ADC1_GPIO(12), \ - /* PC3 */ ADC1_GPIO(13), \ - /* PC4 */ ADC1_GPIO(14) - -/* Define Channel numbers must match above GPIO pin IN(n)*/ - -#define ADC_BATTERY1_VOLTAGE_CHANNEL /* PA0 */ ADC1_CH(0) - -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY1_VOLTAGE_CHANNEL)) - -/* HW has to large of R termination on ADC todo:change when HW value is chosen */ - -#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f) - -/* PWM - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 9 - -#define BOARD_CAPTURE_GPIO /* PD14 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTD|GPIO_PIN14) - -/* High-resolution timer */ -#define HRT_TIMER 5 /* use timer5 for the HRT */ -#define HRT_TIMER_CHANNEL 1 /* use capture/compare channel 3 */ - -/* RC Serial port */ - -#define RC_SERIAL_PORT "/dev/ttyS4" - -/* Power switch controls ******************************************************/ - -#define SDIO_SLOTNO 0 /* Only one slot */ -#define SDIO_MINOR 0 - -/* SD card bringup does not work if performed on the IDLE thread because it - * will cause waiting. Use either: - * - * CONFIG_BOARDCTL=y, OR - * CONFIG_BOARD_INITIALIZE=y && CONFIG_BOARD_INITTHREAD=y - */ - -#if defined(CONFIG_BOARD_INITIALIZE) && !defined(CONFIG_BOARDCTL) && !defined(CONFIG_BOARD_INITTHREAD) -# warning SDIO initialization cannot be perfomed on the IDLE thread -#endif - -/* AV-X_V1 never powers off the Servo rail */ - -#define BOARD_ADC_SERVO_VALID (1) - -#define ADC_BATTERY_VOLTAGE_CHANNEL 0 -#define ADC_BATTERY_CURRENT_CHANNEL 1 // TODO: review - -#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_nVDD_5V_PERIPH_OC)) -#define BOARD_ADC_HIPOWER_5V_OC (!px4_arch_gpioread(GPIO_nVDD_5V_HIPOWER_OC)) - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ - -#define BOARD_HAS_ON_RESET 1 - -#define PX4_GPIO_INIT_LIST { \ - PX4_ADC_GPIO, \ - GPIO_CAN1_RX, \ - GPIO_CAN1_TX, \ - } - -#define BOARD_ENABLE_CONSOLE_BUFFER - -#define BOARD_NUM_IO_TIMERS 6 - -__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); - -#define board_peripheral_reset(ms) - - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/av/x-v1/src/i2c.cpp b/boards/av/x-v1/src/i2c.cpp deleted file mode 100644 index ac2cb87..0000000 --- a/boards/av/x-v1/src/i2c.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(2), - initI2CBusInternal(3), - initI2CBusExternal(4), -}; diff --git a/boards/av/x-v1/src/init.c b/boards/av/x-v1/src/init.c deleted file mode 100644 index 8e12ee8..0000000 --- a/boards/av/x-v1/src/init.c +++ /dev/null @@ -1,244 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2018-2019 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * PX4FMU-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include "board_config.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include - -static int configure_switch(void); - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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(); -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initialization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - px4_platform_init(); - - /* configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - (void) board_hardfault_init(2, true); - -#ifdef CONFIG_MMCSD - - int ret = stm32_sdio_initialize(); - - if (ret != OK) { - syslog(LOG_ERR, "[boot] SDIO init failed\n"); - } - -#endif /* CONFIG_MMCSD */ - - configure_switch(); - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} - -/************************************************************************************ - * Name: configure_switch - * - * Description: - * Configure KSZ9897R ethernet switch on i2c - * - ************************************************************************************/ -static int configure_switch(void) -{ - int ret = PX4_ERROR; - - // attach to the i2c bus (internal) - struct i2c_master_s *i2c = px4_i2cbus_initialize(3); - - if (i2c == NULL) { - syslog(LOG_ERR, "[boot] I2C device not opened\n"); - } - - // ethernet switch enable - uint8_t txdata[] = {0x51, 0x00, 0x21, 0x00}; //0x5100, 0x2100 MSB to LSB here. - - struct i2c_msg_s msgv; - - msgv.frequency = 100000; - msgv.addr = 0x5F; - msgv.flags = 0; - msgv.buffer = &txdata[0]; - msgv.length = sizeof(txdata); - - unsigned retry_count = 0; - const unsigned retries = 5; - - do { - ret = I2C_TRANSFER(i2c, &msgv, 1); - - /* success */ - if (ret == PX4_OK) { - break; - - } else { - syslog(LOG_ERR, "[boot] ETH switch I2C fail: %d, retrying\n", ret); - } - - /* if we have already retried once, or we are going to give up, then reset the bus */ - if ((retry_count >= 1) || (retry_count >= retries)) { - I2C_RESET(i2c); - } - - } while (retry_count++ < retries); - - px4_i2cbus_uninitialize(i2c); - - return ret; -} diff --git a/boards/av/x-v1/src/sdio.c b/boards/av/x-v1/src/sdio.c deleted file mode 100644 index 93e25a8..0000000 --- a/boards/av/x-v1/src/sdio.c +++ /dev/null @@ -1,173 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include "chip.h" -#include "board_config.h" -#include "stm32_gpio.h" -#include "stm32_sdmmc.h" - -#ifdef CONFIG_MMCSD - - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Card detections requires card support and a card detection GPIO */ - -#define HAVE_NCD 1 -#if !defined(GPIO_SDMMC1_NCD) -# undef HAVE_NCD -#endif - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -static FAR struct sdio_dev_s *sdio_dev; -#ifdef HAVE_NCD -static bool g_sd_inserted = 0xff; /* Impossible value */ -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_ncd_interrupt - * - * Description: - * Card detect interrupt handler. - * - ****************************************************************************/ - -#ifdef HAVE_NCD -static int stm32_ncd_interrupt(int irq, FAR void *context) -{ - bool present; - - present = !stm32_gpioread(GPIO_SDMMC1_NCD); - - if (sdio_dev && present != g_sd_inserted) { - sdio_mediachange(sdio_dev, present); - g_sd_inserted = present; - } - - return OK; -} -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_sdio_initialize - * - * Description: - * Initialize SDIO-based MMC/SD card support - * - ****************************************************************************/ - -int stm32_sdio_initialize(void) -{ - int ret; - -#ifdef HAVE_NCD - /* Card detect */ - bool cd_status; - - /* Configure the card detect GPIO */ - stm32_configgpio(GPIO_SDMMC1_NCD); - - /* Register an interrupt handler for the card detect pin */ - stm32_gpiosetevent(GPIO_SDMMC1_NCD, true, true, true, stm32_ncd_interrupt); -#endif - - /* Mount the SDIO-based MMC/SD block driver */ - /* First, get an instance of the SDIO interface */ - finfo("Initializing SDIO slot %d\n", SDIO_SLOTNO); - - sdio_dev = sdio_initialize(SDIO_SLOTNO); - - if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", SDIO_SLOTNO); - return -ENODEV; - } - - /* Now bind the SDIO interface to the MMC/SD driver */ - - finfo("Bind SDIO to the MMC/SD driver, minor=%d\n", SDIO_MINOR); - - ret = mmcsd_slotinitialize(SDIO_MINOR, sdio_dev); - - if (ret != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); - return ret; - } - - finfo("Successfully bound SDIO to the MMC/SD driver\n"); - -#ifdef HAVE_NCD - /* Use SD card detect pin to check if a card is g_sd_inserted */ - - cd_status = !stm32_gpioread(GPIO_SDMMC1_NCD); - finfo("Card detect : %d\n", cd_status); - - sdio_mediachange(sdio_dev, cd_status); -#else - /* Assume that the SD card is inserted. What choice do we have? */ - - sdio_mediachange(sdio_dev, true); -#endif - - return OK; -} - -#endif /* CONFIG_MMCSD */ diff --git a/boards/av/x-v1/src/spi.cpp b/boards/av/x-v1/src/spi.cpp deleted file mode 100644 index 74b0648..0000000 --- a/boards/av/x-v1/src/spi.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2018 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ADIS16477, SPI::CS{GPIO::PortG, GPIO::Pin10}, SPI::DRDY{GPIO::PortJ, GPIO::Pin0}), - }), - initSPIBusExternal(SPI::Bus::SPI2, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin0}), - }), - initSPIBus(SPI::Bus::SPI4, { - initSPIDevice(DRV_BARO_DEVTYPE_LPS22HB, SPI::CS{GPIO::PortE, GPIO::Pin4}, SPI::DRDY{GPIO::PortK, GPIO::Pin1}), - }), - initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(DRV_MAG_DEVTYPE_LSM303AGR, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortK, GPIO::Pin7}), - initSPIDevice(DRV_ACC_DEVTYPE_LSM303AGR, SPI::CS{GPIO::PortB, GPIO::Pin0}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/av/x-v1/src/timer_config.cpp b/boards/av/x-v1/src/timer_config.cpp deleted file mode 100644 index 4feef97..0000000 --- a/boards/av/x-v1/src/timer_config.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2018 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1), - initIOTimer(Timer::Timer2), - initIOTimer(Timer::Timer8), - initIOTimer(Timer::Timer11), - initIOTimer(Timer::Timer10), - initIOTimer(Timer::Timer4), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortA, GPIO::Pin8}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortA, GPIO::Pin9}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortA, GPIO::Pin10}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortA, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel4}, {GPIO::PortA, GPIO::Pin3}), - initIOTimerChannel(io_timers, {Timer::Timer8, Timer::Channel2}, {GPIO::PortI, GPIO::Pin6}), - initIOTimerChannel(io_timers, {Timer::Timer11, Timer::Channel1}, {GPIO::PortF, GPIO::Pin7}), - initIOTimerChannel(io_timers, {Timer::Timer10, Timer::Channel1}, {GPIO::PortF, GPIO::Pin6}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/beaglebone/blue/CMakeLists.txt b/boards/beaglebone/blue/CMakeLists.txt deleted file mode 100644 index 826626a..0000000 --- a/boards/beaglebone/blue/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -############################################################################ -# -# Copyright (c) 2018-2019 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. -# -############################################################################ - -add_subdirectory(adc) diff --git a/boards/beaglebone/blue/adc/CMakeLists.txt b/boards/beaglebone/blue/adc/CMakeLists.txt deleted file mode 100644 index 5562acf..0000000 --- a/boards/beaglebone/blue/adc/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -############################################################################ -# -# Copyright (c) 2020 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. -# -############################################################################ - -px4_add_library(arch_adc - adc.cpp -) diff --git a/boards/beaglebone/blue/adc/adc.cpp b/boards/beaglebone/blue/adc/adc.cpp deleted file mode 100644 index 7d9aec5..0000000 --- a/boards/beaglebone/blue/adc/adc.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -#include - -#include - -#include -#include -#include - -#define ADC_SYSFS_PATH "/sys/bus/iio/devices/iio:device0" -#define ADC_MAX_CHAN 8 -int _channels_fd[ADC_MAX_CHAN]; - -int px4_arch_adc_init(uint32_t base_address) -{ - for (int i = 0; i < ADC_MAX_CHAN; i++) { - _channels_fd[i] = -1; - } - - return 0; -} - -void px4_arch_adc_uninit(uint32_t base_address) -{ - for (int i = 0; i < ADC_MAX_CHAN; i++) { - ::close(_channels_fd[i]); - _channels_fd[i] = -1; - } -} - -uint32_t px4_arch_adc_sample(uint32_t base_address, unsigned channel) -{ - if (channel > ADC_MAX_CHAN) { - PX4_ERR("channel %d out of range: %d", channel, ADC_MAX_CHAN); - return UINT32_MAX; // error - } - - // open channel if necessary - if (_channels_fd[channel] == -1) { - // ADC_SYSFS_PATH - char channel_path[strlen(ADC_SYSFS_PATH) + 20] {}; - - if (sprintf(channel_path, "%s/in_voltage%d_raw", ADC_SYSFS_PATH, channel) == -1) { - PX4_ERR("adc channel: %d\n", channel); - return UINT32_MAX; // error - } - - _channels_fd[channel] = ::open(channel_path, O_RDONLY); - } - - char buffer[10] {}; - - if (::pread(_channels_fd[channel], buffer, sizeof(buffer), 0) < 0) { - PX4_ERR("read channel %d failed", channel); - return UINT32_MAX; // error - } - - return atoi(buffer); -} - -float px4_arch_adc_reference_v() -{ - return BOARD_ADC_POS_REF_V; // 12-bit 1.8V ADC -} - -uint32_t px4_arch_adc_dn_fullcount() -{ - return 1 << 12; // 12 bit ADC -} diff --git a/boards/beaglebone/blue/cmake/init.cmake b/boards/beaglebone/blue/cmake/init.cmake deleted file mode 100644 index aa1b69b..0000000 --- a/boards/beaglebone/blue/cmake/init.cmake +++ /dev/null @@ -1,56 +0,0 @@ -############################################################################ -# -# Copyright (c) 2018-2019 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. -# -############################################################################ - -add_compile_options(-Wno-cast-align) - -include(ExternalProject) -ExternalProject_Add(librobotcontrol - GIT_REPOSITORY https://github.com/beagleboard/librobotcontrol.git - GIT_TAG 290e14f - CMAKE_CACHE_ARGS -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} - INSTALL_COMMAND "" - TEST_COMMAND "" - LOG_DOWNLOAD ON - LOG_CONFIGURE ON - LOG_BUILD ON -) - -ExternalProject_Get_Property(librobotcontrol install_dir) -set(ROBOTCONTROL_LIB_DIR ${install_dir}/src/librobotcontrol-build/library) -set(ROBOTCONTROL_INC_DIR ${install_dir}/src/librobotcontrol/library/include) - -include_directories(SYSTEM ${ROBOTCONTROL_INC_DIR}) -link_directories(${ROBOTCONTROL_LIB_DIR}) - -# add to prebuild -add_dependencies(prebuild_targets librobotcontrol) diff --git a/boards/beaglebone/blue/cmake/upload.cmake b/boards/beaglebone/blue/cmake/upload.cmake deleted file mode 100644 index 10a1e16..0000000 --- a/boards/beaglebone/blue/cmake/upload.cmake +++ /dev/null @@ -1,41 +0,0 @@ -############################################################################ -# -# Copyright (c) 2020 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. -# -############################################################################ - -add_custom_target(upload - COMMAND rsync -arh --progress - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/bbblue/*.config ${PX4_BINARY_DIR}/etc # source - debian@beaglebone.lan:/home/debian/px4 # destination - DEPENDS px4 - COMMENT "uploading px4" - USES_TERMINAL -) diff --git a/boards/beaglebone/blue/default.px4board b/boards/beaglebone/blue/default.px4board deleted file mode 100644 index 34459e5..0000000 --- a/boards/beaglebone/blue/default.px4board +++ /dev/null @@ -1,84 +0,0 @@ -CONFIG_PLATFORM_POSIX=y -CONFIG_BOARD_LINUX_TARGET=y -CONFIG_BOARD_TOOLCHAIN="arm-linux-gnueabihf" -CONFIG_BOARD_ARCHITECTURE="cortex-a8" -CONFIG_BOARD_TESTING=y -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_BAROMETER_BMP280=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU9250=y -CONFIG_DRIVERS_LINUX_PWM_OUT=y -CONFIG_DRIVERS_MAGNETOMETER_HMC5883=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_BATTERY_SIMULATOR=y -CONFIG_MODULES_SIMULATION_SIMULATOR_MAVLINK=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UUV_ATT_CONTROL=y -CONFIG_MODULES_UUV_POS_CONTROL=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DYN=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SHUTDOWN=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_DYN_HELLO=y -CONFIG_EXAMPLES_FAKE_GPS=y -CONFIG_EXAMPLES_FAKE_IMU=y -CONFIG_EXAMPLES_FAKE_MAGNETOMETER=y -CONFIG_EXAMPLES_HELLO=y -CONFIG_EXAMPLES_PX4_MAVLINK_DEBUG=y -CONFIG_EXAMPLES_PX4_SIMPLE_APP=y -CONFIG_EXAMPLES_WORK_ITEM=y diff --git a/boards/beaglebone/blue/include/px4_arch/adc.h b/boards/beaglebone/blue/include/px4_arch/adc.h deleted file mode 100644 index c72e7bd..0000000 --- a/boards/beaglebone/blue/include/px4_arch/adc.h +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -#define SYSTEM_ADC_BASE 0 // not used - -#define px4_arch_adc_temp_sensor_mask() (0) diff --git a/boards/beaglebone/blue/init/rc.board_defaults b/boards/beaglebone/blue/init/rc.board_defaults deleted file mode 100644 index d5f8c3b..0000000 --- a/boards/beaglebone/blue/init/rc.board_defaults +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 11.0 diff --git a/boards/beaglebone/blue/src/CMakeLists.txt b/boards/beaglebone/blue/src/CMakeLists.txt deleted file mode 100644 index 6c3896e..0000000 --- a/boards/beaglebone/blue/src/CMakeLists.txt +++ /dev/null @@ -1,40 +0,0 @@ -############################################################################ -# -# Copyright (c) 2018-2019 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. -# -############################################################################ - -px4_add_library(drivers_board - board_pwm_out.cpp - i2c.cpp - init.cpp - spi.cpp -) -target_link_libraries(drivers_board PRIVATE robotics_cape) diff --git a/boards/beaglebone/blue/src/board_config.h b/boards/beaglebone/blue/src/board_config.h deleted file mode 100644 index b6c5479..0000000 --- a/boards/beaglebone/blue/src/board_config.h +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2018 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * BBBLUE internal definitions - */ - -#pragma once - -#define BOARD_OVERRIDE_UUID "BBBLUEID00000000" // must be of length 16 -#define PX4_SOC_ARCH_ID PX4_SOC_ARCH_ID_BBBLUE - -#define BOARD_MAX_LEDS 4 // Number external of LED's this board has - - -// I2C -#define CONFIG_I2C 1 -#define PX4_NUMBER_I2C_BUSES 2 - -#define PX4_I2C_OBDEV_MPU9250 0x68 - - -// SPI -#define CONFIG_SPI 1 - - -// ADC channels: -#define ADC_CHANNELS (1 << 5) -#define BOARD_ADC_POS_REF_V (1.8f) - -#define ADC_BATTERY_VOLTAGE_CHANNEL 5 -#define ADC_BATTERY_CURRENT_CHANNEL ((uint8_t)(-1)) - - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -int rc_init(void); -void rc_cleaning(void); - -#ifdef __cplusplus -} -#endif - -#ifdef __RC_V0_3 -#define rc_i2c_lock_bus rc_i2c_claim_bus -#define rc_i2c_unlock_bus rc_i2c_release_bus -#define rc_i2c_get_lock rc_i2c_get_in_use_state - -#define rc_servo_send_pulse_us rc_send_servo_pulse_us - -#define rc_filter_empty rc_empty_filter -#define rc_filter_march rc_march_filter -#define rc_filter_prefill_inputs rc_prefill_filter_inputs -#define rc_filter_prefill_outputs rc_prefill_filter_outputs -#define rc_filter_butterworth_lowpass rc_butterworth_lowpass - -#endif diff --git a/boards/beaglebone/blue/src/board_pwm_out.cpp b/boards/beaglebone/blue/src/board_pwm_out.cpp deleted file mode 100644 index 5b728dd..0000000 --- a/boards/beaglebone/blue/src/board_pwm_out.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2018 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. - * - ****************************************************************************/ - -#ifndef MODULE_NAME -#define MODULE_NAME "bbblue_pwm_out" -#endif - -#include -#include -#include - -#include -#include - -#include "board_pwm_out.h" - -using namespace pwm_out; - -BBBlueRcPWMOut::BBBlueRcPWMOut(int max_num_outputs) : _num_outputs(max_num_outputs) -{ - if (_num_outputs > MAX_NUM_PWM) { - PX4_WARN("number of outputs too large. Setting to %i", MAX_NUM_PWM); - _num_outputs = MAX_NUM_PWM; - } -} - -BBBlueRcPWMOut::~BBBlueRcPWMOut() -{ - rc_cleaning(); -} - -int BBBlueRcPWMOut::init() -{ - rc_init(); - - return 0; -} - -int BBBlueRcPWMOut::send_output_pwm(const uint16_t *pwm, int num_outputs) -{ - if (num_outputs > _num_outputs) { - num_outputs = _num_outputs; - } - - int ret = 0; - - // pwm[ch] is duty_cycle in us - for (int ch = 0; ch < num_outputs; ++ch) { - ret += rc_servo_send_pulse_us(ch + 1, pwm[ch]); // converts to 1-based channel # - } - - return ret; -} - diff --git a/boards/beaglebone/blue/src/board_pwm_out.h b/boards/beaglebone/blue/src/board_pwm_out.h deleted file mode 100644 index 46d130d..0000000 --- a/boards/beaglebone/blue/src/board_pwm_out.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2018 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. - * - ****************************************************************************/ - -#pragma once - -#include - -#define BOARD_PWM_OUT_IMPL BBBlueRcPWMOut - -namespace pwm_out -{ - -/** - ** class BBBlueRcPWMOut - * PWM output class for BeagleBone Blue with Robotics Cape Library - * - * Ref: https://github.com/StrawsonDesign/Robotics_Cape_Installer - * http://www.strawsondesign.com/#!manual-servos - */ -class BBBlueRcPWMOut : public PWMOutBase -{ -public: - BBBlueRcPWMOut(int max_num_outputs); - virtual ~BBBlueRcPWMOut(); - - int init() override; - - int send_output_pwm(const uint16_t *pwm, int num_outputs) override; - -private: - static const int MAX_NUM_PWM = 8; - static const int MIN_FREQUENCY_PWM = 40; - - int _num_outputs; -}; - -} diff --git a/boards/beaglebone/blue/src/i2c.cpp b/boards/beaglebone/blue/src/i2c.cpp deleted file mode 100644 index 53199fc..0000000 --- a/boards/beaglebone/blue/src/i2c.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), // i2c-1: pins P9 17,18 - initI2CBusInternal(2), // i2c-2: pins P9 19,20 - bmp280, mpu9250 -}; diff --git a/boards/beaglebone/blue/src/init.cpp b/boards/beaglebone/blue/src/init.cpp deleted file mode 100644 index 7a3f8db..0000000 --- a/boards/beaglebone/blue/src/init.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2018 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * BBBLUE specific initialization - */ -#include -#include - -#include - -#include "board_config.h" - -// initialize roboticscape library similar to the deprecated rc_initialize() -int rc_init(void) -{ -#ifdef __RC_V0_3 - return rc_initialize(); -#else - - if (rc_get_state() == RUNNING) { return 0; } - - PX4_INFO("Initializing librobotcontrol ..."); - - // make sure another instance isn't running - rc_kill_existing_process(2.0f); - - // make PID file to indicate your project is running - rc_make_pid_file(); - - // start state as Uninitialized - rc_set_state(UNINITIALIZED); - - // initialize pinmux - /* - if (rc_pinmux_set_default()) { - PX4_ERR("rc_init failed to run rc_pinmux_set_default()"); - return -1; - } - // rc_pinmux_set_default() includes: rc_pinmux_set(DSM_HEADER_PIN, PINMUX_UART); - */ - - /* - // Due to device tree issue, rc_pinmux_set_default() currently does not work correctly - // with kernel 4.14, use a simplified version for now - // - // shared pins - int ret = 0; - ret |= rc_pinmux_set(DSM_HEADER_PIN, PINMUX_UART); - ret |= rc_pinmux_set(GPS_HEADER_PIN_3, PINMUX_UART); - ret |= rc_pinmux_set(GPS_HEADER_PIN_4, PINMUX_UART); - ret |= rc_pinmux_set(UART1_HEADER_PIN_3, PINMUX_UART); - ret |= rc_pinmux_set(UART1_HEADER_PIN_4, PINMUX_UART); - - if (ret != 0) { - PX4_ERR("rc_init failed to set default pinmux"); - return -1; - } - */ - - // no direct equivalent of configure_gpio_pins() - - if (rc_adc_init()) { - PX4_ERR("rc_init failed to run rc_adc_init()"); - return -1; - } - - if (rc_servo_init()) { // Configures the PRU to send servo pulses - PX4_ERR("rc_init failed to run rc_servo_init()"); - return -1; - } - - if (rc_servo_power_rail_en(1)) { // Turning On 6V Servo Power Rail - PX4_ERR("rc_init failed to run rc_servo_power_rail_en(1)"); - return -1; - } - - //i2c, barometer and mpu will be initialized later - - rc_set_state(RUNNING); - - return 0; -#endif -} - - -void rc_cleaning(void) -{ -#ifdef __RC_V0_3 - rc_cleanup(); return ; -#else - - if (rc_get_state() == EXITING) { return; } - - rc_set_state(EXITING); - - rc_adc_cleanup(); - - rc_servo_power_rail_en(0); - rc_servo_cleanup(); - - rc_remove_pid_file(); -#endif -} diff --git a/boards/beaglebone/blue/src/spi.cpp b/boards/beaglebone/blue/src/spi.cpp deleted file mode 100644 index 78f5f02..0000000 --- a/boards/beaglebone/blue/src/spi.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(1, { - initSPIDevice(DRV_DEVTYPE_UNUSED, 1), // spidev1.1 - initSPIDevice(DRV_DEVTYPE_UNUSED, 2), // spidev1.2 - }), -}; diff --git a/boards/bitcraze/crazyflie/CMakeLists.txt b/boards/bitcraze/crazyflie/CMakeLists.txt deleted file mode 100644 index 4fda6f2..0000000 --- a/boards/bitcraze/crazyflie/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -############################################################################ -# -# Copyright (c) 2018 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. -# -############################################################################ - -add_subdirectory(syslink) diff --git a/boards/bitcraze/crazyflie/default.px4board b/boards/bitcraze/crazyflie/default.px4board deleted file mode 100644 index 326273d..0000000 --- a/boards/bitcraze/crazyflie/default.px4board +++ /dev/null @@ -1,50 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_CONSTRAINED_FLASH=y -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_BOARD_COMPILE_DEFINITIONS="-Wno-narrowing" -CONFIG_DRIVERS_BAROMETER_LPS25H=y -CONFIG_DRIVERS_DISTANCE_SENSOR_VL53L0X=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU9250=y -CONFIG_DRIVERS_MAGNETOMETER_AKM_AK8963=y -CONFIG_DRIVERS_OPTICAL_FLOW_PMW3901=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -# CONFIG_EKF2_GNSS_YAW is not set -# CONFIG_EKF2_SIDESLIP is not set -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_SENSORS=y -# CONFIG_SENSORS_VEHICLE_AIRSPEED is not set -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/bitcraze/crazyflie/extras/bitcraze_crazyflie_bootloader.bin b/boards/bitcraze/crazyflie/extras/bitcraze_crazyflie_bootloader.bin deleted file mode 100644 index 954ef6e..0000000 Binary files a/boards/bitcraze/crazyflie/extras/bitcraze_crazyflie_bootloader.bin and /dev/null differ diff --git a/boards/bitcraze/crazyflie/firmware.prototype b/boards/bitcraze/crazyflie/firmware.prototype deleted file mode 100644 index 9cd986e..0000000 --- a/boards/bitcraze/crazyflie/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 12, - "magic": "Crazyflie", - "description": "Firmware for the Crazyflie 2.0", - "image": "", - "build_time": 0, - "summary": "CRAZYFLIE", - "version": "0.1", - "image_size": 0, - "image_maxsize": 1032192, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/bitcraze/crazyflie/init/rc.board_defaults b/boards/bitcraze/crazyflie/init/rc.board_defaults deleted file mode 100644 index 7eb6055..0000000 --- a/boards/bitcraze/crazyflie/init/rc.board_defaults +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -# system_power unavailable -param set-default CBRK_SUPPLY_CHK 894281 - -param set-default SYS_AUTOSTART 4900 - -# don't probe external I2C -param set-default SENS_EXT_I2C_PRB 0 diff --git a/boards/bitcraze/crazyflie/init/rc.board_sensors b/boards/bitcraze/crazyflie/init/rc.board_sensors deleted file mode 100644 index 3d3ca47..0000000 --- a/boards/bitcraze/crazyflie/init/rc.board_sensors +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -# -# Bitcraze Crazyflie specific board sensors init -#------------------------------------------------------------------------------ - -board_adc start - -# Onboard I2C -if mpu9250_i2c -I -b 3 -a 0x69 -R 6 start; then - sleep 1 # wait for mpu9250 to be configured with bypass enabled - ak8963 -I -b 3 -R 4 start - lps25h -I -b 3 start -fi - -# Optical flow deck -vl53l0x start -X diff --git a/boards/bitcraze/crazyflie/nuttx-config/include/board.h b/boards/bitcraze/crazyflie/nuttx-config/include/board.h deleted file mode 100644 index d3c2f95..0000000 --- a/boards/bitcraze/crazyflie/nuttx-config/include/board.h +++ /dev/null @@ -1,223 +0,0 @@ -/************************************************************************************ - * configs/crazyflie/include/board.h - * include/arch/board/board.h - * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ************************************************************************************/ - -#ifndef __CONFIG_CRAZYFLIE_INCLUDE_BOARD_H -#define __CONFIG_CRAZYFLIE_INCLUDE_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32.h" - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The Crazyflie 2.0 uses a 8MHz crystal connected to the HSE. - * - * This is the canonical configuration: - * System Clock source : PLL (HSE) - * SYSCLK(Hz) : 168000000 Determined by PLL configuration - * HCLK(Hz) : 168000000 (STM32_RCC_CFGR_HPRE) - * AHB Prescaler : 1 (STM32_RCC_CFGR_HPRE) - * APB1 Prescaler : 4 (STM32_RCC_CFGR_PPRE1) - * APB2 Prescaler : 2 (STM32_RCC_CFGR_PPRE2) - * HSE Frequency(Hz) : 8000000 (STM32_BOARD_XTAL) - * PLLM : 8 (STM32_PLLCFG_PLLM) - * PLLN : 336 (STM32_PLLCFG_PLLN) - * PLLP : 2 (STM32_PLLCFG_PLLP) - * PLLQ : 7 (STM32_PLLCFG_PLLQ) - * Main regulator output voltage : Scale1 mode Needed for high speed SYSCLK - * Flash Latency(WS) : 5 - * Prefetch Buffer : OFF - * Instruction cache : ON - * Data cache : ON - * Require 48MHz for USB OTG FS, : Enabled - * SDIO and RNG clock - */ - -/* HSI - 16 MHz RC factory-trimmed - * LSI - 32 KHz RC - * HSE - On-board crystal frequency is 8MHz - * LSE - not installed - */ - -#define STM32_BOARD_XTAL 8000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -//#define STM32_LSE_FREQUENCY 32768 - -/* Main PLL Configuration. - * - * PLL source is HSE - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * = (8,000,000 / 8) * 336 - * = 336,000,000 - * SYSCLK = PLL_VCO / PLLP - * = 336,000,000 / 2 = 168,000,000 - * USB OTG FS, SDIO and RNG Clock - * = PLL_VCO / PLLQ - * = 48,000,000 - */ - -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(8) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(336) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(7) - -#define STM32_SYSCLK_FREQUENCY 168000000ul - -/* AHB clock (HCLK) is SYSCLK (168MHz) */ - -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (42MHz) */ - -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (84MHz) */ - -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx - * otherwise frequency is 2xAPBx. - * Note: TIM1,8-11 are on APB2, others on APB1 - */ - -#define BOARD_TIM1_FREQUENCY STM32_APB2_TIM1_CLKIN -#define BOARD_TIM2_FREQUENCY STM32_APB1_TIM2_CLKIN -#define BOARD_TIM3_FREQUENCY STM32_APB1_TIM3_CLKIN -#define BOARD_TIM4_FREQUENCY STM32_APB1_TIM4_CLKIN -#define BOARD_TIM5_FREQUENCY STM32_APB1_TIM5_CLKIN -#define BOARD_TIM6_FREQUENCY STM32_APB1_TIM6_CLKIN -#define BOARD_TIM7_FREQUENCY STM32_APB1_TIM7_CLKIN -#define BOARD_TIM8_FREQUENCY STM32_APB2_TIM8_CLKIN -#define BOARD_TIM9_FREQUENCY STM32_APB2_TIM9_CLKIN -#define BOARD_TIM10_FREQUENCY STM32_APB2_TIM10_CLKIN -#define BOARD_TIM11_FREQUENCY STM32_APB2_TIM11_CLKIN -#define BOARD_TIM12_FREQUENCY STM32_APB1_TIM12_CLKIN -#define BOARD_TIM13_FREQUENCY STM32_APB1_TIM13_CLKIN -#define BOARD_TIM14_FREQUENCY STM32_APB1_TIM14_CLKIN - -/* Alternate function pin selections ************************************************/ - -/* - * UARTs. - * - */ -/* E_TX2 / E_RX2 */ -#define GPIO_USART2_RX GPIO_USART2_RX_1 -#define GPIO_USART2_TX GPIO_USART2_TX_1 - -/* E_TX1 / E_RX1 */ -#define GPIO_USART3_RX GPIO_USART3_RX_2 -#define GPIO_USART3_TX GPIO_USART3_TX_2 - -/* NRF51 via syslink */ -#define GPIO_USART6_RX GPIO_USART6_RX_1 -#define GPIO_USART6_TX GPIO_USART6_TX_1 - -/* UART DMA configuration for USART6 */ -#define DMAMAP_USART6_RX DMAMAP_USART6_RX_2 - -/* - * I2C - * - * The optional _GPIO configurations allow the I2C driver to manually - * reset the bus to clear stuck slaves. They match the pin configuration, - * but are normally-high GPIOs. - */ -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_1 -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_1 -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN6) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN7) - -#define GPIO_I2C3_SCL GPIO_I2C3_SCL_1 -#define GPIO_I2C3_SDA GPIO_I2C3_SDA_1 -#define GPIO_I2C3_SCL_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN8) -#define GPIO_I2C3_SDA_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN9) - -/* - * SPI - * - * E_MISO, E_MOSI, E_SCK exposed on headers - */ -#define GPIO_SPI1_MISO (GPIO_SPI1_MISO_1|GPIO_SPEED_50MHz) -#define GPIO_SPI1_MOSI (GPIO_SPI1_MOSI_1|GPIO_SPEED_50MHz) -#define GPIO_SPI1_SCK (GPIO_SPI1_SCK_1|GPIO_SPEED_50MHz) - -/* XXX since we allocate the HP work stack from CCM RAM on normal system startup, - SPI1 will never run in DMA mode - so we can just give it a random config here. - What we really need to do is to make DMA configurable per channel, and always - disable it for SPI1. */ -#define DMACHAN_SPI1_RX DMAMAP_SPI1_RX_1 -#define DMACHAN_SPI1_TX DMAMAP_SPI1_TX_2 - -#endif /* __CONFIG_CRAZYFLIE_INCLUDE_BOARD_H */ diff --git a/boards/bitcraze/crazyflie/nuttx-config/nsh/defconfig b/boards/bitcraze/crazyflie/nuttx-config/nsh/defconfig deleted file mode 100644 index 85951b8..0000000 --- a/boards/bitcraze/crazyflie/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,212 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_SPI_CALLBACK is not set -# CONFIG_STM32_CCMEXCLUDE is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/bitcraze/crazyflie/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F405RG=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0016 -CONFIG_CDCACM_PRODUCTSTR="PX4 Crazyflie v2.0" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=2000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="Bitcraze AB" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FAT_DIRECT_RETRY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MM_REGIONS=2 -CONFIG_MTD=y -CONFIG_MTD_AT24XX=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_FATDEVNO=0 -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_MMCSDSPIPORTNO=1 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=196608 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32_ADC1=y -CONFIG_STM32_BBSRAM=y -CONFIG_STM32_BBSRAM_FILES=5 -CONFIG_STM32_BKPSRAM=y -CONFIG_STM32_CCMDATARAM=y -CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y -CONFIG_STM32_DMA1=y -CONFIG_STM32_DMA2=y -CONFIG_STM32_FLASH_PREFETCH=y -CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_STM32_I2C1=y -CONFIG_STM32_I2C3=y -CONFIG_STM32_I2CTIMEOMS=10 -CONFIG_STM32_I2CTIMEOTICKS=10 -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_OTGFS=y -CONFIG_STM32_PWR=y -CONFIG_STM32_RTC=y -CONFIG_STM32_RTC_HSECLOCK=y -CONFIG_STM32_RTC_MAGIC_REG=1 -CONFIG_STM32_SAVE_CRASHDUMP=y -CONFIG_STM32_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32_SPI1=y -CONFIG_STM32_USART2=y -CONFIG_STM32_USART3=y -CONFIG_STM32_USART6=y -CONFIG_STM32_USART_BREAKS=y -CONFIG_STM32_USART_SINGLEWIRE=y -CONFIG_STM32_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_RXBUFSIZE=300 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=300 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_SERIAL_CONSOLE=y -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=128 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=64 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/bitcraze/crazyflie/nuttx-config/scripts/script.ld b/boards/bitcraze/crazyflie/nuttx-config/scripts/script.ld deleted file mode 100644 index 0c6b669..0000000 --- a/boards/bitcraze/crazyflie/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,145 +0,0 @@ -/**************************************************************************** - * configs/crazyflie/scripts/ld.script - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F405RG has 1024Kb of FLASH beginning at address 0x0800:0000 and - * 192Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of CCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 0x4000 of flash is reserved for the bootloader. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08004000, LENGTH = 1008K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - ccsram (rwx) : ORIGIN = 0x10000000, LENGTH = 64K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(board_get_manifest) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/bitcraze/crazyflie/src/CMakeLists.txt b/boards/bitcraze/crazyflie/src/CMakeLists.txt deleted file mode 100644 index d574b47..0000000 --- a/boards/bitcraze/crazyflie/src/CMakeLists.txt +++ /dev/null @@ -1,48 +0,0 @@ -############################################################################ -# -# Copyright (c) 2015 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. -# -############################################################################ - -add_library(drivers_board - i2c.cpp - init.c - led.c - mtd.cpp - spi.cpp - timer_config.cpp - usb.c -) -target_link_libraries(drivers_board - PRIVATE - arch_spi - drivers__led # drv_led_start - px4_layer -) diff --git a/boards/bitcraze/crazyflie/src/board_config.h b/boards/bitcraze/crazyflie/src/board_config.h deleted file mode 100644 index b69a021..0000000 --- a/boards/bitcraze/crazyflie/src/board_config.h +++ /dev/null @@ -1,224 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-2016 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * PX4-CRAZYFLIE internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ -/* Configuration ************************************************************************************/ - -/* Crazyflie GPIOs **********************************************************************************/ -/* LEDs */ - - -/* Radio TX indicator */ -#define GPIO_LED_RED_L (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\ - GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN0) -/* Radio RX indicator */ -#define GPIO_LED_GREEN_L (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\ - GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN1) -#define GPIO_LED_GREEN_R (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\ - GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN2) -#define GPIO_LED_RED_R (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\ - GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN3) - -/* PX4: armed state indicator ; Stock FW: Blinking while charging */ -#define GPIO_LED_BLUE_L (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTD|GPIO_PIN2) - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_OVERLOAD_LED LED_RED -#define BOARD_ARMED_LED LED_BLUE -#define BOARD_ARMED_STATE_LED LED_GREEN - -#define LED_TX 4 -#define LED_RX 5 - -#define GPIO_FSYNC_MPU9250 (GPIO_OUTPUT|GPIO_PORTC|GPIO_PIN14) // Needs to be set low -#define GPIO_DRDY_MPU9250 (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTC|GPIO_PIN13) - - -#define GPIO_NRF_TXEN (GPIO_INPUT|GPIO_PULLUP|GPIO_EXTI|GPIO_PORTA|GPIO_PIN4) - - -/* - * I2C busses - */ -#define PX4_I2C_BUS_ONBOARD_HZ 400000 -#define PX4_I2C_BUS_EXPANSION_HZ 400000 - -#define PX4_I2C_BUS_MTD 1 - -#define BOARD_NUMBER_I2C_BUSES 3 -#define BOARD_I2C_BUS_CLOCK_INIT {PX4_I2C_BUS_ONBOARD_HZ, 100000, PX4_I2C_BUS_EXPANSION_HZ} - - -/* Devices on the onboard bus. - * - * Note that these are unshifted addresses. - */ -#define PX4_I2C_OBDEV_MPU9250 0x69 - -/* USB OTG FS - * - * PA9 OTG_FS_VBUS VBUS sensing - */ -#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN9) - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that can be used by the Px4 Firmware in the adc driver - */ -#define ADC_CHANNELS 0 - -/* Tone alarm output : These are only applicable when the buzzer deck is attached */ -#define TONE_ALARM_TIMER 5 /* timer 5 */ -#define TONE_ALARM_CHANNEL 3 /* channel 3 */ -#define GPIO_TONE_ALARM_IDLE (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN2) -#define GPIO_TONE_ALARM (GPIO_ALT|GPIO_AF2|GPIO_SPEED_2MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN2) -#define GPIO_TONE_ALARM_NEG (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN3) - -/* PWM -*/ - -#define DIRECT_PWM_OUTPUT_CHANNELS 4 - -/* This board overrides the defaults by providing - * PX4_PWM_ALTERNATE_RANGES and a replacement set of - * constants - */ - - -/* PWM directly wired to transistor. Duty cycle directly corresponds to power - * So we need to override the defaults - */ - -#define PX4_PWM_ALTERNATE_RANGES -#define PWM_LOWEST_MIN 0 -#define PWM_HIGHEST_MAX 255 - -/* High-resolution timer */ -#define HRT_TIMER 8 /* use timer8 for the HRT */ -#define HRT_TIMER_CHANNEL 1 /* use capture/compare channel */ - - -#define BOARD_ENABLE_CONSOLE_BUFFER -#define BOARD_CONSOLE_BUFFER_SIZE (1024*3) - -__BEGIN_DECLS - -/**************************************************************************************************** - * Public Types - ****************************************************************************************************/ - -/**************************************************************************************************** - * Public data - ****************************************************************************************************/ - -#ifndef __ASSEMBLY__ - -/**************************************************************************************************** - * Public Functions - ****************************************************************************************************/ - -/**************************************************************************************************** - * Name: board_peripheral_reset - * - * Description: - * Called to reset the periferal bus - * - ****************************************************************************************************/ - -#define board_peripheral_reset(ms) - -/**************************************************************************************************** - * Name: stm32_usbinitialize - * - * Description: - * Called to configure USB IO. - * - ****************************************************************************************************/ - -extern void stm32_usbinitialize(void); - -/**************************************************************************** - * Name: board_i2c_initialize - * - * Description: - * Called to set I2C bus frequencies. - * - ****************************************************************************/ - -int board_i2c_initialize(void); - -/**************************************************************************************************** - * Name: stm32_spiinitialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the PX4FMU board. - * - ****************************************************************************************************/ - -extern void stm32_spiinitialize(void); - -/************************************************************************************ - * Name: stm32_spi_bus_initialize - * - * Description: - * Called to configure SPI Buses. - * - ************************************************************************************/ - -extern int stm32_spi_bus_initialize(void); - - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/bitcraze/crazyflie/src/i2c.cpp b/boards/bitcraze/crazyflie/src/i2c.cpp deleted file mode 100644 index bb73d27..0000000 --- a/boards/bitcraze/crazyflie/src/i2c.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), - initI2CBusInternal(3), -}; diff --git a/boards/bitcraze/crazyflie/src/init.c b/boards/bitcraze/crazyflie/src/init.c deleted file mode 100644 index c1364b7..0000000 --- a/boards/bitcraze/crazyflie/src/init.c +++ /dev/null @@ -1,161 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file crazyflie_init.c - * - * Crazyflie specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "board_config.h" -#include - -#include - -#include -#include - -#include -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/**************************************************************************** - * Protected Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/************************************************************************************ - * Name: stm32_boardinitialize - * - * Description: - * All STM32 architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. - * - ************************************************************************************/ - -__EXPORT void -stm32_boardinitialize(void) -{ - /* configure LEDs */ - - board_autoled_initialize(); - - /* configure SPI interfaces */ - - stm32_spiinitialize(); - - stm32_usbinitialize(); -} - -/**************************************************************************** - * Name: board_app_initialize - * - * Description: - * Perform architecture specific initialization - * - ****************************************************************************/ - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - px4_platform_init(); - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_off(LED_GREEN); - led_off(LED_BLUE); - led_off(LED_TX); - led_off(LED_RX); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - -#ifdef CONFIG_SPI - stm32_spi_bus_initialize(); -#endif - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/bitcraze/crazyflie/src/led.c b/boards/bitcraze/crazyflie/src/led.c deleted file mode 100644 index b2ea621..0000000 --- a/boards/bitcraze/crazyflie/src/led.c +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013 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. - * - ****************************************************************************/ - -/** - * @file crazyflie_led.c - * - * Crazyflie LED backend. - */ - -#include - -#include - -#include "stm32.h" -#include "board_config.h" - -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -static uint32_t g_ledmap[] = { - GPIO_LED_BLUE_L, // Indexed by LED_BLUE - GPIO_LED_RED_R, // Indexed by LED_RED, LED_AMBER - 0, // Indexed by LED_SAFETY - GPIO_LED_GREEN_R, // Indexed by LED_GREEN - GPIO_LED_RED_L, // Indexed by LED_TX - GPIO_LED_GREEN_L // Indexed by LED_RX -}; - - -__EXPORT void led_init() -{ - /* Configure LED1 GPIO for output */ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - if (g_ledmap[l]) { - px4_arch_configgpio(g_ledmap[l]); - } - } -} - -__EXPORT void led_on(int led) -{ - /* Pull down to switch on */ - px4_arch_gpiowrite(g_ledmap[led], g_ledmap[led] & GPIO_OUTPUT_SET ? true : false); -} - -__EXPORT void led_off(int led) -{ - /* Pull up to switch off */ - px4_arch_gpiowrite(g_ledmap[led], g_ledmap[led] & GPIO_OUTPUT_SET ? false : true); -} - -__EXPORT void led_toggle(int led) -{ - if (px4_arch_gpioread(g_ledmap[led])) { - px4_arch_gpiowrite(g_ledmap[led], false); - - } else { - px4_arch_gpiowrite(g_ledmap[led], true); - } -} diff --git a/boards/bitcraze/crazyflie/src/mtd.cpp b/boards/bitcraze/crazyflie/src/mtd.cpp deleted file mode 100644 index 2b00e23..0000000 --- a/boards/bitcraze/crazyflie/src/mtd.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include -// KiB BS nB -static const px4_mft_device_t i2c1 = { // 24AA64FT on Base 8K 32 X 256 - .bus_type = px4_mft_device_t::I2C, - .devid = PX4_MK_I2C_DEVID(1, 0x50) -}; - - -static const px4_mtd_entry_t fmu_eeprom = { - .device = &i2c1, - .npart = 2, - .partd = { - { - .type = MTD_PARAMETERS, - .path = "/fs/mtd_params", - .nblocks = 128 - }, - { - .type = MTD_WAYPOINTS, - .path = "/fs/mtd_waypoints", - .nblocks = 128 - - } - }, -}; - -static const px4_mtd_manifest_t board_mtd_config = { - .nconfigs = 1, - .entries = { - &fmu_eeprom, - } -}; - -static const px4_mft_entry_s mtd_mft = { - .type = MTD, - .pmft = (void *) &board_mtd_config, -}; - -static const px4_mft_s mft = { - .nmft = 1, - .mfts = { - &mtd_mft - } -}; - -const px4_mft_s *board_get_manifest(void) -{ - return &mft; -} diff --git a/boards/bitcraze/crazyflie/src/spi.cpp b/boards/bitcraze/crazyflie/src/spi.cpp deleted file mode 100644 index bd5f6db..0000000 --- a/boards/bitcraze/crazyflie/src/spi.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include "board_config.h" - -#include -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(SPIDEV_MMCSD(0), SPI::CS{GPIO::PortC, GPIO::Pin12}), - initSPIDevice(DRV_FLOW_DEVTYPE_PMW3901, SPI::CS{GPIO::PortB, GPIO::Pin4}), - initSPIDevice(DRV_DEVTYPE_UNUSED, SPI::CS{GPIO::PortB, GPIO::Pin5}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); - -/************************************************************************************ - * Name: stm32_spi_bus_initialize - * - * Description: - * Called to configure SPI buses on PX4FMU board. - * - ************************************************************************************/ -static struct spi_dev_s *spi_expansion; - -__EXPORT int stm32_spi_bus_initialize(void) -{ - /* Configure SPI-based devices */ - - /* Get the external SPI port */ - spi_expansion = stm32_spibus_initialize(1); - - if (!spi_expansion) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 1); - return -ENODEV; - } - -#ifdef CONFIG_MMCSD - int ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi_expansion); - - if (ret != OK) { - syslog(LOG_ERR, "[boot] FAILED to bind SPI port 1 to the MMCSD driver\n"); - return -ENODEV; - } - -#endif - - return OK; -} diff --git a/boards/bitcraze/crazyflie/src/timer_config.cpp b/boards/bitcraze/crazyflie/src/timer_config.cpp deleted file mode 100644 index 33532b0..0000000 --- a/boards/bitcraze/crazyflie/src/timer_config.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016 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 - -/* IO Timers normally free-run at 1MHz - * Here we make adjustments to the Frequency that sets the timer's prescale - * so that the prescale is set to 0 - */ -#define TIMx_CLKIN 1000000 - -static inline constexpr io_timers_t initIOTimerOverrideClockFreq(Timer::Timer timer) -{ - io_timers_t ret = initIOTimer(timer); - ret.clock_freq = TIMx_CLKIN; - return ret; -} - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimerOverrideClockFreq(Timer::Timer2), - initIOTimerOverrideClockFreq(Timer::Timer4), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel2}, {GPIO::PortA, GPIO::Pin1}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel4}, {GPIO::PortB, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel1}, {GPIO::PortA, GPIO::Pin15}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel4}, {GPIO::PortB, GPIO::Pin9}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/bitcraze/crazyflie/src/usb.c b/boards/bitcraze/crazyflie/src/usb.c deleted file mode 100644 index 29bae3d..0000000 --- a/boards/bitcraze/crazyflie/src/usb.c +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file crazyflie_usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include "board_config.h" - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -/************************************************************************************ - * Name: stm32_usbinitialize - * - * Description: - * Called to setup USB-related GPIO pins for the PX4-STM32F4Discovery 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_STM32_OTGFS - stm32_configgpio(GPIO_OTGFS_VBUS); - /* XXX We only support device mode - stm32_configgpio(GPIO_OTGFS_PWRON); - stm32_configgpio(GPIO_OTGFS_OVER); - */ -#endif -} - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} - diff --git a/boards/bitcraze/crazyflie/syslink/CMakeLists.txt b/boards/bitcraze/crazyflie/syslink/CMakeLists.txt deleted file mode 100644 index ebf6c04..0000000 --- a/boards/bitcraze/crazyflie/syslink/CMakeLists.txt +++ /dev/null @@ -1,47 +0,0 @@ -############################################################################ -# -# Copyright (c) 2016 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. -# -############################################################################ - -px4_add_module( - MODULE modules__syslink - MAIN syslink - COMPILE_FLAGS - -Wno-cast-align # TODO: fix and enable - SRCS - ringbuffer.cpp - syslink_main.cpp - syslink_bridge.cpp - syslink_memory.cpp - syslink.c - DEPENDS - battery - ) diff --git a/boards/bitcraze/crazyflie/syslink/crtp.h b/boards/bitcraze/crazyflie/syslink/crtp.h deleted file mode 100644 index a874659..0000000 --- a/boards/bitcraze/crazyflie/syslink/crtp.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2016 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. - * - ****************************************************************************/ - -#pragma once - - -#include - -#define CRTP_PORT_CONSOLE 0x00 -#define CRTP_PORT_PARAM 0x02 -#define CRTP_PORT_COMMANDER 0x03 -#define CRTP_PORT_MEM 0x04 -#define CRTP_PORT_LOG 0x05 - -#define CRTP_PORT_MAVLINK 0x08 // Non-standard port for transmitting mavlink messages - -#define CRTP_PORT_PLATFORM 0x0D -#define CRTP_PORT_DEBUG 0x0E -#define CRTP_PORT_LINK 0x0F - -#define CRTP_NULL(x) (((x).header & 0xf3) == 0xf3) - -// 1 byte header + 31 bytes data = 32 (max ESB packet size) -// With the NRF51, this could be increased to ~250, but the Crazyradio PA uses a NRF24 which can't do this -#define CRTP_MAX_DATA_SIZE 31 - -typedef struct { - uint8_t size; // Total size of this message, including the header (placed here to overlap with syslink length field) - union { - uint8_t header; - struct { - uint8_t channel : 2; - uint8_t link : 2; - uint8_t port : 4; - }; - }; - - uint8_t data[CRTP_MAX_DATA_SIZE]; -} __attribute__((packed)) crtp_message_t; - - -typedef struct { - float roll; // -20 to 20 - float pitch; - float yaw; // -150 to 150 - uint16_t thrust; -} crtp_commander; diff --git a/boards/bitcraze/crazyflie/syslink/drv_deck.h b/boards/bitcraze/crazyflie/syslink/drv_deck.h deleted file mode 100644 index 2b21ae5..0000000 --- a/boards/bitcraze/crazyflie/syslink/drv_deck.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016 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. - * - ****************************************************************************/ - -/* Definitions for crazyflie related drivers */ - -#ifndef _DRV_CRAZYFLIE_H -#define _DRV_CRAZYFLIE_H - -#include -#include -#include - - -#define DECK_DEVICE_PATH "/dev/deck" - - - -/* structure of the data stored in deck memory */ -typedef struct { - uint8_t header; // Should be 0xEB - uint32_t pins; - uint8_t vendorId; - uint8_t productId; - uint8_t crc; - uint8_t data[104]; - -} __attribute__((packed)) deck_descriptor_t; - - - -/* - * ioctl() definitions - */ - -#define _DECKIOCBASE (0x4100) -#define _DECKIOC(_n) (_PX4_IOC(_DECKIOCBASE, _n)) - -/** get the number of connected deck memory devices */ -#define DECKIOGNUM _DECKIOC(0) - -/** set the index of the current deck memory being accessed */ -#define DECKIOSNUM _DECKIOC(1) - -#define DECKIOID _DECKIOC(2) - - - - -#endif diff --git a/boards/bitcraze/crazyflie/syslink/ringbuffer.cpp b/boards/bitcraze/crazyflie/syslink/ringbuffer.cpp deleted file mode 100644 index 04d31dd..0000000 --- a/boards/bitcraze/crazyflie/syslink/ringbuffer.cpp +++ /dev/null @@ -1,402 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2013-2015 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. - * - ****************************************************************************/ - -/** - * @file ringbuffer.cpp - * - * A flexible ringbuffer class. - */ - -#include "ringbuffer.h" -#include - -namespace ringbuffer -{ - -RingBuffer::RingBuffer(unsigned num_items, size_t item_size) : - _num_items(num_items), - _item_size(item_size), - _buf(new char[(_num_items + 1) * item_size]), - _head(_num_items), - _tail(_num_items) -{} - -RingBuffer::~RingBuffer() -{ - delete[] _buf; -} - -unsigned -RingBuffer::_next(unsigned index) -{ - return (0 == index) ? _num_items : (index - 1); -} - -bool -RingBuffer::empty() -{ - return _tail == _head; -} - -bool -RingBuffer::full() -{ - return _next(_head) == _tail; -} - -unsigned -RingBuffer::size() -{ - return (_buf != nullptr) ? _num_items : 0; -} - -void -RingBuffer::flush() -{ - while (!empty()) { - get(nullptr); - } -} - -bool -RingBuffer::put(const void *val, size_t val_size) -{ - unsigned next = _next(_head); - - if (next != _tail) { - if ((val_size == 0) || (val_size > _item_size)) { - val_size = _item_size; - } - - memcpy(&_buf[_head * _item_size], val, val_size); - _head = next; - return true; - - } else { - return false; - } -} - -bool -RingBuffer::put(int8_t val) -{ - return put(&val, sizeof(val)); -} - -bool -RingBuffer::put(uint8_t val) -{ - return put(&val, sizeof(val)); -} - -bool -RingBuffer::put(int16_t val) -{ - return put(&val, sizeof(val)); -} - -bool -RingBuffer::put(uint16_t val) -{ - return put(&val, sizeof(val)); -} - -bool -RingBuffer::put(int32_t val) -{ - return put(&val, sizeof(val)); -} - -bool -RingBuffer::put(uint32_t val) -{ - return put(&val, sizeof(val)); -} - -bool -RingBuffer::put(int64_t val) -{ - return put(&val, sizeof(val)); -} - -bool -RingBuffer::put(uint64_t val) -{ - return put(&val, sizeof(val)); -} - -bool -RingBuffer::put(float val) -{ - return put(&val, sizeof(val)); -} - -bool -RingBuffer::put(double val) -{ - return put(&val, sizeof(val)); -} - -bool -RingBuffer::force(const void *val, size_t val_size) -{ - bool overwrote = false; - - for (;;) { - if (put(val, val_size)) { - break; - } - - get(nullptr); - overwrote = true; - } - - return overwrote; -} - -bool -RingBuffer::force(int8_t val) -{ - return force(&val, sizeof(val)); -} - -bool -RingBuffer::force(uint8_t val) -{ - return force(&val, sizeof(val)); -} - -bool -RingBuffer::force(int16_t val) -{ - return force(&val, sizeof(val)); -} - -bool -RingBuffer::force(uint16_t val) -{ - return force(&val, sizeof(val)); -} - -bool -RingBuffer::force(int32_t val) -{ - return force(&val, sizeof(val)); -} - -bool -RingBuffer::force(uint32_t val) -{ - return force(&val, sizeof(val)); -} - -bool -RingBuffer::force(int64_t val) -{ - return force(&val, sizeof(val)); -} - -bool -RingBuffer::force(uint64_t val) -{ - return force(&val, sizeof(val)); -} - -bool -RingBuffer::force(float val) -{ - return force(&val, sizeof(val)); -} - -bool -RingBuffer::force(double val) -{ - return force(&val, sizeof(val)); -} - -bool -RingBuffer::get(void *val, size_t val_size) -{ - if (_tail != _head) { - unsigned candidate; - unsigned next; - - if ((val_size == 0) || (val_size > _item_size)) { - val_size = _item_size; - } - - do { - /* decide which element we think we're going to read */ - candidate = _tail; - - /* and what the corresponding next index will be */ - next = _next(candidate); - - /* go ahead and read from this index */ - if (val != nullptr) { - memcpy(val, &_buf[candidate * _item_size], val_size); - } - - /* if the tail pointer didn't change, we got our item */ - } while (!__sync_bool_compare_and_swap(&_tail, candidate, next)); - - return true; - - } else { - return false; - } -} - -bool -RingBuffer::get(int8_t &val) -{ - return get(&val, sizeof(val)); -} - -bool -RingBuffer::get(uint8_t &val) -{ - return get(&val, sizeof(val)); -} - -bool -RingBuffer::get(int16_t &val) -{ - return get(&val, sizeof(val)); -} - -bool -RingBuffer::get(uint16_t &val) -{ - return get(&val, sizeof(val)); -} - -bool -RingBuffer::get(int32_t &val) -{ - return get(&val, sizeof(val)); -} - -bool -RingBuffer::get(uint32_t &val) -{ - return get(&val, sizeof(val)); -} - -bool -RingBuffer::get(int64_t &val) -{ - return get(&val, sizeof(val)); -} - -bool -RingBuffer::get(uint64_t &val) -{ - return get(&val, sizeof(val)); -} - -bool -RingBuffer::get(float &val) -{ - return get(&val, sizeof(val)); -} - -bool -RingBuffer::get(double &val) -{ - return get(&val, sizeof(val)); -} - -unsigned -RingBuffer::space() -{ - unsigned tail, head; - - /* - * Make a copy of the head/tail pointers in a fashion that - * may err on the side of under-estimating the free space - * in the buffer in the case that the buffer is being updated - * asynchronously with our check. - * If the head pointer changes (reducing space) while copying, - * re-try the copy. - */ - do { - head = _head; - tail = _tail; - } while (head != _head); - - return (tail >= head) ? (_num_items - (tail - head)) : (head - tail - 1); -} - -unsigned -RingBuffer::count() -{ - /* - * Note that due to the conservative nature of space(), this may - * over-estimate the number of items in the buffer. - */ - return _num_items - space(); -} - -bool -RingBuffer::resize(unsigned new_size) -{ - char *old_buffer; - char *new_buffer = new char [(new_size + 1) * _item_size]; - - if (new_buffer == nullptr) { - return false; - } - - old_buffer = _buf; - _buf = new_buffer; - _num_items = new_size; - _head = new_size; - _tail = new_size; - delete[] old_buffer; - return true; -} - -void -RingBuffer::print_info(const char *name) -{ - printf("%s %u/%lu (%u/%u @ %p)\n", - name, - _num_items, - (unsigned long)_num_items * _item_size, - _head, - _tail, - _buf); -} - -} // namespace ringbuffer diff --git a/boards/bitcraze/crazyflie/syslink/ringbuffer.h b/boards/bitcraze/crazyflie/syslink/ringbuffer.h deleted file mode 100644 index 04bd9fa..0000000 --- a/boards/bitcraze/crazyflie/syslink/ringbuffer.h +++ /dev/null @@ -1,179 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2013-2015 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. - * - ****************************************************************************/ - -/** - * @file ringbuffer.h - * - * A flexible ringbuffer class. - */ - -#pragma once - -#include -#include -#include - -namespace ringbuffer __EXPORT -{ - -class RingBuffer -{ -public: - RingBuffer(unsigned num_items, size_t item_size); - virtual ~RingBuffer(); - - /** - * Put an item into the buffer. - * - * @param val Item to put - * @return true if the item was put, false if the buffer is full - */ - bool put(const void *val, size_t val_size = 0); - - bool put(int8_t val); - bool put(uint8_t val); - bool put(int16_t val); - bool put(uint16_t val); - bool put(int32_t val); - bool put(uint32_t val); - bool put(int64_t val); - bool put(uint64_t val); - bool put(float val); - bool put(double val); - - /** - * Force an item into the buffer, discarding an older item if there is not space. - * - * @param val Item to put - * @return true if an item was discarded to make space - */ - bool force(const void *val, size_t val_size = 0); - - bool force(int8_t val); - bool force(uint8_t val); - bool force(int16_t val); - bool force(uint16_t val); - bool force(int32_t val); - bool force(uint32_t val); - bool force(int64_t val); - bool force(uint64_t val); - bool force(float val); - bool force(double val); - - /** - * Get an item from the buffer. - * - * @param val Item that was gotten - * @return true if an item was got, false if the buffer was empty. - */ - bool get(void *val, size_t val_size = 0); - - bool get(int8_t &val); - bool get(uint8_t &val); - bool get(int16_t &val); - bool get(uint16_t &val); - bool get(int32_t &val); - bool get(uint32_t &val); - bool get(int64_t &val); - bool get(uint64_t &val); - bool get(float &val); - bool get(double &val); - - /* - * Get the number of slots free in the buffer. - * - * @return The number of items that can be put into the buffer before - * it becomes full. - */ - unsigned space(void); - - /* - * Get the number of items in the buffer. - * - * @return The number of items that can be got from the buffer before - * it becomes empty. - */ - unsigned count(void); - - /* - * Returns true if the buffer is empty. - */ - bool empty(); - - /* - * Returns true if the buffer is full. - */ - bool full(); - - /* - * Returns the capacity of the buffer, or zero if the buffer could - * not be allocated. - */ - unsigned size(); - - /* - * Empties the buffer. - */ - void flush(); - - /* - * resize the buffer. This is unsafe to be called while - * a producer or consuming is running. Caller is responsible - * for any locking needed - * - * @param new_size new size for buffer - * @return true if the resize succeeds, false if - * not (allocation error) - */ - bool resize(unsigned new_size); - - /* - * printf() some info on the buffer - */ - void print_info(const char *name); - -private: - unsigned _num_items; - const size_t _item_size; - char *_buf; - volatile unsigned _head; /**< insertion point in _item_size units */ - volatile unsigned _tail; /**< removal point in _item_size units */ - - unsigned _next(unsigned index); - - /* we don't want this class to be copied */ - RingBuffer(const RingBuffer &); - RingBuffer operator=(const RingBuffer &); -}; - -} // namespace ringbuffer diff --git a/boards/bitcraze/crazyflie/syslink/syslink.c b/boards/bitcraze/crazyflie/syslink/syslink.c deleted file mode 100644 index d9e40d1..0000000 --- a/boards/bitcraze/crazyflie/syslink/syslink.c +++ /dev/null @@ -1,153 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2016 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. - * - ****************************************************************************/ - -/** - * @file syslink.c - * - * Crazyflie Syslink protocol implementation - * - * @author Dennis Shtatnov - */ - - -#include -#include -#include -#include -#include -#include -#include - - -#include "syslink.h" - - -const char *syslink_magic = "\xbc\xcf"; - -void syslink_parse_init(syslink_parse_state *state) -{ - state->state = SYSLINK_STATE_START; - state->index = 0; -} - - -int syslink_parse_char(syslink_parse_state *state, char c, syslink_message_t *msg) -{ - - switch (state->state) { - case SYSLINK_STATE_START: - if (c == syslink_magic[state->index]) { - state->index++; - - } else { - state->index = 0; - } - - if (syslink_magic[state->index] == '\x00') { - state->state = SYSLINK_STATE_TYPE; - } - - break; - - case SYSLINK_STATE_TYPE: - msg->type = c; - state->state = SYSLINK_STATE_LENGTH; - break; - - case SYSLINK_STATE_LENGTH: - msg->length = c; - - if (c > SYSLINK_MAX_DATA_LEN) { // Too long - state->state = SYSLINK_STATE_START; - - } else { - state->state = c > 0 ? SYSLINK_STATE_DATA : SYSLINK_STATE_CKSUM; - } - - state->index = 0; - break; - - case SYSLINK_STATE_DATA: - msg->data[state->index++] = c; - - if (state->index >= msg->length) { - state->state = SYSLINK_STATE_CKSUM; - state->index = 0; - syslink_compute_cksum(msg); - } - - break; - - case SYSLINK_STATE_CKSUM: - if (c != msg->cksum[state->index]) { - PX4_INFO("Bad checksum"); - state->state = SYSLINK_STATE_START; - state->index = 0; - break; - } - - state->index++; - - if (state->index >= (int)sizeof(msg->cksum)) { - state->state = SYSLINK_STATE_START; - state->index = 0; - return 1; - } - - - break; - } - - return 0; - -} - -/* - Computes Fletcher 8bit checksum per RFC1146 - A := A + D[i] - B := B + A -*/ -void syslink_compute_cksum(syslink_message_t *msg) -{ - uint8_t a = 0, b = 0; - uint8_t *Di = (uint8_t *)msg, *end = Di + (2 + msg->length) * sizeof(uint8_t); - - while (Di < end) { - a = a + *Di; - b = b + a; - ++Di; - } - - msg->cksum[0] = a; - msg->cksum[1] = b; -} diff --git a/boards/bitcraze/crazyflie/syslink/syslink.h b/boards/bitcraze/crazyflie/syslink/syslink.h deleted file mode 100644 index d0ccb14..0000000 --- a/boards/bitcraze/crazyflie/syslink/syslink.h +++ /dev/null @@ -1,141 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2016 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. - * - ****************************************************************************/ - -#pragma once - -#include - - -extern const char *syslink_magic; - -#define SYSLINK_GROUP 0xF0 - -#define SYSLINK_RADIO 0x00 -#define SYSLINK_RADIO_RAW 0x00 -#define SYSLINK_RADIO_CHANNEL 0x01 -#define SYSLINK_RADIO_DATARATE 0x02 -#define SYSLINK_RADIO_CONTWAVE 0x03 -#define SYSLINK_RADIO_RSSI 0x04 -#define SYSLINK_RADIO_ADDRESS 0x05 - -#define SYSLINK_PM 0x10 -#define SYSLINK_PM_SOURCE 0x10 -#define SYSLINK_PM_ONOFF_SWITCHOFF 0x11 -#define SYSLINK_PM_BATTERY_VOLTAGE 0x12 -#define SYSLINK_PM_BATTERY_STATE 0x13 -#define SYSLINK_PM_BATTERY_AUTOUPDATE 0x14 - -#define SYSLINK_OW 0x20 -#define SYSLINK_OW_SCAN 0x20 -#define SYSLINK_OW_GETINFO 0x21 -#define SYSLINK_OW_READ 0x22 -#define SYSLINK_OW_WRITE 0x23 - -// Limited by the CRTP packet which is limited by the ESB protocol used by the NRF -#define SYSLINK_MAX_DATA_LEN 32 - -#define SYSLINK_RADIO_RATE_250K 0 -#define SYSLINK_RADIO_RATE_1M 1 -#define SYSLINK_RADIO_RATE_2M 2 - - -typedef struct { - uint8_t type; - uint8_t length; - uint8_t data[SYSLINK_MAX_DATA_LEN]; - uint8_t cksum[2]; -} __attribute__((packed)) syslink_message_t; - - -#define OW_SIZE 112 -#define OW_READ_BLOCK 29 -#define OW_WRITE_BLOCK 26 // TODO: Use even, but can be up to 27 - -typedef struct { - uint8_t nmems; -} __attribute__((packed)) syslink_ow_scan_t; - -typedef struct { - uint8_t family; // Should by 0x0D for most chips - uint8_t sn[6]; - uint8_t crc; -} __attribute__((packed)) syslink_ow_id_t; - -typedef struct { - uint8_t idx; - uint8_t id[8]; -} __attribute__((packed)) syslink_ow_getinfo_t; - -typedef struct { - uint8_t idx; - uint16_t addr; - uint8_t data[OW_READ_BLOCK]; -} __attribute__((packed)) syslink_ow_read_t; - -typedef struct { - uint8_t idx; - uint16_t addr; - uint16_t length; - uint8_t data[OW_WRITE_BLOCK]; -} __attribute__((packed)) syslink_ow_write_t; - - -typedef enum { - SYSLINK_STATE_START = 0, - SYSLINK_STATE_TYPE, - SYSLINK_STATE_LENGTH, - SYSLINK_STATE_DATA, - SYSLINK_STATE_CKSUM -} SYSLINK_STATE; - -typedef struct { - SYSLINK_STATE state; - int index; - -} syslink_parse_state; - - -#ifdef __cplusplus -extern "C" { -#endif - -extern void syslink_parse_init(syslink_parse_state *state); - -// Returns true if a full message was parsed -extern int syslink_parse_char(syslink_parse_state *state, char c, syslink_message_t *msg); - -extern void syslink_compute_cksum(syslink_message_t *msg); - -#ifdef __cplusplus -} -#endif diff --git a/boards/bitcraze/crazyflie/syslink/syslink_bridge.cpp b/boards/bitcraze/crazyflie/syslink/syslink_bridge.cpp deleted file mode 100644 index 7c7ac1e..0000000 --- a/boards/bitcraze/crazyflie/syslink/syslink_bridge.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2016 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. - * - ****************************************************************************/ - - -/** - * @file syslink_bridge.cpp - * - * Character device for talking to the radio as a plain serial port - */ - -#include "syslink_main.h" -#include - - - -SyslinkBridge::SyslinkBridge(Syslink *link) : - CDev("/dev/bridge0"), - _link(link), - _readbuffer(16, sizeof(crtp_message_t)) -{ - _msg_to_send.header = 0; - _msg_to_send.size = sizeof(_msg_to_send.header); - _msg_to_send.port = CRTP_PORT_MAVLINK; - _msg_to_send_size_remaining = CRTP_MAX_DATA_SIZE - 1; // to send 30 bytes of data - //ideally _msg_to_send.data size should be CRTP_MAX_DATA_SIZE but cfbridge does not receive 31 bytes of data due to a bug somewhere -} - -int -SyslinkBridge::init() -{ - int ret = CDev::init(); - - /* if init failed, bail now */ - if (ret != OK) { - PX4_DEBUG("CDev init failed"); - return ret; - } - - - return ret; -} - -pollevent_t -SyslinkBridge::poll_state(struct file *filp) -{ - pollevent_t state = 0; - - if (!_readbuffer.empty()) { - state |= POLLIN; - } - - if (_link->_writebuffer.space() > 0) { - state |= POLLOUT; - } - - return state; -} - -ssize_t -SyslinkBridge::read(struct file *filp, char *buffer, size_t buflen) -{ - int nread = 0; - crtp_message_t msg; - - while (!_readbuffer.empty() && buflen >= sizeof(CRTP_MAX_DATA_SIZE)) { - _readbuffer.get(&msg, sizeof(msg)); - int size = msg.size - sizeof(msg.header); - memcpy(buffer, &msg.data, size); - - nread += size; - buffer += size; - buflen -= size; - } - - return nread; -} - -ssize_t -SyslinkBridge::write(struct file *filp, const char *buffer, size_t buflen) -{ - int buflen_rem = buflen; - - while (buflen_rem > 0) { - - int datasize = MIN(_msg_to_send_size_remaining, buflen_rem); - _msg_to_send.size += datasize; - memcpy(&_msg_to_send.data[CRTP_MAX_DATA_SIZE - 1 - _msg_to_send_size_remaining], buffer, datasize); - - buffer += datasize; - _msg_to_send_size_remaining -= datasize; - buflen_rem -= datasize; - - - if (_msg_to_send_size_remaining == 0) { - - if (_link->_writebuffer.force(&_msg_to_send, sizeof(crtp_message_t))) { - PX4_WARN("write buffer overflow"); - } - - _msg_to_send.size = sizeof(_msg_to_send.header); - _msg_to_send_size_remaining = CRTP_MAX_DATA_SIZE - 1; - } - } - - return buflen; -} - -int -SyslinkBridge::ioctl(struct file *filp, int cmd, unsigned long arg) -{ - // All termios commands should be silently ignored as they are handled - - switch (cmd) { - - case FIONSPACE: - *((int *) arg) = _link->_writebuffer.space() * CRTP_MAX_DATA_SIZE; - return 0; - - default: - /* give it to the superclass */ - CDev::ioctl(filp, cmd, arg); - return 0; - } -} - - -void -SyslinkBridge::pipe_message(crtp_message_t *msg) -{ - _readbuffer.force(msg, sizeof(msg->size) + msg->size); - poll_notify(POLLIN); -} diff --git a/boards/bitcraze/crazyflie/syslink/syslink_main.cpp b/boards/bitcraze/crazyflie/syslink/syslink_main.cpp deleted file mode 100644 index 909d841..0000000 --- a/boards/bitcraze/crazyflie/syslink/syslink_main.cpp +++ /dev/null @@ -1,864 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2016 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. - * - ****************************************************************************/ - -/** - * @file syslink_main.cpp - * Entry point for syslink module used to communicate with the NRF module on a Crazyflie - */ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -#include - -#include "crtp.h" -#include "syslink_main.h" -#include "drv_deck.h" - - - -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -extern "C" { __EXPORT int syslink_main(int argc, char *argv[]); } - - -Syslink *g_syslink = nullptr; - -Syslink::Syslink() : - pktrate(0), - nullrate(0), - rxrate(0), - txrate(0), - _syslink_task(-1), - _task_running(false), - _bootloader_mode(false), - _count(0), - _null_count(0), - _count_in(0), - _count_out(0), - _lasttime(0), - _lasttxtime(0), - _lastrxtime(0), - _fd(0), - _queue(2, sizeof(syslink_message_t)), - _writebuffer(16, sizeof(crtp_message_t)), - _rssi(input_rc_s::RSSI_MAX), - _bstate(BAT_DISCHARGING) -{ - px4_sem_init(&memory_sem, 0, 0); - /* memory_sem use case is a signal */ - px4_sem_setprotocol(&memory_sem, SEM_PRIO_NONE); -} - - -int -Syslink::start() -{ - _task_running = true; - _syslink_task = px4_task_spawn_cmd( - "syslink", - SCHED_DEFAULT, - SCHED_PRIORITY_DEFAULT, - 1500, - Syslink::task_main_trampoline, - NULL - ); - - return 0; -} - - -int -Syslink::set_datarate(uint8_t datarate) -{ - syslink_message_t msg; - msg.type = SYSLINK_RADIO_DATARATE; - msg.length = 1; - msg.data[0] = datarate; - return send_message(&msg); -} - -int -Syslink::set_channel(uint8_t channel) -{ - syslink_message_t msg; - msg.type = SYSLINK_RADIO_CHANNEL; - msg.length = 1; - msg.data[0] = channel; - return send_message(&msg); -} - -int -Syslink::set_address(uint64_t addr) -{ - syslink_message_t msg; - msg.type = SYSLINK_RADIO_ADDRESS; - msg.length = 5; - memcpy(&msg.data, &addr, 5); - return send_message(&msg); -} - -int -Syslink::send_queued_raw_message() -{ - if (_writebuffer.empty()) { - return 0; - } - - _lasttxtime = hrt_absolute_time(); - - syslink_message_t msg; - msg.type = SYSLINK_RADIO_RAW; - - _count_out++; - - _writebuffer.get(&msg.length, sizeof(crtp_message_t)); - - return send_message(&msg); -} - - -void -Syslink::update_params(bool force_set) -{ - param_t _param_radio_channel = param_find("SLNK_RADIO_CHAN"); - param_t _param_radio_rate = param_find("SLNK_RADIO_RATE"); - param_t _param_radio_addr1 = param_find("SLNK_RADIO_ADDR1"); - param_t _param_radio_addr2 = param_find("SLNK_RADIO_ADDR2"); - - - // reading parameter values into temp variables - - int32_t channel, rate, addr1, addr2; - uint64_t addr = 0; - - param_get(_param_radio_channel, &channel); - param_get(_param_radio_rate, &rate); - param_get(_param_radio_addr1, &addr1); - param_get(_param_radio_addr2, &addr2); - - memcpy(&addr, &addr2, 4); - memcpy(((char *)&addr) + 4, &addr1, 4); - - - hrt_abstime t = hrt_absolute_time(); - - // request updates if needed - - if (channel != this->_channel || force_set) { - this->_channel = channel; - set_channel(channel); - this->_params_update[0] = t; - this->_params_ack[0] = 0; - } - - if (rate != this->_rate || force_set) { - this->_rate = rate; - set_datarate(rate); - this->_params_update[1] = t; - this->_params_ack[1] = 0; - } - - if (addr != this->_addr || force_set) { - this->_addr = addr; - set_address(addr); - this->_params_update[2] = t; - this->_params_ack[2] = 0; - } -} - -// 1M 8N1 serial connection to NRF51 -int -Syslink::open_serial(const char *dev) -{ -#ifndef B1000000 -#define B1000000 1000000 -#endif - - int rate = B1000000; - - // open uart - int fd = px4_open(dev, O_RDWR | O_NOCTTY); - int termios_state = -1; - - if (fd < 0) { - PX4_ERR("failed to open uart device!"); - return -1; - } - - // set baud rate - struct termios config; - tcgetattr(fd, &config); - - // clear ONLCR flag (which appends a CR for every LF) - config.c_oflag = 0; - config.c_lflag &= ~(ECHO | ECHONL | ICANON | IEXTEN | ISIG); - - // Disable hardware flow control - config.c_cflag &= ~CRTSCTS; - - - /* Set baud rate */ - if (cfsetispeed(&config, rate) < 0 || cfsetospeed(&config, rate) < 0) { - warnx("ERR SET BAUD %s: %d\n", dev, termios_state); - px4_close(fd); - return -1; - } - - if ((termios_state = tcsetattr(fd, TCSANOW, &config)) < 0) { - PX4_WARN("ERR SET CONF %s\n", dev); - px4_close(fd); - return -1; - } - - return fd; -} - - - -int -Syslink::task_main_trampoline(int argc, char *argv[]) -{ - g_syslink->task_main(); - return 0; -} - -void -Syslink::task_main() -{ - _bridge = new SyslinkBridge(this); - _bridge->init(); - - _memory = new SyslinkMemory(this); - _memory->init(); - - // int ret; - - /* Open serial port */ - const char *dev = "/dev/ttyS2"; - _fd = open_serial(dev); - - if (_fd < 0) { - err(1, "can't open %s", dev); - return; - } - - - /* Set non-blocking */ - /* - int flags = fcntl(_fd, F_GETFL, 0); - fcntl(_fd, F_SETFL, flags | O_NONBLOCK); - */ - - px4_arch_configgpio(GPIO_NRF_TXEN); - - px4_pollfd_struct_t fds[2]; - fds[0].fd = _fd; - fds[0].events = POLLIN; - - _params_sub = orb_subscribe(ORB_ID(parameter_update)); - fds[1].fd = _params_sub; - fds[1].events = POLLIN; - - int error_counter = 0; - - char buf[64]; - int nread; - - syslink_parse_state state; - syslink_message_t msg; - - syslink_parse_init(&state); - - //setup initial parameters - update_params(true); - - while (_task_running) { - int poll_ret = px4_poll(fds, 2, 500); - - /* handle the poll result */ - if (poll_ret == 0) { - /* timeout: this means none of our providers is giving us data */ - - } else if (poll_ret < 0) { - /* this is seriously bad - should be an emergency */ - if (error_counter < 10 || error_counter % 50 == 0) { - /* use a counter to prevent flooding (and slowing us down) */ - PX4_ERR("[syslink] ERROR return value from poll(): %d" - , poll_ret); - } - - error_counter++; - - } else { - if (fds[0].revents & POLLIN) { - if ((nread = read(_fd, buf, sizeof(buf))) < 0) { - continue; - } - - for (int i = 0; i < nread; i++) { - if (syslink_parse_char(&state, buf[i], &msg)) { - handle_message(&msg); - } - } - } - - if (fds[1].revents & POLLIN) { - parameter_update_s update; - orb_copy(ORB_ID(parameter_update), _params_sub, &update); - update_params(false); - } - } - - } - - close(_fd); -} - -void -Syslink::handle_message(syslink_message_t *msg) -{ - hrt_abstime t = hrt_absolute_time(); - - if (t - _lasttime > 1000000) { - pktrate = _count; - rxrate = _count_in; - txrate = _count_out; - nullrate = _null_count; - - _lasttime = t; - _count = 0; - _null_count = 0; - _count_in = 0; - _count_out = 0; - } - - _count++; - - if (msg->type == SYSLINK_PM_ONOFF_SWITCHOFF) { - // When the power button is hit - } else if (msg->type == SYSLINK_PM_BATTERY_STATE) { - - if (msg->length != 9) { - return; - } - - uint8_t flags = msg->data[0]; - int charging = flags & 1; - int powered = flags & 2; - - float vbat; //, iset; - memcpy(&vbat, &msg->data[1], sizeof(float)); - //memcpy(&iset, &msg->data[5], sizeof(float)); - - _battery.setConnected(true); - _battery.updateVoltage(vbat); - _battery.updateAndPublishBatteryStatus(t); - - // Update battery charge state - if (charging) { - _bstate = BAT_CHARGING; - } - - /* With the usb plugged in and battery disconnected, it appears to be charged. The voltage check ensures that a battery is connected */ - else if (powered && !charging && vbat > 3.7f) { - _bstate = BAT_CHARGED; - - } else { - _bstate = BAT_DISCHARGING; - } - - } else if (msg->type == SYSLINK_RADIO_RSSI) { - uint8_t rssi = msg->data[0]; // Between 40 and 100 meaning -40 dBm to -100 dBm - _rssi = 140 - rssi * 100 / (100 - 40); - - } else if (msg->type == SYSLINK_RADIO_RAW) { - handle_raw(msg); - _lastrxtime = t; - - } else if ((msg->type & SYSLINK_GROUP) == SYSLINK_RADIO) { - handle_radio(msg); - - } else if ((msg->type & SYSLINK_GROUP) == SYSLINK_OW) { - memcpy(&_memory->msgbuf, msg, sizeof(syslink_message_t)); - px4_sem_post(&memory_sem); - - } else { - PX4_INFO("GOT %" PRIu8, msg->type); - } - - //Send queued messages - if (!_queue.empty()) { - _queue.get(msg, sizeof(syslink_message_t)); - send_message(msg); - } - - - float p = (t % 500000) / 500000.0f; - - /* Use LED_GREEN for charging indicator */ - if (_bstate == BAT_CHARGED) { - led_on(LED_GREEN); - - } else if (_bstate == BAT_CHARGING && p < 0.25f) { - led_on(LED_GREEN); - - } else { - led_off(LED_GREEN); - } - - /* Alternate RX/TX LEDS when transfering */ - bool rx = t - _lastrxtime < 200000, - tx = t - _lasttxtime < 200000; - - - if (rx && p < 0.25f) { - led_on(LED_RX); - - } else { - led_off(LED_RX); - } - - if (tx && p > 0.5f && p > 0.75f) { - led_on(LED_TX); - - } else { - led_off(LED_TX); - } - - - // resend parameters if they haven't been acknowledged - if (_params_ack[0] == 0 && t - _params_update[0] > 10000) { - set_channel(_channel); - - } else if (_params_ack[1] == 0 && t - _params_update[1] > 10000) { - set_datarate(_rate); - - } else if (_params_ack[2] == 0 && t - _params_update[2] > 10000) { - set_address(_addr); - } -} - -void -Syslink::handle_radio(syslink_message_t *sys) -{ - hrt_abstime t = hrt_absolute_time(); - - // record acknowlegements to parameter messages - if (sys->type == SYSLINK_RADIO_CHANNEL) { - _params_ack[0] = t; - - } else if (sys->type == SYSLINK_RADIO_DATARATE) { - _params_ack[1] = t; - - } else if (sys->type == SYSLINK_RADIO_ADDRESS) { - _params_ack[2] = t; - } -} - -void -Syslink::handle_raw(syslink_message_t *sys) -{ - crtp_message_t *c = (crtp_message_t *) &sys->length; - - if (CRTP_NULL(*c)) { - if (c->size >= 3) { - handle_bootloader(sys); - } - - _null_count++; - - } else if (c->port == CRTP_PORT_COMMANDER) { - - crtp_commander *cmd = (crtp_commander *) &c->data[0]; - - input_rc_s rc = {}; - - rc.timestamp = hrt_absolute_time(); - rc.timestamp_last_signal = rc.timestamp; - rc.channel_count = 5; - rc.rc_failsafe = false; - rc.rc_lost = false; - rc.rc_lost_frame_count = 0; - rc.rc_total_frame_count = 1; - rc.rc_ppm_frame_length = 0; - rc.input_source = input_rc_s::RC_INPUT_SOURCE_MAVLINK; - rc.rssi = _rssi; - - - double pitch = cmd->pitch, roll = cmd->roll, yaw = cmd->yaw; - - /* channels (scaled to rc limits) */ - rc.values[0] = pitch * 500 / 20 + 1500; - rc.values[1] = roll * 500 / 20 + 1500; - rc.values[2] = yaw * 500 / 150 + 1500; - rc.values[3] = cmd->thrust * 1000 / USHRT_MAX + 1000; - rc.values[4] = 1000; // Dummy channel as px4 needs at least 5 - - rc.link_quality = -1; - rc.rssi_dbm = NAN; - - _rc_pub.publish(rc); - - } else if (c->port == CRTP_PORT_MAVLINK) { - _count_in++; - /* Pipe to Mavlink bridge */ - _bridge->pipe_message(c); - - } else { - handle_raw_other(sys); - } - - // Block all non-requested messaged in bootloader mode - if (_bootloader_mode) { - return; - } - - // Allow one raw message to be sent from the queue - send_queued_raw_message(); -} - -void -Syslink::handle_bootloader(syslink_message_t *sys) -{ - // Minimal bootloader emulation for being detectable - // To the bitcraze utilities, the STM32 will appear to have no flashable pages - // Upon receiving a bootloader message, all outbound packets are blocked in 'bootloader mode' due to how fragile the aforementioned utilities are to extra packets - - crtp_message_t *c = (crtp_message_t *) &sys->length; - - uint8_t target = c->data[0]; - uint8_t cmd = c->data[1]; - - if (target != 0xFF) { // CF2 STM32 target - return; - } - - _bootloader_mode = true; - - if (cmd == 0x10) { // GET_INFO - - c->size = 1 + 23; - memset(&c->data[2], 0, 21); - c->data[22] = 0x10; // Protocol version - send_message(sys); - } -} - -void -Syslink::handle_raw_other(syslink_message_t *sys) -{ - // This function doesn't actually do anything - // It is just here to return null responses to most standard messages - - crtp_message_t *c = (crtp_message_t *) &sys->length; - - if (c->port == CRTP_PORT_LOG) { - - PX4_INFO("Log: %" PRIu8 " %" PRIu8, c->channel, c->data[0]); - - if (c->channel == 0) { // Table of Contents Access - - uint8_t cmd = c->data[0]; - - if (cmd == 0) { // GET_ITEM - //int id = c->data[1]; - memset(&c->data[2], 0, 3); - c->data[2] = 1; // type - c->size = 1 + 5; - send_message(sys); - - } else if (cmd == 1) { // GET_INFO - memset(&c->data[1], 0, 7); - c->size = 1 + 8; - send_message(sys); - } - - } else if (c->channel == 1) { // Log control - - uint8_t cmd = c->data[0]; - - PX4_INFO("Responding to cmd: %" PRIu8, cmd); - c->data[2] = 0; // Success - c->size = 3 + 1; - - // resend message - send_message(sys); - - } else if (c->channel == 2) { // Log data - - } - } else if (c->port == CRTP_PORT_MEM) { - if (c->channel == 0) { // Info - int cmd = c->data[0]; - - if (cmd == 1) { // GET_NBR_OF_MEMS - c->data[1] = 0; - c->size = 2 + 1; - - // resend message - send_message(sys); - } - } - - } else if (c->port == CRTP_PORT_PARAM) { - if (c->channel == 0) { // TOC Access - // uint8_t msgId = c->data[0]; - - c->data[1] = 0; // Last parameter (id = 0) - memset(&c->data[2], 0, 10); - c->size = 1 + 8; - send_message(sys); - } - - else if (c->channel == 1) { // Param read - // 0 is ok - c->data[1] = 0; // value - c->size = 1 + 2; - send_message(sys); - } - - } else { - PX4_INFO("Got raw: %" PRIu8, c->port); - } -} - -int -Syslink::send_bytes(const void *data, size_t len) -{ - // TODO: This could be way more efficient - // Using interrupts/DMA/polling would be much better - for (size_t i = 0; i < len; i++) { - // Block until we can send a byte - while (px4_arch_gpioread(GPIO_NRF_TXEN)) ; - - write(_fd, ((const char *)data) + i, 1); - } - - return 0; -} - -int -Syslink::send_message(syslink_message_t *msg) -{ - syslink_compute_cksum(msg); - send_bytes(syslink_magic, 2); - send_bytes(&msg->type, sizeof(msg->type)); - send_bytes(&msg->length, sizeof(msg->length)); - send_bytes(&msg->data, msg->length); - send_bytes(&msg->cksum, sizeof(msg->cksum)); - return 0; -} - - -namespace syslink -{ - -void usage(); -void start(); -void status(); -void test(); -void attached(int pid); - -void usage() -{ - warnx("missing command: try 'start', 'status', 'attached', 'test'"); -} - -void start() -{ - if (g_syslink != nullptr) { - printf("Already started\n"); - exit(1); - } - - g_syslink = new Syslink(); - g_syslink->start(); - - // Wait for task and bridge to start - usleep(5000); - - - warnx("Started syslink on /dev/ttyS2\n"); - exit(0); - -} - -void status() -{ - if (g_syslink == nullptr) { - printf("Please start syslink first\n"); - exit(1); - } - - printf("Connection activity:\n"); - printf("- total rx: %d p/s\n", g_syslink->pktrate); - printf("- radio rx: %d p/s (%d null)\n", g_syslink->rxrate, g_syslink->nullrate); - printf("- radio tx: %d p/s\n\n", g_syslink->txrate); - - printf("Parameter Status:\n"); - const char *goodParam = "good"; - const char *badParam = "fail!"; - printf("- channel: %s\n", g_syslink->is_good(0) ? goodParam : badParam); - printf("- data rate: %s\n", g_syslink->is_good(1) != 0 ? goodParam : badParam); - printf("- address: %s\n\n", g_syslink->is_good(2) != 0 ? goodParam : badParam); - - - int deckfd = open(DECK_DEVICE_PATH, O_RDONLY); - int ndecks = 0; ioctl(deckfd, DECKIOGNUM, (unsigned long) &ndecks); - printf("Deck scan: (found %d)\n", ndecks); - - for (int i = 0; i < ndecks; i++) { - ioctl(deckfd, DECKIOSNUM, (unsigned long) &i); - - uint8_t *id; - int idlen = ioctl(deckfd, DECKIOID, (unsigned long) &id); - - // TODO: Validate the ID - printf("%i: ROM ID: ", i); - - for (int idi = 0; idi < idlen; idi++) { - printf("%02" PRIX8, id[idi]); - } - - deck_descriptor_t desc; - read(deckfd, &desc, sizeof(desc)); - - printf("HDR:%02" PRIx8 ", VID: %02" PRIx8 " , PID: %02" PRIx8 "\n", desc.header, desc.vendorId, desc.productId); - - // Print pages of memory - for (size_t di = 0; di < sizeof(desc); di++) { - if (di % 16 == 0) { - printf("\n"); - } - - printf("%02" PRIX8 " ", ((uint8_t *)&desc)[di]); - - } - - printf("\n\n"); - } - - close(deckfd); - exit(0); -} - -void attached(int pid) -{ - bool found = false; - - int deckfd = open(DECK_DEVICE_PATH, O_RDONLY); - int ndecks = 0; ioctl(deckfd, DECKIOGNUM, (unsigned long) &ndecks); - - for (int i = 0; i < ndecks; i++) { - ioctl(deckfd, DECKIOSNUM, (unsigned long) &i); - - deck_descriptor_t desc; - read(deckfd, &desc, sizeof(desc)); - - if (desc.productId == pid) { - found = true; - break; - } - } - - close(deckfd); - exit(found ? 1 : 0); -} - -void test() -{ - // TODO: Ensure battery messages are recent - // TODO: Read and write from memory to ensure it is working -} - -} // namespace syslink - -int syslink_main(int argc, char *argv[]) -{ - if (argc < 2) { - syslink::usage(); - exit(1); - } - - const char *verb = argv[1]; - - if (!strcmp(verb, "start")) { - syslink::start(); - } - - if (!strcmp(verb, "status")) { - syslink::status(); - } - - if (!strcmp(verb, "attached")) { - if (argc != 3) { - errx(1, "usage: syslink attached [deck_pid]"); - } - - int pid = atoi(argv[2]); - syslink::attached(pid); - } - - if (!strcmp(verb, "test")) { - syslink::test(); - } - - syslink::usage(); - exit(1); - - return 0; -} diff --git a/boards/bitcraze/crazyflie/syslink/syslink_main.h b/boards/bitcraze/crazyflie/syslink/syslink_main.h deleted file mode 100644 index a548595..0000000 --- a/boards/bitcraze/crazyflie/syslink/syslink_main.h +++ /dev/null @@ -1,216 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2016 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. - * - ****************************************************************************/ - -#pragma once - -#include - -#include - -#include -#include "ringbuffer.h" - -#include -#include -#include -#include - -#include "syslink.h" -#include "crtp.h" - -using namespace time_literals; - -#define MIN(X, Y) (((X) < (Y)) ? (X) : (Y)) - -typedef enum { - BAT_DISCHARGING = 0, - BAT_CHARGING = 1, - BAT_CHARGED = 2 -} battery_state; - - -class SyslinkBridge; -class SyslinkMemory; - -class Syslink -{ -public: - Syslink(); - - int start(); - - int set_datarate(uint8_t datarate); - int set_channel(uint8_t channel); - int set_address(uint64_t addr); - - int is_good(int i) { return _params_ack[i] != 0; } - - int pktrate; - int nullrate; - int rxrate; - int txrate; - -private: - friend class SyslinkBridge; - friend class SyslinkMemory; - - int open_serial(const char *dev); - - void handle_message(syslink_message_t *msg); - void handle_raw(syslink_message_t *sys); - void handle_radio(syslink_message_t *sys); - void handle_bootloader(syslink_message_t *sys); - - // Handles other types of messages that we don't really care about, but - // will be maintained with the bare minimum implementation for supporting - // other crazyflie libraries - void handle_raw_other(syslink_message_t *sys); - - int send_bytes(const void *data, size_t len); - - // Checksums and transmits a syslink message - int send_message(syslink_message_t *msg); - - int send_queued_raw_message(); - - void update_params(bool force_set); - - int _syslink_task; - bool _task_running; - bool _bootloader_mode; - - int _count; - int _null_count; - int _count_in; - int _count_out; - hrt_abstime _lasttime; - hrt_abstime _lasttxtime; // Last time a radio message was sent - hrt_abstime _lastrxtime; // Last time a radio message was recieved - - int _fd; - - // For receiving raw syslink messages to send from other processes - ringbuffer::RingBuffer _queue; - - // Stores data that was needs to be written as a raw message - ringbuffer::RingBuffer _writebuffer; - SyslinkBridge *_bridge; - SyslinkMemory *_memory; - - int _params_sub; - - // Current parameter values - int32_t _channel, _rate; - uint64_t _addr; - hrt_abstime _params_update[3]; // Time at which the parameters were updated - hrt_abstime _params_ack[3]; // Time at which the parameters were acknowledged by the nrf module - - uORB::PublicationMulti _rc_pub{ORB_ID(input_rc)}; - - // nrf chip schedules battery updates with SYSLINK_SEND_PERIOD_MS - static constexpr uint32_t SYSLINK_BATTERY_STATUS_INTERVAL_US = 10_ms; - Battery _battery{1, nullptr, SYSLINK_BATTERY_STATUS_INTERVAL_US, battery_status_s::BATTERY_SOURCE_POWER_MODULE}; - - int32_t _rssi; - battery_state _bstate; - - px4_sem_t memory_sem; - - syslink_message_t memory_msg; - - static int task_main_trampoline(int argc, char *argv[]); - - void task_main(); -}; - - -class SyslinkBridge : public cdev::CDev -{ - -public: - SyslinkBridge(Syslink *link); - virtual ~SyslinkBridge() = default; - - virtual int init(); - - virtual ssize_t read(struct file *filp, char *buffer, size_t buflen); - virtual ssize_t write(struct file *filp, const char *buffer, size_t buflen); - virtual int ioctl(struct file *filp, int cmd, unsigned long arg); - - // Makes the message available for reading to processes reading from the bridge - void pipe_message(crtp_message_t *msg); - -protected: - virtual pollevent_t poll_state(struct file *filp); - -private: - Syslink *_link; - - // Stores data that was received from syslink but not yet read by another driver - ringbuffer::RingBuffer _readbuffer; - - crtp_message_t _msg_to_send; - int _msg_to_send_size_remaining; -}; - - -class SyslinkMemory : public cdev::CDev -{ - -public: - SyslinkMemory(Syslink *link); - virtual ~SyslinkMemory() = default; - - virtual int init(); - - virtual ssize_t read(struct file *filp, char *buffer, size_t buflen); - virtual ssize_t write(struct file *filp, const char *buffer, size_t buflen); - virtual int ioctl(struct file *filp, int cmd, unsigned long arg); - -private: - friend class Syslink; - - Syslink *_link; - - int _activeI; - - syslink_message_t msgbuf; - - uint8_t scan(); - void getinfo(int i); - - int read(int i, uint16_t addr, char *buf, int length); - int write(int i, uint16_t addr, const char *buf, int length); - - void sendAndWait(); -}; diff --git a/boards/bitcraze/crazyflie/syslink/syslink_memory.cpp b/boards/bitcraze/crazyflie/syslink/syslink_memory.cpp deleted file mode 100644 index 4473339..0000000 --- a/boards/bitcraze/crazyflie/syslink/syslink_memory.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2016 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 "syslink_main.h" - -#include "drv_deck.h" - -#include - - -SyslinkMemory::SyslinkMemory(Syslink *link) : - CDev(DECK_DEVICE_PATH), - _link(link), - _activeI(0) -{ -} - - -int -SyslinkMemory::init() -{ - int ret = CDev::init(); - - /* if init failed, bail now */ - if (ret != OK) { - PX4_DEBUG("CDev init failed"); - return ret; - } - - - return ret; -} - -ssize_t -SyslinkMemory::read(struct file *filp, char *buffer, size_t buflen) -{ - return read(_activeI, 0, buffer, buflen); -} - -ssize_t -SyslinkMemory::write(struct file *filp, const char *buffer, size_t buflen) -{ - // For now, unsupported - return -1; -// return buflen; -} - -int -SyslinkMemory::ioctl(struct file *filp, int cmd, unsigned long arg) -{ - switch (cmd) { - case DECKIOGNUM: - *((int *) arg) = scan(); - return 0; - - case DECKIOSNUM: - _activeI = *((int *) arg); - return 0; - - case DECKIOID: { - syslink_ow_getinfo_t *data = (syslink_ow_getinfo_t *) &msgbuf.data; - getinfo(_activeI); - *((uint8_t **)arg) = data->id; - return 8; - } - - default: - CDev::ioctl(filp, cmd, arg); - return 0; - } -} - - -uint8_t -SyslinkMemory::scan() -{ - syslink_ow_scan_t *data = (syslink_ow_scan_t *) &msgbuf.data; - msgbuf.type = SYSLINK_OW_SCAN; - msgbuf.length = 0; - sendAndWait(); - - return data->nmems; -} - -void -SyslinkMemory::getinfo(int i) -{ - syslink_ow_getinfo_t *data = (syslink_ow_getinfo_t *) &msgbuf.data; - msgbuf.type = SYSLINK_OW_GETINFO; - msgbuf.length = 1; - data->idx = i; - sendAndWait(); -} - -int -SyslinkMemory::read(int i, uint16_t addr, char *buf, int length) -{ - syslink_ow_read_t *data = (syslink_ow_read_t *) &msgbuf.data; - msgbuf.type = SYSLINK_OW_READ; - - int nread = 0; - - while (nread < length) { - - msgbuf.length = 3; - data->idx = i; - data->addr = addr; - sendAndWait(); - - // Number of bytes actually read - int n = MIN(length - nread, msgbuf.length - 3); - - if (n == 0) { - break; - } - - memcpy(buf, data->data, n); - nread += n; - buf += n; - addr += n; - } - - return nread; -} - -int -SyslinkMemory::write(int i, uint16_t addr, const char *buf, int length) -{ - // TODO: Unimplemented - return -1; -} - -void -SyslinkMemory::sendAndWait() -{ - // TODO: Force the syslink thread to wake up - _link->_queue.force(&msgbuf, sizeof(msgbuf)); - px4_sem_wait(&_link->memory_sem); -} diff --git a/boards/bitcraze/crazyflie/syslink/syslink_params.c b/boards/bitcraze/crazyflie/syslink/syslink_params.c deleted file mode 100644 index 921ec01..0000000 --- a/boards/bitcraze/crazyflie/syslink/syslink_params.c +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2016 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. - * - ****************************************************************************/ - -/** - * @file syslink_params.c - * - * Parameters defined by the syslink module and the exposed NRF51 radio - * - * @author Dennis Shtatnov - */ - -/** - * Operating channel of the NRF51 - * - * @min 0 - * @max 125 - * @group Syslink - */ -PARAM_DEFINE_INT32(SLNK_RADIO_CHAN, 80); - -/** - * Operating datarate of the NRF51 - * - * @min 0 - * @max 2 - * @group Syslink - */ -PARAM_DEFINE_INT32(SLNK_RADIO_RATE, 2); - -/** - * Operating address of the NRF51 (most significant byte) - * - * @group Syslink - */ -PARAM_DEFINE_INT32(SLNK_RADIO_ADDR1, 231); // 0xE7 - -/** - * Operating address of the NRF51 (least significant 4 bytes) - * - * @group Syslink - */ -PARAM_DEFINE_INT32(SLNK_RADIO_ADDR2, 3890735079); // 0xE7E7E7E7 diff --git a/boards/bitcraze/crazyflie21/CMakeLists.txt b/boards/bitcraze/crazyflie21/CMakeLists.txt deleted file mode 100644 index 2794156..0000000 --- a/boards/bitcraze/crazyflie21/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -############################################################################ -# -# Copyright (c) 2018 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. -# -############################################################################ - -add_subdirectory(../crazyflie syslink) diff --git a/boards/bitcraze/crazyflie21/default.px4board b/boards/bitcraze/crazyflie21/default.px4board deleted file mode 100644 index a5e5244..0000000 --- a/boards/bitcraze/crazyflie21/default.px4board +++ /dev/null @@ -1,50 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_CONSTRAINED_FLASH=y -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_BOARD_COMPILE_DEFINITIONS="-Wno-narrowing" -CONFIG_DRIVERS_BAROMETER_BMP388=y -CONFIG_DRIVERS_DISTANCE_SENSOR_VL53L1X=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_BOSCH_BMI088_I2C=y -CONFIG_DRIVERS_OPTICAL_FLOW_PMW3901=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -# CONFIG_EKF2_GNSS_YAW is not set -# CONFIG_EKF2_SIDESLIP is not set -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_SENSORS=y -# CONFIG_SENSORS_VEHICLE_AIRSPEED is not set -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/bitcraze/crazyflie21/extras/bitcraze_crazyflie21_bootloader.bin b/boards/bitcraze/crazyflie21/extras/bitcraze_crazyflie21_bootloader.bin deleted file mode 100644 index c4542ff..0000000 Binary files a/boards/bitcraze/crazyflie21/extras/bitcraze_crazyflie21_bootloader.bin and /dev/null differ diff --git a/boards/bitcraze/crazyflie21/firmware.prototype b/boards/bitcraze/crazyflie21/firmware.prototype deleted file mode 100644 index f1121a6..0000000 --- a/boards/bitcraze/crazyflie21/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 14, - "magic": "Crazyflie21", - "description": "Firmware for the Crazyflie 2.1", - "image": "", - "build_time": 0, - "summary": "CRAZYFLIE 2.1", - "version": "0.1", - "image_size": 0, - "image_maxsize": 1032192, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/bitcraze/crazyflie21/init/rc.board_defaults b/boards/bitcraze/crazyflie21/init/rc.board_defaults deleted file mode 100644 index a1cd8b6..0000000 --- a/boards/bitcraze/crazyflie21/init/rc.board_defaults +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -# system_power unavailable -param set-default CBRK_SUPPLY_CHK 894281 - -param set-default SYS_AUTOSTART 4901 - -# don't probe external I2C -param set-default SENS_EXT_I2C_PRB 0 diff --git a/boards/bitcraze/crazyflie21/init/rc.board_sensors b/boards/bitcraze/crazyflie21/init/rc.board_sensors deleted file mode 100644 index 60df800..0000000 --- a/boards/bitcraze/crazyflie21/init/rc.board_sensors +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# Bitcraze Crazyflie specific board sensors init -#------------------------------------------------------------------------------ - -board_adc start - -# Internal I2C bus -bmp388 -I -a 0x77 -f 400 start -bmi088_i2c -A -R 0 -I -a 0x18 start -bmi088_i2c -G -R 0 -I -a 0x69 start - -# Optical flow deck -vl53l1x start -X diff --git a/boards/bitcraze/crazyflie21/nuttx-config/include/board.h b/boards/bitcraze/crazyflie21/nuttx-config/include/board.h deleted file mode 100644 index d3c2f95..0000000 --- a/boards/bitcraze/crazyflie21/nuttx-config/include/board.h +++ /dev/null @@ -1,223 +0,0 @@ -/************************************************************************************ - * configs/crazyflie/include/board.h - * include/arch/board/board.h - * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ************************************************************************************/ - -#ifndef __CONFIG_CRAZYFLIE_INCLUDE_BOARD_H -#define __CONFIG_CRAZYFLIE_INCLUDE_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32.h" - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The Crazyflie 2.0 uses a 8MHz crystal connected to the HSE. - * - * This is the canonical configuration: - * System Clock source : PLL (HSE) - * SYSCLK(Hz) : 168000000 Determined by PLL configuration - * HCLK(Hz) : 168000000 (STM32_RCC_CFGR_HPRE) - * AHB Prescaler : 1 (STM32_RCC_CFGR_HPRE) - * APB1 Prescaler : 4 (STM32_RCC_CFGR_PPRE1) - * APB2 Prescaler : 2 (STM32_RCC_CFGR_PPRE2) - * HSE Frequency(Hz) : 8000000 (STM32_BOARD_XTAL) - * PLLM : 8 (STM32_PLLCFG_PLLM) - * PLLN : 336 (STM32_PLLCFG_PLLN) - * PLLP : 2 (STM32_PLLCFG_PLLP) - * PLLQ : 7 (STM32_PLLCFG_PLLQ) - * Main regulator output voltage : Scale1 mode Needed for high speed SYSCLK - * Flash Latency(WS) : 5 - * Prefetch Buffer : OFF - * Instruction cache : ON - * Data cache : ON - * Require 48MHz for USB OTG FS, : Enabled - * SDIO and RNG clock - */ - -/* HSI - 16 MHz RC factory-trimmed - * LSI - 32 KHz RC - * HSE - On-board crystal frequency is 8MHz - * LSE - not installed - */ - -#define STM32_BOARD_XTAL 8000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -//#define STM32_LSE_FREQUENCY 32768 - -/* Main PLL Configuration. - * - * PLL source is HSE - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * = (8,000,000 / 8) * 336 - * = 336,000,000 - * SYSCLK = PLL_VCO / PLLP - * = 336,000,000 / 2 = 168,000,000 - * USB OTG FS, SDIO and RNG Clock - * = PLL_VCO / PLLQ - * = 48,000,000 - */ - -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(8) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(336) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(7) - -#define STM32_SYSCLK_FREQUENCY 168000000ul - -/* AHB clock (HCLK) is SYSCLK (168MHz) */ - -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (42MHz) */ - -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (84MHz) */ - -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx - * otherwise frequency is 2xAPBx. - * Note: TIM1,8-11 are on APB2, others on APB1 - */ - -#define BOARD_TIM1_FREQUENCY STM32_APB2_TIM1_CLKIN -#define BOARD_TIM2_FREQUENCY STM32_APB1_TIM2_CLKIN -#define BOARD_TIM3_FREQUENCY STM32_APB1_TIM3_CLKIN -#define BOARD_TIM4_FREQUENCY STM32_APB1_TIM4_CLKIN -#define BOARD_TIM5_FREQUENCY STM32_APB1_TIM5_CLKIN -#define BOARD_TIM6_FREQUENCY STM32_APB1_TIM6_CLKIN -#define BOARD_TIM7_FREQUENCY STM32_APB1_TIM7_CLKIN -#define BOARD_TIM8_FREQUENCY STM32_APB2_TIM8_CLKIN -#define BOARD_TIM9_FREQUENCY STM32_APB2_TIM9_CLKIN -#define BOARD_TIM10_FREQUENCY STM32_APB2_TIM10_CLKIN -#define BOARD_TIM11_FREQUENCY STM32_APB2_TIM11_CLKIN -#define BOARD_TIM12_FREQUENCY STM32_APB1_TIM12_CLKIN -#define BOARD_TIM13_FREQUENCY STM32_APB1_TIM13_CLKIN -#define BOARD_TIM14_FREQUENCY STM32_APB1_TIM14_CLKIN - -/* Alternate function pin selections ************************************************/ - -/* - * UARTs. - * - */ -/* E_TX2 / E_RX2 */ -#define GPIO_USART2_RX GPIO_USART2_RX_1 -#define GPIO_USART2_TX GPIO_USART2_TX_1 - -/* E_TX1 / E_RX1 */ -#define GPIO_USART3_RX GPIO_USART3_RX_2 -#define GPIO_USART3_TX GPIO_USART3_TX_2 - -/* NRF51 via syslink */ -#define GPIO_USART6_RX GPIO_USART6_RX_1 -#define GPIO_USART6_TX GPIO_USART6_TX_1 - -/* UART DMA configuration for USART6 */ -#define DMAMAP_USART6_RX DMAMAP_USART6_RX_2 - -/* - * I2C - * - * The optional _GPIO configurations allow the I2C driver to manually - * reset the bus to clear stuck slaves. They match the pin configuration, - * but are normally-high GPIOs. - */ -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_1 -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_1 -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN6) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN7) - -#define GPIO_I2C3_SCL GPIO_I2C3_SCL_1 -#define GPIO_I2C3_SDA GPIO_I2C3_SDA_1 -#define GPIO_I2C3_SCL_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN8) -#define GPIO_I2C3_SDA_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN9) - -/* - * SPI - * - * E_MISO, E_MOSI, E_SCK exposed on headers - */ -#define GPIO_SPI1_MISO (GPIO_SPI1_MISO_1|GPIO_SPEED_50MHz) -#define GPIO_SPI1_MOSI (GPIO_SPI1_MOSI_1|GPIO_SPEED_50MHz) -#define GPIO_SPI1_SCK (GPIO_SPI1_SCK_1|GPIO_SPEED_50MHz) - -/* XXX since we allocate the HP work stack from CCM RAM on normal system startup, - SPI1 will never run in DMA mode - so we can just give it a random config here. - What we really need to do is to make DMA configurable per channel, and always - disable it for SPI1. */ -#define DMACHAN_SPI1_RX DMAMAP_SPI1_RX_1 -#define DMACHAN_SPI1_TX DMAMAP_SPI1_TX_2 - -#endif /* __CONFIG_CRAZYFLIE_INCLUDE_BOARD_H */ diff --git a/boards/bitcraze/crazyflie21/nuttx-config/nsh/defconfig b/boards/bitcraze/crazyflie21/nuttx-config/nsh/defconfig deleted file mode 100644 index 4840814..0000000 --- a/boards/bitcraze/crazyflie21/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,213 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_SPI_CALLBACK is not set -# CONFIG_STM32_CCMEXCLUDE is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/bitcraze/crazyflie21/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F405RG=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0016 -CONFIG_CDCACM_PRODUCTSTR="PX4 Crazyflie v2.0" -CONFIG_CDCACM_RXBUFSIZE=300 -CONFIG_CDCACM_TXBUFSIZE=1000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="Bitcraze AB" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FAT_DIRECT_RETRY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_EXCLUDE_BLOCKS=y -CONFIG_FS_PROCFS_EXCLUDE_MEMINFO=y -CONFIG_FS_PROCFS_EXCLUDE_MOUNT=y -CONFIG_FS_PROCFS_EXCLUDE_USAGE=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MM_REGIONS=2 -CONFIG_MTD=y -CONFIG_MTD_AT24XX=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_FATDEVNO=0 -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_MMCSDSPIPORTNO=1 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=196608 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32_ADC1=y -CONFIG_STM32_BBSRAM=y -CONFIG_STM32_BBSRAM_FILES=5 -CONFIG_STM32_BKPSRAM=y -CONFIG_STM32_CCMDATARAM=y -CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y -CONFIG_STM32_DMA1=y -CONFIG_STM32_DMA2=y -CONFIG_STM32_FLASH_PREFETCH=y -CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_STM32_I2C1=y -CONFIG_STM32_I2C3=y -CONFIG_STM32_I2CTIMEOMS=10 -CONFIG_STM32_I2CTIMEOTICKS=10 -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_OTGFS=y -CONFIG_STM32_PWR=y -CONFIG_STM32_RTC=y -CONFIG_STM32_RTC_HSECLOCK=y -CONFIG_STM32_RTC_MAGIC_REG=1 -CONFIG_STM32_SAVE_CRASHDUMP=y -CONFIG_STM32_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32_SPI1=y -CONFIG_STM32_USART2=y -CONFIG_STM32_USART3=y -CONFIG_STM32_USART6=y -CONFIG_STM32_USART_BREAKS=y -CONFIG_STM32_USART_SINGLEWIRE=y -CONFIG_STM32_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_RXBUFSIZE=300 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=300 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_SERIAL_CONSOLE=y -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=128 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=64 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/bitcraze/crazyflie21/nuttx-config/scripts/script.ld b/boards/bitcraze/crazyflie21/nuttx-config/scripts/script.ld deleted file mode 100644 index 178b10a..0000000 --- a/boards/bitcraze/crazyflie21/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,144 +0,0 @@ -/**************************************************************************** - * configs/crazyflie/scripts/ld.script - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F405RG has 1024Kb of FLASH beginning at address 0x0800:0000 and - * 192Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of CCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 0x4000 of flash is reserved for the bootloader. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08004000, LENGTH = 1008K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - ccsram (rwx) : ORIGIN = 0x10000000, LENGTH = 64K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/bitcraze/crazyflie21/src/CMakeLists.txt b/boards/bitcraze/crazyflie21/src/CMakeLists.txt deleted file mode 100644 index d967b47..0000000 --- a/boards/bitcraze/crazyflie21/src/CMakeLists.txt +++ /dev/null @@ -1,47 +0,0 @@ -############################################################################ -# -# Copyright (c) 2015 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. -# -############################################################################ - -add_library(drivers_board - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - usb.c -) -target_link_libraries(drivers_board - PRIVATE - arch_spi - drivers__led # drv_led_start - px4_layer -) diff --git a/boards/bitcraze/crazyflie21/src/board_config.h b/boards/bitcraze/crazyflie21/src/board_config.h deleted file mode 100644 index b636bfd..0000000 --- a/boards/bitcraze/crazyflie21/src/board_config.h +++ /dev/null @@ -1,225 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-2016 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * PX4-CRAZYFLIE internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ -/* Configuration ************************************************************************************/ - -/* Crazyflie GPIOs **********************************************************************************/ -/* LEDs */ - - -/* Radio TX indicator */ -#define GPIO_LED_RED_L (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\ - GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN0) -/* Radio RX indicator */ -#define GPIO_LED_GREEN_L (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\ - GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN1) -#define GPIO_LED_GREEN_R (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\ - GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN2) -#define GPIO_LED_RED_R (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\ - GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN3) - -/* PX4: armed state indicator ; Stock FW: Blinking while charging */ -#define GPIO_LED_BLUE_L (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTD|GPIO_PIN2) - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_OVERLOAD_LED LED_RED -#define BOARD_ARMED_LED LED_BLUE -#define BOARD_ARMED_STATE_LED LED_GREEN - -#define LED_TX 4 -#define LED_RX 5 - -#define GPIO_FSYNC_MPU9250 (GPIO_OUTPUT|GPIO_PORTC|GPIO_PIN14) // Needs to be set low -#define GPIO_DRDY_MPU9250 (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTC|GPIO_PIN13) - - -#define GPIO_NRF_TXEN (GPIO_INPUT|GPIO_PULLUP|GPIO_EXTI|GPIO_PORTA|GPIO_PIN4) - -#define GPIO_I2C4_DRDY1_BMP388 (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTG|GPIO_PIN5) - -/* - * I2C busses - */ -#define PX4_I2C_BUS_ONBOARD_HZ 400000 -#define PX4_I2C_BUS_EXPANSION_HZ 400000 - -#define PX4_I2C_BUS_MTD 1 - -#define BOARD_NUMBER_I2C_BUSES 3 -#define BOARD_I2C_BUS_CLOCK_INIT {PX4_I2C_BUS_ONBOARD_HZ, 400000, PX4_I2C_BUS_EXPANSION_HZ} - - -/* Devices on the onboard bus. - * - * Note that these are unshifted addresses. - */ -#define PX4_I2C_OBDEV_MPU9250 0x69 - -/* USB OTG FS - * - * PA9 OTG_FS_VBUS VBUS sensing - */ -#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN9) - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that can be used by the Px4 Firmware in the adc driver - */ -#define ADC_CHANNELS 0 - -/* Tone alarm output : These are only applicable when the buzzer deck is attached */ -#define TONE_ALARM_TIMER 5 /* timer 5 */ -#define TONE_ALARM_CHANNEL 3 /* channel 3 */ -#define GPIO_TONE_ALARM_IDLE (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN2) -#define GPIO_TONE_ALARM (GPIO_ALT|GPIO_AF2|GPIO_SPEED_2MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN2) -#define GPIO_TONE_ALARM_NEG (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN3) - -/* PWM -*/ - -#define DIRECT_PWM_OUTPUT_CHANNELS 4 - -/* This board overrides the defaults by providing - * PX4_PWM_ALTERNATE_RANGES and a replacement set of - * constants - */ - - -/* PWM directly wired to transistor. Duty cycle directly corresponds to power - * So we need to override the defaults - */ - -#define PX4_PWM_ALTERNATE_RANGES -#define PWM_LOWEST_MIN 0 -#define PWM_HIGHEST_MAX 255 - -/* High-resolution timer */ -#define HRT_TIMER 8 /* use timer8 for the HRT */ -#define HRT_TIMER_CHANNEL 1 /* use capture/compare channel */ - - -#define BOARD_ENABLE_CONSOLE_BUFFER -#define BOARD_CONSOLE_BUFFER_SIZE (1024*3) - -__BEGIN_DECLS - -/**************************************************************************************************** - * Public Types - ****************************************************************************************************/ - -/**************************************************************************************************** - * Public data - ****************************************************************************************************/ - -#ifndef __ASSEMBLY__ - -/**************************************************************************************************** - * Public Functions - ****************************************************************************************************/ - -/**************************************************************************************************** - * Name: board_peripheral_reset - * - * Description: - * Called to reset the periferal bus - * - ****************************************************************************************************/ - -#define board_peripheral_reset(ms) - -/**************************************************************************************************** - * Name: stm32_usbinitialize - * - * Description: - * Called to configure USB IO. - * - ****************************************************************************************************/ - -extern void stm32_usbinitialize(void); - -/**************************************************************************** - * Name: board_i2c_initialize - * - * Description: - * Called to set I2C bus frequencies. - * - ****************************************************************************/ - -int board_i2c_initialize(void); - -/**************************************************************************************************** - * Name: stm32_spiinitialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the PX4FMU board. - * - ****************************************************************************************************/ - -extern void stm32_spiinitialize(void); - -/************************************************************************************ - * Name: stm32_spi_bus_initialize - * - * Description: - * Called to configure SPI Buses. - * - ************************************************************************************/ - -extern int stm32_spi_bus_initialize(void); - - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/bitcraze/crazyflie21/src/i2c.cpp b/boards/bitcraze/crazyflie21/src/i2c.cpp deleted file mode 100644 index bb73d27..0000000 --- a/boards/bitcraze/crazyflie21/src/i2c.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), - initI2CBusInternal(3), -}; diff --git a/boards/bitcraze/crazyflie21/src/init.c b/boards/bitcraze/crazyflie21/src/init.c deleted file mode 100644 index 6d16036..0000000 --- a/boards/bitcraze/crazyflie21/src/init.c +++ /dev/null @@ -1,157 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file crazyflie_init.c - * - * Crazyflie specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "board_config.h" -#include - -#include - -#include -#include - -#include -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/**************************************************************************** - * Protected Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/************************************************************************************ - * Name: stm32_boardinitialize - * - * Description: - * All STM32 architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. - * - ************************************************************************************/ - -__EXPORT void -stm32_boardinitialize(void) -{ - /* configure LEDs */ - - board_autoled_initialize(); - - /* configure SPI interfaces */ - - stm32_spiinitialize(); - - stm32_usbinitialize(); -} - -/**************************************************************************** - * Name: board_app_initialize - * - * Description: - * Perform architecture specific initialization - * - ****************************************************************************/ - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - px4_platform_init(); - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_off(LED_GREEN); - led_off(LED_BLUE); - led_off(LED_TX); - led_off(LED_RX); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - -#ifdef CONFIG_SPI - stm32_spi_bus_initialize(); -#endif - - return OK; -} diff --git a/boards/bitcraze/crazyflie21/src/led.c b/boards/bitcraze/crazyflie21/src/led.c deleted file mode 100644 index b2ea621..0000000 --- a/boards/bitcraze/crazyflie21/src/led.c +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013 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. - * - ****************************************************************************/ - -/** - * @file crazyflie_led.c - * - * Crazyflie LED backend. - */ - -#include - -#include - -#include "stm32.h" -#include "board_config.h" - -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -static uint32_t g_ledmap[] = { - GPIO_LED_BLUE_L, // Indexed by LED_BLUE - GPIO_LED_RED_R, // Indexed by LED_RED, LED_AMBER - 0, // Indexed by LED_SAFETY - GPIO_LED_GREEN_R, // Indexed by LED_GREEN - GPIO_LED_RED_L, // Indexed by LED_TX - GPIO_LED_GREEN_L // Indexed by LED_RX -}; - - -__EXPORT void led_init() -{ - /* Configure LED1 GPIO for output */ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - if (g_ledmap[l]) { - px4_arch_configgpio(g_ledmap[l]); - } - } -} - -__EXPORT void led_on(int led) -{ - /* Pull down to switch on */ - px4_arch_gpiowrite(g_ledmap[led], g_ledmap[led] & GPIO_OUTPUT_SET ? true : false); -} - -__EXPORT void led_off(int led) -{ - /* Pull up to switch off */ - px4_arch_gpiowrite(g_ledmap[led], g_ledmap[led] & GPIO_OUTPUT_SET ? false : true); -} - -__EXPORT void led_toggle(int led) -{ - if (px4_arch_gpioread(g_ledmap[led])) { - px4_arch_gpiowrite(g_ledmap[led], false); - - } else { - px4_arch_gpiowrite(g_ledmap[led], true); - } -} diff --git a/boards/bitcraze/crazyflie21/src/spi.cpp b/boards/bitcraze/crazyflie21/src/spi.cpp deleted file mode 100644 index bd5f6db..0000000 --- a/boards/bitcraze/crazyflie21/src/spi.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include "board_config.h" - -#include -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(SPIDEV_MMCSD(0), SPI::CS{GPIO::PortC, GPIO::Pin12}), - initSPIDevice(DRV_FLOW_DEVTYPE_PMW3901, SPI::CS{GPIO::PortB, GPIO::Pin4}), - initSPIDevice(DRV_DEVTYPE_UNUSED, SPI::CS{GPIO::PortB, GPIO::Pin5}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); - -/************************************************************************************ - * Name: stm32_spi_bus_initialize - * - * Description: - * Called to configure SPI buses on PX4FMU board. - * - ************************************************************************************/ -static struct spi_dev_s *spi_expansion; - -__EXPORT int stm32_spi_bus_initialize(void) -{ - /* Configure SPI-based devices */ - - /* Get the external SPI port */ - spi_expansion = stm32_spibus_initialize(1); - - if (!spi_expansion) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 1); - return -ENODEV; - } - -#ifdef CONFIG_MMCSD - int ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi_expansion); - - if (ret != OK) { - syslog(LOG_ERR, "[boot] FAILED to bind SPI port 1 to the MMCSD driver\n"); - return -ENODEV; - } - -#endif - - return OK; -} diff --git a/boards/bitcraze/crazyflie21/src/timer_config.cpp b/boards/bitcraze/crazyflie21/src/timer_config.cpp deleted file mode 100644 index 33532b0..0000000 --- a/boards/bitcraze/crazyflie21/src/timer_config.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016 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 - -/* IO Timers normally free-run at 1MHz - * Here we make adjustments to the Frequency that sets the timer's prescale - * so that the prescale is set to 0 - */ -#define TIMx_CLKIN 1000000 - -static inline constexpr io_timers_t initIOTimerOverrideClockFreq(Timer::Timer timer) -{ - io_timers_t ret = initIOTimer(timer); - ret.clock_freq = TIMx_CLKIN; - return ret; -} - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimerOverrideClockFreq(Timer::Timer2), - initIOTimerOverrideClockFreq(Timer::Timer4), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel2}, {GPIO::PortA, GPIO::Pin1}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel4}, {GPIO::PortB, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel1}, {GPIO::PortA, GPIO::Pin15}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel4}, {GPIO::PortB, GPIO::Pin9}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/bitcraze/crazyflie21/src/usb.c b/boards/bitcraze/crazyflie21/src/usb.c deleted file mode 100644 index 29bae3d..0000000 --- a/boards/bitcraze/crazyflie21/src/usb.c +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file crazyflie_usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include "board_config.h" - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -/************************************************************************************ - * Name: stm32_usbinitialize - * - * Description: - * Called to setup USB-related GPIO pins for the PX4-STM32F4Discovery 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_STM32_OTGFS - stm32_configgpio(GPIO_OTGFS_VBUS); - /* XXX We only support device mode - stm32_configgpio(GPIO_OTGFS_PWRON); - stm32_configgpio(GPIO_OTGFS_OVER); - */ -#endif -} - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} - diff --git a/boards/cuav/can-gps-v1/canbootloader.px4board b/boards/cuav/can-gps-v1/canbootloader.px4board deleted file mode 100644 index 4691728..0000000 --- a/boards/cuav/can-gps-v1/canbootloader.px4board +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_ROMFSROOT="" -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_DRIVERS_BOOTLOADERS=y diff --git a/boards/cuav/can-gps-v1/default.px4board b/boards/cuav/can-gps-v1/default.px4board deleted file mode 100644 index 6b0a567..0000000 --- a/boards/cuav/can-gps-v1/default.px4board +++ /dev/null @@ -1,36 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_ROMFSROOT="cannode" -CONFIG_BOARD_CONSTRAINED_FLASH=y -CONFIG_BOARD_NO_HELP=y -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_BOARD_COMPILE_DEFINITIONS="-DUSE_S_RGB_LED_DMA" -CONFIG_DRIVERS_BAROMETER_MS5611=y -CONFIG_DRIVERS_BOOTLOADERS=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_LIGHTS_NEOPIXEL=y -CONFIG_DRIVERS_MAGNETOMETER_RM3100=y -CONFIG_DRIVERS_SAFETY_BUTTON=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_BOARD_UAVCAN_INTERFACES=1 -CONFIG_DRIVERS_UAVCANNODE=y -CONFIG_UAVCANNODE_BEEP_COMMAND=y -CONFIG_UAVCANNODE_GNSS_FIX=y -CONFIG_UAVCANNODE_LIGHTS_COMMAND=y -CONFIG_UAVCANNODE_MAGNETIC_FIELD_STRENGTH=y -CONFIG_UAVCANNODE_SAFETY_BUTTON=y -CONFIG_UAVCANNODE_STATIC_PRESSURE=y -CONFIG_UAVCANNODE_STATIC_TEMPERATURE=y -CONFIG_MODULES_SENSORS=y -# CONFIG_SENSORS_VEHICLE_AIRSPEED is not set -# CONFIG_SENSORS_VEHICLE_AIR_DATA is not set -# CONFIG_SENSORS_VEHICLE_GPS_POSITION is not set -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/cuav/can-gps-v1/firmware.prototype b/boards/cuav/can-gps-v1/firmware.prototype deleted file mode 100644 index 949b4c5..0000000 --- a/boards/cuav/can-gps-v1/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 11, - "magic": "PX4FWv1", - "description": "Firmware for the PX4FMUv4 board", - "image": "", - "build_time": 0, - "summary": "PX4FMUv4", - "version": "0.1", - "image_size": 0, - "image_maxsize": 2080768, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/cuav/can-gps-v1/init/rc.board_defaults b/boards/cuav/can-gps-v1/init/rc.board_defaults deleted file mode 100644 index 68ad0d5..0000000 --- a/boards/cuav/can-gps-v1/init/rc.board_defaults +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default CBRK_IO_SAFETY 0 - -neopixel start -safety_button start -tone_alarm start diff --git a/boards/cuav/can-gps-v1/init/rc.board_sensors b/boards/cuav/can-gps-v1/init/rc.board_sensors deleted file mode 100644 index 6ffc127..0000000 --- a/boards/cuav/can-gps-v1/init/rc.board_sensors +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# -# board sensors init -#------------------------------------------------------------------------------ - -gps start -d /dev/ttyS1 -g 38400 -p ubx - -# Internal SPI -ms5611 -s start -rm3100 -s start diff --git a/boards/cuav/can-gps-v1/nuttx-config/canbootloader/defconfig b/boards/cuav/can-gps-v1/nuttx-config/canbootloader/defconfig deleted file mode 100644 index 621a3ab..0000000 --- a/boards/cuav/can-gps-v1/nuttx-config/canbootloader/defconfig +++ /dev/null @@ -1,57 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/cuav/can-gps-v1/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F412CE=y -CONFIG_ARCH_INTERRUPTSTACK=4096 -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BINFMT_DISABLE=y -CONFIG_BOARDCTL=y -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DISABLE_MOUNTPOINT=y -CONFIG_EXPERIMENTAL=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=4096 -CONFIG_INIT_STACKSIZE=4096 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_MM_REGIONS=2 -CONFIG_NAME_MAX=0 -CONFIG_NUNGET_CHARS=0 -CONFIG_PREALLOC_TIMERS=0 -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_DISABLE_BUFFERING=y -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_NOEXT_VECTORS=y -CONFIG_STM32_TIM8=y -CONFIG_TASK_NAME_SIZE=0 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/cuav/can-gps-v1/nuttx-config/include/board.h b/boards/cuav/can-gps-v1/nuttx-config/include/board.h deleted file mode 100644 index c725abf..0000000 --- a/boards/cuav/can-gps-v1/nuttx-config/include/board.h +++ /dev/null @@ -1,152 +0,0 @@ -/************************************************************************************ - * configs/px4fmu/include/board.h - * include/arch/board/board.h - * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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_dma_map.h" - -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include -#ifndef __ASSEMBLY__ -# include -#endif - -#include - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/* HSI - 16 MHz RC factory-trimmed - * LSI - 32 KHz RC - * HSE - 8 MHz Crystal - * LSE - not installed - */ - -#define STM32_BOARD_USEHSE 1 -#define STM32_BOARD_XTAL 16000000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 - -/* Main PLL Configuration */ -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(16) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(384) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_4 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(8) -#define STM32_PLLCFG_PLLR RCC_PLLCFG_PLLR(2) - -#define STM32_RCC_PLLI2SCFGR_PLLI2SM RCC_PLLI2SCFGR_PLLI2SM(16) -#define STM32_RCC_PLLI2SCFGR_PLLI2SN RCC_PLLI2SCFGR_PLLI2SN(192) -#define STM32_RCC_PLLI2SCFGR_PLLI2SQ RCC_PLLI2SCFGR_PLLI2SQ(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SR RCC_PLLI2SCFGR_PLLI2SR(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SSRC RCC_PLLI2SCFGR_PLLI2SSRC(0) /* HSE or HSI depending on PLLSRC of PLLCFGR*/ - -#define STM32_RCC_DCKCFGR2_CK48MSEL RCC_DCKCFGR2_CK48MSEL_PLL -#define STM32_RCC_DCKCFGR2_FMPI2C1SEL RCC_DCKCFGR2_FMPI2C1SEL_APB -#define STM32_RCC_DCKCFGR2_SDIOSEL RCC_DCKCFGR2_SDIOSEL_48MHZ - -#define STM32_SYSCLK_FREQUENCY 96000000ul - -/* AHB clock (HCLK) is SYSCLK (96MHz) */ -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* Same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/2 (48MHz) */ -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB1 will be twice PCLK1 (see page 112 of reference manual) */ -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK (96MHz) */ -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLK /* PCLK2 = HCLK */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY) - -/* Timers driven from APB2 will be PCLK2 since no prescale division */ -#define STM32_APB2_TIM1_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (STM32_PCLK2_FREQUENCY) - -/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx - * otherwise frequency is 2xAPBx. - * Note: TIM1,8 are on APB2, others on APB1 - */ - -#define BOARD_TIM2_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM3_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM4_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM5_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM6_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM7_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM8_FREQUENCY (2 * STM32_PCLK2_FREQUENCY) - -/* Alternate function pin selections ************************************************/ - -/* UARTs */ -#define GPIO_USART1_RX GPIO_USART1_RX_3 -#define GPIO_USART1_TX GPIO_USART1_TX_2 - -#define GPIO_USART2_RX GPIO_USART2_RX_1 -#define GPIO_USART2_TX GPIO_USART2_TX_1 - -/* CAN */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_2 -#define GPIO_CAN1_TX GPIO_CAN1_TX_2 - -/* I2C */ -#define GPIO_I2C3_SCL GPIO_I2C3_SCL_1 -#define GPIO_I2C3_SDA GPIO_I2C3_SDA_2 - -/* SPI */ -#define GPIO_SPI1_MISO (GPIO_SPI1_MISO_1|GPIO_SPEED_50MHz) -#define GPIO_SPI1_MOSI (GPIO_SPI1_MOSI_1|GPIO_SPEED_50MHz) -#define GPIO_SPI1_SCK (GPIO_SPI1_SCK_1|GPIO_SPEED_50MHz) - -#endif /* __ARCH_BOARD_BOARD_H */ diff --git a/boards/cuav/can-gps-v1/nuttx-config/include/board_dma_map.h b/boards/cuav/can-gps-v1/nuttx-config/include/board_dma_map.h deleted file mode 100644 index ac050d1..0000000 --- a/boards/cuav/can-gps-v1/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -#pragma once - -// N.B. Map not included as it is not correct for an F412 - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- - - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMAMAP_TIM1_CH2 DMAMAP_TIM1_CH2_2 // DMA2, Stream 6, Channel 6 SLED diff --git a/boards/cuav/can-gps-v1/nuttx-config/nsh/defconfig b/boards/cuav/can-gps-v1/nuttx-config/nsh/defconfig deleted file mode 100644 index 64f884c..0000000 --- a/boards/cuav/can-gps-v1/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,179 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_OS_API is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_STM32_DMACAPABLE is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/cuav/can-gps-v1/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F412CE=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2624 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MM_REGIONS=2 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32_ADC1=y -CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y -CONFIG_STM32_DMA1=y -CONFIG_STM32_DMA2=y -CONFIG_STM32_FLASH_PREFETCH=y -CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_STM32_I2C3=y -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_PWR=y -CONFIG_STM32_RTC=y -CONFIG_STM32_RTC_HSECLOCK=y -CONFIG_STM32_RTC_MAGIC=0xfacefeee -CONFIG_STM32_RTC_MAGIC_REG=1 -CONFIG_STM32_RTC_MAGIC_TIME_SET=0xfacefeef -CONFIG_STM32_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32_SPI1=y -CONFIG_STM32_TIM8=y -CONFIG_STM32_USART1=y -CONFIG_STM32_USART2=y -CONFIG_STM32_USART_BREAKS=y -CONFIG_STM32_WWDG=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_SERIAL_CONSOLE=y -CONFIG_USART1_TXBUFSIZE=2500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_TXBUFSIZE=1100 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/cuav/can-gps-v1/nuttx-config/scripts/canbootloader_script.ld b/boards/cuav/can-gps-v1/nuttx-config/scripts/canbootloader_script.ld deleted file mode 100644 index 758a426..0000000 --- a/boards/cuav/can-gps-v1/nuttx-config/scripts/canbootloader_script.ld +++ /dev/null @@ -1,139 +0,0 @@ -/**************************************************************************** - * nuttx-config/scripts/canbootloader_script.ld - * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F412 has 512Kb of FLASH beginning at address 0x0800:0000 and - * 256Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of SRAM beginning at address 0x2002:0000 - * 4) 64Kb of TCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 0x10000 of flash is reserved for the bootloader. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08000000, LENGTH = 32K - shared_sram (rwx) : ORIGIN = 0x20000000, LENGTH = 256 - sram (rwx) : ORIGIN = 0x20000100, LENGTH = 192K - 256 -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .app_bl_shared : { - _sapp_bl_shared = ABSOLUTE(.); - } > shared_sram - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/cuav/can-gps-v1/nuttx-config/scripts/script.ld b/boards/cuav/can-gps-v1/nuttx-config/scripts/script.ld deleted file mode 100644 index 4e866c5..0000000 --- a/boards/cuav/can-gps-v1/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,152 +0,0 @@ -/**************************************************************************** - * scripts/ld.script - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F412 has 512Kb of FLASH beginning at address 0x0800:0000 and - * 256Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of SRAM beginning at address 0x2002:0000 - * 4) 64Kb of TCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 0x10000 of flash is reserved for the bootloader. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08010000, LENGTH = 448K - shared_sram (rwx) : ORIGIN = 0x20000000, LENGTH = 256 - sram (rwx) : ORIGIN = 0x20000100, LENGTH = 192K - 256 -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(8); - /* - * This section positions the app_descriptor_t used - * by the make_can_boot_descriptor.py tool to set - * the application image's descriptor so that the - * uavcan bootloader has the ability to validate the - * image crc, size etc - */ - KEEP(*(.app_descriptor)) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .app_bl_shared : { - _sapp_bl_shared = ABSOLUTE(.); - } > shared_sram - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/cuav/can-gps-v1/src/CMakeLists.txt b/boards/cuav/can-gps-v1/src/CMakeLists.txt deleted file mode 100644 index c85479c..0000000 --- a/boards/cuav/can-gps-v1/src/CMakeLists.txt +++ /dev/null @@ -1,65 +0,0 @@ -############################################################################ -# -# Copyright (c) 2020 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. -# -############################################################################ - -if("${PX4_BOARD_LABEL}" STREQUAL "canbootloader") - - add_library(drivers_board - boot.c - led.cpp - ) - - target_link_libraries(drivers_board - PRIVATE - nuttx_arch - nuttx_drivers - canbootloader - platform_srgbled - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/canbootloader) - -else() - add_library(drivers_board - can.c - i2c.cpp - init.c - spi.cpp - ) - - target_link_libraries(drivers_board - PRIVATE - arch_spi - nuttx_arch - nuttx_drivers - px4_layer - ) -endif() diff --git a/boards/cuav/can-gps-v1/src/Makefile b/boards/cuav/can-gps-v1/src/Makefile deleted file mode 100644 index 1e0b101..0000000 --- a/boards/cuav/can-gps-v1/src/Makefile +++ /dev/null @@ -1,100 +0,0 @@ -############################################################################ -# -# Copyright (C) 2015 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# David Sidrane -# -# 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 NuttX 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 $(TOPDIR)/Make.defs - -CFLAGS += -I$(TOPDIR)/sched - -ASRCS = -AOBJS = $(ASRCS:.S=$(OBJEXT)) - -ifeq ($(CONFIG_BOOTLOADER),) -CSRCS = empty.c -endif -ifeq ($(CONFIG_BOOTLOADER),y) - -SRC_SEARCH = bootloader/can bootloader/src bootloader/common bootloader/uavcan - -CSRCS = ostubs.c - -CFLAGS += $(addprefix -I,$(SRC_SEARCH)) -DEPOPTS = $(addprefix --dep-path ,$(SRC_SEARCH)) -VPATH= $(SRC_SEARCH) -endif - -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src -ifeq ($(WINTOOL),y) - CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \ - -I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \ - -I "${shell cygpath -w $(ARCH_SRCDIR)/armv7-m}" -else - CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/armv7-m -endif - -all: libboard$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(LINKOBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -libboard$(LIBEXT): $(OBJS) - $(call ARCHIVE, $@, $(OBJS)) - -.depend: Makefile $(SRCS) - @$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, libboard$(LIBEXT)) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -ifneq ($(BOARD_CONTEXT),y) -context: -endif - --include Make.dep diff --git a/boards/cuav/can-gps-v1/src/board_config.h b/boards/cuav/can-gps-v1/src/board_config.h deleted file mode 100644 index ce2c932..0000000 --- a/boards/cuav/can-gps-v1/src/board_config.h +++ /dev/null @@ -1,115 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * PX4FMUv4 internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -/* BUTTON *************************************************************************** */ -#define BUTTON_SAFETY /* PB3 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTB|GPIO_PIN3|GPIO_EXTI) - -#define GPIO_RGB_S /* PB0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN0) -#define BOARD_SRGBLED_PORT STM32_GPIOB_ODR -#define BOARD_SRGBLED_BIT 0 - -/* CAN Silence - * - * Silent mode control \ ESC Mux select - */ -#define GPIO_CAN1_SILENT_S0 /* PB5 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN5) - -#define GPIO_LED_SAFETY (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN1) -#define GPIO_BTN_SAFETY (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTB|GPIO_PIN3) - -/* Tone alarm output. */ -#define TONE_ALARM_TIMER 2 /* timer 2 */ -#define TONE_ALARM_CHANNEL 3 /* channel 1 */ -#define GPIO_TONE_ALARM_IDLE (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN10) -#define GPIO_TONE_ALARM (GPIO_ALT|GPIO_AF1|GPIO_SPEED_2MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN10) - -/* High-resolution timer */ -#define HRT_TIMER 3 /* use timer 3 for the HRT */ -#define HRT_TIMER_CHANNEL 4 /* use capture/compare channel 4 */ - -#define FLASH_BASED_PARAMS - -__BEGIN_DECLS -#define BOARD_HAS_N_S_RGB_LED 8 /* Uses 8 SK6812 digital led chip */ -#define BOARD_MAX_LEDS BOARD_HAS_N_S_RGB_LED - -/* USE_S_RGB_LED_DMAis passed in from the *.cmake file - * Bootloader is not timming sensitive and can use the SW version as a - * size savings - * The Application can not as it needs DMA to maintain reall time. - */ - -#if defined(USE_S_RGB_LED_DMA) -# define S_RGB_LED_DMA DMAMAP_TIM1_CH2 -# define S_RGB_LED_TIMER 1 /* timer 1 */ -# define S_RGB_LED_CHANNEL 2 /* channel 2 */ -# define S_RGB_LED_CHANNELN 1 /* channel 2N */ -# define S_RGB_LED_TIM_GPIO GPIO_TIM1_CH2N_1 -#endif -#ifndef __ASSEMBLY__ - -/**************************************************************************************************** - * Public Functions - ****************************************************************************************************/ - -/**************************************************************************************************** - * Name: stm32_spiinitialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the PX4FMU board. - * - ****************************************************************************************************/ - -extern void stm32_spiinitialize(void); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/cuav/can-gps-v1/src/boot.c b/boards/cuav/can-gps-v1/src/boot.c deleted file mode 100644 index ba0042b..0000000 --- a/boards/cuav/can-gps-v1/src/boot.c +++ /dev/null @@ -1,187 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2015 PX4 Development Team. All rights reserved. - * Author: Ben Dyer - * Pavel Kirienko - * David Sidrane - * - * 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include "boot_config.h" -#include "board.h" - -#include -#include -#include - -#include -#include "led.h" - -/************************************************************************************ - * 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) -{ - putreg32(getreg32(STM32_RCC_APB1ENR) | RCC_APB1ENR_CAN1EN, STM32_RCC_APB1ENR); - stm32_configgpio(GPIO_CAN1_RX); - stm32_configgpio(GPIO_CAN1_TX); - stm32_configgpio(GPIO_CAN1_SILENT_S0); - putreg32(getreg32(STM32_RCC_APB1RSTR) | RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR); - putreg32(getreg32(STM32_RCC_APB1RSTR) & ~RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR); - -#if defined(OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO) - stm32_configgpio(GPIO_GETNODEINFO_JUMPER); -#endif - -} - -/************************************************************************************ - * Name: board_deinitialize - * - * Description: - * This function is called by the bootloader code prior to booting - * the application. Is should place the HW into an benign initialized state. - * - ************************************************************************************/ - -void board_deinitialize(void) -{ - putreg32(getreg32(STM32_RCC_APB1RSTR) | RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR); -} - -/**************************************************************************** - * Name: board_get_product_name - * - * Description: - * Called to retrieve the product name. The returned value is a assumed - * to be written to a pascal style string that will be length prefixed - * and not null terminated - * - * Input Parameters: - * product_name - A pointer to a buffer to write the name. - * maxlen - The maximum number of charter that can be written - * - * Returned Value: - * The length of characters written to the buffer. - * - ****************************************************************************/ - -uint8_t board_get_product_name(uint8_t *product_name, size_t maxlen) -{ - DEBUGASSERT(maxlen > UAVCAN_STRLEN(HW_UAVCAN_NAME)); - memcpy(product_name, HW_UAVCAN_NAME, UAVCAN_STRLEN(HW_UAVCAN_NAME)); - return UAVCAN_STRLEN(HW_UAVCAN_NAME); -} - -/**************************************************************************** - * Name: board_get_hardware_version - * - * Description: - * Called to retrieve the hardware version information. The function - * will first initialize the the callers struct to all zeros. - * - * Input Parameters: - * hw_version - A pointer to a uavcan_hardwareversion_t. - * - * Returned Value: - * Length of the unique_id - * - ****************************************************************************/ - -size_t board_get_hardware_version(uavcan_HardwareVersion_t *hw_version) -{ - memset(hw_version, 0, sizeof(uavcan_HardwareVersion_t)); - - hw_version->major = HW_VERSION_MAJOR; - hw_version->minor = HW_VERSION_MINOR; - - return board_get_mfguid(*(mfguid_t *) hw_version->unique_id); -} - -/**************************************************************************** - * Name: board_indicate - * - * Description: - * Provides User feedback to indicate the state of the bootloader - * on board specific hardware. - * - * Input Parameters: - * indication - A member of the uiindication_t - * - * Returned Value: - * None - * - ****************************************************************************/ -#define led(n, code, r , g , b, h) {.red = (r),.green = (g), .blue = (b),.hz = (h)} - -typedef begin_packed_struct struct led_t { - uint8_t red; - uint8_t green; - uint8_t blue; - uint8_t hz; -} end_packed_struct led_t; - -static const led_t i2l[] = { - - led(0, off, 0, 0, 0, 0), - led(1, reset, 128, 128, 128, 30), - led(2, autobaud_start, 0, 128, 0, 1), - led(3, autobaud_end, 0, 128, 0, 2), - led(4, allocation_start, 0, 0, 64, 2), - led(5, allocation_end, 0, 128, 64, 3), - led(6, fw_update_start, 32, 128, 64, 3), - led(7, fw_update_erase_fail, 32, 128, 32, 3), - led(8, fw_update_invalid_response, 64, 0, 0, 1), - led(9, fw_update_timeout, 64, 0, 0, 2), - led(a, fw_update_invalid_crc, 64, 0, 0, 4), - led(b, jump_to_app, 0, 128, 0, 10), - -}; - -void board_indicate(uiindication_t indication) -{ - rgb_led(i2l[indication].red, - i2l[indication].green, - i2l[indication].blue, - i2l[indication].hz); -} diff --git a/boards/cuav/can-gps-v1/src/boot_config.h b/boards/cuav/can-gps-v1/src/boot_config.h deleted file mode 100644 index 0015ca4..0000000 --- a/boards/cuav/can-gps-v1/src/boot_config.h +++ /dev/null @@ -1,131 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-2015 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. - * - ****************************************************************************/ - -/* - * @file boot_config.h - * - * bootloader definitions that configures the behavior and options - * of the Boot loader - * This file is relies on the parent folder's boot_config.h file and defines - * different usages of the hardware for bootloading - */ - -#pragma once - - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -/* Bring in the board_config.h definitions - * todo:make this be pulled in from a targed's build - * files in nuttx*/ - -#include "board_config.h" -#include "uavcan.h" -#include - -#include - -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define OPT_PREFERRED_NODE_ID ANY_NODE_ID - -//todo:wrap OPT_x in in ifdefs for command line definitions -#define OPT_TBOOT_MS 5000 -#define OPT_NODE_STATUS_RATE_MS 800 -#define OPT_NODE_INFO_RATE_MS 50 -#define OPT_BL_NUMBER_TIMERS 7 -#undef S_RGB_LED_DMA // use the poled one -/* - * This Option set is set to 1 ensure a provider of firmware has an - * opportunity update the node's firmware. - * This Option is the default policy and can be overridden by - * a jumper - * When this Policy is set, the node will ignore tboot and - * wait indefinitely for a GetNodeInfo request before booting. - * - * OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO_INVERT is used to allow - * the polarity of the jumper to be True Active - * - * wait OPT_WAIT_FOR_GETNODEINFO OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO - * Jumper - * yes 1 0 x - * yes 1 1 Active - * no 1 1 Not Active - * no 0 0 X - * yes 0 1 Active - * no 0 1 Not Active - * - */ -#define OPT_WAIT_FOR_GETNODEINFO 0 -#define OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO 1 -#define OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO_INVERT 0 - -#define OPT_ENABLE_WD 1 - -#define OPT_RESTART_TIMEOUT_MS 20000 - -/* Reserved for the Booloader */ -#define OPT_BOOTLOADER_SIZE_IN_K (1024*64) - -/* Reserved for the application out of the total - * system flash minus the BOOTLOADER_SIZE_IN_K - */ -#define OPT_APPLICATION_RESERVER_IN_K 0 - -#define OPT_APPLICATION_IMAGE_OFFSET OPT_BOOTLOADER_SIZE_IN_K -#define OPT_APPLICATION_IMAGE_LENGTH (FLASH_SIZE-(OPT_BOOTLOADER_SIZE_IN_K+OPT_APPLICATION_RESERVER_IN_K)) - - -#define FLASH_BASE STM32_FLASH_BASE -#define FLASH_SIZE STM32_FLASH_SIZE - -#define APPLICATION_LOAD_ADDRESS (FLASH_BASE + OPT_APPLICATION_IMAGE_OFFSET) -#define APPLICATION_SIZE (FLASH_SIZE-OPT_APPLICATION_IMAGE_OFFSET) -#define APPLICATION_LAST_8BIT_ADDRRESS ((uint8_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint8_t))) -#define APPLICATION_LAST_32BIT_ADDRRESS ((uint32_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint32_t))) -#define APPLICATION_LAST_64BIT_ADDRRESS ((uint64_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint64_t))) - -/* If this board uses big flash that have large sectors */ - -#define OPT_USE_YIELD - -/* Bootloader Option***************************************************************** - * - */ -#define GPIO_GETNODEINFO_JUMPER (BUTTON_SAFETY & ~GPIO_EXTI) diff --git a/boards/cuav/can-gps-v1/src/can.c b/boards/cuav/can-gps-v1/src/can.c deleted file mode 100644 index 89b8ba2..0000000 --- a/boards/cuav/can-gps-v1/src/can.c +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file can.c - * - * Board-specific CAN functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include - -#include -#include - -#include "chip.h" -#include "arm_internal.h" - -#include "stm32.h" -#include "stm32_can.h" -#include "board_config.h" - -#ifdef CONFIG_CAN - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) -# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." -# undef CONFIG_STM32_CAN2 -#endif - -#ifdef CONFIG_STM32_CAN1 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); - -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} - -#endif diff --git a/boards/cuav/can-gps-v1/src/i2c.cpp b/boards/cuav/can-gps-v1/src/i2c.cpp deleted file mode 100644 index f95271f..0000000 --- a/boards/cuav/can-gps-v1/src/i2c.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(3), -}; diff --git a/boards/cuav/can-gps-v1/src/init.c b/boards/cuav/can-gps-v1/src/init.c deleted file mode 100644 index 2466d25..0000000 --- a/boards/cuav/can-gps-v1/src/init.c +++ /dev/null @@ -1,155 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * PX4FMU-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include "board_config.h" -#include - -#include - -#include -#include -#include - -#include - -#include - -# if defined(FLASH_BASED_PARAMS) -# include -#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) -{ - watchdog_init(); - // Configure CAN interface - stm32_configgpio(GPIO_CAN1_RX); - stm32_configgpio(GPIO_CAN1_TX); - - stm32_configgpio(GPIO_CAN1_SILENT_S0); - - stm32_configgpio(GPIO_LED_SAFETY); - stm32_configgpio(GPIO_BTN_SAFETY); - - // Configure SPI all interfaces GPIO & enable power. - stm32_spiinitialize(); -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - px4_platform_init(); - -#if defined(FLASH_BASED_PARAMS) - static sector_descriptor_t params_sector_map[] = { - {2, 16 * 1024, 0x08008000}, - {3, 16 * 1024, 0x0800C000}, - {0, 0, 0}, - }; - - /* Initialize the flashfs layer to use heap allocated memory */ - int result = parameter_flashfs_init(params_sector_map, NULL, 0); - - if (result != OK) { - syslog(LOG_ERR, "[boot] FAILED to init params in FLASH %d\n", result); - } - -#endif // FLASH_BASED_PARAMS - - //px4_platform_configure(); - - return OK; -} diff --git a/boards/cuav/can-gps-v1/src/led.cpp b/boards/cuav/can-gps-v1/src/led.cpp deleted file mode 100644 index e83154f..0000000 --- a/boards/cuav/can-gps-v1/src/led.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2015 PX4 Development Team. All rights reserved. - * Author: David Sidrane - * - * 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 - -#include -#include - -#include - -#include -#include -#include -#include - -#include "led.h" - -#define TMR_BASE STM32_TIM1_BASE -#define TMR_FREQUENCY STM32_APB2_TIM1_CLKIN -#define TMR_REG(o) (TMR_BASE+(o)) - -static uint8_t _rgb[] = {0, 0, 0}; - -static int timerInterrupt(int irq, void *context, void *arg) -{ - putreg16(~getreg16(TMR_REG(STM32_GTIM_SR_OFFSET)), TMR_REG(STM32_GTIM_SR_OFFSET)); - - static int d2 = 1; - (d2++ & 1) ? neopixel_write_no_dma(0, 0, 0, 1) : neopixel_write_no_dma(_rgb[0], _rgb[1], _rgb[2], 1); - - return 0; -} - -void rgb_led(int r, int g, int b, int freqs) -{ - long fosc = TMR_FREQUENCY; - long prescale = 1536; - long p1s = fosc / prescale; - long p0p5s = p1s / 2; - uint16_t val; - static bool once = 0; - - if (!once) { - once = 1; - - stm32_configgpio(GPIO_RGB_S); - - neopixel_write_no_dma(0, 0, 0, BOARD_HAS_N_S_RGB_LED); - - modifyreg32(STM32_RCC_APB2ENR, 0, RCC_APB2ENR_TIM1EN); - - /* Reload */ - val = getreg16(TMR_REG(STM32_BTIM_EGR_OFFSET)); - val |= ATIM_EGR_UG; - putreg16(val, TMR_REG(STM32_BTIM_EGR_OFFSET)); - - /* Set Prescaler STM32_TIM_SETCLOCK */ - putreg16(prescale, TMR_REG(STM32_BTIM_PSC_OFFSET)); - - /* Enable STM32_TIM_SETMODE*/ - putreg16(ATIM_CR1_CEN | ATIM_CR1_ARPE, TMR_REG(STM32_BTIM_CR1_OFFSET)); - - putreg32(p0p5s + 1, TMR_REG(STM32_BTIM_ARR_OFFSET)); - - - irq_attach(STM32_IRQ_TIM1CC, timerInterrupt, NULL); - up_enable_irq(STM32_IRQ_TIM1CC); - putreg16(GTIM_DIER_CC1IE, TMR_REG(STM32_GTIM_DIER_OFFSET)); - } - - long p = freqs == 0 ? p1s + 1 : p0p5s / freqs; - putreg32(p + 1, TMR_REG(STM32_BTIM_ARR_OFFSET)); - putreg32(p, TMR_REG(STM32_GTIM_CCR1_OFFSET)); - _rgb[0] = r; - _rgb[1] = g; - _rgb[2] = b; - neopixel_write_no_dma(_rgb[0], _rgb[1], _rgb[2], 1); - - val = getreg16(TMR_REG(STM32_BTIM_CR1_OFFSET)); - - if (freqs == 0) { - val &= ~ATIM_CR1_CEN; - - } else { - val |= ATIM_CR1_CEN; - } - - putreg16(val, TMR_REG(STM32_BTIM_CR1_OFFSET)); -} diff --git a/boards/cuav/can-gps-v1/src/led.h b/boards/cuav/can-gps-v1/src/led.h deleted file mode 100644 index b68e4aa..0000000 --- a/boards/cuav/can-gps-v1/src/led.h +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2015 PX4 Development Team. All rights reserved. - * Author: David Sidrane - * - * 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. - * - ****************************************************************************/ - -__BEGIN_DECLS -void rgb_led(int r, int g, int b, int freqs); -__END_DECLS diff --git a/boards/cuav/can-gps-v1/src/spi.cpp b/boards/cuav/can-gps-v1/src/spi.cpp deleted file mode 100644 index 3b31426..0000000 --- a/boards/cuav/can-gps-v1/src/spi.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortA, GPIO::Pin10}), - initSPIDevice(DRV_MAG_DEVTYPE_RM3100, SPI::CS{GPIO::PortA, GPIO::Pin4}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/cuav/can-gps-v1/uavcan_board_identity b/boards/cuav/can-gps-v1/uavcan_board_identity deleted file mode 100644 index a547589..0000000 --- a/boards/cuav/can-gps-v1/uavcan_board_identity +++ /dev/null @@ -1,18 +0,0 @@ -# UAVCAN boot loadable Module ID -set(uavcanblid_sw_version_major 0) -set(uavcanblid_sw_version_minor 1) -add_definitions( - -DAPP_VERSION_MAJOR=${uavcanblid_sw_version_major} - -DAPP_VERSION_MINOR=${uavcanblid_sw_version_minor} -) - -set(uavcanblid_hw_version_major 3) -set(uavcanblid_hw_version_minor 233) -set(uavcanblid_name "\"org.cuav.can-gps-v1\"") -add_definitions( - -DHW_UAVCAN_NAME=${uavcanblid_name} - -DHW_VERSION_MAJOR=${uavcanblid_hw_version_major} - -DHW_VERSION_MINOR=${uavcanblid_hw_version_minor} - -DSUPPORT_ALT_CAN_BOOTLOADER - -) diff --git a/boards/cuav/nora/bootloader.px4board b/boards/cuav/nora/bootloader.px4board deleted file mode 100644 index 19b6e66..0000000 --- a/boards/cuav/nora/bootloader.px4board +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_ROMFSROOT="" diff --git a/boards/cuav/nora/default.px4board b/boards/cuav/nora/default.px4board deleted file mode 100644 index f312504..0000000 --- a/boards/cuav/nora/default.px4board +++ /dev/null @@ -1,99 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS0" -CONFIG_BOARD_SERIAL_GPS2="/dev/ttyS2" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS3" -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_COMMON_BAROMETERS=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_HEATER=y -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=y -CONFIG_DRIVERS_IMU_BOSCH_BMI088=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20649=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20689=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_DRIVERS_LIGHTS_RGBLED_PWM=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SAFETY_BUTTON=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_BOARD_UAVCAN_TIMER_OVERRIDE=2 -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_FAKE_GPS=y diff --git a/boards/cuav/nora/extras/cuav_nora_bootloader.bin b/boards/cuav/nora/extras/cuav_nora_bootloader.bin deleted file mode 100755 index 015f8e3..0000000 Binary files a/boards/cuav/nora/extras/cuav_nora_bootloader.bin and /dev/null differ diff --git a/boards/cuav/nora/firmware.prototype b/boards/cuav/nora/firmware.prototype deleted file mode 100644 index 77470ef..0000000 --- a/boards/cuav/nora/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 1009, - "magic": "PX4FWv1", - "description": "Firmware for the CUAV Nora board", - "image": "", - "build_time": 0, - "summary": "Nora", - "version": "0.1", - "image_size": 0, - "image_maxsize": 1966080, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/cuav/nora/init/rc.board_defaults b/boards/cuav/nora/init/rc.board_defaults deleted file mode 100644 index f7905f6..0000000 --- a/boards/cuav/nora/init/rc.board_defaults +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 18 -param set-default BAT2_V_DIV 18 - -param set-default BAT1_A_PER_V 24 -param set-default BAT2_A_PER_V 24 - -# Enable IMU thermal control -param set-default SENS_EN_THERMAL 1 - -rgbled_pwm start -safety_button start diff --git a/boards/cuav/nora/init/rc.board_sensors b/boards/cuav/nora/init/rc.board_sensors deleted file mode 100644 index b6dcb5b..0000000 --- a/boards/cuav/nora/init/rc.board_sensors +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# -# board specific sensors init -#------------------------------------------------------------------------------ -board_adc start - -# SPI1 -icm20689 -s -b 1 -R 2 start - -# SPI2 -rm3100 -s -b 2 start - -# SPI4 -bmi088 -s -b 4 -A -R 2 start -if ! bmi088 -s -b 4 -G -R 2 start -then - icm42688p -R 2 -s start -fi -ms5611 -s -b 4 start - -# SPI6 -if ! icm20649 -s -b 6 -R 2 start -then - icm20689 -s -b 6 -R 2 start -fi -ms5611 -s -b 6 start - -# External compass on GPS1/I2C1: standard CUAV GPS/compass puck (with lights, safety button, and buzzer) -ist8310 -X -b 1 -R 10 start diff --git a/boards/cuav/nora/nuttx-config/bootloader/defconfig b/boards/cuav/nora/nuttx-config/bootloader/defconfig deleted file mode 100644 index a054498..0000000 --- a/boards/cuav/nora/nuttx-config/bootloader/defconfig +++ /dev/null @@ -1,90 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_CONSOLE is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_SPI_EXCHANGE is not set -# CONFIG_STM32H7_SYSCFG is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/cuav/nora/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743XI=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_INITTHREAD_PRIORITY=254 -CONFIG_BOARD_LATE_INITIALIZE=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x004c -CONFIG_CDCACM_PRODUCTSTR="PX4 BL CUAV Nora" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x3163 -CONFIG_CDCACM_VENDORSTR="CUAV" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_EXPERIMENTAL=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="bootloader_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SPI=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_USART6=y -CONFIG_SYSTEMTICK_HOOK=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGINT_CHAR=0x03 -CONFIG_TTY_SIGTSTP=y -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/cuav/nora/nuttx-config/include/board.h b/boards/cuav/nora/nuttx-config/include/board.h deleted file mode 100644 index ad4b16f..0000000 --- a/boards/cuav/nora/nuttx-config/include/board.h +++ /dev/null @@ -1,286 +0,0 @@ -/************************************************************************************ - * nuttx-config/include/board.h - * - * Copyright (C) 2020 Gregory Nutt. All rights reserved. - * Authors: David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ -#pragma once - -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/* Clocking *************************************************************************/ -/* The board provides the following clock sources: - * - * X1: 16 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 16 MHz RC factory-trimmed - * HSE: 16 MHz crystal for HSE - */ -#define STM32_BOARD_XTAL 16000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 0 - -/* Main PLL Configuration. - * - * PLL source is HSE = 16,000,000 - * - * PLL_VCOx = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 1 <= PLLM <= 63 - * 4 <= PLLN <= 512 - * 150 MHz <= PLL_VCOL <= 420MHz - * 192 MHz <= PLL_VCOH <= 836MHz - * - * SYSCLK = PLL_VCO / PLLP - * CPUCLK = SYSCLK / D1CPRE - * Subject to - * - * PLLP1 = {2, 4, 6, 8, ..., 128} - * PLLP2,3 = {2, 3, 4, ..., 128} - * CPUCLK <= 480 MHz - */ -#define STM32_PLLCFG_PLLSRC RCC_PLLCKSELR_PLLSRC_HSE - -/* PLL1, wide 4 - 8 MHz input, enable DIVP, DIVQ, DIVR - * - * PLL1_VCO = (16,000,000 / 1) * 60 = 960 MHz - * - * PLL1P = PLL1_VCO/2 = 960 MHz / 2 = 480 MHz - * PLL1Q = PLL1_VCO/4 = 960 MHz / 4 = 240 MHz - * PLL1R = PLL1_VCO/8 = 960 MHz / 8 = 120 MHz - */ -#define STM32_PLLCFG_PLL1CFG (RCC_PLLCFGR_PLL1VCOSEL_WIDE|RCC_PLLCFGR_PLL1RGE_4_8_MHZ|RCC_PLLCFGR_DIVP1EN|RCC_PLLCFGR_DIVQ1EN|RCC_PLLCFGR_DIVR1EN) -#define STM32_PLLCFG_PLL1M RCC_PLLCKSELR_DIVM1(1) -#define STM32_PLLCFG_PLL1N RCC_PLL1DIVR_N1(60) -#define STM32_PLLCFG_PLL1P RCC_PLL1DIVR_P1(2) -#define STM32_PLLCFG_PLL1Q RCC_PLL1DIVR_Q1(4) -#define STM32_PLLCFG_PLL1R RCC_PLL1DIVR_R1(8) - -#define STM32_VCO1_FREQUENCY ((STM32_HSE_FREQUENCY / 1) * 60) -#define STM32_PLL1P_FREQUENCY (STM32_VCO1_FREQUENCY / 2) -#define STM32_PLL1Q_FREQUENCY (STM32_VCO1_FREQUENCY / 4) -#define STM32_PLL1R_FREQUENCY (STM32_VCO1_FREQUENCY / 8) - -/* PLL2 */ -#define STM32_PLLCFG_PLL2CFG (RCC_PLLCFGR_PLL2VCOSEL_WIDE|RCC_PLLCFGR_PLL2RGE_4_8_MHZ|RCC_PLLCFGR_DIVP2EN|RCC_PLLCFGR_DIVQ2EN|RCC_PLLCFGR_DIVR2EN) -#define STM32_PLLCFG_PLL2M RCC_PLLCKSELR_DIVM2(4) -#define STM32_PLLCFG_PLL2N RCC_PLL2DIVR_N2(48) -#define STM32_PLLCFG_PLL2P RCC_PLL2DIVR_P2(2) -#define STM32_PLLCFG_PLL2Q RCC_PLL2DIVR_Q2(2) -#define STM32_PLLCFG_PLL2R RCC_PLL2DIVR_R2(2) - -#define STM32_VCO2_FREQUENCY ((STM32_HSE_FREQUENCY / 4) * 48) -#define STM32_PLL2P_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2Q_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2R_FREQUENCY (STM32_VCO2_FREQUENCY / 2) - -/* PLL3 */ -#define STM32_PLLCFG_PLL3CFG (RCC_PLLCFGR_PLL3VCOSEL_WIDE|RCC_PLLCFGR_PLL3RGE_4_8_MHZ|RCC_PLLCFGR_DIVQ3EN) -#define STM32_PLLCFG_PLL3M RCC_PLLCKSELR_DIVM3(4) -#define STM32_PLLCFG_PLL3N RCC_PLL3DIVR_N3(48) -#define STM32_PLLCFG_PLL3P RCC_PLL3DIVR_P3(2) -#define STM32_PLLCFG_PLL3Q RCC_PLL3DIVR_Q3(4) -#define STM32_PLLCFG_PLL3R RCC_PLL3DIVR_R3(2) - -#define STM32_VCO3_FREQUENCY ((STM32_HSE_FREQUENCY / 4) * 48) -#define STM32_PLL3P_FREQUENCY (STM32_VCO3_FREQUENCY / 2) -#define STM32_PLL3Q_FREQUENCY (STM32_VCO3_FREQUENCY / 4) -#define STM32_PLL3R_FREQUENCY (STM32_VCO3_FREQUENCY / 2) - -/* SYSCLK = PLL1P = 480MHz - * CPUCLK = SYSCLK / 1 = 480 MHz - */ -#define STM32_RCC_D1CFGR_D1CPRE (RCC_D1CFGR_D1CPRE_SYSCLK) -#define STM32_SYSCLK_FREQUENCY (STM32_PLL1P_FREQUENCY) -#define STM32_CPUCLK_FREQUENCY (STM32_SYSCLK_FREQUENCY / 1) - -/* Configure Clock Assignments */ - -/* AHB clock (HCLK) is SYSCLK/2 (240 MHz max) - * HCLK1 = HCLK2 = HCLK3 = HCLK4 = 240 - */ -#define STM32_RCC_D1CFGR_HPRE RCC_D1CFGR_HPRE_SYSCLKd2 /* HCLK = SYSCLK / 2 */ -#define STM32_ACLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* ACLK in D1, HCLK3 in D1 */ -#define STM32_HCLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* HCLK in D2, HCLK4 in D3 */ -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/2 (120 MHz) */ -#define STM32_RCC_D2CFGR_D2PPRE1 RCC_D2CFGR_D2PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB2 clock (PCLK2) is HCLK/2 (120 MHz) */ -#define STM32_RCC_D2CFGR_D2PPRE2 RCC_D2CFGR_D2PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB3 clock (PCLK3) is HCLK/2 (120 MHz) */ -#define STM32_RCC_D1CFGR_D1PPRE RCC_D1CFGR_D1PPRE_HCLKd2 /* PCLK3 = HCLK / 2 */ -#define STM32_PCLK3_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB4 clock (PCLK4) is HCLK/4 (120 MHz) */ -#define STM32_RCC_D3CFGR_D3PPRE RCC_D3CFGR_D3PPRE_HCLKd2 /* PCLK4 = HCLK / 2 */ -#define STM32_PCLK4_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timer clock frequencies */ - -/* Timers driven from APB1 will be twice PCLK1 */ -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* Timers driven from APB2 will be twice PCLK2 */ -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM15_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM16_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM17_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Kernel Clock Configuration - * Note: look at Table 54 in ST Manual - */ -#define STM32_RCC_D2CCIP2R_I2C123SRC RCC_D2CCIP2R_I2C123SEL_HSI /* I2C123 clock source */ -#define STM32_RCC_D3CCIPR_I2C4SRC RCC_D3CCIPR_I2C4SEL_HSI /* I2C4 clock source */ -#define STM32_RCC_D2CCIP1R_SPI123SRC RCC_D2CCIP1R_SPI123SEL_PLL2 /* SPI123 clock source */ -#define STM32_RCC_D2CCIP1R_SPI45SRC RCC_D2CCIP1R_SPI45SEL_PLL2 /* SPI45 clock source */ -#define STM32_RCC_D3CCIPR_SPI6SRC RCC_D3CCIPR_SPI6SEL_PLL2 /* SPI6 clock source */ -#define STM32_RCC_D2CCIP2R_USBSRC RCC_D2CCIP2R_USBSEL_PLL3 /* USB 1 and 2 clock source */ -#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2 /* ADC 1 2 3 clock source */ -#define STM32_RCC_D2CCIP1R_FDCANSEL RCC_D2CCIP1R_FDCANSEL_HSE /* FDCAN 1 2 clock source */ - -#define STM32_FDCANCLK STM32_HSE_FREQUENCY - -/* FLASH wait states */ -#define BOARD_FLASH_WAITSTATES 2 - -/* SDMMC definitions ********************************************************/ -/* Init 400kHz, freq = PLL1Q/(2*div) div = PLL1Q/(2*freq) */ -#define STM32_SDMMC_INIT_CLKDIV (300 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* 25 MHz Max for now, 25 mHZ = PLL1Q/(2*div), div = PLL1Q/(2*freq) - * div = 4.8 = 240 / 50, So round up to 5 for default speed 24 MB/s - */ -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_MMCXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_SDXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - -/* UART/USART */ -#define GPIO_USART1_RX GPIO_USART1_RX_3 /* PB7 */ -#define GPIO_USART1_TX GPIO_USART1_TX_3 /* PB6 */ - -#define GPIO_USART2_RX GPIO_USART2_RX_2 /* PD6 */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 /* PD4 */ -#define GPIO_USART2_CTS GPIO_USART2_CTS_NSS_2 /* PD3 */ - -#define GPIO_UART4_RX GPIO_UART4_RX_5 /* PD0 */ -#define GPIO_UART4_TX GPIO_UART4_TX_5 /* PD1 */ - -#define GPIO_USART6_RX GPIO_USART6_RX_2 /* PG9 */ -#define GPIO_USART6_TX GPIO_USART6_TX_2 /* PG14 */ -#define GPIO_USART6_RTS GPIO_USART6_RTS_2 /* PG8 */ -#define GPIO_USART6_CTS GPIO_USART6_CTS_NSS_2 /* PG15 */ - -#define GPIO_UART7_RX GPIO_UART7_RX_4 /* PF6 */ -#define GPIO_UART7_TX GPIO_UART7_TX_3 /* PE8 */ - -#define GPIO_UART8_RX GPIO_UART8_RX_1 /* PE0 */ -#define GPIO_UART8_TX GPIO_UART8_TX_1 /* PE1 */ - -/* CAN */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_5 /* PI9 */ -#define GPIO_CAN1_TX GPIO_CAN1_TX_4 /* PH13 */ -#define GPIO_CAN2_RX GPIO_CAN2_RX_1 /* PB12 */ -#define GPIO_CAN2_TX GPIO_CAN2_TX_1 /* PB13 */ - -/* SPI */ -#define ADJ_SLEW_RATE(p) (((p) & ~GPIO_SPEED_MASK) | (GPIO_SPEED_2MHz)) - -#define GPIO_SPI1_SCK ADJ_SLEW_RATE(GPIO_SPI1_SCK_3) /* PG11 */ -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_3 /* PD7 */ - -#define GPIO_SPI2_SCK ADJ_SLEW_RATE(GPIO_SPI2_SCK_6) /* PI1 */ -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_3 /* PI2 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_4 /* PI3 */ - -#define GPIO_SPI4_SCK ADJ_SLEW_RATE(GPIO_SPI4_SCK_2) /* PE2 */ -#define GPIO_SPI4_MISO GPIO_SPI4_MISO_1 /* PE13 */ -#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_2 /* PE6 */ - -#define GPIO_SPI5_SCK ADJ_SLEW_RATE(GPIO_SPI5_SCK_1) /* PF7 */ -#define GPIO_SPI5_MISO GPIO_SPI5_MISO_1 /* PF8 */ -#define GPIO_SPI5_MOSI GPIO_SPI5_MOSI_2 /* PF9 */ - -#define GPIO_SPI6_SCK ADJ_SLEW_RATE(GPIO_SPI6_SCK_1) /* PG13 */ -#define GPIO_SPI6_MISO GPIO_SPI6_MISO_1 /* PG12 */ -#define GPIO_SPI6_MOSI GPIO_SPI6_MOSI_2 /* PA7 */ - -/* I2C */ -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 /* PB8 */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 /* PB9 */ - -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_2 /* PF1 */ -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_2 /* PF0 */ - -#define GPIO_I2C3_SCL GPIO_I2C3_SCL_2 /* PH7 */ -#define GPIO_I2C3_SDA GPIO_I2C3_SDA_2 /* PH8 */ - -#define GPIO_I2C4_SCL GPIO_I2C4_SCL_2 /* PF14 */ -#define GPIO_I2C4_SDA GPIO_I2C4_SDA_2 /* PF15 */ diff --git a/boards/cuav/nora/nuttx-config/include/board_dma_map.h b/boards/cuav/nora/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 428ef3f..0000000 --- a/boards/cuav/nora/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -// DMAMUX1 -#define DMAMAP_SPI1_RX DMAMAP_DMA12_SPI1RX_0 /* DMA1:37 */ -#define DMAMAP_SPI1_TX DMAMAP_DMA12_SPI1TX_0 /* DMA1:38 */ - -#define DMAMAP_UART8_RX DMAMAP_DMA12_UART8RX_0 /* DMA1:81 */ -#define DMAMAP_UART8_TX DMAMAP_DMA12_UART8TX_0 /* DMA1:82 */ - -#define DMAMAP_SPI4_RX DMAMAP_DMA12_SPI4RX_0 /* DMA1:83 */ -#define DMAMAP_SPI4_TX DMAMAP_DMA12_SPI4TX_0 /* DMA1:84 */ - - -// DMAMUX2 (BDMA) -#define DMAMAP_SPI6_RX DMAMAP_BDMA_SPI6_RX /* BDMA:11 */ -#define DMAMAP_SPI6_TX DMAMAP_BDMA_SPI6_TX /* BDMA:12 */ diff --git a/boards/cuav/nora/nuttx-config/nsh/defconfig b/boards/cuav/nora/nuttx-config/nsh/defconfig deleted file mode 100644 index fb84cac..0000000 --- a/boards/cuav/nora/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,265 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/cuav/nora/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743XI=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=95150 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x004c -CONFIG_CDCACM_PRODUCTSTR="PX4 CUAV Nora" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x3163 -CONFIG_CDCACM_VENDORSTR="CUAV" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXPERIMENTAL=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=4 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_PROGMEM=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32H7_ADC1=y -CONFIG_STM32H7_ADC3=y -CONFIG_STM32H7_BBSRAM=y -CONFIG_STM32H7_BBSRAM_FILES=5 -CONFIG_STM32H7_BDMA=y -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_DMA2=y -CONFIG_STM32H7_DMACAPABLE=y -CONFIG_STM32H7_FLOWCONTROL_BROKEN=y -CONFIG_STM32H7_I2C1=y -CONFIG_STM32H7_I2C2=y -CONFIG_STM32H7_I2C3=y -CONFIG_STM32H7_I2C4=y -CONFIG_STM32H7_I2C_DYNTIMEO=y -CONFIG_STM32H7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_RTC=y -CONFIG_STM32H7_RTC_HSECLOCK=y -CONFIG_STM32H7_RTC_MAGIC_REG=1 -CONFIG_STM32H7_SAVE_CRASHDUMP=y -CONFIG_STM32H7_SDMMC1=y -CONFIG_STM32H7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_SPI1=y -CONFIG_STM32H7_SPI1_DMA=y -CONFIG_STM32H7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32H7_SPI2=y -CONFIG_STM32H7_SPI4=y -CONFIG_STM32H7_SPI4_DMA=y -CONFIG_STM32H7_SPI4_DMA_BUFFER=1024 -CONFIG_STM32H7_SPI5=y -CONFIG_STM32H7_SPI6=y -CONFIG_STM32H7_SPI6_DMA=y -CONFIG_STM32H7_SPI6_DMA_BUFFER=1024 -CONFIG_STM32H7_TIM12=y -CONFIG_STM32H7_TIM15=y -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_TIM3=y -CONFIG_STM32H7_TIM4=y -CONFIG_STM32H7_TIM5=y -CONFIG_STM32H7_TIM8=y -CONFIG_STM32H7_UART4=y -CONFIG_STM32H7_UART7=y -CONFIG_STM32H7_UART8=y -CONFIG_STM32H7_USART1=y -CONFIG_STM32H7_USART2=y -CONFIG_STM32H7_USART6=y -CONFIG_STM32H7_USART_BREAKS=y -CONFIG_STM32H7_USART_INVERT=y -CONFIG_STM32H7_USART_SINGLEWIRE=y -CONFIG_STM32H7_USART_SWAP=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGTSTP=y -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_IFLOWCONTROL=y -CONFIG_USART6_OFLOWCONTROL=y -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 -CONFIG_WATCHDOG=y diff --git a/boards/cuav/nora/nuttx-config/scripts/bootloader_script.ld b/boards/cuav/nora/nuttx-config/scripts/bootloader_script.ld deleted file mode 100644 index c2eba58..0000000 --- a/boards/cuav/nora/nuttx-config/scripts/bootloader_script.ld +++ /dev/null @@ -1,223 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2020 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The board uses an STM32H743XIH6 and has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * There's a switch on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the switch is - * drepresed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743ZI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K - DTCM1 (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - DTCM2 (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */ - SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */ - SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */ - BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > AXI_SRAM AT > FLASH - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > AXI_SRAM - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } - - .ramfunc : { - _sramfuncs = .; - *(.ramfunc .ramfunc.*) - . = ALIGN(4); - _eramfuncs = .; - } > ITCM_RAM AT > FLASH - - _framfuncs = LOADADDR(.ramfunc); -} diff --git a/boards/cuav/nora/nuttx-config/scripts/script.ld b/boards/cuav/nora/nuttx-config/scripts/script.ld deleted file mode 100644 index f213ad2..0000000 --- a/boards/cuav/nora/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,228 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2020 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The board uses an STM32H743XIH6 and has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * There's a switch on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the switch is - * drepresed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743ZI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - FLASH (rx) : ORIGIN = 0x08020000, LENGTH = 1920K - - DTCM1_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - DTCM2_RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */ - SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */ - SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */ - BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH - - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - - /* Pad out last section as the STM32H7 Flash write size is 256 bits. 32 bytes */ - . = ALIGN(16); - FILL(0xffff) - . += 16; - } > AXI_SRAM AT > FLASH = 0xffff - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > AXI_SRAM - - /* Emit the the D3 power domain section for locating BDMA data */ - - .sram4_reserve (NOLOAD) : - { - *(.sram4) - . = ALIGN(4); - _sram4_heap_start = ABSOLUTE(.); - } > SRAM4 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/cuav/nora/src/CMakeLists.txt b/boards/cuav/nora/src/CMakeLists.txt deleted file mode 100644 index a218bdd..0000000 --- a/boards/cuav/nora/src/CMakeLists.txt +++ /dev/null @@ -1,67 +0,0 @@ -############################################################################ -# -# Copyright (c) 2020 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. -# -############################################################################ -if("${PX4_BOARD_LABEL}" STREQUAL "bootloader") - add_library(drivers_board - bootloader_main.c - usb.c - ) - target_link_libraries(drivers_board - PRIVATE - nuttx_arch - nuttx_drivers - bootloader - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/bootloader/common) - -else() - add_library(drivers_board - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - usb.c - ) - add_dependencies(drivers_board arch_board_hw_info) - - target_link_libraries(drivers_board - PRIVATE - arch_io_pins - arch_spi - arch_board_hw_info - drivers__led - nuttx_arch - nuttx_drivers - px4_layer - ) -endif() diff --git a/boards/cuav/nora/src/board_config.h b/boards/cuav/nora/src/board_config.h deleted file mode 100644 index 56dbf9c..0000000 --- a/boards/cuav/nora/src/board_config.h +++ /dev/null @@ -1,246 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * Board internal definitions - */ - -#pragma once - -#include -#include -#include -#include - -/* LEDs */ -#define GPIO_nLED_RED /* PI5 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTI|GPIO_PIN5) -#define GPIO_nLED_GREEN /* PI6 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTI|GPIO_PIN6) -#define GPIO_nLED_BLUE /* PI7 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTI|GPIO_PIN7) - -#define BOARD_HAS_LED_PWM 1 - -/* ADC channels */ -#define PX4_ADC_GPIO \ - /* PA0 */ GPIO_ADC1_INP16, \ - /* PA1 */ GPIO_ADC1_INP17, \ - /* PA2 */ GPIO_ADC12_INP14, \ - /* PF11 */ GPIO_ADC1_INP2, \ - /* PC4 */ GPIO_ADC12_INP4, \ - /* PA4 */ GPIO_ADC12_INP18, \ - /* PF12 */ GPIO_ADC1_INP6, \ - /* PC5 */ GPIO_ADC12_INP8, \ - /* PC1 */ GPIO_ADC123_INP11, \ - /* PC2 */ GPIO_ADC123_INP12, \ - /* PC3 */ GPIO_ADC12_INP13 - -/* Define Channel numbers must match above GPIO pins */ -#define ADC_BATTERY1_VOLTAGE_CHANNEL 16 /* PA0 */ -#define ADC_BATTERY1_CURRENT_CHANNEL 17 /* PA1 */ -#define ADC_BATTERY2_VOLTAGE_CHANNEL 14 /* PA2 */ -#define ADC_BATTERY2_CURRENT_CHANNEL 2 /* PF11 */ -#define ADC1_6V6_IN_CHANNEL 4 /* PC4 */ // SPARE1_ADC1: ADC6.6 -#define ADC1_3V3_IN_CHANNEL 18 /* PA4 */ // SPARE2_ADC1: ADC3.3 -#define ADC_RSSI_IN_CHANNEL 6 /* PF12 */ -#define ADC_SCALED_V5_CHANNEL 8 /* PC5 */ // VDD_5V_SENS: Motherboard 5V voltage detection -#define ADC_SCALED_VDD_3V3_SENSORS_CHANNEL 11 /* PC1 */ // SCALED_V3V3: Sensor power detection -#define ADC_HW_VER_SENSE_CHANNEL 12 /* PC2 */ -#define ADC_HW_REV_SENSE_CHANNEL 13 /* PC3 */ - -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY1_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY1_CURRENT_CHANNEL) | \ - (1 << ADC_BATTERY2_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY2_CURRENT_CHANNEL) | \ - (1 << ADC1_6V6_IN_CHANNEL) | \ - (1 << ADC1_3V3_IN_CHANNEL) | \ - (1 << ADC_RSSI_IN_CHANNEL) | \ - (1 << ADC_SCALED_V5_CHANNEL) | \ - (1 << ADC_SCALED_VDD_3V3_SENSORS_CHANNEL) | \ - (1 << ADC_HW_VER_SENSE_CHANNEL) | \ - (1 << ADC_HW_REV_SENSE_CHANNEL)) - -/* HW has to large of R termination on ADC todo:change when HW value is chosen */ -#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f) - -#define GPIO_HW_REV_DRIVE /* PH14 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTH|GPIO_PIN14) -#define GPIO_HW_REV_SENSE /* PC3 */ GPIO_ADC12_INP13 -#define GPIO_HW_VER_DRIVE /* PH14 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN3) -#define GPIO_HW_VER_SENSE /* PC2 */ GPIO_ADC123_INP12 - -/* CAN Silence Silent mode control */ -#define GPIO_CAN1_SILENT_S0 /* PH2 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN2) -#define GPIO_CAN2_SILENT_S1 /* PH3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN3) - -/* HEATER */ -#define GPIO_HEATER_OUTPUT /* PA8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN8) -#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true)) - -/* PWM */ -#define DIRECT_PWM_OUTPUT_CHANNELS 14 -#define BOARD_NUM_IO_TIMERS 4 - -/* Power supply control and monitoring GPIOs */ -#define BOARD_NUMBER_BRICKS 2 - -#define GPIO_nPOWER_IN_ADC /* PG1 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN1) -#define GPIO_nPOWER_IN_CAN /* PG2 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN2) -#define GPIO_nPOWER_IN_C /* PG0 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN0) - -#define GPIO_nVDD_BRICK1_VALID GPIO_nPOWER_IN_ADC /* Brick 1 is Chosen */ -#define GPIO_nVDD_BRICK2_VALID GPIO_nPOWER_IN_CAN /* Brick 2 is Chosen */ -#define GPIO_nVDD_USB_VALID GPIO_nPOWER_IN_C /* USB is Chosen */ - -#define GPIO_VDD_5V_HIPOWER_EN /* PD11 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTD|GPIO_PIN11) -#define GPIO_nVDD_5V_PERIPH_EN /* PG4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN4) -#define GPIO_VDD_5V_RC_EN /* PG5 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN5) -#define GPIO_VDD_3V3_SD_CARD_EN /* PG7 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN7) - -#define GPIO_VDD_5V_HIPOWER_OC /* PJ3 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTJ|GPIO_PIN3) -#define GPIO_nVDD_5V_PERIPH_OC /* PJ4 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTJ|GPIO_PIN4) - -/* Power switch controls ******************************************************/ -#define VDD_5V_PERIPH_EN(on_true) px4_arch_gpiowrite(GPIO_nVDD_5V_PERIPH_EN, (on_true)) -#define VDD_5V_HIPOWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_HIPOWER_EN, (on_true)) -#define VDD_3V3_SD_CARD_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SD_CARD_EN, (on_true)) - -#define SPEKTRUM_POWER(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_RC_EN, (on_true)) -#define READ_SPEKTRUM_POWER() px4_arch_gpioread(GPIO_VDD_5V_RC_EN) - -/* Tone alarm output */ -#define TONE_ALARM_TIMER 15 /* timer 15 */ -#define TONE_ALARM_CHANNEL 1 /* PE5 TIM15_CH1 */ - -#define GPIO_TONE_ALARM_IDLE /* PE5 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN5) // ALARM -#define GPIO_TONE_ALARM GPIO_TIM15_CH1OUT_2 - -/* USB - * OTG FS: PA9 OTG_FS_VBUS VBUS sensing - * HS USB EN: PH15 - */ -#define GPIO_OTGFS_VBUS /* PA9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN9) -#define GPIO_HS_USB_EN /* PH15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN15) - -/* High-resolution timer */ -#define HRT_TIMER 3 /* use timer3 for the HRT */ -#define HRT_TIMER_CHANNEL 3 /* use capture/compare channel 3 */ - - -#define HRT_PPM_CHANNEL /* T3C1 */ 1 /* use capture/compare channel 1 */ -#define GPIO_PPM_IN /* PB4 T3C1 */ GPIO_TIM3_CH1IN_2 -#define RC_SERIAL_PORT "/dev/ttyS5" -#define RC_SERIAL_SINGLEWIRE - -/** - * GPIO PPM_IN on PB4 T3C1 - * SPEKTRUM_RX (it's TX or RX in Bind) on UART8 PE0 - * Inversion is possible in the UART and can drive GPIO_PPM_IN as an output - */ -#define GPIO_PPM_IN_AS_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN4) -#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_PPM_IN_AS_OUT) -#define SPEKTRUM_RX_AS_UART() /* Can be left as uart */ -#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true)) - -/* RSSI_IN */ -#define GPIO_RSSI_IN /* PB0 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN0) - -/* Safety Switch is only on FMU */ -#define FMU_LED_AMBER /* PE12 */ (GPIO_OUTPUT|GPIO_PULLDOWN|GPIO_PORTE|GPIO_PIN12) // FMU_LED_AMBER -#define GPIO_BTN_SAFETY /* PE10 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTE|GPIO_PIN10) // SAFETY_SW - -#define GPIO_LED_SAFETY FMU_LED_AMBER - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID)) -#define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -#define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID)) -#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_nVDD_5V_PERIPH_OC)) -#define BOARD_ADC_HIPOWER_5V_OC (!px4_arch_gpioread(GPIO_VDD_5V_HIPOWER_OC)) - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ -#define BOARD_HAS_ON_RESET 1 - - -#define BOARD_ENABLE_CONSOLE_BUFFER - -#define PX4_GPIO_INIT_LIST { \ - PX4_ADC_GPIO, \ - GPIO_HW_REV_DRIVE, \ - GPIO_HW_VER_DRIVE, \ - GPIO_CAN1_TX, \ - GPIO_CAN1_RX, \ - GPIO_CAN2_TX, \ - GPIO_CAN2_RX, \ - GPIO_CAN1_SILENT_S0, \ - GPIO_CAN2_SILENT_S1, \ - GPIO_HEATER_OUTPUT, \ - GPIO_nPOWER_IN_CAN, \ - GPIO_nPOWER_IN_ADC, \ - GPIO_nPOWER_IN_C, \ - GPIO_nVDD_5V_PERIPH_EN, \ - GPIO_nVDD_5V_PERIPH_OC, \ - GPIO_VDD_5V_HIPOWER_EN, \ - GPIO_VDD_5V_HIPOWER_OC, \ - GPIO_VDD_5V_RC_EN, \ - PX4_GPIO_PIN_OFF(GPIO_SDMMC1_D0), \ - PX4_GPIO_PIN_OFF(GPIO_SDMMC1_D1), \ - PX4_GPIO_PIN_OFF(GPIO_SDMMC1_D2), \ - PX4_GPIO_PIN_OFF(GPIO_SDMMC1_D3), \ - PX4_GPIO_PIN_OFF(GPIO_SDMMC1_CMD),\ - GPIO_VDD_3V3_SD_CARD_EN, \ - GPIO_TONE_ALARM_IDLE, \ - GPIO_OTGFS_VBUS, \ - PX4_GPIO_PIN_OFF(GPIO_HS_USB_EN), \ - GPIO_RSSI_IN, \ - FMU_LED_AMBER, \ - GPIO_BTN_SAFETY, \ - } - -__BEGIN_DECLS -#ifndef __ASSEMBLY__ - -extern void stm32_spiinitialize(void); -extern void board_peripheral_reset(int ms); - -#include -#endif /* __ASSEMBLY__ */ -__END_DECLS diff --git a/boards/cuav/nora/src/bootloader_main.c b/boards/cuav/nora/src/bootloader_main.c deleted file mode 100644 index 3a0e1a1..0000000 --- a/boards/cuav/nora/src/bootloader_main.c +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020-2021 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. - * - ****************************************************************************/ - -/** - * @file bootloader_main.c - * - * FMU-specific early startup code for bootloader -*/ - -#include "board_config.h" -#include "bl.h" - -#include -#include -#include -#include -#include -#include "arm_internal.h" -#include - -extern int sercon_main(int c, char **argv); - -__EXPORT void board_on_reset(int status) {} - -__EXPORT void stm32_boardinitialize(void) -{ - /* configure USB interfaces */ - stm32_configgpio(GPIO_OTGFS_VBUS); -} - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - return 0; -} - -void board_late_initialize(void) -{ - sercon_main(0, NULL); -} - -extern void sys_tick_handler(void); -void board_timerhook(void) -{ - sys_tick_handler(); -} diff --git a/boards/cuav/nora/src/hw_config.h b/boards/cuav/nora/src/hw_config.h deleted file mode 100644 index 4a1fca5..0000000 --- a/boards/cuav/nora/src/hw_config.h +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/**************************************************************************** - * 10-8--2016: - * To simplify the ripple effect on the tools, we will be using - * /dev/serial/by-id/PX4 to locate PX4 devices. Therefore - * moving forward all Bootloaders must contain the prefix "PX4 BL " - * in the USBDEVICESTRING - * This Change will be made in an upcoming BL release - ****************************************************************************/ -/* - * Define usage to configure a bootloader - * - * - * Constant example Usage - * APP_LOAD_ADDRESS 0x08004000 - The address in Linker Script, where the app fw is org-ed - * BOOTLOADER_DELAY 5000 - Ms to wait while under USB pwr or bootloader request - * BOARD_FMUV2 - * INTERFACE_USB 1 - (Optional) Scan and use the USB interface for bootloading - * INTERFACE_USART 1 - (Optional) Scan and use the Serial interface for bootloading - * USBDEVICESTRING "PX4 BL FMU v2.x" - USB id string - * USBPRODUCTID 0x0011 - PID Should match defconfig - * BOOT_DELAY_ADDRESS 0x000001a0 - (Optional) From the linker script from Linker Script to get a custom - * delay provided by an APP FW - * BOARD_TYPE 9 - Must match .prototype boad_id - * _FLASH_KBYTES (*(uint16_t *)0x1fff7a22) - Run time flash size detection - * BOARD_FLASH_SECTORS ((_FLASH_KBYTES == 0x400) ? 11 : 23) - Run time determine the physical last sector - * BOARD_FLASH_SECTORS 11 - Hard coded zero based last sector - * BOARD_FLASH_SIZE (_FLASH_KBYTES*1024)- Total Flash size of device, determined at run time. - * (1024 * 1024) - Hard coded Total Flash of device - The bootloader and app reserved will be deducted - * programmatically - * - * BOARD_FIRST_FLASH_SECTOR_TO_ERASE 2 - Optional sectors index in the flash_sectors table (F4 only), to begin erasing. - * This is to allow sectors to be reserved for app fw usage. That will NOT be erased - * during a FW upgrade. - * The default is 0, and selects the first sector to be erased, as the 0th entry in the - * flash_sectors table. Which is the second physical sector of FLASH in the device. - * The first physical sector of FLASH is used by the bootloader, and is not defined - * in the table. - * - * APP_RESERVATION_SIZE (BOARD_FIRST_FLASH_SECTOR_TO_ERASE * 16 * 1024) - Number of bytes reserved by the APP FW. This number plus - * BOOTLOADER_RESERVATION_SIZE will be deducted from - * BOARD_FLASH_SIZE to determine the size of the App FW - * and hence the address space of FLASH to erase and program. - * USBMFGSTRING "PX4 AP" - Optional USB MFG string (default is '3D Robotics' if not defined.) - * SERIAL_BREAK_DETECT_DISABLED - Optional prevent break selection on Serial port from entering or staying in BL - * - * * Other defines are somewhat self explanatory. - */ - -/* Boot device selection list*/ -#define USB0_DEV 0x01 -#define SERIAL0_DEV 0x02 -#define SERIAL1_DEV 0x04 - -#define APP_LOAD_ADDRESS 0x08020000 -#define BOOTLOADER_DELAY 5000 -#define INTERFACE_USB 1 -#define INTERFACE_USB_CONFIG "/dev/ttyACM0" -#define BOARD_VBUS MK_GPIO_INPUT(GPIO_OTGFS_VBUS) - -//#define USE_VBUS_PULL_DOWN -#define INTERFACE_USART 1 -#define INTERFACE_USART_CONFIG "/dev/ttyS4,57600" -#define BOOT_DELAY_ADDRESS 0x000001a0 -#define BOARD_TYPE 1009 -#define _FLASH_KBYTES (*(uint32_t *)0x1FF1E880) -#define BOARD_FLASH_SECTORS (15) -#define BOARD_FLASH_SIZE (_FLASH_KBYTES * 1024) - -#define OSC_FREQ 16 - -#define BOARD_PIN_LED_ACTIVITY GPIO_nLED_BLUE // BLUE -#define BOARD_PIN_LED_BOOTLOADER GPIO_nLED_GREEN // GREEN -#define BOARD_LED_ON 0 -#define BOARD_LED_OFF 1 - -#define SERIAL_BREAK_DETECT_DISABLED 1 - -#if !defined(ARCH_SN_MAX_LENGTH) -# define ARCH_SN_MAX_LENGTH 12 -#endif - -#if !defined(APP_RESERVATION_SIZE) -# define APP_RESERVATION_SIZE 0 -#endif - -#if !defined(BOARD_FIRST_FLASH_SECTOR_TO_ERASE) -# define BOARD_FIRST_FLASH_SECTOR_TO_ERASE 1 -#endif - -#if !defined(USB_DATA_ALIGN) -# define USB_DATA_ALIGN -#endif - -#ifndef BOOT_DEVICES_SELECTION -# define BOOT_DEVICES_SELECTION USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif - -#ifndef BOOT_DEVICES_FILTER_ONUSB -# define BOOT_DEVICES_FILTER_ONUSB USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif diff --git a/boards/cuav/nora/src/i2c.cpp b/boards/cuav/nora/src/i2c.cpp deleted file mode 100644 index 124fc23..0000000 --- a/boards/cuav/nora/src/i2c.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), - initI2CBusExternal(2), - initI2CBusInternal(3), - initI2CBusExternal(4), -}; diff --git a/boards/cuav/nora/src/init.c b/boards/cuav/nora/src/init.c deleted file mode 100644 index d4c262b..0000000 --- a/boards/cuav/nora/src/init.c +++ /dev/null @@ -1,219 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * FMU-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. - */ - -#include "board_config.h" - -#include - -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include - -#include - -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - /* set the peripheral rails off */ - VDD_5V_PERIPH_EN(false); - board_control_spi_sensors_power(false, 0xffff); - - bool last = READ_SPEKTRUM_POWER(); - /* Keep Spektum on to discharge rail*/ - SPEKTRUM_POWER(false); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ - SPEKTRUM_POWER(last); - board_control_spi_sensors_power(true, 0xffff); - VDD_5V_PERIPH_EN(true); -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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 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(); -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Power on Interfaces */ - VDD_5V_PERIPH_EN(true); - VDD_5V_HIPOWER_EN(true); - board_control_spi_sensors_power(true, 0xffff); - SPEKTRUM_POWER(true); - - /* Need hrt running before using the ADC */ - px4_platform_init(); - - /* configure SPI interfaces (after we determined the HW version) */ - stm32_spiinitialize(); - - /* configure the DMA allocator */ - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_on(LED_GREEN); // Indicate Power. - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - -#ifdef CONFIG_MMCSD - // Ensure Power is off for > 10 mS - usleep(15 * 1000); - VDD_3V3_SD_CARD_EN(true); - usleep(500 * 1000); - - /* Mount the SDIO-based MMC/SD block driver */ - /* First, get an instance of the SDIO interface */ - struct sdio_dev_s *sdio_dev = sdio_initialize(0); // SDIO_SLOTNO 0 Only one slot - - if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", 0); - } - - if (mmcsd_slotinitialize(0, sdio_dev) != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver\n"); - } - - /* Assume that the SD card is inserted. What choice do we have? */ - sdio_mediachange(sdio_dev, true); -#endif /* CONFIG_MMCSD */ - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/cuav/nora/src/led.c b/boards/cuav/nora/src/led.c deleted file mode 100644 index 79792ca..0000000 --- a/boards/cuav/nora/src/led.c +++ /dev/null @@ -1,111 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -# define xlat(p) (p) -static uint32_t g_ledmap[] = { - FMU_LED_AMBER, // Indexed by LED_SAFETY (defaulted to an output) -}; - -__EXPORT void led_init(void) -{ - /* Configure LED GPIOs for output */ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - if (g_ledmap[l] != 0) { - stm32_configgpio(g_ledmap[l]); - } - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - if (g_ledmap[led] != 0) { - stm32_gpiowrite(g_ledmap[led], !state); - } -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - if (g_ledmap[led] != 0) { - return !stm32_gpioread(g_ledmap[led]); - } - - return false; -} - -__EXPORT void led_on(int led) -{ - phy_set_led(xlat(led), true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(xlat(led), false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(xlat(led), !phy_get_led(xlat(led))); -} diff --git a/boards/cuav/nora/src/spi.cpp b/boards/cuav/nora/src/spi.cpp deleted file mode 100644 index 0aa6c50..0000000 --- a/boards/cuav/nora/src/spi.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20689, SPI::CS{GPIO::PortG, GPIO::Pin6}, SPI::DRDY{GPIO::PortJ, GPIO::Pin0}), - }, {GPIO::PortE, GPIO::Pin3}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortF, GPIO::Pin5}), - initSPIDevice(DRV_MAG_DEVTYPE_RM3100, SPI::CS{GPIO::PortF, GPIO::Pin2}, SPI::DRDY{GPIO::PortE, GPIO::Pin4}), - }), - initSPIBus(SPI::Bus::SPI4, { - initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::PortF, GPIO::Pin3}, SPI::DRDY{GPIO::PortB, GPIO::Pin15}), - initSPIDevice(DRV_GYR_DEVTYPE_BMI088, SPI::CS{GPIO::PortF, GPIO::Pin4}, SPI::DRDY{GPIO::PortB, GPIO::Pin14}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortB, GPIO::Pin15}), - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortG, GPIO::Pin10}), - }), - initSPIBusExternal(SPI::Bus::SPI5, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin4}), - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}), - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin13}), - }), - initSPIBus(SPI::Bus::SPI6, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20649, SPI::CS{GPIO::PortI, GPIO::Pin12}, SPI::DRDY{GPIO::PortH, GPIO::Pin5}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20689, SPI::CS{GPIO::PortE, GPIO::Pin15}, SPI::DRDY{GPIO::PortH, GPIO::Pin5}), - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortI, GPIO::Pin8}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/cuav/nora/src/timer_config.cpp b/boards/cuav/nora/src/timer_config.cpp deleted file mode 100644 index 0885466..0000000 --- a/boards/cuav/nora/src/timer_config.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer5, DMA{DMA::Index1}), - initIOTimer(Timer::Timer4, DMA{DMA::Index1}), - initIOTimer(Timer::Timer1, DMA{DMA::Index1}), - initIOTimer(Timer::Timer12), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel1}, {GPIO::PortH, GPIO::Pin10}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel2}, {GPIO::PortH, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel3}, {GPIO::PortH, GPIO::Pin12}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel4}, {GPIO::PortI, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel1}, {GPIO::PortD, GPIO::Pin12}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel4}, {GPIO::PortD, GPIO::Pin15}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortA, GPIO::Pin10}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer12, Timer::Channel1}, {GPIO::PortH, GPIO::Pin6}), - initIOTimerChannel(io_timers, {Timer::Timer12, Timer::Channel2}, {GPIO::PortH, GPIO::Pin9}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); - -constexpr io_timers_t led_pwm_timers[MAX_LED_TIMERS] = { - initIOTimer(Timer::Timer8), -}; - -#define CCER_C1_NUM_BITS 4 -#define POLARITY(c) (GTIM_CCER_CC1P << (((c)-1) * CCER_C1_NUM_BITS)) -#define DRIVE_TYPE(p) ((p)|GPIO_OPENDRAIN|GPIO_PULLUP) - -static inline constexpr timer_io_channels_t initIOTimerChannelLED(const io_timers_t io_timers_conf[MAX_LED_TIMERS], - Timer::TimerChannel timer, GPIO::GPIOPin pin, int ui_polarity) -{ - timer_io_channels_t ret = initIOTimerChannel(io_timers_conf, timer, pin); - ret.gpio_out = DRIVE_TYPE(ret.gpio_out); - ret.masks = POLARITY(ui_polarity); - return ret; -} - -constexpr timer_io_channels_t led_pwm_channels[MAX_TIMER_LED_CHANNELS] = { - initIOTimerChannelLED(led_pwm_timers, {Timer::Timer8, Timer::Channel1}, {GPIO::PortI, GPIO::Pin5}, 1), - initIOTimerChannelLED(led_pwm_timers, {Timer::Timer8, Timer::Channel2}, {GPIO::PortI, GPIO::Pin6}, 2), - initIOTimerChannelLED(led_pwm_timers, {Timer::Timer8, Timer::Channel3}, {GPIO::PortI, GPIO::Pin7}, 3), -}; diff --git a/boards/cuav/nora/src/usb.c b/boards/cuav/nora/src/usb.c deleted file mode 100644 index 3d86aca..0000000 --- a/boards/cuav/nora/src/usb.c +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -#include "board_config.h" -#include -#include -#include -#include - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/cuav/x7pro/bootloader.px4board b/boards/cuav/x7pro/bootloader.px4board deleted file mode 100644 index 19b6e66..0000000 --- a/boards/cuav/x7pro/bootloader.px4board +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_ROMFSROOT="" diff --git a/boards/cuav/x7pro/default.px4board b/boards/cuav/x7pro/default.px4board deleted file mode 100644 index 99e831c..0000000 --- a/boards/cuav/x7pro/default.px4board +++ /dev/null @@ -1,101 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS0" -CONFIG_BOARD_SERIAL_GPS2="/dev/ttyS2" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS3" -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_COMMON_BAROMETERS=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_HEATER=y -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=y -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16470=y -CONFIG_DRIVERS_IMU_BOSCH_BMI088=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20649=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20689=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_DRIVERS_LIGHTS_RGBLED_PWM=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SAFETY_BUTTON=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_BOARD_UAVCAN_TIMER_OVERRIDE=2 -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_FAKE_GPS=y diff --git a/boards/cuav/x7pro/extras/cuav_x7pro_bootloader.bin b/boards/cuav/x7pro/extras/cuav_x7pro_bootloader.bin deleted file mode 100755 index 2992661..0000000 Binary files a/boards/cuav/x7pro/extras/cuav_x7pro_bootloader.bin and /dev/null differ diff --git a/boards/cuav/x7pro/firmware.prototype b/boards/cuav/x7pro/firmware.prototype deleted file mode 100644 index 939e25b..0000000 --- a/boards/cuav/x7pro/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 1010, - "magic": "PX4FWv1", - "description": "Firmware for the CUAV X7Pro board", - "image": "", - "build_time": 0, - "summary": "X7Pro", - "version": "0.1", - "image_size": 0, - "image_maxsize": 1966080, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/cuav/x7pro/init/rc.board_defaults b/boards/cuav/x7pro/init/rc.board_defaults deleted file mode 100644 index c6235b2..0000000 --- a/boards/cuav/x7pro/init/rc.board_defaults +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 18 -param set-default BAT2_V_DIV 18 - -param set-default BAT1_A_PER_V 24 -param set-default BAT2_A_PER_V 24 - -# Enable IMU thermal control -param set-default SENS_EN_THERMAL 1 - -param set-default SENS_TEMP_ID 6946850 - -rgbled_pwm start -safety_button start diff --git a/boards/cuav/x7pro/init/rc.board_sensors b/boards/cuav/x7pro/init/rc.board_sensors deleted file mode 100644 index da9a45c..0000000 --- a/boards/cuav/x7pro/init/rc.board_sensors +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# -# board specific sensors init -#------------------------------------------------------------------------------ -board_adc start - -# SPI1 -if ! icm20689 -s -b 1 -R 2 -q start -then - adis16470 -s -b 1 -R 2 start -fi - -# SPI2 -rm3100 -s -b 2 start - -# SPI4 -bmi088 -s -b 4 -A -R 2 start -if ! bmi088 -s -b 4 -G -R 2 start -then - icm42688p -R 2 -s start -fi -ms5611 -s -b 4 start - -# SPI6 -if ! icm20649 -s -b 6 -R 2 start -then - icm20689 -s -b 6 -R 2 start -fi -ms5611 -s -b 6 start - -# External compass on GPS1/I2C1: standard CUAV GPS/compass puck (with lights, safety button, and buzzer) -ist8310 -X -b 1 -R 10 start diff --git a/boards/cuav/x7pro/nuttx-config/bootloader/defconfig b/boards/cuav/x7pro/nuttx-config/bootloader/defconfig deleted file mode 100644 index b3a4aa1..0000000 --- a/boards/cuav/x7pro/nuttx-config/bootloader/defconfig +++ /dev/null @@ -1,90 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_CONSOLE is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_SPI_EXCHANGE is not set -# CONFIG_STM32H7_SYSCFG is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/cuav/x7pro/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743XI=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_INITTHREAD_PRIORITY=254 -CONFIG_BOARD_LATE_INITIALIZE=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x004c -CONFIG_CDCACM_PRODUCTSTR="PX4 BL CUAV X7Pro" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x3163 -CONFIG_CDCACM_VENDORSTR="CUAV" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_EXPERIMENTAL=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="bootloader_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SPI=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_USART6=y -CONFIG_SYSTEMTICK_HOOK=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGINT_CHAR=0x03 -CONFIG_TTY_SIGTSTP=y -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/cuav/x7pro/nuttx-config/include/board.h b/boards/cuav/x7pro/nuttx-config/include/board.h deleted file mode 100644 index ad4b16f..0000000 --- a/boards/cuav/x7pro/nuttx-config/include/board.h +++ /dev/null @@ -1,286 +0,0 @@ -/************************************************************************************ - * nuttx-config/include/board.h - * - * Copyright (C) 2020 Gregory Nutt. All rights reserved. - * Authors: David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ -#pragma once - -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/* Clocking *************************************************************************/ -/* The board provides the following clock sources: - * - * X1: 16 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 16 MHz RC factory-trimmed - * HSE: 16 MHz crystal for HSE - */ -#define STM32_BOARD_XTAL 16000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 0 - -/* Main PLL Configuration. - * - * PLL source is HSE = 16,000,000 - * - * PLL_VCOx = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 1 <= PLLM <= 63 - * 4 <= PLLN <= 512 - * 150 MHz <= PLL_VCOL <= 420MHz - * 192 MHz <= PLL_VCOH <= 836MHz - * - * SYSCLK = PLL_VCO / PLLP - * CPUCLK = SYSCLK / D1CPRE - * Subject to - * - * PLLP1 = {2, 4, 6, 8, ..., 128} - * PLLP2,3 = {2, 3, 4, ..., 128} - * CPUCLK <= 480 MHz - */ -#define STM32_PLLCFG_PLLSRC RCC_PLLCKSELR_PLLSRC_HSE - -/* PLL1, wide 4 - 8 MHz input, enable DIVP, DIVQ, DIVR - * - * PLL1_VCO = (16,000,000 / 1) * 60 = 960 MHz - * - * PLL1P = PLL1_VCO/2 = 960 MHz / 2 = 480 MHz - * PLL1Q = PLL1_VCO/4 = 960 MHz / 4 = 240 MHz - * PLL1R = PLL1_VCO/8 = 960 MHz / 8 = 120 MHz - */ -#define STM32_PLLCFG_PLL1CFG (RCC_PLLCFGR_PLL1VCOSEL_WIDE|RCC_PLLCFGR_PLL1RGE_4_8_MHZ|RCC_PLLCFGR_DIVP1EN|RCC_PLLCFGR_DIVQ1EN|RCC_PLLCFGR_DIVR1EN) -#define STM32_PLLCFG_PLL1M RCC_PLLCKSELR_DIVM1(1) -#define STM32_PLLCFG_PLL1N RCC_PLL1DIVR_N1(60) -#define STM32_PLLCFG_PLL1P RCC_PLL1DIVR_P1(2) -#define STM32_PLLCFG_PLL1Q RCC_PLL1DIVR_Q1(4) -#define STM32_PLLCFG_PLL1R RCC_PLL1DIVR_R1(8) - -#define STM32_VCO1_FREQUENCY ((STM32_HSE_FREQUENCY / 1) * 60) -#define STM32_PLL1P_FREQUENCY (STM32_VCO1_FREQUENCY / 2) -#define STM32_PLL1Q_FREQUENCY (STM32_VCO1_FREQUENCY / 4) -#define STM32_PLL1R_FREQUENCY (STM32_VCO1_FREQUENCY / 8) - -/* PLL2 */ -#define STM32_PLLCFG_PLL2CFG (RCC_PLLCFGR_PLL2VCOSEL_WIDE|RCC_PLLCFGR_PLL2RGE_4_8_MHZ|RCC_PLLCFGR_DIVP2EN|RCC_PLLCFGR_DIVQ2EN|RCC_PLLCFGR_DIVR2EN) -#define STM32_PLLCFG_PLL2M RCC_PLLCKSELR_DIVM2(4) -#define STM32_PLLCFG_PLL2N RCC_PLL2DIVR_N2(48) -#define STM32_PLLCFG_PLL2P RCC_PLL2DIVR_P2(2) -#define STM32_PLLCFG_PLL2Q RCC_PLL2DIVR_Q2(2) -#define STM32_PLLCFG_PLL2R RCC_PLL2DIVR_R2(2) - -#define STM32_VCO2_FREQUENCY ((STM32_HSE_FREQUENCY / 4) * 48) -#define STM32_PLL2P_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2Q_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2R_FREQUENCY (STM32_VCO2_FREQUENCY / 2) - -/* PLL3 */ -#define STM32_PLLCFG_PLL3CFG (RCC_PLLCFGR_PLL3VCOSEL_WIDE|RCC_PLLCFGR_PLL3RGE_4_8_MHZ|RCC_PLLCFGR_DIVQ3EN) -#define STM32_PLLCFG_PLL3M RCC_PLLCKSELR_DIVM3(4) -#define STM32_PLLCFG_PLL3N RCC_PLL3DIVR_N3(48) -#define STM32_PLLCFG_PLL3P RCC_PLL3DIVR_P3(2) -#define STM32_PLLCFG_PLL3Q RCC_PLL3DIVR_Q3(4) -#define STM32_PLLCFG_PLL3R RCC_PLL3DIVR_R3(2) - -#define STM32_VCO3_FREQUENCY ((STM32_HSE_FREQUENCY / 4) * 48) -#define STM32_PLL3P_FREQUENCY (STM32_VCO3_FREQUENCY / 2) -#define STM32_PLL3Q_FREQUENCY (STM32_VCO3_FREQUENCY / 4) -#define STM32_PLL3R_FREQUENCY (STM32_VCO3_FREQUENCY / 2) - -/* SYSCLK = PLL1P = 480MHz - * CPUCLK = SYSCLK / 1 = 480 MHz - */ -#define STM32_RCC_D1CFGR_D1CPRE (RCC_D1CFGR_D1CPRE_SYSCLK) -#define STM32_SYSCLK_FREQUENCY (STM32_PLL1P_FREQUENCY) -#define STM32_CPUCLK_FREQUENCY (STM32_SYSCLK_FREQUENCY / 1) - -/* Configure Clock Assignments */ - -/* AHB clock (HCLK) is SYSCLK/2 (240 MHz max) - * HCLK1 = HCLK2 = HCLK3 = HCLK4 = 240 - */ -#define STM32_RCC_D1CFGR_HPRE RCC_D1CFGR_HPRE_SYSCLKd2 /* HCLK = SYSCLK / 2 */ -#define STM32_ACLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* ACLK in D1, HCLK3 in D1 */ -#define STM32_HCLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* HCLK in D2, HCLK4 in D3 */ -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/2 (120 MHz) */ -#define STM32_RCC_D2CFGR_D2PPRE1 RCC_D2CFGR_D2PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB2 clock (PCLK2) is HCLK/2 (120 MHz) */ -#define STM32_RCC_D2CFGR_D2PPRE2 RCC_D2CFGR_D2PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB3 clock (PCLK3) is HCLK/2 (120 MHz) */ -#define STM32_RCC_D1CFGR_D1PPRE RCC_D1CFGR_D1PPRE_HCLKd2 /* PCLK3 = HCLK / 2 */ -#define STM32_PCLK3_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB4 clock (PCLK4) is HCLK/4 (120 MHz) */ -#define STM32_RCC_D3CFGR_D3PPRE RCC_D3CFGR_D3PPRE_HCLKd2 /* PCLK4 = HCLK / 2 */ -#define STM32_PCLK4_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timer clock frequencies */ - -/* Timers driven from APB1 will be twice PCLK1 */ -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* Timers driven from APB2 will be twice PCLK2 */ -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM15_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM16_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM17_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Kernel Clock Configuration - * Note: look at Table 54 in ST Manual - */ -#define STM32_RCC_D2CCIP2R_I2C123SRC RCC_D2CCIP2R_I2C123SEL_HSI /* I2C123 clock source */ -#define STM32_RCC_D3CCIPR_I2C4SRC RCC_D3CCIPR_I2C4SEL_HSI /* I2C4 clock source */ -#define STM32_RCC_D2CCIP1R_SPI123SRC RCC_D2CCIP1R_SPI123SEL_PLL2 /* SPI123 clock source */ -#define STM32_RCC_D2CCIP1R_SPI45SRC RCC_D2CCIP1R_SPI45SEL_PLL2 /* SPI45 clock source */ -#define STM32_RCC_D3CCIPR_SPI6SRC RCC_D3CCIPR_SPI6SEL_PLL2 /* SPI6 clock source */ -#define STM32_RCC_D2CCIP2R_USBSRC RCC_D2CCIP2R_USBSEL_PLL3 /* USB 1 and 2 clock source */ -#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2 /* ADC 1 2 3 clock source */ -#define STM32_RCC_D2CCIP1R_FDCANSEL RCC_D2CCIP1R_FDCANSEL_HSE /* FDCAN 1 2 clock source */ - -#define STM32_FDCANCLK STM32_HSE_FREQUENCY - -/* FLASH wait states */ -#define BOARD_FLASH_WAITSTATES 2 - -/* SDMMC definitions ********************************************************/ -/* Init 400kHz, freq = PLL1Q/(2*div) div = PLL1Q/(2*freq) */ -#define STM32_SDMMC_INIT_CLKDIV (300 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* 25 MHz Max for now, 25 mHZ = PLL1Q/(2*div), div = PLL1Q/(2*freq) - * div = 4.8 = 240 / 50, So round up to 5 for default speed 24 MB/s - */ -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_MMCXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_SDXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - -/* UART/USART */ -#define GPIO_USART1_RX GPIO_USART1_RX_3 /* PB7 */ -#define GPIO_USART1_TX GPIO_USART1_TX_3 /* PB6 */ - -#define GPIO_USART2_RX GPIO_USART2_RX_2 /* PD6 */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 /* PD4 */ -#define GPIO_USART2_CTS GPIO_USART2_CTS_NSS_2 /* PD3 */ - -#define GPIO_UART4_RX GPIO_UART4_RX_5 /* PD0 */ -#define GPIO_UART4_TX GPIO_UART4_TX_5 /* PD1 */ - -#define GPIO_USART6_RX GPIO_USART6_RX_2 /* PG9 */ -#define GPIO_USART6_TX GPIO_USART6_TX_2 /* PG14 */ -#define GPIO_USART6_RTS GPIO_USART6_RTS_2 /* PG8 */ -#define GPIO_USART6_CTS GPIO_USART6_CTS_NSS_2 /* PG15 */ - -#define GPIO_UART7_RX GPIO_UART7_RX_4 /* PF6 */ -#define GPIO_UART7_TX GPIO_UART7_TX_3 /* PE8 */ - -#define GPIO_UART8_RX GPIO_UART8_RX_1 /* PE0 */ -#define GPIO_UART8_TX GPIO_UART8_TX_1 /* PE1 */ - -/* CAN */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_5 /* PI9 */ -#define GPIO_CAN1_TX GPIO_CAN1_TX_4 /* PH13 */ -#define GPIO_CAN2_RX GPIO_CAN2_RX_1 /* PB12 */ -#define GPIO_CAN2_TX GPIO_CAN2_TX_1 /* PB13 */ - -/* SPI */ -#define ADJ_SLEW_RATE(p) (((p) & ~GPIO_SPEED_MASK) | (GPIO_SPEED_2MHz)) - -#define GPIO_SPI1_SCK ADJ_SLEW_RATE(GPIO_SPI1_SCK_3) /* PG11 */ -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_3 /* PD7 */ - -#define GPIO_SPI2_SCK ADJ_SLEW_RATE(GPIO_SPI2_SCK_6) /* PI1 */ -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_3 /* PI2 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_4 /* PI3 */ - -#define GPIO_SPI4_SCK ADJ_SLEW_RATE(GPIO_SPI4_SCK_2) /* PE2 */ -#define GPIO_SPI4_MISO GPIO_SPI4_MISO_1 /* PE13 */ -#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_2 /* PE6 */ - -#define GPIO_SPI5_SCK ADJ_SLEW_RATE(GPIO_SPI5_SCK_1) /* PF7 */ -#define GPIO_SPI5_MISO GPIO_SPI5_MISO_1 /* PF8 */ -#define GPIO_SPI5_MOSI GPIO_SPI5_MOSI_2 /* PF9 */ - -#define GPIO_SPI6_SCK ADJ_SLEW_RATE(GPIO_SPI6_SCK_1) /* PG13 */ -#define GPIO_SPI6_MISO GPIO_SPI6_MISO_1 /* PG12 */ -#define GPIO_SPI6_MOSI GPIO_SPI6_MOSI_2 /* PA7 */ - -/* I2C */ -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 /* PB8 */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 /* PB9 */ - -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_2 /* PF1 */ -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_2 /* PF0 */ - -#define GPIO_I2C3_SCL GPIO_I2C3_SCL_2 /* PH7 */ -#define GPIO_I2C3_SDA GPIO_I2C3_SDA_2 /* PH8 */ - -#define GPIO_I2C4_SCL GPIO_I2C4_SCL_2 /* PF14 */ -#define GPIO_I2C4_SDA GPIO_I2C4_SDA_2 /* PF15 */ diff --git a/boards/cuav/x7pro/nuttx-config/include/board_dma_map.h b/boards/cuav/x7pro/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 428ef3f..0000000 --- a/boards/cuav/x7pro/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -// DMAMUX1 -#define DMAMAP_SPI1_RX DMAMAP_DMA12_SPI1RX_0 /* DMA1:37 */ -#define DMAMAP_SPI1_TX DMAMAP_DMA12_SPI1TX_0 /* DMA1:38 */ - -#define DMAMAP_UART8_RX DMAMAP_DMA12_UART8RX_0 /* DMA1:81 */ -#define DMAMAP_UART8_TX DMAMAP_DMA12_UART8TX_0 /* DMA1:82 */ - -#define DMAMAP_SPI4_RX DMAMAP_DMA12_SPI4RX_0 /* DMA1:83 */ -#define DMAMAP_SPI4_TX DMAMAP_DMA12_SPI4TX_0 /* DMA1:84 */ - - -// DMAMUX2 (BDMA) -#define DMAMAP_SPI6_RX DMAMAP_BDMA_SPI6_RX /* BDMA:11 */ -#define DMAMAP_SPI6_TX DMAMAP_BDMA_SPI6_TX /* BDMA:12 */ diff --git a/boards/cuav/x7pro/nuttx-config/nsh/defconfig b/boards/cuav/x7pro/nuttx-config/nsh/defconfig deleted file mode 100644 index 1088a24..0000000 --- a/boards/cuav/x7pro/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,265 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/cuav/x7pro/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743XI=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=95150 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x004c -CONFIG_CDCACM_PRODUCTSTR="PX4 CUAV X7Pro" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x3163 -CONFIG_CDCACM_VENDORSTR="CUAV" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXAMPLES_CALIB_UDELAY=y -CONFIG_EXPERIMENTAL=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=4 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_PROGMEM=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32H7_ADC1=y -CONFIG_STM32H7_ADC3=y -CONFIG_STM32H7_BBSRAM=y -CONFIG_STM32H7_BBSRAM_FILES=5 -CONFIG_STM32H7_BDMA=y -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_DMA2=y -CONFIG_STM32H7_DMACAPABLE=y -CONFIG_STM32H7_FLOWCONTROL_BROKEN=y -CONFIG_STM32H7_I2C1=y -CONFIG_STM32H7_I2C2=y -CONFIG_STM32H7_I2C3=y -CONFIG_STM32H7_I2C4=y -CONFIG_STM32H7_I2C_DYNTIMEO=y -CONFIG_STM32H7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_RTC=y -CONFIG_STM32H7_RTC_HSECLOCK=y -CONFIG_STM32H7_RTC_MAGIC_REG=1 -CONFIG_STM32H7_SAVE_CRASHDUMP=y -CONFIG_STM32H7_SDMMC1=y -CONFIG_STM32H7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_SPI1=y -CONFIG_STM32H7_SPI1_DMA=y -CONFIG_STM32H7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32H7_SPI2=y -CONFIG_STM32H7_SPI4=y -CONFIG_STM32H7_SPI4_DMA=y -CONFIG_STM32H7_SPI4_DMA_BUFFER=1024 -CONFIG_STM32H7_SPI5=y -CONFIG_STM32H7_SPI6=y -CONFIG_STM32H7_SPI6_DMA=y -CONFIG_STM32H7_SPI6_DMA_BUFFER=1024 -CONFIG_STM32H7_TIM12=y -CONFIG_STM32H7_TIM15=y -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_TIM3=y -CONFIG_STM32H7_TIM4=y -CONFIG_STM32H7_TIM5=y -CONFIG_STM32H7_TIM8=y -CONFIG_STM32H7_UART4=y -CONFIG_STM32H7_UART7=y -CONFIG_STM32H7_UART8=y -CONFIG_STM32H7_USART1=y -CONFIG_STM32H7_USART2=y -CONFIG_STM32H7_USART6=y -CONFIG_STM32H7_USART_BREAKS=y -CONFIG_STM32H7_USART_INVERT=y -CONFIG_STM32H7_USART_SINGLEWIRE=y -CONFIG_STM32H7_USART_SWAP=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGTSTP=y -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_IFLOWCONTROL=y -CONFIG_USART6_OFLOWCONTROL=y -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 -CONFIG_WATCHDOG=y diff --git a/boards/cuav/x7pro/nuttx-config/scripts/bootloader_script.ld b/boards/cuav/x7pro/nuttx-config/scripts/bootloader_script.ld deleted file mode 100644 index c2eba58..0000000 --- a/boards/cuav/x7pro/nuttx-config/scripts/bootloader_script.ld +++ /dev/null @@ -1,223 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2020 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The board uses an STM32H743XIH6 and has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * There's a switch on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the switch is - * drepresed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743ZI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K - DTCM1 (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - DTCM2 (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */ - SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */ - SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */ - BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > AXI_SRAM AT > FLASH - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > AXI_SRAM - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } - - .ramfunc : { - _sramfuncs = .; - *(.ramfunc .ramfunc.*) - . = ALIGN(4); - _eramfuncs = .; - } > ITCM_RAM AT > FLASH - - _framfuncs = LOADADDR(.ramfunc); -} diff --git a/boards/cuav/x7pro/nuttx-config/scripts/script.ld b/boards/cuav/x7pro/nuttx-config/scripts/script.ld deleted file mode 100644 index f213ad2..0000000 --- a/boards/cuav/x7pro/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,228 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2020 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The board uses an STM32H743XIH6 and has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * There's a switch on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the switch is - * drepresed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743ZI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - FLASH (rx) : ORIGIN = 0x08020000, LENGTH = 1920K - - DTCM1_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - DTCM2_RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */ - SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */ - SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */ - BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH - - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - - /* Pad out last section as the STM32H7 Flash write size is 256 bits. 32 bytes */ - . = ALIGN(16); - FILL(0xffff) - . += 16; - } > AXI_SRAM AT > FLASH = 0xffff - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > AXI_SRAM - - /* Emit the the D3 power domain section for locating BDMA data */ - - .sram4_reserve (NOLOAD) : - { - *(.sram4) - . = ALIGN(4); - _sram4_heap_start = ABSOLUTE(.); - } > SRAM4 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/cuav/x7pro/nuttx-config/test/defconfig b/boards/cuav/x7pro/nuttx-config/test/defconfig deleted file mode 100644 index 7506c06..0000000 --- a/boards/cuav/x7pro/nuttx-config/test/defconfig +++ /dev/null @@ -1,268 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/cuav/x7pro/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743XI=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=95150 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x004c -CONFIG_CDCACM_PRODUCTSTR="PX4 CUAV X7Pro" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x3163 -CONFIG_CDCACM_VENDORSTR="CUAV" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXAMPLES_CALIB_UDELAY=y -CONFIG_EXPERIMENTAL=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=4 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_PROGMEM=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32H7_ADC1=y -CONFIG_STM32H7_ADC3=y -CONFIG_STM32H7_BBSRAM=y -CONFIG_STM32H7_BBSRAM_FILES=5 -CONFIG_STM32H7_BDMA=y -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_DMA2=y -CONFIG_STM32H7_DMACAPABLE=y -CONFIG_STM32H7_FLOWCONTROL_BROKEN=y -CONFIG_STM32H7_I2C1=y -CONFIG_STM32H7_I2C2=y -CONFIG_STM32H7_I2C3=y -CONFIG_STM32H7_I2C4=y -CONFIG_STM32H7_I2C_DYNTIMEO=y -CONFIG_STM32H7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_RTC=y -CONFIG_STM32H7_RTC_HSECLOCK=y -CONFIG_STM32H7_RTC_MAGIC_REG=1 -CONFIG_STM32H7_SAVE_CRASHDUMP=y -CONFIG_STM32H7_SDMMC1=y -CONFIG_STM32H7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_SPI1=y -CONFIG_STM32H7_SPI1_DMA=y -CONFIG_STM32H7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32H7_SPI2=y -CONFIG_STM32H7_SPI4=y -CONFIG_STM32H7_SPI4_DMA=y -CONFIG_STM32H7_SPI4_DMA_BUFFER=1024 -CONFIG_STM32H7_SPI5=y -CONFIG_STM32H7_SPI6=y -CONFIG_STM32H7_SPI6_DMA=y -CONFIG_STM32H7_SPI6_DMA_BUFFER=1024 -CONFIG_STM32H7_TIM12=y -CONFIG_STM32H7_TIM15=y -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_TIM3=y -CONFIG_STM32H7_TIM4=y -CONFIG_STM32H7_TIM5=y -CONFIG_STM32H7_TIM8=y -CONFIG_STM32H7_UART4=y -CONFIG_STM32H7_UART7=y -CONFIG_STM32H7_UART8=y -CONFIG_STM32H7_USART1=y -CONFIG_STM32H7_USART2=y -CONFIG_STM32H7_USART6=y -CONFIG_STM32H7_USART_BREAKS=y -CONFIG_STM32H7_USART_INVERT=y -CONFIG_STM32H7_USART_SINGLEWIRE=y -CONFIG_STM32H7_USART_SWAP=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TESTING_OSTEST=y -CONFIG_TESTING_OSTEST_FPUTESTDISABLE=y -CONFIG_TESTING_OSTEST_STACKSIZE=10240 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGTSTP=y -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_IFLOWCONTROL=y -CONFIG_USART6_OFLOWCONTROL=y -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 -CONFIG_WATCHDOG=y diff --git a/boards/cuav/x7pro/src/CMakeLists.txt b/boards/cuav/x7pro/src/CMakeLists.txt deleted file mode 100644 index a218bdd..0000000 --- a/boards/cuav/x7pro/src/CMakeLists.txt +++ /dev/null @@ -1,67 +0,0 @@ -############################################################################ -# -# Copyright (c) 2020 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. -# -############################################################################ -if("${PX4_BOARD_LABEL}" STREQUAL "bootloader") - add_library(drivers_board - bootloader_main.c - usb.c - ) - target_link_libraries(drivers_board - PRIVATE - nuttx_arch - nuttx_drivers - bootloader - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/bootloader/common) - -else() - add_library(drivers_board - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - usb.c - ) - add_dependencies(drivers_board arch_board_hw_info) - - target_link_libraries(drivers_board - PRIVATE - arch_io_pins - arch_spi - arch_board_hw_info - drivers__led - nuttx_arch - nuttx_drivers - px4_layer - ) -endif() diff --git a/boards/cuav/x7pro/src/board_config.h b/boards/cuav/x7pro/src/board_config.h deleted file mode 100644 index f8a1824..0000000 --- a/boards/cuav/x7pro/src/board_config.h +++ /dev/null @@ -1,246 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * Board internal definitions - */ - -#pragma once - -#include -#include -#include -#include - -/* LEDs */ -#define GPIO_nLED_RED /* PI5 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTI|GPIO_PIN5) -#define GPIO_nLED_GREEN /* PI6 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTI|GPIO_PIN6) -#define GPIO_nLED_BLUE /* PI7 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTI|GPIO_PIN7) - -#define BOARD_HAS_LED_PWM 1 - -/* ADC channels */ -#define PX4_ADC_GPIO \ - /* PA0 */ GPIO_ADC1_INP16, \ - /* PA1 */ GPIO_ADC1_INP17, \ - /* PA2 */ GPIO_ADC12_INP14, \ - /* PF11 */ GPIO_ADC1_INP2, \ - /* PC4 */ GPIO_ADC12_INP4, \ - /* PA4 */ GPIO_ADC12_INP18, \ - /* PF12 */ GPIO_ADC1_INP6, \ - /* PC5 */ GPIO_ADC12_INP8, \ - /* PC1 */ GPIO_ADC123_INP11, \ - /* PC2 */ GPIO_ADC123_INP12, \ - /* PC3 */ GPIO_ADC12_INP13 - -/* Define Channel numbers must match above GPIO pins */ -#define ADC_BATTERY1_VOLTAGE_CHANNEL 16 /* PA0 */ -#define ADC_BATTERY1_CURRENT_CHANNEL 17 /* PA1 */ -#define ADC_BATTERY2_VOLTAGE_CHANNEL 14 /* PA2 */ -#define ADC_BATTERY2_CURRENT_CHANNEL 2 /* PF11 */ -#define ADC1_6V6_IN_CHANNEL 4 /* PC4 */ // SPARE1_ADC1: ADC6.6 -#define ADC1_3V3_IN_CHANNEL 18 /* PA4 */ // SPARE2_ADC1: ADC3.3 -#define ADC_RSSI_IN_CHANNEL 6 /* PF12 */ -#define ADC_SCALED_V5_CHANNEL 8 /* PC5 */ // VDD_5V_SENS: Motherboard 5V voltage detection -#define ADC_SCALED_VDD_3V3_SENSORS_CHANNEL 11 /* PC1 */ // SCALED_V3V3: Sensor power detection -#define ADC_HW_VER_SENSE_CHANNEL 12 /* PC2 */ -#define ADC_HW_REV_SENSE_CHANNEL 13 /* PC3 */ - -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY1_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY1_CURRENT_CHANNEL) | \ - (1 << ADC_BATTERY2_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY2_CURRENT_CHANNEL) | \ - (1 << ADC1_6V6_IN_CHANNEL) | \ - (1 << ADC1_3V3_IN_CHANNEL) | \ - (1 << ADC_RSSI_IN_CHANNEL) | \ - (1 << ADC_SCALED_V5_CHANNEL) | \ - (1 << ADC_SCALED_VDD_3V3_SENSORS_CHANNEL) | \ - (1 << ADC_HW_VER_SENSE_CHANNEL) | \ - (1 << ADC_HW_REV_SENSE_CHANNEL)) - -/* HW has to large of R termination on ADC todo:change when HW value is chosen */ -#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f) - -#define GPIO_HW_REV_DRIVE /* PH14 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTH|GPIO_PIN14) -#define GPIO_HW_REV_SENSE /* PC3 */ GPIO_ADC12_INP13 -#define GPIO_HW_VER_DRIVE /* PH14 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN3) -#define GPIO_HW_VER_SENSE /* PC2 */ GPIO_ADC123_INP12 - -/* CAN Silence Silent mode control */ -#define GPIO_CAN1_SILENT_S0 /* PH2 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN2) -#define GPIO_CAN2_SILENT_S1 /* PH3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN3) - -/* HEATER */ -#define GPIO_HEATER_OUTPUT /* PA8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN8) -#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true)) - -/* PWM */ -#define DIRECT_PWM_OUTPUT_CHANNELS 14 -#define BOARD_NUM_IO_TIMERS 4 - -/* Power supply control and monitoring GPIOs */ -#define BOARD_NUMBER_BRICKS 2 - -#define GPIO_nPOWER_IN_ADC /* PG1 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN1) -#define GPIO_nPOWER_IN_CAN /* PG2 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN2) -#define GPIO_nPOWER_IN_C /* PG0 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN0) - -#define GPIO_nVDD_BRICK1_VALID GPIO_nPOWER_IN_ADC /* Brick 1 is Chosen */ -#define GPIO_nVDD_BRICK2_VALID GPIO_nPOWER_IN_CAN /* Brick 2 is Chosen */ -#define GPIO_nVDD_USB_VALID GPIO_nPOWER_IN_C /* USB is Chosen */ - -#define GPIO_VDD_5V_HIPOWER_EN /* PD11 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTD|GPIO_PIN11) -#define GPIO_nVDD_5V_PERIPH_EN /* PG4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN4) -#define GPIO_VDD_5V_RC_EN /* PG5 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN5) -#define GPIO_VDD_3V3_SD_CARD_EN /* PG7 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN7) - -#define GPIO_VDD_5V_HIPOWER_OC /* PJ3 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTJ|GPIO_PIN3) -#define GPIO_nVDD_5V_PERIPH_OC /* PJ4 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTJ|GPIO_PIN4) - -/* Power switch controls ******************************************************/ -#define VDD_5V_PERIPH_EN(on_true) px4_arch_gpiowrite(GPIO_nVDD_5V_PERIPH_EN, !(on_true)) -#define VDD_5V_HIPOWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_HIPOWER_EN, (on_true)) -#define VDD_3V3_SD_CARD_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SD_CARD_EN, (on_true)) - -#define SPEKTRUM_POWER(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_RC_EN, (on_true)) -#define READ_SPEKTRUM_POWER() px4_arch_gpioread(GPIO_VDD_5V_RC_EN) - -/* Tone alarm output */ -#define TONE_ALARM_TIMER 15 /* timer 15 */ -#define TONE_ALARM_CHANNEL 1 /* PE5 TIM15_CH1 */ - -#define GPIO_TONE_ALARM_IDLE /* PE5 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN5) // ALARM -#define GPIO_TONE_ALARM GPIO_TIM15_CH1OUT_2 - -/* USB - * OTG FS: PA9 OTG_FS_VBUS VBUS sensing - * HS USB EN: PH15 - */ -#define GPIO_OTGFS_VBUS /* PA9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN9) -#define GPIO_HS_USB_EN /* PH15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN15) - -/* High-resolution timer */ -#define HRT_TIMER 3 /* use timer3 for the HRT */ -#define HRT_TIMER_CHANNEL 3 /* use capture/compare channel 3 */ - - -#define HRT_PPM_CHANNEL /* T3C1 */ 1 /* use capture/compare channel 1 */ -#define GPIO_PPM_IN /* PB4 T3C1 */ GPIO_TIM3_CH1IN_2 -#define RC_SERIAL_PORT "/dev/ttyS5" -#define RC_SERIAL_SINGLEWIRE - -/** - * GPIO PPM_IN on PB4 T3C1 - * SPEKTRUM_RX (it's TX or RX in Bind) on UART8 PE0 - * Inversion is possible in the UART and can drive GPIO_PPM_IN as an output - */ -#define GPIO_PPM_IN_AS_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN4) -#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_PPM_IN_AS_OUT) -#define SPEKTRUM_RX_AS_UART() /* Can be left as uart */ -#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true)) - -/* RSSI_IN */ -#define GPIO_RSSI_IN /* PB0 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN0) - -/* Safety Switch is only on FMU */ -#define FMU_LED_AMBER /* PE12 */ (GPIO_OUTPUT|GPIO_PULLDOWN|GPIO_PORTE|GPIO_PIN12) // FMU_LED_AMBER -#define GPIO_BTN_SAFETY /* PE10 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTE|GPIO_PIN10) // SAFETY_SW - -#define GPIO_LED_SAFETY FMU_LED_AMBER - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID)) -#define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -#define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID)) -#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_nVDD_5V_PERIPH_OC)) -#define BOARD_ADC_HIPOWER_5V_OC (!px4_arch_gpioread(GPIO_VDD_5V_HIPOWER_OC)) - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ -#define BOARD_HAS_ON_RESET 1 - - -#define BOARD_ENABLE_CONSOLE_BUFFER - -#define PX4_GPIO_INIT_LIST { \ - PX4_ADC_GPIO, \ - GPIO_HW_REV_DRIVE, \ - GPIO_HW_VER_DRIVE, \ - GPIO_CAN1_TX, \ - GPIO_CAN1_RX, \ - GPIO_CAN2_TX, \ - GPIO_CAN2_RX, \ - GPIO_CAN1_SILENT_S0, \ - GPIO_CAN2_SILENT_S1, \ - GPIO_HEATER_OUTPUT, \ - GPIO_nPOWER_IN_CAN, \ - GPIO_nPOWER_IN_ADC, \ - GPIO_nPOWER_IN_C, \ - GPIO_nVDD_5V_PERIPH_EN, \ - GPIO_nVDD_5V_PERIPH_OC, \ - GPIO_VDD_5V_HIPOWER_EN, \ - GPIO_VDD_5V_HIPOWER_OC, \ - GPIO_VDD_5V_RC_EN, \ - PX4_GPIO_PIN_OFF(GPIO_SDMMC1_D0), \ - PX4_GPIO_PIN_OFF(GPIO_SDMMC1_D1), \ - PX4_GPIO_PIN_OFF(GPIO_SDMMC1_D2), \ - PX4_GPIO_PIN_OFF(GPIO_SDMMC1_D3), \ - PX4_GPIO_PIN_OFF(GPIO_SDMMC1_CMD),\ - GPIO_VDD_3V3_SD_CARD_EN, \ - GPIO_TONE_ALARM_IDLE, \ - GPIO_OTGFS_VBUS, \ - PX4_GPIO_PIN_OFF(GPIO_HS_USB_EN), \ - GPIO_RSSI_IN, \ - FMU_LED_AMBER, \ - GPIO_BTN_SAFETY, \ - } - -__BEGIN_DECLS -#ifndef __ASSEMBLY__ - -extern void stm32_spiinitialize(void); -extern void board_peripheral_reset(int ms); - -#include -#endif /* __ASSEMBLY__ */ -__END_DECLS diff --git a/boards/cuav/x7pro/src/bootloader_main.c b/boards/cuav/x7pro/src/bootloader_main.c deleted file mode 100644 index 3a0e1a1..0000000 --- a/boards/cuav/x7pro/src/bootloader_main.c +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020-2021 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. - * - ****************************************************************************/ - -/** - * @file bootloader_main.c - * - * FMU-specific early startup code for bootloader -*/ - -#include "board_config.h" -#include "bl.h" - -#include -#include -#include -#include -#include -#include "arm_internal.h" -#include - -extern int sercon_main(int c, char **argv); - -__EXPORT void board_on_reset(int status) {} - -__EXPORT void stm32_boardinitialize(void) -{ - /* configure USB interfaces */ - stm32_configgpio(GPIO_OTGFS_VBUS); -} - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - return 0; -} - -void board_late_initialize(void) -{ - sercon_main(0, NULL); -} - -extern void sys_tick_handler(void); -void board_timerhook(void) -{ - sys_tick_handler(); -} diff --git a/boards/cuav/x7pro/src/hw_config.h b/boards/cuav/x7pro/src/hw_config.h deleted file mode 100644 index ced086d..0000000 --- a/boards/cuav/x7pro/src/hw_config.h +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/**************************************************************************** - * 10-8--2016: - * To simplify the ripple effect on the tools, we will be using - * /dev/serial/by-id/PX4 to locate PX4 devices. Therefore - * moving forward all Bootloaders must contain the prefix "PX4 BL " - * in the USBDEVICESTRING - * This Change will be made in an upcoming BL release - ****************************************************************************/ -/* - * Define usage to configure a bootloader - * - * - * Constant example Usage - * APP_LOAD_ADDRESS 0x08004000 - The address in Linker Script, where the app fw is org-ed - * BOOTLOADER_DELAY 5000 - Ms to wait while under USB pwr or bootloader request - * BOARD_FMUV2 - * INTERFACE_USB 1 - (Optional) Scan and use the USB interface for bootloading - * INTERFACE_USART 1 - (Optional) Scan and use the Serial interface for bootloading - * USBDEVICESTRING "PX4 BL FMU v2.x" - USB id string - * USBPRODUCTID 0x0011 - PID Should match defconfig - * BOOT_DELAY_ADDRESS 0x000001a0 - (Optional) From the linker script from Linker Script to get a custom - * delay provided by an APP FW - * BOARD_TYPE 9 - Must match .prototype boad_id - * _FLASH_KBYTES (*(uint16_t *)0x1fff7a22) - Run time flash size detection - * BOARD_FLASH_SECTORS ((_FLASH_KBYTES == 0x400) ? 11 : 23) - Run time determine the physical last sector - * BOARD_FLASH_SECTORS 11 - Hard coded zero based last sector - * BOARD_FLASH_SIZE (_FLASH_KBYTES*1024)- Total Flash size of device, determined at run time. - * (1024 * 1024) - Hard coded Total Flash of device - The bootloader and app reserved will be deducted - * programmatically - * - * BOARD_FIRST_FLASH_SECTOR_TO_ERASE 2 - Optional sectors index in the flash_sectors table (F4 only), to begin erasing. - * This is to allow sectors to be reserved for app fw usage. That will NOT be erased - * during a FW upgrade. - * The default is 0, and selects the first sector to be erased, as the 0th entry in the - * flash_sectors table. Which is the second physical sector of FLASH in the device. - * The first physical sector of FLASH is used by the bootloader, and is not defined - * in the table. - * - * APP_RESERVATION_SIZE (BOARD_FIRST_FLASH_SECTOR_TO_ERASE * 16 * 1024) - Number of bytes reserved by the APP FW. This number plus - * BOOTLOADER_RESERVATION_SIZE will be deducted from - * BOARD_FLASH_SIZE to determine the size of the App FW - * and hence the address space of FLASH to erase and program. - * USBMFGSTRING "PX4 AP" - Optional USB MFG string (default is '3D Robotics' if not defined.) - * SERIAL_BREAK_DETECT_DISABLED - Optional prevent break selection on Serial port from entering or staying in BL - * - * * Other defines are somewhat self explanatory. - */ - -/* Boot device selection list*/ -#define USB0_DEV 0x01 -#define SERIAL0_DEV 0x02 -#define SERIAL1_DEV 0x04 - -#define APP_LOAD_ADDRESS 0x08020000 -#define BOOTLOADER_DELAY 5000 -#define INTERFACE_USB 1 -#define INTERFACE_USB_CONFIG "/dev/ttyACM0" -#define BOARD_VBUS MK_GPIO_INPUT(GPIO_OTGFS_VBUS) - -//#define USE_VBUS_PULL_DOWN -#define INTERFACE_USART 1 -#define INTERFACE_USART_CONFIG "/dev/ttyS4,57600" -#define BOOT_DELAY_ADDRESS 0x000001a0 -#define BOARD_TYPE 1010 -#define _FLASH_KBYTES (*(uint32_t *)0x1FF1E880) -#define BOARD_FLASH_SECTORS (15) -#define BOARD_FLASH_SIZE (_FLASH_KBYTES * 1024) - -#define OSC_FREQ 16 - -#define BOARD_PIN_LED_ACTIVITY GPIO_nLED_BLUE // BLUE -#define BOARD_PIN_LED_BOOTLOADER GPIO_nLED_GREEN // GREEN -#define BOARD_LED_ON 0 -#define BOARD_LED_OFF 1 - -#define SERIAL_BREAK_DETECT_DISABLED 1 - -#if !defined(ARCH_SN_MAX_LENGTH) -# define ARCH_SN_MAX_LENGTH 12 -#endif - -#if !defined(APP_RESERVATION_SIZE) -# define APP_RESERVATION_SIZE 0 -#endif - -#if !defined(BOARD_FIRST_FLASH_SECTOR_TO_ERASE) -# define BOARD_FIRST_FLASH_SECTOR_TO_ERASE 1 -#endif - -#if !defined(USB_DATA_ALIGN) -# define USB_DATA_ALIGN -#endif - -#ifndef BOOT_DEVICES_SELECTION -# define BOOT_DEVICES_SELECTION USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif - -#ifndef BOOT_DEVICES_FILTER_ONUSB -# define BOOT_DEVICES_FILTER_ONUSB USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif diff --git a/boards/cuav/x7pro/src/i2c.cpp b/boards/cuav/x7pro/src/i2c.cpp deleted file mode 100644 index 124fc23..0000000 --- a/boards/cuav/x7pro/src/i2c.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), - initI2CBusExternal(2), - initI2CBusInternal(3), - initI2CBusExternal(4), -}; diff --git a/boards/cuav/x7pro/src/init.c b/boards/cuav/x7pro/src/init.c deleted file mode 100644 index d4c262b..0000000 --- a/boards/cuav/x7pro/src/init.c +++ /dev/null @@ -1,219 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * FMU-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. - */ - -#include "board_config.h" - -#include - -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include - -#include - -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - /* set the peripheral rails off */ - VDD_5V_PERIPH_EN(false); - board_control_spi_sensors_power(false, 0xffff); - - bool last = READ_SPEKTRUM_POWER(); - /* Keep Spektum on to discharge rail*/ - SPEKTRUM_POWER(false); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ - SPEKTRUM_POWER(last); - board_control_spi_sensors_power(true, 0xffff); - VDD_5V_PERIPH_EN(true); -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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 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(); -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Power on Interfaces */ - VDD_5V_PERIPH_EN(true); - VDD_5V_HIPOWER_EN(true); - board_control_spi_sensors_power(true, 0xffff); - SPEKTRUM_POWER(true); - - /* Need hrt running before using the ADC */ - px4_platform_init(); - - /* configure SPI interfaces (after we determined the HW version) */ - stm32_spiinitialize(); - - /* configure the DMA allocator */ - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_on(LED_GREEN); // Indicate Power. - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - -#ifdef CONFIG_MMCSD - // Ensure Power is off for > 10 mS - usleep(15 * 1000); - VDD_3V3_SD_CARD_EN(true); - usleep(500 * 1000); - - /* Mount the SDIO-based MMC/SD block driver */ - /* First, get an instance of the SDIO interface */ - struct sdio_dev_s *sdio_dev = sdio_initialize(0); // SDIO_SLOTNO 0 Only one slot - - if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", 0); - } - - if (mmcsd_slotinitialize(0, sdio_dev) != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver\n"); - } - - /* Assume that the SD card is inserted. What choice do we have? */ - sdio_mediachange(sdio_dev, true); -#endif /* CONFIG_MMCSD */ - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/cuav/x7pro/src/led.c b/boards/cuav/x7pro/src/led.c deleted file mode 100644 index 79792ca..0000000 --- a/boards/cuav/x7pro/src/led.c +++ /dev/null @@ -1,111 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -# define xlat(p) (p) -static uint32_t g_ledmap[] = { - FMU_LED_AMBER, // Indexed by LED_SAFETY (defaulted to an output) -}; - -__EXPORT void led_init(void) -{ - /* Configure LED GPIOs for output */ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - if (g_ledmap[l] != 0) { - stm32_configgpio(g_ledmap[l]); - } - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - if (g_ledmap[led] != 0) { - stm32_gpiowrite(g_ledmap[led], !state); - } -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - if (g_ledmap[led] != 0) { - return !stm32_gpioread(g_ledmap[led]); - } - - return false; -} - -__EXPORT void led_on(int led) -{ - phy_set_led(xlat(led), true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(xlat(led), false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(xlat(led), !phy_get_led(xlat(led))); -} diff --git a/boards/cuav/x7pro/src/spi.cpp b/boards/cuav/x7pro/src/spi.cpp deleted file mode 100644 index 671ad8d..0000000 --- a/boards/cuav/x7pro/src/spi.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ADIS16470, SPI::CS{GPIO::PortF, GPIO::Pin10}, SPI::DRDY{GPIO::PortE, GPIO::Pin7}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20689, SPI::CS{GPIO::PortG, GPIO::Pin6}, SPI::DRDY{GPIO::PortJ, GPIO::Pin0}), - }, {GPIO::PortE, GPIO::Pin3}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortF, GPIO::Pin5}), - initSPIDevice(DRV_MAG_DEVTYPE_RM3100, SPI::CS{GPIO::PortF, GPIO::Pin2}, SPI::DRDY{GPIO::PortE, GPIO::Pin4}), - }), - initSPIBus(SPI::Bus::SPI4, { - initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::PortF, GPIO::Pin3}, SPI::DRDY{GPIO::PortB, GPIO::Pin15}), - initSPIDevice(DRV_GYR_DEVTYPE_BMI088, SPI::CS{GPIO::PortF, GPIO::Pin4}, SPI::DRDY{GPIO::PortB, GPIO::Pin14}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortB, GPIO::Pin15}), - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortG, GPIO::Pin10}), - }), - initSPIBusExternal(SPI::Bus::SPI5, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin4}), - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}), - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin13}), - }), - initSPIBus(SPI::Bus::SPI6, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20649, SPI::CS{GPIO::PortI, GPIO::Pin12}, SPI::DRDY{GPIO::PortH, GPIO::Pin5}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20689, SPI::CS{GPIO::PortE, GPIO::Pin15}, SPI::DRDY{GPIO::PortH, GPIO::Pin5}), - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortI, GPIO::Pin8}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/cuav/x7pro/src/timer_config.cpp b/boards/cuav/x7pro/src/timer_config.cpp deleted file mode 100644 index 0885466..0000000 --- a/boards/cuav/x7pro/src/timer_config.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer5, DMA{DMA::Index1}), - initIOTimer(Timer::Timer4, DMA{DMA::Index1}), - initIOTimer(Timer::Timer1, DMA{DMA::Index1}), - initIOTimer(Timer::Timer12), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel1}, {GPIO::PortH, GPIO::Pin10}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel2}, {GPIO::PortH, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel3}, {GPIO::PortH, GPIO::Pin12}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel4}, {GPIO::PortI, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel1}, {GPIO::PortD, GPIO::Pin12}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel4}, {GPIO::PortD, GPIO::Pin15}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortA, GPIO::Pin10}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer12, Timer::Channel1}, {GPIO::PortH, GPIO::Pin6}), - initIOTimerChannel(io_timers, {Timer::Timer12, Timer::Channel2}, {GPIO::PortH, GPIO::Pin9}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); - -constexpr io_timers_t led_pwm_timers[MAX_LED_TIMERS] = { - initIOTimer(Timer::Timer8), -}; - -#define CCER_C1_NUM_BITS 4 -#define POLARITY(c) (GTIM_CCER_CC1P << (((c)-1) * CCER_C1_NUM_BITS)) -#define DRIVE_TYPE(p) ((p)|GPIO_OPENDRAIN|GPIO_PULLUP) - -static inline constexpr timer_io_channels_t initIOTimerChannelLED(const io_timers_t io_timers_conf[MAX_LED_TIMERS], - Timer::TimerChannel timer, GPIO::GPIOPin pin, int ui_polarity) -{ - timer_io_channels_t ret = initIOTimerChannel(io_timers_conf, timer, pin); - ret.gpio_out = DRIVE_TYPE(ret.gpio_out); - ret.masks = POLARITY(ui_polarity); - return ret; -} - -constexpr timer_io_channels_t led_pwm_channels[MAX_TIMER_LED_CHANNELS] = { - initIOTimerChannelLED(led_pwm_timers, {Timer::Timer8, Timer::Channel1}, {GPIO::PortI, GPIO::Pin5}, 1), - initIOTimerChannelLED(led_pwm_timers, {Timer::Timer8, Timer::Channel2}, {GPIO::PortI, GPIO::Pin6}, 2), - initIOTimerChannelLED(led_pwm_timers, {Timer::Timer8, Timer::Channel3}, {GPIO::PortI, GPIO::Pin7}, 3), -}; diff --git a/boards/cuav/x7pro/src/usb.c b/boards/cuav/x7pro/src/usb.c deleted file mode 100644 index 3d86aca..0000000 --- a/boards/cuav/x7pro/src/usb.c +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -#include "board_config.h" -#include -#include -#include -#include - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/cuav/x7pro/test.px4board b/boards/cuav/x7pro/test.px4board deleted file mode 100644 index 3968d02..0000000 --- a/boards/cuav/x7pro/test.px4board +++ /dev/null @@ -1,13 +0,0 @@ -# CONFIG_BOARD_UAVCAN_TIMER_OVERRIDE is not set -CONFIG_DRIVERS_ADC_ADS1115=n -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=n -CONFIG_DRIVERS_IRLOCK=n -CONFIG_DRIVERS_PCA9685_PWM_OUT=n -CONFIG_DRIVERS_UAVCAN=n -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=n -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=n -CONFIG_MODULES_ROVER_POS_CONTROL=n -CONFIG_BOARD_TESTING=y -CONFIG_DRIVERS_TEST_PPM=y -CONFIG_SYSTEMCMDS_BL_UPDATE=y -CONFIG_SYSTEMCMDS_MICROBENCH=y diff --git a/boards/cubepilot/cubeorange/bootloader.px4board b/boards/cubepilot/cubeorange/bootloader.px4board deleted file mode 100644 index 19b6e66..0000000 --- a/boards/cubepilot/cubeorange/bootloader.px4board +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_ROMFSROOT="" diff --git a/boards/cubepilot/cubeorange/default.px4board b/boards/cubepilot/cubeorange/default.px4board deleted file mode 100644 index 521dd3b..0000000 --- a/boards/cubepilot/cubeorange/default.px4board +++ /dev/null @@ -1,92 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_IO="cubepilot_io-v2_default" -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS2" -CONFIG_BOARD_SERIAL_GPS2="/dev/ttyS5" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS0" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS1" -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_BAROMETER_MS5611=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20649=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_PWM_INPUT=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_PX4IO=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_TRANSPONDER_SAGETECH_MXS=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BL_UPDATE=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/cubepilot/cubeorange/extras/cubepilot_cubeorange_bootloader.bin b/boards/cubepilot/cubeorange/extras/cubepilot_cubeorange_bootloader.bin deleted file mode 100755 index e8553b4..0000000 Binary files a/boards/cubepilot/cubeorange/extras/cubepilot_cubeorange_bootloader.bin and /dev/null differ diff --git a/boards/cubepilot/cubeorange/extras/cubepilot_io-v2_default.bin b/boards/cubepilot/cubeorange/extras/cubepilot_io-v2_default.bin deleted file mode 100755 index 4d29f3a..0000000 Binary files a/boards/cubepilot/cubeorange/extras/cubepilot_io-v2_default.bin and /dev/null differ diff --git a/boards/cubepilot/cubeorange/firmware.prototype b/boards/cubepilot/cubeorange/firmware.prototype deleted file mode 100644 index 8132a05..0000000 --- a/boards/cubepilot/cubeorange/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 140, - "magic": "PX4FWv1", - "description": "Firmware for the CubePilot CubeOrange board", - "image": "", - "build_time": 0, - "summary": "CubeOrange", - "version": "0.1", - "image_size": 0, - "image_maxsize": 1966080, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/cubepilot/cubeorange/init/rc.board_defaults b/boards/cubepilot/cubeorange/init/rc.board_defaults deleted file mode 100644 index 8ae2ed4..0000000 --- a/boards/cubepilot/cubeorange/init/rc.board_defaults +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 10.1 -param set-default BAT2_V_DIV 10.1 - -param set-default BAT1_A_PER_V 17 -param set-default BAT2_A_PER_V 17 - -# Disable IMU thermal control -param set-default SENS_EN_THERMAL 0 - -param set-default -s SENS_TEMP_ID 2621474 - -param set-default SYS_USE_IO 1 - -set IOFW "/etc/extras/cubepilot_io-v2_default.bin" diff --git a/boards/cubepilot/cubeorange/init/rc.board_mavlink b/boards/cubepilot/cubeorange/init/rc.board_mavlink deleted file mode 100644 index 1dd0666..0000000 --- a/boards/cubepilot/cubeorange/init/rc.board_mavlink +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# -# Board specific MAVLink startup script. -#------------------------------------------------------------------------------ - -# Start ADS-B receiver mavlink connection if console not present -if [ ! -e /dev/console ] -then - mavlink start -d /dev/ttyS4 -b 57600 -m minimal -fi diff --git a/boards/cubepilot/cubeorange/init/rc.board_sensors b/boards/cubepilot/cubeorange/init/rc.board_sensors deleted file mode 100644 index e84edf7..0000000 --- a/boards/cubepilot/cubeorange/init/rc.board_sensors +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# Board specific sensors init -#------------------------------------------------------------------------------ -board_adc start - -# SPI4 -ms5611 -s -b 4 start -icm20602 -s -b 4 -R 12 start -icm20948 -s -b 4 -R 10 -M start - -# SPI1 -ms5611 -s -b 1 start -icm20649 -s -b 1 start - diff --git a/boards/cubepilot/cubeorange/nuttx-config/bootloader/defconfig b/boards/cubepilot/cubeorange/nuttx-config/bootloader/defconfig deleted file mode 100644 index 2203424..0000000 --- a/boards/cubepilot/cubeorange/nuttx-config/bootloader/defconfig +++ /dev/null @@ -1,90 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_CONSOLE is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_SPI_EXCHANGE is not set -# CONFIG_STM32H7_SYSCFG is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/cubepilot/cubeorange/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743ZI=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_INITTHREAD_PRIORITY=254 -CONFIG_BOARD_LATE_INITIALIZE=y -CONFIG_BOARD_LOOPSPERMSEC=79954 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x1016 -CONFIG_CDCACM_PRODUCTSTR="PX4 BL CubePilot CubeOrange" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x2DAE -CONFIG_CDCACM_VENDORSTR="CubePilot" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_EXPERIMENTAL=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="bootloader_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SPI=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_USART3=y -CONFIG_SYSTEMTICK_HOOK=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGINT_CHAR=0x03 -CONFIG_TTY_SIGTSTP=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/cubepilot/cubeorange/nuttx-config/include/board.h b/boards/cubepilot/cubeorange/nuttx-config/include/board.h deleted file mode 100644 index 3a4abd0..0000000 --- a/boards/cubepilot/cubeorange/nuttx-config/include/board.h +++ /dev/null @@ -1,266 +0,0 @@ -/************************************************************************************ - * nuttx-config/include/board.h - * - * Copyright (C) 2020 Gregory Nutt. All rights reserved. - * Authors: David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ -#pragma once - -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/* Clocking *************************************************************************/ -/* The board provides the following clock sources: - * - * X1: 24 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 16 MHz RC factory-trimmed internal oscillator - * HSE: 24 MHz crystal for HSE - */ -#define STM32_BOARD_XTAL 24000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL - -/* Main PLL Configuration. - * - * PLL source is HSE = 24,000,000 - * - * PLL_VCOx = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 1 <= PLLM <= 63 - * 4 <= PLLN <= 512 - * 150 MHz <= PLL_VCOL <= 420MHz - * 192 MHz <= PLL_VCOH <= 836MHz - * - * SYSCLK = PLL_VCO / PLLP - * CPUCLK = SYSCLK / D1CPRE - * Subject to - * - * PLLP1 = {2, 4, 6, 8, ..., 128} - * PLLP2,3 = {2, 3, 4, ..., 128} - * CPUCLK <= 480 MHz - */ - -/* PLL1, wide 4 - 8 MHz input, enable DIVP, DIVQ, DIVR - * - * PLL1_VCO = (24,000,000 / 3) * 100 = 800 MHz - * - * PLL1P = PLL1_VCO/2 = 800 MHz / 2 = 400 MHz - * PLL1Q = PLL1_VCO/8 = 800 MHz / 8 = 100 MHz - * PLL1R = PLL1_VCO/2 = 800 MHz / 2 = 400 MHz - */ -#define STM32_PLLCFG_PLL1CFG (RCC_PLLCFGR_PLL1VCOSEL_WIDE|RCC_PLLCFGR_PLL1RGE_4_8_MHZ|RCC_PLLCFGR_DIVP1EN|RCC_PLLCFGR_DIVQ1EN|RCC_PLLCFGR_DIVR1EN) -#define STM32_PLLCFG_PLL1M RCC_PLLCKSELR_DIVM1(3) -#define STM32_PLLCFG_PLL1N RCC_PLL1DIVR_N1(100) -#define STM32_PLLCFG_PLL1P RCC_PLL1DIVR_P1(2) -#define STM32_PLLCFG_PLL1Q RCC_PLL1DIVR_Q1(8) -#define STM32_PLLCFG_PLL1R RCC_PLL1DIVR_R1(2) - -#define STM32_VCO1_FREQUENCY ((STM32_HSE_FREQUENCY / 3) * 100) -#define STM32_PLL1P_FREQUENCY (STM32_VCO1_FREQUENCY / 2) -#define STM32_PLL1Q_FREQUENCY (STM32_VCO1_FREQUENCY / 8) -#define STM32_PLL1R_FREQUENCY (STM32_VCO1_FREQUENCY / 2) - -/* PLL2 */ -#define STM32_PLLCFG_PLL2CFG (RCC_PLLCFGR_PLL2VCOSEL_WIDE|RCC_PLLCFGR_PLL2RGE_4_8_MHZ|RCC_PLLCFGR_DIVP2EN|RCC_PLLCFGR_DIVQ2EN|RCC_PLLCFGR_DIVR2EN) -#define STM32_PLLCFG_PLL2M RCC_PLLCKSELR_DIVM2(2) -#define STM32_PLLCFG_PLL2N RCC_PLL2DIVR_N2(30) -#define STM32_PLLCFG_PLL2P RCC_PLL2DIVR_P2(4) -#define STM32_PLLCFG_PLL2Q RCC_PLL2DIVR_Q2(5) -#define STM32_PLLCFG_PLL2R RCC_PLL2DIVR_R2(1) - -#define STM32_VCO2_FREQUENCY ((STM32_HSE_FREQUENCY / 2) * 30) -#define STM32_PLL2P_FREQUENCY (STM32_VCO2_FREQUENCY / 4) -#define STM32_PLL2Q_FREQUENCY (STM32_VCO2_FREQUENCY / 5) -#define STM32_PLL2R_FREQUENCY (STM32_VCO2_FREQUENCY / 1) - -/* PLL3 */ -#define STM32_PLLCFG_PLL3CFG (RCC_PLLCFGR_PLL3VCOSEL_WIDE|RCC_PLLCFGR_PLL3RGE_4_8_MHZ|RCC_PLLCFGR_DIVQ3EN) -#define STM32_PLLCFG_PLL3M RCC_PLLCKSELR_DIVM3(6) -#define STM32_PLLCFG_PLL3N RCC_PLL3DIVR_N3(72) -#define STM32_PLLCFG_PLL3P RCC_PLL3DIVR_P3(3) -#define STM32_PLLCFG_PLL3Q RCC_PLL3DIVR_Q3(6) -#define STM32_PLLCFG_PLL3R RCC_PLL3DIVR_R3(9) - -#define STM32_VCO3_FREQUENCY ((STM32_HSE_FREQUENCY / 6) * 72) -#define STM32_PLL3P_FREQUENCY (STM32_VCO3_FREQUENCY / 3) -#define STM32_PLL3Q_FREQUENCY (STM32_VCO3_FREQUENCY / 6) -#define STM32_PLL3R_FREQUENCY (STM32_VCO3_FREQUENCY / 9) - -/* SYSCLK = PLL1P = 400MHz - * CPUCLK = SYSCLK / 1 = 400 MHz - */ -#define STM32_RCC_D1CFGR_D1CPRE (RCC_D1CFGR_D1CPRE_SYSCLK) -#define STM32_SYSCLK_FREQUENCY (STM32_PLL1P_FREQUENCY) -#define STM32_CPUCLK_FREQUENCY (STM32_SYSCLK_FREQUENCY / 1) - -/* Configure Clock Assignments */ - -/* AHB clock (HCLK) is SYSCLK/2 (240 MHz max) - * HCLK1 = HCLK2 = HCLK3 = HCLK4 = 200 - */ -#define STM32_RCC_D1CFGR_HPRE RCC_D1CFGR_HPRE_SYSCLKd2 /* HCLK = SYSCLK / 2 */ -#define STM32_ACLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* ACLK in D1, HCLK3 in D1 */ -#define STM32_HCLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* HCLK in D2, HCLK4 in D3 */ -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (120 MHz) */ -#define STM32_RCC_D2CFGR_D2PPRE1 RCC_D2CFGR_D2PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB2 clock (PCLK2) is HCLK/2 (120 MHz) */ -#define STM32_RCC_D2CFGR_D2PPRE2 RCC_D2CFGR_D2PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB3 clock (PCLK3) is HCLK/2 (120 MHz) */ -#define STM32_RCC_D1CFGR_D1PPRE RCC_D1CFGR_D1PPRE_HCLKd2 /* PCLK3 = HCLK / 2 */ -#define STM32_PCLK3_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB4 clock (PCLK4) is HCLK/4 (120 MHz) */ -#define STM32_RCC_D3CFGR_D3PPRE RCC_D3CFGR_D3PPRE_HCLKd2 /* PCLK4 = HCLK / 2 */ -#define STM32_PCLK4_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timer clock frequencies */ - -/* Timers driven from APB1 will be twice PCLK1 */ -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* Timers driven from APB2 will be twice PCLK2 */ -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM15_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM16_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM17_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Kernel Clock Configuration - * Note: look at Table 54 in ST Manual - */ -#define STM32_RCC_D1CCIPR_SDMMCSEL RCC_D1CCIPR_SDMMC_PLL1 - -#define STM32_RCC_D2CCIP2R_I2C123SRC RCC_D2CCIP2R_I2C123SEL_HSI /* I2C123 clock source */ -#define STM32_RCC_D2CCIP1R_SPI123SRC RCC_D2CCIP1R_SPI123SEL_PLL2 /* SPI123 clock source */ -#define STM32_RCC_D2CCIP1R_SPI45SRC RCC_D2CCIP1R_SPI45SEL_PLL2 /* SPI45 clock source */ -#define STM32_RCC_D2CCIP2R_USBSRC RCC_D2CCIP2R_USBSEL_PLL3 /* USB 1 and 2 clock source */ -#define STM32_RCC_D2CCIP1R_FDCANSEL RCC_D2CCIP1R_FDCANSEL_HSE /* FDCAN 1 2 clock source */ - -#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2 /* ADC 1 2 3 clock source */ - -/* FLASH wait states */ -#define BOARD_FLASH_WAITSTATES 2 - -/* SDMMC definitions ********************************************************/ -/* Init 400kHz, freq = PLL1Q/(2*div) div = PLL1Q/(2*freq) */ -#define STM32_SDMMC_INIT_CLKDIV (125 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* 25 MHz Max for now, 25 mHZ = PLL1Q/(2*div), div = PLL1Q/(2*freq) - * div = 100 / (2*25) - */ -#define STM32_SDMMC_MMCXFR_CLKDIV (2 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#define STM32_SDMMC_SDXFR_CLKDIV (2 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - - -/* UART/USART */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ -#define GPIO_USART2_RX GPIO_USART2_RX_2 /* PD6 */ -#define GPIO_USART2_CTS GPIO_USART2_CTS_NSS_2 /* PD3 */ -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 /* PD4 */ - -#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ -#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ -#define GPIO_USART3_CTS GPIO_USART3_CTS_NSS_2 /* PD11 */ -#define GPIO_USART3_RTS GPIO_USART3_RTS_2 /* PD12 */ - -#define GPIO_UART4_TX GPIO_UART4_TX_2 /* PA0 */ -#define GPIO_UART4_RX GPIO_UART4_RX_2 /* PA1 */ - -#define GPIO_USART6_TX GPIO_USART6_TX_1 /* PC6 */ -#define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC7 */ - -#define GPIO_UART7_TX GPIO_UART7_TX_3 /* PE8 */ -#define GPIO_UART7_RX GPIO_UART7_RX_3 /* PE7 */ - -#define GPIO_UART8_TX GPIO_UART8_TX_1 /* PE1 */ -#define GPIO_UART8_RX GPIO_UART8_RX_1 /* PE0 */ - - -/* CAN */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 /* PD0 */ -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 /* PD1 */ - -#define GPIO_CAN2_RX GPIO_CAN2_RX_1 /* PB12 */ -#define GPIO_CAN2_TX GPIO_CAN2_TX_2 /* PB6 */ - - -/* SPI */ -#define ADJ_SLEW_RATE(p) (((p) & ~GPIO_SPEED_MASK) | (GPIO_SPEED_2MHz)) - -#define GPIO_SPI1_SCK ADJ_SLEW_RATE(GPIO_SPI1_SCK_1) /* PA5 */ -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 /* PA7 */ - -#define GPIO_SPI2_SCK ADJ_SLEW_RATE(GPIO_SPI2_SCK_4) /* PB13 */ -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 /* PB14 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 /* PB15 */ - -#define GPIO_SPI4_SCK ADJ_SLEW_RATE(GPIO_SPI4_SCK_2) /* PE2 */ -#define GPIO_SPI4_MISO GPIO_SPI4_MISO_2 /* PE5 */ -#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_2 /* PE6 */ - - -/* I2C */ -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 /* PB8 */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 /* PB9 */ - -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_1 /* PB10 */ -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_1 /* PB11 */ diff --git a/boards/cubepilot/cubeorange/nuttx-config/include/board_dma_map.h b/boards/cubepilot/cubeorange/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 050ae59..0000000 --- a/boards/cubepilot/cubeorange/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -// DMAMUX1 -#define DMAMAP_SPI1_RX DMAMAP_DMA12_SPI1RX_0 /* DMA1:37 */ -#define DMAMAP_SPI1_TX DMAMAP_DMA12_SPI1TX_0 /* DMA1:38 */ - -#define DMAMAP_USART6_RX DMAMAP_DMA12_USART6RX_1 /* DMA1:71 */ -#define DMAMAP_USART6_TX DMAMAP_DMA12_USART6TX_1 /* DMA1:72 */ - -#define DMAMAP_SPI4_RX DMAMAP_DMA12_SPI4RX_0 /* DMA1:83 */ -#define DMAMAP_SPI4_TX DMAMAP_DMA12_SPI4TX_0 /* DMA1:84 */ diff --git a/boards/cubepilot/cubeorange/nuttx-config/nsh/defconfig b/boards/cubepilot/cubeorange/nuttx-config/nsh/defconfig deleted file mode 100644 index fe6a962..0000000 --- a/boards/cubepilot/cubeorange/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,255 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_CONSOLE is not set -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/cubepilot/cubeorange/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743ZI=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=79954 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x1016 -CONFIG_CDCACM_PRODUCTSTR="CubeOrange" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x2DAE -CONFIG_CDCACM_VENDORSTR="CubePilot" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXPERIMENTAL=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=4 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_PROGMEM=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32H7_ADC1=y -CONFIG_STM32H7_ADC3=y -CONFIG_STM32H7_BBSRAM=y -CONFIG_STM32H7_BBSRAM_FILES=5 -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_DMA2=y -CONFIG_STM32H7_DMACAPABLE=y -CONFIG_STM32H7_FLOWCONTROL_BROKEN=y -CONFIG_STM32H7_I2C1=y -CONFIG_STM32H7_I2C2=y -CONFIG_STM32H7_I2C_DYNTIMEO=y -CONFIG_STM32H7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_RTC=y -CONFIG_STM32H7_RTC_HSECLOCK=y -CONFIG_STM32H7_RTC_MAGIC_REG=1 -CONFIG_STM32H7_SAVE_CRASHDUMP=y -CONFIG_STM32H7_SDMMC1=y -CONFIG_STM32H7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_SPI1=y -CONFIG_STM32H7_SPI1_DMA=y -CONFIG_STM32H7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32H7_SPI2=y -CONFIG_STM32H7_SPI4=y -CONFIG_STM32H7_SPI4_DMA=y -CONFIG_STM32H7_SPI4_DMA_BUFFER=1024 -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_TIM3=y -CONFIG_STM32H7_TIM4=y -CONFIG_STM32H7_UART4=y -CONFIG_STM32H7_UART7=y -CONFIG_STM32H7_UART8=y -CONFIG_STM32H7_USART2=y -CONFIG_STM32H7_USART3=y -CONFIG_STM32H7_USART6=y -CONFIG_STM32H7_USART_BREAKS=y -CONFIG_STM32H7_USART_INVERT=y -CONFIG_STM32H7_USART_SINGLEWIRE=y -CONFIG_STM32H7_USART_SWAP=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGINT_CHAR=0x03 -CONFIG_TTY_SIGTSTP=y -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_TXBUFSIZE=3000 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 -CONFIG_WATCHDOG=y diff --git a/boards/cubepilot/cubeorange/nuttx-config/scripts/bootloader_script.ld b/boards/cubepilot/cubeorange/nuttx-config/scripts/bootloader_script.ld deleted file mode 100644 index 8d5c394..0000000 --- a/boards/cubepilot/cubeorange/nuttx-config/scripts/bootloader_script.ld +++ /dev/null @@ -1,223 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2020 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The board uses an STM32H743II has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * There's a switch on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the switch is - * drepresed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743ZI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K - DTCM1 (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - DTCM2 (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */ - SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */ - SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */ - BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > AXI_SRAM AT > FLASH - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > AXI_SRAM - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } - - .ramfunc : { - _sramfuncs = .; - *(.ramfunc .ramfunc.*) - . = ALIGN(4); - _eramfuncs = .; - } > ITCM_RAM AT > FLASH - - _framfuncs = LOADADDR(.ramfunc); -} diff --git a/boards/cubepilot/cubeorange/nuttx-config/scripts/script.ld b/boards/cubepilot/cubeorange/nuttx-config/scripts/script.ld deleted file mode 100644 index f213ad2..0000000 --- a/boards/cubepilot/cubeorange/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,228 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2020 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The board uses an STM32H743XIH6 and has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * There's a switch on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the switch is - * drepresed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743ZI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - FLASH (rx) : ORIGIN = 0x08020000, LENGTH = 1920K - - DTCM1_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - DTCM2_RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */ - SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */ - SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */ - BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH - - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - - /* Pad out last section as the STM32H7 Flash write size is 256 bits. 32 bytes */ - . = ALIGN(16); - FILL(0xffff) - . += 16; - } > AXI_SRAM AT > FLASH = 0xffff - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > AXI_SRAM - - /* Emit the the D3 power domain section for locating BDMA data */ - - .sram4_reserve (NOLOAD) : - { - *(.sram4) - . = ALIGN(4); - _sram4_heap_start = ABSOLUTE(.); - } > SRAM4 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/cubepilot/cubeorange/nuttx-config/test/defconfig b/boards/cubepilot/cubeorange/nuttx-config/test/defconfig deleted file mode 100644 index 54613e1..0000000 --- a/boards/cubepilot/cubeorange/nuttx-config/test/defconfig +++ /dev/null @@ -1,258 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CMP is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/cubepilot/cubeorange/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743ZI=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=79954 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x1016 -CONFIG_CDCACM_PRODUCTSTR="CubeOrange" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x2DAE -CONFIG_CDCACM_VENDORSTR="CubePilot" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXAMPLES_CALIB_UDELAY=y -CONFIG_EXPERIMENTAL=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=4 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_PROGMEM=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32H7_ADC1=y -CONFIG_STM32H7_ADC3=y -CONFIG_STM32H7_BBSRAM=y -CONFIG_STM32H7_BBSRAM_FILES=5 -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_DMA2=y -CONFIG_STM32H7_DMACAPABLE=y -CONFIG_STM32H7_FLOWCONTROL_BROKEN=y -CONFIG_STM32H7_I2C1=y -CONFIG_STM32H7_I2C2=y -CONFIG_STM32H7_I2C_DYNTIMEO=y -CONFIG_STM32H7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_RTC=y -CONFIG_STM32H7_RTC_HSECLOCK=y -CONFIG_STM32H7_RTC_MAGIC_REG=1 -CONFIG_STM32H7_SAVE_CRASHDUMP=y -CONFIG_STM32H7_SDMMC1=y -CONFIG_STM32H7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_SPI1=y -CONFIG_STM32H7_SPI1_DMA=y -CONFIG_STM32H7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32H7_SPI2=y -CONFIG_STM32H7_SPI4=y -CONFIG_STM32H7_SPI4_DMA=y -CONFIG_STM32H7_SPI4_DMA_BUFFER=1024 -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_TIM3=y -CONFIG_STM32H7_TIM4=y -CONFIG_STM32H7_UART4=y -CONFIG_STM32H7_UART7=y -CONFIG_STM32H7_UART8=y -CONFIG_STM32H7_USART2=y -CONFIG_STM32H7_USART3=y -CONFIG_STM32H7_USART6=y -CONFIG_STM32H7_USART_BREAKS=y -CONFIG_STM32H7_USART_INVERT=y -CONFIG_STM32H7_USART_SINGLEWIRE=y -CONFIG_STM32H7_USART_SWAP=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TESTING_OSTEST=y -CONFIG_TESTING_OSTEST_FPUTESTDISABLE=y -CONFIG_TESTING_OSTEST_STACKSIZE=10240 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGTSTP=y -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_TXBUFSIZE=3000 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 -CONFIG_WATCHDOG=y diff --git a/boards/cubepilot/cubeorange/src/CMakeLists.txt b/boards/cubepilot/cubeorange/src/CMakeLists.txt deleted file mode 100644 index c8e7699..0000000 --- a/boards/cubepilot/cubeorange/src/CMakeLists.txt +++ /dev/null @@ -1,65 +0,0 @@ -############################################################################ -# -# Copyright (c) 2020 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. -# -############################################################################ -if("${PX4_BOARD_LABEL}" STREQUAL "bootloader") - add_library(drivers_board - bootloader_main.c - usb.c - ) - target_link_libraries(drivers_board - PRIVATE - nuttx_arch - nuttx_drivers - bootloader - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/bootloader/common) - -else() - add_library(drivers_board - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - usb.c - ) - - target_link_libraries(drivers_board - PRIVATE - arch_io_pins - arch_spi - drivers__led - nuttx_arch - nuttx_drivers - px4_layer - ) -endif() diff --git a/boards/cubepilot/cubeorange/src/board_config.h b/boards/cubepilot/cubeorange/src/board_config.h deleted file mode 100644 index 5cab2c5..0000000 --- a/boards/cubepilot/cubeorange/src/board_config.h +++ /dev/null @@ -1,190 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * Board internal definitions - */ - -#pragma once - -#include -#include -#include -#include - -/* PX4IO connection configuration */ -#define BOARD_USES_PX4IO_VERSION 2 -#define PX4IO_SERIAL_DEVICE "/dev/ttyS3" -#define PX4IO_SERIAL_TX_GPIO GPIO_USART6_TX -#define PX4IO_SERIAL_RX_GPIO GPIO_USART6_RX -#define PX4IO_SERIAL_BASE STM32_USART6_BASE -#define PX4IO_SERIAL_VECTOR STM32_IRQ_USART6 -#define PX4IO_SERIAL_TX_DMAMAP DMAMAP_USART6_TX -#define PX4IO_SERIAL_RX_DMAMAP DMAMAP_USART6_RX -#define PX4IO_SERIAL_RCC_REG STM32_RCC_APB2ENR -#define PX4IO_SERIAL_RCC_EN RCC_APB2ENR_USART6EN -#define PX4IO_SERIAL_CLOCK STM32_PCLK2_FREQUENCY -#define PX4IO_SERIAL_BITRATE 1500000 /* 1.5Mbps -> max rate for IO */ - -/* LEDs */ -#define GPIO_nLED_AMBER /* PE12 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN12) - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_ARMED_LED LED_AMBER - -/* ADC channels */ -#define PX4_ADC_GPIO \ - /* PA2 */ GPIO_ADC12_INP14, \ - /* PA3 */ GPIO_ADC12_INP15, \ - /* PA4 */ GPIO_ADC12_INP18, \ - /* PC3 */ GPIO_ADC12_INP13, \ - /* PC4 */ GPIO_ADC12_INP4, \ - /* PC5 */ GPIO_ADC12_INP8 - -/* Define Channel numbers must match above GPIO pins */ -#define ADC_BATTERY1_VOLTAGE_CHANNEL 14 /* PA2: BATT_VOLTAGE_SENS */ -#define ADC_BATTERY1_CURRENT_CHANNEL 15 /* PA3: BATT_CURRENT_SENS */ -#define ADC_SCALED_V5_CHANNEL 18 /* PA4: VDD_5V_SENS */ -#define ADC_BATTERY2_VOLTAGE_CHANNEL 13 /* PC3: FMU_AUX_POWER_ADC1 */ -#define ADC_BATTERY2_CURRENT_CHANNEL 4 /* PC4: FMU_AUX_ADC2 */ -#define ADC_AIRSPEED_VOLTAGE_CHANNEL 8 /* PC5: PRESSURE_SENS */ - -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY1_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY1_CURRENT_CHANNEL) | \ - (1 << ADC_SCALED_V5_CHANNEL) | \ - (1 << ADC_BATTERY2_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY2_CURRENT_CHANNEL) | \ - (1 << ADC_AIRSPEED_VOLTAGE_CHANNEL)) - -/* HW has to large of R termination on ADC todo:change when HW value is chosen */ -#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f) - -/* PWM */ -#define DIRECT_PWM_OUTPUT_CHANNELS 6 -#define GPIO_PWM_VOLT_SEL /* PB4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN4) - -/* Power supply control and monitoring GPIOs */ -#define BOARD_NUMBER_BRICKS 2 -#define GPIO_nVDD_BRICK1_VALID /* PB5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5) // VDD_BRICK_VALID -#define GPIO_nVDD_BRICK2_VALID /* PB7 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN7) // VDD_BACKUP_VALID -#define GPIO_nVDD_USB_VALID /* PC0 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN0) // VBUS_VALID -#define GPIO_VDD_3V3_SENSORS_EN /* PE3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN3) // VDD_3V3_SENSORS_EN -#define GPIO_nVDD_5V_PERIPH_EN /* PA8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN8) // VDD_5V_PERIPH_EN -#define GPIO_nVDD_5V_PERIPH_OC /* PE15 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN15) // VDD_5V_PERIPH_OC -#define GPIO_nVDD_5V_HIPOWER_OC /* PE10 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN10) // VDD_5V_HIPOWER_OC - -/* Tone alarm output */ -#define TONE_ALARM_TIMER 2 /* timer 2 */ -#define TONE_ALARM_CHANNEL 1 /* PA15 TIM2_CH1 */ - -#define GPIO_BUZZER_1 /* PA15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) // ALARM - -#define GPIO_TONE_ALARM_IDLE GPIO_BUZZER_1 -#define GPIO_TONE_ALARM GPIO_TIM2_CH1OUT_2 - -/* PWM input driver. Use FMU AUX5 pins attached to timer4 channel 2 */ -#define PWMIN_TIMER 4 -#define PWMIN_TIMER_CHANNEL /* T4C2 */ 2 -#define GPIO_PWM_IN /* PD13 */ GPIO_TIM4_CH2IN_2 - -/* USB - * OTG FS: PA9 OTG_FS_VBUS VBUS sensing - */ -#define GPIO_OTGFS_VBUS /* PA9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 8 /* use timer8 for the HRT */ -#define HRT_TIMER_CHANNEL 3 /* use capture/compare channel 3 */ - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID)) -#define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -#define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID)) -#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_nVDD_5V_PERIPH_OC)) -#define BOARD_ADC_HIPOWER_5V_OC (!px4_arch_gpioread(GPIO_nVDD_5V_HIPOWER_OC)) - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ -#define BOARD_HAS_ON_RESET 1 - -#define BOARD_HAS_STATIC_MANIFEST 1 - - - -#define BOARD_ENABLE_CONSOLE_BUFFER - -#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, \ - GPIO_nVDD_USB_VALID, \ - GPIO_VDD_3V3_SENSORS_EN, \ - GPIO_nVDD_5V_PERIPH_EN, \ - GPIO_nVDD_5V_PERIPH_OC, \ - GPIO_nVDD_5V_HIPOWER_OC, \ - 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_GPIO_PIN_OFF(GPIO_SDMMC1_D0), \ - PX4_GPIO_PIN_OFF(GPIO_SDMMC1_D1), \ - PX4_GPIO_PIN_OFF(GPIO_SDMMC1_D2), \ - PX4_GPIO_PIN_OFF(GPIO_SDMMC1_D3), \ - PX4_GPIO_PIN_OFF(GPIO_SDMMC1_CMD),\ - GPIO_TONE_ALARM_IDLE, \ - GPIO_OTGFS_VBUS, \ - } - -__BEGIN_DECLS -#ifndef __ASSEMBLY__ - -extern void stm32_spiinitialize(void); -extern void board_peripheral_reset(int ms); - -#include -#endif /* __ASSEMBLY__ */ -__END_DECLS diff --git a/boards/cubepilot/cubeorange/src/bootloader_main.c b/boards/cubepilot/cubeorange/src/bootloader_main.c deleted file mode 100644 index 3a0e1a1..0000000 --- a/boards/cubepilot/cubeorange/src/bootloader_main.c +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020-2021 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. - * - ****************************************************************************/ - -/** - * @file bootloader_main.c - * - * FMU-specific early startup code for bootloader -*/ - -#include "board_config.h" -#include "bl.h" - -#include -#include -#include -#include -#include -#include "arm_internal.h" -#include - -extern int sercon_main(int c, char **argv); - -__EXPORT void board_on_reset(int status) {} - -__EXPORT void stm32_boardinitialize(void) -{ - /* configure USB interfaces */ - stm32_configgpio(GPIO_OTGFS_VBUS); -} - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - return 0; -} - -void board_late_initialize(void) -{ - sercon_main(0, NULL); -} - -extern void sys_tick_handler(void); -void board_timerhook(void) -{ - sys_tick_handler(); -} diff --git a/boards/cubepilot/cubeorange/src/hw_config.h b/boards/cubepilot/cubeorange/src/hw_config.h deleted file mode 100644 index 58b55e0..0000000 --- a/boards/cubepilot/cubeorange/src/hw_config.h +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/**************************************************************************** - * 10-8--2016: - * To simplify the ripple effect on the tools, we will be using - * /dev/serial/by-id/PX4 to locate PX4 devices. Therefore - * moving forward all Bootloaders must contain the prefix "PX4 BL " - * in the USBDEVICESTRING - * This Change will be made in an upcoming BL release - ****************************************************************************/ -/* - * Define usage to configure a bootloader - * - * - * Constant example Usage - * APP_LOAD_ADDRESS 0x08004000 - The address in Linker Script, where the app fw is org-ed - * BOOTLOADER_DELAY 5000 - Ms to wait while under USB pwr or bootloader request - * BOARD_FMUV2 - * INTERFACE_USB 1 - (Optional) Scan and use the USB interface for bootloading - * INTERFACE_USART 1 - (Optional) Scan and use the Serial interface for bootloading - * USBDEVICESTRING "PX4 BL FMU v2.x" - USB id string - * USBPRODUCTID 0x0011 - PID Should match defconfig - * BOOT_DELAY_ADDRESS 0x000001a0 - (Optional) From the linker script from Linker Script to get a custom - * delay provided by an APP FW - * BOARD_TYPE 9 - Must match .prototype boad_id - * _FLASH_KBYTES (*(uint16_t *)0x1fff7a22) - Run time flash size detection - * BOARD_FLASH_SECTORS ((_FLASH_KBYTES == 0x400) ? 11 : 23) - Run time determine the physical last sector - * BOARD_FLASH_SECTORS 11 - Hard coded zero based last sector - * BOARD_FLASH_SIZE (_FLASH_KBYTES*1024)- Total Flash size of device, determined at run time. - * (1024 * 1024) - Hard coded Total Flash of device - The bootloader and app reserved will be deducted - * programmatically - * - * BOARD_FIRST_FLASH_SECTOR_TO_ERASE 2 - Optional sectors index in the flash_sectors table (F4 only), to begin erasing. - * This is to allow sectors to be reserved for app fw usage. That will NOT be erased - * during a FW upgrade. - * The default is 0, and selects the first sector to be erased, as the 0th entry in the - * flash_sectors table. Which is the second physical sector of FLASH in the device. - * The first physical sector of FLASH is used by the bootloader, and is not defined - * in the table. - * - * APP_RESERVATION_SIZE (BOARD_FIRST_FLASH_SECTOR_TO_ERASE * 16 * 1024) - Number of bytes reserved by the APP FW. This number plus - * BOOTLOADER_RESERVATION_SIZE will be deducted from - * BOARD_FLASH_SIZE to determine the size of the App FW - * and hence the address space of FLASH to erase and program. - * USBMFGSTRING "PX4 AP" - Optional USB MFG string (default is '3D Robotics' if not defined.) - * SERIAL_BREAK_DETECT_DISABLED - Optional prevent break selection on Serial port from entering or staying in BL - * - * * Other defines are somewhat self explanatory. - */ - -/* Boot device selection list*/ -#define USB0_DEV 0x01 -#define SERIAL0_DEV 0x02 -#define SERIAL1_DEV 0x04 - -#define APP_LOAD_ADDRESS 0x08020000 -#define BOOTLOADER_DELAY 5000 -#define INTERFACE_USB 1 -#define INTERFACE_USB_CONFIG "/dev/ttyACM0" -#define BOARD_VBUS MK_GPIO_INPUT(GPIO_OTGFS_VBUS) - -//#define USE_VBUS_PULL_DOWN -#define INTERFACE_USART 1 -#define INTERFACE_USART_CONFIG "/dev/ttyS0,115200" -#define BOOT_DELAY_ADDRESS 0x000001a0 -#define BOARD_TYPE 140 -#define _FLASH_KBYTES (*(uint32_t *)0x1FF1E880) -#define BOARD_FLASH_SECTORS (15) -#define BOARD_FLASH_SIZE (_FLASH_KBYTES * 1024) - -#define OSC_FREQ 24 - -#define BOARD_PIN_LED_ACTIVITY GPIO_nLED_AMBER -#define BOARD_PIN_LED_BOOTLOADER GPIO_nLED_AMBER -#define BOARD_LED_ON 0 -#define BOARD_LED_OFF 1 - -#define SERIAL_BREAK_DETECT_DISABLED 1 - -#if !defined(ARCH_SN_MAX_LENGTH) -# define ARCH_SN_MAX_LENGTH 12 -#endif - -#if !defined(APP_RESERVATION_SIZE) -# define APP_RESERVATION_SIZE 0 -#endif - -#if !defined(BOARD_FIRST_FLASH_SECTOR_TO_ERASE) -# define BOARD_FIRST_FLASH_SECTOR_TO_ERASE 1 -#endif - -#if !defined(USB_DATA_ALIGN) -# define USB_DATA_ALIGN -#endif - -#ifndef BOOT_DEVICES_SELECTION -# define BOOT_DEVICES_SELECTION USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif - -#ifndef BOOT_DEVICES_FILTER_ONUSB -# define BOOT_DEVICES_FILTER_ONUSB USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif diff --git a/boards/cubepilot/cubeorange/src/i2c.cpp b/boards/cubepilot/cubeorange/src/i2c.cpp deleted file mode 100644 index 5625423..0000000 --- a/boards/cubepilot/cubeorange/src/i2c.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(2), - initI2CBusExternal(1), -}; diff --git a/boards/cubepilot/cubeorange/src/init.c b/boards/cubepilot/cubeorange/src/init.c deleted file mode 100644 index f7e1b3c..0000000 --- a/boards/cubepilot/cubeorange/src/init.c +++ /dev/null @@ -1,199 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * board-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. - */ - -#include "board_config.h" - -#include - -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include - -#include - -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - /* Power off Interfaces */ - stm32_gpiowrite(GPIO_nVDD_5V_PERIPH_EN, true); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - stm32_gpiowrite(GPIO_nVDD_5V_PERIPH_EN, false); -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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 - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Power on Interfaces */ - stm32_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, true); - stm32_gpiowrite(GPIO_nVDD_5V_PERIPH_EN, false); - board_control_spi_sensors_power(true, 0xffff); - - px4_platform_init(); - - stm32_spiinitialize(); - - /* configure the DMA allocator */ - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - - /* initial LED state */ - drv_led_start(); - led_off(LED_AMBER); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_AMBER); - } - -#ifdef CONFIG_MMCSD - /* Mount the SDIO-based MMC/SD block driver */ - /* First, get an instance of the SDIO interface */ - struct sdio_dev_s *sdio_dev = sdio_initialize(0); // SDIO_SLOTNO 0 Only one slot - - if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", 0); - } - - if (mmcsd_slotinitialize(0, sdio_dev) != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver\n"); - } - - /* Assume that the SD card is inserted. What choice do we have? */ - sdio_mediachange(sdio_dev, true); -#endif /* CONFIG_MMCSD */ - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/cubepilot/cubeorange/src/led.c b/boards/cubepilot/cubeorange/src/led.c deleted file mode 100644 index f3c2546..0000000 --- a/boards/cubepilot/cubeorange/src/led.c +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -# define xlat(p) (p) -static uint32_t g_ledmap[] = { - GPIO_nLED_AMBER, -}; - -__EXPORT void led_init(void) -{ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - if (g_ledmap[l] != 0) { - stm32_configgpio(g_ledmap[l]); - } - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - if (g_ledmap[led] != 0) { - stm32_gpiowrite(g_ledmap[led], !state); - } -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - if (g_ledmap[led] != 0) { - return !stm32_gpioread(g_ledmap[led]); - } - - return false; -} - -__EXPORT void led_on(int led) -{ - phy_set_led(xlat(led), true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(xlat(led), false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(xlat(led), !phy_get_led(xlat(led))); -} diff --git a/boards/cubepilot/cubeorange/src/spi.cpp b/boards/cubepilot/cubeorange/src/spi.cpp deleted file mode 100644 index 54c59fe..0000000 --- a/boards/cubepilot/cubeorange/src/spi.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20649, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), // MPU_CS, MPU_DRDY - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortD, GPIO::Pin7}), // BARO_CS - }), - - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10}) // FRAM_CS - }), - - initSPIBus(SPI::Bus::SPI4, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20948, SPI::CS{GPIO::PortE, GPIO::Pin4}), // MPU_EXT_CS - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortC, GPIO::Pin13}), // GYRO_EXT_CS - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortC, GPIO::Pin14}), // BARO_EXT_CS - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/cubepilot/cubeorange/src/timer_config.cpp b/boards/cubepilot/cubeorange/src/timer_config.cpp deleted file mode 100644 index 293a74d..0000000 --- a/boards/cubepilot/cubeorange/src/timer_config.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1, DMA{DMA::Index1}), - initIOTimer(Timer::Timer4, DMA{DMA::Index1}), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortE, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/cubepilot/cubeorange/src/usb.c b/boards/cubepilot/cubeorange/src/usb.c deleted file mode 100644 index fae2e76..0000000 --- a/boards/cubepilot/cubeorange/src/usb.c +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -#include "board_config.h" -#include -#include -#include -#include -#include - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/cubepilot/cubeorange/test.px4board b/boards/cubepilot/cubeorange/test.px4board deleted file mode 100644 index f59326f..0000000 --- a/boards/cubepilot/cubeorange/test.px4board +++ /dev/null @@ -1,11 +0,0 @@ -CONFIG_DRIVERS_ADC_ADS1115=n -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=n -CONFIG_DRIVERS_IRLOCK=n -CONFIG_DRIVERS_PCA9685_PWM_OUT=n -CONFIG_DRIVERS_UAVCAN=n -CONFIG_MODULES_TEMPERATURE_COMPENSATION=n -CONFIG_BOARD_TESTING=y -CONFIG_DRIVERS_TEST_PPM=y -CONFIG_SYSTEMCMDS_MICROBENCH=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y diff --git a/boards/cubepilot/cubeorangeplus/bootloader.px4board b/boards/cubepilot/cubeorangeplus/bootloader.px4board deleted file mode 100644 index 19b6e66..0000000 --- a/boards/cubepilot/cubeorangeplus/bootloader.px4board +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_ROMFSROOT="" diff --git a/boards/cubepilot/cubeorangeplus/default.px4board b/boards/cubepilot/cubeorangeplus/default.px4board deleted file mode 100644 index e9f6c2d..0000000 --- a/boards/cubepilot/cubeorangeplus/default.px4board +++ /dev/null @@ -1,92 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_IO="cubepilot_io-v2_default" -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS2" -CONFIG_BOARD_SERIAL_GPS2="/dev/ttyS5" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS0" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS1" -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_BAROMETER_MS5611=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20649=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM45686=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_PWM_INPUT=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_PX4IO=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_TRANSPONDER_SAGETECH_MXS=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BL_UPDATE=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/cubepilot/cubeorangeplus/extras/cubepilot_cubeorangeplus_bootloader.bin b/boards/cubepilot/cubeorangeplus/extras/cubepilot_cubeorangeplus_bootloader.bin deleted file mode 100755 index fef54cd..0000000 Binary files a/boards/cubepilot/cubeorangeplus/extras/cubepilot_cubeorangeplus_bootloader.bin and /dev/null differ diff --git a/boards/cubepilot/cubeorangeplus/extras/cubepilot_io-v2_default.bin b/boards/cubepilot/cubeorangeplus/extras/cubepilot_io-v2_default.bin deleted file mode 100755 index 3eab1b7..0000000 Binary files a/boards/cubepilot/cubeorangeplus/extras/cubepilot_io-v2_default.bin and /dev/null differ diff --git a/boards/cubepilot/cubeorangeplus/firmware.prototype b/boards/cubepilot/cubeorangeplus/firmware.prototype deleted file mode 100644 index 885422b..0000000 --- a/boards/cubepilot/cubeorangeplus/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 1063, - "magic": "PX4FWv1", - "description": "Firmware for the CubePilot CubeOrange+ board", - "image": "", - "build_time": 0, - "summary": "CubeOrange+", - "version": "0.1", - "image_size": 0, - "image_maxsize": 1966080, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/cubepilot/cubeorangeplus/init/rc.board_defaults b/boards/cubepilot/cubeorangeplus/init/rc.board_defaults deleted file mode 100644 index 8ae2ed4..0000000 --- a/boards/cubepilot/cubeorangeplus/init/rc.board_defaults +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 10.1 -param set-default BAT2_V_DIV 10.1 - -param set-default BAT1_A_PER_V 17 -param set-default BAT2_A_PER_V 17 - -# Disable IMU thermal control -param set-default SENS_EN_THERMAL 0 - -param set-default -s SENS_TEMP_ID 2621474 - -param set-default SYS_USE_IO 1 - -set IOFW "/etc/extras/cubepilot_io-v2_default.bin" diff --git a/boards/cubepilot/cubeorangeplus/init/rc.board_mavlink b/boards/cubepilot/cubeorangeplus/init/rc.board_mavlink deleted file mode 100644 index 1dd0666..0000000 --- a/boards/cubepilot/cubeorangeplus/init/rc.board_mavlink +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# -# Board specific MAVLink startup script. -#------------------------------------------------------------------------------ - -# Start ADS-B receiver mavlink connection if console not present -if [ ! -e /dev/console ] -then - mavlink start -d /dev/ttyS4 -b 57600 -m minimal -fi diff --git a/boards/cubepilot/cubeorangeplus/init/rc.board_sensors b/boards/cubepilot/cubeorangeplus/init/rc.board_sensors deleted file mode 100644 index 2b08f29..0000000 --- a/boards/cubepilot/cubeorangeplus/init/rc.board_sensors +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# -# Board specific sensors init -#------------------------------------------------------------------------------ -board_adc start - -# Variants -# 1. Isolated {ICM42688p, ICM20948(with mag)}, body-fixed {ICM20649} -# 2. Isolated {ICM42688p, ICM42688p}, body-fixed {ICM20649, ICM45686, AK09918} -# 3. Isolated {ICM42688p, ICM42688p}, body-fixed {ICM45686, AK09918} -# 4. Isolated {ICM45686, ICM45686}, body-fixed {ICM45686, AK09918} - -# SPI4 is isolated, SPI1 is body-fixed - -# SPI4, isolated -ms5611 -s -b 4 start - -if icm42688p -s -b 4 -R 10 -q start -c 15 -then - if ! icm20948 -s -b 4 -R 10 -M -q start - then - icm42688p -s -b 4 -R 6 start -c 13 - fi -else - icm45686 -s -b 4 -R 10 start -c 15 - icm45686 -s -b 4 -R 6 start -c 13 -fi - -# SPI1, body-fixed -if icm45686 -s -b 1 -R 3 -q start -then - # if we detected the ICM45686 we also ought to have an AK09918 - ak09916 start -I -R 13 -else - icm20649 -s -b 1 start - -fi - -ms5611 -s -b 1 start - diff --git a/boards/cubepilot/cubeorangeplus/nuttx-config/bootloader/defconfig b/boards/cubepilot/cubeorangeplus/nuttx-config/bootloader/defconfig deleted file mode 100644 index 15ca3bf..0000000 --- a/boards/cubepilot/cubeorangeplus/nuttx-config/bootloader/defconfig +++ /dev/null @@ -1,93 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_CONSOLE is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_SPI_EXCHANGE is not set -# CONFIG_STM32H7_SYSCFG is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/cubepilot/cubeorangeplus/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H747XI=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_INITTHREAD_PRIORITY=254 -CONFIG_BOARD_LATE_INITIALIZE=y -CONFIG_BOARD_LOOPSPERMSEC=79954 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x1058 -CONFIG_CDCACM_PRODUCTSTR="PX4 BL CubePilot CubeOrange+" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x2DAE -CONFIG_CDCACM_VENDORSTR="CubePilot" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_EXPERIMENTAL=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="bootloader_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SPI=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_PWR_DIRECT_SMPS_SUPPLY=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_USART3=y -CONFIG_SYSTEMTICK_HOOK=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGINT_CHAR=0x03 -CONFIG_TTY_SIGTSTP=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/cubepilot/cubeorangeplus/nuttx-config/include/board.h b/boards/cubepilot/cubeorangeplus/nuttx-config/include/board.h deleted file mode 100644 index 00a886d..0000000 --- a/boards/cubepilot/cubeorangeplus/nuttx-config/include/board.h +++ /dev/null @@ -1,270 +0,0 @@ -/************************************************************************************ - * nuttx-config/include/board.h - * - * Copyright (C) 2020 Gregory Nutt. All rights reserved. - * Authors: David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ -#pragma once - -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/* Clocking *************************************************************************/ -/* The board provides the following clock sources: - * - * X1: 24 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 16 MHz RC factory-trimmed internal oscillator - * HSE: 24 MHz crystal for HSE - */ -#define STM32_BOARD_XTAL 24000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL - -/* Main PLL Configuration. - * - * PLL source is HSE = 24,000,000 - * - * PLL_VCOx = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 1 <= PLLM <= 63 - * 4 <= PLLN <= 512 - * 150 MHz <= PLL_VCOL <= 420MHz - * 192 MHz <= PLL_VCOH <= 836MHz - * - * SYSCLK = PLL_VCO / PLLP - * CPUCLK = SYSCLK / D1CPRE - * Subject to - * - * PLLP1 = {2, 4, 6, 8, ..., 128} - * PLLP2,3 = {2, 3, 4, ..., 128} - * CPUCLK <= 480 MHz - */ - -/* PLL1, wide 4 - 8 MHz input, enable DIVP, DIVQ, DIVR - * - * PLL1_VCO = (24,000,000 / 3) * 100 = 800 MHz - * - * PLL1P = PLL1_VCO/2 = 800 MHz / 2 = 400 MHz - * PLL1Q = PLL1_VCO/8 = 800 MHz / 8 = 100 MHz - * PLL1R = PLL1_VCO/2 = 800 MHz / 2 = 400 MHz - */ -#define STM32_PLLCFG_PLL1CFG (RCC_PLLCFGR_PLL1VCOSEL_WIDE|RCC_PLLCFGR_PLL1RGE_4_8_MHZ|RCC_PLLCFGR_DIVP1EN|RCC_PLLCFGR_DIVQ1EN|RCC_PLLCFGR_DIVR1EN) -#define STM32_PLLCFG_PLL1M RCC_PLLCKSELR_DIVM1(3) -#define STM32_PLLCFG_PLL1N RCC_PLL1DIVR_N1(100) -#define STM32_PLLCFG_PLL1P RCC_PLL1DIVR_P1(2) -#define STM32_PLLCFG_PLL1Q RCC_PLL1DIVR_Q1(8) -#define STM32_PLLCFG_PLL1R RCC_PLL1DIVR_R1(2) - -#define STM32_VCO1_FREQUENCY ((STM32_HSE_FREQUENCY / 3) * 100) -#define STM32_PLL1P_FREQUENCY (STM32_VCO1_FREQUENCY / 2) -#define STM32_PLL1Q_FREQUENCY (STM32_VCO1_FREQUENCY / 8) -#define STM32_PLL1R_FREQUENCY (STM32_VCO1_FREQUENCY / 2) - -/* PLL2 */ -#define STM32_PLLCFG_PLL2CFG (RCC_PLLCFGR_PLL2VCOSEL_WIDE|RCC_PLLCFGR_PLL2RGE_4_8_MHZ|RCC_PLLCFGR_DIVP2EN|RCC_PLLCFGR_DIVQ2EN|RCC_PLLCFGR_DIVR2EN) -#define STM32_PLLCFG_PLL2M RCC_PLLCKSELR_DIVM2(2) -#define STM32_PLLCFG_PLL2N RCC_PLL2DIVR_N2(30) -#define STM32_PLLCFG_PLL2P RCC_PLL2DIVR_P2(4) -#define STM32_PLLCFG_PLL2Q RCC_PLL2DIVR_Q2(5) -#define STM32_PLLCFG_PLL2R RCC_PLL2DIVR_R2(1) - -#define STM32_VCO2_FREQUENCY ((STM32_HSE_FREQUENCY / 2) * 30) -#define STM32_PLL2P_FREQUENCY (STM32_VCO2_FREQUENCY / 4) -#define STM32_PLL2Q_FREQUENCY (STM32_VCO2_FREQUENCY / 5) -#define STM32_PLL2R_FREQUENCY (STM32_VCO2_FREQUENCY / 1) - -/* PLL3 */ -#define STM32_PLLCFG_PLL3CFG (RCC_PLLCFGR_PLL3VCOSEL_WIDE|RCC_PLLCFGR_PLL3RGE_4_8_MHZ|RCC_PLLCFGR_DIVQ3EN) -#define STM32_PLLCFG_PLL3M RCC_PLLCKSELR_DIVM3(6) -#define STM32_PLLCFG_PLL3N RCC_PLL3DIVR_N3(72) -#define STM32_PLLCFG_PLL3P RCC_PLL3DIVR_P3(3) -#define STM32_PLLCFG_PLL3Q RCC_PLL3DIVR_Q3(6) -#define STM32_PLLCFG_PLL3R RCC_PLL3DIVR_R3(9) - -#define STM32_VCO3_FREQUENCY ((STM32_HSE_FREQUENCY / 6) * 72) -#define STM32_PLL3P_FREQUENCY (STM32_VCO3_FREQUENCY / 3) -#define STM32_PLL3Q_FREQUENCY (STM32_VCO3_FREQUENCY / 6) -#define STM32_PLL3R_FREQUENCY (STM32_VCO3_FREQUENCY / 9) - -/* SYSCLK = PLL1P = 400MHz - * CPUCLK = SYSCLK / 1 = 400 MHz - */ -#define STM32_RCC_D1CFGR_D1CPRE (RCC_D1CFGR_D1CPRE_SYSCLK) -#define STM32_SYSCLK_FREQUENCY (STM32_PLL1P_FREQUENCY) -#define STM32_CPUCLK_FREQUENCY (STM32_SYSCLK_FREQUENCY / 1) - -/* Configure Clock Assignments */ - -/* AHB clock (HCLK) is SYSCLK/2 (240 MHz max) - * HCLK1 = HCLK2 = HCLK3 = HCLK4 = 200 - */ -#define STM32_RCC_D1CFGR_HPRE RCC_D1CFGR_HPRE_SYSCLKd2 /* HCLK = SYSCLK / 2 */ -#define STM32_ACLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* ACLK in D1, HCLK3 in D1 */ -#define STM32_HCLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* HCLK in D2, HCLK4 in D3 */ -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (120 MHz) */ -#define STM32_RCC_D2CFGR_D2PPRE1 RCC_D2CFGR_D2PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB2 clock (PCLK2) is HCLK/2 (120 MHz) */ -#define STM32_RCC_D2CFGR_D2PPRE2 RCC_D2CFGR_D2PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB3 clock (PCLK3) is HCLK/2 (120 MHz) */ -#define STM32_RCC_D1CFGR_D1PPRE RCC_D1CFGR_D1PPRE_HCLKd2 /* PCLK3 = HCLK / 2 */ -#define STM32_PCLK3_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB4 clock (PCLK4) is HCLK/4 (120 MHz) */ -#define STM32_RCC_D3CFGR_D3PPRE RCC_D3CFGR_D3PPRE_HCLKd2 /* PCLK4 = HCLK / 2 */ -#define STM32_PCLK4_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timer clock frequencies */ - -/* Timers driven from APB1 will be twice PCLK1 */ -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* Timers driven from APB2 will be twice PCLK2 */ -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM15_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM16_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM17_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Kernel Clock Configuration - * Note: look at Table 54 in ST Manual - */ -#define STM32_RCC_D1CCIPR_SDMMCSEL RCC_D1CCIPR_SDMMC_PLL1 - -#define STM32_RCC_D2CCIP2R_I2C123SRC RCC_D2CCIP2R_I2C123SEL_HSI /* I2C123 clock source */ -#define STM32_RCC_D3CCIPR_I2C4SRC RCC_D3CCIPR_I2C4SEL_HSI -#define STM32_RCC_D2CCIP1R_SPI123SRC RCC_D2CCIP1R_SPI123SEL_PLL2 /* SPI123 clock source */ -#define STM32_RCC_D2CCIP1R_SPI45SRC RCC_D2CCIP1R_SPI45SEL_PLL2 /* SPI45 clock source */ -#define STM32_RCC_D2CCIP2R_USBSRC RCC_D2CCIP2R_USBSEL_PLL3 /* USB 1 and 2 clock source */ -#define STM32_RCC_D2CCIP1R_FDCANSEL RCC_D2CCIP1R_FDCANSEL_HSE /* FDCAN 1 2 clock source */ - -#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2 /* ADC 1 2 3 clock source */ - -/* FLASH wait states */ -#define BOARD_FLASH_WAITSTATES 2 - -/* SDMMC definitions ********************************************************/ -/* Init 400kHz, freq = PLL1Q/(2*div) div = PLL1Q/(2*freq) */ -#define STM32_SDMMC_INIT_CLKDIV (125 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* 25 MHz Max for now, 25 mHZ = PLL1Q/(2*div), div = PLL1Q/(2*freq) - * div = 100 / (2*25) - */ -#define STM32_SDMMC_MMCXFR_CLKDIV (2 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#define STM32_SDMMC_SDXFR_CLKDIV (2 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - - -/* UART/USART */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ -#define GPIO_USART2_RX GPIO_USART2_RX_2 /* PD6 */ -#define GPIO_USART2_CTS GPIO_USART2_CTS_NSS_2 /* PD3 */ -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 /* PD4 */ - -#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ -#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ -#define GPIO_USART3_CTS GPIO_USART3_CTS_NSS_2 /* PD11 */ -#define GPIO_USART3_RTS GPIO_USART3_RTS_2 /* PD12 */ - -#define GPIO_UART4_TX GPIO_UART4_TX_2 /* PA0 */ -#define GPIO_UART4_RX GPIO_UART4_RX_2 /* PA1 */ - -#define GPIO_USART6_TX GPIO_USART6_TX_1 /* PC6 */ -#define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC7 */ - -#define GPIO_UART7_TX GPIO_UART7_TX_3 /* PE8 */ -#define GPIO_UART7_RX GPIO_UART7_RX_3 /* PE7 */ - -#define GPIO_UART8_TX GPIO_UART8_TX_1 /* PE1 */ -#define GPIO_UART8_RX GPIO_UART8_RX_1 /* PE0 */ - - -/* CAN */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 /* PD0 */ -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 /* PD1 */ - -#define GPIO_CAN2_RX GPIO_CAN2_RX_1 /* PB12 */ -#define GPIO_CAN2_TX GPIO_CAN2_TX_2 /* PB6 */ - - -/* SPI */ -#define ADJ_SLEW_RATE(p) (((p) & ~GPIO_SPEED_MASK) | (GPIO_SPEED_2MHz)) - -#define GPIO_SPI1_SCK ADJ_SLEW_RATE(GPIO_SPI1_SCK_1) /* PA5 */ -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 /* PA7 */ - -#define GPIO_SPI2_SCK ADJ_SLEW_RATE(GPIO_SPI2_SCK_4) /* PB13 */ -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 /* PB14 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 /* PB15 */ - -#define GPIO_SPI4_SCK ADJ_SLEW_RATE(GPIO_SPI4_SCK_2) /* PE2 */ -#define GPIO_SPI4_MISO GPIO_SPI4_MISO_2 /* PE5 */ -#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_2 /* PE6 */ - - -/* I2C */ -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 /* PB8 */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 /* PB9 */ - -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_1 /* PB10 */ -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_1 /* PB11 */ - -#define GPIO_I2C4_SCL GPIO_I2C4_SCL_2 /* PF14 */ -#define GPIO_I2C4_SDA GPIO_I2C4_SDA_2 /* PF15 */ diff --git a/boards/cubepilot/cubeorangeplus/nuttx-config/include/board_dma_map.h b/boards/cubepilot/cubeorangeplus/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 050ae59..0000000 --- a/boards/cubepilot/cubeorangeplus/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -// DMAMUX1 -#define DMAMAP_SPI1_RX DMAMAP_DMA12_SPI1RX_0 /* DMA1:37 */ -#define DMAMAP_SPI1_TX DMAMAP_DMA12_SPI1TX_0 /* DMA1:38 */ - -#define DMAMAP_USART6_RX DMAMAP_DMA12_USART6RX_1 /* DMA1:71 */ -#define DMAMAP_USART6_TX DMAMAP_DMA12_USART6TX_1 /* DMA1:72 */ - -#define DMAMAP_SPI4_RX DMAMAP_DMA12_SPI4RX_0 /* DMA1:83 */ -#define DMAMAP_SPI4_TX DMAMAP_DMA12_SPI4TX_0 /* DMA1:84 */ diff --git a/boards/cubepilot/cubeorangeplus/nuttx-config/nsh/defconfig b/boards/cubepilot/cubeorangeplus/nuttx-config/nsh/defconfig deleted file mode 100644 index 7bab0a3..0000000 --- a/boards/cubepilot/cubeorangeplus/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,257 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_CONSOLE is not set -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/cubepilot/cubeorangeplus/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H747XI=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=79954 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x1058 -CONFIG_CDCACM_PRODUCTSTR="CubeOrange+" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x2DAE -CONFIG_CDCACM_VENDORSTR="CubePilot" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXPERIMENTAL=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=4 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_PROGMEM=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32H7_ADC1=y -CONFIG_STM32H7_ADC3=y -CONFIG_STM32H7_BBSRAM=y -CONFIG_STM32H7_BBSRAM_FILES=5 -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_DMA2=y -CONFIG_STM32H7_DMACAPABLE=y -CONFIG_STM32H7_FLOWCONTROL_BROKEN=y -CONFIG_STM32H7_I2C1=y -CONFIG_STM32H7_I2C2=y -CONFIG_STM32H7_I2C4=y -CONFIG_STM32H7_I2C_DYNTIMEO=y -CONFIG_STM32H7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_PWR_DIRECT_SMPS_SUPPLY=y -CONFIG_STM32H7_RTC=y -CONFIG_STM32H7_RTC_HSECLOCK=y -CONFIG_STM32H7_RTC_MAGIC_REG=1 -CONFIG_STM32H7_SAVE_CRASHDUMP=y -CONFIG_STM32H7_SDMMC1=y -CONFIG_STM32H7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_SPI1=y -CONFIG_STM32H7_SPI1_DMA=y -CONFIG_STM32H7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32H7_SPI2=y -CONFIG_STM32H7_SPI4=y -CONFIG_STM32H7_SPI4_DMA=y -CONFIG_STM32H7_SPI4_DMA_BUFFER=1024 -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_TIM3=y -CONFIG_STM32H7_TIM4=y -CONFIG_STM32H7_UART4=y -CONFIG_STM32H7_UART7=y -CONFIG_STM32H7_UART8=y -CONFIG_STM32H7_USART2=y -CONFIG_STM32H7_USART3=y -CONFIG_STM32H7_USART6=y -CONFIG_STM32H7_USART_BREAKS=y -CONFIG_STM32H7_USART_INVERT=y -CONFIG_STM32H7_USART_SINGLEWIRE=y -CONFIG_STM32H7_USART_SWAP=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGINT_CHAR=0x03 -CONFIG_TTY_SIGTSTP=y -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_TXBUFSIZE=3000 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 -CONFIG_WATCHDOG=y diff --git a/boards/cubepilot/cubeorangeplus/nuttx-config/scripts/bootloader_script.ld b/boards/cubepilot/cubeorangeplus/nuttx-config/scripts/bootloader_script.ld deleted file mode 100644 index 4a255ad..0000000 --- a/boards/cubepilot/cubeorangeplus/nuttx-config/scripts/bootloader_script.ld +++ /dev/null @@ -1,223 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2020 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The board uses an STM32H757ZI has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H757ZI, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * There's a switch on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the switch is - * drepresed, then the boot will be from 0x1FF0:0000 - * - * The STM32H757ZI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K - DTCM1 (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - DTCM2 (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */ - SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */ - SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */ - BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > AXI_SRAM AT > FLASH - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > AXI_SRAM - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } - - .ramfunc : { - _sramfuncs = .; - *(.ramfunc .ramfunc.*) - . = ALIGN(4); - _eramfuncs = .; - } > ITCM_RAM AT > FLASH - - _framfuncs = LOADADDR(.ramfunc); -} diff --git a/boards/cubepilot/cubeorangeplus/nuttx-config/scripts/script.ld b/boards/cubepilot/cubeorangeplus/nuttx-config/scripts/script.ld deleted file mode 100644 index f4aa39b..0000000 --- a/boards/cubepilot/cubeorangeplus/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,228 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2020 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The board uses an STM32H757ZI and has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H757ZI, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * There's a switch on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the switch is - * drepresed, then the boot will be from 0x1FF0:0000 - * - * The STM32H757ZI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - FLASH (rx) : ORIGIN = 0x08020000, LENGTH = 1920K - - DTCM1_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - DTCM2_RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */ - SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */ - SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */ - BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH - - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - - /* Pad out last section as the STM32H7 Flash write size is 256 bits. 32 bytes */ - . = ALIGN(16); - FILL(0xffff) - . += 16; - } > AXI_SRAM AT > FLASH = 0xffff - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > AXI_SRAM - - /* Emit the the D3 power domain section for locating BDMA data */ - - .sram4_reserve (NOLOAD) : - { - *(.sram4) - . = ALIGN(4); - _sram4_heap_start = ABSOLUTE(.); - } > SRAM4 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/cubepilot/cubeorangeplus/nuttx-config/test/defconfig b/boards/cubepilot/cubeorangeplus/nuttx-config/test/defconfig deleted file mode 100644 index ba34d8a..0000000 --- a/boards/cubepilot/cubeorangeplus/nuttx-config/test/defconfig +++ /dev/null @@ -1,260 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CMP is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/cubepilot/cubeorangeplus/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H747XI=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=79954 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x1058 -CONFIG_CDCACM_PRODUCTSTR="CubeOrange+" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x2DAE -CONFIG_CDCACM_VENDORSTR="CubePilot" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXAMPLES_CALIB_UDELAY=y -CONFIG_EXPERIMENTAL=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=4 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_PROGMEM=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32H7_ADC1=y -CONFIG_STM32H7_ADC3=y -CONFIG_STM32H7_BBSRAM=y -CONFIG_STM32H7_BBSRAM_FILES=5 -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_DMA2=y -CONFIG_STM32H7_DMACAPABLE=y -CONFIG_STM32H7_FLOWCONTROL_BROKEN=y -CONFIG_STM32H7_I2C1=y -CONFIG_STM32H7_I2C2=y -CONFIG_STM32H7_I2C4=y -CONFIG_STM32H7_I2C_DYNTIMEO=y -CONFIG_STM32H7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_PWR_DIRECT_SMPS_SUPPLY=y -CONFIG_STM32H7_RTC=y -CONFIG_STM32H7_RTC_HSECLOCK=y -CONFIG_STM32H7_RTC_MAGIC_REG=1 -CONFIG_STM32H7_SAVE_CRASHDUMP=y -CONFIG_STM32H7_SDMMC1=y -CONFIG_STM32H7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_SPI1=y -CONFIG_STM32H7_SPI1_DMA=y -CONFIG_STM32H7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32H7_SPI2=y -CONFIG_STM32H7_SPI4=y -CONFIG_STM32H7_SPI4_DMA=y -CONFIG_STM32H7_SPI4_DMA_BUFFER=1024 -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_TIM3=y -CONFIG_STM32H7_TIM4=y -CONFIG_STM32H7_UART4=y -CONFIG_STM32H7_UART7=y -CONFIG_STM32H7_UART8=y -CONFIG_STM32H7_USART2=y -CONFIG_STM32H7_USART3=y -CONFIG_STM32H7_USART6=y -CONFIG_STM32H7_USART_BREAKS=y -CONFIG_STM32H7_USART_INVERT=y -CONFIG_STM32H7_USART_SINGLEWIRE=y -CONFIG_STM32H7_USART_SWAP=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TESTING_OSTEST=y -CONFIG_TESTING_OSTEST_FPUTESTDISABLE=y -CONFIG_TESTING_OSTEST_STACKSIZE=10240 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGTSTP=y -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_TXBUFSIZE=3000 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 -CONFIG_WATCHDOG=y diff --git a/boards/cubepilot/cubeorangeplus/src/CMakeLists.txt b/boards/cubepilot/cubeorangeplus/src/CMakeLists.txt deleted file mode 100644 index c8e7699..0000000 --- a/boards/cubepilot/cubeorangeplus/src/CMakeLists.txt +++ /dev/null @@ -1,65 +0,0 @@ -############################################################################ -# -# Copyright (c) 2020 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. -# -############################################################################ -if("${PX4_BOARD_LABEL}" STREQUAL "bootloader") - add_library(drivers_board - bootloader_main.c - usb.c - ) - target_link_libraries(drivers_board - PRIVATE - nuttx_arch - nuttx_drivers - bootloader - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/bootloader/common) - -else() - add_library(drivers_board - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - usb.c - ) - - target_link_libraries(drivers_board - PRIVATE - arch_io_pins - arch_spi - drivers__led - nuttx_arch - nuttx_drivers - px4_layer - ) -endif() diff --git a/boards/cubepilot/cubeorangeplus/src/board_config.h b/boards/cubepilot/cubeorangeplus/src/board_config.h deleted file mode 100644 index 1646925..0000000 --- a/boards/cubepilot/cubeorangeplus/src/board_config.h +++ /dev/null @@ -1,202 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * Board internal definitions - */ - -#pragma once - -#include -#include -#include -#include - -/** - * If NuttX is built without support for SMPS it can brick the hardware. - * Therefore, we make sure the NuttX headers are correct. - */ -#include "hardware/stm32h7x3xx_pwr.h" -#if STM32_PWR_CR3_SMPSEXTHP != (1 << 3) -# error "No SMPS support in NuttX submodule"); -#endif - - -/* PX4IO connection configuration */ -#define BOARD_USES_PX4IO_VERSION 2 -#define PX4IO_SERIAL_DEVICE "/dev/ttyS3" -#define PX4IO_SERIAL_TX_GPIO GPIO_USART6_TX -#define PX4IO_SERIAL_RX_GPIO GPIO_USART6_RX -#define PX4IO_SERIAL_BASE STM32_USART6_BASE -#define PX4IO_SERIAL_VECTOR STM32_IRQ_USART6 -#define PX4IO_SERIAL_TX_DMAMAP DMAMAP_USART6_TX -#define PX4IO_SERIAL_RX_DMAMAP DMAMAP_USART6_RX -#define PX4IO_SERIAL_RCC_REG STM32_RCC_APB2ENR -#define PX4IO_SERIAL_RCC_EN RCC_APB2ENR_USART6EN -#define PX4IO_SERIAL_CLOCK STM32_PCLK2_FREQUENCY -#define PX4IO_SERIAL_BITRATE 1500000 /* 1.5Mbps -> max rate for IO */ - -/* LEDs */ -#define GPIO_nLED_AMBER /* PE12 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN12) - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_ARMED_LED LED_AMBER - -/* ADC channels */ -#define PX4_ADC_GPIO \ - /* PA2 */ GPIO_ADC12_INP14, \ - /* PA3 */ GPIO_ADC12_INP15, \ - /* PA4 */ GPIO_ADC12_INP18, \ - /* PC3 */ GPIO_ADC12_INP13, \ - /* PC4 */ GPIO_ADC12_INP4, \ - /* PC5 */ GPIO_ADC12_INP8 - -/* Define Channel numbers must match above GPIO pins */ -#define ADC_BATTERY1_VOLTAGE_CHANNEL 14 /* PA2: BATT_VOLTAGE_SENS */ -#define ADC_BATTERY1_CURRENT_CHANNEL 15 /* PA3: BATT_CURRENT_SENS */ -#define ADC_SCALED_V5_CHANNEL 18 /* PA4: VDD_5V_SENS */ -#define ADC_BATTERY2_VOLTAGE_CHANNEL 13 /* PC3: FMU_AUX_POWER_ADC1 */ -#define ADC_BATTERY2_CURRENT_CHANNEL 4 /* PC4: FMU_AUX_ADC2 */ -#define ADC_AIRSPEED_VOLTAGE_CHANNEL 8 /* PC5: PRESSURE_SENS */ - -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY1_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY1_CURRENT_CHANNEL) | \ - (1 << ADC_SCALED_V5_CHANNEL) | \ - (1 << ADC_BATTERY2_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY2_CURRENT_CHANNEL) | \ - (1 << ADC_AIRSPEED_VOLTAGE_CHANNEL)) - -/* HW has to large of R termination on ADC todo:change when HW value is chosen */ -#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f) - -/* PWM */ -#define DIRECT_PWM_OUTPUT_CHANNELS 6 -#define GPIO_PWM_VOLT_SEL /* PB4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN4) - -/* Power supply control and monitoring GPIOs */ -#define BOARD_NUMBER_BRICKS 2 -#define GPIO_nVDD_BRICK1_VALID /* PB5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5) // VDD_BRICK_VALID -#define GPIO_nVDD_BRICK2_VALID /* PB7 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN7) // VDD_BACKUP_VALID -#define GPIO_nVDD_USB_VALID /* PC0 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN0) // VBUS_VALID -#define GPIO_VDD_3V3_SENSORS_EN /* PE3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN3) // VDD_3V3_SENSORS_EN -#define GPIO_nVDD_5V_PERIPH_EN /* PA8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN8) // VDD_5V_PERIPH_EN -#define GPIO_nVDD_5V_PERIPH_OC /* PE15 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN15) // VDD_5V_PERIPH_OC -#define GPIO_nVDD_5V_HIPOWER_OC /* PE10 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN10) // VDD_5V_HIPOWER_OC - -/* Tone alarm output */ -#define TONE_ALARM_TIMER 2 /* timer 2 */ -#define TONE_ALARM_CHANNEL 1 /* PA15 TIM2_CH1 */ - -#define GPIO_BUZZER_1 /* PA15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) // ALARM - -#define GPIO_TONE_ALARM_IDLE GPIO_BUZZER_1 -#define GPIO_TONE_ALARM GPIO_TIM2_CH1OUT_2 - -/* PWM input driver. Use FMU AUX5 pins attached to timer4 channel 2 */ -#define PWMIN_TIMER 4 -#define PWMIN_TIMER_CHANNEL /* T4C2 */ 2 -#define GPIO_PWM_IN /* PD13 */ GPIO_TIM4_CH2IN_2 - -/* USB - * OTG FS: PA9 OTG_FS_VBUS VBUS sensing - */ -#define GPIO_OTGFS_VBUS /* PA9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 8 /* use timer8 for the HRT */ -#define HRT_TIMER_CHANNEL 3 /* use capture/compare channel 3 */ - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID)) -#define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -#define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID)) -#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_nVDD_5V_PERIPH_OC)) -#define BOARD_ADC_HIPOWER_5V_OC (!px4_arch_gpioread(GPIO_nVDD_5V_HIPOWER_OC)) - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ -#define BOARD_HAS_ON_RESET 1 - -#define BOARD_HAS_STATIC_MANIFEST 1 - - - -#define BOARD_ENABLE_CONSOLE_BUFFER - -#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, \ - GPIO_nVDD_USB_VALID, \ - GPIO_VDD_3V3_SENSORS_EN, \ - GPIO_nVDD_5V_PERIPH_EN, \ - GPIO_nVDD_5V_PERIPH_OC, \ - GPIO_nVDD_5V_HIPOWER_OC, \ - 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_I2C4_SCL), \ - PX4_MAKE_GPIO_OUTPUT_CLEAR(GPIO_I2C4_SDA), \ - PX4_GPIO_PIN_OFF(GPIO_SDMMC1_D0), \ - PX4_GPIO_PIN_OFF(GPIO_SDMMC1_D1), \ - PX4_GPIO_PIN_OFF(GPIO_SDMMC1_D2), \ - PX4_GPIO_PIN_OFF(GPIO_SDMMC1_D3), \ - PX4_GPIO_PIN_OFF(GPIO_SDMMC1_CMD),\ - GPIO_TONE_ALARM_IDLE, \ - GPIO_OTGFS_VBUS, \ - } - -__BEGIN_DECLS -#ifndef __ASSEMBLY__ - -extern void stm32_spiinitialize(void); -extern void board_peripheral_reset(int ms); - -#include -#endif /* __ASSEMBLY__ */ -__END_DECLS diff --git a/boards/cubepilot/cubeorangeplus/src/bootloader_main.c b/boards/cubepilot/cubeorangeplus/src/bootloader_main.c deleted file mode 100644 index bb6b4dc..0000000 --- a/boards/cubepilot/cubeorangeplus/src/bootloader_main.c +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020, 2021 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. - * - ****************************************************************************/ - -/** - * @file bootloader_main.c - * - * FMU-specific early startup code for bootloader -*/ - -#include "board_config.h" -#include "bl.h" - -#include -#include -#include -#include -#include -#include "arm_internal.h" -#include - -extern int sercon_main(int c, char **argv); - -__EXPORT void board_on_reset(int status) {} - -__EXPORT void stm32_boardinitialize(void) -{ - /* configure USB interfaces */ - stm32_configgpio(GPIO_OTGFS_VBUS); -} - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - return 0; -} - -void board_late_initialize(void) -{ - sercon_main(0, NULL); -} - -extern void sys_tick_handler(void); -void board_timerhook(void) -{ - sys_tick_handler(); -} diff --git a/boards/cubepilot/cubeorangeplus/src/hw_config.h b/boards/cubepilot/cubeorangeplus/src/hw_config.h deleted file mode 100644 index dbe6581..0000000 --- a/boards/cubepilot/cubeorangeplus/src/hw_config.h +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/**************************************************************************** - * 10-8--2016: - * To simplify the ripple effect on the tools, we will be using - * /dev/serial/by-id/PX4 to locate PX4 devices. Therefore - * moving forward all Bootloaders must contain the prefix "PX4 BL " - * in the USBDEVICESTRING - * This Change will be made in an upcoming BL release - ****************************************************************************/ -/* - * Define usage to configure a bootloader - * - * - * Constant example Usage - * APP_LOAD_ADDRESS 0x08004000 - The address in Linker Script, where the app fw is org-ed - * BOOTLOADER_DELAY 5000 - Ms to wait while under USB pwr or bootloader request - * BOARD_FMUV2 - * INTERFACE_USB 1 - (Optional) Scan and use the USB interface for bootloading - * INTERFACE_USART 1 - (Optional) Scan and use the Serial interface for bootloading - * USBDEVICESTRING "PX4 BL FMU v2.x" - USB id string - * USBPRODUCTID 0x0011 - PID Should match defconfig - * BOOT_DELAY_ADDRESS 0x000001a0 - (Optional) From the linker script from Linker Script to get a custom - * delay provided by an APP FW - * BOARD_TYPE 9 - Must match .prototype boad_id - * _FLASH_KBYTES (*(uint16_t *)0x1fff7a22) - Run time flash size detection - * BOARD_FLASH_SECTORS ((_FLASH_KBYTES == 0x400) ? 11 : 23) - Run time determine the physical last sector - * BOARD_FLASH_SECTORS 11 - Hard coded zero based last sector - * BOARD_FLASH_SIZE (_FLASH_KBYTES*1024)- Total Flash size of device, determined at run time. - * (1024 * 1024) - Hard coded Total Flash of device - The bootloader and app reserved will be deducted - * programmatically - * - * BOARD_FIRST_FLASH_SECTOR_TO_ERASE 2 - Optional sectors index in the flash_sectors table (F4 only), to begin erasing. - * This is to allow sectors to be reserved for app fw usage. That will NOT be erased - * during a FW upgrade. - * The default is 0, and selects the first sector to be erased, as the 0th entry in the - * flash_sectors table. Which is the second physical sector of FLASH in the device. - * The first physical sector of FLASH is used by the bootloader, and is not defined - * in the table. - * - * APP_RESERVATION_SIZE (BOARD_FIRST_FLASH_SECTOR_TO_ERASE * 16 * 1024) - Number of bytes reserved by the APP FW. This number plus - * BOOTLOADER_RESERVATION_SIZE will be deducted from - * BOARD_FLASH_SIZE to determine the size of the App FW - * and hence the address space of FLASH to erase and program. - * USBMFGSTRING "PX4 AP" - Optional USB MFG string (default is '3D Robotics' if not defined.) - * SERIAL_BREAK_DETECT_DISABLED - Optional prevent break selection on Serial port from entering or staying in BL - * - * * Other defines are somewhat self explanatory. - */ - -/* Boot device selection list*/ -#define USB0_DEV 0x01 -#define SERIAL0_DEV 0x02 -#define SERIAL1_DEV 0x04 - -#define APP_LOAD_ADDRESS 0x08020000 -#define BOOTLOADER_DELAY 5000 -#define INTERFACE_USB 1 -#define INTERFACE_USB_CONFIG "/dev/ttyACM0" -#define BOARD_VBUS MK_GPIO_INPUT(GPIO_OTGFS_VBUS) - -//#define USE_VBUS_PULL_DOWN -#define INTERFACE_USART 1 -#define INTERFACE_USART_CONFIG "/dev/ttyS0,115200" -#define BOOT_DELAY_ADDRESS 0x000001a0 -#define BOARD_TYPE 1063 -#define _FLASH_KBYTES (*(uint32_t *)0x1FF1E880) -#define BOARD_FLASH_SECTORS (15) -#define BOARD_FLASH_SIZE (_FLASH_KBYTES * 1024) - -#define OSC_FREQ 24 - -#define BOARD_PIN_LED_ACTIVITY GPIO_nLED_AMBER -#define BOARD_PIN_LED_BOOTLOADER GPIO_nLED_AMBER -#define BOARD_LED_ON 0 -#define BOARD_LED_OFF 1 - -#define SERIAL_BREAK_DETECT_DISABLED 1 - -#if !defined(ARCH_SN_MAX_LENGTH) -# define ARCH_SN_MAX_LENGTH 12 -#endif - -#if !defined(APP_RESERVATION_SIZE) -# define APP_RESERVATION_SIZE 0 -#endif - -#if !defined(BOARD_FIRST_FLASH_SECTOR_TO_ERASE) -# define BOARD_FIRST_FLASH_SECTOR_TO_ERASE 1 -#endif - -#if !defined(USB_DATA_ALIGN) -# define USB_DATA_ALIGN -#endif - -#ifndef BOOT_DEVICES_SELECTION -# define BOOT_DEVICES_SELECTION USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif - -#ifndef BOOT_DEVICES_FILTER_ONUSB -# define BOOT_DEVICES_FILTER_ONUSB USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif diff --git a/boards/cubepilot/cubeorangeplus/src/i2c.cpp b/boards/cubepilot/cubeorangeplus/src/i2c.cpp deleted file mode 100644 index 9fcdb91..0000000 --- a/boards/cubepilot/cubeorangeplus/src/i2c.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(2), - initI2CBusExternal(1), - initI2CBusInternal(4), -}; diff --git a/boards/cubepilot/cubeorangeplus/src/init.c b/boards/cubepilot/cubeorangeplus/src/init.c deleted file mode 100644 index f7e1b3c..0000000 --- a/boards/cubepilot/cubeorangeplus/src/init.c +++ /dev/null @@ -1,199 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * board-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. - */ - -#include "board_config.h" - -#include - -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include - -#include - -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - /* Power off Interfaces */ - stm32_gpiowrite(GPIO_nVDD_5V_PERIPH_EN, true); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - stm32_gpiowrite(GPIO_nVDD_5V_PERIPH_EN, false); -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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 - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Power on Interfaces */ - stm32_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, true); - stm32_gpiowrite(GPIO_nVDD_5V_PERIPH_EN, false); - board_control_spi_sensors_power(true, 0xffff); - - px4_platform_init(); - - stm32_spiinitialize(); - - /* configure the DMA allocator */ - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - - /* initial LED state */ - drv_led_start(); - led_off(LED_AMBER); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_AMBER); - } - -#ifdef CONFIG_MMCSD - /* Mount the SDIO-based MMC/SD block driver */ - /* First, get an instance of the SDIO interface */ - struct sdio_dev_s *sdio_dev = sdio_initialize(0); // SDIO_SLOTNO 0 Only one slot - - if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", 0); - } - - if (mmcsd_slotinitialize(0, sdio_dev) != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver\n"); - } - - /* Assume that the SD card is inserted. What choice do we have? */ - sdio_mediachange(sdio_dev, true); -#endif /* CONFIG_MMCSD */ - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/cubepilot/cubeorangeplus/src/led.c b/boards/cubepilot/cubeorangeplus/src/led.c deleted file mode 100644 index f3c2546..0000000 --- a/boards/cubepilot/cubeorangeplus/src/led.c +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -# define xlat(p) (p) -static uint32_t g_ledmap[] = { - GPIO_nLED_AMBER, -}; - -__EXPORT void led_init(void) -{ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - if (g_ledmap[l] != 0) { - stm32_configgpio(g_ledmap[l]); - } - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - if (g_ledmap[led] != 0) { - stm32_gpiowrite(g_ledmap[led], !state); - } -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - if (g_ledmap[led] != 0) { - return !stm32_gpioread(g_ledmap[led]); - } - - return false; -} - -__EXPORT void led_on(int led) -{ - phy_set_led(xlat(led), true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(xlat(led), false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(xlat(led), !phy_get_led(xlat(led))); -} diff --git a/boards/cubepilot/cubeorangeplus/src/spi.cpp b/boards/cubepilot/cubeorangeplus/src/spi.cpp deleted file mode 100644 index b14c9c6..0000000 --- a/boards/cubepilot/cubeorangeplus/src/spi.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20649, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), // MPU_CS, MPU_DRDY - initSPIDevice(DRV_IMU_DEVTYPE_ICM45686, SPI::CS{GPIO::PortG, GPIO::Pin1}), // ICM45686_CS - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortD, GPIO::Pin7}), // BARO_CS - }), - - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10}) // FRAM_CS - }), - - initSPIBus(SPI::Bus::SPI4, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20948, SPI::CS{GPIO::PortE, GPIO::Pin4}), // MPU_EXT_CS - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortC, GPIO::Pin15}), // ACCEL_EXT_CS - initSPIDevice(DRV_IMU_DEVTYPE_ICM45686, SPI::CS{GPIO::PortC, GPIO::Pin15}), // ACCEL_EXT_CS - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortC, GPIO::Pin13}), // GYRO_EXT_CS - initSPIDevice(DRV_IMU_DEVTYPE_ICM45686, SPI::CS{GPIO::PortC, GPIO::Pin13}), // GYRO_EXT_CS - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortC, GPIO::Pin14}), // BARO_EXT_CS - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/cubepilot/cubeorangeplus/src/timer_config.cpp b/boards/cubepilot/cubeorangeplus/src/timer_config.cpp deleted file mode 100644 index 293a74d..0000000 --- a/boards/cubepilot/cubeorangeplus/src/timer_config.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1, DMA{DMA::Index1}), - initIOTimer(Timer::Timer4, DMA{DMA::Index1}), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortE, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/cubepilot/cubeorangeplus/src/usb.c b/boards/cubepilot/cubeorangeplus/src/usb.c deleted file mode 100644 index fae2e76..0000000 --- a/boards/cubepilot/cubeorangeplus/src/usb.c +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -#include "board_config.h" -#include -#include -#include -#include -#include - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/cubepilot/cubeorangeplus/test.px4board b/boards/cubepilot/cubeorangeplus/test.px4board deleted file mode 100644 index f46378f..0000000 --- a/boards/cubepilot/cubeorangeplus/test.px4board +++ /dev/null @@ -1,10 +0,0 @@ -CONFIG_DRIVERS_ADC_ADS1115=n -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=n -CONFIG_DRIVERS_IRLOCK=n -CONFIG_DRIVERS_PCA9685_PWM_OUT=n -CONFIG_DRIVERS_UAVCAN=n -CONFIG_MODULES_TEMPERATURE_COMPENSATION=n -CONFIG_BOARD_TESTING=y -CONFIG_DRIVERS_TEST_PPM=y -CONFIG_SYSTEMCMDS_MICROBENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y diff --git a/boards/cubepilot/cubeyellow/default.px4board b/boards/cubepilot/cubeyellow/default.px4board deleted file mode 100644 index 45cf93a..0000000 --- a/boards/cubepilot/cubeyellow/default.px4board +++ /dev/null @@ -1,101 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_IO="cubepilot_io-v2_default" -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS2" -CONFIG_BOARD_SERIAL_GPS2="/dev/ttyS5" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS0" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL3="/dev/ttyS4" -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_COMMON_BAROMETERS=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20649=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_PX4IO=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UUV_ATT_CONTROL=y -CONFIG_MODULES_UUV_POS_CONTROL=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BL_UPDATE=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_FAKE_GPS=y diff --git a/boards/cubepilot/cubeyellow/extras/cubepilot_io-v2_default.bin b/boards/cubepilot/cubeyellow/extras/cubepilot_io-v2_default.bin deleted file mode 100755 index 4d29f3a..0000000 Binary files a/boards/cubepilot/cubeyellow/extras/cubepilot_io-v2_default.bin and /dev/null differ diff --git a/boards/cubepilot/cubeyellow/firmware.prototype b/boards/cubepilot/cubeyellow/firmware.prototype deleted file mode 100644 index 90adbdd..0000000 --- a/boards/cubepilot/cubeyellow/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 120, - "magic": "PX4FWv1", - "description": "Firmware for the CubePilot CubeYellow board", - "image": "", - "build_time": 0, - "summary": "CubeYellow", - "version": "0.1", - "image_size": 0, - "image_maxsize": 2064384, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/cubepilot/cubeyellow/init/rc.board_defaults b/boards/cubepilot/cubeyellow/init/rc.board_defaults deleted file mode 100644 index 54705e6..0000000 --- a/boards/cubepilot/cubeyellow/init/rc.board_defaults +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - - -param set-default BAT1_V_DIV 10.1 -param set-default BAT2_V_DIV 10.1 - -param set-default BAT1_A_PER_V 17 -param set-default BAT2_A_PER_V 17 - -# Disable IMU thermal control -param set-default SENS_EN_THERMAL 0 - -param set-default SYS_USE_IO 1 - -set IOFW "/etc/extras/cubepilot_io-v2_default.bin" diff --git a/boards/cubepilot/cubeyellow/init/rc.board_sensors b/boards/cubepilot/cubeyellow/init/rc.board_sensors deleted file mode 100644 index e84edf7..0000000 --- a/boards/cubepilot/cubeyellow/init/rc.board_sensors +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# Board specific sensors init -#------------------------------------------------------------------------------ -board_adc start - -# SPI4 -ms5611 -s -b 4 start -icm20602 -s -b 4 -R 12 start -icm20948 -s -b 4 -R 10 -M start - -# SPI1 -ms5611 -s -b 1 start -icm20649 -s -b 1 start - diff --git a/boards/cubepilot/cubeyellow/nuttx-config/include/board.h b/boards/cubepilot/cubeyellow/nuttx-config/include/board.h deleted file mode 100644 index c6e6abd..0000000 --- a/boards/cubepilot/cubeyellow/nuttx-config/include/board.h +++ /dev/null @@ -1,297 +0,0 @@ -/************************************************************************************ - * nuttx-config/include/board.h - * - * Copyright (C) 2020 Gregory Nutt. All rights reserved. - * Authors: David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ -#pragma once - -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/* Clocking *************************************************************************/ -/* The board provides the following clock sources: - * - * X1: 24 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 16 MHz RC factory-trimmed internal oscillator - * HSE: 24 MHz crystal for HSE - */ -#define STM32_BOARD_XTAL 24000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 32768 - -/* Main PLL Configuration. - * - * PLL source is HSE = 24,000,000 - * - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 2 <= PLLM <= 63 - * 192 <= PLLN <= 432 - * 192 MHz <= PLL_VCO <= 432MHz - * - * SYSCLK = PLL_VCO / PLLP - * Subject to - * - * PLLP = {2, 4, 6, 8} - * SYSCLK <= 216 MHz - * - * USB OTG FS, SDMMC and RNG Clock = PLL_VCO / PLLQ - * Subject to - * The USB OTG FS requires a 48 MHz clock to work correctly. The SDMMC - * and the random number generator need a frequency lower than or equal - * to 48 MHz to work correctly. - * - * 2 <= PLLQ <= 15 - */ - -/* Highest SYSCLK with USB OTG FS clock = 48 MHz - * - * PLL_VCO = (24,000,000 / 24) * 432 = 432 MHz - * SYSCLK = 432 MHz / 2 = 216 MHz - * USB OTG FS, SDMMC and RNG Clock = 432 MHz / 9 = 48 MHz - */ - -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(24) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(432) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(9) - -#define STM32_VCO_FREQUENCY ((STM32_HSE_FREQUENCY / 24) * 432) -#define STM32_SYSCLK_FREQUENCY (STM32_VCO_FREQUENCY / 2) -#define STM32_OTGFS_FREQUENCY (STM32_VCO_FREQUENCY / 9) - -/* Configure factors for PLLSAI clock */ -#define CONFIG_STM32F7_PLLSAI 1 -#define STM32_RCC_PLLSAICFGR_PLLSAIN RCC_PLLSAICFGR_PLLSAIN(192) -#define STM32_RCC_PLLSAICFGR_PLLSAIP RCC_PLLSAICFGR_PLLSAIP(8) -#define STM32_RCC_PLLSAICFGR_PLLSAIQ RCC_PLLSAICFGR_PLLSAIQ(4) -#define STM32_RCC_PLLSAICFGR_PLLSAIR RCC_PLLSAICFGR_PLLSAIR(2) - -/* Configure Dedicated Clock Configuration Register */ -#define STM32_RCC_DCKCFGR1_PLLI2SDIVQ RCC_DCKCFGR1_PLLI2SDIVQ(1) -#define STM32_RCC_DCKCFGR1_PLLSAIDIVQ RCC_DCKCFGR1_PLLSAIDIVQ(1) -#define STM32_RCC_DCKCFGR1_PLLSAIDIVR RCC_DCKCFGR1_PLLSAIDIVR(0) -#define STM32_RCC_DCKCFGR1_SAI1SRC RCC_DCKCFGR1_SAI1SEL(0) -#define STM32_RCC_DCKCFGR1_SAI2SRC RCC_DCKCFGR1_SAI2SEL(0) -#define STM32_RCC_DCKCFGR1_TIMPRESRC 0 -#define STM32_RCC_DCKCFGR1_DFSDM1SRC 0 -#define STM32_RCC_DCKCFGR1_ADFSDM1SRC 0 - -/* Configure factors for PLLI2S clock */ -#define CONFIG_STM32F7_PLLI2S 1 -#define STM32_RCC_PLLI2SCFGR_PLLI2SN RCC_PLLI2SCFGR_PLLI2SN(192) -#define STM32_RCC_PLLI2SCFGR_PLLI2SP RCC_PLLI2SCFGR_PLLI2SP(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SQ RCC_PLLI2SCFGR_PLLI2SQ(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SR RCC_PLLI2SCFGR_PLLI2SR(2) - -/* Configure Dedicated Clock Configuration Register 2 */ -#define STM32_RCC_DCKCFGR2_USART1SRC RCC_DCKCFGR2_USART1SEL_APB -#define STM32_RCC_DCKCFGR2_USART2SRC RCC_DCKCFGR2_USART2SEL_APB -#define STM32_RCC_DCKCFGR2_UART4SRC RCC_DCKCFGR2_UART4SEL_APB -#define STM32_RCC_DCKCFGR2_UART5SRC RCC_DCKCFGR2_UART5SEL_APB -#define STM32_RCC_DCKCFGR2_USART6SRC RCC_DCKCFGR2_USART6SEL_APB -#define STM32_RCC_DCKCFGR2_UART7SRC RCC_DCKCFGR2_UART7SEL_APB -#define STM32_RCC_DCKCFGR2_UART8SRC RCC_DCKCFGR2_UART8SEL_APB -#define STM32_RCC_DCKCFGR2_I2C1SRC RCC_DCKCFGR2_I2C1SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C2SRC RCC_DCKCFGR2_I2C2SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C3SRC RCC_DCKCFGR2_I2C3SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C4SRC RCC_DCKCFGR2_I2C4SEL_HSI -#define STM32_RCC_DCKCFGR2_LPTIM1SRC RCC_DCKCFGR2_LPTIM1SEL_APB -#define STM32_RCC_DCKCFGR2_CECSRC RCC_DCKCFGR2_CECSEL_HSI -#define STM32_RCC_DCKCFGR2_CK48MSRC RCC_DCKCFGR2_CK48MSEL_PLL -#define STM32_RCC_DCKCFGR2_SDMMCSRC RCC_DCKCFGR2_SDMMCSEL_48MHZ -#define STM32_RCC_DCKCFGR2_SDMMC2SRC RCC_DCKCFGR2_SDMMC2SEL_48MHZ -#define STM32_RCC_DCKCFGR2_DSISRC RCC_DCKCFGR2_DSISEL_PHY - - -/* Several prescalers allow the configuration of the two AHB buses, the - * high-speed APB (APB2) and the low-speed APB (APB1) domains. The maximum - * frequency of the two AHB buses is 216 MHz while the maximum frequency of - * the high-speed APB domains is 108 MHz. The maximum allowed frequency of - * the low-speed APB domain is 54 MHz. - */ - -/* AHB clock (HCLK) is SYSCLK (216 MHz) */ -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (54 MHz) */ -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (108MHz) */ -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* SDMMC dividers. Note that slower clocking is required when DMA is disabled - * in order to avoid RX overrun/TX underrun errors due to delayed responses - * to service FIFOs in interrupt driven mode. These values have not been - * tuned!!! - * - * SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(118+2)=400 KHz - */ - -/* Use the Falling edge of the SDIO_CLK clock to change the edge the - * data and commands are change on - */ - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - -#define STM32_SDMMC_INIT_CLKDIV (118 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* DMA ON: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(1+2)=16 MHz - * DMA OFF: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32F7_SDMMC_DMA -# define STM32_SDMMC_MMCXFR_CLKDIV (1 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (2 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -/* DMA ON: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(1+2)=16 MHz - * DMA OFF: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(2+2)=12 MHz - */ -//TODO #warning "Check Freq for 24mHz" - -#ifdef CONFIG_STM32F7_SDMMC_DMA -# define STM32_SDMMC_SDXFR_CLKDIV (1 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (2 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -/* FLASH wait states - * - * --------- ---------- ----------- - * VDD MAX SYSCLK WAIT STATES - * --------- ---------- ----------- - * 1.7-2.1 V 180 MHz 8 - * 2.1-2.4 V 216 MHz 9 - * 2.4-2.7 V 216 MHz 8 - * 2.7-3.6 V 216 MHz 7 - * --------- ---------- ----------- - */ - -#define BOARD_FLASH_WAITSTATES 7 - - -/* UART/USART */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ -#define GPIO_USART2_RX GPIO_USART2_RX_2 /* PD6 */ -#define GPIO_USART2_CTS GPIO_USART2_CTS_2 /* PD3 */ -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 /* PD4 */ - -#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ -#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ -#define GPIO_USART3_CTS GPIO_USART3_CTS_2 /* PD11 */ -#define GPIO_USART3_RTS GPIO_USART3_RTS_2 /* PD12 */ - -#define GPIO_UART4_TX GPIO_UART4_TX_1 /* PA0 */ -#define GPIO_UART4_RX GPIO_UART4_RX_1 /* PA1 */ - -#define GPIO_USART6_TX GPIO_USART6_TX_1 /* PC6 */ -#define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC7 */ - -#define GPIO_UART7_TX GPIO_UART7_TX_1 /* PE8 */ -#define GPIO_UART7_RX GPIO_UART7_RX_1 /* PE7 */ - -/* USART8: has no remap - * - * GPIO_UART8_RX PE0[CN12-64] - * GPIO_UART8_TX PE1[CN11-61] - */ - - -/* CAN */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 /* PD0 */ -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 /* PD1 */ - -#define GPIO_CAN2_RX GPIO_CAN2_RX_1 /* PB12 */ -#define GPIO_CAN2_TX GPIO_CAN2_TX_2 /* PB6 */ - - -/* SPI */ -#define ADJ_SLEW_RATE(p) (((p) & ~GPIO_SPEED_MASK) | (GPIO_SPEED_2MHz)) - -#define GPIO_SPI1_SCK ADJ_SLEW_RATE(GPIO_SPI1_SCK_1) /* PA5 */ -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 /* PA7 */ - -#define GPIO_SPI2_SCK ADJ_SLEW_RATE(GPIO_SPI2_SCK_3) /* PB13 */ -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 /* PB14 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 /* PB15 */ - -#define GPIO_SPI4_SCK ADJ_SLEW_RATE(GPIO_SPI4_SCK_1) /* PE2 */ -#define GPIO_SPI4_MISO GPIO_SPI4_MISO_1 /* PE5 */ -#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_1 /* PE6 */ - - -/* I2C */ -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 /* PB8 */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 /* PB9 */ - -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_1 /* PB10 */ -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_1 /* PB11 */ diff --git a/boards/cubepilot/cubeyellow/nuttx-config/include/board_dma_map.h b/boards/cubepilot/cubeyellow/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 7861e24..0000000 --- a/boards/cubepilot/cubeyellow/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/* -| DMA1 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | SPI3_RX_1 | SPDIFRX_DT | SPI3_RX_2 | SPI2_RX | SPI2_TX | SPI3_TX_1 | SPDIFRX_CS | SPI3_TX_2 | -| Channel 1 | I2C1_RX | I2C3_RX | TIM7_UP_1 | - | TIM7_UP_2 | I2C1_RX_1 | I2C1_TX | I2C1_TX_1 | -| Channel 2 | TIM4_CH1 | - | I2C4_RX | TIM4_CH2 | - | I2C4_RX | TIM4_UP | TIM4_CH3 | -| Channel 3 | - | TIM2_UP_1 | I2C3_RX_1 | - | I2C3_TX | TIM2_CH1 | TIM2_CH2 | TIM2_UP_2 | -| | | TIM2_CH3 | | | | | TIM2_CH4_1 | TIM2_CH4_2 | -| Channel 4 | UART5_RX | USART3_RX | UART4_RX | USART3_TX_1 | UART4_TX | USART2_RX | USART2_TX | UART5_TX | -| Channel 5 | UART8_TX | UART7_TX | TIM3_CH4 | UART7_RX | TIM3_CH1 | TIM3_CH2 | UART8_RX | TIM3_CH3 | -| | | | TIM3_UP | | TIM3_TRIG | | | | -| Channel 6 | TIM5_CH3 | TIM5_CH4_1 | TIM5_CH1 | TIM5_CH4_2 | TIM5_CH2 | - | TIM5_UP_2 | - | -| | TIM5_UP_1 | TIM5_TRIG_1 | | TIM5_TRIG_2 | | | | | -| Channel 7 | - | TIM6_UP | I2C2_RX | I2C2_RX_1 | USART3_TX_2 | DAC1 | DAC2 | I2C2_TX | -| Channel 8 | I2C3_TX | I2C4_RX | - | - | I2C2_TX | - | I2C4_TX | - | -| Channel 9 | - | SPI2_RX | - | - | - | - | SPI2_TX | - | -| | | | | | | | | | -| Usage | UART8_TX | USART3_RX | UART4_RX | USART3_TX_1 | | USART2_RX | UART8_RX | | - - -| DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | ADC1_1 | SAI1_A | TIM8_CH1_1 | SAI1_A_1 | ADC1_2 | SAI1_B_1 | TIM1_CH1_1 | SAI2_B_2 | -| | | | TIM8_CH2_1 | | | | TIM1_CH2_1 | | -| | | | TIM8_CH3_1 | | | | TIM1_CH3_1 | | -| Channel 1 | - | DCMI_1 | ADC2_1 | ADC2_2 | SAI1_B | SPI6_TX | SPI6_RX | DCMI_2 | -| Channel 2 | ADC3_1 | ADC3_2 | - | SPI5_RX_1 | SPI5_TX_1 | CRYP_OUT | CRYP_IN | HASH_IN | -| Channel 3 | SPI1_RX_1 | - | SPI1_RX_2 | SPI1_TX_1 | SAI2_A | SPI1_TX_2 | SAI2_B | QUADSPI | -| Channel 4 | SPI4_RX_1 | SPI4_TX_1 | USART1_RX_1 | SDMMC1_1 | - | USART1_RX_2 | SDMMC1_2 | USART1_TX | -| Channel 5 | - | USART6_RX_1 | USART6_RX_2 | SPI4_RX_2 | SPI4_TX_2 | - | USART6_TX_1 | USART6_TX_2 | -| Channel 6 | TIM1_TRIG_1 | TIM1_CH1_2 | TIM1_CH2_2 | TIM1_CH1 | TIM1_CH4 | TIM1_UP | TIM1_CH3_2 | - | -| | | | | | TIM1_TRIG_2 | | | | -| | | | | | TIM1_COM | | | | -| Channel 7 | - | TIM8_UP | TIM8_CH1_2 | TIM8_CH2_2 | TIM8_CH3_2 | SPI5_RX_2 | SPI5_TX_2 | TIM8_CH4 | -| | | | | | | | | TIM8_TRIG | -| | | | | | | | | TIM8_COM | -| Channel 8 | DSFDM1_FLT0 | DSFDM1_FLT1 | DSFDM1_FLT2 | DSFDM1_FLT3 | DSFDM1_FLT0 | DSFDM1_FLT1 | DSFDM1_FLT2 | DSFDM1_FLT3 | -| Channel 9 | JPEG_IN | JPEG_OUT | SPI4_TX | JPEG_IN | JPEG_OUT | SPI5_RX | - | - | -| Channel 10 | SAI1_B | SAI2_B | SAI2_A | - | - | - | SAI1_A | - | -| Channel 11 | SDMMC2 | - | QUADSPI | - | - | SDMMC2 | - | - | -| | | | | | | | | | -| Usage | SPI1_RX_1 | | USART6_RX_2 | SPI1_TX_1 | | TIM1_UP | SDMMC1_2 | USART6_TX_2 | - */ - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// AVAILABLE // DMA1, Stream 0, Channel 5 -// DMAMAP_USART3_RX // DMA1, Stream 1, Channel 4 (TELEM2 RX) -// DMAMAP_UART4_RX // DMA1, Stream 2, Channel 4 (GPS1 RX) -#define DMAMAP_USART3_TX DMAMAP_USART3_TX_1 // DMA1, Stream 3, Channel 4 (TELEM2 TX) -// DMAMAP_USART2_RX // DMA1, Stream 5, Channel 4 (TELEM1 RX) -// DMAMAP_UART8_RX // DMA1, Stream 6, Channel 5 (GPS2 RX) - - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMAMAP_SPI1_RX DMAMAP_SPI1_RX_1 // DMA2, Stream 0, Channel 3 (MS5611, ICM20649) -#define DMAMAP_SPI4_TX DMAMAP_SPI4_TX_1 // DMA2, Stream 1, Channel 4 (MS5611, ICM20602, ICM20948) -#define DMAMAP_USART6_RX DMAMAP_USART6_RX_2 // DMA2, Stream 2, Channel 5 (PX4_IO RX) -#define DMAMAP_SPI4_RX DMAMAP_SPI4_RX_2 // DMA2, Stream 3, Channel 3 (MS5611, ICM20602, ICM20948) -// AVAILABLE // DMA2, Stream 4 -#define DMAMAP_SPI1_TX DMAMAP_SPI1_TX_2 // DMA2, Stream 5, Channel 3 (MS5611, ICM20649) -#define DMAMAP_SDMMC1 DMAMAP_SDMMC1_2 // DMA2, Stream 6, Channel 4 (SDMMC) -#define DMAMAP_USART6_TX DMAMAP_USART6_TX_2 // DMA2, Stream 7, Channel 5 (PX4_IO TX) diff --git a/boards/cubepilot/cubeyellow/nuttx-config/nsh/defconfig b/boards/cubepilot/cubeyellow/nuttx-config/nsh/defconfig deleted file mode 100644 index f00b3e9..0000000 --- a/boards/cubepilot/cubeyellow/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,259 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_CONSOLE is not set -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_FS_PROCFS_EXCLUDE_ENVIRON is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/cubepilot/cubeyellow/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32f7" -CONFIG_ARCH_CHIP_STM32F777VI=y -CONFIG_ARCH_CHIP_STM32F7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x1012 -CONFIG_CDCACM_PRODUCTSTR="CubeYellow" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x2DAE -CONFIG_CDCACM_VENDORSTR="CubePilot" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=3 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_MODE=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32F7_ADC1=y -CONFIG_STM32F7_BBSRAM=y -CONFIG_STM32F7_BBSRAM_FILES=5 -CONFIG_STM32F7_BKPSRAM=y -CONFIG_STM32F7_DMA1=y -CONFIG_STM32F7_DMA2=y -CONFIG_STM32F7_DMACAPABLE=y -CONFIG_STM32F7_FLOWCONTROL_BROKEN=y -CONFIG_STM32F7_I2C1=y -CONFIG_STM32F7_I2C2=y -CONFIG_STM32F7_I2C_DYNTIMEO=y -CONFIG_STM32F7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32F7_OTGFS=y -CONFIG_STM32F7_PROGMEM=y -CONFIG_STM32F7_PWR=y -CONFIG_STM32F7_RTC=y -CONFIG_STM32F7_RTC_HSECLOCK=y -CONFIG_STM32F7_RTC_MAGIC_REG=1 -CONFIG_STM32F7_SAVE_CRASHDUMP=y -CONFIG_STM32F7_SDMMC1=y -CONFIG_STM32F7_SDMMC_DMA=y -CONFIG_STM32F7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32F7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32F7_SPI1=y -CONFIG_STM32F7_SPI1_DMA=y -CONFIG_STM32F7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI2=y -CONFIG_STM32F7_SPI4=y -CONFIG_STM32F7_SPI4_DMA=y -CONFIG_STM32F7_SPI4_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI_DMATHRESHOLD=8 -CONFIG_STM32F7_TIM10=y -CONFIG_STM32F7_TIM11=y -CONFIG_STM32F7_UART4=y -CONFIG_STM32F7_UART7=y -CONFIG_STM32F7_UART8=y -CONFIG_STM32F7_USART2=y -CONFIG_STM32F7_USART3=y -CONFIG_STM32F7_USART6=y -CONFIG_STM32F7_USART_BREAKS=y -CONFIG_STM32F7_USART_INVERT=y -CONFIG_STM32F7_USART_SINGLEWIRE=y -CONFIG_STM32F7_USART_SWAP=y -CONFIG_STM32F7_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_RXDMA=y -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_RXDMA=y -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=3000 -CONFIG_USART3_TXDMA=y -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/cubepilot/cubeyellow/nuttx-config/scripts/script.ld b/boards/cubepilot/cubeyellow/nuttx-config/scripts/script.ld deleted file mode 100644 index 89f6ef2..0000000 --- a/boards/cubepilot/cubeyellow/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,181 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2020 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F765IIT6 has 2048 KiB of main FLASH memory. This FLASH memory - * can be accessed from either the AXIM interface at address 0x0800:0000 or - * from the ITCM interface at address 0x0020:0000. - * - * Additional information, including the option bytes, is available at at - * FLASH at address 0x1ff0:0000 (AXIM) or 0x0010:0000 (ITCM). - * - * In the STM32F765IIT6, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash on ITCM at 0x0020:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x0010:0000 - * - * NuttX does not modify these option byes. On the unmodified NUCLEO-144 - * board, the BOOT0 pin is at ground so by default, the STM32F765IIT6 will - * boot from address 0x0020:0000 in ITCM FLASH. - * - * The STM32F765IIT6 also has 512 KiB of data SRAM (in addition to ITCM SRAM). - * SRAM is split up into three blocks: - * - * 1) 128 KiB of DTCM SRM beginning at address 0x2000:0000 - * 2) 368 KiB of SRAM1 beginning at address 0x2002:0000 - * 3) 16 KiB of SRAM2 beginning at address 0x2007:c000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * Bootloader reserves three 32K banks (2 Mbytes Flash memory single bank) - * organization (256 bits read width) - */ - -MEMORY -{ - FLASH_ITCM (rx) : ORIGIN = 0x00218000, LENGTH = 1952K - FLASH_AXIM (rx) : ORIGIN = 0x08018000, LENGTH = 1952K - - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 16K - DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - SRAM1 (rwx) : ORIGIN = 0x20020000, LENGTH = 368K - SRAM2 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH_AXIM - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH_AXIM - - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH_AXIM - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH_AXIM - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > SRAM1 AT > FLASH_AXIM - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > SRAM1 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } - - .ramfunc : { - _sramfuncs = .; - *(.ramfunc .ramfunc.*) - . = ALIGN(4); - _eramfuncs = .; - } > ITCM_RAM AT > FLASH_AXIM - - _framfuncs = LOADADDR(.ramfunc); -} diff --git a/boards/cubepilot/cubeyellow/src/CMakeLists.txt b/boards/cubepilot/cubeyellow/src/CMakeLists.txt deleted file mode 100644 index ce7742d..0000000 --- a/boards/cubepilot/cubeyellow/src/CMakeLists.txt +++ /dev/null @@ -1,51 +0,0 @@ -############################################################################ -# -# Copyright (c) 2020 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. -# -############################################################################ - -add_library(drivers_board - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - usb.c -) - -target_link_libraries(drivers_board - PRIVATE - arch_io_pins - arch_spi - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer -) diff --git a/boards/cubepilot/cubeyellow/src/board_config.h b/boards/cubepilot/cubeyellow/src/board_config.h deleted file mode 100644 index 53fff3a..0000000 --- a/boards/cubepilot/cubeyellow/src/board_config.h +++ /dev/null @@ -1,176 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * Board internal definitions - */ - -#pragma once - -#include -#include -#include -#include - -/* PX4IO connection configuration */ -#define BOARD_USES_PX4IO_VERSION 2 -#define PX4IO_SERIAL_DEVICE "/dev/ttyS3" -#define PX4IO_SERIAL_TX_GPIO GPIO_USART6_TX -#define PX4IO_SERIAL_RX_GPIO GPIO_USART6_RX -#define PX4IO_SERIAL_BASE STM32_USART6_BASE -#define PX4IO_SERIAL_VECTOR STM32_IRQ_USART6 -#define PX4IO_SERIAL_TX_DMAMAP DMAMAP_USART6_TX -#define PX4IO_SERIAL_RX_DMAMAP DMAMAP_USART6_RX -#define PX4IO_SERIAL_RCC_REG STM32_RCC_APB2ENR -#define PX4IO_SERIAL_RCC_EN RCC_APB2ENR_USART6EN -#define PX4IO_SERIAL_CLOCK STM32_PCLK2_FREQUENCY -#define PX4IO_SERIAL_BITRATE 1500000 /* 1.5Mbps -> max rate for IO */ - -/* LEDs */ -#define GPIO_nLED_AMBER /* PE12 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN12) - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_ARMED_LED LED_AMBER - -/* ADC channels */ -#define PX4_ADC_GPIO \ - /* PA2 */ GPIO_ADC1_IN2, \ - /* PA3 */ GPIO_ADC1_IN3, \ - /* PA4 */ GPIO_ADC1_IN4, \ - /* PC3 */ GPIO_ADC1_IN13, \ - /* PC4 */ GPIO_ADC1_IN14, \ - /* PC5 */ GPIO_ADC1_IN15 - -/* Define Channel numbers must match above GPIO pins */ -#define ADC_BATTERY1_VOLTAGE_CHANNEL 2 /* PA2: BATT_VOLTAGE_SENS */ -#define ADC_BATTERY1_CURRENT_CHANNEL 3 /* PA3: BATT_CURRENT_SENS */ -#define ADC_SCALED_V5_CHANNEL 4 /* PA4: VDD_5V_SENS */ -#define ADC_BATTERY2_VOLTAGE_CHANNEL 13 /* PC3: FMU_AUX_POWER_ADC1 */ -#define ADC_BATTERY2_CURRENT_CHANNEL 14 /* PC4: FMU_AUX_ADC2 */ -#define ADC_AIRSPEED_VOLTAGE_CHANNEL 15 /* PC5: PRESSURE_SENS */ - -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY1_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY1_CURRENT_CHANNEL) | \ - (1 << ADC_SCALED_V5_CHANNEL) | \ - (1 << ADC_BATTERY2_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY2_CURRENT_CHANNEL) | \ - (1 << ADC_AIRSPEED_VOLTAGE_CHANNEL)) - -/* HW has to large of R termination on ADC todo:change when HW value is chosen */ -#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f) - -/* PWM */ -#define DIRECT_PWM_OUTPUT_CHANNELS 6 -#define GPIO_PWM_VOLT_SEL /* PB4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN4) - -/* Power supply control and monitoring GPIOs */ -#define BOARD_NUMBER_BRICKS 2 -#define GPIO_nVDD_BRICK1_VALID /* PB5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5) // VDD_BRICK_VALID -#define GPIO_nVDD_BRICK2_VALID /* PB7 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN7) // VDD_BACKUP_VALID -#define GPIO_nVDD_USB_VALID /* PC0 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN0) // VBUS_VALID -#define GPIO_VDD_3V3_SENSORS_EN /* PE3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN3) // VDD_3V3_SENSORS_EN -#define GPIO_nVDD_5V_PERIPH_EN /* PA8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN8) // VDD_5V_PERIPH_EN -#define GPIO_nVDD_5V_PERIPH_OC /* PE15 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN15) // VDD_5V_PERIPH_OC -#define GPIO_nVDD_5V_HIPOWER_OC /* PE10 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN10) // VDD_5V_HIPOWER_OC - -/* Tone alarm output */ -#define TONE_ALARM_TIMER 2 /* timer 2 */ -#define TONE_ALARM_CHANNEL 1 /* PA15 TIM2_CH1 */ - -#define GPIO_BUZZER_1 /* PA15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) // ALARM - -#define GPIO_TONE_ALARM_IDLE GPIO_BUZZER_1 -#define GPIO_TONE_ALARM GPIO_TIM2_CH1OUT_2 - -/* USB - * OTG FS: PA9 OTG_FS_VBUS VBUS sensing - */ -#define GPIO_OTGFS_VBUS /* PA9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 8 /* use timer8 for the HRT */ -#define HRT_TIMER_CHANNEL 3 /* use capture/compare channel 3 */ - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID)) -#define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -#define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID)) -#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_nVDD_5V_PERIPH_OC)) -#define BOARD_ADC_HIPOWER_5V_OC (!px4_arch_gpioread(GPIO_nVDD_5V_HIPOWER_OC)) - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ -#define BOARD_HAS_ON_RESET 1 - -#define BOARD_HAS_STATIC_MANIFEST 1 - - - -#define BOARD_ENABLE_CONSOLE_BUFFER - -#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, \ - GPIO_nVDD_USB_VALID, \ - GPIO_VDD_3V3_SENSORS_EN, \ - GPIO_nVDD_5V_PERIPH_EN, \ - GPIO_nVDD_5V_PERIPH_OC, \ - GPIO_nVDD_5V_HIPOWER_OC, \ - GPIO_TONE_ALARM_IDLE, \ - GPIO_OTGFS_VBUS, \ - } - -__BEGIN_DECLS -#ifndef __ASSEMBLY__ - -extern void stm32_spiinitialize(void); -extern void board_peripheral_reset(int ms); - -#include -#endif /* __ASSEMBLY__ */ -__END_DECLS diff --git a/boards/cubepilot/cubeyellow/src/i2c.cpp b/boards/cubepilot/cubeyellow/src/i2c.cpp deleted file mode 100644 index 5625423..0000000 --- a/boards/cubepilot/cubeyellow/src/i2c.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(2), - initI2CBusExternal(1), -}; diff --git a/boards/cubepilot/cubeyellow/src/init.c b/boards/cubepilot/cubeyellow/src/init.c deleted file mode 100644 index 8ba8972..0000000 --- a/boards/cubepilot/cubeyellow/src/init.c +++ /dev/null @@ -1,203 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * board-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. - */ - -#include "board_config.h" - -#include - -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include - -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - /* Power off Interfaces */ - stm32_gpiowrite(GPIO_nVDD_5V_PERIPH_EN, true); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - stm32_gpiowrite(GPIO_nVDD_5V_PERIPH_EN, false); -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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 - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Power on Interfaces */ - stm32_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, true); - stm32_gpiowrite(GPIO_nVDD_5V_PERIPH_EN, false); - board_control_spi_sensors_power(true, 0xffff); - - px4_platform_init(); - - stm32_spiinitialize(); - - /* configure the DMA allocator */ - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_AMBER); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_AMBER); - } - -#ifdef CONFIG_MMCSD - /* Mount the SDIO-based MMC/SD block driver */ - /* First, get an instance of the SDIO interface */ - struct sdio_dev_s *sdio_dev = sdio_initialize(0); // SDIO_SLOTNO 0 Only one slot - - if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", 0); - } - - if (mmcsd_slotinitialize(0, sdio_dev) != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver\n"); - } - - /* Assume that the SD card is inserted. What choice do we have? */ - sdio_mediachange(sdio_dev, true); -#endif /* CONFIG_MMCSD */ - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/cubepilot/cubeyellow/src/led.c b/boards/cubepilot/cubeyellow/src/led.c deleted file mode 100644 index f3c2546..0000000 --- a/boards/cubepilot/cubeyellow/src/led.c +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -# define xlat(p) (p) -static uint32_t g_ledmap[] = { - GPIO_nLED_AMBER, -}; - -__EXPORT void led_init(void) -{ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - if (g_ledmap[l] != 0) { - stm32_configgpio(g_ledmap[l]); - } - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - if (g_ledmap[led] != 0) { - stm32_gpiowrite(g_ledmap[led], !state); - } -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - if (g_ledmap[led] != 0) { - return !stm32_gpioread(g_ledmap[led]); - } - - return false; -} - -__EXPORT void led_on(int led) -{ - phy_set_led(xlat(led), true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(xlat(led), false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(xlat(led), !phy_get_led(xlat(led))); -} diff --git a/boards/cubepilot/cubeyellow/src/spi.cpp b/boards/cubepilot/cubeyellow/src/spi.cpp deleted file mode 100644 index 54c59fe..0000000 --- a/boards/cubepilot/cubeyellow/src/spi.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20649, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), // MPU_CS, MPU_DRDY - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortD, GPIO::Pin7}), // BARO_CS - }), - - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10}) // FRAM_CS - }), - - initSPIBus(SPI::Bus::SPI4, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20948, SPI::CS{GPIO::PortE, GPIO::Pin4}), // MPU_EXT_CS - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortC, GPIO::Pin13}), // GYRO_EXT_CS - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortC, GPIO::Pin14}), // BARO_EXT_CS - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/cubepilot/cubeyellow/src/timer_config.cpp b/boards/cubepilot/cubeyellow/src/timer_config.cpp deleted file mode 100644 index bf64e64..0000000 --- a/boards/cubepilot/cubeyellow/src/timer_config.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1, DMA{DMA::Index2, DMA::Stream5, DMA::Channel6}), - initIOTimer(Timer::Timer4), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortE, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/cubepilot/cubeyellow/src/usb.c b/boards/cubepilot/cubeyellow/src/usb.c deleted file mode 100644 index 343f3cb..0000000 --- a/boards/cubepilot/cubeyellow/src/usb.c +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -#include "board_config.h" -#include -#include -#include -#include -#include - - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/cubepilot/io-v2/default.px4board b/boards/cubepilot/io-v2/default.px4board deleted file mode 100644 index 9e69a1e..0000000 --- a/boards/cubepilot/io-v2/default.px4board +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m3" -CONFIG_BOARD_ROMFSROOT="" -CONFIG_BOARD_CONSTRAINED_FLASH=y -CONFIG_MODULES_PX4IOFIRMWARE=y diff --git a/boards/cubepilot/io-v2/extras/cubepilot_io-v2_bootloader.bin b/boards/cubepilot/io-v2/extras/cubepilot_io-v2_bootloader.bin deleted file mode 100644 index 235c65c..0000000 Binary files a/boards/cubepilot/io-v2/extras/cubepilot_io-v2_bootloader.bin and /dev/null differ diff --git a/boards/cubepilot/io-v2/firmware.prototype b/boards/cubepilot/io-v2/firmware.prototype deleted file mode 100644 index 5758931..0000000 --- a/boards/cubepilot/io-v2/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 10, - "magic": "PX4FWv2", - "description": "Firmware for the PX4IOv2 board", - "image": "", - "build_time": 0, - "summary": "PX4IOv2", - "version": "2.0", - "image_size": 0, - "image_maxsize": 61440, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/cubepilot/io-v2/nuttx-config/include/board.h b/boards/cubepilot/io-v2/nuttx-config/include/board.h deleted file mode 100644 index 577e02d..0000000 --- a/boards/cubepilot/io-v2/nuttx-config/include/board.h +++ /dev/null @@ -1,141 +0,0 @@ -/************************************************************************************ - * nuttx-configs/px4io/include/board.h - * include/arch/board/board.h - * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * Copyright (C) 2012 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 NuttX 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. - * - ************************************************************************************/ - -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include -#ifndef __ASSEMBLY__ -# include -#endif -#include - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ - -/* On-board crystal frequency is 24MHz (HSE) */ - -#define STM32_BOARD_XTAL 24000000ul - -/* Use the HSE output as the system clock */ - -#define STM32_SYSCLK_SW RCC_CFGR_SW_HSE -#define STM32_SYSCLK_SWS RCC_CFGR_SWS_HSE -#define STM32_SYSCLK_FREQUENCY STM32_BOARD_XTAL - -/* AHB clock (HCLK) is SYSCLK (24MHz) */ - -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB2 clock (PCLK2) is HCLK (24MHz) */ - -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLK -#define STM32_PCLK2_FREQUENCY STM32_HCLK_FREQUENCY -#define STM32_APB2_CLKIN (STM32_PCLK2_FREQUENCY) /* Timers 2-4 */ - -/* APB2 timer 1 will receive PCLK2. */ - -#define STM32_APB2_TIM1_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM15_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM16_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM17_CLKIN (STM32_PCLK2_FREQUENCY) - -/* APB1 clock (PCLK1) is HCLK (24MHz) */ - -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLK -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY) - -/* All timers run off PCLK */ - - -#define STM32_APB1_TIM2_CLKIN (STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (STM32_PCLK1_FREQUENCY) - -/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx - * otherwise frequency is 2xAPBx. - * Note: TIM1, 15-17 are on APB2, others on APB1 - */ - -#define BOARD_TIM1_FREQUENCY STM32_APB2_TIM1_CLKIN -#define BOARD_TIM2_FREQUENCY STM32_APB1_TIM2_CLKIN -#define BOARD_TIM3_FREQUENCY STM32_APB1_TIM3_CLKIN -#define BOARD_TIM4_FREQUENCY STM32_APB1_TIM4_CLKIN -#define BOARD_TIM5_FREQUENCY STM32_APB1_TIM5_CLKIN -#define BOARD_TIM6_FREQUENCY STM32_APB1_TIM6_CLKIN -#define BOARD_TIM7_FREQUENCY STM32_APB1_TIM7_CLKIN -#define BOARD_TIM12_FREQUENCY STM32_APB1_TIM12_CLKIN -#define BOARD_TIM13_FREQUENCY STM32_APB1_TIM13_CLKIN -#define BOARD_TIM14_FREQUENCY STM32_APB1_TIM14_CLKIN -#define BOARD_TIM15_FREQUENCY STM32_APB2_TIM15_CLKIN -#define BOARD_TIM16_FREQUENCY STM32_APB2_TIM16_CLKIN -#define BOARD_TIM17_FREQUENCY STM32_APB2_TIM17_CLKIN - - -/* - * Some of the USART pins are not available; override the GPIO - * definitions with an invalid pin configuration. - */ -#undef GPIO_USART2_CTS -#define GPIO_USART2_CTS 0xffffffff -#undef GPIO_USART2_RTS -#define GPIO_USART2_RTS 0xffffffff -#undef GPIO_USART2_CK -#define GPIO_USART2_CK 0xffffffff -#undef GPIO_USART3_CK -#define GPIO_USART3_CK 0xffffffff -#undef GPIO_USART3_CTS -#define GPIO_USART3_CTS 0xffffffff -#undef GPIO_USART3_RTS -#define GPIO_USART3_RTS 0xffffffff - -#endif /* __ARCH_BOARD_BOARD_H */ diff --git a/boards/cubepilot/io-v2/nuttx-config/nsh/defconfig b/boards/cubepilot/io-v2/nuttx-config/nsh/defconfig deleted file mode 100644 index 7381b24..0000000 --- a/boards/cubepilot/io-v2/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,61 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_NULL is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/cubepilot/io-v2/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F100C8=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARD_LOOPSPERMSEC=2000 -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DISABLE_MOUNTPOINT=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=316 -CONFIG_INIT_ENTRYPOINT="user_start" -CONFIG_INIT_STACKSIZE=1100 -CONFIG_MM_FILL_ALLOCATIONS=y -CONFIG_MM_SMALL=y -CONFIG_NAME_MAX=12 -CONFIG_PREALLOC_TIMERS=0 -CONFIG_RAM_SIZE=8192 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_DISABLE_BUFFERING=y -CONFIG_STM32_ADC1=y -CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y -CONFIG_STM32_DMA1=y -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_USART1=y -CONFIG_STM32_USART2=y -CONFIG_STM32_USART3=y -CONFIG_STM32_USART_SINGLEWIRE=y -CONFIG_TASK_NAME_SIZE=0 -CONFIG_USART1_RXBUFSIZE=64 -CONFIG_USART1_RXDMA=y -CONFIG_USART1_SERIAL_CONSOLE=y -CONFIG_USART1_TXBUFSIZE=32 -CONFIG_USART2_RXBUFSIZE=64 -CONFIG_USART2_TXBUFSIZE=64 -CONFIG_USART3_RXBUFSIZE=64 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=64 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/cubepilot/io-v2/nuttx-config/scripts/script.ld b/boards/cubepilot/io-v2/nuttx-config/scripts/script.ld deleted file mode 100644 index c842153..0000000 --- a/boards/cubepilot/io-v2/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,131 +0,0 @@ -/**************************************************************************** - * configs/px4io-v2/scripts/ld.script - * - * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F100C8 has 64Kb of FLASH beginning at address 0x0800:0000 and - * 8Kb of SRAM beginning at address 0x2000:0000. When booting from FLASH, - * FLASH memory is aliased to address 0x0000:0000 where the code expects to - * begin execution by jumping to the entry point in the 0x0800:0000 address - * range. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08001000, LENGTH = 60K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 8K -} - -OUTPUT_ARCH(arm) -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - /* The STM32F100CB has 8Kb of SRAM beginning at the following address */ - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - . = ALIGN(4); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/cubepilot/io-v2/src/CMakeLists.txt b/boards/cubepilot/io-v2/src/CMakeLists.txt deleted file mode 100644 index 5cef2f6..0000000 --- a/boards/cubepilot/io-v2/src/CMakeLists.txt +++ /dev/null @@ -1,42 +0,0 @@ -############################################################################ -# -# Copyright (c) 2015 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. -# -############################################################################ - -add_library(drivers_board - init.c - timer_config.cpp -) - -target_link_libraries(drivers_board - PRIVATE - nuttx_arch -) diff --git a/boards/cubepilot/io-v2/src/board_config.h b/boards/cubepilot/io-v2/src/board_config.h deleted file mode 100644 index 913564e..0000000 --- a/boards/cubepilot/io-v2/src/board_config.h +++ /dev/null @@ -1,145 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013, 2014 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * PX4IOV2 internal definitions - */ - -#pragma once - -/****************************************************************************** - * Included Files - ******************************************************************************/ - -#include -#include -#include - -/****************************************************************************** - * Definitions - ******************************************************************************/ -/* Configuration **************************************************************/ - -/****************************************************************************** - * Serial - ******************************************************************************/ -#define PX4FMU_SERIAL_BASE STM32_USART2_BASE -#define PX4FMU_SERIAL_VECTOR STM32_IRQ_USART2 -#define PX4FMU_SERIAL_TX_GPIO GPIO_USART2_TX -#define PX4FMU_SERIAL_RX_GPIO GPIO_USART2_RX -#define PX4FMU_SERIAL_TX_DMA DMACHAN_USART2_TX -#define PX4FMU_SERIAL_RX_DMA DMACHAN_USART2_RX -#define PX4FMU_SERIAL_CLOCK STM32_PCLK1_FREQUENCY -#define PX4FMU_SERIAL_BITRATE 1500000 - -/****************************************************************************** - * GPIOS - ******************************************************************************/ - -/* LEDS **********************************************************************/ - -#define GPIO_LED_AMBER (GPIO_OUTPUT|GPIO_CNF_OUTOD|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN15) // IO-LED_AMBER -#define GPIO_LED_SAFETY (GPIO_OUTPUT|GPIO_CNF_OUTOD|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN13) // IO-LED_SAFETY -#define GPIO_LED_GREEN (GPIO_OUTPUT|GPIO_CNF_OUTOD|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN11) // IO-LED_POWER_BREATHING - -#define LED_AMBER(on_true) stm32_gpiowrite(GPIO_LED_AMBER, !(on_true)) -#define LED_SAFETY(on_true) stm32_gpiowrite(GPIO_LED_SAFETY, !(on_true)) -#define LED_GREEN(on_true) stm32_gpiowrite(GPIO_LED_GREEN, (on_true)) - - -/* HEATER */ -#define GPIO_HEATER_OUTPUT /* PB14 */ (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN14) -#define HEATER_OUTPUT_EN(on_true) stm32_gpiowrite(GPIO_HEATER_OUTPUT, (on_true)) - - -#define GPIO_USART1_RX_SPEKTRUM (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN10) - -/* Safety switch button *******************************************************/ - -#define GPIO_BTN_SAFETY (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN5) - -/* Power switch controls ******************************************************/ - -#define GPIO_SPEKTRUM_PWR_EN (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN13) -#define SPEKTRUM_POWER(_on_true) px4_arch_gpiowrite(GPIO_SPEKTRUM_PWR_EN, (_on_true)) - -#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_USART1_RX_SPEKTRUM, (_one_true)) -#define SPEKTRUM_RX_AS_UART() px4_arch_configgpio(GPIO_USART1_RX) -#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_USART1_RX_SPEKTRUM) - -#define GPIO_SERVO_FAULT_DETECT (GPIO_INPUT|GPIO_CNF_INPULLUP|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN15) - -/* Analog inputs **************************************************************/ - -#define GPIO_ADC_VSERVO (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN4) - -/* the same rssi signal goes to both an adc and a timer input */ -#define GPIO_ADC_RSSI (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN5) -#define GPIO_TIM_RSSI (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN12) - -/* PWM pins **************************************************************/ - -#define GPIO_PPM (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN8) - -#define GPIO_PWM1 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN0) -#define GPIO_PWM2 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN1) -#define GPIO_PWM3 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN8) -#define GPIO_PWM4 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN9) -#define GPIO_PWM5 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN6) -#define GPIO_PWM6 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN7) -#define GPIO_PWM7 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN0) -#define GPIO_PWM8 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN1) - -#define DIRECT_PWM_OUTPUT_CHANNELS 8 -#define BOARD_HAS_NO_CAPTURE - -/* SBUS pins *************************************************************/ - -/* XXX these should be UART pins */ -#define GPIO_SBUS_INPUT (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN11) -#define GPIO_SBUS_OUTPUT (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN10) -#define GPIO_SBUS_OENABLE (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN4) - -/* - * High-resolution timer - */ -#define HRT_TIMER 1 /* use timer1 for the HRT */ -#define HRT_TIMER_CHANNEL 2 /* use capture/compare channel 2 */ -#define HRT_PPM_CHANNEL 1 /* use capture/compare channel 1 PA8 */ -#define GPIO_PPM_IN (GPIO_ALT|GPIO_CNF_INPULLUP|GPIO_PORTA|GPIO_PIN8) - -#define BOARD_NUM_IO_TIMERS 3 - -#include diff --git a/boards/cubepilot/io-v2/src/init.c b/boards/cubepilot/io-v2/src/init.c deleted file mode 100644 index 55ade13..0000000 --- a/boards/cubepilot/io-v2/src/init.c +++ /dev/null @@ -1,145 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * PX4FMU-specific early startup code. This file implements the - * stm32_boardinitialize() function that is called during cpu startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include -#include -#include - -#include - -#include -#include "board_config.h" - -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Protected Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/************************************************************************************ - * Name: stm32_boardinitialize - * - * Description: - * All STM32 architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. - * - ************************************************************************************/ - -__EXPORT void stm32_boardinitialize(void) -{ - /* configure GPIOs */ - - stm32_configgpio(GPIO_HEATER_OUTPUT); - - /* LEDS - default to off */ - stm32_configgpio(GPIO_LED_AMBER); - stm32_configgpio(GPIO_LED_SAFETY); - stm32_configgpio(GPIO_LED_GREEN); - - stm32_configgpio(GPIO_BTN_SAFETY); - - /* spektrum power enable is active high - enable it by default */ - stm32_configgpio(GPIO_SPEKTRUM_PWR_EN); - - stm32_configgpio(GPIO_SERVO_FAULT_DETECT); - - /* RSSI inputs */ - stm32_configgpio(GPIO_TIM_RSSI); /* xxx alternate function */ - stm32_configgpio(GPIO_ADC_RSSI); - - /* servo rail voltage */ - stm32_configgpio(GPIO_ADC_VSERVO); - - stm32_configgpio(GPIO_SBUS_INPUT); /* xxx alternate function */ - stm32_configgpio(GPIO_SBUS_OUTPUT); - - /* sbus output enable is active low - disable it by default */ - stm32_gpiowrite(GPIO_SBUS_OENABLE, true); - stm32_configgpio(GPIO_SBUS_OENABLE); - - stm32_configgpio(GPIO_PPM); /* xxx alternate function */ - - stm32_gpiowrite(GPIO_PWM1, true); - stm32_configgpio(GPIO_PWM1); - - stm32_gpiowrite(GPIO_PWM2, true); - stm32_configgpio(GPIO_PWM2); - - stm32_gpiowrite(GPIO_PWM3, true); - stm32_configgpio(GPIO_PWM3); - - stm32_gpiowrite(GPIO_PWM4, true); - stm32_configgpio(GPIO_PWM4); - - stm32_gpiowrite(GPIO_PWM5, true); - stm32_configgpio(GPIO_PWM5); - - stm32_gpiowrite(GPIO_PWM6, true); - stm32_configgpio(GPIO_PWM6); - - stm32_gpiowrite(GPIO_PWM7, true); - stm32_configgpio(GPIO_PWM7); - - stm32_gpiowrite(GPIO_PWM8, true); - stm32_configgpio(GPIO_PWM8); - - /* disable heater */ - HEATER_OUTPUT_EN(false); -} diff --git a/boards/cubepilot/io-v2/src/timer_config.cpp b/boards/cubepilot/io-v2/src/timer_config.cpp deleted file mode 100644 index bb7dfa8..0000000 --- a/boards/cubepilot/io-v2/src/timer_config.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer2), - initIOTimer(Timer::Timer4), - initIOTimer(Timer::Timer3), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel1}, {GPIO::PortA, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel2}, {GPIO::PortA, GPIO::Pin1}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortB, GPIO::Pin8}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel4}, {GPIO::PortB, GPIO::Pin9}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel1}, {GPIO::PortA, GPIO::Pin6}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel2}, {GPIO::PortA, GPIO::Pin7}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel3}, {GPIO::PortB, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel4}, {GPIO::PortB, GPIO::Pin1}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/diatone/mamba-f405-mk2/bootloader/mamba_f405_mk2_bootloader.bin b/boards/diatone/mamba-f405-mk2/bootloader/mamba_f405_mk2_bootloader.bin deleted file mode 100644 index be73a7f..0000000 Binary files a/boards/diatone/mamba-f405-mk2/bootloader/mamba_f405_mk2_bootloader.bin and /dev/null differ diff --git a/boards/diatone/mamba-f405-mk2/default.px4board b/boards/diatone/mamba-f405-mk2/default.px4board deleted file mode 100644 index 6655e8e..0000000 --- a/boards/diatone/mamba-f405-mk2/default.px4board +++ /dev/null @@ -1,44 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_CONSTRAINED_FLASH=y -CONFIG_BOARD_NO_HELP=y -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_BOARD_EXTERNAL_METADATA=y -CONFIG_BOARD_SERIAL_URT6="/dev/ttyS2" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS1" -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_BAROMETER_BMP280=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU6000=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU9250=y -CONFIG_DRIVERS_MAGNETOMETER_AKM_AK8963=y -CONFIG_DRIVERS_MAGNETOMETER_HMC5883=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_SENSORS=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_VER=y diff --git a/boards/diatone/mamba-f405-mk2/firmware.prototype b/boards/diatone/mamba-f405-mk2/firmware.prototype deleted file mode 100644 index cd7955b..0000000 --- a/boards/diatone/mamba-f405-mk2/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 42, - "magic": "MAMBAF405MK2", - "description": "Firmware for the MambaF405Mk2 board", - "image": "", - "build_time": 0, - "summary": "PX4/MambaF405", - "version": "0.1", - "image_size": 0, - "image_maxsize": 1032192, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/diatone/mamba-f405-mk2/init/rc.board_defaults b/boards/diatone/mamba-f405-mk2/init/rc.board_defaults deleted file mode 100644 index 97bbcd6..0000000 --- a/boards/diatone/mamba-f405-mk2/init/rc.board_defaults +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -# system_power unavailable -param set-default CBRK_SUPPLY_CHK 894281 - -# Disable safety switch by default -param set-default CBRK_IO_SAFETY 22027 - -# use the Q attitude estimator, it works w/o mag or GPS. -param set-default SYS_MC_EST_GROUP 3 -param set-default ATT_ACC_COMP 0 -param set-default ATT_W_ACC 0.4000 -param set-default ATT_W_GYRO_BIAS 0.0000 - -param set-default SYS_HAS_MAG 0 diff --git a/boards/diatone/mamba-f405-mk2/init/rc.board_extras b/boards/diatone/mamba-f405-mk2/init/rc.board_extras deleted file mode 100644 index d31babd..0000000 --- a/boards/diatone/mamba-f405-mk2/init/rc.board_extras +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# -# Mamba F405 MK2 specific board extras init -#------------------------------------------------------------------------------ - -if ! param compare OSD_ATXXXX_CFG 0 -then - atxxxx start -s -fi diff --git a/boards/diatone/mamba-f405-mk2/init/rc.board_sensors b/boards/diatone/mamba-f405-mk2/init/rc.board_sensors deleted file mode 100644 index 2ce4db6..0000000 --- a/boards/diatone/mamba-f405-mk2/init/rc.board_sensors +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -# -# Mamba F405 MK2 specific board sensors init -#------------------------------------------------------------------------------ - -board_adc start - -if ! mpu6000 -R 6 -s start -then - # some boards such as the Hobbywing XRotor F4 G2 use the ICM-20602 - icm20602 -s -R 6 start -fi - -if ! hmc5883 -T -X start -then - if mpu9250_i2c -X -b 2 -a 0x68 -R 28 start; then - sleep 1 # wait for mpu9250 to be configured with bypass enabled - ak8963 -X -b 2 -R 30 start # -R 34 - sleep 1 - mpu9250_i2c stop - ak8963 -X -b 2 -R 30 start # -R 34 - fi -fi - -bmp280 -X -b 2 start diff --git a/boards/diatone/mamba-f405-mk2/nuttx-config/include/board.h b/boards/diatone/mamba-f405-mk2/nuttx-config/include/board.h deleted file mode 100644 index 041d552..0000000 --- a/boards/diatone/mamba-f405-mk2/nuttx-config/include/board.h +++ /dev/null @@ -1,327 +0,0 @@ -/************************************************************************************ - * nuttx-configs/diatone_mamba-f405-mk2/include/board.h - * include/arch/board/board.h - * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Copyright (c) 2018 PX4 Development Team. All rights reserved. - * Author: Nathan Tsoi - * - * 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 NuttX 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. - * - ************************************************************************************/ - -#ifndef __CONFIG_MAMBAF405MK2_INCLUDE_BOARD_H -#define __CONFIG_MAMBAF405MK2_INCLUDE_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdio.h" -#include "stm32.h" - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The mambaf405mk2 board features a single 8MHz crystal. Space is provided - * for a 32kHz RTC backup crystal, but it is not stuffed. - * - * This is the canonical configuration: - * System Clock source : PLL (HSE) - * SYSCLK(Hz) : 168000000 Determined by PLL configuration - * HCLK(Hz) : 168000000 (STM32_RCC_CFGR_HPRE) - * AHB Prescaler : 1 (STM32_RCC_CFGR_HPRE) - * APB1 Prescaler : 4 (STM32_RCC_CFGR_PPRE1) - * APB2 Prescaler : 2 (STM32_RCC_CFGR_PPRE2) - * HSE Frequency(Hz) : 8000000 (STM32_BOARD_XTAL) - * PLLM : 8 (STM32_PLLCFG_PLLM) - * PLLN : 336 (STM32_PLLCFG_PLLN) - * PLLP : 2 (STM32_PLLCFG_PLLP) - * PLLQ : 7 (STM32_PLLCFG_PLLQ) - * Main regulator output voltage : Scale1 mode Needed for high speed SYSCLK - * Flash Latency(WS) : 5 - * Prefetch Buffer : OFF - * Instruction cache : ON - * Data cache : ON - * Require 48MHz for USB OTG FS, : Enabled - * SDIO and RNG clock - */ - -/* HSI - 16 MHz RC factory-trimmed - * LSI - 32 KHz RC - * HSE - On-board crystal frequency is 8MHz - * LSE - 32.768 kHz - */ - -#define STM32_BOARD_XTAL 8000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 32768 - -/* Main PLL Configuration. - * - * PLL source is HSE - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * = (8,000,000 / 8) * 336 - * = 336,000,000 - * SYSCLK = PLL_VCO / PLLP - * = 336,000,000 / 2 = 168,000,000 - * USB OTG FS, SDIO and RNG Clock - * = PLL_VCO / PLLQ - * = 48,000,000 - */ - -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(8) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(336) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(7) - -#define STM32_SYSCLK_FREQUENCY 168000000ul - -/* AHB clock (HCLK) is SYSCLK (168MHz) */ - -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (42MHz) */ - -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (84MHz) */ - -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx - * otherwise frequency is 2xAPBx. - * Note: TIM1,8-11 are on APB2, others on APB1 - */ - -#define BOARD_TIM1_FREQUENCY STM32_APB2_TIM1_CLKIN -#define BOARD_TIM2_FREQUENCY STM32_APB1_TIM2_CLKIN -#define BOARD_TIM3_FREQUENCY STM32_APB1_TIM3_CLKIN -#define BOARD_TIM4_FREQUENCY STM32_APB1_TIM4_CLKIN -#define BOARD_TIM5_FREQUENCY STM32_APB1_TIM5_CLKIN -#define BOARD_TIM6_FREQUENCY STM32_APB1_TIM6_CLKIN -#define BOARD_TIM7_FREQUENCY STM32_APB1_TIM7_CLKIN -#define BOARD_TIM8_FREQUENCY STM32_APB2_TIM8_CLKIN -#define BOARD_TIM9_FREQUENCY STM32_APB2_TIM9_CLKIN -#define BOARD_TIM10_FREQUENCY STM32_APB2_TIM10_CLKIN -#define BOARD_TIM11_FREQUENCY STM32_APB2_TIM11_CLKIN -#define BOARD_TIM12_FREQUENCY STM32_APB1_TIM12_CLKIN -#define BOARD_TIM13_FREQUENCY STM32_APB1_TIM13_CLKIN -#define BOARD_TIM14_FREQUENCY STM32_APB1_TIM14_CLKIN - -/* SDIO dividers. Note that slower clocking is required when DMA is disabled - * in order to avoid RX overrun/TX underrun errors due to delayed responses - * to service FIFOs in interrupt driven mode. These values have not been - * tuned!!! - * - * SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(118+2)=400 KHz - */ - -#define SDIO_INIT_CLKDIV (118 << SDIO_CLKCR_CLKDIV_SHIFT) - -/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz - * DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32_SDIO_DMA -# define SDIO_MMCXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) -#else -# define SDIO_MMCXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) -#endif - -/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz - * DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32_SDIO_DMA -# define SDIO_SDXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) -#else -# define SDIO_SDXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) -#endif - -/* LED definitions ******************************************************************/ -/* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any - * way. The following definitions are used to access individual LEDs. - */ - -/* LED index values for use with stm32_setled() */ - -#define BOARD_LED1 0 -//#define BOARD_LED2 1 -#define BOARD_NLEDS 1 - -#define BOARD_LED_BLUE BOARD_LED1 -//#define BOARD_LED_RED BOARD_LED2 - -/* LED bits for use with stm32_setleds() */ - -#define BOARD_LED1_BIT (1 << BOARD_LED1) -#define BOARD_LED2_BIT (1 << BOARD_LED2) - -/* If CONFIG_ARCH_LEDs is defined, then NuttX will control the 2 LEDs on board the - * omnibusf4sd. The following definitions describe how NuttX controls the LEDs: - */ - -#define LED_STARTED 0 /* LED1 */ -#define LED_HEAPALLOCATE 1 /* LED2 */ -#define LED_IRQSENABLED 2 /* LED1 */ -#define LED_STACKCREATED 3 /* LED1 + LED2 */ -#define LED_INIRQ 4 /* LED1 */ -#define LED_SIGNAL 5 /* LED2 */ -#define LED_ASSERTION 6 /* LED1 + LED2 */ -#define LED_PANIC 7 /* LED1 + LED2 */ - -/* Alternate function pin selections ************************************************/ - -/* UART1: - * - * PA10 (RX) and PA9 (TX) are broken out on J5 - */ - -#define GPIO_USART1_RX GPIO_USART1_RX_1 -#define GPIO_USART1_TX GPIO_USART1_TX_1 - -/* USART3: - * - * PC10 (TX) and PC11 (RX) are broken out on J4 - * - * However, this port is shared with SPI3 which contains the BMP280 and MAX7456 - * - * The Silkscreen pin labeled SCL is TX - * MISO is RX - */ -//#define GPIO_USART3_RX GPIO_USART3_RX_2 -//#define GPIO_USART3_TX GPIO_USART3_TX_2 - -/* UART4: - * - * PA0 (TX) -- Labeled RSSI on the silkscreen is only broken out on a test pad - * on the pro version. It's on a 2.54mm header on other versions - * PA1 (RX) -- Motor 5 out - */ -#define GPIO_UART4_RX GPIO_UART4_RX_1 -#define GPIO_UART4_TX GPIO_UART4_TX_1 - -/* UART6: - * - * PC6 (TX) and PC7 (RX) are broken out on J10 - */ - -#define GPIO_USART6_RX GPIO_USART6_RX_1 -#define GPIO_USART6_TX GPIO_USART6_TX_1 - -/* SPI1: - * MPU6000 - * CS: PA4 -- configured in board_config.h - * CLK: PA5 - * MISO: PA6 - * MOSI: PA7 - */ - -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 - -/* SPI2: - * SD Card - * CS: PB12 -- configured in board_config.h - * CLK: PB13 - * MISO: PB14 - * MOSI: PB15 - */ - -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_2 -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 - -/* SPI3: - * BMP280 - * CS: PB3 -- configured in board_config.h - * CLK: PC10 - * MISO: PC11 - * MOSI: PC12 - */ - -#define GPIO_SPI3_SCK GPIO_SPI3_SCK_2 -#define GPIO_SPI3_MISO GPIO_SPI3_MISO_2 -#define GPIO_SPI3_MOSI GPIO_SPI3_MOSI_2 - -/* - * I2C (external) - * - * SCL: PB10 - * SDA: PB11 - * - * TODO: - * The optional _GPIO configurations allow the I2C driver to manually - * reset the bus to clear stuck slaves. They match the pin configuration, - * but are normally-high GPIOs. - */ -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_1 -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_1 - -#endif /* __CONFIG_OMNIBUSF4SD_INCLUDE_BOARD_H */ diff --git a/boards/diatone/mamba-f405-mk2/nuttx-config/include/board_dma_map.h b/boards/diatone/mamba-f405-mk2/nuttx-config/include/board_dma_map.h deleted file mode 100644 index d54cbdf..0000000 --- a/boards/diatone/mamba-f405-mk2/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/* -| DMA1 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | SPI3_RX_1 | - | SPI3_RX_2 | SPI2_RX | SPI2_TX | SPI3_TX_1 | - | SPI3_TX_2 | -| Channel 1 | I2C1_RX | - | TIM7_UP_1 | - | TIM7_UP_2 | I2C1_RX_1 | I2C1_TX | I2C1_TX_1 | -| Channel 2 | TIM4_CH1 | - | I2C4_RX | TIM4_CH2 | - | I2C4_RX | TIM4_UP | TIM4_CH3 | -| Channel 3 | - | TIM2_UP_1 | I2C3_RX_1 | I2C2_EXT_RX | I2C3_TX | TIM2_CH1 | TIM2_CH2 | TIM2_UP_2 | -| | | TIM2_CH3 | | | | | TIM2_CH4_1 | TIM2_CH4_2 | -| Channel 4 | UART5_RX | USART3_RX | UART4_RX | USART3_TX_1 | UART4_TX | USART2_RX | USART2_TX | UART5_TX | -| Channel 5 | UART8_TX | UART7_TX | TIM3_CH4 | UART7_RX | TIM3_CH1 | TIM3_CH2 | UART8_RX | TIM3_CH3 | -| | | | TIM3_UP | | TIM3_TRIG | | | | -| Channel 6 | TIM5_CH3 | TIM5_CH4_1 | TIM5_CH1 | TIM5_CH4_2 | TIM5_CH2 | - | TIM5_UP_2 | - | -| | TIM5_UP_1 | TIM5_TRIG_1 | | TIM5_TRIG_2 | | | | | -| Channel 7 | - | TIM6_UP | I2C2_RX | I2C2_RX_1 | USART3_TX_2 | DAC1 | DAC2 | I2C2_TX | -| | | | | | | | | | -| Usage | | TIM2_UP_1 | TIM3_UP | SPI2_RX | SPI2_TX | | | | - - -| DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | ADC1_1 | SAI1_A | TIM8_CH1_1 | SAI1_A_1 | ADC1_2 | SAI1_B_1 | TIM1_CH1_1 | - | -| | | | TIM8_CH2_1 | | | | TIM1_CH2_1 | | -| | | | TIM8_CH3_1 | | | | TIM1_CH3_1 | | -| Channel 1 | - | DCMI_1 | ADC2_1 | ADC2_2 | SAI1_B | SPI6_TX | SPI6_RX | DCMI_2 | -| Channel 2 | ADC3_1 | ADC3_2 | - | SPI5_RX_1 | SPI5_TX_1 | CRYP_OUT | CRYP_IN | HASH_IN | -| Channel 3 | SPI1_RX_1 | - | SPI1_RX_2 | SPI1_TX_1 | - | SPI1_TX_2 | - | QUADSPI | -| Channel 4 | SPI4_RX_1 | SPI4_TX_1 | USART1_RX_1 | SDIO | - | USART1_RX_2 | SDIO | USART1_TX | -| Channel 5 | - | USART6_RX_1 | USART6_RX_2 | SPI4_RX_2 | SPI4_TX_2 | - | USART6_TX_1 | USART6_TX_2 | -| Channel 6 | TIM1_TRIG_1 | TIM1_CH1_2 | TIM1_CH2_2 | TIM1_CH1 | TIM1_CH4 | TIM1_UP | TIM1_CH3_2 | - | -| | | | | | TIM1_TRIG_2 | | | | -| | | | | | TIM1_COM | | | | -| Channel 7 | - | TIM8_UP | TIM8_CH1_2 | TIM8_CH2_2 | TIM8_CH3_2 | SPI5_RX_2 | SPI5_TX_2 | TIM8_CH4 | -| | | | | | | | | TIM8_TRIG | -| | | | | | | | | TIM8_COM | -| | | | | | | | | | -| Usage | SPI1_RX_1 | USART6_RX_1 | USART1_RX_1 | SPI1_TX_1 | | | SDIO | | - */ - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// AVAILABLE // DMA2, Stream 0 -// DMAMAP_TIM2_UP // DMA1, Stream 1, Channel 3 (DSHOT) -// DMAMAP_TIM3_UP // DMA1, Stream 2, Channel 5 (DSHOT) -#define DMACHAN_SPI2_RX DMAMAP_SPI2_RX // DMA1, Stream 3, Channel 0 (SPI2 RX) -#define DMACHAN_SPI2_TX DMAMAP_SPI2_TX // DMA1, Stream 4, Channel 0 (SPI2 TX) -// AVAILABLE // DMA2, Stream 5 -// AVAILABLE // DMA2, Stream 6 -// AVAILABLE // DMA2, Stream 7 - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMACHAN_SPI1_RX DMAMAP_SPI1_RX_1 // DMA2, Stream 0, Channel 3 (SPI1 RX) -#define DMAMAP_USART6_RX DMAMAP_USART6_RX_1 // DMA2, Stream 1, Channel 4 -#define DMAMAP_USART1_RX DMAMAP_USART1_RX_1 // DMA2, Stream 2, Channel 4 -#define DMACHAN_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 3, Channel 3 (SPI1 TX) -// AVAILABLE // DMA2, Stream 4 -// AVAILABLE // DMA2, Stream 5 -#define DMAMAP_SDIO DMAMAP_SDIO_2 // DMA2, Stream 6, Channel 4 -// AVAILABLE // DMA2, Stream 7 diff --git a/boards/diatone/mamba-f405-mk2/nuttx-config/nsh/defconfig b/boards/diatone/mamba-f405-mk2/nuttx-config/nsh/defconfig deleted file mode 100644 index 8fed52b..0000000 --- a/boards/diatone/mamba-f405-mk2/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,187 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_CONSOLE is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_SPI_CALLBACK is not set -# CONFIG_STM32_CCMEXCLUDE is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/diatone/mamba-f405-mk2/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F405RG=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_CUSTOM_LEDS=y -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0001 -CONFIG_CDCACM_PRODUCTSTR="DiatoneMambaF405 MK2" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=2000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="Diatone" -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_DISABLE_MQUEUE=y -CONFIG_DISABLE_POSIX_TIMERS=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MM_REGIONS=2 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_PROGMEM=y -CONFIG_MTD_W25=y -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_DISABLE_BASENAME=y -CONFIG_NSH_DISABLE_DD=y -CONFIG_NSH_DISABLE_DIRNAME=y -CONFIG_NSH_DISABLE_HEXDUMP=y -CONFIG_NSH_DISABLE_LOSETUP=y -CONFIG_NSH_DISABLE_MKFIFO=y -CONFIG_NSH_DISABLE_MKRD=y -CONFIG_NSH_DISABLE_PUT=y -CONFIG_NSH_DISABLE_REBOOT=y -CONFIG_NSH_DISABLE_UNAME=y -CONFIG_NSH_DISABLE_WGET=y -CONFIG_NSH_DISABLE_XD=y -CONFIG_NSH_FATDEVNO=0 -CONFIG_NSH_FILEIOSIZE=512 -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_MMCSDSPIPORTNO=2 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_READLINE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=196608 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32_ADC1=y -CONFIG_STM32_BBSRAM=y -CONFIG_STM32_BBSRAM_FILES=5 -CONFIG_STM32_BKPSRAM=y -CONFIG_STM32_CCMDATARAM=y -CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y -CONFIG_STM32_DMA1=y -CONFIG_STM32_DMA2=y -CONFIG_STM32_FLASH_PREFETCH=y -CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_STM32_I2C2=y -CONFIG_STM32_I2CTIMEOMS=10 -CONFIG_STM32_I2CTIMEOTICKS=10 -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_OTGFS=y -CONFIG_STM32_PWR=y -CONFIG_STM32_RTC=y -CONFIG_STM32_RTC_HSECLOCK=y -CONFIG_STM32_RTC_MAGIC_REG=1 -CONFIG_STM32_SAVE_CRASHDUMP=y -CONFIG_STM32_SDIO=y -CONFIG_STM32_SDIO_CARD=y -CONFIG_STM32_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32_SPI1=y -CONFIG_STM32_SPI1_DMA=y -CONFIG_STM32_SPI1_DMA_BUFFER=512 -CONFIG_STM32_SPI2=y -CONFIG_STM32_SPI2_DMA=y -CONFIG_STM32_SPI3=y -CONFIG_STM32_SPI_DMATHRESHOLD=8 -CONFIG_STM32_TIM1=y -CONFIG_STM32_TIM5=y -CONFIG_STM32_UART4=y -CONFIG_STM32_USART1=y -CONFIG_STM32_USART6=y -CONFIG_STM32_USART_BREAKS=y -CONFIG_STM32_USART_SINGLEWIRE=y -CONFIG_STM32_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=600 -CONFIG_USART1_RXBUFSIZE=300 -CONFIG_USART1_RXDMA=y -CONFIG_USART1_TXBUFSIZE=300 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=300 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/diatone/mamba-f405-mk2/nuttx-config/scripts/script.ld b/boards/diatone/mamba-f405-mk2/nuttx-config/scripts/script.ld deleted file mode 100644 index c1d3ec6..0000000 --- a/boards/diatone/mamba-f405-mk2/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************** - * configs/omnibus-f4sd/scripts/ld.script - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F405RG has 1024Kb of FLASH beginning at address 0x0800:0000 and - * 192Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of CCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 16 KiB of flash is reserved for the bootloader. - * Paramater storage will use the next 16KiB Sector. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08008000, LENGTH = 992K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - ccsram (rwx) : ORIGIN = 0x10000000, LENGTH = 64K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/diatone/mamba-f405-mk2/src/CMakeLists.txt b/boards/diatone/mamba-f405-mk2/src/CMakeLists.txt deleted file mode 100644 index 4212b7e..0000000 --- a/boards/diatone/mamba-f405-mk2/src/CMakeLists.txt +++ /dev/null @@ -1,50 +0,0 @@ -############################################################################ -# -# Copyright (c) 2018 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. -# -############################################################################ - -add_library(drivers_board - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - usb.c -) - -target_link_libraries(drivers_board - PRIVATE - arch_spi - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer -) diff --git a/boards/diatone/mamba-f405-mk2/src/board_config.h b/boards/diatone/mamba-f405-mk2/src/board_config.h deleted file mode 100644 index 7c2b17d..0000000 --- a/boards/diatone/mamba-f405-mk2/src/board_config.h +++ /dev/null @@ -1,204 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2018, 2014 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * boards internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ -/* Configuration ************************************************************************************/ - -/* omnibusf4sd GPIOs ***********************************************************************************/ -/* LEDs */ -// power - green -// LED1 - PB5 - blue -#define GPIO_LED1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN5) -#define GPIO_LED_BLUE GPIO_LED1 - -#define BOARD_OVERLOAD_LED LED_BLUE - -#define FLASH_BASED_PARAMS - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that can be used by the Px4 Firmware in the adc driver - */ -#define ADC_CHANNELS (1 << 0) | (1 << 11) | (1 << 12) - -#define ADC_BATTERY_VOLTAGE_CHANNEL 11 -#define ADC_BATTERY_CURRENT_CHANNEL 13 -#define ADC_RC_RSSI_CHANNEL 12 - -/* Define Battery 1 Voltage Divider and A per V - */ -#define BOARD_BATTERY1_V_DIV (11.12f) -#define BOARD_BATTERY1_A_PER_V (31.f) - -/* User GPIOs - * - * GPIO0-5 are the PWM servo outputs. - * GPIO_TIM3_CH3OUT GPIO_TIM3_CH3OUT_1 //PB0 S1_OUT D1_ST7 - * GPIO_TIM3_CH4OUT GPIO_TIM3_CH4OUT_1 //PB1 S2_OUT D1_ST2 - * GPIO_TIM2_CH4OUT GPIO_TIM2_CH4OUT_1 //PA3 S3_OUT D1_ST6 - * GPIO_TIM2_CH3OUT GPIO_TIM2_CH3OUT_1 //PA2 S4_OUT D1_ST1 - * GPIO_TIM5_CH2OUT GPIO_TIM5_CH2OUT_1 //PA1 S5_OUT - * GPIO_TIM1_CH1OUT GPIO_TIM1_CH1OUT_1 //PA8 S6_OUT - */ - -#define _MK_GPIO_INPUT(def) (((def) & (GPIO_PORT_MASK | GPIO_PIN_MASK)) | (GPIO_INPUT|GPIO_PULLUP)) - -#define GPIO_GPIO0_INPUT _MK_GPIO_INPUT(GPIO_TIM3_CH3IN) -#define GPIO_GPIO1_INPUT _MK_GPIO_INPUT(GPIO_TIM3_CH4IN) -#define GPIO_GPIO2_INPUT _MK_GPIO_INPUT(GPIO_TIM2_CH3IN) -#define GPIO_GPIO3_INPUT _MK_GPIO_INPUT(GPIO_TIM2_CH4IN) -//#define GPIO_GPIO4_INPUT _MK_GPIO_INPUT(GPIO_TIM5_CH2IN) -//#define GPIO_GPIO5_INPUT _MK_GPIO_INPUT(GPIO_TIM1_CH1IN) - -#define _MK_GPIO_OUTPUT(def) (((def) & (GPIO_PORT_MASK | GPIO_PIN_MASK)) | (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR)) - -#define GPIO_GPIO0_OUTPUT _MK_GPIO_OUTPUT(GPIO_TIM3_CH3OUT) -#define GPIO_GPIO1_OUTPUT _MK_GPIO_OUTPUT(GPIO_TIM3_CH4OUT) -#define GPIO_GPIO2_OUTPUT _MK_GPIO_OUTPUT(GPIO_TIM2_CH3OUT) -#define GPIO_GPIO3_OUTPUT _MK_GPIO_OUTPUT(GPIO_TIM2_CH4OUT) -//#define GPIO_GPIO4_OUTPUT _MK_GPIO_OUTPUT(GPIO_TIM5_CH2OUT) -//#define GPIO_GPIO5_OUTPUT _MK_GPIO_OUTPUT(GPIO_TIM1_CH1OUT) - -/* USB OTG FS - * - * PA9 OTG_FS_VBUS VBUS sensing - */ -#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTC|GPIO_PIN5) - -/* PWM - * - * Alternatively CH3/CH4 could be assigned to UART6_TX/RX - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 4 -#define DIRECT_INPUT_TIMER_CHANNELS 4 - -// Has pwm outputs -#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS - -/* High-resolution timer */ -#define HRT_TIMER 4 // T4C1 -#define HRT_TIMER_CHANNEL 1 // use capture/compare channel 1 - -#define HRT_PPM_CHANNEL 3 // capture/compare channel 3 -#define GPIO_PPM_IN (GPIO_ALT|GPIO_AF2|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN8) - -#define RC_SERIAL_PORT "/dev/ttyS0" -#define BOARD_SUPPORTS_RC_SERIAL_PORT_OUTPUT - -/* - * One RC_IN - * - * GPIO PPM_IN on PB8 T4CH3 - * SPEKTRUM_RX (it's TX or RX in Bind) on PA10 UART1 - * The FMU can drive GPIO PPM_IN as an output - */ -// TODO? -//#define GPIO_PPM_IN_AS_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN6) -//#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_PPM_IN_AS_OUT) -//#define SPEKTRUM_RX_AS_UART() px4_arch_configgpio(GPIO_USART1_RX) -//#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true)) - -#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -#define BOARD_HAS_ON_RESET 1 - -#define BOARD_ENABLE_CONSOLE_BUFFER -#define BOARD_CONSOLE_BUFFER_SIZE (1024*2) - - -__BEGIN_DECLS - -/**************************************************************************************************** - * Public Types - ****************************************************************************************************/ - -/**************************************************************************************************** - * Public data - ****************************************************************************************************/ - -#ifndef __ASSEMBLY__ - -/**************************************************************************************************** - * Public Functions - ****************************************************************************************************/ - -/**************************************************************************************************** - * Name: stm32_spiinitialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the PX4FMU board. - * - ****************************************************************************************************/ - -extern void stm32_spiinitialize(void); - - -/**************************************************************************************************** - * Name: stm32_usbinitialize - * - * Description: - * Called to configure USB IO. - * - ****************************************************************************************************/ - -extern void stm32_usbinitialize(void); - -extern void board_peripheral_reset(int ms); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/diatone/mamba-f405-mk2/src/i2c.cpp b/boards/diatone/mamba-f405-mk2/src/i2c.cpp deleted file mode 100644 index 3cf7e2e..0000000 --- a/boards/diatone/mamba-f405-mk2/src/i2c.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(2), -}; diff --git a/boards/diatone/mamba-f405-mk2/src/init.c b/boards/diatone/mamba-f405-mk2/src/init.c deleted file mode 100644 index ad2a64f..0000000 --- a/boards/diatone/mamba-f405-mk2/src/init.c +++ /dev/null @@ -1,343 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-2018 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * mambaf405mk2-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include "board_config.h" -#include - -#include - -#include -#include - -#include - -#include -#include -#include - -# if defined(FLASH_BASED_PARAMS) -# include -#endif - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/**************************************************************************** - * Protected Functions - ****************************************************************************/ -/**************************************************************************** - * Public Functions - ****************************************************************************/ -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - UNUSED(ms); -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - /* configure the GPIO pins to outputs and keep them low */ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(io_timer_channel_get_gpio_output(i)); - } - - /* On resets invoked from system (not boot) insure we establish a low - * output state (discharge the pins) on PWM pins before they become inputs. - */ - - if (status >= 0) { - up_mdelay(400); - } -} - -/************************************************************************************ - * 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 all PWM to Low outputs */ - - board_on_reset(-1); - - /* configure LEDs */ - board_autoled_initialize(); - - - /* configure ADC pins */ - stm32_configgpio(GPIO_ADC1_IN11); /* BATT_VOLTAGE_SENS */ - stm32_configgpio(GPIO_ADC1_IN13); /* BATT_CURRENT_SENS */ - stm32_configgpio(GPIO_ADC1_IN12); /* RSSI analog in (TX of UART4 instead) */ - - // TODO: power peripherals - ///* configure power supply control/sense pins */ - //stm32_configgpio(GPIO_PERIPH_3V3_EN); - //stm32_configgpio(GPIO_VDD_BRICK_VALID); - //stm32_configgpio(GPIO_VDD_USB_VALID); - - // TODO: 3v3 Sensor? - ///* Start with Sensor voltage off We will enable it - // * in board_app_initialize - // */ - //stm32_configgpio(GPIO_VDD_3V3_SENSORS_EN); - - // TODO: SBUS inversion? SPEK power? - //stm32_configgpio(GPIO_SBUS_INV); - //stm32_configgpio(GPIO_SPEKTRUM_PWR_EN); - - // TODO: $$$ Unused? - //stm32_configgpio(GPIO_8266_GPIO0); - //stm32_configgpio(GPIO_8266_PD); - //stm32_configgpio(GPIO_8266_RST); - - /* Safety - led don in led driver */ - - // TODO: unused? - //stm32_configgpio(GPIO_BTN_SAFETY); - - // TODO: RSSI - //stm32_configgpio(GPIO_RSSI_IN); - - stm32_configgpio(GPIO_PPM_IN); - - /* configure SPI all interfaces GPIO */ - - stm32_spiinitialize(); - -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -static struct spi_dev_s *spi1; -static struct spi_dev_s *spi2; -static struct spi_dev_s *spi3; - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - px4_platform_init(); - - /* configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_BLUE); - } - - - /* Configure SPI-based devices */ - - // SPI1: MPU6000 - spi1 = stm32_spibus_initialize(1); - - if (!spi1) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 1\n"); - led_on(LED_BLUE); - return -ENODEV; - } - - /* Default SPI1 to 1MHz and de-assert the known chip selects. */ - SPI_SETFREQUENCY(spi1, 10000000); - SPI_SETBITS(spi1, 8); - SPI_SETMODE(spi1, SPIDEV_MODE3); - up_udelay(20); - - // SPI2: SDCard - /* Get the SPI port for the microSD slot */ - spi2 = stm32_spibus_initialize(CONFIG_NSH_MMCSDSPIPORTNO); - - if (!spi2) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", CONFIG_NSH_MMCSDSPIPORTNO); - led_on(LED_BLUE); - return -ENODEV; - } - - /* Now bind the SPI interface to the MMCSD driver */ - int result = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi2); - - if (result != OK) { - led_on(LED_BLUE); - syslog(LOG_ERR, "[boot] FAILED to bind SPI port 2 to the MMCSD driver\n"); - return -ENODEV; - } - - up_udelay(20); - - - // SPI3: OSD / Baro - spi3 = stm32_spibus_initialize(3); - - if (!spi3) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 3\n"); - led_on(LED_BLUE); - return -ENODEV; - } - - /* Copied from fmu-v4 - * Default SPI3 to 12MHz and de-assert the known chip selects. - * MS5611 has max SPI clock speed of 20MHz - */ - - // BMP280 max SPI speed is 10 MHz - SPI_SETFREQUENCY(spi3, 10 * 1000 * 1000); - SPI_SETBITS(spi3, 8); - SPI_SETMODE(spi3, SPIDEV_MODE3); - up_udelay(20); - -#if defined(FLASH_BASED_PARAMS) - static sector_descriptor_t params_sector_map[] = { - {1, 16 * 1024, 0x08004000}, - {0, 0, 0}, - }; - - /* Initialize the flashfs layer to use heap allocated memory */ - result = parameter_flashfs_init(params_sector_map, NULL, 0); - - if (result != OK) { - syslog(LOG_ERR, "[boot] FAILED to init params in FLASH %d\n", result); - led_on(LED_AMBER); - return -ENODEV; - } - -#endif - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/diatone/mamba-f405-mk2/src/led.c b/boards/diatone/mamba-f405-mk2/src/led.c deleted file mode 100644 index 463474a..0000000 --- a/boards/diatone/mamba-f405-mk2/src/led.c +++ /dev/null @@ -1,120 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2018 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * omnibusf4sd LED backend. - */ - -#include - -#include - -#include "stm32.h" -#include "board_config.h" - -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -static uint32_t g_ledmap[] = { - GPIO_LED_BLUE, -}; - -__EXPORT void led_init(void) -{ - /* Configure LED GPIOs for output */ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - stm32_configgpio(g_ledmap[l]); - } -} - -static void phy_set_led(int led, bool state) -{ - /* Pull Down to switch on */ - if (led == 0) { - stm32_gpiowrite(g_ledmap[led], !state); - } -} - -__EXPORT void led_on(int led) -{ - phy_set_led(led, true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(led, false); -} - -__EXPORT void led_toggle(int led) -{ - if (led == 0) { - phy_set_led(led, !stm32_gpioread(g_ledmap[led])); - } -} - -__EXPORT void board_autoled_initialize(void) -{ - /* Configure LED1 GPIO for output */ - stm32_configgpio(GPIO_LED1); -} - -__EXPORT void board_autoled_on(int led) -{ - if (led == 1) { - /* Pull down to switch on */ - stm32_gpiowrite(GPIO_LED1, false); - } -} - -__EXPORT void board_autoled_off(int led) -{ - if (led == 1) { - /* Pull up to switch off */ - stm32_gpiowrite(GPIO_LED1, true); - } -} diff --git a/boards/diatone/mamba-f405-mk2/src/spi.cpp b/boards/diatone/mamba-f405-mk2/src/spi.cpp deleted file mode 100644 index f744b7f..0000000 --- a/boards/diatone/mamba-f405-mk2/src/spi.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2018 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_MPU6000, SPI::CS{GPIO::PortA, GPIO::Pin4}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortA, GPIO::Pin4}), - }), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_OSD_DEVTYPE_ATXXXX, SPI::CS{GPIO::PortB, GPIO::Pin12}), - }), - initSPIBus(SPI::Bus::SPI3, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortB, GPIO::Pin3}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/diatone/mamba-f405-mk2/src/timer_config.cpp b/boards/diatone/mamba-f405-mk2/src/timer_config.cpp deleted file mode 100644 index 8ee6104..0000000 --- a/boards/diatone/mamba-f405-mk2/src/timer_config.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2018 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer3, DMA{DMA::Index1, DMA::Stream2, DMA::Channel5}), - initIOTimer(Timer::Timer2, DMA{DMA::Index1, DMA::Stream1, DMA::Channel3}), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel3}, {GPIO::PortB, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel4}, {GPIO::PortB, GPIO::Pin1}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel3}, {GPIO::PortA, GPIO::Pin2}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel4}, {GPIO::PortA, GPIO::Pin3}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/diatone/mamba-f405-mk2/src/usb.c b/boards/diatone/mamba-f405-mk2/src/usb.c deleted file mode 100644 index 09f0cde..0000000 --- a/boards/diatone/mamba-f405-mk2/src/usb.c +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2018 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include "board_config.h" - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -/************************************************************************************ - * Name: stm32_usbinitialize - * - * Description: - * Called to setup USB-related GPIO pins for the omnibusf4sd 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_STM32_OTGFS - stm32_configgpio(GPIO_OTGFS_VBUS); - /* XXX We only support device mode - stm32_configgpio(GPIO_OTGFS_PWRON); - stm32_configgpio(GPIO_OTGFS_OVER); - */ -#endif -} - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/emlid/navio2/CMakeLists.txt b/boards/emlid/navio2/CMakeLists.txt deleted file mode 100644 index 19a79fa..0000000 --- a/boards/emlid/navio2/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -############################################################################ -# -# Copyright (c) 2018 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. -# -############################################################################ - -add_subdirectory(adc) -add_subdirectory(navio_rgbled) -add_subdirectory(navio_sysfs_rc_in) diff --git a/boards/emlid/navio2/adc/CMakeLists.txt b/boards/emlid/navio2/adc/CMakeLists.txt deleted file mode 100644 index 5562acf..0000000 --- a/boards/emlid/navio2/adc/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -############################################################################ -# -# Copyright (c) 2020 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. -# -############################################################################ - -px4_add_library(arch_adc - adc.cpp -) diff --git a/boards/emlid/navio2/adc/adc.cpp b/boards/emlid/navio2/adc/adc.cpp deleted file mode 100644 index 017c600..0000000 --- a/boards/emlid/navio2/adc/adc.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -#include - -#include - -#include -#include -#include - -#define ADC_SYSFS_PATH "/sys/kernel/rcio/adc" -#define ADC_MAX_CHAN 6 -int _channels_fd[ADC_MAX_CHAN]; - -int px4_arch_adc_init(uint32_t base_address) -{ - for (int i = 0; i < ADC_MAX_CHAN; i++) { - _channels_fd[i] = -1; - } - - return 0; -} - -void px4_arch_adc_uninit(uint32_t base_address) -{ - for (int i = 0; i < ADC_MAX_CHAN; i++) { - ::close(_channels_fd[i]); - _channels_fd[i] = -1; - } -} - -uint32_t px4_arch_adc_sample(uint32_t base_address, unsigned channel) -{ - if (channel > ADC_MAX_CHAN) { - PX4_ERR("channel %d out of range: %d", channel, ADC_MAX_CHAN); - return UINT32_MAX; // error - } - - // open channel if necessary - if (_channels_fd[channel] == -1) { - // ADC_SYSFS_PATH - char channel_path[strlen(ADC_SYSFS_PATH) + 5] {}; - - if (sprintf(channel_path, "%s/ch%d", ADC_SYSFS_PATH, channel) == -1) { - PX4_ERR("adc channel: %d\n", channel); - return UINT32_MAX; // error - } - - _channels_fd[channel] = ::open(channel_path, O_RDONLY); - } - - char buffer[10] {}; - - if (::pread(_channels_fd[channel], buffer, sizeof(buffer), 0) < 0) { - PX4_ERR("read channel %d failed", channel); - return UINT32_MAX; // error - } - - return atoi(buffer); -} - -float px4_arch_adc_reference_v() -{ - return BOARD_ADC_POS_REF_V; -} - -uint32_t px4_arch_adc_dn_fullcount() -{ - return 1 << 12; // 12 bit ADC -} diff --git a/boards/emlid/navio2/cmake/upload.cmake b/boards/emlid/navio2/cmake/upload.cmake deleted file mode 100644 index a6f824f..0000000 --- a/boards/emlid/navio2/cmake/upload.cmake +++ /dev/null @@ -1,47 +0,0 @@ -############################################################################ -# -# Copyright (c) 2020 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. -# -############################################################################ - -if(DEFINED ENV{AUTOPILOT_HOST}) - set(AUTOPILOT_HOST $ENV{AUTOPILOT_HOST}) -else() - set(AUTOPILOT_HOST "navio") -endif() - -add_custom_target(upload - COMMAND rsync -arh --progress - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/rpi/*.config ${PX4_BINARY_DIR}/etc # source - pi@${AUTOPILOT_HOST}:/home/pi/px4 # destination - DEPENDS px4 - COMMENT "uploading px4" - USES_TERMINAL -) diff --git a/boards/emlid/navio2/default.px4board b/boards/emlid/navio2/default.px4board deleted file mode 100644 index bc912f5..0000000 --- a/boards/emlid/navio2/default.px4board +++ /dev/null @@ -1,86 +0,0 @@ -CONFIG_PLATFORM_POSIX=y -CONFIG_BOARD_LINUX_TARGET=y -CONFIG_BOARD_TOOLCHAIN="arm-linux-gnueabihf" -CONFIG_BOARD_ARCHITECTURE="cortex-a53" -CONFIG_BOARD_TESTING=y -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_BAROMETER_MS5611=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU9250=y -CONFIG_DRIVERS_IMU_ST_LSM9DS1=y -CONFIG_DRIVERS_LINUX_PWM_OUT=y -CONFIG_DRIVERS_MAGNETOMETER_HMC5883=y -CONFIG_DRIVERS_MAGNETOMETER_LSM9DS1_MAG=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_BATTERY_SIMULATOR=y -CONFIG_MODULES_SIMULATION_SIMULATOR_MAVLINK=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UUV_ATT_CONTROL=y -CONFIG_MODULES_UUV_POS_CONTROL=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DYN=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SHUTDOWN=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_DYN_HELLO=y -CONFIG_EXAMPLES_FAKE_GPS=y -CONFIG_EXAMPLES_FAKE_IMU=y -CONFIG_EXAMPLES_FAKE_MAGNETOMETER=y -CONFIG_EXAMPLES_HELLO=y -CONFIG_EXAMPLES_PX4_MAVLINK_DEBUG=y -CONFIG_EXAMPLES_PX4_SIMPLE_APP=y -CONFIG_EXAMPLES_WORK_ITEM=y diff --git a/boards/emlid/navio2/include/px4_arch/adc.h b/boards/emlid/navio2/include/px4_arch/adc.h deleted file mode 100644 index c72e7bd..0000000 --- a/boards/emlid/navio2/include/px4_arch/adc.h +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -#define SYSTEM_ADC_BASE 0 // not used - -#define px4_arch_adc_temp_sensor_mask() (0) diff --git a/boards/emlid/navio2/init/rc.board_defaults b/boards/emlid/navio2/init/rc.board_defaults deleted file mode 100644 index 65348c4..0000000 --- a/boards/emlid/navio2/init/rc.board_defaults +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 10.177939394 -param set-default BAT1_A_PER_V 15.391030303 - diff --git a/boards/emlid/navio2/navio_rgbled/CMakeLists.txt b/boards/emlid/navio2/navio_rgbled/CMakeLists.txt deleted file mode 100644 index c97bcea..0000000 --- a/boards/emlid/navio2/navio_rgbled/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ -############################################################################ -# -# Copyright (c) 2016-2020 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. -# -############################################################################ - -px4_add_module( - MODULE navio_rgbled - MAIN navio_rgbled - SRCS - NavioRGBLed.cpp - NavioRGBLed.hpp - DEPENDS - led - px4_work_queue - ) diff --git a/boards/emlid/navio2/navio_rgbled/NavioRGBLed.cpp b/boards/emlid/navio2/navio_rgbled/NavioRGBLed.cpp deleted file mode 100644 index 4cc8213..0000000 --- a/boards/emlid/navio2/navio_rgbled/NavioRGBLed.cpp +++ /dev/null @@ -1,174 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2016-2020 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 "NavioRGBLed.hpp" - -NavioRGBLed::NavioRGBLed() : - ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::lp_default) -{ -}; - -NavioRGBLed::~NavioRGBLed() -{ - ScheduleClear(); - - _ledR.off(); - _ledG.off(); - _ledB.off(); -} - -int NavioRGBLed::init() -{ - _ledR.off(); - _ledG.off(); - _ledB.off(); - - // kick off work queue - ScheduleNow(); - - return PX4_OK; -} - -void NavioRGBLed::Run() -{ - LedControlData led_control_data{}; - - if (_led_controller.update(led_control_data) == 1) { - switch (led_control_data.leds[0].color) { - case led_control_s::COLOR_RED: - _ledR.on(); - _ledG.off(); - _ledB.off(); - break; - - case led_control_s::COLOR_GREEN: - _ledR.off(); - _ledG.on(); - _ledB.off(); - break; - - case led_control_s::COLOR_BLUE: - _ledR.off(); - _ledG.off(); - _ledB.on(); - break; - - case led_control_s::COLOR_AMBER: // make it the same as yellow - case led_control_s::COLOR_YELLOW: - _ledR.on(); - _ledG.on(); - _ledB.off(); - break; - - case led_control_s::COLOR_PURPLE: - _ledR.on(); - _ledG.off(); - _ledB.on(); - break; - - case led_control_s::COLOR_CYAN: - _ledR.off(); - _ledG.on(); - _ledB.on(); - break; - - case led_control_s::COLOR_WHITE: - _ledR.on(); - _ledG.on(); - _ledB.on(); - break; - - default: // led_control_s::COLOR_OFF - _ledR.off(); - _ledG.off(); - _ledB.off(); - break; - } - } - - /* re-queue ourselves to run again later */ - ScheduleDelayed(_led_controller.maximum_update_interval()); -} - -int NavioRGBLed::custom_command(int argc, char *argv[]) -{ - return print_usage("unknown command"); -} - -int NavioRGBLed::task_spawn(int argc, char *argv[]) -{ - NavioRGBLed *instance = new NavioRGBLed(); - - if (instance) { - _object.store(instance); - _task_id = task_id_is_work_queue; - - if (instance->init() == PX4_OK) { - return PX4_OK; - } - - } else { - PX4_ERR("alloc failed"); - } - - delete instance; - _object.store(nullptr); - _task_id = -1; - - return PX4_ERROR; -} - -int NavioRGBLed::print_usage(const char *reason) -{ - if (reason) { - PX4_WARN("%s\n", reason); - } - - PRINT_MODULE_DESCRIPTION( - R"DESCR_STR( -### Description -Emlid Navio2 RGB LED driver. - -)DESCR_STR"); - - PRINT_MODULE_USAGE_NAME("navio_rgbled", "driver"); - PRINT_MODULE_USAGE_COMMAND("start"); - PRINT_MODULE_USAGE_DEFAULT_COMMANDS(); - - return 0; -} - -extern "C" __EXPORT int navio_rgbled_main(int argc, char *argv[]) -{ - return NavioRGBLed::main(argc, argv); -} diff --git a/boards/emlid/navio2/navio_rgbled/NavioRGBLed.hpp b/boards/emlid/navio2/navio_rgbled/NavioRGBLed.hpp deleted file mode 100644 index 01bcc26..0000000 --- a/boards/emlid/navio2/navio_rgbled/NavioRGBLed.hpp +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2016-2020 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. - * - ****************************************************************************/ - -#pragma once - -#include -#include -#include -#include - -#include - -class NavioRGBLed : public ModuleBase, public px4::ScheduledWorkItem -{ -public: - NavioRGBLed(); - ~NavioRGBLed() override; - - /** @see ModuleBase */ - static int task_spawn(int argc, char *argv[]); - - /** @see ModuleBase */ - static int custom_command(int argc, char *argv[]); - - /** @see ModuleBase */ - static int print_usage(const char *reason = nullptr); - - int init(); - -private: - - void Run() override; - - LedController _led_controller; - - - class SysRGBLED - { - public: - explicit SysRGBLED(const char *path) : _fd(open(path, O_WRONLY)) {} - ~SysRGBLED() { close(_fd); } - - bool on() { return (write(_fd, "0", 1) > 0); } - bool off() { return (write(_fd, "1", 1) > 0); } - - private: - int _fd{-1}; - }; - - SysRGBLED _ledR{"/sys/class/leds/rgb_led0/brightness"}; - SysRGBLED _ledG{"/sys/class/leds/rgb_led1/brightness"}; - SysRGBLED _ledB{"/sys/class/leds/rgb_led2/brightness"}; -}; diff --git a/boards/emlid/navio2/navio_sysfs_rc_in/CMakeLists.txt b/boards/emlid/navio2/navio_sysfs_rc_in/CMakeLists.txt deleted file mode 100644 index d05dabc..0000000 --- a/boards/emlid/navio2/navio_sysfs_rc_in/CMakeLists.txt +++ /dev/null @@ -1,42 +0,0 @@ -############################################################################ -# -# Copyright (c) 2016-2020 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. -# -############################################################################ -px4_add_module( - MODULE navio_sysfs_rc_in - MAIN navio_sysfs_rc_in - SRCS - NavioSysRCInput.cpp - NavioSysRCInput.hpp - navio_sysfs_rc_in_main.cpp - DEPENDS - px4_work_queue -) diff --git a/boards/emlid/navio2/navio_sysfs_rc_in/NavioSysRCInput.cpp b/boards/emlid/navio2/navio_sysfs_rc_in/NavioSysRCInput.cpp deleted file mode 100644 index 3c8691d..0000000 --- a/boards/emlid/navio2/navio_sysfs_rc_in/NavioSysRCInput.cpp +++ /dev/null @@ -1,174 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2015 Mark Charlebois. All rights reserved. - * Copyright (C) 2016 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 "NavioSysRCInput.hpp" - -#include -#include -#include - -using namespace time_literals; - -namespace navio_sysfs_rc_in -{ - -NavioSysRCInput::NavioSysRCInput() : - ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::hp_default) -{ - _isRunning = true; -}; - -NavioSysRCInput::~NavioSysRCInput() -{ - ScheduleClear(); - - _isRunning = false; - - for (int i = 0; i < CHANNELS; ++i) { - ::close(_channel_fd[i]); - } - - ::close(_connected_fd); - - perf_free(_publish_interval_perf); -} - -int NavioSysRCInput::navio_rc_init() -{ - _connected_fd = ::open("/sys/kernel/rcio/rcin/connected", O_RDONLY); - - for (int i = 0; i < CHANNELS; ++i) { - char buf[80] {}; - ::snprintf(buf, sizeof(buf), "%s/ch%d", "/sys/kernel/rcio/rcin", i); - int fd = ::open(buf, O_RDONLY); - - if (fd < 0) { - PX4_ERR("open %s (%d) failed", buf, i); - break; - } - - _channel_fd[i] = fd; - } - - return PX4_OK; -} - -int NavioSysRCInput::start() -{ - navio_rc_init(); - - _should_exit.store(false); - - ScheduleOnInterval(10_ms); // 100 Hz - - return PX4_OK; -} - -void NavioSysRCInput::stop() -{ - _should_exit.store(true); -} - -void NavioSysRCInput::Run() -{ - if (_should_exit.load()) { - ScheduleClear(); - return; - } - - char connected_buf[12] {}; - int ret_connected = ::pread(_connected_fd, connected_buf, sizeof(connected_buf) - 1, 0); - - if (ret_connected < 0) { - return; - } - - input_rc_s data{}; - - connected_buf[sizeof(connected_buf) - 1] = '\0'; - _connected = (atoi(connected_buf) == 1); - - data.rc_lost = !_connected; - - uint64_t timestamp_sample = hrt_absolute_time(); - - for (int i = 0; i < CHANNELS; ++i) { - char buf[12] {}; - int res = ::pread(_channel_fd[i], buf, sizeof(buf) - 1, 0); - - if (res < 0) { - continue; - } - - buf[sizeof(buf) - 1] = '\0'; - - data.values[i] = atoi(buf); - } - - // check if all channels are 0 - bool all_zero = true; - - for (int i = 0; i < CHANNELS; ++i) { - if (data.values[i] != 0) { - all_zero = false; - } - } - - if (all_zero) { - return; - } - - data.timestamp_last_signal = timestamp_sample; - data.channel_count = CHANNELS; - data.input_source = input_rc_s::RC_INPUT_SOURCE_PX4FMU_PPM; - data.link_quality = -1; - data.rssi_dbm = NAN; - - data.timestamp = hrt_absolute_time(); - - _input_rc_pub.publish(data); - perf_count(_publish_interval_perf); -} - -int NavioSysRCInput::print_status() -{ - PX4_INFO("Running"); - PX4_INFO("connected: %d", _connected); - - perf_print_counter(_publish_interval_perf); - - return 0; -} - -}; // namespace navio_sysfs_rc_in diff --git a/boards/emlid/navio2/navio_sysfs_rc_in/NavioSysRCInput.hpp b/boards/emlid/navio2/navio_sysfs_rc_in/NavioSysRCInput.hpp deleted file mode 100644 index 08601b9..0000000 --- a/boards/emlid/navio2/navio_sysfs_rc_in/NavioSysRCInput.hpp +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2015 Mark Charlebois. All rights reserved. - * Copyright (C) 2016 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. - * - ****************************************************************************/ - -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace navio_sysfs_rc_in -{ - -class NavioSysRCInput : public px4::ScheduledWorkItem -{ -public: - NavioSysRCInput(); - ~NavioSysRCInput() override; - - /* @return 0 on success, -errno on failure */ - int start(); - - /* @return 0 on success, -errno on failure */ - void stop(); - - int print_status(); - - bool isRunning() { return _isRunning; } - -private: - void Run() override; - - int navio_rc_init(); - - px4::atomic_bool _should_exit{false}; - - bool _isRunning{false}; - - uORB::PublicationMulti _input_rc_pub{ORB_ID(input_rc)}; - - static constexpr int CHANNELS{14}; - int _channel_fd[CHANNELS] {}; - int _connected_fd{-1}; - - bool _connected{false}; - - perf_counter_t _publish_interval_perf{perf_alloc(PC_INTERVAL, MODULE_NAME": publish interval")}; -}; - -}; // namespace navio_sysfs_rc_in diff --git a/boards/emlid/navio2/navio_sysfs_rc_in/navio_sysfs_rc_in_main.cpp b/boards/emlid/navio2/navio_sysfs_rc_in/navio_sysfs_rc_in_main.cpp deleted file mode 100644 index ea3c8e3..0000000 --- a/boards/emlid/navio2/navio_sysfs_rc_in/navio_sysfs_rc_in_main.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2015 Mark Charlebois. All rights reserved. - * Copyright (C) 2016 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 -#include - -#include "NavioSysRCInput.hpp" - -namespace navio_sysfs_rc_in -{ - -static void usage(const char *reason) -{ - if (reason) { - PX4_ERR("%s", reason); - } - - PX4_INFO("usage: navio_sysfs_rc_in {start|stop|status}"); -} - -static NavioSysRCInput *rc_input = nullptr; - -extern "C" __EXPORT int navio_sysfs_rc_in_main(int argc, char *argv[]) -{ - if (argc < 2) { - usage("missing command"); - return 1; - } - - if (!strcmp(argv[1], "start")) { - - if (rc_input != nullptr && rc_input->isRunning()) { - PX4_WARN("already running"); - /* this is not an error */ - return 0; - } - - rc_input = new NavioSysRCInput(); - - // Check if alloc worked. - if (rc_input == nullptr) { - PX4_ERR("alloc failed"); - return -1; - } - - int ret = rc_input->start(); - - if (ret != 0) { - PX4_ERR("start failed"); - } - - return 0; - } - - if (!strcmp(argv[1], "stop")) { - - if (rc_input == nullptr || !rc_input->isRunning()) { - PX4_WARN("not running"); - /* this is not an error */ - return 0; - } - - rc_input->stop(); - - // Wait for task to die - int i = 0; - - do { - /* wait up to 3s */ - usleep(100000); - - } while (rc_input->isRunning() && ++i < 30); - - delete rc_input; - rc_input = nullptr; - - return 0; - } - - if (!strcmp(argv[1], "status")) { - if (rc_input != nullptr) { - rc_input->print_status(); - - } else { - PX4_INFO("not running"); - } - - return 0; - } - - usage("unrecognized command"); - return 1; - -} - -}; // namespace navio_sysfs_rc_in diff --git a/boards/emlid/navio2/src/CMakeLists.txt b/boards/emlid/navio2/src/CMakeLists.txt deleted file mode 100644 index e3ddbe4..0000000 --- a/boards/emlid/navio2/src/CMakeLists.txt +++ /dev/null @@ -1,38 +0,0 @@ -############################################################################ -# -# Copyright (c) 2017 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. -# -############################################################################ - -add_library(drivers_board - board_pwm_out.cpp - i2c.cpp - spi.cpp -) diff --git a/boards/emlid/navio2/src/board_config.h b/boards/emlid/navio2/src/board_config.h deleted file mode 100644 index 6d8c1ef..0000000 --- a/boards/emlid/navio2/src/board_config.h +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2017 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * Emlid Navio2 internal definitions - */ - -#pragma once - -#define BOARD_OVERRIDE_UUID "RPIID00000000000" // must be of length 16 -#define PX4_SOC_ARCH_ID PX4_SOC_ARCH_ID_RPI - -#define BOARD_MAX_LEDS 1 // Number of external LED's this board has - - -// I2C -#define CONFIG_I2C 1 -#define PX4_NUMBER_I2C_BUSES 1 - - -// SPI -#define CONFIG_SPI 1 - -// ADC channels: -// A0 - board voltage (shows 5V) -// A1 - servo rail voltage -// A2 - power module voltage (ADC0, POWER port) -// A3 - power module current (ADC1, POWER port) -// A4 - ADC2 (ADC port) -// A5 - ADC3 (ADC port) -#define ADC_CHANNELS (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5) -#define BOARD_ADC_POS_REF_V (4.096f) // TODO: need confirmation - -#define ADC_BATTERY_VOLTAGE_CHANNEL 2 -#define ADC_BATTERY_CURRENT_CHANNEL 3 -#define ADC_5V_RAIL_SENSE 0 - - -#include -#include diff --git a/boards/emlid/navio2/src/board_pwm_out.cpp b/boards/emlid/navio2/src/board_pwm_out.cpp deleted file mode 100644 index bd6d7a6..0000000 --- a/boards/emlid/navio2/src/board_pwm_out.cpp +++ /dev/null @@ -1,156 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2017 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. - * - ****************************************************************************/ -#ifndef MODULE_NAME -#define MODULE_NAME "navio_sysfs_pwm_out" -#endif - -#include "board_pwm_out.h" - -#include -#include -#include -#include - -using namespace pwm_out; - -const char NavioSysfsPWMOut::_device[] = "/sys/class/pwm/pwmchip0"; - -NavioSysfsPWMOut::NavioSysfsPWMOut(int max_num_outputs) -{ - if (max_num_outputs > MAX_NUM_PWM) { - PX4_WARN("number of outputs too large. Setting to %i", MAX_NUM_PWM); - max_num_outputs = MAX_NUM_PWM; - } - - for (int i = 0; i < MAX_NUM_PWM; ++i) { - _pwm_fd[i] = -1; - } - - _pwm_num = max_num_outputs; -} - -NavioSysfsPWMOut::~NavioSysfsPWMOut() -{ - for (int i = 0; i < MAX_NUM_PWM; ++i) { - if (_pwm_fd[i] != -1) { - ::close(_pwm_fd[i]); - } - } -} - -int NavioSysfsPWMOut::init() -{ - int i; - char path[128]; - - for (i = 0; i < _pwm_num; ++i) { - ::snprintf(path, sizeof(path), "%s/export", _device); - - if (pwm_write_sysfs(path, i) < 0) { - PX4_ERR("PWM export failed"); - } - } - - for (i = 0; i < _pwm_num; ++i) { - ::snprintf(path, sizeof(path), "%s/pwm%u/enable", _device, i); - - if (pwm_write_sysfs(path, 1) < 0) { - PX4_ERR("PWM enable failed"); - } - } - - for (i = 0; i < _pwm_num; ++i) { - ::snprintf(path, sizeof(path), "%s/pwm%u/period", _device, i); - - if (pwm_write_sysfs(path, (int)1e9 / FREQUENCY_PWM)) { - PX4_ERR("PWM period failed"); - } - } - - for (i = 0; i < _pwm_num; ++i) { - ::snprintf(path, sizeof(path), "%s/pwm%u/duty_cycle", _device, i); - _pwm_fd[i] = ::open(path, O_WRONLY | O_CLOEXEC); - - if (_pwm_fd[i] == -1) { - PX4_ERR("PWM: Failed to open duty_cycle."); - return -errno; - } - } - - return 0; -} - -int NavioSysfsPWMOut::send_output_pwm(const uint16_t *pwm, int num_outputs) -{ - char data[16]; - - if (num_outputs > _pwm_num) { - num_outputs = _pwm_num; - } - - int ret = 0; - - //convert this to duty_cycle in ns - for (int i = 0; i < num_outputs; ++i) { - int n = ::snprintf(data, sizeof(data), "%u", pwm[i] * 1000); - int write_ret = ::write(_pwm_fd[i], data, n); - - if (n != write_ret) { - ret = -1; - } - } - - return ret; -} - -int NavioSysfsPWMOut::pwm_write_sysfs(char *path, int value) -{ - int fd = ::open(path, O_WRONLY | O_CLOEXEC); - int n; - char data[16]; - - if (fd == -1) { - return -errno; - } - - n = ::snprintf(data, sizeof(data), "%u", value); - - if (n > 0) { - n = ::write(fd, data, n); // This n is not used, but to avoid a compiler error. - } - - ::close(fd); - - return 0; -} - diff --git a/boards/emlid/navio2/src/board_pwm_out.h b/boards/emlid/navio2/src/board_pwm_out.h deleted file mode 100644 index 66de6ff..0000000 --- a/boards/emlid/navio2/src/board_pwm_out.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2017 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. - * - ****************************************************************************/ - -#pragma once - -#include - -#define BOARD_PWM_OUT_IMPL NavioSysfsPWMOut - -namespace pwm_out -{ - -/** - ** class NavioSysfsPWMOut - * PWM output class for Navio Sysfs - */ -class NavioSysfsPWMOut : public PWMOutBase -{ -public: - NavioSysfsPWMOut(int max_num_outputs); - virtual ~NavioSysfsPWMOut(); - - int init() override; - - int send_output_pwm(const uint16_t *pwm, int num_outputs) override; - -private: - int pwm_write_sysfs(char *path, int value); - - static const int MAX_NUM_PWM = 14; - static const int FREQUENCY_PWM = 400; - - int _pwm_fd[MAX_NUM_PWM]; - int _pwm_num; - - static const char _device[]; -}; - -} diff --git a/boards/emlid/navio2/src/i2c.cpp b/boards/emlid/navio2/src/i2c.cpp deleted file mode 100644 index e9f26f9..0000000 --- a/boards/emlid/navio2/src/i2c.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), -}; diff --git a/boards/emlid/navio2/src/spi.cpp b/boards/emlid/navio2/src/spi.cpp deleted file mode 100644 index a5d046a..0000000 --- a/boards/emlid/navio2/src/spi.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(0, { - // spidev0.0 - ublox m8n - initSPIDevice(DRV_IMU_DEVTYPE_MPU9250, 1), - initSPIDevice(DRV_MAG_DEVTYPE_ST_LSM9DS1_M, 2), - initSPIDevice(DRV_IMU_DEVTYPE_ST_LSM9DS1_AG, 3), - }), -}; diff --git a/boards/flywoo/gn-f405/bootloader/flywoo_gnf405_bl_15d91db.hex b/boards/flywoo/gn-f405/bootloader/flywoo_gnf405_bl_15d91db.hex deleted file mode 100644 index f13fed0..0000000 --- a/boards/flywoo/gn-f405/bootloader/flywoo_gnf405_bl_15d91db.hex +++ /dev/null @@ -1,616 +0,0 @@ -:020000040800F2 -:1000000000000220811B00087F1B00087D1B0008E8 -:100010007D1B00087D1B00087D1B00080000000000 -:100020000000000000000000000000007F1B00082E -:100030007F1B0008000000007F1B0008B9020008B9 -:100040007D1B00087D1B00087D1B00087D1B000830 -:100050007D1B00087D1B00087D1B00087D1B000820 -:100060007D1B00087D1B00087D1B00087D1B000810 -:100070007D1B00087D1B00087D1B00087D1B000800 -:100080007D1B00087D1B00087D1B00087D1B0008F0 -:100090007D1B00087D1B00087D1B00087D1B0008E0 -:1000A0007D1B00087D1B00087D1B00087D1B0008D0 -:1000B0007D1B00087D1B00087D1B00087D1B0008C0 -:1000C0007D1B00087D1B00087D1B00087D1B0008B0 -:1000D0007D1B00087D1B00087D1B00087D1B0008A0 -:1000E0007D1B00087D1B00087D1B00087D1B000890 -:1000F0007D1B00087D1B00087D1B00087D1B000880 -:100100007D1B00087D1B00087D1B00087D1B00086F -:100110007D1B00087D1B00087D1B00087D1B00085F -:100120007D1B00087D1B00087D1B00087D1B00084F -:100130007D1B00087D1B00087D1B00087D1B00083F -:100140007D1B00087D1B00087D1B00082908000896 -:100150007D1B00087D1B00087D1B00087D1B00081F -:100160007D1B00087D1B00087D1B00087D1B00080F -:100170007D1B00087D1B00087D1B00087D1B0008FF -:100180007D1B00087D1B00087D1B00087D1B0008EF -:100190007D1B00087D1B00087D1B00087D1B0008DF -:1001A0007D1B00087D1B00087D1B0008022901D172 -:1001B00000F042BB7047000010B5084C237813F0E4 -:1001C000FD0F02D04FF0FF3010BDC307FAD500F08D -:1001D000B5FB0028F6DB02236370F5E7580000202A -:1001E00010B5064C606000F0CBFBFFF7E5FF002880 -:1001F00002DA6368002BF6D110BD00BFE8070020CB -:1002000008B5FFF7EDFFA0F120035842584108BDA3 -:10021000034B1B78022B01D100F09ABB704700BF43 -:1002200058000020054B596810B54A1C9C68D2B292 -:1002300094421EBFC9185A60087310BD58000020B0 -:10024000064AD2E901138B421FBFD1180133DBB23A -:10025000087B14BF93604FF0FF30704758000020B8 -:1002600038B5124C236801331ED0114D2A68A242C2 -:100270001AD3104B9B6803F1006303F500439A42C5 -:1002800012D200F0D7FB00F0A9FB00F037FB00F022 -:10029000ADFB00F077FB204600F0D0FB23682A6816 -:1002A00083F308881047FEE738BD00BF00800008D0 -:1002B000048000080C0000200D4A10B500231446ED -:1002C00052F8231021B152F82310013942F82310BB -:1002D0000133042BF4D1074B93F80C3133B9A368E5 -:1002E00023B9022000F080FC3223A36010BD00BFC0 -:1002F000E807002058000020024BD860DA68002A86 -:10030000FCD17047E80700202DE9F04FBF4DDFF822 -:100310000483DFF81093D8F808408BB00026074616 -:100320002E70029600F046FB0FB1C9F8007085F8F8 -:100330000C61C9F808604FF0FF36012000F046FC60 -:1003400027B1D9F80030002B00F0F8810020FFF72A -:1003500047FF0390039B002BF2DB012000F028FCF9 -:10036000039B213B102BE8D801A252F823F000BFD9 -:10037000B5030008E5030008510400083B0300082A -:100380003B0300083B030008C90400083B030008C6 -:100390006F0500082D06000877060008CB06000848 -:1003A0003B030008EB0600083B03000819070008A0 -:1003B000C90300080220FFF723FF002800F0D881BE -:1003C000029B43F0010302932B780BB96B782B70DF -:1003D00041F21203022105A8ADF814300027FFF7FF -:1003E00017FFAAE74FF47A70FFF7FAFEB0F1000AA0 -:1003F000C0F2BE810220FFF703FF002800F0B881A1 -:100400000AF1FF30042800F2B381DFE800F0030BAB -:100410000E1114007E480421FFF7FAFE029B43F000 -:100420000203D0E77B480421F6E77B480421F3E789 -:100430007A480421F0E71C27384600F015FB043702 -:100440000590042105A8FFF7E3FE2C2FF4D1E5E782 -:100450000220FFF7D5FE002800F08A81029B03F0FE -:100460000303032B40F084810123022085F80C3123 -:1004700000F09EFB00F0E0FA4FF0000A504600F05A -:10048000E3FA044690B9022085F80C0100F09EFBC7 -:10049000D8F80830A3420FD8029B002443F004038D -:1004A000029385F80C41C9F808408DE7504600F0EA -:1004B000E5FA0AF1010AE1E7204600F0D5FA013039 -:1004C00040F04D810434E3E73220FFF789FEB0F1BC -:1004D000000BC0F24D811BF0030240F04981D8F8B7 -:1004E00008000BEB0401814200F24281BBF5807FE2 -:1004F00000F23E81DFF830A151465A4516D1C8209E -:10050000FFF77EFE002800F033812CB94FF0FF3258 -:10051000D5F81061C5F810212BF0030303EB040B91 -:100520005C4515D1029B43F008034CE74FF47A7009 -:10053000CDE90021FFF754FE039003980028C0F294 -:1005400017810199009A039801F8010B0132D4E751 -:10055000DAF80010204600F081FA204600F084FA14 -:100560005AF8042B904240F0FA800434D8E7022075 -:10057000FFF746FE002800F0FB800027BA4631E076 -:10058000002F3DD1711C3BD00596D5F81422C2B97D -:1005900023481346082103F0010C5B08BCF1000F4F -:1005A00007D083F06D4383F4380383F4034383F06F -:1005B00020030139EFD10132B2F5807F40F8043BCE -:1005C000E7D105A9002211F8013B83EA0A03DBB257 -:1005D00005EB83030132D3F81032042A83EA1A2A86 -:1005E000F1D10437D8F80830BB42C9D8042105A896 -:1005F000CDF814A0FFF70CFE029B43F01003E2E6D7 -:10060000384600F031FA0590BFE700BF58000020DF -:10061000DC2300080C000020100000201400002043 -:1006200068020020E80700206801002005AB4FF0B9 -:10063000000B9A4664200093FFF7D2FD0028C0F219 -:100640009780009B0BF1010BBBF1040F03F8010B2A -:10065000F0D1059B00930220FFF7D2FD002800F0A7 -:100660008780009B184600F031FA594605905046A5 -:10067000FFF7CEFDA8E605AB4FF0000B9A466420CD -:100680000093FFF7ADFD002872DB009B0BF1010B1F -:10069000BBF1040F03F8010BF1D1059B009302207D -:1006A000FFF7AEFD002863D0009B9A0760D1082BAE -:1006B0005ED8184600F076FA594605905046FFF786 -:1006C000A7FD029B43F040037DE60220FFF798FD63 -:1006D00000284DD000F00AFA0421059005A8FFF784 -:1006E00097FD029B43F080036DE60220FFF788FD33 -:1006F00000283DD005A9142000F0FEF9042107468A -:10070000049004A8FFF784FD394605A8FFF780FD93 -:10071000029B43F4807356E64FF47A70FFF770FD46 -:1007200030B3731C0DD141F2120305A80221ADF8BC -:100730001430FFF76DFD6420FFF7DEFD0BB0BDE860 -:10074000F08F029B03F01B031B2B11D131460020BD -:1007500000F084F9002000F087F98642E3D041F2EE -:100760001213022105A8ADF81430FFF751FDE4E59E -:1007700041F21233022105A8ADF81430FFF748FD0D -:1007800000230293D9E500BF4978212909D0222905 -:1007900009D0202909D11888062894BF00200120FB -:1007A0007047034B1360012070470020704700BF63 -:1007B000F423000837B5104B00930446002540236E -:1007C0000222012100F00CFD204600954023022268 -:1007D000822100F005FD204600951023032283218D -:1007E00000F0FEFC054B7F222121204603B0BDE82E -:1007F000304001F099B800BF0108000889070008DF -:1008000030B591B040236A46012100F011FD00246B -:100810000546AC4201D311B030BD1DF80400FFF70E -:1008200001FD0134F5E70000024B186808B100F043 -:10083000CDBC7047680600201FB52648264C012114 -:1008400000F070FC2548802100F06CFC4FF4C05390 -:1008500023480022022100F087FB21484FF4C052B8 -:100860000A2100F0BCFB1F4A1F48136843F4001321 -:1008700013601E4B1B68B3F5005F01BF4FF0A04231 -:10088000136843F0C00313608023194A0293231DA9 -:100890000193032302F10D010093164B00F06EFC4F -:1008A0001549206000F0FEFE104B1B68B3F5005F99 -:1008B0000AD10C4A136843F404131360D2F8CC37FE -:1008C00023F00203C2F8CC37432004B0BDE8104047 -:1008D00001F0D4B9303802406806002034380240B4 -:1008E0000000024038000050B82500083C000050CD -:1008F000FB23000800000020B507000810B50C4CD1 -:10090000432001F0C9F9206820B1012100F062FC08 -:10091000002323600022074811464FF4C05300F023 -:1009200023FBBDE810400448802100F0FFBB00BF5E -:10093000680600200000024034380240034B1B6868 -:100940000BB1FFF77DBC4FF0FF3070476806002009 -:1009500070B50A4E326805460C4662B970BD402C2F -:10096000234628BF40232A4630689BB2822100F0EC -:1009700057FC241A0544002CF1D1EFE7680600204B -:1009800007207047002208B511463023064800F0C2 -:10099000EBFA06484FF0805100F0C8FB044B4FF4CF -:1009A00080121A6008BD00BF0004024040380240B7 -:1009B0003038024008B5042001F034F9064BDB68FA -:1009C0004FF47A70584301F025F901F037F9BDE88A -:1009D000084001F043B900BF0C00002008B501F049 -:1009E00035F9BDE8084001F041B9000010B5042018 -:1009F00000F0ACF9042000F0A1F90A4B00241C60BF -:100A0000032000F0CFF9204600F0CCF900F0F6F911 -:100A1000054B064A1A60032000F09CFB044B1C6047 -:100A200010BD00BF083802400438024010300024D6 -:100A30000C38024000F01ABB00F006BB014B1860F6 -:100A4000704700BF08ED00E00A289DBF024B03EB92 -:100A5000C000406800207047D024000800F100600A -:100A600000F5004000F01EBB830703BF00F10060EB -:100A700000F500400068002070470000431E092B6D -:100A800070B502460AD8104C01230025934206D1C6 -:100A900004EBC20300215E68B14206D370BD04EBD3 -:100AA000C301013349680D44F0E76818FFF7DCFF24 -:100AB000013001D10431EFE714F832000221BDE822 -:100AC000704000F007BB00BFD024000810F0030303 -:100AD00009D1B0F5007F04D800F10050A0F508401E -:100AE0000368184670470023FBE70000014B1868B5 -:100AF000704700BF002004E0284B1A68284B2DE9FE -:100B0000F041C2F30B0C5F691D7E0446120C0020FD -:100B10004FF00C0E10330EFB00F636F80380E04564 -:100B200029D133445F681D7A42F201039A4226D0EC -:100B3000B2F5805F25D041F201039A4223D041F201 -:100B400003039A4221D041F207039A4208BF31259C -:100B5000621E0A447C1E0B4693421CD214F8016F9D -:100B6000581CA6B92C2482421C7001D9981C5D70B7 -:100B7000401ABDE8F08101300428CCD1D4E73325F8 -:100B8000E6E74125E4E75A25E2E75925E0E700F8E2 -:100B9000016C0346E0E71846EAE700BF002004E0E6 -:100BA0000C000020014BC058704700BF107AFF1F97 -:100BB000012802D0022804D070472021024800F00A -:100BC000C7B91021FAE700BF00040240012802D093 -:100BD000022804D070472021024800F0B7B9102144 -:100BE000FAE700BF00040240012802D0022804D026 -:100BF00070472021024800F0AEB91021FAE700BF8B -:100C0000000402402C4A2D4838B5136843F47003A1 -:100C100013602B4B6FF07F0200245A7202210F22C7 -:100C20009A721C72DC7200F07DFA2648302322464C -:100C3000012100F099F9302322462248214600F094 -:100C4000B3F92048302100F083F94FF080511E485D -:100C500000F068FA1D4800F023F91D4B1D481A6882 -:100C600042F480721A601C4A116841F4004111601C -:100C70000568196821F48071196018498D4217D1EF -:100C8000196841F480711960116841F400411160E4 -:100C900004601A6822F480721A6002210020FFF7B3 -:100CA00085FA2046FFF730FB0024FFF7D9FAF8E772 -:100CB00041F28834F1E700BF88ED00E030380240AF -:100CC0000C00002000040240403802408825000843 -:100CD00000700040502800407038024007B007B054 -:100CE000062822D8DFE800F004171C090E131500AF -:100CF0000F4B1868C0F3406070470D4B1868C0F385 -:100D0000404070470A4B1868C0F340007047094BD9 -:100D1000F9E7094BF7E7064B1868C0F340707047D6 -:100D2000034B1868C0F3C06070470020704700BFD5 -:100D300000380240703802407438024008B502465C -:100D40001046FFF7CDFF0028FAD008BD06280AD8C4 -:100D5000DFE800F004181D0A0F1416000E4A13688D -:100D600043F08073136070470B4A136843F4803379 -:100D7000F8E7094A136843F00103F3E7074AF9E784 -:100D8000074AF7E7044A136843F08053EAE7024A48 -:100D9000136843F08063E5E7003802407038024092 -:100DA0007438024006280AD8DFE800F004181D0A4B -:100DB0000F1416000E4A136823F0807313607047F7 -:100DC0000B4A136823F48033F8E7094A136823F0C9 -:100DD0000103F3E7074AF9E7074AF7E7044A13680C -:100DE00023F08053EAE7024A136823F08063E5E7C3 -:100DF000003802407038024074380240024A1368DA -:100E000023F400231360704700380240034A13683C -:100E100023F0030318431060704700BF08380240F6 -:100E2000034A136823F4604343EA4030106070477C -:100E300008380240034A136823F4E05343EA802051 -:100E40001060704708380240034A136823F0F0032B -:100E500043EA0010106070470838024010B5029C49 -:100E6000022C38BF022424071B0603F0706304F031 -:100E7000E04452081C4300F03F0047F6C073013ABB -:100E800003EA8111044312040C4302F44032034B81 -:100E9000144344F480041C6010BD00BF04380240B9 -:100EA00013B504460420FFF751FF0420FFF746FF67 -:100EB0000020FFF7ABFF0320FFF748FF0320FFF7F9 -:100EC0003DFFE07B002835D100F0F4FE207BFFF7EA -:100ED000BBFF607BFFF7AEFFA07BFFF7A1FFA3790D -:100EE00061882279207800936379FFF7B7FF124A6F -:100EF000136843F0807313600020FFF71FFFA068A2 -:100F000000F098F80220FFF781FF0C4A1368C3F342 -:100F10008103022BFAD10A4B22691A60094B6269DC -:100F20001A60A269084B04201A6002B0BDE81040A4 -:100F3000FFF738BF0120C7E70038024008380240F9 -:100F40004C000020500000205400002081617047B8 -:100F5000090481617047436901EA030221EA030140 -:100F600041EA0241816170472DE9F0410568C4689A -:100F700000264FF0030E43FA06F7FF070DD5770062 -:100F80000EFA07FC01FA07F825EA0C0524EA0C041E -:100F900002FA07F748EA05053C430136102EEAD16C -:100FA0000560C460BDE8F081012941680CBF1943A8 -:100FB0009943F0B5416081680024032643FA04F5A3 -:100FC000ED0707D5650006FA05F721EA070102FAE1 -:100FD00005F529430134102CF0D18160F0BDF0B546 -:100FE000076A466A00234FF00F0C42FA03F4E50744 -:100FF00007D59D000CFA05F427EA040701FA05F568 -:101000002F430133082BF0D14FF00F0C42FA03F4B9 -:10101000E40708D59C00203C0CFA04F526EA0506F6 -:1010200001FA04F426430133102BEFD10762466224 -:10103000F0BD0000034A136823F007031843106053 -:10104000704700BF003C0240054A136843F000436C -:101050001360044B044A1A6002F188321A60704728 -:10106000103C0240043C024023016745024A1368D9 -:1010700043F0004313607047103C0240024A13687B -:10108000DB03FCD4704700BF0C3C0240044B1968E2 -:1010900021F4407119601A6842EA00201860704714 -:1010A000103C024070B50A4C0E460546FFF7E6FFBD -:1010B0000220FFF7EBFF236843F0010323602E605B -:1010C000FFF7DCFF236823F00103236070BD00BF3E -:1010D000103C024037B5124C01910546FFF7CEFF98 -:1010E0000198FFF7D3FF236823F0F80323602368F8 -:1010F000ED00EDB21D432560236843F00203236039 -:10110000236843F480332360FFF7B8FF236823F09C -:1011100002032360236823F0F803236003B030BD8B -:10112000103C02400368194301607047036823EADA -:10113000010101607047430903F1804303F50E3359 -:1011400000F01F001968012202FA00F0084318603D -:1011500070470000032802D0052806D07047054AD2 -:10116000136823F4802313607047034A136823F045 -:101170000403F8E700380240703802402DE9F041DE -:101180001E4603680546884617469847069BC36077 -:10119000079B0361BDF820308382094B0367094B2D -:1011A000C366094B83660023C0E90087C0E9323378 -:1011B000C0E93433C0F8DC508660BDE8F08100BF80 -:1011C00055190008C5190008471A0008D0F8DC3086 -:1011D0005B6A1847D0F8DC309B6A03B11847704748 -:1011E00010B4D0F8DC40A468A4465DF8044B604716 -:1011F00013B503680021C1820446DB7900910A46D9 -:10120000FFF7EEFFD4F8DC3000215B6820469847FA -:10121000E3691BB102B0BDE81040184702B010BD31 -:1012200010B4D0F8DC40E469A4465DF8044B604794 -:1012300010B4D0F8DC40246AA4465DF8044B604743 -:10124000D0F8DC301B691847D0F8DC309B691847B0 -:10125000D0F8DC305B69184710B50B7873B94C884F -:101260007F2C0CD8D0F8DC30847593F830201AB17C -:1012700049885B68C9B29847012300E000231846FB -:1012800010BDF8B50D464988044679B103680D26AE -:10129000587C0023984201D80020F8BD626806FB04 -:1012A000032252798A4203D00133F3E74FF0FF3330 -:1012B0000133DBB2E3754BB9D4F8DC302046DB6890 -:1012C0009847D4F8C830ABB90120E6E70D226FF09B -:1012D0000C0112FB031263681344002210461979B3 -:1012E0009142E9D9D3F809101601715801B108707B -:1012F0000132F4E70023A3642365A365236604F1A8 -:10130000C80604F1D80756F8043B13B16988204693 -:101310009847B742F7D1D7E719881268012984BFE7 -:1013200001211980C37D2BB141680D2000FB0313FF -:1013300013F8083C13700120704770B5C67D4068F3 -:101340006FF00C050D2414FB065420448D8804799D -:10135000A5420CD201241C808B88D0F809001B0107 -:101360001B5803B11B7812680120137070BD002058 -:10137000FCE71988022984BF022119801168002323 -:101380000B70126801205370704710B514461A880C -:10139000022A84BF02221A808988C9B2FFF754FF4B -:1013A0002368003818BF01201870236800225A7083 -:1013B000012010BD08B589880122C9B2FFF740FF9E -:1013C000012008BD08B589880022C9B2FFF738FF9F -:1013D000012008BD70B5C27D0D241D466FF00C03C1 -:1013E00014FB023344688A881C442379934219D938 -:1013F000D4F809404B88160104EB021212799A4284 -:1014000010D9A25952B11370D0F8D83013B14A880C -:101410008988984700232B80012070BD002BF3D0D2 -:101420001046FAE70020F8E72DE9F04F4D881F46F7 -:101430002B0A022B89B0144611D0032B00F0ED804B -:10144000012B40F0218102682260127839888A429B -:1014500028BF0A463A80012009B0BDE8F08FEDB2FE -:1014600005EB45080369D0F80490136005EB880884 -:101470003C8819F808500293A54209EB080328BFDD -:1014800025461946029803932A4600F099FE029BCE -:1014900019F80880641B5E19A4B200230193039B12 -:1014A0001A79BDF804309A4204D8029BA3F802804E -:1014B0003D80D0E7019B019A1B010593039BD3F864 -:1014C000093003EB0213D3F808A0BAF1000F14D0CF -:1014D0009AF80090A14528BFA14630464A46514699 -:1014E00000F06EFE9AF80030A4EB09044D449844D5 -:1014F0004E44A4B2ADB21FFA88F800230493039BB4 -:10150000059AD3F809301344BDF810201979914297 -:1015100002D8019B0133C1E7049AD3F80CA015212E -:1015200001FB02F90AEB09031AF809B00093A3457D -:1015300028BFA346194630465A4600F041FE1AF825 -:1015400009309844009BD3F80D10A4EB0B045D44C4 -:101550005E44A4B2ADB21FFA88F8B1B1D3F811A0BD -:10156000A245A8BFA2461FFA8AF930464A4600F0B3 -:1015700027FE009BD3F81130A4EB09044D44984496 -:101580004E44A4B2ADB21FFA88F84FF00009009B98 -:101590001A791FFA89F39A4202D8049B0133ADE706 -:1015A000009BC9EB091BD3F80930079313F80B20F4 -:1015B00003EB0B0AA24228BF224651463046069250 -:1015C00000F0FEFD079B069A13F80B30DAF80710BF -:1015D000A41A154498441644A4B2ADB21FFA88F870 -:1015E000C1B1DAF80B20A242A8BF22461FFA82FB43 -:1015F0005A463046CDF818B000F0E2FDDAF80B306C -:10160000069AA4EB0B045D4498441644A4B2ADB210 -:101610001FFA88F809F10109B9E715F0FF05066915 -:101620000DD10923B3700423F37033703B88042B6E -:1016300028BF04233B800323737026600BE7836875 -:10164000013D0BB3C268AA421EDD898840F20942FF -:10165000914219D153F82550284600F051FE01302F -:101660004000C0B230703B88984228BF184638808E -:1016700000233A885208013A9A42DCDD06EB430225 -:10168000E95C51800133F4E70020E5E6198802297E -:1016900084BF02211980116800230B701268012099 -:1016A0005370704710B5002300F1C80454F8042BA0 -:1016B0002AB10133042BF9D14FF0FF3010BD323382 -:1016C00040F823101046F9E710B44C78092C13D8D1 -:1016D000DFE804F00E12121212100C120A05084C68 -:1016E000A4465DF8044B6047064CF9E7064CF7E763 -:1016F000064CF5E7064CF3E700205DF8044B704715 -:101700008312000819130008291400087313000835 -:101710005912000810B44C780A2C07D00B2C07D0B3 -:1017200044B9064CA4465DF8044B6047044CF9E705 -:10173000044CF7E700205DF8044B70478D16000855 -:101740003B130008D513000810B44C78012C04D0CA -:10175000032C08D01CB9094C09E04C885CB100206E -:101760005DF8044B70474C88002CF8D1044CA4461B -:101770005DF8044B6047034CF9E700BF8B1300088A -:10178000B5130008C513000810B40C7814F0600FEE -:1017900012D104F01F04012C06D0022C08D05CB931 -:1017A0005DF8044BFFF790BF5DF8044BFFF7B2BF45 -:1017B0005DF8044BFFF7C8BF00205DF8044B70478D -:1017C00010B5012204460021FFF73AFD002384F8FA -:1017D0002C3010BD70B50368828FC48EDB79816BAD -:1017E000A41A9C42A8BF1C46A6B20A443346002154 -:1017F0000546FFF71DFD864205D02846FFF7E0FFAE -:101800004FF0FF3070BDAB8F1E44AE87A0B2F9E73A -:1018100010B50368826BD979838F994204460FD241 -:101820000B460021FFF7FCFC022384F82C302368D0 -:10183000A26BD979A38F0A445B1AA263A38710BD58 -:101840000021FFF7EDFC94F84430002B14BF022375 -:10185000032384F82C30002384F84430A387A36347 -:10186000EDE72DE9F04100F1380286B00446054667 -:1018700000F1200800F13C0300F14007AE6C2EB9E6 -:10188000204606B0BDE8F041FFF77EBF087895F826 -:101890004DE095F84CC000EA0E00844503D00835B1 -:1018A0004545EBD1ECE700972046CDE904230391B1 -:1018B000B0470128DDE90312059BF0D806B0BDE86A -:1018C000F08138B5036983638B79CA7943EA0223CF -:1018D000838704460D46FFF7C4FF00B3EB88ABB126 -:1018E000A28F21689342C9790ED932B1B2FBF1F3CC -:1018F00001FB1322B2FA82F2520984F844202046F6 -:10190000BDE83840FFF784BF0022F6E71A461946C3 -:101910002046FFF785FC042384F82C3038BD204690 -:10192000BDE83840FFF74CBF70B5002500F1480610 -:1019300056F835402CB10135042DF9D14FF0FF3068 -:1019400070BD00EBC50080F84C1080F84D2083641A -:101950002046F5E770B5002500F130060446056421 -:1019600001222946FFF774FC082332462946204607 -:10197000FFF75EFC082804D02046BDE87040FFF762 -:101980001FBFE28E2AB931462046BDE87040FFF7FE -:1019900098BF94F93030002BF5DBA38A9342EBD348 -:1019A0002369A3632368A587DB79934234BF0523AA -:1019B000062384F82C302A4629462046BDE870408C -:1019C000FFF746BC10B590F82C30062B044612D019 -:1019D000072B27D0052B21D1FFF7FCFE002809DBC0 -:1019E000A28FE38E9B1A2268D279934202DC0623EF -:1019F00084F82C3010BDFFF7EDFE0028FADB04F16F -:101A000030012046FFF72DFF38B100231A46194652 -:101A10002046FFF705FC0423EAE72046BDE8104016 -:101A2000FFF7CEBE00231A461946FFF701FC00233C -:101A300084F82C30236C1BB104F130012046984708 -:101A400000232364D6E710B590F82C30032B04460E -:101A500007D0042B0ED0022B23D1BDE81040FFF796 -:101A6000D7BE072380F82C300022BDE81040114675 -:101A7000FFF7EEBB036C13B100F13001984794F807 -:101A8000303053B994F83130052B06D1618ED4F83B -:101A9000DC30C9B25B6820469847002384F82C30BC -:101AA00010BDBDE81040FFF78BBE000008B540F246 -:101AB0008760FFF740FB254A136843F0400313603B -:101AC000234B19461A68002AFCDA1A6842F0010210 -:101AD0001A600B68DB07FCD41E4B1F481B68B3F56C -:101AE000005F1E4B1A682CBF42F4041242F410220D -:101AF0001A601B4A136823F002031360A2F5FF6209 -:101B0000136843F0804343F470531360154B022273 -:101B10001A60154A136843F003031360134B002245 -:101B20001A60134A80231360A0F8E03052F81C3C7E -:101B300043F0010342F81C3C0E4B0F4A1A600F227F -:101B4000C3F804280122C3F8F82708BD0C00005090 -:101B5000100000503C000050EC06002038000050FF -:101B6000040800501400005000080050000E0050FF -:101B7000240000501800005010280480FEE7704731 -:101B8000194B1A4A1A498B421AD31A4A0021934216 -:101B90001BD3194A194C1368194D43F40073136091 -:101BA000536F43F470035367AC4211D3154C164D79 -:101BB000AC4211D3FFF726F8144C154DAC420FD3AD -:101BC00052F8040B43F8040BDDE743F8041BDEE78F -:101BD00054F8043B9847E7E754F8043B9847E7E795 -:101BE00054F8043B9847E9E700000020EC25000882 -:101BF00058000020F807002014ED00E0EC25000854 -:101C0000EC250008EC250008EC250008EC25000870 -:101C1000EC250008024B20F07F401860704700BFA1 -:101C200014E000E0044A136800F0040023F0040309 -:101C300003431360704700BF10E000E0024A1368DE -:101C400043F002031360704710E000E0024A13689B -:101C500023F002031360704710E000E0024A1368AB -:101C600043F001031360704710E000E0024A13687C -:101C700023F001031360704710E000E0054B4209B8 -:101C800003EB820300F01F00012202FA00F018604B -:101C9000704700BF00E100E0054B420903EB8203FF -:101CA00000F01F00012202FA00F01860704700BF28 -:101CB00080E100E028B9064A136843F480431360CA -:101CC00070470128FCD1024A136803F48043F6E709 -:101CD00000700040D0F8DC30DA6AD2F8003823F423 -:101CE000FE6343EA0111C2F8001870472DE9F0477E -:101CF000D0F8DCE0089FDEF82C5011F07F0603F0EE -:101D00007F043ED13F2B31D9C5F80069DEF82C2085 -:101D1000C2F81049DEF82C10D1F8002942F0084230 -:101D2000C1F80029DEF82C2044F0005444F40024CB -:101D3000C0F8E840C2F8104BDEF82C10D1F8002BA8 -:101D400042F00842C1F8002BBEF83220DEF82C1019 -:101D50009B0842EA03428A62B0F8E02013449BB237 -:101D6000A0F8E030A0F8E230BDE8F0871F2B03D9DF -:101D70000122C5F80029C9E70F2B8CBF02220322DC -:101D8000F7E709064FEA461C4FEA824226D5B0F82B -:101D9000E090990806F1400849EA014A45F828A070 -:101DA0004944A0F8E010DEF82C1001F5116142EA78 -:101DB000865241F80C400CF51061DEF82C401343BC -:101DC0000D5943F0184343F400432B430B51002FAC -:101DD000CAD00C2303FB06008766C5E706F13A016B -:101DE00005F5316544F4002440F8214045F80C40E5 -:101DF0000CF53061DEF82C4013430D5943F01443C9 -:101E000043F400432B430B51002FADD00C2303FBB5 -:101E10000600C766A8E7B0F8E230D0F8DC2010B5BD -:101E2000A0F8E0304FF43263D16A58580028BEBFA2 -:101E3000585840F080405850A3F50070D16A44587B -:101E4000002CB8BF445803F12003BCBF44F08044C9 -:101E50004450B3F5386FE7D1D36A4FF486621A6104 -:101E600010BD10B5D0F8DC40E06AF1B9D0F8003907 -:101E70005AB143F40013C0F800395831E26A4901FD -:101E80008B5843F400138B501AE023F40013C0F86E -:101E900000395831E26A49018B5823F400138B5002 -:101EA000E26A8B5843F08053EDE70B0613D501F03F -:101EB0007F0348335B0122B11A5842F400121A50D2 -:101EC00010BD1A5822F400121A50E16A5A5842F012 -:101ED00080525A50F4E7002ACFD1DAE70A06D0F848 -:101EE000DC3046BF01F07F0148315831DB6A4901DF -:101EF000C858C0F3405070470B060CD443185831F3 -:101F000083F8E420D0F8DC304901DB6A22B1CA58FA -:101F100042F00062CA507047CA5842F08062F9E746 -:101F2000F0B5D0F8DC60F06A01F07F04610100F5E3 -:101F3000116045582D0316D443F40027475001F58E -:101F40001061F76AC85940F004400134C8511D4679 -:101F50002403002D01DC1846F0BDF16A52F8040B91 -:101F60006050043DF5E70023F5E737B5B0F8F850C9 -:101F70009D4228BF1D46014614462B46032B1FDCFD -:101F8000A8086FF0030303FB005302EB8000A3B12A -:101F9000D1F8DC20B1F8F840D26A032C02F5805267 -:101FA00088BF043C126801928CBFA4B20024A1F83F -:101FB000F8401A4601A900F003F9284603B030BDE5 -:101FC000D1F8DC00C06A00F58050043B006844F89A -:101FD000040BB1F8F8000438A1F8F800CEE7D0F807 -:101FE000DC30DA6A2DE9F047556915F400560446ED -:101FF00009D05B8E4FF400515161BDE8F047A0F865 -:10200000E030FFF7F5B800F168084FF00C094FF029 -:10201000010AD4F8DC30DB6A770103F60813DB59D8 -:10202000DA070ED509FB06F358F8033013B1F1B205 -:1020300020469847D4F8DC30DB6A03F6081343F8EF -:1020400007A00136042EE4D1EB0648D5D4F8DC0015 -:10205000C36A1A6A02F4F016B6F5C02F02F00F0137 -:1020600002D0B6F5002F18D101F13A054A0103F567 -:10207000316354F825509D502144C56A91F8E4100D -:1020800002F5306300295A5914BF4FF008414FF050 -:1020900004410A435A51BDE8F087B6F5802F73D04A -:1020A000B6F5402FF7D14E0103F51167BF593F0335 -:1020B00040D4022001EB410303441A33C2F30A1255 -:1020C00054F82330A4F8F8200BB120469847B4F810 -:1020D000F8100023994259DC0023A4F8F8302A05AF -:1020E00008D5236A03B19847D4F8DC30DB6A4FF493 -:1020F00000625A61002D08DA636A03B19847D4F888 -:10210000DC30DB6A4FF000425A612B0707D5A36A27 -:1021100003B19847D4F8DC30DB6A08225A61D4F85E -:10212000DC30A26ADB6A002A38D09A6942F00802E1 -:102130009A61B0E706F5106C53F80C7047F0006731 -:1021400043F80C70C76A07F608133344D3F800E06D -:102150001EF0400FFAD05CF807309B0DD7F810E066 -:10216000BEF1000FFADA9B0103F4707343F0200311 -:102170003B61C36A03F5116300279F51C36A1033A3 -:1021800018688006FCD494E7012093E7D4F8DC209B -:10219000D26A02F58052043312689BE79A6922F0F2 -:1021A0000802C5E7D0F8DC30DB6AD3F8042821B197 -:1021B00042F00202C3F80428704722F00202F9E755 -:1021C000844641EA000313F003036DD1403A41D342 -:1021D00051F8043B40F8043B51F8043B40F8043B01 -:1021E00051F8043B40F8043B51F8043B40F8043BF1 -:1021F00051F8043B40F8043B51F8043B40F8043BE1 -:1022000051F8043B40F8043B51F8043B40F8043BD0 -:1022100051F8043B40F8043B51F8043B40F8043BC0 -:1022200051F8043B40F8043B51F8043B40F8043BB0 -:1022300051F8043B40F8043B51F8043B40F8043BA0 -:1022400051F8043B40F8043B51F8043B40F8043B90 -:10225000403ABDD2303211D351F8043B40F8043B30 -:1022600051F8043B40F8043B51F8043B40F8043B70 -:1022700051F8043B40F8043B103AEDD20C3205D340 -:1022800051F8043B40F8043B043AF9D2043208D038 -:10229000D2071CBF11F8013B00F8013B01D30B88AA -:1022A00003806046704700BF082A13D38B078DD088 -:1022B00010F003038AD0C3F10403D21ADB071CBF5A -:1022C00011F8013B00F8013B80D331F8023B20F8C4 -:1022D000023B7BE7043AD9D3013A11F8013B00F8FD -:1022E000013BF9D20B7803704B7843708B78837085 -:1022F0006046704700000000000000000000000081 -:1023000090F800F06DE9024520F007016FF0000C35 -:1023100010F0070491F820F040F049804FF00004DD -:102320006FF00700D1E9002391F840F000F10800B8 -:1023300082FA4CF2A4FA8CF283FA4CF3A2FA8CF3F0 -:102340004BBBD1E9022382FA4CF200F10800A4FA57 -:102350008CF283FA4CF3A2FA8CF3E3B9D1E90423AB -:1023600082FA4CF200F10800A4FA8CF283FA4CF3E2 -:10237000A2FA8CF37BB9D1E9062301F1200182FA9C -:102380004CF200F10800A4FA8CF283FA4CF3A2FAA2 -:102390008CF3002BC6D0002A04BF04301A4612BAB0 -:1023A000B2FA82F2FDE8024500EBD2007047D1E9B3 -:1023B000002304F00305C4F100004FEAC50514F042 -:1023C000040F91F840F00CFA05F562EA05021CBF13 -:1023D00063EA050362464FF00004A9E70500000028 -:1023E000466C79776F6F0050583420474E46343032 -:1023F0003500300000C201000000080902000002A0 -:10240000010080FA1C2400081201000202000040B2 -:10241000AC261600010101020301000000000000CB -:10242000010000000000000051240008000000002E -:1024300001000000000000003C2400080904010025 -:10244000020A0000007924000800000000000000DB -:10245000000904000001020201009724000866241C -:1024600000081300000005240010010524010001EC -:1024700004240200052406000107050102400001B2 -:10248000000000000000000007058202400001007B -:1024900000000000000000070583031000FF00009B -:1024A00000000000000053544D3332463F3F3F00D0 -:1024B00053544D3332463430780053544D33324602 -:1024C0003432780053544D33324634343658580041 -:1024D0000100000000400000020000000040000079 -:1024E00003000000004000000400000000000100A4 -:1024F00005000000000002000600000000000200CD -:1025000007000000000002000800000000000200B8 -:1025100009000000000002000A00000000000200A4 -:102520000B0000000000020010000000004000004E -:1025300011000000004000001200000000400000F8 -:102540001300000000400000140000000000010023 -:10255000150000000000020016000000000002004C -:102560001700000000000200180000000000020038 -:1025700019000000000002001A0000000000020024 -:102580001B000000000002000800500102070000CC -:1025900005060000000504000000000080DE800247 -:1025A00000BD0105012033000010410001105A0058 -:1025B0000310590007103100AD1A0008D51C00089F -:1025C000ED1C0008171E0008631E0008F91E000815 -:1025D000DD1E0008211F00086B1F0008DF1F000818 -:0C25E000A5210008000000500100800050 -:1025EC00E0230008E7230008F22300082A0000007B -:1025FC000000000000000000A80000000000000027 -:10260C00A62400083F00000013040000B0240008BA -:10261C003F00000019040000BA2400083F0000002D -:10262C0021040000C42400083F0000000024F40032 -:08263C000024F4000024F40066 -:0400000508000000EF -:00000001FF diff --git a/boards/flywoo/gn-f405/default.px4board b/boards/flywoo/gn-f405/default.px4board deleted file mode 100644 index b016b0d..0000000 --- a/boards/flywoo/gn-f405/default.px4board +++ /dev/null @@ -1,39 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_CONSTRAINED_FLASH=y -CONFIG_BOARD_NO_HELP=y -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_BOARD_SERIAL_URT6="/dev/ttyS2" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS1" -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_BAROMETER_BMP280=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU6000=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_SENSORS=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_VER=y diff --git a/boards/flywoo/gn-f405/firmware.prototype b/boards/flywoo/gn-f405/firmware.prototype deleted file mode 100644 index 277de41..0000000 --- a/boards/flywoo/gn-f405/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 42, - "magic": "FLYWOOGNF405", - "description": "Firmware for the FLYWOO GNF405 board", - "image": "", - "build_time": 0, - "summary": "flywoo/GNF405", - "version": "0.1", - "image_size": 0, - "image_maxsize": 1032192, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/flywoo/gn-f405/init/rc.board_defaults b/boards/flywoo/gn-f405/init/rc.board_defaults deleted file mode 100644 index d5ae67d..0000000 --- a/boards/flywoo/gn-f405/init/rc.board_defaults +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# -# Flywoo GNF405 board specific defaults -#------------------------------------------------------------------------------ - -# default airframe quadrotor -param set-default SYS_AUTOSTART 4001 - -# system_power unavailable -param set-default CBRK_SUPPLY_CHK 894281 - -# Disable safety switch by default -param set-default CBRK_IO_SAFETY 22027 - -# EKF2 can be enabled when baro is avaialble and EKF2_MAG_TYPE is set to 5 -param set-default SYS_MC_EST_GROUP 2 -param set-default EKF2_MAG_TYPE 5 -param set-default SENS_BOARD_ROT 6 - -param set-default ATT_ACC_COMP 0 -param set-default ATT_W_ACC 0.4000 -param set-default ATT_W_GYRO_BIAS 0.0000 - -param set-default SYS_HAS_MAG 0 - -# GPS is on Uart6 -param set-default GPS_1_CONFIG 6 - -# Telemetry (onboard) is on Uart4 -param set-default MAV_0_CONFIG 102 -param set-default MAV_0_MODE 2 - -# Set serial rates -param set-default SER_TEL2_BAUD 500000 -param set-default SER_URT6_BAUD 9600 diff --git a/boards/flywoo/gn-f405/init/rc.board_extras b/boards/flywoo/gn-f405/init/rc.board_extras deleted file mode 100644 index 159a000..0000000 --- a/boards/flywoo/gn-f405/init/rc.board_extras +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# -# Flywoo GNF405 specific board extras init -#------------------------------------------------------------------------------ - -if ! param compare OSD_ATXXXX_CFG 0 -then - atxxxx start -s -fi - - diff --git a/boards/flywoo/gn-f405/init/rc.board_sensors b/boards/flywoo/gn-f405/init/rc.board_sensors deleted file mode 100644 index 989dd2e..0000000 --- a/boards/flywoo/gn-f405/init/rc.board_sensors +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# -# Flywoo GNF405 specific board sensors init -#------------------------------------------------------------------------------ - -board_adc start - -mpu6000 -R 6 -s start - -# Start Baro -bmp280 -X start diff --git a/boards/flywoo/gn-f405/nuttx-config/include/board.h b/boards/flywoo/gn-f405/nuttx-config/include/board.h deleted file mode 100644 index 2f9eb5a..0000000 --- a/boards/flywoo/gn-f405/nuttx-config/include/board.h +++ /dev/null @@ -1,327 +0,0 @@ -/************************************************************************************ - * nuttx-configs/flywoo_gn-f405/include/board.h - * include/arch/board/board.h - * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Copyright (c) 2018 PX4 Development Team. All rights reserved. - * Author: Nathan Tsoi - * - * 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 NuttX 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. - * - ************************************************************************************/ - -#ifndef __CONFIG_GNF405S_INCLUDE_BOARD_H -#define __CONFIG_GNF405S_INCLUDE_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdio.h" -#include "stm32.h" - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The gnf405s board features a single 8MHz crystal. Space is provided - * for a 32kHz RTC backup crystal, but it is not stuffed. - * - * This is the canonical configuration: - * System Clock source : PLL (HSE) - * SYSCLK(Hz) : 168000000 Determined by PLL configuration - * HCLK(Hz) : 168000000 (STM32_RCC_CFGR_HPRE) - * AHB Prescaler : 1 (STM32_RCC_CFGR_HPRE) - * APB1 Prescaler : 4 (STM32_RCC_CFGR_PPRE1) - * APB2 Prescaler : 2 (STM32_RCC_CFGR_PPRE2) - * HSE Frequency(Hz) : 8000000 (STM32_BOARD_XTAL) - * PLLM : 8 (STM32_PLLCFG_PLLM) - * PLLN : 336 (STM32_PLLCFG_PLLN) - * PLLP : 2 (STM32_PLLCFG_PLLP) - * PLLQ : 7 (STM32_PLLCFG_PLLQ) - * Main regulator output voltage : Scale1 mode Needed for high speed SYSCLK - * Flash Latency(WS) : 5 - * Prefetch Buffer : OFF - * Instruction cache : ON - * Data cache : ON - * Require 48MHz for USB OTG FS, : Enabled - * SDIO and RNG clock - */ - -/* HSI - 16 MHz RC factory-trimmed - * LSI - 32 KHz RC - * HSE - On-board crystal frequency is 8MHz - * LSE - 32.768 kHz - */ - -#define STM32_BOARD_XTAL 8000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 32768 - -/* Main PLL Configuration. - * - * PLL source is HSE - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * = (8,000,000 / 8) * 336 - * = 336,000,000 - * SYSCLK = PLL_VCO / PLLP - * = 336,000,000 / 2 = 168,000,000 - * USB OTG FS, SDIO and RNG Clock - * = PLL_VCO / PLLQ - * = 48,000,000 - */ - -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(8) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(336) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(7) - -#define STM32_SYSCLK_FREQUENCY 168000000ul - -/* AHB clock (HCLK) is SYSCLK (168MHz) */ - -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (42MHz) */ - -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (84MHz) */ - -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx - * otherwise frequency is 2xAPBx. - * Note: TIM1,8-11 are on APB2, others on APB1 - */ - -#define BOARD_TIM1_FREQUENCY STM32_APB2_TIM1_CLKIN -#define BOARD_TIM2_FREQUENCY STM32_APB1_TIM2_CLKIN -#define BOARD_TIM3_FREQUENCY STM32_APB1_TIM3_CLKIN -#define BOARD_TIM4_FREQUENCY STM32_APB1_TIM4_CLKIN -#define BOARD_TIM5_FREQUENCY STM32_APB1_TIM5_CLKIN -#define BOARD_TIM6_FREQUENCY STM32_APB1_TIM6_CLKIN -#define BOARD_TIM7_FREQUENCY STM32_APB1_TIM7_CLKIN -#define BOARD_TIM8_FREQUENCY STM32_APB2_TIM8_CLKIN -#define BOARD_TIM9_FREQUENCY STM32_APB2_TIM9_CLKIN -#define BOARD_TIM10_FREQUENCY STM32_APB2_TIM10_CLKIN -#define BOARD_TIM11_FREQUENCY STM32_APB2_TIM11_CLKIN -#define BOARD_TIM12_FREQUENCY STM32_APB1_TIM12_CLKIN -#define BOARD_TIM13_FREQUENCY STM32_APB1_TIM13_CLKIN -#define BOARD_TIM14_FREQUENCY STM32_APB1_TIM14_CLKIN - -/* SDIO dividers. Note that slower clocking is required when DMA is disabled - * in order to avoid RX overrun/TX underrun errors due to delayed responses - * to service FIFOs in interrupt driven mode. These values have not been - * tuned!!! - * - * SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(118+2)=400 KHz - */ - -#define SDIO_INIT_CLKDIV (118 << SDIO_CLKCR_CLKDIV_SHIFT) - -/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz - * DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32_SDIO_DMA -# define SDIO_MMCXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) -#else -# define SDIO_MMCXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) -#endif - -/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz - * DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32_SDIO_DMA -# define SDIO_SDXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) -#else -# define SDIO_SDXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) -#endif - -/* LED definitions ******************************************************************/ -/* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any - * way. The following definitions are used to access individual LEDs. - */ - -/* LED index values for use with stm32_setled() */ - -#define BOARD_LED1 0 -//#define BOARD_LED2 1 -#define BOARD_NLEDS 1 - -#define BOARD_LED_BLUE BOARD_LED1 -//#define BOARD_LED_RED BOARD_LED2 - -/* LED bits for use with stm32_setleds() */ - -#define BOARD_LED1_BIT (1 << BOARD_LED1) -#define BOARD_LED2_BIT (1 << BOARD_LED2) - -/* If CONFIG_ARCH_LEDs is defined, then NuttX will control the 2 LEDs on board the - * gnf405s. The following definitions describe how NuttX controls the LEDs: - */ - -#define LED_STARTED 0 /* LED1 */ -#define LED_HEAPALLOCATE 1 /* LED2 */ -#define LED_IRQSENABLED 2 /* LED1 */ -#define LED_STACKCREATED 3 /* LED1 + LED2 */ -#define LED_INIRQ 4 /* LED1 */ -#define LED_SIGNAL 5 /* LED2 */ -#define LED_ASSERTION 6 /* LED1 + LED2 */ -#define LED_PANIC 7 /* LED1 + LED2 */ - -/* Alternate function pin selections ************************************************/ - -/* UART1: - * - * PA10 (RX) and PA9 (TX) are broken out on J5 - */ - -#define GPIO_USART1_RX GPIO_USART1_RX_1 -#define GPIO_USART1_TX GPIO_USART1_TX_2 - -/* USART3: - * - * PC10 (TX) and PC11 (RX) are broken out on J4 - * - * However, this port is shared with SPI3 which contains the BMP280 and MAX7456 - * - * The Silkscreen pin labeled SCL is TX - * MISO is RX - */ -//#define GPIO_USART3_RX GPIO_USART3_RX_2 -//#define GPIO_USART3_TX GPIO_USART3_TX_2 - -/* UART4: - * - * PA0 (TX) -- Labeled RSSI on the silkscreen is only broken out on a test pad - * on the pro version. It's on a 2.54mm header on other versions - * PA1 (RX) -- Motor 5 out - */ -#define GPIO_UART4_RX GPIO_UART4_RX_1 -#define GPIO_UART4_TX GPIO_UART4_TX_1 - -/* UART6: - * - * PC6 (TX) and PC7 (RX) are broken out on J10 - */ - -#define GPIO_USART6_RX GPIO_USART6_RX_1 -#define GPIO_USART6_TX GPIO_USART6_TX_1 - -/* SPI1: - * MPU6000 - * CS: PA4 -- configured in board_config.h - * CLK: PA5 - * MISO: PA6 - * MOSI: PA7 - */ - -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 - -/* SPI2: - * SD Card - * CS: PB12 -- configured in board_config.h - * CLK: PB13 - * MISO: PB14 - * MOSI: PB15 - */ - -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_3 -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_3 -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_3 - -/* SPI3: - * BMP280 - * CS: PB3 -- configured in board_config.h - * CLK: PC10 - * MISO: PC11 - * MOSI: PC12 - */ - -#define GPIO_SPI3_SCK GPIO_SPI3_SCK_2 -#define GPIO_SPI3_MISO GPIO_SPI3_MISO_2 -#define GPIO_SPI3_MOSI GPIO_SPI3_MOSI_2 - -/* - * I2C (external) - * - * SCL: PB10 - * SDA: PB11 - * - * TODO: - * The optional _GPIO configurations allow the I2C driver to manually - * reset the bus to clear stuck slaves. They match the pin configuration, - * but are normally-high GPIOs. - */ -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 - -#endif /* __CONFIG_GNF405S_INCLUDE_BOARD_H */ diff --git a/boards/flywoo/gn-f405/nuttx-config/include/board_dma_map.h b/boards/flywoo/gn-f405/nuttx-config/include/board_dma_map.h deleted file mode 100644 index d54cbdf..0000000 --- a/boards/flywoo/gn-f405/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/* -| DMA1 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | SPI3_RX_1 | - | SPI3_RX_2 | SPI2_RX | SPI2_TX | SPI3_TX_1 | - | SPI3_TX_2 | -| Channel 1 | I2C1_RX | - | TIM7_UP_1 | - | TIM7_UP_2 | I2C1_RX_1 | I2C1_TX | I2C1_TX_1 | -| Channel 2 | TIM4_CH1 | - | I2C4_RX | TIM4_CH2 | - | I2C4_RX | TIM4_UP | TIM4_CH3 | -| Channel 3 | - | TIM2_UP_1 | I2C3_RX_1 | I2C2_EXT_RX | I2C3_TX | TIM2_CH1 | TIM2_CH2 | TIM2_UP_2 | -| | | TIM2_CH3 | | | | | TIM2_CH4_1 | TIM2_CH4_2 | -| Channel 4 | UART5_RX | USART3_RX | UART4_RX | USART3_TX_1 | UART4_TX | USART2_RX | USART2_TX | UART5_TX | -| Channel 5 | UART8_TX | UART7_TX | TIM3_CH4 | UART7_RX | TIM3_CH1 | TIM3_CH2 | UART8_RX | TIM3_CH3 | -| | | | TIM3_UP | | TIM3_TRIG | | | | -| Channel 6 | TIM5_CH3 | TIM5_CH4_1 | TIM5_CH1 | TIM5_CH4_2 | TIM5_CH2 | - | TIM5_UP_2 | - | -| | TIM5_UP_1 | TIM5_TRIG_1 | | TIM5_TRIG_2 | | | | | -| Channel 7 | - | TIM6_UP | I2C2_RX | I2C2_RX_1 | USART3_TX_2 | DAC1 | DAC2 | I2C2_TX | -| | | | | | | | | | -| Usage | | TIM2_UP_1 | TIM3_UP | SPI2_RX | SPI2_TX | | | | - - -| DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | ADC1_1 | SAI1_A | TIM8_CH1_1 | SAI1_A_1 | ADC1_2 | SAI1_B_1 | TIM1_CH1_1 | - | -| | | | TIM8_CH2_1 | | | | TIM1_CH2_1 | | -| | | | TIM8_CH3_1 | | | | TIM1_CH3_1 | | -| Channel 1 | - | DCMI_1 | ADC2_1 | ADC2_2 | SAI1_B | SPI6_TX | SPI6_RX | DCMI_2 | -| Channel 2 | ADC3_1 | ADC3_2 | - | SPI5_RX_1 | SPI5_TX_1 | CRYP_OUT | CRYP_IN | HASH_IN | -| Channel 3 | SPI1_RX_1 | - | SPI1_RX_2 | SPI1_TX_1 | - | SPI1_TX_2 | - | QUADSPI | -| Channel 4 | SPI4_RX_1 | SPI4_TX_1 | USART1_RX_1 | SDIO | - | USART1_RX_2 | SDIO | USART1_TX | -| Channel 5 | - | USART6_RX_1 | USART6_RX_2 | SPI4_RX_2 | SPI4_TX_2 | - | USART6_TX_1 | USART6_TX_2 | -| Channel 6 | TIM1_TRIG_1 | TIM1_CH1_2 | TIM1_CH2_2 | TIM1_CH1 | TIM1_CH4 | TIM1_UP | TIM1_CH3_2 | - | -| | | | | | TIM1_TRIG_2 | | | | -| | | | | | TIM1_COM | | | | -| Channel 7 | - | TIM8_UP | TIM8_CH1_2 | TIM8_CH2_2 | TIM8_CH3_2 | SPI5_RX_2 | SPI5_TX_2 | TIM8_CH4 | -| | | | | | | | | TIM8_TRIG | -| | | | | | | | | TIM8_COM | -| | | | | | | | | | -| Usage | SPI1_RX_1 | USART6_RX_1 | USART1_RX_1 | SPI1_TX_1 | | | SDIO | | - */ - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// AVAILABLE // DMA2, Stream 0 -// DMAMAP_TIM2_UP // DMA1, Stream 1, Channel 3 (DSHOT) -// DMAMAP_TIM3_UP // DMA1, Stream 2, Channel 5 (DSHOT) -#define DMACHAN_SPI2_RX DMAMAP_SPI2_RX // DMA1, Stream 3, Channel 0 (SPI2 RX) -#define DMACHAN_SPI2_TX DMAMAP_SPI2_TX // DMA1, Stream 4, Channel 0 (SPI2 TX) -// AVAILABLE // DMA2, Stream 5 -// AVAILABLE // DMA2, Stream 6 -// AVAILABLE // DMA2, Stream 7 - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMACHAN_SPI1_RX DMAMAP_SPI1_RX_1 // DMA2, Stream 0, Channel 3 (SPI1 RX) -#define DMAMAP_USART6_RX DMAMAP_USART6_RX_1 // DMA2, Stream 1, Channel 4 -#define DMAMAP_USART1_RX DMAMAP_USART1_RX_1 // DMA2, Stream 2, Channel 4 -#define DMACHAN_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 3, Channel 3 (SPI1 TX) -// AVAILABLE // DMA2, Stream 4 -// AVAILABLE // DMA2, Stream 5 -#define DMAMAP_SDIO DMAMAP_SDIO_2 // DMA2, Stream 6, Channel 4 -// AVAILABLE // DMA2, Stream 7 diff --git a/boards/flywoo/gn-f405/nuttx-config/nsh/defconfig b/boards/flywoo/gn-f405/nuttx-config/nsh/defconfig deleted file mode 100644 index 52ed2f8..0000000 --- a/boards/flywoo/gn-f405/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,222 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_CONSOLE is not set -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_SPI_CALLBACK is not set -# CONFIG_STM32_CCMEXCLUDE is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/flywoo/gn-f405/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F405RG=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_CUSTOM_LEDS=y -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0001 -CONFIG_CDCACM_PRODUCTSTR="PX4 GNF405" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=2000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="Flywoo" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXAMPLES_CALIB_UDELAY=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MM_REGIONS=2 -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_FATDEVNO=0 -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_MMCSDSPIPORTNO=2 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=196608 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32_ADC1=y -CONFIG_STM32_BBSRAM=y -CONFIG_STM32_BBSRAM_FILES=5 -CONFIG_STM32_BKPSRAM=y -CONFIG_STM32_CCMDATARAM=y -CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y -CONFIG_STM32_DMA1=y -CONFIG_STM32_DMA2=y -CONFIG_STM32_FLASH_PREFETCH=y -CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_STM32_I2C1=y -CONFIG_STM32_I2CTIMEOMS=10 -CONFIG_STM32_I2CTIMEOTICKS=10 -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_OTGFS=y -CONFIG_STM32_PWR=y -CONFIG_STM32_RTC=y -CONFIG_STM32_RTC_HSECLOCK=y -CONFIG_STM32_RTC_MAGIC_REG=1 -CONFIG_STM32_SAVE_CRASHDUMP=y -CONFIG_STM32_SDIO=y -CONFIG_STM32_SDIO_CARD=y -CONFIG_STM32_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32_SPI1=y -CONFIG_STM32_SPI1_DMA=y -CONFIG_STM32_SPI1_DMA_BUFFER=1024 -CONFIG_STM32_SPI2=y -CONFIG_STM32_SPI2_DMA=y -CONFIG_STM32_SPI3=y -CONFIG_STM32_SPI_DMATHRESHOLD=8 -CONFIG_STM32_TIM1=y -CONFIG_STM32_TIM5=y -CONFIG_STM32_UART4=y -CONFIG_STM32_USART1=y -CONFIG_STM32_USART6=y -CONFIG_STM32_USART_BREAKS=y -CONFIG_STM32_USART_SINGLEWIRE=y -CONFIG_STM32_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=300 -CONFIG_UART4_TXBUFSIZE=300 -CONFIG_USART1_RXBUFSIZE=300 -CONFIG_USART1_RXDMA=y -CONFIG_USART1_TXBUFSIZE=300 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=300 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/flywoo/gn-f405/nuttx-config/scripts/script.ld b/boards/flywoo/gn-f405/nuttx-config/scripts/script.ld deleted file mode 100644 index dbeae7b..0000000 --- a/boards/flywoo/gn-f405/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************** - * configs/flywoo-gn_f405/scripts/ld.script - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F405RG has 1024Kb of FLASH beginning at address 0x0800:0000 and - * 192Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of CCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 16 KiB of flash is reserved for the bootloader. - * Paramater storage will use the next 16KiB Sector. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08008000, LENGTH = 992K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - ccsram (rwx) : ORIGIN = 0x10000000, LENGTH = 64K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/flywoo/gn-f405/src/CMakeLists.txt b/boards/flywoo/gn-f405/src/CMakeLists.txt deleted file mode 100644 index 4212b7e..0000000 --- a/boards/flywoo/gn-f405/src/CMakeLists.txt +++ /dev/null @@ -1,50 +0,0 @@ -############################################################################ -# -# Copyright (c) 2018 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. -# -############################################################################ - -add_library(drivers_board - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - usb.c -) - -target_link_libraries(drivers_board - PRIVATE - arch_spi - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer -) diff --git a/boards/flywoo/gn-f405/src/board_config.h b/boards/flywoo/gn-f405/src/board_config.h deleted file mode 100644 index 756389e..0000000 --- a/boards/flywoo/gn-f405/src/board_config.h +++ /dev/null @@ -1,206 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2018, 2014 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * gnf405s internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ -/* Configuration ************************************************************************************/ - -/* gnf405s GPIOs ***********************************************************************************/ -/* LEDs */ -// power - green -// LED1 - PB5 - blue -#define GPIO_LED1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN5) -#define GPIO_LED_BLUE GPIO_LED1 - -#define BOARD_OVERLOAD_LED LED_BLUE - -#define FLASH_BASED_PARAMS - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that can be used by the Px4 Firmware in the adc driver - */ -#define ADC1_CH(n) (n) - -#define PX4_ADC_GPIO \ - /* PC0 */ GPIO_ADC1_IN10, \ - /* PC2 */ GPIO_ADC1_IN12, \ - /* PC3 */ GPIO_ADC1_IN13 - -#define ADC_BATTERY_VOLTAGE_CHANNEL ADC1_CH(13) -#define ADC_BATTERY_CURRENT_CHANNEL ADC1_CH(12) -// #define ADC_BATTERY_VOLTAGE_CHANNEL 12 -// #define ADC_BATTERY_CURRENT_CHANNEL 11 -#define ADC_RC_RSSI_CHANNEL ADC1_CH(10) - -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY_CURRENT_CHANNEL) | \ - (1 << ADC_RC_RSSI_CHANNEL)) - -/* User GPIOs - * - * GPIO0-5 are the PWM servo outputs. - * GPIO_TIM3_CH3OUT GPIO_TIM3_CH3OUT_1 //PB0 S1_OUT D1_ST7 - * GPIO_TIM3_CH4OUT GPIO_TIM3_CH4OUT_1 //PB1 S2_OUT D1_ST2 - * GPIO_TIM2_CH4OUT GPIO_TIM2_CH4OUT_1 //PA3 S3_OUT D1_ST6 - * GPIO_TIM2_CH3OUT GPIO_TIM2_CH3OUT_1 //PA2 S4_OUT D1_ST1 - * GPIO_TIM5_CH2OUT GPIO_TIM5_CH2OUT_1 //PA1 S5_OUT - * GPIO_TIM1_CH1OUT GPIO_TIM1_CH1OUT_1 //PA8 S6_OUT - */ - -#define _MK_GPIO_INPUT(def) (((def) & (GPIO_PORT_MASK | GPIO_PIN_MASK)) | (GPIO_INPUT|GPIO_PULLUP)) - -#define GPIO_GPIO0_INPUT _MK_GPIO_INPUT(GPIO_TIM3_CH3IN) -#define GPIO_GPIO1_INPUT _MK_GPIO_INPUT(GPIO_TIM3_CH4IN) -#define GPIO_GPIO2_INPUT _MK_GPIO_INPUT(GPIO_TIM2_CH4IN) -#define GPIO_GPIO3_INPUT _MK_GPIO_INPUT(GPIO_TIM2_CH3IN) -//#define GPIO_GPIO4_INPUT _MK_GPIO_INPUT(GPIO_TIM5_CH2IN) -//#define GPIO_GPIO5_INPUT _MK_GPIO_INPUT(GPIO_TIM1_CH1IN) - -#define _MK_GPIO_OUTPUT(def) (((def) & (GPIO_PORT_MASK | GPIO_PIN_MASK)) | (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR)) - -#define GPIO_GPIO0_OUTPUT _MK_GPIO_OUTPUT(GPIO_TIM3_CH3OUT) -#define GPIO_GPIO1_OUTPUT _MK_GPIO_OUTPUT(GPIO_TIM3_CH4OUT) -#define GPIO_GPIO2_OUTPUT _MK_GPIO_OUTPUT(GPIO_TIM2_CH4OUT) -#define GPIO_GPIO3_OUTPUT _MK_GPIO_OUTPUT(GPIO_TIM2_CH3OUT) -//#define GPIO_GPIO4_OUTPUT _MK_GPIO_OUTPUT(GPIO_TIM5_CH2OUT) -//#define GPIO_GPIO5_OUTPUT _MK_GPIO_OUTPUT(GPIO_TIM1_CH1OUT) - -/* USB OTG FS - * - * PA9 OTG_FS_VBUS VBUS sensing - */ -#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTC|GPIO_PIN5) - -/* PWM - * - * Alternatively CH3/CH4 could be assigned to UART6_TX/RX - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 4 - -/* High-resolution timer */ -#define HRT_TIMER 4 // T4C1 -#define HRT_TIMER_CHANNEL 1 // use capture/compare channel 1 - -#define HRT_PPM_CHANNEL 3 // capture/compare channel 3 -#define GPIO_PPM_IN (GPIO_ALT|GPIO_AF2|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN8) - -#define RC_SERIAL_PORT "/dev/ttyS0" -#define BOARD_SUPPORTS_RC_SERIAL_PORT_OUTPUT - -/* - * One RC_IN - * - * GPIO PPM_IN on PB8 T4CH3 - * SPEKTRUM_RX (it's TX or RX in Bind) on PA10 UART1 - * The FMU can drive GPIO PPM_IN as an output - */ -// TODO? -//#define GPIO_PPM_IN_AS_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN6) -//#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_PPM_IN_AS_OUT) -//#define SPEKTRUM_RX_AS_UART() px4_arch_configgpio(GPIO_USART1_RX) -//#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true)) - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -#define BOARD_HAS_ON_RESET 1 - -#define BOARD_ENABLE_CONSOLE_BUFFER -#define BOARD_CONSOLE_BUFFER_SIZE (1024*3) - - -__BEGIN_DECLS - -/**************************************************************************************************** - * Public Types - ****************************************************************************************************/ - -/**************************************************************************************************** - * Public data - ****************************************************************************************************/ - -#ifndef __ASSEMBLY__ - -/**************************************************************************************************** - * Public Functions - ****************************************************************************************************/ - -/**************************************************************************************************** - * Name: stm32_spiinitialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the PX4FMU board. - * - ****************************************************************************************************/ - -extern void stm32_spiinitialize(void); - - -/**************************************************************************************************** - * Name: stm32_usbinitialize - * - * Description: - * Called to configure USB IO. - * - ****************************************************************************************************/ - -extern void stm32_usbinitialize(void); - -extern void board_peripheral_reset(int ms); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/flywoo/gn-f405/src/i2c.cpp b/boards/flywoo/gn-f405/src/i2c.cpp deleted file mode 100644 index e9f26f9..0000000 --- a/boards/flywoo/gn-f405/src/i2c.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), -}; diff --git a/boards/flywoo/gn-f405/src/init.c b/boards/flywoo/gn-f405/src/init.c deleted file mode 100644 index 0fabb89..0000000 --- a/boards/flywoo/gn-f405/src/init.c +++ /dev/null @@ -1,338 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-2018 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * gnf405s-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include "board_config.h" -#include - -#include - -#include -#include - -#include - -#include -#include -#include - -# if defined(FLASH_BASED_PARAMS) -# include -#endif - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/**************************************************************************** - * Protected Functions - ****************************************************************************/ -/**************************************************************************** - * Public Functions - ****************************************************************************/ -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - UNUSED(ms); -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - /* configure the GPIO pins to outputs and keep them low */ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(io_timer_channel_get_gpio_output(i)); - } - - /* On resets invoked from system (not boot) insure we establish a low - * output state (discharge the pins) on PWM pins before they become inputs. - */ - - if (status >= 0) { - up_mdelay(400); - } -} - -/************************************************************************************ - * 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 all PWM to Low outputs */ - - board_on_reset(-1); - - /* configure LEDs */ - board_autoled_initialize(); - - - /* configure ADC pins */ - stm32_configgpio(GPIO_ADC1_IN13); /* BATT_VOLTAGE_SENS */ - stm32_configgpio(GPIO_ADC1_IN12); /* BATT_CURRENT_SENS */ - //stm32_configgpio(GPIO_ADC1_IN0); /* RSSI analog in (TX of UART4 instead) */ - - // TODO: power peripherals - ///* configure power supply control/sense pins */ - //stm32_configgpio(GPIO_PERIPH_3V3_EN); - //stm32_configgpio(GPIO_VDD_BRICK_VALID); - //stm32_configgpio(GPIO_VDD_USB_VALID); - - // TODO: 3v3 Sensor? - ///* Start with Sensor voltage off We will enable it - // * in board_app_initialize - // */ - //stm32_configgpio(GPIO_VDD_3V3_SENSORS_EN); - - // TODO: SBUS inversion? SPEK power? - //stm32_configgpio(GPIO_SBUS_INV); - //stm32_configgpio(GPIO_SPEKTRUM_PWR_EN); - - // TODO: $$$ Unused? - //stm32_configgpio(GPIO_8266_GPIO0); - //stm32_configgpio(GPIO_8266_PD); - //stm32_configgpio(GPIO_8266_RST); - - /* Safety - led don in led driver */ - - // TODO: unused? - //stm32_configgpio(GPIO_BTN_SAFETY); - - // TODO: RSSI - //stm32_configgpio(GPIO_RSSI_IN); - - stm32_configgpio(GPIO_PPM_IN); - - /* configure SPI all interfaces GPIO */ - - stm32_spiinitialize(); - -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -static struct spi_dev_s *spi1; -static struct spi_dev_s *spi2; -static struct spi_dev_s *spi3; - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - px4_platform_init(); - - /* configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_BLUE); - } - - - /* Configure SPI-based devices */ - - // SPI1: MPU6000 - spi1 = stm32_spibus_initialize(1); - - if (!spi1) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 1\n"); - led_on(LED_BLUE); - } - - /* Default SPI1 to 1MHz and de-assert the known chip selects. */ - SPI_SETFREQUENCY(spi1, 10000000); - SPI_SETBITS(spi1, 8); - SPI_SETMODE(spi1, SPIDEV_MODE3); - up_udelay(20); - - // SPI2: SDCard - /* Get the SPI port for the microSD slot */ - spi2 = stm32_spibus_initialize(CONFIG_NSH_MMCSDSPIPORTNO); - - if (!spi2) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", CONFIG_NSH_MMCSDSPIPORTNO); - led_on(LED_BLUE); - } - - /* Now bind the SPI interface to the MMCSD driver */ - int result = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi2); - - if (result != OK) { - led_on(LED_BLUE); - syslog(LOG_ERR, "[boot] FAILED to bind SPI port 2 to the MMCSD driver\n"); - } - - up_udelay(20); - - - // SPI3: OSD / Baro - spi3 = stm32_spibus_initialize(3); - - if (!spi3) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 3\n"); - led_on(LED_BLUE); - } - - /* Copied from fmu-v4 - * Default SPI3 to 12MHz and de-assert the known chip selects. - * MS5611 has max SPI clock speed of 20MHz - */ - - // BMP280 max SPI speed is 10 MHz - SPI_SETFREQUENCY(spi3, 10 * 1000 * 1000); - SPI_SETBITS(spi3, 8); - SPI_SETMODE(spi3, SPIDEV_MODE3); - up_udelay(20); - -#if defined(FLASH_BASED_PARAMS) - static sector_descriptor_t params_sector_map[] = { - {1, 16 * 1024, 0x08004000}, - {0, 0, 0}, - }; - - /* Initialize the flashfs layer to use heap allocated memory */ - result = parameter_flashfs_init(params_sector_map, NULL, 0); - - if (result != OK) { - syslog(LOG_ERR, "[boot] FAILED to init params in FLASH %d\n", result); - led_on(LED_AMBER); - } - -#endif - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/flywoo/gn-f405/src/led.c b/boards/flywoo/gn-f405/src/led.c deleted file mode 100644 index 3fde90d..0000000 --- a/boards/flywoo/gn-f405/src/led.c +++ /dev/null @@ -1,120 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2018 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * gnf405s LED backend. - */ - -#include - -#include - -#include "stm32.h" -#include "board_config.h" - -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -static uint32_t g_ledmap[] = { - GPIO_LED_BLUE, -}; - -__EXPORT void led_init(void) -{ - /* Configure LED GPIOs for output */ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - stm32_configgpio(g_ledmap[l]); - } -} - -static void phy_set_led(int led, bool state) -{ - /* Pull Down to switch on */ - if (led == 0) { - stm32_gpiowrite(g_ledmap[led], !state); - } -} - -__EXPORT void led_on(int led) -{ - phy_set_led(led, true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(led, false); -} - -__EXPORT void led_toggle(int led) -{ - if (led == 0) { - phy_set_led(led, !stm32_gpioread(g_ledmap[led])); - } -} - -__EXPORT void board_autoled_initialize(void) -{ - /* Configure LED1 GPIO for output */ - stm32_configgpio(GPIO_LED1); -} - -__EXPORT void board_autoled_on(int led) -{ - if (led == 1) { - /* Pull down to switch on */ - stm32_gpiowrite(GPIO_LED1, false); - } -} - -__EXPORT void board_autoled_off(int led) -{ - if (led == 1) { - /* Pull up to switch off */ - stm32_gpiowrite(GPIO_LED1, true); - } -} diff --git a/boards/flywoo/gn-f405/src/spi.cpp b/boards/flywoo/gn-f405/src/spi.cpp deleted file mode 100644 index 3530e26..0000000 --- a/boards/flywoo/gn-f405/src/spi.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2018 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - // initSPIBus(SPI::Bus::SPI1, { - // initSPIDevice(DRV_IMU_DEVTYPE_MPU6000, SPI::CS{GPIO::PortA, GPIO::Pin4}), - // initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortA, GPIO::Pin4}), - // }), - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_MPU6000, SPI::CS{GPIO::PortB, GPIO::Pin12}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortA, GPIO::Pin4}), - }), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_MMCSD(0), SPI::CS{GPIO::PortB, GPIO::Pin15}) - }), - // initSPIBus(SPI::Bus::SPI2, { - // initSPIDevice(SPIDEV_MMCSD(0), SPI::CS{GPIO::PortB, GPIO::Pin12}) - // }), - initSPIBus(SPI::Bus::SPI3, { - initSPIDevice(DRV_BARO_DEVTYPE_BMP280, SPI::CS{GPIO::PortB, GPIO::Pin3}), - initSPIDevice(DRV_OSD_DEVTYPE_ATXXXX, SPI::CS{GPIO::PortA, GPIO::Pin15}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/flywoo/gn-f405/src/timer_config.cpp b/boards/flywoo/gn-f405/src/timer_config.cpp deleted file mode 100644 index c38c5b1..0000000 --- a/boards/flywoo/gn-f405/src/timer_config.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2018 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer2, DMA{DMA::Index1, DMA::Stream1, DMA::Channel3}), - initIOTimer(Timer::Timer3, DMA{DMA::Index1, DMA::Stream2, DMA::Channel5}), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel3}, {GPIO::PortB, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel4}, {GPIO::PortB, GPIO::Pin1}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel4}, {GPIO::PortA, GPIO::Pin3}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel3}, {GPIO::PortA, GPIO::Pin2}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/flywoo/gn-f405/src/usb.c b/boards/flywoo/gn-f405/src/usb.c deleted file mode 100644 index 94b0946..0000000 --- a/boards/flywoo/gn-f405/src/usb.c +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2018 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include "board_config.h" - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -/************************************************************************************ - * Name: stm32_usbinitialize - * - * Description: - * Called to setup USB-related GPIO pins for the gnf405s 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_STM32_OTGFS - stm32_configgpio(GPIO_OTGFS_VBUS); - /* XXX We only support device mode - stm32_configgpio(GPIO_OTGFS_PWRON); - stm32_configgpio(GPIO_OTGFS_OVER); - */ -#endif -} - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/freefly/can-rtk-gps/canbootloader.px4board b/boards/freefly/can-rtk-gps/canbootloader.px4board deleted file mode 100644 index b0fd876..0000000 --- a/boards/freefly/can-rtk-gps/canbootloader.px4board +++ /dev/null @@ -1,6 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_ROMFSROOT="" -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_DRIVERS_BOOTLOADERS=y -CONFIG_DRIVERS_LIGHTS_RGBLED_NCP5623C=y diff --git a/boards/freefly/can-rtk-gps/default.px4board b/boards/freefly/can-rtk-gps/default.px4board deleted file mode 100644 index c2759ba..0000000 --- a/boards/freefly/can-rtk-gps/default.px4board +++ /dev/null @@ -1,39 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_ROMFSROOT="cannode" -CONFIG_BOARD_CONSTRAINED_FLASH=y -CONFIG_BOARD_NO_HELP=y -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_DRIVERS_BAROMETER_BMP388=y -CONFIG_DRIVERS_BOOTLOADERS=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_LIGHTS_RGBLED_NCP5623C=y -CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8310=y -CONFIG_BOARD_UAVCAN_INTERFACES=1 -CONFIG_DRIVERS_UAVCANNODE=y -CONFIG_UAVCANNODE_BEEP_COMMAND=y -CONFIG_UAVCANNODE_GNSS_FIX=y -CONFIG_UAVCANNODE_LIGHTS_COMMAND=y -CONFIG_UAVCANNODE_MAGNETIC_FIELD_STRENGTH=y -CONFIG_UAVCANNODE_RTK_DATA=y -CONFIG_UAVCANNODE_SAFETY_BUTTON=y -CONFIG_UAVCANNODE_STATIC_PRESSURE=y -CONFIG_UAVCANNODE_STATIC_TEMPERATURE=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_SENSORS=y -# CONFIG_SENSORS_VEHICLE_AIRSPEED is not set -# CONFIG_SENSORS_VEHICLE_AIR_DATA is not set -# CONFIG_SENSORS_VEHICLE_GPS_POSITION is not set -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/freefly/can-rtk-gps/firmware.prototype b/boards/freefly/can-rtk-gps/firmware.prototype deleted file mode 100644 index 3f8a8bf..0000000 --- a/boards/freefly/can-rtk-gps/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 85, - "magic": "PX4FWv1", - "description": "Firmware for the FreeFly RTK GPS", - "image": "", - "build_time": 0, - "summary": "FFRTK", - "version": "0.1", - "image_size": 0, - "image_maxsize": 2080768, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/freefly/can-rtk-gps/init/rc.board_defaults b/boards/freefly/can-rtk-gps/init/rc.board_defaults deleted file mode 100644 index 82830e4..0000000 --- a/boards/freefly/can-rtk-gps/init/rc.board_defaults +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default CANNODE_GPS_RTCM 1 diff --git a/boards/freefly/can-rtk-gps/init/rc.board_sensors b/boards/freefly/can-rtk-gps/init/rc.board_sensors deleted file mode 100644 index e905822..0000000 --- a/boards/freefly/can-rtk-gps/init/rc.board_sensors +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# board sensors init -#------------------------------------------------------------------------------ - -rgbled_ncp5623c -I -b 1 -a 0x39 start - -ist8310 start -I -b 1 -a 0x0E - -bmp388 start -I -b b -a 0x77 - -safety_button start - -gps start -d /dev/ttyS0 -g 115200 -p ubx diff --git a/boards/freefly/can-rtk-gps/nuttx-config/canbootloader/defconfig b/boards/freefly/can-rtk-gps/nuttx-config/canbootloader/defconfig deleted file mode 100644 index ef01b5f..0000000 --- a/boards/freefly/can-rtk-gps/nuttx-config/canbootloader/defconfig +++ /dev/null @@ -1,62 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/freefly/can-rtk-gps/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32f7" -CONFIG_ARCH_CHIP_STM32F722RE=y -CONFIG_ARCH_CHIP_STM32F7=y -CONFIG_ARCH_INTERRUPTSTACK=4096 -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BINFMT_DISABLE=y -CONFIG_BOARDCTL=y -CONFIG_BOARD_CUSTOM_LEDS=y -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DISABLE_MOUNTPOINT=y -CONFIG_EXPERIMENTAL=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_POLLED=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=4096 -CONFIG_INIT_STACKSIZE=4096 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_MM_REGIONS=2 -CONFIG_NAME_MAX=0 -CONFIG_NUNGET_CHARS=0 -CONFIG_PREALLOC_TIMERS=0 -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_DISABLE_BUFFERING=y -CONFIG_STM32F7_CAN1=y -CONFIG_STM32F7_I2C1=y -CONFIG_STM32F7_PROGMEM=y -CONFIG_STM32F7_TIM8=y -CONFIG_TASK_NAME_SIZE=0 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/freefly/can-rtk-gps/nuttx-config/include/board.h b/boards/freefly/can-rtk-gps/nuttx-config/include/board.h deleted file mode 100644 index 0dbed5a..0000000 --- a/boards/freefly/can-rtk-gps/nuttx-config/include/board.h +++ /dev/null @@ -1,267 +0,0 @@ -/************************************************************************************ - * configs/px4fmu/include/board.h - * include/arch/board/board.h - * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ************************************************************************************/ -#pragma once - -#include "board_dma_map.h" - -#include -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" - -/* HSI - 16 MHz RC factory-trimmed - * LSI - 32 KHz RC - * HSE - 16 MHz Crystal - * LSE - not installed - */ - -#define STM32_BOARD_XTAL 16000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 0 - -/* Main PLL Configuration. - * - * PLL source is HSE = 16,000,000 - * - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 2 <= PLLM <= 63 - * 192 <= PLLN <= 432 - * 192 MHz <= PLL_VCO <= 432MHz - * - * SYSCLK = PLL_VCO / PLLP - * Subject to - * - * PLLP = {2, 4, 6, 8} - * SYSCLK <= 216 MHz - * - * USB OTG FS, SDMMC and RNG Clock = PLL_VCO / PLLQ - * Subject to - * The USB OTG FS requires a 48 MHz clock to work correctly. The SDMMC - * and the random number generator need a frequency lower than or equal - * to 48 MHz to work correctly. - * - * 2 <= PLLQ <= 15 - */ - -/* Highest SYSCLK with USB OTG FS clock = 48 MHz - * - * PLL_VCO = (16,000,000 / 8) * 216 = 432 MHz - * SYSCLK = 432 MHz / 2 = 216 MHz - * USB OTG FS, SDMMC and RNG Clock = 432 MHz / 9 = 48 MHz - */ - -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(8) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(216) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(9) - -#define STM32_VCO_FREQUENCY ((STM32_HSE_FREQUENCY / 8) * 216) -#define STM32_SYSCLK_FREQUENCY (STM32_VCO_FREQUENCY / 2) -#define STM32_OTGFS_FREQUENCY (STM32_VCO_FREQUENCY / 9) - -/* Configure factors for PLLSAI clock */ - -#define CONFIG_STM32F7_PLLSAI 1 -#define STM32_RCC_PLLSAICFGR_PLLSAIN RCC_PLLSAICFGR_PLLSAIN(192) -#define STM32_RCC_PLLSAICFGR_PLLSAIP RCC_PLLSAICFGR_PLLSAIP(8) -#define STM32_RCC_PLLSAICFGR_PLLSAIQ RCC_PLLSAICFGR_PLLSAIQ(4) -#define STM32_RCC_PLLSAICFGR_PLLSAIR RCC_PLLSAICFGR_PLLSAIR(2) - -/* Configure Dedicated Clock Configuration Register */ - -#define STM32_RCC_DCKCFGR1_PLLI2SDIVQ RCC_DCKCFGR1_PLLI2SDIVQ(1) -#define STM32_RCC_DCKCFGR1_PLLSAIDIVQ RCC_DCKCFGR1_PLLSAIDIVQ(1) -#define STM32_RCC_DCKCFGR1_PLLSAIDIVR RCC_DCKCFGR1_PLLSAIDIVR(0) -#define STM32_RCC_DCKCFGR1_SAI1SRC RCC_DCKCFGR1_SAI1SEL(0) -#define STM32_RCC_DCKCFGR1_SAI2SRC RCC_DCKCFGR1_SAI2SEL(0) -#define STM32_RCC_DCKCFGR1_TIMPRESRC 0 -#define STM32_RCC_DCKCFGR1_DFSDM1SRC 0 -#define STM32_RCC_DCKCFGR1_ADFSDM1SRC 0 - - - -/* Configure factors for PLLI2S clock */ - -#define CONFIG_STM32F7_PLLI2S 1 -#define STM32_RCC_PLLI2SCFGR_PLLI2SN RCC_PLLI2SCFGR_PLLI2SN(192) -#define STM32_RCC_PLLI2SCFGR_PLLI2SP RCC_PLLI2SCFGR_PLLI2SP(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SQ RCC_PLLI2SCFGR_PLLI2SQ(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SR RCC_PLLI2SCFGR_PLLI2SR(2) - -/* Configure Dedicated Clock Configuration Register 2 */ - -#define STM32_RCC_DCKCFGR2_USART1SRC RCC_DCKCFGR2_USART1SEL_APB -#define STM32_RCC_DCKCFGR2_USART2SRC RCC_DCKCFGR2_USART2SEL_APB -#define STM32_RCC_DCKCFGR2_UART4SRC RCC_DCKCFGR2_UART4SEL_APB -#define STM32_RCC_DCKCFGR2_UART5SRC RCC_DCKCFGR2_UART5SEL_APB -#define STM32_RCC_DCKCFGR2_USART6SRC RCC_DCKCFGR2_USART6SEL_APB -#define STM32_RCC_DCKCFGR2_UART7SRC RCC_DCKCFGR2_UART7SEL_APB -#define STM32_RCC_DCKCFGR2_UART8SRC RCC_DCKCFGR2_UART8SEL_APB -#define STM32_RCC_DCKCFGR2_I2C1SRC RCC_DCKCFGR2_I2C1SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C2SRC RCC_DCKCFGR2_I2C2SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C3SRC RCC_DCKCFGR2_I2C3SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C4SRC RCC_DCKCFGR2_I2C4SEL_HSI -#define STM32_RCC_DCKCFGR2_LPTIM1SRC RCC_DCKCFGR2_LPTIM1SEL_APB -#define STM32_RCC_DCKCFGR2_CECSRC RCC_DCKCFGR2_CECSEL_HSI -#define STM32_RCC_DCKCFGR2_CK48MSRC RCC_DCKCFGR2_CK48MSEL_PLL -#define STM32_RCC_DCKCFGR2_SDMMCSRC RCC_DCKCFGR2_SDMMCSEL_48MHZ -#define STM32_RCC_DCKCFGR2_SDMMC2SRC RCC_DCKCFGR2_SDMMC2SEL_48MHZ -#define STM32_RCC_DCKCFGR2_DSISRC RCC_DCKCFGR2_DSISEL_PHY - - -/* Several prescalers allow the configuration of the two AHB buses, the - * high-speed APB (APB2) and the low-speed APB (APB1) domains. The maximum - * frequency of the two AHB buses is 216 MHz while the maximum frequency of - * the high-speed APB domains is 108 MHz. The maximum allowed frequency of - * the low-speed APB domain is 54 MHz. - */ - -/* AHB clock (HCLK) is SYSCLK (216 MHz) */ - -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (54 MHz) */ - -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (108MHz) */ - -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - - -/* FLASH wait states - * - * --------- ---------- ----------- - * VDD MAX SYSCLK WAIT STATES - * --------- ---------- ----------- - * 1.7-2.1 V 180 MHz 8 - * 2.1-2.4 V 216 MHz 9 - * 2.4-2.7 V 216 MHz 8 - * 2.7-3.6 V 216 MHz 7 - * --------- ---------- ----------- - */ - -#define BOARD_FLASH_WAITSTATES 7 - -/* LED definitions ******************************************************************/ -/* The board has numerous LEDs but 1, RED LED - - * If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any way. - * The following definitions are used to access individual LEDs. - */ - - -/* If CONFIG_ARCH_LEDS is defined, the usage by the board port is defined in - * include/board.h and src/stm32_leds.c. The LEDs are used to encode OS-related - * events as follows: - * - * - * SYMBOL Meaning LED state - * Red - * ---------------------- -------------------------- ------ */ - -#define LED_STARTED 0 /* NuttX has been started OFF */ -#define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF */ -#define LED_IRQSENABLED 2 /* Interrupts enabled OFF */ -#define LED_STACKCREATED 3 /* Idle stack created OFF */ -#define LED_INIRQ 4 /* In an interrupt N/C */ -#define LED_SIGNAL 5 /* In a signal handler N/C */ -#define LED_ASSERTION 6 /* An assertion failed GLOW N/C GLOW */ -#define LED_PANIC 7 /* The system has crashed Blink OFF N/C */ -#define LED_IDLE 8 /* MCU is is sleep mode ON OFF OFF */ - - -/* UARTs */ - -#define GPIO_USART2_TX GPIO_USART2_TX_1 /* PA2 */ -#define GPIO_USART2_RX GPIO_USART2_RX_1 /* PA3 */ - -#define GPIO_USART3_TX GPIO_USART3_TX_1 /* PB10 */ -#define GPIO_USART3_RX GPIO_USART3_RX_1 /* PB11 */ - - -/* CAN */ - -#define GPIO_CAN1_RX GPIO_CAN1_RX_2 /* PB8 */ -#define GPIO_CAN1_TX GPIO_CAN1_TX_2 /* PB9 */ - - -/* I2C */ - -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_1 /* PB6 */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_1 /* PB7 */ - -#define GPIO_I2C3_SCL GPIO_I2C3_SCL_1 /* PA8 */ -#define GPIO_I2C3_SDA GPIO_I2C3_SDA_1 /* PC9 */ - - -/* SPI */ - -#define GPIO_SPI3_MISO GPIO_SPI3_MISO_2 /* PC11 */ -#define GPIO_SPI3_MOSI GPIO_SPI3_MOSI_3 /* PC12 */ -#define GPIO_SPI3_SCK GPIO_SPI3_SCK_1 /* PB3 */ - diff --git a/boards/freefly/can-rtk-gps/nuttx-config/include/board_dma_map.h b/boards/freefly/can-rtk-gps/nuttx-config/include/board_dma_map.h deleted file mode 100644 index ca0d101..0000000 --- a/boards/freefly/can-rtk-gps/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,102 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -#pragma once - -/* -| DMA1 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | SPI3_RX_1 | SPDIFRX_DT | SPI3_RX_2 | SPI2_RX | SPI2_TX | SPI3_TX_1 | SPDIFRX_CS | SPI3_TX_2 | -| Channel 1 | I2C1_RX | I2C3_RX | TIM7_UP_1 | - | TIM7_UP_2 | I2C1_RX_1 | I2C1_TX | I2C1_TX_1 | -| Channel 2 | TIM4_CH1 | - | I2C4_RX | TIM4_CH2 | - | I2C4_RX | TIM4_UP | TIM4_CH3 | -| Channel 3 | - | TIM2_UP_1 | I2C3_RX_1 | - | I2C3_TX | TIM2_CH1 | TIM2_CH2 | TIM2_UP_2 | -| | | TIM2_CH3 | | | | | TIM2_CH4_1 | TIM2_CH4_2 | -| Channel 4 | UART5_RX | USART3_RX | UART4_RX | USART3_TX_1 | UART4_TX | USART2_RX | USART2_TX | UART5_TX | -| Channel 5 | UART8_TX | UART7_TX | TIM3_CH4 | UART7_RX | TIM3_CH1 | TIM3_CH2 | UART8_RX | TIM3_CH3 | -| | | | TIM3_UP | | TIM3_TRIG | | | | -| Channel 6 | TIM5_CH3 | TIM5_CH4_1 | TIM5_CH1 | TIM5_CH4_2 | TIM5_CH2 | - | TIM5_UP_2 | - | -| | TIM5_UP_1 | TIM5_TRIG_1 | | TIM5_TRIG_2 | | | | | -| Channel 7 | - | TIM6_UP | I2C2_RX | I2C2_RX_1 | USART3_TX_2 | DAC1 | DAC2 | I2C2_TX | -| Channel 8 | I2C3_TX | I2C4_RX | - | - | I2C2_TX | - | I2C4_TX | - | -| Channel 9 | - | SPI2_RX | - | - | - | - | SPI2_TX | - | -| | | | | | | | | | -| Usage | SPI3_RX_1 | | | | | USART2_RX | USART2_TX | SPI3_TX_2 | - - -| DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | ADC1_1 | SAI1_A | TIM8_CH1_1 | SAI1_A_1 | ADC1_2 | SAI1_B_1 | TIM1_CH1_1 | SAI2_B_2 | -| | | | TIM8_CH2_1 | | | | TIM1_CH2_1 | | -| | | | TIM8_CH3_1 | | | | TIM1_CH3_1 | | -| Channel 1 | - | DCMI_1 | ADC2_1 | ADC2_2 | SAI1_B | SPI6_TX | SPI6_RX | DCMI_2 | -| Channel 2 | ADC3_1 | ADC3_2 | - | SPI5_RX_1 | SPI5_TX_1 | CRYP_OUT | CRYP_IN | HASH_IN | -| Channel 3 | SPI1_RX_1 | - | SPI1_RX_2 | SPI1_TX_1 | SAI2_A | SPI1_TX_2 | SAI2_B | QUADSPI | -| Channel 4 | SPI4_RX_1 | SPI4_TX_1 | USART1_RX_1 | SDMMC1_1 | - | USART1_RX_2 | SDMMC1_2 | USART1_TX | -| Channel 5 | - | USART6_RX_1 | USART6_RX_2 | SPI4_RX_2 | SPI4_TX_2 | - | USART6_TX_1 | USART6_TX_2 | -| Channel 6 | TIM1_TRIG_1 | TIM1_CH1_2 | TIM1_CH2_2 | TIM1_CH1 | TIM1_CH4 | TIM1_UP | TIM1_CH3_2 | - | -| | | | | | TIM1_TRIG_2 | | | | -| | | | | | TIM1_COM | | | | -| Channel 7 | - | TIM8_UP | TIM8_CH1_2 | TIM8_CH2_2 | TIM8_CH3_2 | SPI5_RX_2 | SPI5_TX_2 | TIM8_CH4 | -| | | | | | | | | TIM8_TRIG | -| | | | | | | | | TIM8_COM | -| Channel 8 | DSFDM1_FLT0 | DSFDM1_FLT1 | DSFDM1_FLT2 | DSFDM1_FLT3 | DSFDM1_FLT0 | DSFDM1_FLT1 | DSFDM1_FLT2 | DSFDM1_FLT3 | -| Channel 9 | JPEG_IN | JPEG_OUT | SPI4_TX | JPEG_IN | JPEG_OUT | SPI5_RX | - | - | -| Channel 10 | SAI1_B | SAI2_B | SAI2_A | - | - | - | SAI1_A | - | -| Channel 11 | SDMMC2 | - | QUADSPI | - | - | SDMMC2 | - | - | -| | | | | | | | | | -| Usage | SPI4_RX_1 | TIM8_UP | | | SPI4_TX_2 | TIM1_UP | | | - */ - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// SPI3_RX_1 // DMA1, Stream 0, Channel 0 -// AVAILABLE // DMA1, Stream 1 -// AVAILABLE // DMA1, Stream 1 -// AVAILABLE // DMA1, Stream 3 -// AVAILABLE // DMA1, Stream 4 -// DMAMAP_USART2_RX // DMA1, Stream 5, Channel 4 -// DMAMAP_USART2_TX // DMA1, Stream 6, Channel 4 -// SPI3_TX_2 // DMA1, Stream 7, Channel 0 - - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// AVAILABLE // DMA1, Stream 0 -// AVAILABLE // DMA1, Stream 1 -#define DMAMAP_USART1_RX USART1_RX_1 // DMA1, Stream 2, Channel 4 -// AVAILABLE // DMA1, Stream 3 -// AVAILABLE // DMA1, Stream 4 -// AVAILABLE // DMA1, Stream 5 -// AVAILABLE // DMA1, Stream 6 -// DMAMAP_USART1_TX USART1_TX // DMA1, Stream 7, Channel 5 - diff --git a/boards/freefly/can-rtk-gps/nuttx-config/nsh/defconfig b/boards/freefly/can-rtk-gps/nuttx-config/nsh/defconfig deleted file mode 100644 index 3ea9c49..0000000 --- a/boards/freefly/can-rtk-gps/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,199 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_OS_API is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/freefly/can-rtk-gps/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32f7" -CONFIG_ARCH_CHIP_STM32F722RE=y -CONFIG_ARCH_CHIP_STM32F7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0016 -CONFIG_CDCACM_PRODUCTSTR="PX4 FreeFly RTK GPS" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="Freefly" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2624 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MM_REGIONS=2 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32F7_CAN1=y -CONFIG_STM32F7_DMA1=y -CONFIG_STM32F7_DMA2=y -CONFIG_STM32F7_DMACAPABLE=y -CONFIG_STM32F7_I2C1=y -CONFIG_STM32F7_I2C3=y -CONFIG_STM32F7_I2C_DYNTIMEO=y -CONFIG_STM32F7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32F7_OTGFS=y -CONFIG_STM32F7_PROGMEM=y -CONFIG_STM32F7_PWR=y -CONFIG_STM32F7_RTC=y -CONFIG_STM32F7_RTC_HSECLOCK=y -CONFIG_STM32F7_RTC_MAGIC=0xfacefeee -CONFIG_STM32F7_RTC_MAGIC_REG=1 -CONFIG_STM32F7_RTC_MAGIC_TIME_SET=0xfacefeef -CONFIG_STM32F7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32F7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32F7_SPI3=y -CONFIG_STM32F7_TIM8=y -CONFIG_STM32F7_USART2=y -CONFIG_STM32F7_USART3=y -CONFIG_STM32F7_USART_BREAKS=y -CONFIG_STM32F7_WWDG=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_TXBUFSIZE=1100 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_SERIAL_CONSOLE=y -CONFIG_USART3_TXBUFSIZE=1100 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/freefly/can-rtk-gps/nuttx-config/scripts/canbootloader_script.ld b/boards/freefly/can-rtk-gps/nuttx-config/scripts/canbootloader_script.ld deleted file mode 100644 index f63cd44..0000000 --- a/boards/freefly/can-rtk-gps/nuttx-config/scripts/canbootloader_script.ld +++ /dev/null @@ -1,155 +0,0 @@ -/**************************************************************************** - * nuttx-config/scripts/canbootloader_script.ld - * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F722ZE has 512 KiB of main FLASH memory. This FLASH memory - * can be accessed from either the AXIM interface at address 0x0800:0000 or - * from the ITCM interface at address 0x0020:0000. - * - * Additional information, including the option bytes, is available at at - * FLASH at address 0x1ff0:0000 (AXIM) or 0x0010:0000 (ITCM). - * - * In the STM32F32RE, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash on ITCM at 0x0020:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x0010:0000 - * - * NuttX does not modify these option bytes. On the unmodified NUCLEO-144 - * board, the BOOT0 pin is at ground so by default, the STM32F32RE will - * boot from address 0x0020:0000 in ITCM FLASH. - * - * The STM32F32RE also has 256 KiB of data SRAM (in addition to ITCM SRAM). - * SRAM is split up into three blocks: - * - * 1) 64 KiB of DTCM SRM beginning at address 0x2000:0000 - * 2) 176 KiB of SRAM1 beginning at address 0x2001:0000 - * 3) 16 KiB of SRAM2 beginning at address 0x2003:c000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - itcm (rwx) : ORIGIN = 0x00200000, LENGTH = 512K - flash (rx) : ORIGIN = 0x08000000, LENGTH = 32K - dtcm (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - sram1 (rwx) : ORIGIN = 0x20010000, LENGTH = 176K - sram2 (rwx) : ORIGIN = 0x2003c000, LENGTH = 16K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram1 AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram1 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/freefly/can-rtk-gps/nuttx-config/scripts/script.ld b/boards/freefly/can-rtk-gps/nuttx-config/scripts/script.ld deleted file mode 100644 index 6e6424d..0000000 --- a/boards/freefly/can-rtk-gps/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,169 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F32RE has 512 KiB of main FLASH memory. This FLASH memory - * can be accessed from either the AXIM interface at address 0x0800:0000 or - * from the ITCM interface at address 0x0020:0000. - * - * Additional information, including the option bytes, is available at at - * FLASH at address 0x1ff0:0000 (AXIM) or 0x0010:0000 (ITCM). - * - * In the STM32F32RE, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash on ITCM at 0x0020:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x0010:0000 - * - * NuttX does not modify these option bytes. On the unmodified NUCLEO-144 - * board, the BOOT0 pin is at ground so by default, the STM32F32RE will - * boot from address 0x0020:0000 in ITCM FLASH. - * - * The STM32F32RE also has 256 KiB of data SRAM (in addition to ITCM SRAM). - * SRAM is split up into three blocks: - * - * 1) 64 KiB of DTCM SRM beginning at address 0x2000:0000 - * 2) 176 KiB of SRAM1 beginning at address 0x2001:0000 - * 3) 16 KiB of SRAM2 beginning at address 0x2003:c000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - itcm (rwx) : ORIGIN = 0x00200000, LENGTH = 512K - flash (rx) : ORIGIN = 0x08010000, LENGTH = 512K-64K - dtcm (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - sram1 (rwx) : ORIGIN = 0x20010000, LENGTH = 176K - sram2 (rwx) : ORIGIN = 0x2003c000, LENGTH = 16K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(8); - /* - * This section positions the app_descriptor_t used - * by the make_can_boot_descriptor.py tool to set - * the application image's descriptor so that the - * uavcan bootloader has the ability to validate the - * image crc, size etc - */ - KEEP(*(.app_descriptor)) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram1 AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram1 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/freefly/can-rtk-gps/src/CMakeLists.txt b/boards/freefly/can-rtk-gps/src/CMakeLists.txt deleted file mode 100644 index 246b512..0000000 --- a/boards/freefly/can-rtk-gps/src/CMakeLists.txt +++ /dev/null @@ -1,66 +0,0 @@ -############################################################################ -# -# Copyright (c) 2021 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. -# -############################################################################ - -if("${PX4_BOARD_LABEL}" STREQUAL "canbootloader") - - add_library(drivers_board - boot_config.h - boot.c - i2c.cpp - led.cpp - ) - target_link_libraries(drivers_board - PRIVATE - nuttx_arch - nuttx_drivers - canbootloader - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/canbootloader) - -else() - add_library(drivers_board - can.c - i2c.cpp - init.c - spi.cpp - usb.c - ) - - target_link_libraries(drivers_board - PRIVATE - arch_spi - nuttx_arch - nuttx_drivers - px4_layer - ) -endif() diff --git a/boards/freefly/can-rtk-gps/src/board_config.h b/boards/freefly/can-rtk-gps/src/board_config.h deleted file mode 100644 index 8a8bbc2..0000000 --- a/boards/freefly/can-rtk-gps/src/board_config.h +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * board internal definitions - */ - -#pragma once - -#include -#include -#include - -/* BUTTON *************************************************************************** */ - -#define BUTTON_SAFETY /* PC14 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTC|GPIO_PIN14|GPIO_EXTI) - -#define GPIO_LED_SAFETY (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN6) -#define GPIO_BTN_SAFETY (BUTTON_SAFETY & ~GPIO_EXTI) - - -#define FLASH_BASED_PARAMS - -/* High-resolution timer */ -#define HRT_TIMER 2 /* use timer 2 for the HRT */ -#define HRT_TIMER_CHANNEL 1 /* use capture/compare channel 1 */ - -#define BOARD_ENABLE_CONSOLE_BUFFER - -__BEGIN_DECLS - -#ifndef __ASSEMBLY__ - -extern void stm32_spiinitialize(void); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/freefly/can-rtk-gps/src/boot.c b/boards/freefly/can-rtk-gps/src/boot.c deleted file mode 100644 index 4fc6fa5..0000000 --- a/boards/freefly/can-rtk-gps/src/boot.c +++ /dev/null @@ -1,201 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 PX4 Development Team. All rights reserved. - * Author: Ben Dyer - * Pavel Kirienko - * David Sidrane - * - * 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include "boot_config.h" -#include "led.h" -#include "board.h" - -#include -#include -#include - -#include - -/************************************************************************************ - * 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) -{ - putreg32(getreg32(STM32_RCC_APB1ENR) | RCC_APB1ENR_CAN1EN, STM32_RCC_APB1ENR); - stm32_configgpio(GPIO_CAN1_RX); - stm32_configgpio(GPIO_CAN1_TX); - putreg32(getreg32(STM32_RCC_APB1RSTR) | RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR); - putreg32(getreg32(STM32_RCC_APB1RSTR) & ~RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR); - - stm32_configgpio(GPIO_LED_SAFETY); - -#if defined(OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO) - stm32_configgpio(GPIO_GETNODEINFO_JUMPER); -#endif - -} - -/************************************************************************************ - * Name: board_deinitialize - * - * Description: - * This function is called by the bootloader code prior to booting - * the application. Is should place the HW into an benign initialized state. - * - ************************************************************************************/ - -void board_deinitialize(void) -{ - putreg32(getreg32(STM32_RCC_APB1RSTR) | RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR); -} - -/**************************************************************************** - * Name: board_get_product_name - * - * Description: - * Called to retrieve the product name. The returned value is a assumed - * to be written to a pascal style string that will be length prefixed - * and not null terminated - * - * Input Parameters: - * product_name - A pointer to a buffer to write the name. - * maxlen - The maximum number of charter that can be written - * - * Returned Value: - * The length of characters written to the buffer. - * - ****************************************************************************/ - -uint8_t board_get_product_name(uint8_t *product_name, size_t maxlen) -{ - DEBUGASSERT(maxlen > UAVCAN_STRLEN(HW_UAVCAN_NAME)); - memcpy(product_name, HW_UAVCAN_NAME, UAVCAN_STRLEN(HW_UAVCAN_NAME)); - return UAVCAN_STRLEN(HW_UAVCAN_NAME); -} - -/**************************************************************************** - * Name: board_get_hardware_version - * - * Description: - * Called to retrieve the hardware version information. The function - * will first initialize the the callers struct to all zeros. - * - * Input Parameters: - * hw_version - A pointer to a uavcan_hardwareversion_t. - * - * Returned Value: - * Length of the unique_id - * - ****************************************************************************/ - -size_t board_get_hardware_version(uavcan_HardwareVersion_t *hw_version) -{ - memset(hw_version, 0, sizeof(uavcan_HardwareVersion_t)); - - hw_version->major = HW_VERSION_MAJOR; - hw_version->minor = HW_VERSION_MINOR; - - return board_get_mfguid(*(mfguid_t *) hw_version->unique_id); -} - -/**************************************************************************** - * Name: board_indicate - * - * Description: - * Provides User feedback to indicate the state of the bootloader - * on board specific hardware. - * - * Input Parameters: - * indication - A member of the uiindication_t - * - * Returned Value: - * None - * - ****************************************************************************/ -#define led(n, code, r , g , b, h) {.red = (r),.green = (g), .blue = (b),.hz = (h)} - -typedef begin_packed_struct struct led_t { - uint8_t red; - uint8_t green; - uint8_t blue; - uint8_t hz; -} end_packed_struct led_t; - -static const led_t i2l[] = { - - led(0, off, 0, 0, 0, 0), - led(1, reset, 10, 63, 31, 255), - led(2, autobaud_start, 0, 63, 0, 1), - led(3, autobaud_end, 0, 63, 0, 2), - led(4, allocation_start, 0, 0, 31, 2), - led(5, allocation_end, 0, 63, 31, 3), - led(6, fw_update_start, 15, 63, 31, 3), - led(7, fw_update_erase_fail, 15, 63, 15, 3), - led(8, fw_update_invalid_response, 31, 0, 0, 1), - led(9, fw_update_timeout, 31, 0, 0, 2), - led(a, fw_update_invalid_crc, 31, 0, 0, 4), - led(b, jump_to_app, 0, 63, 0, 10), - -}; - -void board_indicate(uiindication_t indication) -{ - rgb_led(i2l[indication].red << 3, - i2l[indication].green << 2, - i2l[indication].blue << 3, - i2l[indication].hz); -} - -// I2C Driver wants to use the px4 log - -__EXPORT void px4_log_modulename(int level, const char *moduleName, const char *fmt, ...) -{ -} - -// I2C Driver wants to use printf etal (putc,wite) so cut it off here - -int printf(FAR const IPTR char *fmt, ...) -{ - return 0; -} diff --git a/boards/freefly/can-rtk-gps/src/boot_config.h b/boards/freefly/can-rtk-gps/src/boot_config.h deleted file mode 100644 index d551014..0000000 --- a/boards/freefly/can-rtk-gps/src/boot_config.h +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/* - * @file boot_config.h - * - * bootloader definitions that configures the behavior and options - * of the Boot loader - * This file is relies on the parent folder's boot_config.h file and defines - * different usages of the hardware for bootloading - */ - -#pragma once - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -/* Bring in the board_config.h definitions - * todo:make this be pulled in from a targed's build - * files in nuttx*/ - -#include "board_config.h" -#include "uavcan.h" -#include - -#include - -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define OPT_PREFERRED_NODE_ID ANY_NODE_ID - -//todo:wrap OPT_x in in ifdefs for command line definitions -#define OPT_TBOOT_MS 5000 -#define OPT_NODE_STATUS_RATE_MS 800 -#define OPT_NODE_INFO_RATE_MS 50 -#define OPT_BL_NUMBER_TIMERS 7 - -/* - * This Option set is set to 1 ensure a provider of firmware has an - * opportunity update the node's firmware. - * This Option is the default policy and can be overridden by - * a jumper - * When this Policy is set, the node will ignore tboot and - * wait indefinitely for a GetNodeInfo request before booting. - * - * OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO_INVERT is used to allow - * the polarity of the jumper to be True Active - * - * wait OPT_WAIT_FOR_GETNODEINFO OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO - * Jumper - * yes 1 0 x - * yes 1 1 Active - * no 1 1 Not Active - * no 0 0 X - * yes 0 1 Active - * no 0 1 Not Active - * - */ -#define OPT_WAIT_FOR_GETNODEINFO 0 -#define OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO 1 -#define OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO_INVERT 0 - -#define OPT_ENABLE_WD 1 - -#define OPT_RESTART_TIMEOUT_MS 20000 - -/* Reserved for the Booloader */ -#define OPT_BOOTLOADER_SIZE_IN_K (1024*64) - -/* Reserved for the application out of the total - * system flash minus the BOOTLOADER_SIZE_IN_K - */ -#define OPT_APPLICATION_RESERVER_IN_K 0 - -#define OPT_APPLICATION_IMAGE_OFFSET OPT_BOOTLOADER_SIZE_IN_K -#define OPT_APPLICATION_IMAGE_LENGTH (FLASH_SIZE-(OPT_BOOTLOADER_SIZE_IN_K+OPT_APPLICATION_RESERVER_IN_K)) - - -#define FLASH_BASE STM32_FLASH_BASE -#define FLASH_SIZE STM32_FLASH_SIZE - -#define APPLICATION_LOAD_ADDRESS (FLASH_BASE + OPT_APPLICATION_IMAGE_OFFSET) -#define APPLICATION_SIZE (FLASH_SIZE-OPT_APPLICATION_IMAGE_OFFSET) -#define APPLICATION_LAST_8BIT_ADDRRESS ((uint8_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint8_t))) -#define APPLICATION_LAST_32BIT_ADDRRESS ((uint32_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint32_t))) -#define APPLICATION_LAST_64BIT_ADDRRESS ((uint64_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint64_t))) - -/* If this board uses big flash that have large sectors */ - -#define OPT_USE_YIELD - -/* I2C LED needs 8 bytes */ - -#define OPT_SIMPLE_MALLOC_HEAP_SIZE 8 - -/* Bootloader Option***************************************************************** - * - */ -#define GPIO_GETNODEINFO_JUMPER GPIO_BTN_SAFETY diff --git a/boards/freefly/can-rtk-gps/src/can.c b/boards/freefly/can-rtk-gps/src/can.c deleted file mode 100644 index 4fd810d..0000000 --- a/boards/freefly/can-rtk-gps/src/can.c +++ /dev/null @@ -1,127 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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. - * - ****************************************************************************/ - -/** - * @file can.c - * - * Board-specific CAN functions. - */ - -#ifdef CONFIG_CAN - -#include "board_config.h" - -#include -#include - -#include -#include - -#include "chip.h" -#include "arm_internal.h" - -#include "chip.h" -#include "stm32_can.h" -#include "board_config.h" - - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) -# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." -# undef CONFIG_STM32_CAN2 -#endif - -#ifdef CONFIG_STM32_CAN1 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); - -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} - -#endif diff --git a/boards/freefly/can-rtk-gps/src/i2c.cpp b/boards/freefly/can-rtk-gps/src/i2c.cpp deleted file mode 100644 index 3ee9ff0..0000000 --- a/boards/freefly/can-rtk-gps/src/i2c.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusInternal(1), - initI2CBusInternal(3), -}; diff --git a/boards/freefly/can-rtk-gps/src/init.c b/boards/freefly/can-rtk-gps/src/init.c deleted file mode 100644 index ff36fa2..0000000 --- a/boards/freefly/can-rtk-gps/src/init.c +++ /dev/null @@ -1,148 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * board specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include - -#include -#include -#include -#include - -# if defined(FLASH_BASED_PARAMS) -# include -#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) -{ - //watchdog_init(); - - // Configure CAN interface - stm32_configgpio(GPIO_CAN1_RX); - stm32_configgpio(GPIO_CAN1_TX); - - stm32_configgpio(GPIO_LED_SAFETY); - stm32_configgpio(GPIO_BTN_SAFETY); - - // Configure SPI all interfaces GPIO & enable power. - stm32_spiinitialize(); -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - px4_platform_init(); - -#if defined(FLASH_BASED_PARAMS) - static sector_descriptor_t params_sector_map[] = { - {1, 32 * 1024, 0x08008000}, - {2, 32 * 1024, 0x08010000}, - {0, 0, 0}, - }; - - /* Initialize the flashfs layer to use heap allocated memory */ - int result = parameter_flashfs_init(params_sector_map, NULL, 0); - - if (result != OK) { - syslog(LOG_ERR, "[boot] FAILED to init params in FLASH %d\n", result); - } - -#endif // FLASH_BASED_PARAMS - - //px4_platform_configure(); - - return OK; -} diff --git a/boards/freefly/can-rtk-gps/src/led.cpp b/boards/freefly/can-rtk-gps/src/led.cpp deleted file mode 100644 index 704faa5..0000000 --- a/boards/freefly/can-rtk-gps/src/led.cpp +++ /dev/null @@ -1,236 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2015 PX4 Development Team. All rights reserved. - * Author: David Sidrane - * - * 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 - -#include -#include - -#include -#include "led.h" - -#include - -#include -#include - -__BEGIN_DECLS -#include "cxx_init.h" -void board_autoled_on(int led); -void board_autoled_off(int led); -__END_DECLS - -using namespace time_literals; -#define MODULE_NAME "LED" - -#define ADDR 0x39 /**< I2C adress of NCP5623C */ - -#define NCP5623_LED_CURRENT 0x20 /**< Current register */ -#define NCP5623_LED_PWM0 0x40 /**< pwm0 register */ -#define NCP5623_LED_PWM1 0x60 /**< pwm1 register */ -#define NCP5623_LED_PWM2 0x80 /**< pwm2 register */ - -#define NCP5623_LED_BRIGHT 0x1f /**< full brightness */ -#define NCP5623_LED_OFF 0x00 /**< off */ - - -class RGBLED_NCP5623C : public device::I2C -{ -public: - RGBLED_NCP5623C(const int bus, int bus_frequency, const int address); - virtual ~RGBLED_NCP5623C() = default; - - int init() override; - int probe() override; - - int send_led_rgb(uint8_t red, uint8_t green, uint8_t blue); - - -private: - float _brightness{1.0f}; - float _max_brightness{1.0f}; - - int write(uint8_t reg, uint8_t data); -}; - -RGBLED_NCP5623C::RGBLED_NCP5623C(const int bus, int bus_frequency, const int address) : - I2C(DRV_LED_DEVTYPE_RGBLED_NCP5623C, MODULE_NAME, bus, address, bus_frequency) -{ -} - -int -RGBLED_NCP5623C::write(uint8_t reg, uint8_t data) -{ - uint8_t msg[1] = { 0x00 }; - msg[0] = ((reg & 0xe0) | (data & 0x1f)); - - int ret = transfer(&msg[0], 1, nullptr, 0); - - return ret; -} - -int -RGBLED_NCP5623C::init() -{ - int ret = I2C::init(); - - if (ret != OK) { - return ret; - } - - return OK; -} - -int -RGBLED_NCP5623C::probe() -{ - return write(NCP5623_LED_CURRENT, 0x00); -} - - -/** - * Send RGB PWM settings to LED driver according to current color and brightness - */ -int -RGBLED_NCP5623C::send_led_rgb(uint8_t red, uint8_t green, uint8_t blue) -{ - - uint8_t msg[7] = {0x20, 0x70, 0x40, 0x70, 0x60, 0x70, 0x80}; - uint8_t brightness = 0x1f * _max_brightness; - - msg[0] = NCP5623_LED_CURRENT | (brightness & 0x1f); - msg[2] = NCP5623_LED_PWM0 | (uint8_t(red * _brightness) & 0x1f); - msg[4] = NCP5623_LED_PWM1 | (uint8_t(green * _brightness) & 0x1f); - msg[6] = NCP5623_LED_PWM2 | (uint8_t(blue * _brightness) & 0x1f); - - return transfer(&msg[0], 7, nullptr, 0); -} - -static RGBLED_NCP5623C instance(1, 100000, ADDR); - -#define TMR_BASE STM32_TIM1_BASE -#define TMR_FREQUENCY STM32_APB2_TIM1_CLKIN -#define TMR_REG(o) (TMR_BASE+(o)) - -static uint8_t _rgb[] = {0, 0, 0}; - -static int timerInterrupt(int irq, void *context, void *arg) -{ - putreg16(~getreg16(TMR_REG(STM32_GTIM_SR_OFFSET)), TMR_REG(STM32_GTIM_SR_OFFSET)); - - static int d2 = 1; - (d2++ & 1) ? instance.send_led_rgb(0, 0, 0) : instance.send_led_rgb(_rgb[0], _rgb[1], _rgb[2]); - - return 0; -} - - -void rgb_led(int r, int g, int b, int freqs) -{ - long fosc = TMR_FREQUENCY; - long prescale = 1536; - long p1s = fosc / prescale; - long p0p5s = p1s / 2; - uint16_t val; - static bool once = false; - - if (!once) { - cxx_initialize(); - - if (instance.init() != PX4_OK) { - return; - } - - modifyreg32(STM32_RCC_APB2ENR, 0, RCC_APB2ENR_TIM1EN); - - /* Reload */ - val = getreg16(TMR_REG(STM32_BTIM_EGR_OFFSET)); - val |= ATIM_EGR_UG; - putreg16(val, TMR_REG(STM32_BTIM_EGR_OFFSET)); - - /* Set Prescaler STM32_TIM_SETCLOCK */ - putreg16(prescale, TMR_REG(STM32_BTIM_PSC_OFFSET)); - - /* Enable STM32_TIM_SETMODE*/ - putreg16(ATIM_CR1_CEN | ATIM_CR1_ARPE, TMR_REG(STM32_BTIM_CR1_OFFSET)); - - putreg32(p0p5s + 1, TMR_REG(STM32_BTIM_ARR_OFFSET)); - - - irq_attach(STM32_IRQ_TIM1CC, timerInterrupt, NULL); - up_enable_irq(STM32_IRQ_TIM1CC); - putreg16(GTIM_DIER_CC1IE, TMR_REG(STM32_GTIM_DIER_OFFSET)); - once = true; - } - - long p = freqs == 0 ? p1s + 1 : p0p5s / freqs; - putreg32(p + 1, TMR_REG(STM32_BTIM_ARR_OFFSET)); - putreg32(p, TMR_REG(STM32_GTIM_CCR1_OFFSET)); - _rgb[0] = r; - _rgb[1] = g; - _rgb[2] = b; - - val = getreg16(TMR_REG(STM32_BTIM_CR1_OFFSET)); - - if (freqs == 0) { - val &= ~ATIM_CR1_CEN; - - } else { - val |= ATIM_CR1_CEN; - } - - putreg16(val, TMR_REG(STM32_BTIM_CR1_OFFSET)); -} - -/**************************************************************************** - * Name: board_autoled_on - ****************************************************************************/ - -__EXPORT void board_autoled_on(int led) -{ - if (led == LED_ASSERTION || led == LED_PANIC) { - stm32_gpiowrite(GPIO_LED_SAFETY, true); - } -} - -/**************************************************************************** - * Name: board_autoled_off - ****************************************************************************/ - -__EXPORT void board_autoled_off(int led) -{ - if (led == LED_ASSERTION || led == LED_PANIC) { - stm32_gpiowrite(GPIO_LED_SAFETY, false); - } - -} diff --git a/boards/freefly/can-rtk-gps/src/led.h b/boards/freefly/can-rtk-gps/src/led.h deleted file mode 100644 index b68e4aa..0000000 --- a/boards/freefly/can-rtk-gps/src/led.h +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2015 PX4 Development Team. All rights reserved. - * Author: David Sidrane - * - * 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. - * - ****************************************************************************/ - -__BEGIN_DECLS -void rgb_led(int r, int g, int b, int freqs); -__END_DECLS diff --git a/boards/freefly/can-rtk-gps/src/spi.cpp b/boards/freefly/can-rtk-gps/src/spi.cpp deleted file mode 100644 index cf00932..0000000 --- a/boards/freefly/can-rtk-gps/src/spi.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI3, { - initSPIDevice(DRV_IMU_DEVTYPE_ST_LSM9DS1_AG, SPI::CS{GPIO::PortA, GPIO::Pin15}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/freefly/can-rtk-gps/src/usb.c b/boards/freefly/can-rtk-gps/src/usb.c deleted file mode 100644 index 553bd8f..0000000 --- a/boards/freefly/can-rtk-gps/src/usb.c +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include "board_config.h" - -/************************************************************************************ - * 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 GPIO_OTGFS_VBUS - stm32_configgpio(GPIO_OTGFS_VBUS); -#endif -} - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/freefly/can-rtk-gps/uavcan_board_identity b/boards/freefly/can-rtk-gps/uavcan_board_identity deleted file mode 100644 index 997b26e..0000000 --- a/boards/freefly/can-rtk-gps/uavcan_board_identity +++ /dev/null @@ -1,17 +0,0 @@ -# UAVCAN boot loadable Module ID -set(uavcanblid_sw_version_major 0) -set(uavcanblid_sw_version_minor 1) -add_definitions( - -DAPP_VERSION_MAJOR=${uavcanblid_sw_version_major} - -DAPP_VERSION_MINOR=${uavcanblid_sw_version_minor} -) - -set(uavcanblid_hw_version_major 0) -set(uavcanblid_hw_version_minor 85) -set(uavcanblid_name "\"org.freefly.can-rtk-gps\"") - -add_definitions( - -DHW_UAVCAN_NAME=${uavcanblid_name} - -DHW_VERSION_MAJOR=${uavcanblid_hw_version_major} - -DHW_VERSION_MINOR=${uavcanblid_hw_version_minor} -) diff --git a/boards/holybro/can-gps-v1/canbootloader.px4board b/boards/holybro/can-gps-v1/canbootloader.px4board deleted file mode 100644 index 4691728..0000000 --- a/boards/holybro/can-gps-v1/canbootloader.px4board +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_ROMFSROOT="" -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_DRIVERS_BOOTLOADERS=y diff --git a/boards/holybro/can-gps-v1/default.px4board b/boards/holybro/can-gps-v1/default.px4board deleted file mode 100644 index 41b3cee..0000000 --- a/boards/holybro/can-gps-v1/default.px4board +++ /dev/null @@ -1,37 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_ROMFSROOT="cannode" -CONFIG_BOARD_CONSTRAINED_FLASH=y -CONFIG_BOARD_NO_HELP=y -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_BAROMETER_BMP388=y -CONFIG_DRIVERS_BOOTLOADERS=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20649=y -CONFIG_DRIVERS_LIGHTS_RGBLED_NCP5623C=y -CONFIG_DRIVERS_MAGNETOMETER_BOSCH_BMM150=y -CONFIG_BOARD_UAVCAN_INTERFACES=1 -CONFIG_DRIVERS_UAVCANNODE=y -CONFIG_UAVCANNODE_BEEP_COMMAND=y -CONFIG_UAVCANNODE_GNSS_FIX=y -CONFIG_UAVCANNODE_LIGHTS_COMMAND=y -CONFIG_UAVCANNODE_MAGNETIC_FIELD_STRENGTH=y -CONFIG_UAVCANNODE_SAFETY_BUTTON=y -CONFIG_UAVCANNODE_STATIC_PRESSURE=y -CONFIG_UAVCANNODE_STATIC_TEMPERATURE=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_SENSORS=y -# CONFIG_SENSORS_VEHICLE_AIRSPEED is not set -# CONFIG_SENSORS_VEHICLE_AIR_DATA is not set -# CONFIG_SENSORS_VEHICLE_GPS_POSITION is not set -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/holybro/can-gps-v1/firmware.prototype b/boards/holybro/can-gps-v1/firmware.prototype deleted file mode 100644 index 0be70c8..0000000 --- a/boards/holybro/can-gps-v1/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 79, - "magic": "HBCANGPS", - "description": "Firmware for the Holybro CAN GPS board", - "image": "", - "build_time": 0, - "summary": "HolybroCANGPS", - "version": "0.1", - "image_size": 0, - "image_maxsize": 475136, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/holybro/can-gps-v1/init/rc.board_defaults b/boards/holybro/can-gps-v1/init/rc.board_defaults deleted file mode 100644 index c888bbc..0000000 --- a/boards/holybro/can-gps-v1/init/rc.board_defaults +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -rgbled_ncp5623c -I -b 2 -a 0x39 start diff --git a/boards/holybro/can-gps-v1/init/rc.board_sensors b/boards/holybro/can-gps-v1/init/rc.board_sensors deleted file mode 100644 index 9adcd32..0000000 --- a/boards/holybro/can-gps-v1/init/rc.board_sensors +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -# -# board sensors init -#------------------------------------------------------------------------------ - -gps start -d /dev/ttyS0 -g 38400 -p ubx - - -# Internal SPI ICM20649 -icm20649 -s -b 1 -R 8 start - -# Internal Baro -bmp388 -I -b 1 -a 0x77 start - -# Internal magnetometer on I2c -bmm150 -I -b 1 -R 2 start diff --git a/boards/holybro/can-gps-v1/nuttx-config/canbootloader/defconfig b/boards/holybro/can-gps-v1/nuttx-config/canbootloader/defconfig deleted file mode 100644 index c4baa9a..0000000 --- a/boards/holybro/can-gps-v1/nuttx-config/canbootloader/defconfig +++ /dev/null @@ -1,56 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/holybro/can-gps-v1/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F412CE=y -CONFIG_ARCH_INTERRUPTSTACK=4096 -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BINFMT_DISABLE=y -CONFIG_BOARDCTL=y -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DISABLE_MOUNTPOINT=y -CONFIG_EXPERIMENTAL=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=4096 -CONFIG_INIT_STACKSIZE=4096 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_MM_REGIONS=2 -CONFIG_NAME_MAX=0 -CONFIG_NUNGET_CHARS=0 -CONFIG_PREALLOC_TIMERS=0 -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_DISABLE_BUFFERING=y -CONFIG_STM32_NOEXT_VECTORS=y -CONFIG_STM32_TIM8=y -CONFIG_TASK_NAME_SIZE=0 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/holybro/can-gps-v1/nuttx-config/include/board.h b/boards/holybro/can-gps-v1/nuttx-config/include/board.h deleted file mode 100644 index c905886..0000000 --- a/boards/holybro/can-gps-v1/nuttx-config/include/board.h +++ /dev/null @@ -1,161 +0,0 @@ -/************************************************************************************ - * Copyright (c) 2021 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 NuttX 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. - * - ************************************************************************************/ - -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H - -#include "board_dma_map.h" - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include -#ifndef __ASSEMBLY__ -# include -#endif - -#include - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/* HSI - 16 MHz RC factory-trimmed - * LSI - 32 KHz RC - * HSE - 8 MHz Crystal - * LSE - not installed - */ - -#define STM32_BOARD_USEHSE 1 -#define STM32_BOARD_XTAL 16000000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 - -/* Main PLL Configuration */ -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(16) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(384) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_4 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(8) -#define STM32_PLLCFG_PLLR RCC_PLLCFG_PLLR(2) - -#define STM32_RCC_PLLI2SCFGR_PLLI2SM RCC_PLLI2SCFGR_PLLI2SM(16) -#define STM32_RCC_PLLI2SCFGR_PLLI2SN RCC_PLLI2SCFGR_PLLI2SN(192) -#define STM32_RCC_PLLI2SCFGR_PLLI2SQ RCC_PLLI2SCFGR_PLLI2SQ(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SR RCC_PLLI2SCFGR_PLLI2SR(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SSRC RCC_PLLI2SCFGR_PLLI2SSRC(0) /* HSE or HSI depending on PLLSRC of PLLCFGR*/ - -#define STM32_RCC_DCKCFGR2_CK48MSEL RCC_DCKCFGR2_CK48MSEL_PLL -#define STM32_RCC_DCKCFGR2_FMPI2C1SEL RCC_DCKCFGR2_FMPI2C1SEL_APB -#define STM32_RCC_DCKCFGR2_SDIOSEL RCC_DCKCFGR2_SDIOSEL_48MHZ - -#define STM32_SYSCLK_FREQUENCY 96000000ul - -/* AHB clock (HCLK) is SYSCLK (96MHz) */ -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* Same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/2 (48MHz) */ -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB1 will be twice PCLK1 (see page 112 of reference manual) */ -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK (96MHz) */ -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLK /* PCLK2 = HCLK */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY) - -/* Timers driven from APB2 will be PCLK2 since no prescale division */ -#define STM32_APB2_TIM1_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (STM32_PCLK2_FREQUENCY) - -/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx - * otherwise frequency is 2xAPBx. - * Note: TIM1,8 are on APB2, others on APB1 - */ - -#define BOARD_TIM2_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM3_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM4_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM5_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM6_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM7_FREQUENCY (2 * STM32_PCLK1_FREQUENCY) -#define BOARD_TIM8_FREQUENCY (2 * STM32_PCLK2_FREQUENCY) - -/* Alternate function pin selections ************************************************/ - -/* UARTs */ - -#define GPIO_USART1_TX /* PA9 */ GPIO_USART1_TX_1 -#define GPIO_USART1_RX /* PA10 */ GPIO_USART1_RX_1 - -#define GPIO_USART2_TX /* PA2 */ GPIO_USART2_TX_1 -#define GPIO_USART2_RX /* PA3 */ GPIO_USART2_RX_1 - -/* CAN */ - -#define GPIO_CAN1_TX /* PA12 */ GPIO_CAN1_TX_1 -#define GPIO_CAN1_RX /* PA11 */ GPIO_CAN1_RX_1 - -#define GPIO_CAN2_TX /* PB13 */ GPIO_CAN2_TX_1 -#define GPIO_CAN2_RX /* PB12 */ GPIO_CAN2_RX_2 - -/* I2C */ - -#define GPIO_I2C1_SCL /* PB6 */ GPIO_I2C1_SCL_1 -#define GPIO_I2C1_SDA /* PB7 */ GPIO_I2C1_SDA_1 - -#define GPIO_I2C2_SCL /* PB10 */ GPIO_I2C2_SCL_1 -#define GPIO_I2C2_SDA /* PB3 */ GPIO_I2C2_SDA_3 - -/* SPI */ - -#define ADJ_SLEW_RATE(p) (((p) & ~GPIO_SPEED_MASK) | (GPIO_SPEED_2MHz)) - -#define GPIO_SPI1_MISO /* PA6 */ GPIO_SPI1_MISO_1 -#define GPIO_SPI1_MOSI /* PB5 */ GPIO_SPI1_MOSI_2 -#define GPIO_SPI1_SCK /* PA5 */ ADJ_SLEW_RATE(GPIO_SPI1_SCK_1) - -#endif /* __ARCH_BOARD_BOARD_H */ diff --git a/boards/holybro/can-gps-v1/nuttx-config/include/board_dma_map.h b/boards/holybro/can-gps-v1/nuttx-config/include/board_dma_map.h deleted file mode 100644 index ec5e347..0000000 --- a/boards/holybro/can-gps-v1/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ -#pragma once - - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// DMAMAP_USART2_RX // DMA1, Stream 5, Channel 4 (DEBIGT RX) - - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMAMAP_USART1_RX DMAMAP_USART1_RX_1 // DMA2, Stream 2, Channel 4 (GPS RX) -#define DMACHAN_SPI1_RX DMAMAP_SPI1_RX_1 // DMA2, Stream 0, Channel 3 (SPI1 sensors RX) -#define DMACHAN_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 3, Channel 3 (SPI1 sensors TX) diff --git a/boards/holybro/can-gps-v1/nuttx-config/nsh/defconfig b/boards/holybro/can-gps-v1/nuttx-config/nsh/defconfig deleted file mode 100644 index 4dcee61..0000000 --- a/boards/holybro/can-gps-v1/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,186 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_OS_API is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_STM32_DMACAPABLE is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/holybro/can-gps-v1/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F412CE=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=4096 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MM_REGIONS=2 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32_ADC1=y -CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y -CONFIG_STM32_DMA1=y -CONFIG_STM32_DMA2=y -CONFIG_STM32_FLASH_PREFETCH=y -CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_STM32_I2C1=y -CONFIG_STM32_I2C2=y -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_PWR=y -CONFIG_STM32_RTC=y -CONFIG_STM32_RTC_HSECLOCK=y -CONFIG_STM32_RTC_MAGIC=0xfacefeee -CONFIG_STM32_RTC_MAGIC_REG=1 -CONFIG_STM32_RTC_MAGIC_TIME_SET=0xfacefeef -CONFIG_STM32_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32_SPI1=y -CONFIG_STM32_SPI1_DMA=y -CONFIG_STM32_SPI1_DMA_BUFFER=1024 -CONFIG_STM32_SPI_DMATHRESHOLD=8 -CONFIG_STM32_TIM8=y -CONFIG_STM32_USART1=y -CONFIG_STM32_USART2=y -CONFIG_STM32_USART_BREAKS=y -CONFIG_STM32_WWDG=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_RXDMA=y -CONFIG_USART1_TXBUFSIZE=1100 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_SERIAL_CONSOLE=y -CONFIG_USART2_TXBUFSIZE=2500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/holybro/can-gps-v1/nuttx-config/scripts/canbootloader_script.ld b/boards/holybro/can-gps-v1/nuttx-config/scripts/canbootloader_script.ld deleted file mode 100644 index cbf9fdd..0000000 --- a/boards/holybro/can-gps-v1/nuttx-config/scripts/canbootloader_script.ld +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** - * nuttx-config/scripts/canbootloader_script.ld - * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F412 has 512Kb of FLASH beginning at address 0x0800:0000 and - * 256Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of SRAM beginning at address 0x2002:0000 - * 4) 64Kb of TCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 0x10000 of flash is reserved for the bootloader. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08000000, LENGTH = 32K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 192K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/holybro/can-gps-v1/nuttx-config/scripts/script.ld b/boards/holybro/can-gps-v1/nuttx-config/scripts/script.ld deleted file mode 100644 index 050bce7..0000000 --- a/boards/holybro/can-gps-v1/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,147 +0,0 @@ -/**************************************************************************** - * scripts/ld.script - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F412 has 512Kb of FLASH beginning at address 0x0800:0000 and - * 256Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of SRAM beginning at address 0x2002:0000 - * 4) 64Kb of TCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 0x10000 of flash is reserved for the bootloader. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x0800c000, LENGTH = 464K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 256K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(8); - /* - * This section positions the app_descriptor_t used - * by the make_can_boot_descriptor.py tool to set - * the application image's descriptor so that the - * uavcan bootloader has the ability to validate the - * image crc, size etc - */ - KEEP(*(.app_descriptor)) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/holybro/can-gps-v1/src/CMakeLists.txt b/boards/holybro/can-gps-v1/src/CMakeLists.txt deleted file mode 100644 index 52006d2..0000000 --- a/boards/holybro/can-gps-v1/src/CMakeLists.txt +++ /dev/null @@ -1,72 +0,0 @@ -############################################################################ -# -# Copyright (c) 2021 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. -# -############################################################################ - -if("${PX4_BOARD_LABEL}" STREQUAL "canbootloader") - - add_library(drivers_board - boot_config.h - boot.c - led.c - led.h - ) - - target_link_libraries(drivers_board - PRIVATE - nuttx_arch - nuttx_drivers - canbootloader - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/canbootloader) - -else() - add_library(drivers_board - can.c - i2c.cpp - led.c - init.c - manifest.c - spi.cpp - usb.c - ) - add_dependencies(drivers_board arch_board_hw_info) - - target_link_libraries(drivers_board - PRIVATE - arch_spi - arch_board_hw_info - drivers__led # drv_led_start - nuttx_arch - nuttx_drivers - px4_layer - ) -endif() diff --git a/boards/holybro/can-gps-v1/src/board_config.h b/boards/holybro/can-gps-v1/src/board_config.h deleted file mode 100644 index f9acbad..0000000 --- a/boards/holybro/can-gps-v1/src/board_config.h +++ /dev/null @@ -1,170 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * PX4FMUv4 internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -// todo:NCP5623 datasheet says 0x38 driver says 0x39 - needs testing - -/* GPIO *************************************************************************** */ -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that - * can be used by the Px4 Firmware in the adc driver - */ - - -#define ADC1_CH(n) (n) -#define ADC1_GPIO(n) GPIO_ADC1_IN##n - -/* Define GPIO pins used as ADC N.B. Channel numbers must match below */ - -#define PX4_ADC_GPIO \ - /* PA0 */ ADC1_GPIO(0), \ - /* PA1 */ ADC1_GPIO(1) - -/* Define Channel numbers must match above GPIO pin IN(n)*/ - -#define ADC_HW_REV_SENSE_CHANNEL /* PA0 */ ADC1_CH(0) -#define ADC_HW_VER_SENSE_CHANNEL /* PA1 */ ADC1_CH(1) - -#define ADC_CHANNELS \ - ((1 << ADC_HW_REV_SENSE_CHANNEL) | \ - (1 << ADC_HW_VER_SENSE_CHANNEL)) - -/* HW Version and Revision drive signals Default to 1 to detect */ - -#define BOARD_HAS_HW_VERSIONING - -#define GPIO_HW_VER_REV_DRIVE /* PB1 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN1) -#define GPIO_HW_REV_SENSE /* PA0 */ ADC1_GPIO(0) -#define GPIO_HW_VER_SENSE /* PA1 */ ADC1_GPIO(1) -#define HW_INFO_INIT_PREFIX "CANGPS" - -#define CANGPS00 HW_VER_REV(0x0,0x0) // CANGPS - -#define FLASH_BASED_PARAMS - -/* CAN Silence - * - * Silent mode control - */ -#define GPIO_MCU_CAN1_SILENT /* PB2 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN2) -#define GPIO_MCU_CAN2_SILENT /* PA4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN4) - -// SPI pinning for ICM20649 is in spi.ccp - -// GPIO_MCU_SPI1_DRDY /* PB0 */ -// GPIO_MCU_SPI1_NCS_ACC /* PA8 */ - -#define GPIO_SENSOR_3V3_EN /* PC15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN15) - -#define VDD_3V3_SENSORS_EN(on_true) px4_arch_gpiowrite(GPIO_SENSOR_3V3_EN, (on_true)) - -#define GPIO_MCU_I2C1_SCL_RESET /* PB6 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN6) -#define GPIO_MCU_I2C1_SDA_RESET /* PB7 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN7) - -#define GPIO_MCU_I2C2_SCL_RESET /* PB10 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN10) -#define GPIO_MCU_I2C2_SDA_RESET /* PB3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN3) - - -#define GPIO_NOPT_WAIT_FOR_GETNODEINFO /* PC14 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN14) - -#define GPIO_TIM1_CH1N /* PA7 */ GPIO_TIM1_CH1N_1 /* NLED_RED */ -#define GPIO_TIM1_CH2N /* PB14 */ GPIO_TIM1_CH2N_2 /* NLED_BLUE */ -#define GPIO_TIM1_CH3N /* PB15 */ GPIO_TIM1_CH3N_2 /* NLED_GREEN */ - -#define GPIO_TIM2_CH1 /* PA15 */ GPIO_TIM2_CH1_3 /* GPS_PPS_IN */ // todo:needs Driver -#define GPIO_GPS_PPS_IN /* PA15 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTA|GPIO_PIN15) - -/* High-resolution timer */ -#define HRT_TIMER 3 /* use timer 3 for the HRT */ -#define HRT_TIMER_CHANNEL 4 /* use capture/compare channel 4 */ - -#define PX4_GPIO_INIT_LIST { \ - PX4_ADC_GPIO, \ - GPIO_HW_VER_REV_DRIVE, \ - GPIO_SENSOR_3V3_EN, \ - GPIO_MCU_I2C1_SCL_RESET, \ - GPIO_MCU_I2C1_SDA_RESET, \ - GPIO_MCU_I2C2_SCL_RESET, \ - GPIO_MCU_I2C2_SDA_RESET, \ - GPIO_CAN1_TX, \ - GPIO_CAN1_RX, \ - GPIO_CAN2_TX, \ - GPIO_CAN2_RX, \ - GPIO_MCU_CAN1_SILENT, \ - GPIO_MCU_CAN2_SILENT, \ - GPIO_NOPT_WAIT_FOR_GETNODEINFO, \ - GPIO_GPS_PPS_IN \ - } - -__BEGIN_DECLS - -#ifndef __ASSEMBLY__ - -/**************************************************************************************************** - * Public Functions - ****************************************************************************************************/ - -/**************************************************************************************************** - * 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); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/holybro/can-gps-v1/src/boot.c b/boards/holybro/can-gps-v1/src/boot.c deleted file mode 100644 index f4a3028..0000000 --- a/boards/holybro/can-gps-v1/src/boot.c +++ /dev/null @@ -1,190 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2015-2021 PX4 Development Team. All rights reserved. - * Author: Ben Dyer - * Pavel Kirienko - * David Sidrane - * - * 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include "boot_config.h" -#include "board.h" - -#include -#include -#include - -#include -#include "led.h" - -/************************************************************************************ - * 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) -{ - putreg32(getreg32(STM32_RCC_APB1ENR) | RCC_APB1ENR_CAN1EN | RCC_APB1ENR_CAN2EN, STM32_RCC_APB1ENR); - stm32_configgpio(GPIO_CAN1_RX); - stm32_configgpio(GPIO_CAN1_TX); - stm32_configgpio(GPIO_CAN2_RX); - stm32_configgpio(GPIO_CAN2_TX); - stm32_configgpio(GPIO_MCU_CAN1_SILENT); - stm32_configgpio(GPIO_MCU_CAN2_SILENT); - putreg32(getreg32(STM32_RCC_APB1RSTR) | RCC_APB1RSTR_CAN1RST | RCC_APB1RSTR_CAN2RST, STM32_RCC_APB1RSTR); - putreg32(getreg32(STM32_RCC_APB1RSTR) & ~(RCC_APB1RSTR_CAN1RST | RCC_APB1RSTR_CAN2RST), STM32_RCC_APB1RSTR); - -#if defined(OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO) - stm32_configgpio(GPIO_NOPT_WAIT_FOR_GETNODEINFO); -#endif - -} - -/************************************************************************************ - * Name: board_deinitialize - * - * Description: - * This function is called by the bootloader code prior to booting - * the application. Is should place the HW into an benign initialized state. - * - ************************************************************************************/ - -void board_deinitialize(void) -{ - putreg32(getreg32(STM32_RCC_APB1RSTR) | RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR); -} - -/**************************************************************************** - * Name: board_get_product_name - * - * Description: - * Called to retrieve the product name. The returned value is a assumed - * to be written to a pascal style string that will be length prefixed - * and not null terminated - * - * Input Parameters: - * product_name - A pointer to a buffer to write the name. - * maxlen - The maximum number of charter that can be written - * - * Returned Value: - * The length of characters written to the buffer. - * - ****************************************************************************/ - -uint8_t board_get_product_name(uint8_t *product_name, size_t maxlen) -{ - DEBUGASSERT(maxlen > UAVCAN_STRLEN(HW_UAVCAN_NAME)); - memcpy(product_name, HW_UAVCAN_NAME, UAVCAN_STRLEN(HW_UAVCAN_NAME)); - return UAVCAN_STRLEN(HW_UAVCAN_NAME); -} - -/**************************************************************************** - * Name: board_get_hardware_version - * - * Description: - * Called to retrieve the hardware version information. The function - * will first initialize the the callers struct to all zeros. - * - * Input Parameters: - * hw_version - A pointer to a uavcan_hardwareversion_t. - * - * Returned Value: - * Length of the unique_id - * - ****************************************************************************/ - -size_t board_get_hardware_version(uavcan_HardwareVersion_t *hw_version) -{ - memset(hw_version, 0, sizeof(uavcan_HardwareVersion_t)); - - hw_version->major = HW_VERSION_MAJOR; - hw_version->minor = HW_VERSION_MINOR; - - return board_get_mfguid(*(mfguid_t *) hw_version->unique_id); -} - -/**************************************************************************** - * Name: board_indicate - * - * Description: - * Provides User feedback to indicate the state of the bootloader - * on board specific hardware. - * - * Input Parameters: - * indication - A member of the uiindication_t - * - * Returned Value: - * None - * - ****************************************************************************/ -#define led(n, code, r , g , b, h) {.red = (r),.green = (g), .blue = (b),.hz = (h)} - -typedef begin_packed_struct struct led_t { - uint8_t red; - uint8_t green; - uint8_t blue; - uint8_t hz; -} end_packed_struct led_t; - -static const led_t i2l[] = { - - led(0, off, 0, 0, 0, 0), - led(1, reset, 255, 255, 255, 30), - led(2, autobaud_start, 0, 255, 0, 1), - led(3, autobaud_end, 0, 255, 0, 2), - led(4, allocation_start, 0, 0, 128, 2), - led(5, allocation_end, 0, 255, 128, 3), - led(6, fw_update_start, 64, 255, 128, 3), - led(7, fw_update_erase_fail, 64, 255, 64, 3), - led(8, fw_update_invalid_response, 128, 0, 0, 1), - led(9, fw_update_timeout, 128, 0, 0, 2), - led(a, fw_update_invalid_crc, 128, 0, 0, 4), - led(b, jump_to_app, 0, 255, 0, 10), - -}; - -void board_indicate(uiindication_t indication) -{ - rgb_led(i2l[indication].red, - i2l[indication].green, - i2l[indication].blue, - i2l[indication].hz); -} diff --git a/boards/holybro/can-gps-v1/src/boot_config.h b/boards/holybro/can-gps-v1/src/boot_config.h deleted file mode 100644 index 5ffadb3..0000000 --- a/boards/holybro/can-gps-v1/src/boot_config.h +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-2021 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. - * - ****************************************************************************/ - -/* - * @file boot_config.h - * - * bootloader definitions that configures the behavior and options - * of the Boot loader - * This file is relies on the parent folder's boot_config.h file and defines - * different usages of the hardware for bootloading - */ - -#pragma once - - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -/* Bring in the board_config.h definitions - * todo:make this be pulled in from a targed's build - * files in nuttx*/ - -#include "board_config.h" -#include "uavcan.h" -#include - -#include - -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define OPT_PREFERRED_NODE_ID ANY_NODE_ID - -//todo:wrap OPT_x in in ifdefs for command line definitions -#define OPT_TBOOT_MS 5000 -#define OPT_NODE_STATUS_RATE_MS 800 -#define OPT_NODE_INFO_RATE_MS 50 -#define OPT_BL_NUMBER_TIMERS 7 - -/* - * This Option set is set to 1 ensure a provider of firmware has an - * opportunity update the node's firmware. - * This Option is the default policy and can be overridden by - * a jumper - * When this Policy is set, the node will ignore tboot and - * wait indefinitely for a GetNodeInfo request before booting. - * - * OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO_INVERT is used to allow - * the polarity of the jumper to be True Active - * - * wait OPT_WAIT_FOR_GETNODEINFO OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO - * Jumper - * yes 1 0 x - * yes 1 1 Active - * no 1 1 Not Active - * no 0 0 X - * yes 0 1 Active - * no 0 1 Not Active - * - */ -#define OPT_WAIT_FOR_GETNODEINFO 0 -#define OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO 1 -#define OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO_INVERT 1 - -#define OPT_ENABLE_WD 1 - -#define OPT_RESTART_TIMEOUT_MS 20000 - -/* Reserved for the Booloader */ -#define OPT_BOOTLOADER_SIZE_IN_K (32 * 1024) - -/* Reserved for the application out of the total - * system flash minus the BOOTLOADER_SIZE_IN_K - */ -#define OPT_APPLICATION_RESERVER_IN_K (16 * 1024) - -#define OPT_APPLICATION_IMAGE_OFFSET (OPT_BOOTLOADER_SIZE_IN_K + OPT_APPLICATION_RESERVER_IN_K) -#define OPT_APPLICATION_IMAGE_LENGTH (FLASH_SIZE-(OPT_BOOTLOADER_SIZE_IN_K + OPT_APPLICATION_RESERVER_IN_K)) - - -#define FLASH_BASE STM32_FLASH_BASE -#define FLASH_SIZE STM32_FLASH_SIZE - -#define APPLICATION_LOAD_ADDRESS (FLASH_BASE + OPT_APPLICATION_IMAGE_OFFSET) -#define APPLICATION_SIZE (FLASH_SIZE-OPT_APPLICATION_IMAGE_OFFSET) -#define APPLICATION_LAST_8BIT_ADDRRESS ((uint8_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint8_t))) -#define APPLICATION_LAST_32BIT_ADDRRESS ((uint32_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint32_t))) -#define APPLICATION_LAST_64BIT_ADDRRESS ((uint64_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint64_t))) - -/* If this board uses big flash that have large sectors */ -#define OPT_USE_YIELD - -/* Bootloader Option***************************************************************** - * - */ -#define GPIO_GETNODEINFO_JUMPER GPIO_NOPT_WAIT_FOR_GETNODEINFO diff --git a/boards/holybro/can-gps-v1/src/can.c b/boards/holybro/can-gps-v1/src/can.c deleted file mode 100644 index 89b8ba2..0000000 --- a/boards/holybro/can-gps-v1/src/can.c +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file can.c - * - * Board-specific CAN functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include - -#include -#include - -#include "chip.h" -#include "arm_internal.h" - -#include "stm32.h" -#include "stm32_can.h" -#include "board_config.h" - -#ifdef CONFIG_CAN - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) -# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." -# undef CONFIG_STM32_CAN2 -#endif - -#ifdef CONFIG_STM32_CAN1 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); - -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} - -#endif diff --git a/boards/holybro/can-gps-v1/src/i2c.cpp b/boards/holybro/can-gps-v1/src/i2c.cpp deleted file mode 100644 index 8b4552b..0000000 --- a/boards/holybro/can-gps-v1/src/i2c.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusInternal(1), - initI2CBusInternal(2), -}; diff --git a/boards/holybro/can-gps-v1/src/init.c b/boards/holybro/can-gps-v1/src/init.c deleted file mode 100644 index 2495283..0000000 --- a/boards/holybro/can-gps-v1/src/init.c +++ /dev/null @@ -1,177 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * PX4FMU-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include "board_config.h" -#include - -#include - -#include - -#include "led.h" - -#include - -#include - -#include -#include -#include -# if defined(FLASH_BASED_PARAMS) -# include -#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) -{ - /* 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 - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - VDD_3V3_SENSORS_EN(true); - - px4_platform_init(); - - if (OK == board_determine_hw_info()) { - syslog(LOG_INFO, "[boot] Rev 0x%1x : Ver 0x%1x %s\n", board_get_hw_revision(), board_get_hw_version(), - board_get_hw_type_name()); - - } else { - syslog(LOG_ERR, "[boot] Failed to read HW revision and version\n"); - } - - /* configure SPI interfaces (after we determined the HW version) */ - - stm32_spiinitialize(); - -#if defined(FLASH_BASED_PARAMS) - static sector_descriptor_t params_sector_map[] = { - {2, 16 * 1024, 0x08008000}, - {0, 0, 0}, - }; - - /* Initialize the flashfs layer to use heap allocated memory */ - int result = parameter_flashfs_init(params_sector_map, NULL, 0); - - if (result != OK) { - syslog(LOG_ERR, "[boot] FAILED to init params in FLASH %d\n", result); - } - -#endif // FLASH_BASED_PARAMS - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - rgb_led(0, 255, 0, 0); - return OK; -} diff --git a/boards/holybro/can-gps-v1/src/led.c b/boards/holybro/can-gps-v1/src/led.c deleted file mode 100644 index 99c67d9..0000000 --- a/boards/holybro/can-gps-v1/src/led.c +++ /dev/null @@ -1,124 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -#include "led.h" - -#define TMR_BASE STM32_TIM1_BASE -#define TMR_FREQUENCY STM32_APB2_TIM1_CLKIN -#define TMR_REG(o) (TMR_BASE+(o)) - -void rgb_led(int r, int g, int b, int freqs) -{ - - long fosc = TMR_FREQUENCY; - long prescale = 9600; - long p1s = fosc / prescale; - long p0p5s = p1s / 2; - uint16_t val; - static bool once = 0; - - if (!once) { - once = 1; - - /* Enable Clock to Block */ - - modifyreg32(STM32_RCC_APB2ENR, 0, RCC_APB2ENR_TIM1EN); - - /* Reload */ - - val = getreg16(TMR_REG(STM32_BTIM_EGR_OFFSET)); - val |= ATIM_EGR_UG; - putreg16(val, TMR_REG(STM32_BTIM_EGR_OFFSET)); - - /* Set Prescaler STM32_TIM_SETCLOCK */ - - putreg16(prescale, TMR_REG(STM32_BTIM_PSC_OFFSET)); - - /* Enable STM32_TIM_SETMODE*/ - - putreg16(ATIM_CR1_CEN | ATIM_CR1_ARPE, TMR_REG(STM32_BTIM_CR1_OFFSET)); - - putreg16((ATIM_CCMR_MODE_PWM1 << ATIM_CCMR1_OC1M_SHIFT) | ATIM_CCMR1_OC1PE | - (ATIM_CCMR_MODE_PWM1 << ATIM_CCMR1_OC2M_SHIFT) | ATIM_CCMR1_OC2PE, TMR_REG(STM32_GTIM_CCMR1_OFFSET)); - putreg16((ATIM_CCMR_MODE_PWM1 << ATIM_CCMR2_OC3M_SHIFT) | ATIM_CCMR2_OC3PE, TMR_REG(STM32_GTIM_CCMR2_OFFSET)); - putreg16(ATIM_CCER_CC3NE | ATIM_CCER_CC3NP | ATIM_CCER_CC2NE | ATIM_CCER_CC2NP | ATIM_CCER_CC1NE | ATIM_CCER_CC1NP, - TMR_REG(STM32_GTIM_CCER_OFFSET)); - - - stm32_configgpio(GPIO_TIM1_CH1N); - stm32_configgpio(GPIO_TIM1_CH2N); - stm32_configgpio(GPIO_TIM1_CH3N); - - /* master output enable = on */ - - putreg16(ATIM_BDTR_MOE, (TMR_REG(STM32_ATIM_BDTR_OFFSET))); - } - - long p = freqs == 0 ? p1s : p1s / freqs; - putreg32(p, TMR_REG(STM32_BTIM_ARR_OFFSET)); - - p = freqs == 0 ? p1s + 1 : p0p5s / freqs; - - putreg32((r * p) / 255, TMR_REG(STM32_GTIM_CCR1_OFFSET)); - putreg32((g * p) / 255, TMR_REG(STM32_GTIM_CCR2_OFFSET)); - putreg32((b * p) / 255, TMR_REG(STM32_GTIM_CCR3_OFFSET)); - - val = getreg16(TMR_REG(STM32_BTIM_CR1_OFFSET)); - - if (freqs == 0) { - val &= ~ATIM_CR1_CEN; - - } else { - val |= ATIM_CR1_CEN; - } - - putreg16(val, TMR_REG(STM32_BTIM_CR1_OFFSET)); - -} diff --git a/boards/holybro/can-gps-v1/src/led.h b/boards/holybro/can-gps-v1/src/led.h deleted file mode 100644 index b68e4aa..0000000 --- a/boards/holybro/can-gps-v1/src/led.h +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2015 PX4 Development Team. All rights reserved. - * Author: David Sidrane - * - * 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. - * - ****************************************************************************/ - -__BEGIN_DECLS -void rgb_led(int r, int g, int b, int freqs); -__END_DECLS diff --git a/boards/holybro/can-gps-v1/src/manifest.c b/boards/holybro/can-gps-v1/src/manifest.c deleted file mode 100644 index eff41ef..0000000 --- a/boards/holybro/can-gps-v1/src/manifest.c +++ /dev/null @@ -1,153 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2018-2021 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. - * - ****************************************************************************/ - -/** - * @file manifest.c - * - * This module supplies the interface to the manifest of hardware that is - * optional and dependent on the HW REV and HW VER IDs - * - * The manifest allows the system to know whether a hardware option - * say for example the PX4IO is an no-pop option vs it is broken. - * - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include - -#include "systemlib/px4_macros.h" - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -typedef struct { - uint32_t hw_ver_rev; /* the version and revision */ - const px4_hw_mft_item_t *mft; /* The first entry */ - uint32_t entries; /* the lenght of the list */ -} px4_hw_mft_list_entry_t; - -typedef px4_hw_mft_list_entry_t *px4_hw_mft_list_entry; -#define px4_hw_mft_list_uninitialized (px4_hw_mft_list_entry) -1 - -static const px4_hw_mft_item_t device_unsupported = {0, 0, 0}; - -// List of components on a specific board configuration -// The index of those components is given by the enum (px4_hw_mft_item_id_t) -// declared in board_common.h - -static const px4_hw_mft_item_t hw_mft_list_v0000[] = { - { - // PX4_MFT_PX4IO - .present = 0, - .mandatory = 0, - .connection = px4_hw_con_unknown, - }, - { - // PX4_MFT_USB - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, - { - // PX4_MFT_CAN2 - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, - { - // PX4_MFT_CAN3 - .present = 0, - .mandatory = 0, - .connection = px4_hw_con_unknown, - }, -}; - - -static px4_hw_mft_list_entry_t mft_lists[] = { -// ver/rev - {CANGPS00, hw_mft_list_v0000, arraySize(hw_mft_list_v0000)}, -}; - -/************************************************************************************ - * Name: board_query_manifest - * - * Description: - * Optional returns manifest item. - * - * Input Parameters: - * manifest_id - the ID for the manifest item to retrieve - * - * Returned Value: - * 0 - item is not in manifest => assume legacy operations - * pointer to a manifest item - * - ************************************************************************************/ - -__EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) -{ - static px4_hw_mft_list_entry boards_manifest = px4_hw_mft_list_uninitialized; - - if (boards_manifest == px4_hw_mft_list_uninitialized) { - uint32_t ver_rev = board_get_hw_version() << 16; - ver_rev |= board_get_hw_revision(); - - for (unsigned i = 0; i < arraySize(mft_lists); i++) { - if (mft_lists[i].hw_ver_rev == ver_rev) { - boards_manifest = &mft_lists[i]; - break; - } - } - - if (boards_manifest == px4_hw_mft_list_uninitialized) { - syslog(LOG_ERR, "[boot] Board %08" PRIx32 " is not supported!\n", ver_rev); - } - } - - px4_hw_mft_item rv = &device_unsupported; - - if (boards_manifest != px4_hw_mft_list_uninitialized && - id < boards_manifest->entries) { - rv = &boards_manifest->mft[id]; - } - - return rv; -} diff --git a/boards/holybro/can-gps-v1/src/spi.cpp b/boards/holybro/can-gps-v1/src/spi.cpp deleted file mode 100644 index b6cc625..0000000 --- a/boards/holybro/can-gps-v1/src/spi.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20649, SPI::CS{GPIO::PortA, GPIO::Pin8}, SPI::DRDY{GPIO::PortB, GPIO::Pin0}), - }, {GPIO::PortC, GPIO::Pin15}), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/holybro/can-gps-v1/src/usb.c b/boards/holybro/can-gps-v1/src/usb.c deleted file mode 100644 index ac46c4a..0000000 --- a/boards/holybro/can-gps-v1/src/usb.c +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#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_STM32_OTGFS - stm32_configgpio(GPIO_OTGFS_VBUS); -#endif -} - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/holybro/can-gps-v1/uavcan_board_identity b/boards/holybro/can-gps-v1/uavcan_board_identity deleted file mode 100644 index c34b51c..0000000 --- a/boards/holybro/can-gps-v1/uavcan_board_identity +++ /dev/null @@ -1,17 +0,0 @@ -# UAVCAN boot loadable Module ID -set(uavcanblid_sw_version_major 0) -set(uavcanblid_sw_version_minor 1) -add_definitions( - -DAPP_VERSION_MAJOR=${uavcanblid_sw_version_major} - -DAPP_VERSION_MINOR=${uavcanblid_sw_version_minor} -) - -set(uavcanblid_hw_version_major 0) -set(uavcanblid_hw_version_minor 79) -set(uavcanblid_name "\"org.holybro.can-gps-v1\"") - -add_definitions( - -DHW_UAVCAN_NAME=${uavcanblid_name} - -DHW_VERSION_MAJOR=${uavcanblid_hw_version_major} - -DHW_VERSION_MINOR=${uavcanblid_hw_version_minor} -) diff --git a/boards/holybro/durandal-v1/bootloader.px4board b/boards/holybro/durandal-v1/bootloader.px4board deleted file mode 100644 index 19b6e66..0000000 --- a/boards/holybro/durandal-v1/bootloader.px4board +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_ROMFSROOT="" diff --git a/boards/holybro/durandal-v1/default.px4board b/boards/holybro/durandal-v1/default.px4board deleted file mode 100644 index 362eaff..0000000 --- a/boards/holybro/durandal-v1/default.px4board +++ /dev/null @@ -1,92 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS0" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS2" -CONFIG_BOARD_SERIAL_TEL3="/dev/ttyS4" -CONFIG_BOARD_SERIAL_TEL4="/dev/ttyS3" -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_COMMON_BAROMETERS=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_HEATER=y -CONFIG_DRIVERS_IMU_BOSCH_BMI088=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20689=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_PX4IO=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/holybro/durandal-v1/extras/holybro_durandal-v1_bootloader.bin b/boards/holybro/durandal-v1/extras/holybro_durandal-v1_bootloader.bin deleted file mode 100755 index 388ee7a..0000000 Binary files a/boards/holybro/durandal-v1/extras/holybro_durandal-v1_bootloader.bin and /dev/null differ diff --git a/boards/holybro/durandal-v1/extras/px4_io-v2_default.bin b/boards/holybro/durandal-v1/extras/px4_io-v2_default.bin deleted file mode 100755 index 957f0f1..0000000 Binary files a/boards/holybro/durandal-v1/extras/px4_io-v2_default.bin and /dev/null differ diff --git a/boards/holybro/durandal-v1/firmware.prototype b/boards/holybro/durandal-v1/firmware.prototype deleted file mode 100644 index b0866ef..0000000 --- a/boards/holybro/durandal-v1/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 139, - "magic": "PX4FWv1", - "description": "Firmware for the Durandalv1 board", - "image": "", - "build_time": 0, - "summary": "DURANDALv1", - "version": "0.1", - "image_size": 0, - "image_maxsize": 1966080, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/holybro/durandal-v1/init/rc.board_defaults b/boards/holybro/durandal-v1/init/rc.board_defaults deleted file mode 100644 index 2a3b2c0..0000000 --- a/boards/holybro/durandal-v1/init/rc.board_defaults +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 18.1 -param set-default BAT2_V_DIV 18.1 - -param set-default BAT1_A_PER_V 36.367515152 -param set-default BAT2_A_PER_V 36.367515152 - -# Enable IMU thermal control -param set-default SENS_EN_THERMAL 1 - -param set-default SYS_USE_IO 1 diff --git a/boards/holybro/durandal-v1/init/rc.board_sensors b/boards/holybro/durandal-v1/init/rc.board_sensors deleted file mode 100644 index 60519aa..0000000 --- a/boards/holybro/durandal-v1/init/rc.board_sensors +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -# -# Holybro Durandal V1 specific board sensors init -#------------------------------------------------------------------------------ -board_adc start - -# Internal SPI bus ICM-20689 -icm20689 -R 2 -s start - -# Internal SPI BMI088 -bmi088 -A -R 2 -s start -bmi088 -G -R 2 -s start - -if ver hwtypecmp VD000000 -then - # Internal SPI BMI088 - bmi088 -A -R 2 -s start - bmi088 -G -R 2 -s start -fi -if ver hwtypecmp VD000001 -then - # Internal SPI ICM-20602 - icm20602 -R 2 -s start -fi - -# internal compass -ist8310 -I -R 10 start - -# Baro on internal SPI -ms5611 -s start - -# External compass on GPS1/I2C1: standard Holybro GPS/compass puck (with lights, safety button, and buzzer) -ist8310 -X -b 1 -R 10 start diff --git a/boards/holybro/durandal-v1/nuttx-config/Kconfig b/boards/holybro/durandal-v1/nuttx-config/Kconfig deleted file mode 100644 index bb33d3c..0000000 --- a/boards/holybro/durandal-v1/nuttx-config/Kconfig +++ /dev/null @@ -1,17 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see misc/tools/kconfig-language.txt. -# -config BOARD_HAS_PROBES - bool "Board provides GPIO or other Hardware for signaling to timing analyze." - default y - ---help--- - This board provides GPIO FMU-CH1-5, CAP1-6 as PROBE_1-11 to provide timing signals from selected drivers. - -config BOARD_USE_PROBES - bool "Enable the use the board provided FMU-CH1-5, CAP1-6 as PROBE_1-11" - default n - depends on BOARD_HAS_PROBES - - ---help--- - Select to use GPIO FMU-CH1-5, CAP1-6 to provide timing signals from selected drivers. diff --git a/boards/holybro/durandal-v1/nuttx-config/bootloader/defconfig b/boards/holybro/durandal-v1/nuttx-config/bootloader/defconfig deleted file mode 100644 index 14f3827..0000000 --- a/boards/holybro/durandal-v1/nuttx-config/bootloader/defconfig +++ /dev/null @@ -1,90 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_CONSOLE is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_SPI_EXCHANGE is not set -# CONFIG_STM32H7_SYSCFG is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/holybro/durandal-v1/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743II=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_INITTHREAD_PRIORITY=254 -CONFIG_BOARD_LATE_INITIALIZE=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x004b -CONFIG_CDCACM_PRODUCTSTR="PX4 BL Holybro Durandal Vx" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x3162 -CONFIG_CDCACM_VENDORSTR="Holybro" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_EXPERIMENTAL=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="bootloader_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SPI=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_USART3=y -CONFIG_SYSTEMTICK_HOOK=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGINT_CHAR=0x03 -CONFIG_TTY_SIGTSTP=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/holybro/durandal-v1/nuttx-config/include/board.h b/boards/holybro/durandal-v1/nuttx-config/include/board.h deleted file mode 100644 index 2a475b7..0000000 --- a/boards/holybro/durandal-v1/nuttx-config/include/board.h +++ /dev/null @@ -1,516 +0,0 @@ -/************************************************************************************ - * nuttx-configs/holybro/durandal-v1/include/board.h - * - * Copyright (C) 2016-2019 Gregory Nutt. All rights reserved. - * Authors: David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ -#ifndef __NUTTX_CONFIG_HOLYBRO_DURANDAL_V1_INCLUDE_BOARD_H -#define __NUTTX_CONFIG_HOLYBRO_DURANDAL_V1_INCLUDE_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The holybro durandal v1 board provides the following clock sources: - * - * X1: 16 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 16 MHz RC factory-trimmed - * HSE: 16 MHz crystal for HSE - */ - -#define STM32_BOARD_XTAL 16000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 32768 - -/* Main PLL Configuration. - * - * PLL source is HSE = 16,000,000 - * - * PLL_VCOx = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 1 <= PLLM <= 63 - * 4 <= PLLN <= 512 - * 150 MHz <= PLL_VCOL <= 420MHz - * 192 MHz <= PLL_VCOH <= 836MHz - * - * SYSCLK = PLL_VCO / PLLP - * CPUCLK = SYSCLK / D1CPRE - * Subject to - * - * PLLP1 = {2, 4, 6, 8, ..., 128} - * PLLP2,3 = {2, 3, 4, ..., 128} - * CPUCLK <= 480 MHz - */ - -#define STM32_BOARD_USEHSE - -#define STM32_PLLCFG_PLLSRC RCC_PLLCKSELR_PLLSRC_HSE - -/* PLL1, wide 4 - 8 MHz input, enable DIVP, DIVQ, DIVR - * - * PLL1_VCO = (16,000,000 / 1) * 60 = 960 MHz - * - * PLL1P = PLL1_VCO/2 = 960 MHz / 2 = 480 MHz - * PLL1Q = PLL1_VCO/4 = 960 MHz / 4 = 240 MHz - * PLL1R = PLL1_VCO/8 = 960 MHz / 8 = 120 MHz - */ - -#define STM32_PLLCFG_PLL1CFG (RCC_PLLCFGR_PLL1VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL1RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVP1EN | \ - RCC_PLLCFGR_DIVQ1EN | \ - RCC_PLLCFGR_DIVR1EN) -#define STM32_PLLCFG_PLL1M RCC_PLLCKSELR_DIVM1(1) -#define STM32_PLLCFG_PLL1N RCC_PLL1DIVR_N1(60) -#define STM32_PLLCFG_PLL1P RCC_PLL1DIVR_P1(2) -#define STM32_PLLCFG_PLL1Q RCC_PLL1DIVR_Q1(4) -#define STM32_PLLCFG_PLL1R RCC_PLL1DIVR_R1(8) - -#define STM32_VCO1_FREQUENCY ((STM32_HSE_FREQUENCY / 1) * 60) -#define STM32_PLL1P_FREQUENCY (STM32_VCO1_FREQUENCY / 2) -#define STM32_PLL1Q_FREQUENCY (STM32_VCO1_FREQUENCY / 4) -#define STM32_PLL1R_FREQUENCY (STM32_VCO1_FREQUENCY / 8) - -/* PLL2 */ - -#define STM32_PLLCFG_PLL2CFG (RCC_PLLCFGR_PLL2VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL2RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVP2EN | \ - RCC_PLLCFGR_DIVQ2EN | \ - RCC_PLLCFGR_DIVR2EN) -#define STM32_PLLCFG_PLL2M RCC_PLLCKSELR_DIVM2(4) -#define STM32_PLLCFG_PLL2N RCC_PLL2DIVR_N2(48) -#define STM32_PLLCFG_PLL2P RCC_PLL2DIVR_P2(2) -#define STM32_PLLCFG_PLL2Q RCC_PLL2DIVR_Q2(2) -#define STM32_PLLCFG_PLL2R RCC_PLL2DIVR_R2(2) - -#define STM32_VCO2_FREQUENCY ((STM32_HSE_FREQUENCY / 4) * 48) -#define STM32_PLL2P_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2Q_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2R_FREQUENCY (STM32_VCO2_FREQUENCY / 2) - -/* PLL3 */ - -#define STM32_PLLCFG_PLL3CFG (RCC_PLLCFGR_PLL3VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL3RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVQ3EN) -#define STM32_PLLCFG_PLL3M RCC_PLLCKSELR_DIVM3(4) -#define STM32_PLLCFG_PLL3N RCC_PLL3DIVR_N3(48) -#define STM32_PLLCFG_PLL3P RCC_PLL3DIVR_P3(2) -#define STM32_PLLCFG_PLL3Q RCC_PLL3DIVR_Q3(4) -#define STM32_PLLCFG_PLL3R RCC_PLL3DIVR_R3(2) - -#define STM32_VCO3_FREQUENCY ((STM32_HSE_FREQUENCY / 4) * 48) -#define STM32_PLL3P_FREQUENCY (STM32_VCO3_FREQUENCY / 2) -#define STM32_PLL3Q_FREQUENCY (STM32_VCO3_FREQUENCY / 4) -#define STM32_PLL3R_FREQUENCY (STM32_VCO3_FREQUENCY / 2) - -/* SYSCLK = PLL1P = 480MHz - * CPUCLK = SYSCLK / 1 = 480 MHz - */ - -#define STM32_RCC_D1CFGR_D1CPRE (RCC_D1CFGR_D1CPRE_SYSCLK) -#define STM32_SYSCLK_FREQUENCY (STM32_PLL1P_FREQUENCY) -#define STM32_CPUCLK_FREQUENCY (STM32_SYSCLK_FREQUENCY / 1) - -/* Configure Clock Assignments */ - -/* AHB clock (HCLK) is SYSCLK/2 (240 MHz max) - * HCLK1 = HCLK2 = HCLK3 = HCLK4 = 240 - */ - -#define STM32_RCC_D1CFGR_HPRE RCC_D1CFGR_HPRE_SYSCLKd2 /* HCLK = SYSCLK / 2 */ -#define STM32_ACLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* ACLK in D1, HCLK3 in D1 */ -#define STM32_HCLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* HCLK in D2, HCLK4 in D3 */ -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D2CFGR_D2PPRE1 RCC_D2CFGR_D2PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB2 clock (PCLK2) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D2CFGR_D2PPRE2 RCC_D2CFGR_D2PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB3 clock (PCLK3) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D1CFGR_D1PPRE RCC_D1CFGR_D1PPRE_HCLKd2 /* PCLK3 = HCLK / 2 */ -#define STM32_PCLK3_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB4 clock (PCLK4) is HCLK/4 (120 MHz) */ - -#define STM32_RCC_D3CFGR_D3PPRE RCC_D3CFGR_D3PPRE_HCLKd2 /* PCLK4 = HCLK / 2 */ -#define STM32_PCLK4_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timer clock frequencies */ - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM15_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM16_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM17_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Kernel Clock Configuration - * - * Note: look at Table 54 in ST Manual - */ - -/* I2C123 clock source */ - -#define STM32_RCC_D2CCIP2R_I2C123SRC RCC_D2CCIP2R_I2C123SEL_HSI - -/* I2C4 clock source */ - -#define STM32_RCC_D3CCIPR_I2C4SRC RCC_D3CCIPR_I2C4SEL_HSI - -/* SPI123 clock source */ - -#define STM32_RCC_D2CCIP1R_SPI123SRC RCC_D2CCIP1R_SPI123SEL_PLL2 - -/* SPI45 clock source */ - -#define STM32_RCC_D2CCIP1R_SPI45SRC RCC_D2CCIP1R_SPI45SEL_PLL2 - -/* SPI6 clock source */ - -#define STM32_RCC_D3CCIPR_SPI6SRC RCC_D3CCIPR_SPI6SEL_PLL2 - -/* USB 1 and 2 clock source */ - -#define STM32_RCC_D2CCIP2R_USBSRC RCC_D2CCIP2R_USBSEL_PLL3 - -/* ADC 1 2 3 clock source */ - -#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2 - -/* FDCAN 1 2 clock source */ - -#define STM32_RCC_D2CCIP1R_FDCANSEL RCC_D2CCIP1R_FDCANSEL_HSE /* FDCAN 1 2 clock source */ - -#define STM32_FDCANCLK STM32_HSE_FREQUENCY - -/* FLASH wait states - * - * ------------ ---------- ----------- - * Vcore MAX ACLK WAIT STATES - * ------------ ---------- ----------- - * 1.15-1.26 V 70 MHz 0 - * (VOS1 level) 140 MHz 1 - * 210 MHz 2 - * 1.05-1.15 V 55 MHz 0 - * (VOS2 level) 110 MHz 1 - * 165 MHz 2 - * 220 MHz 3 - * 0.95-1.05 V 45 MHz 0 - * (VOS3 level) 90 MHz 1 - * 135 MHz 2 - * 180 MHz 3 - * 225 MHz 4 - * ------------ ---------- ----------- - */ - -#define BOARD_FLASH_WAITSTATES 2 - -/* SDMMC definitions ********************************************************/ - -/* Init 400kHz, freq = PLL1Q/(2*div) div = PLL1Q/(2*freq) */ - -#define STM32_SDMMC_INIT_CLKDIV (300 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* 25 MHz Max for now, 25 mHZ = PLL1Q/(2*div), div = PLL1Q/(2*freq) - * div = 4.8 = 240 / 50, So round up to 5 for default speed 24 MB/s - */ - -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_MMCXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_SDXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - -/* LED definitions ******************************************************************/ -/* The holybro durandal v1 board has three, LED_GREEN a Green LED, LED_BLUE - * a Blue LED and LED_RED a Red LED, that can be controlled by software. - * - * If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any way. - * The following definitions are used to access individual LEDs. - */ - -/* LED index values for use with board_userled() */ - -#define BOARD_LED1 0 -#define BOARD_LED2 1 -#define BOARD_LED3 2 -#define BOARD_NLEDS 3 - -#define BOARD_LED_RED BOARD_LED1 -#define BOARD_LED_GREEN BOARD_LED2 -#define BOARD_LED_BLUE BOARD_LED3 - -/* LED bits for use with board_userled_all() */ - -#define BOARD_LED1_BIT (1 << BOARD_LED1) -#define BOARD_LED2_BIT (1 << BOARD_LED2) -#define BOARD_LED3_BIT (1 << BOARD_LED3) - -/* If CONFIG_ARCH_LEDS is defined, the usage by the board port is defined in - * include/board.h and src/stm32_leds.c. The LEDs are used to encode OS-related - * events as follows: - * - * - * SYMBOL Meaning LED state - * Red Green Blue - * ---------------------- -------------------------- ------ ------ ----*/ - -#define LED_STARTED 0 /* NuttX has been started OFF OFF OFF */ -#define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF OFF ON */ -#define LED_IRQSENABLED 2 /* Interrupts enabled OFF ON OFF */ -#define LED_STACKCREATED 3 /* Idle stack created OFF ON ON */ -#define LED_INIRQ 4 /* In an interrupt N/C N/C GLOW */ -#define LED_SIGNAL 5 /* In a signal handler N/C GLOW N/C */ -#define LED_ASSERTION 6 /* An assertion failed GLOW N/C GLOW */ -#define LED_PANIC 7 /* The system has crashed Blink OFF N/C */ -#define LED_IDLE 8 /* MCU is is sleep mode ON OFF OFF */ - -/* Thus if the Green LED is statically on, NuttX has successfully booted and - * is, apparently, running normally. If the Red LED is flashing at - * approximately 2Hz, then a fatal error has been detected and the system - * has halted. - */ - -/* Alternate function pin selections ************************************************/ - -#define GPIO_USART1_RX GPIO_USART1_RX_3 /* PB7 */ -#define GPIO_USART1_TX GPIO_USART1_TX_3 /* PB6 */ - -#define GPIO_USART2_RX GPIO_USART2_RX_2 /* PD6 */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 /* PD4 */ -#define GPIO_USART2_CTS GPIO_USART2_CTS_NSS_2 /* PD3 */ - -#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ -#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ -#define GPIO_USART3_RTS GPIO_USART3_RTS_2 /* PD12 */ -#define GPIO_USART3_CTS GPIO_USART3_CTS_NSS_2 /* PD11 */ - -#define GPIO_UART4_RX GPIO_UART4_RX_5 /* PD0 */ -#define GPIO_UART4_TX GPIO_UART4_TX_5 /* PD1 */ - -#define GPIO_USART6_RX GPIO_USART6_RX_2 /* PG9 */ -#define GPIO_USART6_TX GPIO_USART6_TX_2 /* PG14 */ -#define GPIO_USART6_RTS GPIO_USART6_RTS_2 /* PG8 */ -#define GPIO_USART6_CTS GPIO_USART6_CTS_NSS_2 /* PG15 */ - -#define GPIO_UART7_RX GPIO_UART7_RX_4 /* PF6 */ -#define GPIO_UART7_TX GPIO_UART7_TX_3 /* PE8 */ - -#define GPIO_UART8_RX GPIO_UART8_RX_1 /* PE0 */ -#define GPIO_UART8_TX GPIO_UART8_TX_1 /* PE1 */ - -/* CAN - * - * CAN1 is routed to transceiver. - * CAN2 is routed to transceiver. - */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_5 /* PI9 */ -#define GPIO_CAN1_TX GPIO_CAN1_TX_4 /* PH13 */ -#define GPIO_CAN2_RX GPIO_CAN2_RX_1 /* PB12 */ -#define GPIO_CAN2_TX GPIO_CAN2_TX_1 /* PB13 */ - -/* SPI - * SPI1 sensors - * SPI2 is FRAM. - * SPI4 is BARO - * SPI6 Reserved - */ - -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_3 /* PD7 */ -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_3 /* PG11 */ - -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_3 /* PI2 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_4 /* PI3 */ -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_6 /* PI1 */ - -#define GPIO_SPI4_MISO GPIO_SPI4_MISO_1 /* PE13 */ -#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_2 /* PE6 */ -#define GPIO_SPI4_SCK GPIO_SPI4_SCK_2 /* PE2 */ - -#define GPIO_SPI5_MISO GPIO_SPI5_MISO_1 /* PF8 */ -#define GPIO_SPI5_MOSI GPIO_SPI5_MOSI_2 /* PF9 */ -#define GPIO_SPI5_SCK GPIO_SPI5_SCK_1 /* PF7 */ - -#define GPIO_SPI6_MISO GPIO_SPI6_MISO_1 /* PG12 */ -#define GPIO_SPI6_MOSI GPIO_SPI6_MOSI_3 /* PB5 */ -#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 - * - * The optional _GPIO configurations allow the I2C driver to manually - * reset the bus to clear stuck slaves. They match the pin configuration, - * but are normally-high GPIOs. - * - */ - -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 /* PB8 */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 /* PB9 */ - -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN8) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN9) - -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_2 /* PF1 */ -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_2 /* PF0 */ - -#define GPIO_I2C2_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTF | GPIO_PIN1) -#define GPIO_I2C2_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTF | GPIO_PIN0) - -#define GPIO_I2C3_SCL GPIO_I2C3_SCL_2 /* PH7 */ -#define GPIO_I2C3_SDA GPIO_I2C3_SDA_2 /* PH8 */ - -#define GPIO_I2C3_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTH | GPIO_PIN7) -#define GPIO_I2C3_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTH | GPIO_PIN8) - -#define GPIO_I2C4_SCL GPIO_I2C4_SCL_2 /* PF14 */ -#define GPIO_I2C4_SDA GPIO_I2C4_SDA_2 /* PF15 */ - -#define GPIO_I2C4_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTF | GPIO_PIN14) -#define GPIO_I2C4_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTF | GPIO_PIN15) - -/* SDMMC1 - * - * VDD 3.3 - * GND - * SDMMC1_CK PC12 - * SDMMC1_CMD PD2 - * SDMMC1_D0 PC8 - * SDMMC1_D1 PC9 - * SDMMC1_D2 PC10 - * SDMMC1_D3 PC11 - * GPIO_SDMMC1_NCD PG0 - */ - -/* USB - * - * OTG_FS_DM PA11 - * OTG_FS_DP PA12 - * VBUS PA9 - */ - - -/* Board provides GPIO or other Hardware for signaling to timing analyzer */ - -#if defined(CONFIG_BOARD_USE_PROBES) -# include "stm32_gpio.h" -# define PROBE_N(n) (1<<((n)-1)) -# define PROBE_1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN14) /* PE14 AUX1 */ -# define PROBE_2 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN10) /* PA10 AUX2 */ -# define PROBE_3 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN11) /* PE11 AUX3 */ -# define PROBE_4 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN9) /* PE9 AUX4 */ -# define PROBE_5 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN13) /* PD13 AUX5 */ -# define PROBE_6 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN14) /* PD14 FMU_CAP6 */ -# define PROBE_7 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN6) /* PH6 FMU_CAP5 */ -# define PROBE_8 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN9) /* PH9 FMU_CAP4 */ -# define PROBE_9 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN5) /* PA5 FMU_CAP3 */ -# define PROBE_10 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN3) /* PB3 FMU_CAP2 */ -# define PROBE_11 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN11) /* PB11 FMU_CAP1 */ - -# define PROBE_INIT(mask) \ - do { \ - if ((mask)& PROBE_N(1)) { stm32_configgpio(PROBE_1); } \ - if ((mask)& PROBE_N(2)) { stm32_configgpio(PROBE_2); } \ - if ((mask)& PROBE_N(3)) { stm32_configgpio(PROBE_3); } \ - if ((mask)& PROBE_N(4)) { stm32_configgpio(PROBE_4); } \ - if ((mask)& PROBE_N(5)) { stm32_configgpio(PROBE_5); } \ - if ((mask)& PROBE_N(6)) { stm32_configgpio(PROBE_6); } \ - if ((mask)& PROBE_N(7)) { stm32_configgpio(PROBE_7); } \ - if ((mask)& PROBE_N(8)) { stm32_configgpio(PROBE_8); } \ - if ((mask)& PROBE_N(9)) { stm32_configgpio(PROBE_9); } \ - if ((mask)& PROBE_N(10)) { stm32_configgpio(PROBE_10); } \ - if ((mask)& PROBE_N(11)) { stm32_configgpio(PROBE_11); } \ - } while(0) - -# define PROBE(n,s) do {stm32_gpiowrite(PROBE_##n,(s));}while(0) -# define PROBE_MARK(n) PROBE(n,false);PROBE(n,true) -#else -# define PROBE_INIT(mask) -# define PROBE(n,s) -# define PROBE_MARK(n) -#endif - -#endif /*__NUTTX_CONFIG_HOLYBRO_DURANDAL_V1_INCLUDE_BOARD_H */ diff --git a/boards/holybro/durandal-v1/nuttx-config/include/board_dma_map.h b/boards/holybro/durandal-v1/nuttx-config/include/board_dma_map.h deleted file mode 100644 index c93b7fe..0000000 --- a/boards/holybro/durandal-v1/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -// DMAMUX1 -#define DMAMAP_SPI1_RX DMAMAP_DMA12_SPI1RX_0 /* DMA1:37 */ -#define DMAMAP_SPI1_TX DMAMAP_DMA12_SPI1TX_0 /* DMA1:38 */ - -#define DMAMAP_UART8_RX DMAMAP_DMA12_UART8RX_0 /* DMA1:81 */ -#define DMAMAP_UART8_TX DMAMAP_DMA12_UART8TX_0 /* DMA1:82 */ - -// DMAMUX2 -#define DMAMAP_SPI6_RX DMAMAP_BDMA_SPI6_RX /* BDMA:11 */ -#define DMAMAP_SPI6_TX DMAMAP_BDMA_SPI6_TX /* BDMA:12 */ diff --git a/boards/holybro/durandal-v1/nuttx-config/nsh/defconfig b/boards/holybro/durandal-v1/nuttx-config/nsh/defconfig deleted file mode 100644 index 85363a6..0000000 --- a/boards/holybro/durandal-v1/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,265 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/holybro/durandal-v1/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743II=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=95150 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x004b -CONFIG_CDCACM_PRODUCTSTR="PX4 DurandalV1" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x3162 -CONFIG_CDCACM_VENDORSTR="Holybro" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_MEMFAULT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXPERIMENTAL=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=4 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_PROGMEM=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32H7_ADC1=y -CONFIG_STM32H7_ADC3=y -CONFIG_STM32H7_BBSRAM=y -CONFIG_STM32H7_BBSRAM_FILES=5 -CONFIG_STM32H7_BDMA=y -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_DMA2=y -CONFIG_STM32H7_DMACAPABLE=y -CONFIG_STM32H7_FLOWCONTROL_BROKEN=y -CONFIG_STM32H7_I2C1=y -CONFIG_STM32H7_I2C2=y -CONFIG_STM32H7_I2C3=y -CONFIG_STM32H7_I2C4=y -CONFIG_STM32H7_I2C_DYNTIMEO=y -CONFIG_STM32H7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_RTC=y -CONFIG_STM32H7_RTC_AUTO_LSECLOCK_START_DRV_CAPABILITY=y -CONFIG_STM32H7_RTC_MAGIC_REG=1 -CONFIG_STM32H7_SAVE_CRASHDUMP=y -CONFIG_STM32H7_SDMMC1=y -CONFIG_STM32H7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_SPI1=y -CONFIG_STM32H7_SPI1_DMA=y -CONFIG_STM32H7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32H7_SPI2=y -CONFIG_STM32H7_SPI4=y -CONFIG_STM32H7_SPI5=y -CONFIG_STM32H7_SPI6=y -CONFIG_STM32H7_SPI6_DMA=y -CONFIG_STM32H7_SPI6_DMA_BUFFER=1024 -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_TIM3=y -CONFIG_STM32H7_TIM4=y -CONFIG_STM32H7_UART4=y -CONFIG_STM32H7_UART7=y -CONFIG_STM32H7_UART8=y -CONFIG_STM32H7_USART1=y -CONFIG_STM32H7_USART2=y -CONFIG_STM32H7_USART3=y -CONFIG_STM32H7_USART6=y -CONFIG_STM32H7_USART_BREAKS=y -CONFIG_STM32H7_USART_INVERT=y -CONFIG_STM32H7_USART_SINGLEWIRE=y -CONFIG_STM32H7_USART_SWAP=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGTSTP=y -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_TXBUFSIZE=3000 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 -CONFIG_WATCHDOG=y diff --git a/boards/holybro/durandal-v1/nuttx-config/scripts/bootloader_script.ld b/boards/holybro/durandal-v1/nuttx-config/scripts/bootloader_script.ld deleted file mode 100644 index 511ef26..0000000 --- a/boards/holybro/durandal-v1/nuttx-config/scripts/bootloader_script.ld +++ /dev/null @@ -1,213 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016, 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The Durandal-v1 uses an STM32H743II has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * The Durandal has a Swtich on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the swiutch is - * drepresed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743ZI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - itcm (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - flash (rx) : ORIGIN = 0x08000000, LENGTH = 2048K - dtcm1 (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - dtcm2 (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - sram (rwx) : ORIGIN = 0x24000000, LENGTH = 512K - sram1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K - sram2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K - sram3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K - sram4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K - bbram (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/holybro/durandal-v1/nuttx-config/scripts/script.ld b/boards/holybro/durandal-v1/nuttx-config/scripts/script.ld deleted file mode 100644 index da121fd..0000000 --- a/boards/holybro/durandal-v1/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,228 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016, 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The Durandal-v1 uses an STM32H743II has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * The Durandal has a Swtich on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the swiutch is - * drepresed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743ZI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - FLASH (rx) : ORIGIN = 0x08020000, LENGTH = 1920K - - DTCM1_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - DTCM2_RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */ - SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */ - SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */ - BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH - - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - - /* Pad out last section as the STM32H7 Flash write size is 256 bits. 32 bytes */ - . = ALIGN(16); - FILL(0xffff) - . += 16; - } > AXI_SRAM AT > FLASH = 0xffff - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > AXI_SRAM - - /* Emit the the D3 power domain section for locating BDMA data */ - - .sram4_reserve (NOLOAD) : - { - *(.sram4) - . = ALIGN(4); - _sram4_heap_start = ABSOLUTE(.); - } > SRAM4 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/holybro/durandal-v1/src/CMakeLists.txt b/boards/holybro/durandal-v1/src/CMakeLists.txt deleted file mode 100644 index c1386c4..0000000 --- a/boards/holybro/durandal-v1/src/CMakeLists.txt +++ /dev/null @@ -1,70 +0,0 @@ -############################################################################ -# -# Copyright (c) 2016 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. -# -############################################################################ -if("${PX4_BOARD_LABEL}" STREQUAL "bootloader") - add_library(drivers_board - bootloader_main.c - usb.c - ) - target_link_libraries(drivers_board - PRIVATE - nuttx_arch # sdio - nuttx_drivers # sdio - bootloader - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/bootloader/common) - -else() - add_library(drivers_board - can.c - i2c.cpp - init.c - led.c - manifest.c - sdio.c - spi.cpp - timer_config.cpp - usb.c - ) - add_dependencies(drivers_board arch_board_hw_info) - - target_link_libraries(drivers_board - PRIVATE - arch_io_pins - arch_spi - arch_board_hw_info - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer - ) -endif() diff --git a/boards/holybro/durandal-v1/src/board_config.h b/boards/holybro/durandal-v1/src/board_config.h deleted file mode 100644 index 4f6369b..0000000 --- a/boards/holybro/durandal-v1/src/board_config.h +++ /dev/null @@ -1,370 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * holybro durandal-v1 internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ - -/* PX4IO connection configuration */ - -#define BOARD_USES_PX4IO_VERSION 2 -#define PX4IO_SERIAL_DEVICE "/dev/ttyS6" -#define PX4IO_SERIAL_TX_GPIO GPIO_UART8_TX -#define PX4IO_SERIAL_RX_GPIO GPIO_UART8_RX -#define PX4IO_SERIAL_BASE STM32_UART8_BASE -#define PX4IO_SERIAL_VECTOR STM32_IRQ_UART8 -#define PX4IO_SERIAL_TX_DMAMAP DMAMAP_UART8_TX -#define PX4IO_SERIAL_RX_DMAMAP DMAMAP_UART8_RX -#define PX4IO_SERIAL_RCC_REG STM32_RCC_APB1LENR -#define PX4IO_SERIAL_RCC_EN RCC_APB1LENR_UART8EN -#define PX4IO_SERIAL_CLOCK STM32_PCLK1_FREQUENCY -#define PX4IO_SERIAL_BITRATE 1500000 /* 1.5Mbps -> max rate for IO */ - -/* Configuration ************************************************************************************/ - -# define BOARD_HAS_LTC44XX_VALIDS 2 // No LTC or N Bricks -# define BOARD_HAS_USB_VALID 1 // LTC Has No USB valid -# define BOARD_HAS_NBAT_V 2 // Only one Vbat to ADC -# define BOARD_HAS_NBAT_I 2 // No Ibat ADC - -/* Holybro Durandal V1 GPIOs ************************************************************************/ - -/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */ - -#define GPIO_nLED_RED /* PB1 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN1) -#define GPIO_nLED_GREEN /* PC6 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN6) -#define GPIO_nLED_BLUE /* PC7 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN7) - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_OVERLOAD_LED LED_RED -#define BOARD_ARMED_STATE_LED LED_BLUE - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that - * can be used by the Px4 Firmware in the adc driver - */ - -/* ADC defines to be used in sensors.cpp to read from a particular channel */ - -#define ADC1_CH(n) (n) - -/* Define GPIO pins used as ADC N.B. Channel numbers must match below */ - -#define PX4_ADC_GPIO \ - /* PA0 */ GPIO_ADC1_INP16, \ - /* PA1 */ GPIO_ADC1_INP17, \ - /* PA2 */ GPIO_ADC12_INP14, \ - /* PA3 */ GPIO_ADC12_INP15, \ - /* PA4 */ GPIO_ADC12_INP18, \ - /* PB0 */ GPIO_ADC12_INP9, \ - /* PC0 */ GPIO_ADC123_INP10, \ - /* PC1 */ GPIO_ADC123_INP11, \ - /* PC2 */ GPIO_ADC123_INP12, \ - /* PC3 */ GPIO_ADC12_INP13, \ - /* PC4 */ GPIO_ADC12_INP4 - -/* Define Channel numbers must match above GPIO pin IN(n)*/ - -#define ADC_BATTERY1_VOLTAGE_CHANNEL /* PA0 */ ADC1_CH(16) -#define ADC_BATTERY1_CURRENT_CHANNEL /* PA1 */ ADC1_CH(17) -#define ADC_BATTERY2_VOLTAGE_CHANNEL /* PA2 */ ADC1_CH(14) -#define ADC_BATTERY2_CURRENT_CHANNEL /* PA3 */ ADC1_CH(15) -#define ADC1_6V6_IN_CHANNEL /* PA4 */ ADC1_CH(18) -#define ADC_RSSI_IN_CHANNEL /* PB0 */ ADC1_CH(9) -#define ADC_SCALED_V5_CHANNEL /* PC0 */ ADC1_CH(10) -#define ADC_SCALED_VDD_3V3_SENSORS_CHANNEL /* PC1 */ ADC1_CH(11) -#define ADC_HW_VER_SENSE_CHANNEL /* PC2 */ ADC1_CH(12) -#define ADC_HW_REV_SENSE_CHANNEL /* PC3 */ ADC1_CH(13) -#define ADC1_3V3_IN_CHANNEL /* PC4 */ ADC1_CH(4) - -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY1_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY1_CURRENT_CHANNEL) | \ - (1 << ADC_BATTERY2_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY2_CURRENT_CHANNEL) | \ - (1 << ADC1_6V6_IN_CHANNEL) | \ - (1 << ADC_RSSI_IN_CHANNEL) | \ - (1 << ADC_SCALED_V5_CHANNEL) | \ - (1 << ADC_SCALED_VDD_3V3_SENSORS_CHANNEL) | \ - (1 << ADC_HW_VER_SENSE_CHANNEL) | \ - (1 << ADC_HW_REV_SENSE_CHANNEL) | \ - (1 << ADC1_3V3_IN_CHANNEL)) - -/* HW has to large of R termination on ADC todo:change when HW value is chosen */ - -#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f) - -/* HW Version and Revision drive signals Default to 1 to detect */ - -#define BOARD_HAS_HW_VERSIONING - -#define GPIO_HW_REV_DRIVE /* PH14 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTH|GPIO_PIN14) -#define GPIO_HW_REV_SENSE /* PC3 */ GPIO_ADC12_INP13 -#define GPIO_HW_VER_DRIVE /* PG0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN0) -#define GPIO_HW_VER_SENSE /* PC2 */ GPIO_ADC123_INP12 -#define HW_INFO_INIT_PREFIX "VD" - -#define BOARD_NUM_SPI_CFG_HW_VERSIONS 2 - -#define VD00 HW_VER_REV(0x0,0x0) // Durandal, Ver 0 Rev 0 -#define VD01 HW_VER_REV(0x0,0x1) // Durandal, Ver 0 Rev 1 - -/* CAN Silence - * - * Silent mode control \ ESC Mux select - */ - -#define GPIO_CAN1_SILENT_S0 /* PH2 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN2) -#define GPIO_CAN2_SILENT_S1 /* PH3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN3) - -/* HEATER - * PWM in future - */ -#define GPIO_HEATER_OUTPUT /* PA7 T14CH1 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN7) -#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true)) - -/* PWM - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 10 - -#define BOARD_NUM_IO_TIMERS 4 - - -/* Power supply control and monitoring GPIOs */ - -#define GPIO_nPOWER_IN_A /* PG1 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN1) -#define GPIO_nPOWER_IN_B /* PG2 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN2) -#define GPIO_nPOWER_IN_C /* PG3 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN3) - -#define GPIO_nVDD_BRICK1_VALID GPIO_nPOWER_IN_A /* Brick 1 Is Chosen */ -#define GPIO_nVDD_BRICK2_VALID GPIO_nPOWER_IN_B /* Brick 2 Is Chosen */ -#define BOARD_NUMBER_BRICKS 2 -#define GPIO_nVDD_USB_VALID GPIO_nPOWER_IN_C /* USB Is Chosen */ - -#define GPIO_nVDD_5V_PERIPH_EN /* PG4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN4) -#define GPIO_nVDD_5V_PERIPH_OC /* PE15 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTE|GPIO_PIN15) -#define GPIO_nVDD_5V_HIPOWER_EN /* PF12 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTF|GPIO_PIN12) -#define GPIO_nVDD_5V_HIPOWER_OC /* PG13 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTF|GPIO_PIN13) -#define GPIO_VDD_3V3_SPEKTRUM_POWER_EN /* PE4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN4) -#define GPIO_VDD_3V3_SD_CARD_EN /* PG7 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN7) - - -/* Define True logic Power Control in arch agnostic form */ - -#define VDD_5V_PERIPH_EN(on_true) px4_arch_gpiowrite(GPIO_nVDD_5V_PERIPH_EN, !(on_true)) -#define VDD_5V_HIPOWER_EN(on_true) px4_arch_gpiowrite(GPIO_nVDD_5V_HIPOWER_EN, !(on_true)) -#define VDD_3V3_SPEKTRUM_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SPEKTRUM_POWER_EN, (on_true)) -#define READ_VDD_3V3_SPEKTRUM_POWER_EN() px4_arch_gpioread(GPIO_VDD_3V3_SPEKTRUM_POWER_EN) -#define VDD_3V3_SD_CARD_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SD_CARD_EN, (on_true)) - -/* Tone alarm output */ - -#define TONE_ALARM_TIMER 15 /* timer 15 */ -#define TONE_ALARM_CHANNEL 1 /* PE5 TIM15_CH1 */ - -#define GPIO_BUZZER_1 /* PE5 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN5) - -#define GPIO_TONE_ALARM_IDLE GPIO_BUZZER_1 -#define GPIO_TONE_ALARM GPIO_TIM15_CH1OUT_2 - -/* USB OTG FS - * - * PA9 OTG_FS_VBUS VBUS sensing - */ -#define GPIO_OTGFS_VBUS /* PA9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 8 /* use timer8 for the HRT */ -#define HRT_TIMER_CHANNEL 3 /* use capture/compare channel 3 */ - -/* RC Serial port */ - -/* PWM input driver. Use FMU AUX5 pins attached to timer4 channel 2 */ - -#define PWMIN_TIMER 4 -#define PWMIN_TIMER_CHANNEL /* T4C2 */ 2 -#define GPIO_PWM_IN /* PD13 */ GPIO_TIM4_CH2IN - -/* RSSI_IN is grounded via a 10K */ - -#define GPIO_RSSI_IN /* PB0 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTB|GPIO_PIN0) - -/* Safety Switch is only on PX4IO */ - -#define GPIO_nSAFETY_SWITCH_LED_OUT /* PE12 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTE|GPIO_PIN12) -#define GPIO_SAFETY_SWITCH_IN /* PE10 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTE|GPIO_PIN10) - -/* Power switch controls ******************************************************/ - -#define SPEKTRUM_POWER(_on_true) VDD_3V3_SPEKTRUM_POWER_EN(_on_true) - -#define SDIO_SLOTNO 0 /* Only one slot */ -#define SDIO_MINOR 0 - -/* SD card bringup does not work if performed on the IDLE thread because it - * will cause waiting. Use either: - * - * CONFIG_BOARDCTL=y, OR - * CONFIG_BOARD_INITIALIZE=y && CONFIG_BOARD_INITTHREAD=y - */ - -#if defined(CONFIG_BOARD_INITIALIZE) && !defined(CONFIG_BOARDCTL) && \ - !defined(CONFIG_BOARD_INITTHREAD) -# warning SDIO initialization cannot be perfomed on the IDLE thread -#endif - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID)) - -/* Board never powers off the Servo rail */ - -#define BOARD_ADC_SERVO_VALID (1) - -#define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -#define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID)) - -#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_nVDD_5V_PERIPH_OC)) -#define BOARD_ADC_HIPOWER_5V_OC (!px4_arch_gpioread(GPIO_nVDD_5V_HIPOWER_OC)) - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ - -#define BOARD_HAS_ON_RESET 1 -#define SDMMC_PIN_OFF(def) (((def) & (GPIO_PORT_MASK | GPIO_PIN_MASK)) | (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_2MHz)) - -#define PX4_GPIO_INIT_LIST { \ - PX4_ADC_GPIO, \ - GPIO_HW_REV_DRIVE, \ - GPIO_HW_VER_DRIVE, \ - GPIO_CAN1_TX, \ - GPIO_CAN1_RX, \ - GPIO_CAN2_TX, \ - GPIO_CAN2_RX, \ - GPIO_CAN1_SILENT_S0, \ - GPIO_CAN2_SILENT_S1, \ - GPIO_HEATER_OUTPUT, \ - GPIO_nPOWER_IN_A, \ - GPIO_nPOWER_IN_B, \ - GPIO_nPOWER_IN_C, \ - GPIO_nVDD_5V_PERIPH_EN, \ - GPIO_nVDD_5V_PERIPH_OC, \ - GPIO_nVDD_5V_HIPOWER_EN, \ - GPIO_nVDD_5V_HIPOWER_OC, \ - GPIO_VDD_3V3_SPEKTRUM_POWER_EN, \ - SDMMC_PIN_OFF(GPIO_SDMMC1_D0), \ - SDMMC_PIN_OFF(GPIO_SDMMC1_D1), \ - SDMMC_PIN_OFF(GPIO_SDMMC1_D2), \ - SDMMC_PIN_OFF(GPIO_SDMMC1_D3), \ - SDMMC_PIN_OFF(GPIO_SDMMC1_CMD), \ - GPIO_VDD_3V3_SD_CARD_EN, \ - GPIO_TONE_ALARM_IDLE, \ - GPIO_RSSI_IN, \ - GPIO_nSAFETY_SWITCH_LED_OUT, \ - GPIO_SAFETY_SWITCH_IN, \ - } - -#define BOARD_ENABLE_CONSOLE_BUFFER - -__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 Holybro Durandal V1 - * board. - * - ****************************************************************************************************/ - -extern void stm32_spiinitialize(void); - -extern void stm32_usbinitialize(void); - -extern void board_peripheral_reset(int ms); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/holybro/durandal-v1/src/bootloader_main.c b/boards/holybro/durandal-v1/src/bootloader_main.c deleted file mode 100644 index cec6abd..0000000 --- a/boards/holybro/durandal-v1/src/bootloader_main.c +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019-2021 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. - * - ****************************************************************************/ - -/** - * @file bootloader_main.c - * - * FMU-specific early startup code for bootloader -*/ - -#include "board_config.h" -#include "bl.h" - -#include -#include -#include -#include -#include -#include "arm_internal.h" -#include - -extern int sercon_main(int c, char **argv); - -__EXPORT void board_on_reset(int status) {} - -__EXPORT void stm32_boardinitialize(void) -{ - /* configure USB interfaces */ - stm32_usbinitialize(); -} - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - return 0; -} - -void board_late_initialize(void) -{ - sercon_main(0, NULL); -} - -extern void sys_tick_handler(void); -void board_timerhook(void) -{ - sys_tick_handler(); -} diff --git a/boards/holybro/durandal-v1/src/can.c b/boards/holybro/durandal-v1/src/can.c deleted file mode 100644 index c71b2e8..0000000 --- a/boards/holybro/durandal-v1/src/can.c +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file px4fmu_can.c - * - * Board-specific CAN functions. - */ - -#ifdef CONFIG_CAN - -#include -#include - -#include -#include - -#include "chip.h" -#include "arm_internal.h" - -#include "chip.h" -#include "stm32_can.h" -#include "board_config.h" - -#ifdef CONFIG_CAN - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) -# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." -# undef CONFIG_STM32_CAN2 -#endif - -#ifdef CONFIG_STM32_CAN1 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); - -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} - -#endif - -#endif /* CONFIG_CAN */ diff --git a/boards/holybro/durandal-v1/src/hw_config.h b/boards/holybro/durandal-v1/src/hw_config.h deleted file mode 100644 index ae706c6..0000000 --- a/boards/holybro/durandal-v1/src/hw_config.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * hw_config.h - * - * Created on: May 17, 2015 - * Author: david_s5 - */ - -#ifndef HW_CONFIG_H_ -#define HW_CONFIG_H_ - -/**************************************************************************** - * 10-8--2016: - * To simplify the ripple effect on the tools, we will be using - * /dev/serial/by-id/PX4 to locate PX4 devices. Therefore - * moving forward all Bootloaders must contain the prefix "PX4 BL " - * in the USBDEVICESTRING - * This Change will be made in an upcoming BL release - ****************************************************************************/ -/* - * Define usage to configure a bootloader - * - * - * Constant example Usage - * APP_LOAD_ADDRESS 0x08004000 - The address in Linker Script, where the app fw is org-ed - * BOOTLOADER_DELAY 5000 - Ms to wait while under USB pwr or bootloader request - * BOARD_FMUV2 - * INTERFACE_USB 1 - (Optional) Scan and use the USB interface for bootloading - * INTERFACE_USART 1 - (Optional) Scan and use the Serial interface for bootloading - * USBDEVICESTRING "PX4 BL FMU v2.x" - USB id string - * USBPRODUCTID 0x0011 - PID Should match defconfig - * BOOT_DELAY_ADDRESS 0x000001a0 - (Optional) From the linker script from Linker Script to get a custom - * delay provided by an APP FW - * BOARD_TYPE 9 - Must match .prototype boad_id - * _FLASH_KBYTES (*(uint16_t *)0x1fff7a22) - Run time flash size detection - * BOARD_FLASH_SECTORS ((_FLASH_KBYTES == 0x400) ? 11 : 23) - Run time determine the physical last sector - * BOARD_FLASH_SECTORS 11 - Hard coded zero based last sector - * BOARD_FLASH_SIZE (_FLASH_KBYTES*1024)- Total Flash size of device, determined at run time. - * (1024 * 1024) - Hard coded Total Flash of device - The bootloader and app reserved will be deducted - * programmatically - * - * BOARD_FIRST_FLASH_SECTOR_TO_ERASE 2 - Optional sectors index in the flash_sectors table (F4 only), to begin erasing. - * This is to allow sectors to be reserved for app fw usage. That will NOT be erased - * during a FW upgrade. - * The default is 0, and selects the first sector to be erased, as the 0th entry in the - * flash_sectors table. Which is the second physical sector of FLASH in the device. - * The first physical sector of FLASH is used by the bootloader, and is not defined - * in the table. - * - * APP_RESERVATION_SIZE (BOARD_FIRST_FLASH_SECTOR_TO_ERASE * 16 * 1024) - Number of bytes reserved by the APP FW. This number plus - * BOOTLOADER_RESERVATION_SIZE will be deducted from - * BOARD_FLASH_SIZE to determine the size of the App FW - * and hence the address space of FLASH to erase and program. - * USBMFGSTRING "PX4 AP" - Optional USB MFG string (default is '3D Robotics' if not defined.) - * SERIAL_BREAK_DETECT_DISABLED - Optional prevent break selection on Serial port from entering or staying in BL - * - * * Other defines are somewhat self explanatory. - */ - -/* Boot device selection list*/ -#define USB0_DEV 0x01 -#define SERIAL0_DEV 0x02 -#define SERIAL1_DEV 0x04 - -#define APP_LOAD_ADDRESS 0x08020000 -#define BOOTLOADER_DELAY 5000 -#define INTERFACE_USB 1 -#define INTERFACE_USB_CONFIG "/dev/ttyACM0" -#define BOARD_VBUS MK_GPIO_INPUT(GPIO_OTGFS_VBUS) - -//#define USE_VBUS_PULL_DOWN -#define INTERFACE_USART 1 -#define INTERFACE_USART_CONFIG "/dev/ttyS0,115200" -#define BOOT_DELAY_ADDRESS 0x000001a0 -#define BOARD_TYPE 139 -#define _FLASH_KBYTES (*(uint32_t *)0x1FF1E880) -#define BOARD_FLASH_SECTORS (15) -#define BOARD_FLASH_SIZE (_FLASH_KBYTES * 1024) - -#define OSC_FREQ 16 - -#define BOARD_PIN_LED_ACTIVITY GPIO_nLED_BLUE // BLUE -#define BOARD_PIN_LED_BOOTLOADER GPIO_nLED_GREEN // GREEN -#define BOARD_LED_ON 0 -#define BOARD_LED_OFF 1 - -#define SERIAL_BREAK_DETECT_DISABLED 1 - -/* - * Uncommenting this allows to force the bootloader through - * a PWM output pin. As this can accidentally initialize - * an ESC prematurely, it is not recommended. This feature - * has not been used and hence defaults now to off. - * - * # define BOARD_FORCE_BL_PIN_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN14) - * # define BOARD_FORCE_BL_PIN_IN (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN11) - * - * # define BOARD_POWER_PIN_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN4) - * # define BOARD_POWER_ON 1 - * # define BOARD_POWER_OFF 0 - * # undef BOARD_POWER_PIN_RELEASE // Leave pin enabling Power - un comment to release (disable power) - * -*/ - -#if !defined(ARCH_SN_MAX_LENGTH) -# define ARCH_SN_MAX_LENGTH 12 -#endif - -#if !defined(APP_RESERVATION_SIZE) -# define APP_RESERVATION_SIZE 0 -#endif - -#if !defined(BOARD_FIRST_FLASH_SECTOR_TO_ERASE) -# define BOARD_FIRST_FLASH_SECTOR_TO_ERASE 1 -#endif - -#if !defined(USB_DATA_ALIGN) -# define USB_DATA_ALIGN -#endif - -#ifndef BOOT_DEVICES_SELECTION -# define BOOT_DEVICES_SELECTION USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif - -#ifndef BOOT_DEVICES_FILTER_ONUSB -# define BOOT_DEVICES_FILTER_ONUSB USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif - -#endif /* HW_CONFIG_H_ */ diff --git a/boards/holybro/durandal-v1/src/i2c.cpp b/boards/holybro/durandal-v1/src/i2c.cpp deleted file mode 100644 index 124fc23..0000000 --- a/boards/holybro/durandal-v1/src/i2c.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), - initI2CBusExternal(2), - initI2CBusInternal(3), - initI2CBusExternal(4), -}; diff --git a/boards/holybro/durandal-v1/src/init.c b/boards/holybro/durandal-v1/src/init.c deleted file mode 100644 index f8dc55d..0000000 --- a/boards/holybro/durandal-v1/src/init.c +++ /dev/null @@ -1,278 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-2019, 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * PX4FMU-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include "board_config.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* Configuration ************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - /* set the peripheral rails off */ - - VDD_5V_PERIPH_EN(false); - board_control_spi_sensors_power(false, 0xffff); - - bool last = READ_VDD_3V3_SPEKTRUM_POWER_EN(); - /* Keep Spektum on to discharge rail*/ - VDD_3V3_SPEKTRUM_POWER_EN(false); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ - VDD_3V3_SPEKTRUM_POWER_EN(last); - board_control_spi_sensors_power(true, 0xffff); - VDD_5V_PERIPH_EN(true); - -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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 - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Power on Interfaces */ - VDD_5V_PERIPH_EN(true); - VDD_5V_HIPOWER_EN(true); - board_control_spi_sensors_power(true, 0xffff); - VDD_3V3_SPEKTRUM_POWER_EN(true); - - /* Need hrt running before using the ADC */ - - px4_platform_init(); - - // Use the default HW_VER_REV(0x0,0x0) for Ramtron - - stm32_spiinitialize(); - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - if (OK == board_determine_hw_info()) { - syslog(LOG_INFO, "[boot] Rev 0x%1x : Ver 0x%1x %s\n", board_get_hw_revision(), board_get_hw_version(), - board_get_hw_type_name()); - - } else { - syslog(LOG_ERR, "[boot] Failed to read HW revision and version\n"); - } - - /* Configure the actual SPI interfaces (after we determined the HW version) */ - - stm32_spiinitialize(); - - /* configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_on(LED_GREEN); // Indicate Power. - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - - // Ensure Power is off for > 10 mS - usleep(15 * 1000); - VDD_3V3_SD_CARD_EN(true); - usleep(500 * 1000); - -#ifdef CONFIG_MMCSD - int ret = stm32_sdio_initialize(); - - if (ret != OK) { - led_on(LED_RED); - } - -#endif /* CONFIG_MMCSD */ - - return OK; -} diff --git a/boards/holybro/durandal-v1/src/led.c b/boards/holybro/durandal-v1/src/led.c deleted file mode 100644 index bff4b09..0000000 --- a/boards/holybro/durandal-v1/src/led.c +++ /dev/null @@ -1,235 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013 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. - * - ****************************************************************************/ - -/** - * @file px4fmu2_led.c - * - * PX4FMU LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -#ifdef CONFIG_ARCH_LEDS -static bool nuttx_owns_leds = true; -// B R S G -// 0 1 2 3 -static const uint8_t xlatpx4[] = {1, 2, 4, 0}; -# define xlat(p) xlatpx4[(p)] -static uint32_t g_ledmap[] = { - GPIO_nLED_GREEN, // Indexed by BOARD_LED_GREEN - GPIO_nLED_BLUE, // Indexed by BOARD_LED_BLUE - GPIO_nLED_RED, // Indexed by BOARD_LED_RED - GPIO_nSAFETY_SWITCH_LED_OUT, // Indexed by LED_SAFETY by xlatpx4 -}; - -#else - -# define xlat(p) (p) -static uint32_t g_ledmap[] = { - GPIO_nLED_BLUE, // Indexed by LED_BLUE - GPIO_nLED_RED, // Indexed by LED_RED, LED_AMBER - 0, // Indexed by LED_SAFETY (defaulted to an input) - GPIO_nLED_GREEN, // Indexed by LED_GREEN -}; - -#endif - -__EXPORT void led_init(void) -{ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - if (g_ledmap[l] != 0) { - stm32_configgpio(g_ledmap[l]); - } - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - - if (g_ledmap[led] != 0) { - stm32_gpiowrite(g_ledmap[led], !state); - } -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - if (g_ledmap[led] != 0) { - return !stm32_gpioread(g_ledmap[led]); - } - - return false; -} - -__EXPORT void led_on(int led) -{ - phy_set_led(xlat(led), true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(xlat(led), false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(xlat(led), !phy_get_led(xlat(led))); -} - -#ifdef CONFIG_ARCH_LEDS -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_autoled_initialize - ****************************************************************************/ - -void board_autoled_initialize(void) -{ - led_init(); -} - -/**************************************************************************** - * Name: board_autoled_on - ****************************************************************************/ - -void board_autoled_on(int led) -{ - if (!nuttx_owns_leds) { - return; - } - - switch (led) { - default: - break; - - case LED_HEAPALLOCATE: - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_IRQSENABLED: - phy_set_led(BOARD_LED_BLUE, false); - phy_set_led(BOARD_LED_GREEN, true); - break; - - case LED_STACKCREATED: - phy_set_led(BOARD_LED_GREEN, true); - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_INIRQ: - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_SIGNAL: - phy_set_led(BOARD_LED_GREEN, true); - break; - - case LED_ASSERTION: - phy_set_led(BOARD_LED_RED, true); - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_PANIC: - phy_set_led(BOARD_LED_RED, true); - break; - - case LED_IDLE : /* IDLE */ - phy_set_led(BOARD_LED_RED, true); - break; - } -} - -/**************************************************************************** - * Name: board_autoled_off - ****************************************************************************/ - -void board_autoled_off(int led) -{ - if (!nuttx_owns_leds) { - return; - } - - switch (led) { - default: - break; - - case LED_SIGNAL: - phy_set_led(BOARD_LED_GREEN, false); - break; - - case LED_INIRQ: - phy_set_led(BOARD_LED_BLUE, false); - break; - - case LED_ASSERTION: - phy_set_led(BOARD_LED_RED, false); - phy_set_led(BOARD_LED_BLUE, false); - break; - - case LED_PANIC: - phy_set_led(BOARD_LED_RED, false); - break; - - case LED_IDLE : /* IDLE */ - phy_set_led(BOARD_LED_RED, false); - break; - } -} - -#endif /* CONFIG_ARCH_LEDS */ diff --git a/boards/holybro/durandal-v1/src/manifest.c b/boards/holybro/durandal-v1/src/manifest.c deleted file mode 100644 index c41ef38..0000000 --- a/boards/holybro/durandal-v1/src/manifest.c +++ /dev/null @@ -1,133 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2018-2021 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. - * - ****************************************************************************/ - -/** - * @file manifest.c - * - * This module supplies the interface to the manifest of hardware that is - * optional and dependent on the HW REV and HW VER IDs - * - * The manifest allows the system to know whether a hardware option - * say for example the PX4IO is an no-pop option vs it is broken. - * - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include - -#include "systemlib/px4_macros.h" - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -typedef struct { - uint32_t hw_ver_rev; /* the version and revision */ - const px4_hw_mft_item_t *mft; /* The first entry */ - uint32_t entries; /* the lenght of the list */ -} px4_hw_mft_list_entry_t; - -typedef px4_hw_mft_list_entry_t *px4_hw_mft_list_entry; -#define px4_hw_mft_list_uninitialized (px4_hw_mft_list_entry) -1 - -static const px4_hw_mft_item_t device_unsupported = {0, 0, 0}; - -// List of components on a specific board configuration -// The index of those components is given by the enum (px4_hw_mft_item_id_t) -// declared in board_common.h -static const px4_hw_mft_item_t hw_mft_list_durandal[] = { - { - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, -}; - -static px4_hw_mft_list_entry_t mft_lists[] = { -// ver_rev - {VD00, hw_mft_list_durandal, arraySize(hw_mft_list_durandal)}, - {VD01, hw_mft_list_durandal, arraySize(hw_mft_list_durandal)}, -}; - -/************************************************************************************ - * Name: board_query_manifest - * - * Description: - * Optional returns manifest item. - * - * Input Parameters: - * manifest_id - the ID for the manifest item to retrieve - * - * Returned Value: - * 0 - item is not in manifest => assume legacy operations - * pointer to a manifest item - * - ************************************************************************************/ - -__EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) -{ - static px4_hw_mft_list_entry boards_manifest = px4_hw_mft_list_uninitialized; - - if (boards_manifest == px4_hw_mft_list_uninitialized) { - uint32_t ver_rev = board_get_hw_version() << 16; - ver_rev |= board_get_hw_revision(); - - for (unsigned i = 0; i < arraySize(mft_lists); i++) { - if (mft_lists[i].hw_ver_rev == ver_rev) { - boards_manifest = &mft_lists[i]; - break; - } - } - - if (boards_manifest == px4_hw_mft_list_uninitialized) { - syslog(LOG_ERR, "[boot] Board %08" PRIx32 " is not supported!\n", ver_rev); - } - } - - px4_hw_mft_item rv = &device_unsupported; - - if (boards_manifest != px4_hw_mft_list_uninitialized && - id < boards_manifest->entries) { - rv = &boards_manifest->mft[id]; - } - - return rv; -} diff --git a/boards/holybro/durandal-v1/src/sdio.c b/boards/holybro/durandal-v1/src/sdio.c deleted file mode 100644 index 869d757..0000000 --- a/boards/holybro/durandal-v1/src/sdio.c +++ /dev/null @@ -1,177 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include "chip.h" -#include "board_config.h" -#include "stm32_gpio.h" -#include "stm32_sdmmc.h" - -#ifdef CONFIG_MMCSD - - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Card detections requires card support and a card detection GPIO */ - -#define HAVE_NCD 1 -#if !defined(GPIO_SDMMC1_NCD) -# undef HAVE_NCD -#endif - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -static FAR struct sdio_dev_s *sdio_dev; -#ifdef HAVE_NCD -static bool g_sd_inserted = 0xff; /* Impossible value */ -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_ncd_interrupt - * - * Description: - * Card detect interrupt handler. - * - ****************************************************************************/ - -#ifdef HAVE_NCD -static int stm32_ncd_interrupt(int irq, FAR void *context) -{ - bool present; - - present = !stm32_gpioread(GPIO_SDMMC1_NCD); - - if (sdio_dev && present != g_sd_inserted) { - sdio_mediachange(sdio_dev, present); - g_sd_inserted = present; - } - - return OK; -} -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_sdio_initialize - * - * Description: - * Initialize SDIO-based MMC/SD card support - * - ****************************************************************************/ - -int stm32_sdio_initialize(void) -{ - int ret; - -#ifdef HAVE_NCD - /* Card detect */ - - bool cd_status; - - /* Configure the card detect GPIO */ - - stm32_configgpio(GPIO_SDMMC1_NCD); - - /* Register an interrupt handler for the card detect pin */ - - stm32_gpiosetevent(GPIO_SDMMC1_NCD, true, true, true, stm32_ncd_interrupt); -#endif - - /* Mount the SDIO-based MMC/SD block driver */ - /* First, get an instance of the SDIO interface */ - - finfo("Initializing SDIO slot %d\n", SDIO_SLOTNO); - - sdio_dev = sdio_initialize(SDIO_SLOTNO); - - if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", SDIO_SLOTNO); - return -ENODEV; - } - - /* Now bind the SDIO interface to the MMC/SD driver */ - - finfo("Bind SDIO to the MMC/SD driver, minor=%d\n", SDIO_MINOR); - - ret = mmcsd_slotinitialize(SDIO_MINOR, sdio_dev); - - if (ret != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); - return ret; - } - - finfo("Successfully bound SDIO to the MMC/SD driver\n"); - -#ifdef HAVE_NCD - /* Use SD card detect pin to check if a card is g_sd_inserted */ - - cd_status = !stm32_gpioread(GPIO_SDMMC1_NCD); - finfo("Card detect : %d\n", cd_status); - - sdio_mediachange(sdio_dev, cd_status); -#else - /* Assume that the SD card is inserted. What choice do we have? */ - - sdio_mediachange(sdio_dev, true); -#endif - - return OK; -} - -#endif /* CONFIG_MMCSD */ diff --git a/boards/holybro/durandal-v1/src/spi.cpp b/boards/holybro/durandal-v1/src/spi.cpp deleted file mode 100644 index 6a2662e..0000000 --- a/boards/holybro/durandal-v1/src/spi.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020-2021 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 -#include -#include - -constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSIONS] = { - initSPIHWVersion(HW_VER_REV(0, 0), { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20689, SPI::CS{GPIO::PortF, GPIO::Pin2}, SPI::DRDY{GPIO::PortB, GPIO::Pin4}), - initSPIDevice(DRV_GYR_DEVTYPE_BMI088, SPI::CS{GPIO::PortF, GPIO::Pin4}, SPI::DRDY{GPIO::PortB, GPIO::Pin14}), - initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::PortG, GPIO::Pin10}, SPI::DRDY{GPIO::PortB, GPIO::Pin15}), - initSPIDevice(DRV_DEVTYPE_UNUSED, SPI::CS{GPIO::PortH, GPIO::Pin5}), - }, {GPIO::PortE, GPIO::Pin3}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortF, GPIO::Pin5}) - }), - initSPIBus(SPI::Bus::SPI4, { - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortF, GPIO::Pin10}), - }), - initSPIBusExternal(SPI::Bus::SPI5, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin4}), - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}), - }), - initSPIBusExternal(SPI::Bus::SPI6, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin6}), - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin7}), - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin8}) - }), - }), - initSPIHWVersion(HW_VER_REV(0, 1), { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20689, SPI::CS{GPIO::PortF, GPIO::Pin2}, SPI::DRDY{GPIO::PortB, GPIO::Pin4}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortF, GPIO::Pin4}, SPI::DRDY{GPIO::PortB, GPIO::Pin14}), - initSPIDevice(DRV_DEVTYPE_UNUSED, SPI::CS{GPIO::PortH, GPIO::Pin5}), - }, {GPIO::PortE, GPIO::Pin3}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortF, GPIO::Pin5}) - }), - initSPIBus(SPI::Bus::SPI4, { - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortF, GPIO::Pin10}), - }), - initSPIBusExternal(SPI::Bus::SPI5, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin4}), - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}), - }), - initSPIBusExternal(SPI::Bus::SPI6, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin6}), - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin7}), - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin8}) - }), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses_all_hw); diff --git a/boards/holybro/durandal-v1/src/timer_config.cpp b/boards/holybro/durandal-v1/src/timer_config.cpp deleted file mode 100644 index 84915c2..0000000 --- a/boards/holybro/durandal-v1/src/timer_config.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1, DMA{DMA::Index1}), - initIOTimer(Timer::Timer4, DMA{DMA::Index1}), - initIOTimer(Timer::Timer2), - initIOTimer(Timer::Timer12), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortA, GPIO::Pin10}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannelCapture(io_timers, {Timer::Timer2, Timer::Channel4}, {GPIO::PortB, GPIO::Pin11}), - initIOTimerChannelCapture(io_timers, {Timer::Timer2, Timer::Channel2}, {GPIO::PortB, GPIO::Pin3}), - initIOTimerChannelCapture(io_timers, {Timer::Timer2, Timer::Channel1}, {GPIO::PortA, GPIO::Pin5}), - initIOTimerChannelCapture(io_timers, {Timer::Timer12, Timer::Channel2}, {GPIO::PortH, GPIO::Pin9}), - initIOTimerChannelCapture(io_timers, {Timer::Timer12, Timer::Channel1}, {GPIO::PortH, GPIO::Pin6}), - //initIOTimerChannelCapture(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/holybro/durandal-v1/src/usb.c b/boards/holybro/durandal-v1/src/usb.c deleted file mode 100644 index 6d42476..0000000 --- a/boards/holybro/durandal-v1/src/usb.c +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016 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. - * - ****************************************************************************/ - -/** - * @file px4fmu_usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#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_STM32H7_OTGFS - stm32_configgpio(GPIO_OTGFS_VBUS); -#endif -} - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/holybro/kakutef7/default.px4board b/boards/holybro/kakutef7/default.px4board deleted file mode 100644 index 6919df3..0000000 --- a/boards/holybro/kakutef7/default.px4board +++ /dev/null @@ -1,35 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_CONSTRAINED_FLASH=y -CONFIG_BOARD_NO_HELP=y -CONFIG_BOARD_EXTERNAL_METADATA=y -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS3" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS0" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS1" -CONFIG_BOARD_SERIAL_RC="/dev/ttyS4" -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_BAROMETER_BMP280=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20689=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU6000=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_TELEMETRY_FRSKY_TELEMETRY=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/holybro/kakutef7/extras/holybro_kakutef7_bootloader.bin b/boards/holybro/kakutef7/extras/holybro_kakutef7_bootloader.bin deleted file mode 100644 index 6948aec..0000000 Binary files a/boards/holybro/kakutef7/extras/holybro_kakutef7_bootloader.bin and /dev/null differ diff --git a/boards/holybro/kakutef7/firmware.prototype b/boards/holybro/kakutef7/firmware.prototype deleted file mode 100644 index ff8e70a..0000000 --- a/boards/holybro/kakutef7/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 123, - "magic": "KAKUTEF7", - "description": "Firmware for the Holybro Kakute F7 board", - "image": "", - "build_time": 0, - "summary": "KAKUTEF7", - "version": "0.1", - "image_size": 0, - "image_maxsize": 1032192, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/holybro/kakutef7/init/rc.board_defaults b/boards/holybro/kakutef7/init/rc.board_defaults deleted file mode 100644 index 2968cb6..0000000 --- a/boards/holybro/kakutef7/init/rc.board_defaults +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 10.9 -param set-default BAT1_A_PER_V 17 - -# system_power unavailable -param set-default CBRK_SUPPLY_CHK 894281 - -# Select the Generic 250 Racer by default -param set-default SYS_AUTOSTART 4050 - -# use the Q attitude estimator, it works w/o mag or GPS. -param set-default SYS_MC_EST_GROUP 3 -param set-default ATT_ACC_COMP 0 -param set-default ATT_W_ACC 0.4000 -param set-default ATT_W_GYRO_BIAS 0.0000 - -param set-default SYS_HAS_MAG 0 - -# the startup tune is not great on a binary output buzzer, so disable it -param set-default CBRK_BUZZER 782090 - - -set LOGGER_BUF 30 diff --git a/boards/holybro/kakutef7/init/rc.board_extras b/boards/holybro/kakutef7/init/rc.board_extras deleted file mode 100644 index 309ed17..0000000 --- a/boards/holybro/kakutef7/init/rc.board_extras +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# -# KakuteF7 specific board extras init -#------------------------------------------------------------------------------ - -if ! param compare OSD_ATXXXX_CFG 0 -then - atxxxx start -s -fi - -# DShot telemetry is always on UART7 -dshot telemetry /dev/ttyS5 - diff --git a/boards/holybro/kakutef7/init/rc.board_sensors b/boards/holybro/kakutef7/init/rc.board_sensors deleted file mode 100644 index 0e9cf2a..0000000 --- a/boards/holybro/kakutef7/init/rc.board_sensors +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# KakuteF7 specific board sensors init -#------------------------------------------------------------------------------ - -board_adc start - -# The default IMU is an ICM20689, but there might also be an MPU6000 -if ! mpu6000 -R 6 -s start -then - icm20689 -R 6 -s start -fi - -# Onboard Baro -bmp280 -X start diff --git a/boards/holybro/kakutef7/nuttx-config/include/board.h b/boards/holybro/kakutef7/nuttx-config/include/board.h deleted file mode 100644 index aae28ec..0000000 --- a/boards/holybro/kakutef7/nuttx-config/include/board.h +++ /dev/null @@ -1,307 +0,0 @@ -/************************************************************************************ - * board.h - * - * Copyright (C) 2016-2018 Gregory Nutt. All rights reserved. - * Authors: David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ -#pragma once - -/************************************************************************************ - * Included Files - ************************************************************************************/ -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The KakuteF7 board provides the following clock sources: - * - * 8 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 16 MHz RC factory-trimmed - * HSE: 8 MHz crystal for HSE - */ - -#define STM32_BOARD_XTAL 8000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 0 - -/* Main PLL Configuration. - * - * PLL source is HSE = 8,000,000 - * - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 2 <= PLLM <= 63 - * 192 <= PLLN <= 432 - * 192 MHz <= PLL_VCO <= 432MHz - * - * SYSCLK = PLL_VCO / PLLP - * Subject to - * - * PLLP = {2, 4, 6, 8} - * SYSCLK <= 216 MHz - * - * USB OTG FS, SDMMC and RNG Clock = PLL_VCO / PLLQ - * Subject to - * The USB OTG FS requires a 48 MHz clock to work correctly. The SDMMC - * and the random number generator need a frequency lower than or equal - * to 48 MHz to work correctly. - * - * 2 <= PLLQ <= 15 - */ - -/* Highest SYSCLK with USB OTG FS clock = 48 MHz - * - * PLL_VCO = (8,000,000 / 8) * 432 = 432 MHz - * SYSCLK = 432 MHz / 2 = 216 MHz - * USB OTG FS, SDMMC and RNG Clock = 432 MHz / 9 = 48 MHz - */ - -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(8) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(432) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(9) - -#define STM32_VCO_FREQUENCY ((STM32_HSE_FREQUENCY / 8) * 432) -#define STM32_SYSCLK_FREQUENCY (STM32_VCO_FREQUENCY / 2) -#define STM32_OTGFS_FREQUENCY (STM32_VCO_FREQUENCY / 9) - -/* Configure factors for PLLSAI clock */ - -#define CONFIG_STM32F7_PLLSAI 1 -#define STM32_RCC_PLLSAICFGR_PLLSAIN RCC_PLLSAICFGR_PLLSAIN(384) -#define STM32_RCC_PLLSAICFGR_PLLSAIP RCC_PLLSAICFGR_PLLSAIP(8) -#define STM32_RCC_PLLSAICFGR_PLLSAIQ RCC_PLLSAICFGR_PLLSAIQ(4) -#define STM32_RCC_PLLSAICFGR_PLLSAIR RCC_PLLSAICFGR_PLLSAIR(2) - -/* Configure Dedicated Clock Configuration Register */ - -#define STM32_RCC_DCKCFGR1_PLLI2SDIVQ RCC_DCKCFGR1_PLLI2SDIVQ(1) -#define STM32_RCC_DCKCFGR1_PLLSAIDIVQ RCC_DCKCFGR1_PLLSAIDIVQ(1) -#define STM32_RCC_DCKCFGR1_PLLSAIDIVR RCC_DCKCFGR1_PLLSAIDIVR(0) -#define STM32_RCC_DCKCFGR1_SAI1SRC RCC_DCKCFGR1_SAI1SEL(0) -#define STM32_RCC_DCKCFGR1_SAI2SRC RCC_DCKCFGR1_SAI2SEL(0) -#define STM32_RCC_DCKCFGR1_TIMPRESRC 0 -#define STM32_RCC_DCKCFGR1_DFSDM1SRC 0 -#define STM32_RCC_DCKCFGR1_ADFSDM1SRC 0 - - - -/* Configure factors for PLLI2S clock */ - -#define CONFIG_STM32F7_PLLI2S 1 -#define STM32_RCC_PLLI2SCFGR_PLLI2SN RCC_PLLI2SCFGR_PLLI2SN(384) -#define STM32_RCC_PLLI2SCFGR_PLLI2SP RCC_PLLI2SCFGR_PLLI2SP(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SQ RCC_PLLI2SCFGR_PLLI2SQ(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SR RCC_PLLI2SCFGR_PLLI2SR(2) - -/* Configure Dedicated Clock Configuration Register 2 */ - -#define STM32_RCC_DCKCFGR2_USART1SRC RCC_DCKCFGR2_USART1SEL_APB -#define STM32_RCC_DCKCFGR2_USART2SRC RCC_DCKCFGR2_USART2SEL_APB -#define STM32_RCC_DCKCFGR2_UART4SRC RCC_DCKCFGR2_UART4SEL_APB -#define STM32_RCC_DCKCFGR2_UART5SRC RCC_DCKCFGR2_UART5SEL_APB -#define STM32_RCC_DCKCFGR2_USART6SRC RCC_DCKCFGR2_USART6SEL_APB -#define STM32_RCC_DCKCFGR2_UART7SRC RCC_DCKCFGR2_UART7SEL_APB -#define STM32_RCC_DCKCFGR2_UART8SRC RCC_DCKCFGR2_UART8SEL_APB -#define STM32_RCC_DCKCFGR2_I2C1SRC RCC_DCKCFGR2_I2C1SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C2SRC RCC_DCKCFGR2_I2C2SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C3SRC RCC_DCKCFGR2_I2C3SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C4SRC RCC_DCKCFGR2_I2C4SEL_HSI -#define STM32_RCC_DCKCFGR2_LPTIM1SRC RCC_DCKCFGR2_LPTIM1SEL_APB -#define STM32_RCC_DCKCFGR2_CECSRC RCC_DCKCFGR2_CECSEL_HSI -#define STM32_RCC_DCKCFGR2_CK48MSRC RCC_DCKCFGR2_CK48MSEL_PLL -#define STM32_RCC_DCKCFGR2_SDMMCSRC RCC_DCKCFGR2_SDMMCSEL_48MHZ -#define STM32_RCC_DCKCFGR2_SDMMC2SRC RCC_DCKCFGR2_SDMMC2SEL_48MHZ -#define STM32_RCC_DCKCFGR2_DSISRC RCC_DCKCFGR2_DSISEL_PHY - - -/* Several prescalers allow the configuration of the two AHB buses, the - * high-speed APB (APB2) and the low-speed APB (APB1) domains. The maximum - * frequency of the two AHB buses is 216 MHz while the maximum frequency of - * the high-speed APB domains is 108 MHz. The maximum allowed frequency of - * the low-speed APB domain is 54 MHz. - */ - -/* AHB clock (HCLK) is SYSCLK (216 MHz) */ - -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (54 MHz) */ - -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (108MHz) */ - -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - - -/* FLASH wait states - * - * --------- ---------- ----------- - * VDD MAX SYSCLK WAIT STATES - * --------- ---------- ----------- - * 1.7-2.1 V 180 MHz 8 - * 2.1-2.4 V 216 MHz 9 - * 2.4-2.7 V 216 MHz 8 - * 2.7-3.6 V 216 MHz 7 - * --------- ---------- ----------- - */ - -#define BOARD_FLASH_WAITSTATES 7 - -/* LED definitions ******************************************************************/ - -/* LED index values for use with board_userled() */ - -#define BOARD_LED1 0 -#define BOARD_NLEDS 1 - -#define BOARD_LED_BLUE BOARD_LED1 - -/* LED bits for use with board_userled_all() */ - -#define BOARD_LED1_BIT (1 << BOARD_LED1) - -/* If CONFIG_ARCH_LEDS is defined, the usage by the board port is defined in - * include/board.h and src/stm32_leds.c. The LEDs are used to encode OS-related - * events as follows: - * - * - * SYMBOL Meaning LED state - * Red Green Blue - * ---------------------- -------------------------- ------ ------ ----*/ - -#define LED_STARTED 0 /* NuttX has been started OFF OFF OFF */ -#define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF OFF ON */ -#define LED_IRQSENABLED 2 /* Interrupts enabled OFF ON OFF */ -#define LED_STACKCREATED 3 /* Idle stack created OFF ON ON */ -#define LED_INIRQ 4 /* In an interrupt N/C N/C GLOW */ -#define LED_SIGNAL 5 /* In a signal handler N/C GLOW N/C */ -#define LED_ASSERTION 6 /* An assertion failed GLOW N/C GLOW */ -#define LED_PANIC 7 /* The system has crashed Blink OFF N/C */ -#define LED_IDLE 8 /* MCU is is sleep mode ON OFF OFF */ - -/* Alternate function pin selections (see stm32f74xx75xx_pinmap.h) ******************************/ - -#define GPIO_USART1_RX GPIO_USART1_RX_1 /* PA10 */ -#define GPIO_USART1_TX GPIO_USART1_TX_1 /* PA9 */ - -#define GPIO_USART2_RX GPIO_USART2_RX_2 /* PD6 */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ - -#define GPIO_USART3_RX GPIO_USART3_RX_1 /* PB11 */ -#define GPIO_USART3_TX GPIO_USART3_TX_1 /* PB10 */ - -#define GPIO_UART4_RX GPIO_UART4_RX_1 /* PA1 */ -#define GPIO_UART4_TX GPIO_UART4_TX_1 /* PA0 */ - -#define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC7 */ -#define GPIO_USART6_TX GPIO_USART6_TX_1 /* PC6 */ - -#define GPIO_UART7_RX GPIO_UART7_RX_1 /* PE7 */ -#define GPIO_UART7_TX GPIO_UART7_TX_1 /* PE8 */ - -/* SPI - * SPI1 SD Card - * SPI2 is OSD AT7456E - * SPI4 is IMU - */ - -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 /* PA7 */ -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 /* PA5 */ - -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 /* PB14 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 /* PB15 */ -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_3 /* PB13 */ - -#define GPIO_SPI4_MISO GPIO_SPI4_MISO_1 /* PE5 */ -#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_1 /* PE6 */ -#define GPIO_SPI4_SCK GPIO_SPI4_SCK_1 /* PE2 */ - -/* I2C - */ - -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_1 /* PB6 */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_1 /* PB7 */ - -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN6) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN7) - -/* USB - * - * OTG_FS_DM PA11 - * OTG_FS_DP PA12 - * VBUS PA8 - */ - diff --git a/boards/holybro/kakutef7/nuttx-config/include/board_dma_map.h b/boards/holybro/kakutef7/nuttx-config/include/board_dma_map.h deleted file mode 100644 index c095f53..0000000 --- a/boards/holybro/kakutef7/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,102 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/* -| DMA1 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | SPI3_RX_1 | SPDIFRX_DT | SPI3_RX_2 | SPI2_RX | SPI2_TX | SPI3_TX_1 | SPDIFRX_CS | SPI3_TX_2 | -| Channel 1 | I2C1_RX | I2C3_RX | TIM7_UP_1 | - | TIM7_UP_2 | I2C1_RX_1 | I2C1_TX | I2C1_TX_1 | -| Channel 2 | TIM4_CH1 | - | I2C4_RX | TIM4_CH2 | - | I2C4_RX | TIM4_UP | TIM4_CH3 | -| Channel 3 | - | TIM2_UP_1 | I2C3_RX_1 | - | I2C3_TX | TIM2_CH1 | TIM2_CH2 | TIM2_UP_2 | -| | | TIM2_CH3 | | | | | TIM2_CH4_1 | TIM2_CH4_2 | -| Channel 4 | UART5_RX | USART3_RX | UART4_RX | USART3_TX_1 | UART4_TX | USART2_RX | USART2_TX | UART5_TX | -| Channel 5 | UART8_TX | UART7_TX | TIM3_CH4 | UART7_RX | TIM3_CH1 | TIM3_CH2 | UART8_RX | TIM3_CH3 | -| | | | TIM3_UP | | TIM3_TRIG | | | | -| Channel 6 | TIM5_CH3 | TIM5_CH4_1 | TIM5_CH1 | TIM5_CH4_2 | TIM5_CH2 | - | TIM5_UP_2 | - | -| | TIM5_UP_1 | TIM5_TRIG_1 | | TIM5_TRIG_2 | | | | | -| Channel 7 | - | TIM6_UP | I2C2_RX | I2C2_RX_1 | USART3_TX_2 | DAC1 | DAC2 | I2C2_TX | -| Channel 8 | I2C3_TX | I2C4_RX | - | - | I2C2_TX | - | I2C4_TX | - | -| Channel 9 | - | SPI2_RX | - | - | - | - | SPI2_TX | - | -| | | | | | | | | | -| Usage | | | TIM3_UP | | | USART2_RX | TIM5_UP_2 | | - - -| DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | ADC1_1 | SAI1_A | TIM8_CH1_1 | SAI1_A_1 | ADC1_2 | SAI1_B_1 | TIM1_CH1_1 | SAI2_B_2 | -| | | | TIM8_CH2_1 | | | | TIM1_CH2_1 | | -| | | | TIM8_CH3_1 | | | | TIM1_CH3_1 | | -| Channel 1 | - | DCMI_1 | ADC2_1 | ADC2_2 | SAI1_B | SPI6_TX | SPI6_RX | DCMI_2 | -| Channel 2 | ADC3_1 | ADC3_2 | - | SPI5_RX_1 | SPI5_TX_1 | CRYP_OUT | CRYP_IN | HASH_IN | -| Channel 3 | SPI1_RX_1 | - | SPI1_RX_2 | SPI1_TX_1 | SAI2_A | SPI1_TX_2 | SAI2_B | QUADSPI | -| Channel 4 | SPI4_RX_1 | SPI4_TX_1 | USART1_RX_1 | SDMMC1_1 | - | USART1_RX_2 | SDMMC1_2 | USART1_TX | -| Channel 5 | - | USART6_RX_1 | USART6_RX_2 | SPI4_RX_2 | SPI4_TX_2 | - | USART6_TX_1 | USART6_TX_2 | -| Channel 6 | TIM1_TRIG_1 | TIM1_CH1_2 | TIM1_CH2_2 | TIM1_CH1 | TIM1_CH4 | TIM1_UP | TIM1_CH3_2 | - | -| | | | | | TIM1_TRIG_2 | | | | -| | | | | | TIM1_COM | | | | -| Channel 7 | - | TIM8_UP | TIM8_CH1_2 | TIM8_CH2_2 | TIM8_CH3_2 | SPI5_RX_2 | SPI5_TX_2 | TIM8_CH4 | -| | | | | | | | | TIM8_TRIG | -| | | | | | | | | TIM8_COM | -| Channel 8 | DSFDM1_FLT0 | DSFDM1_FLT1 | DSFDM1_FLT2 | DSFDM1_FLT3 | DSFDM1_FLT0 | DSFDM1_FLT1 | DSFDM1_FLT2 | DSFDM1_FLT3 | -| Channel 9 | JPEG_IN | JPEG_OUT | SPI4_TX | JPEG_IN | JPEG_OUT | SPI5_RX | - | - | -| Channel 10 | SAI1_B | SAI2_B | SAI2_A | - | - | - | SAI1_A | - | -| Channel 11 | SDMMC2 | - | QUADSPI | - | - | SDMMC2 | - | - | -| | | | | | | | | | -| Usage | SPI4_RX_1 | TIM8_UP | | | SPI4_TX_2 | TIM1_UP | | | - */ - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// AVAILABLE // DMA1, Stream 0 -// AVAILABLE // DMA1, Stream 1 -// DMAMAP_TIM3_UP // DMA1, Stream 2, Channel 5 (DSHOT) -// AVAILABLE // DMA1, Stream 3 -// AVAILABLE // DMA1, Stream 4 -// DMAMAP_USART2_RX // DMA1, Stream 5, Channel 4 -// DMAMAP_TIM5_UP_2 // DMA1, Stream 6, Channel 6 (DSHOT) -// AVAILABLE // DMA1, Stream 7 - - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMAMAP_SPI4_RX DMAMAP_SPI4_RX_1 // DMA2, Stream 0, Channel 4 (SPI sensors) -// DMAMAP_TIM8_UP // DMA2, Stream 1, Channel 7 (DSHOT) -// AVAILABLE // DMA1, Stream 2 -// AVAILABLE // DMA1, Stream 3 -#define DMAMAP_SPI4_TX DMAMAP_SPI4_TX_2 // DMA2, Stream 4, Channel 5 (SPI sensors) -// DMAMAP_TIM1_UP // DMA2, Stream 5, Channel 6 (DSHOT) -// AVAILABLE // DMA1, Stream 6 -// AVAILABLE // DMA1, Stream 7 - diff --git a/boards/holybro/kakutef7/nuttx-config/nsh/defconfig b/boards/holybro/kakutef7/nuttx-config/nsh/defconfig deleted file mode 100644 index faf8655..0000000 --- a/boards/holybro/kakutef7/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,241 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_SPI_CALLBACK is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/holybro/kakutef7/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32f7" -CONFIG_ARCH_CHIP_STM32F745VG=y -CONFIG_ARCH_CHIP_STM32F7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0050 -CONFIG_CDCACM_PRODUCTSTR="PX4 KakuteF7" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="Holybro" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_EXCLUDE_BLOCKS=y -CONFIG_FS_PROCFS_EXCLUDE_MOUNT=y -CONFIG_FS_PROCFS_EXCLUDE_MOUNTS=y -CONFIG_FS_PROCFS_EXCLUDE_PARTITIONS=y -CONFIG_FS_PROCFS_EXCLUDE_USAGE=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_LIBC_STRERROR_SHORT=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MM_REGIONS=3 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_MMCSDSPIPORTNO=1 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32F7_ADC1=y -CONFIG_STM32F7_BBSRAM=y -CONFIG_STM32F7_BBSRAM_FILES=5 -CONFIG_STM32F7_BKPSRAM=y -CONFIG_STM32F7_DMA1=y -CONFIG_STM32F7_DMA2=y -CONFIG_STM32F7_DMACAPABLE=y -CONFIG_STM32F7_I2C1=y -CONFIG_STM32F7_I2C_DYNTIMEO=y -CONFIG_STM32F7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32F7_OTGFS=y -CONFIG_STM32F7_PROGMEM=y -CONFIG_STM32F7_PWR=y -CONFIG_STM32F7_RTC=y -CONFIG_STM32F7_RTC_HSECLOCK=y -CONFIG_STM32F7_RTC_MAGIC_REG=1 -CONFIG_STM32F7_SAVE_CRASHDUMP=y -CONFIG_STM32F7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32F7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32F7_SPI1=y -CONFIG_STM32F7_SPI2=y -CONFIG_STM32F7_SPI4=y -CONFIG_STM32F7_SPI4_DMA=y -CONFIG_STM32F7_SPI4_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI_DMATHRESHOLD=8 -CONFIG_STM32F7_UART4=y -CONFIG_STM32F7_UART7=y -CONFIG_STM32F7_USART1=y -CONFIG_STM32F7_USART2=y -CONFIG_STM32F7_USART3=y -CONFIG_STM32F7_USART6=y -CONFIG_STM32F7_USART_BREAKS=y -CONFIG_STM32F7_USART_INVERT=y -CONFIG_STM32F7_USART_SINGLEWIRE=y -CONFIG_STM32F7_USART_SWAP=y -CONFIG_STM32F7_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=2500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_SERIAL_CONSOLE=y -CONFIG_USART3_TXBUFSIZE=1500 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/holybro/kakutef7/nuttx-config/scripts/script.ld b/boards/holybro/kakutef7/nuttx-config/scripts/script.ld deleted file mode 100644 index 903eb2d..0000000 --- a/boards/holybro/kakutef7/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,171 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F745VGT6 has 1024 KiB of main FLASH memory. This FLASH memory - * can be accessed from either the AXIM interface at address 0x0800:0000 or - * from the ITCM interface at address 0x0020:0000. - * - * Additional information, including the option bytes, is available at at - * FLASH at address 0x1ff0:0000 (AXIM) or 0x0010:0000 (ITCM). - * - * In the STM32F745VGT6, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash on ITCM at 0x0020:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x0010:0000 - * - * NuttX does not modify these option byes. On the unmodified NUCLEO-144 - * board, the BOOT0 pin is at ground so by default, the STM32F745VGT6 will - * boot from address 0x0020:0000 in ITCM FLASH. - * - * The STM32F745VGT6 also has 320 KiB of data SRAM (in addition to ITCM SRAM). - * SRAM is split up into three blocks: - * - * 1) 64 KiB of DTCM SRM beginning at address 0x2000:0000 - * 2) 240 KiB of SRAM1 beginning at address 0x2001:0000 - * 3) 16 KiB of SRAM2 beginning at address 0x2004:c000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * Bootloader reserves the first 32K bank. - * The next 2 32K sectors are reserved for parameters. - * - */ - -MEMORY -{ - itcm (rwx) : ORIGIN = 0x00208000, LENGTH = 2016K - flash (rx) : ORIGIN = 0x08018000, LENGTH = 928K - dtcm (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - sram1 (rwx) : ORIGIN = 0x20020000, LENGTH = 368K - sram2 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram1 AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram1 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/holybro/kakutef7/src/CMakeLists.txt b/boards/holybro/kakutef7/src/CMakeLists.txt deleted file mode 100644 index b943815..0000000 --- a/boards/holybro/kakutef7/src/CMakeLists.txt +++ /dev/null @@ -1,51 +0,0 @@ -############################################################################ -# -# Copyright (c) 2019 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. -# -############################################################################ - -add_library(drivers_board - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - usb.c -) - -target_link_libraries(drivers_board - PRIVATE - arch_io_pins - arch_spi - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer -) diff --git a/boards/holybro/kakutef7/src/board_config.h b/boards/holybro/kakutef7/src/board_config.h deleted file mode 100644 index 9254c57..0000000 --- a/boards/holybro/kakutef7/src/board_config.h +++ /dev/null @@ -1,168 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * KakuteF7 internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ - -/* GPIOs ***********************************************************************************/ - -/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */ - -#define GPIO_nLED_BLUE /* PA2 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN2) - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_ARMED_STATE_LED LED_BLUE - -#define FLASH_BASED_PARAMS - - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that - * can be used by the Px4 Firmware in the adc driver - */ - -/* ADC defines to be used in sensors.cpp to read from a particular channel */ -#define ADC1_CH(n) (n) -#define ADC1_GPIO(n) GPIO_ADC1_IN##n - -/* Define GPIO pins used as ADC N.B. Channel numbers must match below */ -#define PX4_ADC_GPIO \ - /* PC2 */ ADC1_GPIO(12), \ - /* PC3 */ ADC1_GPIO(13), \ - /* PC5 */ ADC1_GPIO(15) - -/* Define Channel numbers must match above GPIO pin IN(n)*/ -#define ADC_RSSI_IN_CHANNEL /* PC5 */ ADC1_CH(15) -#define ADC_BATTERY_VOLTAGE_CHANNEL /* PC3 */ ADC1_CH(13) -#define ADC_BATTERY_CURRENT_CHANNEL /* PC2 */ ADC1_CH(12) - -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY_CURRENT_CHANNEL) | \ - (1 << ADC_RSSI_IN_CHANNEL)) - -/* PWM - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 6 - -/* Tone alarm output */ -#define GPIO_TONE_ALARM_IDLE /* PD15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN15) -#define GPIO_TONE_ALARM_GPIO /* PD15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTD|GPIO_PIN15) - -/* USB OTG FS - * - * PA8 OTG_FS_VBUS VBUS sensing - */ -#define GPIO_OTGFS_VBUS /* PA8 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN8) - -/* High-resolution timer */ -#define HRT_TIMER 2 /* use timer 2 for the HRT */ -#define HRT_TIMER_CHANNEL 1 /* use capture/compare channel 1 */ - -/* RC Serial port */ - -#define RC_SERIAL_PORT "/dev/ttyS4" - -#define GPIO_RSSI_IN /* PC5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN5) - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ -#define BOARD_HAS_ON_RESET 1 - -#define PX4_GPIO_INIT_LIST { \ - PX4_ADC_GPIO, \ - GPIO_TONE_ALARM_IDLE, \ - GPIO_RSSI_IN, \ - } - -#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 - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/holybro/kakutef7/src/i2c.cpp b/boards/holybro/kakutef7/src/i2c.cpp deleted file mode 100644 index e9f26f9..0000000 --- a/boards/holybro/kakutef7/src/i2c.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), -}; diff --git a/boards/holybro/kakutef7/src/init.c b/boards/holybro/kakutef7/src/init.c deleted file mode 100644 index da2a545..0000000 --- a/boards/holybro/kakutef7/src/init.c +++ /dev/null @@ -1,260 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * Board-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include "board_config.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include - -# if defined(FLASH_BASED_PARAMS) -# include -#endif - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* Configuration ************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - UNUSED(ms); -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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 - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - - px4_platform_init(); - - /* configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_on(LED_GREEN); // Indicate Power. - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - - /* Get the SPI port for the microSD slot */ - struct spi_dev_s *spi_dev = stm32_spibus_initialize(CONFIG_NSH_MMCSDSPIPORTNO); - - if (!spi_dev) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", CONFIG_NSH_MMCSDSPIPORTNO); - led_on(LED_BLUE); - } - - /* Now bind the SPI interface to the MMCSD driver */ - int result = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi_dev); - - if (result != OK) { - led_on(LED_BLUE); - syslog(LOG_ERR, "[boot] FAILED to bind SPI port 1 to the MMCSD driver\n"); - } - - up_udelay(20); - - -#if defined(FLASH_BASED_PARAMS) - static sector_descriptor_t params_sector_map[] = { - {1, 32 * 1024, 0x08008000}, - {2, 32 * 1024, 0x08010000}, - {0, 0, 0}, - }; - - /* Initialize the flashfs layer to use heap allocated memory */ - result = parameter_flashfs_init(params_sector_map, NULL, 0); - - if (result != OK) { - syslog(LOG_ERR, "[boot] FAILED to init params in FLASH %d\n", result); - led_on(LED_AMBER); - } - -#endif - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/holybro/kakutef7/src/led.c b/boards/holybro/kakutef7/src/led.c deleted file mode 100644 index 5169b86..0000000 --- a/boards/holybro/kakutef7/src/led.c +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -static uint32_t g_ledmap[] = { - GPIO_nLED_BLUE, // Indexed by LED_BLUE -}; - -__EXPORT void led_init(void) -{ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - stm32_configgpio(g_ledmap[l]); - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - if (led == 0) { - stm32_gpiowrite(g_ledmap[led], !state); - } -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - if (led == 0) { - return !stm32_gpioread(g_ledmap[led]); - } - - return false; -} - -__EXPORT void led_on(int led) -{ - phy_set_led(led, true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(led, false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(led, !phy_get_led(led)); -} - diff --git a/boards/holybro/kakutef7/src/spi.cpp b/boards/holybro/kakutef7/src/spi.cpp deleted file mode 100644 index cfae72c..0000000 --- a/boards/holybro/kakutef7/src/spi.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(SPIDEV_MMCSD(0), SPI::CS{GPIO::PortA, GPIO::Pin4}) - }), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_OSD_DEVTYPE_ATXXXX, SPI::CS{GPIO::PortB, GPIO::Pin12}), - }), - initSPIBus(SPI::Bus::SPI4, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20689, SPI::CS{GPIO::PortE, GPIO::Pin4}, SPI::DRDY{GPIO::PortE, GPIO::Pin1}), - initSPIDevice(DRV_IMU_DEVTYPE_MPU6000, SPI::CS{GPIO::PortE, GPIO::Pin4}, SPI::DRDY{GPIO::PortE, GPIO::Pin1}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/holybro/kakutef7/src/timer_config.cpp b/boards/holybro/kakutef7/src/timer_config.cpp deleted file mode 100644 index 1395049..0000000 --- a/boards/holybro/kakutef7/src/timer_config.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2019 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer3, DMA{DMA::Index1, DMA::Stream2, DMA::Channel5}), - initIOTimer(Timer::Timer1, DMA{DMA::Index2, DMA::Stream5, DMA::Channel6}), - initIOTimer(Timer::Timer8, DMA{DMA::Index2, DMA::Stream1, DMA::Channel7}), - initIOTimer(Timer::Timer5, DMA{DMA::Index1, DMA::Stream6, DMA::Channel6}), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel3}, {GPIO::PortB, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel4}, {GPIO::PortB, GPIO::Pin1}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::Timer8, Timer::Channel4}, {GPIO::PortC, GPIO::Pin9}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel4}, {GPIO::PortA, GPIO::Pin3}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/holybro/kakutef7/src/usb.c b/boards/holybro/kakutef7/src/usb.c deleted file mode 100644 index 4ac9829..0000000 --- a/boards/holybro/kakutef7/src/usb.c +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2019 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#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 - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/holybro/kakuteh7/bootloader.px4board b/boards/holybro/kakuteh7/bootloader.px4board deleted file mode 100644 index 19b6e66..0000000 --- a/boards/holybro/kakuteh7/bootloader.px4board +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_ROMFSROOT="" diff --git a/boards/holybro/kakuteh7/default.px4board b/boards/holybro/kakuteh7/default.px4board deleted file mode 100644 index 713c736..0000000 --- a/boards/holybro/kakuteh7/default.px4board +++ /dev/null @@ -1,88 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS3" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS0" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS1" -CONFIG_BOARD_SERIAL_RC="/dev/ttyS4" -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_COMMON_BAROMETERS=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_BOSCH_BMI270=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20689=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU6000=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/holybro/kakuteh7/extras/holybro_kakuteh7_bootloader.bin b/boards/holybro/kakuteh7/extras/holybro_kakuteh7_bootloader.bin deleted file mode 100755 index 0935146..0000000 Binary files a/boards/holybro/kakuteh7/extras/holybro_kakuteh7_bootloader.bin and /dev/null differ diff --git a/boards/holybro/kakuteh7/firmware.prototype b/boards/holybro/kakuteh7/firmware.prototype deleted file mode 100644 index 8081ade..0000000 --- a/boards/holybro/kakuteh7/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 1048, - "magic": "PX4FWv1", - "description": "Firmware for the KakuteH7 board", - "image": "", - "build_time": 0, - "summary": "KAKUTEH7", - "version": "0.1", - "image_size": 0, - "image_maxsize": 1835008, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/holybro/kakuteh7/init/rc.board_defaults b/boards/holybro/kakuteh7/init/rc.board_defaults deleted file mode 100644 index fa014c6..0000000 --- a/boards/holybro/kakuteh7/init/rc.board_defaults +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -# transision from params file to flash-based params (2022-08) -if [ -f $PARAM_FILE ] -then - param load $PARAM_FILE - param save - # create a backup - mv $PARAM_FILE ${PARAM_FILE}.bak - reboot -fi - -param set-default BAT1_V_DIV 11.2 -param set-default BAT1_A_PER_V 59.5 - -# system_power unavailable -param set-default CBRK_SUPPLY_CHK 894281 - -# Select the Generic 250 Racer by default -param set-default SYS_AUTOSTART 4050 - -# use the Q attitude estimator, it works w/o mag or GPS. -param set-default SYS_MC_EST_GROUP 3 -param set-default ATT_ACC_COMP 0 -param set-default ATT_W_ACC 0.4000 -param set-default ATT_W_GYRO_BIAS 0.0000 - -param set-default SYS_HAS_MAG 0 - -# the startup tune is not great on a binary output buzzer, so disable it -param set-default CBRK_BUZZER 782090 - -param set-default IMU_GYRO_RATEMAX 2000 - diff --git a/boards/holybro/kakuteh7/init/rc.board_extras b/boards/holybro/kakuteh7/init/rc.board_extras deleted file mode 100644 index 256633f..0000000 --- a/boards/holybro/kakuteh7/init/rc.board_extras +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# -# KakuteH7 specific board extras init -#------------------------------------------------------------------------------ - -if ! param compare OSD_ATXXXX_CFG 0 -then - atxxxx start -s -fi - -# DShot telemetry is always on UART7 -dshot telemetry /dev/ttyS5 - diff --git a/boards/holybro/kakuteh7/init/rc.board_sensors b/boards/holybro/kakuteh7/init/rc.board_sensors deleted file mode 100644 index c6c9960..0000000 --- a/boards/holybro/kakuteh7/init/rc.board_sensors +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# Holybro KakuteH7v1 specific board sensors init -#------------------------------------------------------------------------------ -board_adc start - -# The KakuteH7 v1 comes by default with an ICM20689, -# but there might also be an MPU6000 -if ! mpu6000 -R 6 -s start -then - icm20689 -R 6 -s start -fi - -bmp280 -X start diff --git a/boards/holybro/kakuteh7/nuttx-config/bootloader/defconfig b/boards/holybro/kakuteh7/nuttx-config/bootloader/defconfig deleted file mode 100644 index 9e7ac9f..0000000 --- a/boards/holybro/kakuteh7/nuttx-config/bootloader/defconfig +++ /dev/null @@ -1,90 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_CONSOLE is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_SPI_EXCHANGE is not set -# CONFIG_STM32H7_SYSCFG is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/holybro/kakuteh7/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743VI=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_INITTHREAD_PRIORITY=254 -CONFIG_BOARD_LATE_INITIALIZE=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0050 -CONFIG_CDCACM_PRODUCTSTR="PX4 BL Holybro KakuteH7" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x3162 -CONFIG_CDCACM_VENDORSTR="Holybro" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_EXPERIMENTAL=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="bootloader_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SPI=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_USART3=y -CONFIG_SYSTEMTICK_HOOK=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGINT_CHAR=0x03 -CONFIG_TTY_SIGTSTP=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/holybro/kakuteh7/nuttx-config/include/board.h b/boards/holybro/kakuteh7/nuttx-config/include/board.h deleted file mode 100644 index 83245ff..0000000 --- a/boards/holybro/kakuteh7/nuttx-config/include/board.h +++ /dev/null @@ -1,419 +0,0 @@ -/************************************************************************************ - * - * Copyright (C) 2016-2019 Gregory Nutt. 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 NuttX 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. - * - ************************************************************************************/ -#pragma once - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The holybro KakuteH7 board provides the following clock sources: - * - * X1: 8 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 16 MHz RC factory-trimmed - * HSE: 8 MHz crystal for HSE - */ - -#define STM32_BOARD_XTAL 8000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 32768 - -/* Main PLL Configuration. - * - * PLL source is HSE = 8,000,000 - * - * PLL_VCOx = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 1 <= PLLM <= 63 - * 4 <= PLLN <= 512 - * 150 MHz <= PLL_VCOL <= 420MHz - * 192 MHz <= PLL_VCOH <= 836MHz - * - * SYSCLK = PLL_VCO / PLLP - * CPUCLK = SYSCLK / D1CPRE - * Subject to - * - * PLLP1 = {2, 4, 6, 8, ..., 128} - * PLLP2,3 = {2, 3, 4, ..., 128} - * CPUCLK <= 480 MHz - */ - -#define STM32_BOARD_USEHSE - -#define STM32_PLLCFG_PLLSRC RCC_PLLCKSELR_PLLSRC_HSE - -/* PLL1, wide 4 - 8 MHz input, enable DIVP, DIVQ, DIVR - * - * PLL1_VCO = (8,000,000 / 1) * 120 = 960 MHz - * - * PLL1P = PLL1_VCO/2 = 960 MHz / 2 = 480 MHz - * PLL1Q = PLL1_VCO/4 = 960 MHz / 4 = 240 MHz - * PLL1R = PLL1_VCO/8 = 960 MHz / 8 = 120 MHz - */ - -#define STM32_PLLCFG_PLL1CFG (RCC_PLLCFGR_PLL1VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL1RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVP1EN | \ - RCC_PLLCFGR_DIVQ1EN | \ - RCC_PLLCFGR_DIVR1EN) -#define STM32_PLLCFG_PLL1M RCC_PLLCKSELR_DIVM1(1) -#define STM32_PLLCFG_PLL1N RCC_PLL1DIVR_N1(120) -#define STM32_PLLCFG_PLL1P RCC_PLL1DIVR_P1(2) -#define STM32_PLLCFG_PLL1Q RCC_PLL1DIVR_Q1(4) -#define STM32_PLLCFG_PLL1R RCC_PLL1DIVR_R1(8) - -#define STM32_VCO1_FREQUENCY ((STM32_HSE_FREQUENCY / 1) * 120) -#define STM32_PLL1P_FREQUENCY (STM32_VCO1_FREQUENCY / 2) -#define STM32_PLL1Q_FREQUENCY (STM32_VCO1_FREQUENCY / 4) -#define STM32_PLL1R_FREQUENCY (STM32_VCO1_FREQUENCY / 8) - -/* PLL2 */ - -#define STM32_PLLCFG_PLL2CFG (RCC_PLLCFGR_PLL2VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL2RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVP2EN | \ - RCC_PLLCFGR_DIVQ2EN | \ - RCC_PLLCFGR_DIVR2EN) -#define STM32_PLLCFG_PLL2M RCC_PLLCKSELR_DIVM2(2) -#define STM32_PLLCFG_PLL2N RCC_PLL2DIVR_N2(48) -#define STM32_PLLCFG_PLL2P RCC_PLL2DIVR_P2(2) -#define STM32_PLLCFG_PLL2Q RCC_PLL2DIVR_Q2(2) -#define STM32_PLLCFG_PLL2R RCC_PLL2DIVR_R2(2) - -#define STM32_VCO2_FREQUENCY ((STM32_HSE_FREQUENCY / 2) * 48) -#define STM32_PLL2P_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2Q_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2R_FREQUENCY (STM32_VCO2_FREQUENCY / 2) - -/* PLL3 */ - -#define STM32_PLLCFG_PLL3CFG (RCC_PLLCFGR_PLL3VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL3RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVQ3EN) -#define STM32_PLLCFG_PLL3M RCC_PLLCKSELR_DIVM3(2) -#define STM32_PLLCFG_PLL3N RCC_PLL3DIVR_N3(48) -#define STM32_PLLCFG_PLL3P RCC_PLL3DIVR_P3(2) -#define STM32_PLLCFG_PLL3Q RCC_PLL3DIVR_Q3(4) -#define STM32_PLLCFG_PLL3R RCC_PLL3DIVR_R3(2) - -#define STM32_VCO3_FREQUENCY ((STM32_HSE_FREQUENCY / 2) * 48) -#define STM32_PLL3P_FREQUENCY (STM32_VCO3_FREQUENCY / 2) -#define STM32_PLL3Q_FREQUENCY (STM32_VCO3_FREQUENCY / 4) -#define STM32_PLL3R_FREQUENCY (STM32_VCO3_FREQUENCY / 2) - -/* SYSCLK = PLL1P = 480MHz - * CPUCLK = SYSCLK / 1 = 480 MHz - */ - -#define STM32_RCC_D1CFGR_D1CPRE (RCC_D1CFGR_D1CPRE_SYSCLK) -#define STM32_SYSCLK_FREQUENCY (STM32_PLL1P_FREQUENCY) -#define STM32_CPUCLK_FREQUENCY (STM32_SYSCLK_FREQUENCY / 1) - -/* Configure Clock Assignments */ - -/* AHB clock (HCLK) is SYSCLK/2 (240 MHz max) - * HCLK1 = HCLK2 = HCLK3 = HCLK4 = 240 - */ - -#define STM32_RCC_D1CFGR_HPRE RCC_D1CFGR_HPRE_SYSCLKd2 /* HCLK = SYSCLK / 2 */ -#define STM32_ACLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* ACLK in D1, HCLK3 in D1 */ -#define STM32_HCLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* HCLK in D2, HCLK4 in D3 */ -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D2CFGR_D2PPRE1 RCC_D2CFGR_D2PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB2 clock (PCLK2) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D2CFGR_D2PPRE2 RCC_D2CFGR_D2PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB3 clock (PCLK3) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D1CFGR_D1PPRE RCC_D1CFGR_D1PPRE_HCLKd2 /* PCLK3 = HCLK / 2 */ -#define STM32_PCLK3_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB4 clock (PCLK4) is HCLK/4 (120 MHz) */ - -#define STM32_RCC_D3CFGR_D3PPRE RCC_D3CFGR_D3PPRE_HCLKd2 /* PCLK4 = HCLK / 2 */ -#define STM32_PCLK4_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timer clock frequencies */ - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM15_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM16_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM17_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Kernel Clock Configuration - * - * Note: look at Table 54 in ST Manual - */ - -/* I2C123 clock source */ - -#define STM32_RCC_D2CCIP2R_I2C123SRC RCC_D2CCIP2R_I2C123SEL_HSI - -/* I2C4 clock source */ - -#define STM32_RCC_D3CCIPR_I2C4SRC RCC_D3CCIPR_I2C4SEL_HSI - -/* SPI123 clock source */ - -#define STM32_RCC_D2CCIP1R_SPI123SRC RCC_D2CCIP1R_SPI123SEL_PLL2 - -/* SPI45 clock source */ - -#define STM32_RCC_D2CCIP1R_SPI45SRC RCC_D2CCIP1R_SPI45SEL_PLL2 - -/* SPI6 clock source */ - -#define STM32_RCC_D3CCIPR_SPI6SRC RCC_D3CCIPR_SPI6SEL_PLL2 - -/* USB 1 and 2 clock source */ - -#define STM32_RCC_D2CCIP2R_USBSRC RCC_D2CCIP2R_USBSEL_PLL3 - -/* ADC 1 2 3 clock source */ - -#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2 - -/* FDCAN 1 2 clock source */ - -#define STM32_RCC_D2CCIP1R_FDCANSEL RCC_D2CCIP1R_FDCANSEL_HSE /* FDCAN 1 2 clock source */ - -#define STM32_FDCANCLK STM32_HSE_FREQUENCY - -/* FLASH wait states - * - * ------------ ---------- ----------- - * Vcore MAX ACLK WAIT STATES - * ------------ ---------- ----------- - * 1.15-1.26 V 70 MHz 0 - * (VOS1 level) 140 MHz 1 - * 210 MHz 2 - * 1.05-1.15 V 55 MHz 0 - * (VOS2 level) 110 MHz 1 - * 165 MHz 2 - * 220 MHz 3 - * 0.95-1.05 V 45 MHz 0 - * (VOS3 level) 90 MHz 1 - * 135 MHz 2 - * 180 MHz 3 - * 225 MHz 4 - * ------------ ---------- ----------- - */ - -#define BOARD_FLASH_WAITSTATES 2 - -/* SDMMC definitions ********************************************************/ - -/* Init 400kHz, freq = PLL1Q/(2*div) div = PLL1Q/(2*freq) */ - -#define STM32_SDMMC_INIT_CLKDIV (300 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* 25 MHz Max for now, 25 mHZ = PLL1Q/(2*div), div = PLL1Q/(2*freq) - * div = 4.8 = 240 / 50, So round up to 5 for default speed 24 MB/s - */ - -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_MMCXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_SDXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - -/* LED definitions ******************************************************************/ -/* The holybro KakuteH7 board has three, LED_GREEN a Green LED, LED_BLUE - * a Blue LED and LED_RED a Red LED, that can be controlled by software. - * - * If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any way. - * The following definitions are used to access individual LEDs. - */ - -/* LED index values for use with board_userled() */ - -#define BOARD_LED1 0 -#define BOARD_NLEDS 1 - -#define BOARD_LED_RED BOARD_LED1 - -/* LED bits for use with board_userled_all() */ - -#define BOARD_LED1_BIT (1 << BOARD_LED1) - -/* If CONFIG_ARCH_LEDS is defined, the usage by the board port is defined in - * include/board.h and src/stm32_leds.c. The LEDs are used to encode OS-related - * events as follows: - * - * - * SYMBOL Meaning LED state - * Red Green Blue - * ---------------------- -------------------------- ------ ------ ----*/ - -#define LED_STARTED 0 /* NuttX has been started OFF OFF OFF */ -#define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF OFF ON */ -#define LED_IRQSENABLED 2 /* Interrupts enabled OFF ON OFF */ -#define LED_STACKCREATED 3 /* Idle stack created OFF ON ON */ -#define LED_INIRQ 4 /* In an interrupt N/C N/C GLOW */ -#define LED_SIGNAL 5 /* In a signal handler N/C GLOW N/C */ -#define LED_ASSERTION 6 /* An assertion failed GLOW N/C GLOW */ -#define LED_PANIC 7 /* The system has crashed Blink OFF N/C */ -#define LED_IDLE 8 /* MCU is is sleep mode ON OFF OFF */ - -/* Thus if the Green LED is statically on, NuttX has successfully booted and - * is, apparently, running normally. If the Red LED is flashing at - * approximately 2Hz, then a fatal error has been detected and the system - * has halted. - */ - -/* Alternate function pin selections ************************************************/ - - -#define GPIO_USART1_RX GPIO_USART1_RX_2 /* PA10 */ -#define GPIO_USART1_TX GPIO_USART1_TX_2 /* PA9 */ - -#define GPIO_USART2_RX GPIO_USART2_RX_2 /* PD6 */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ - -#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ -#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ - -#define GPIO_UART4_RX GPIO_UART4_RX_5 /* PD0 */ -#define GPIO_UART4_TX GPIO_UART4_TX_5 /* PD1 */ - -#define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC7 */ -#define GPIO_USART6_TX GPIO_USART6_TX_1 /* PC6 */ - -#define GPIO_UART7_RX GPIO_UART7_RX_3 /* PE7 */ -#define GPIO_UART7_TX GPIO_UART7_TX_3 /* PE8 */ - -/* SPI - * SPI1 SD Card - * SPI2 is OSD AT7456E - * SPI4 is IMU - */ - -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 /* PA7 */ -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 /* PA5 */ - -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 /* PB14 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 /* PB15 */ -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_4 /* PB13 */ - -#define GPIO_SPI4_MISO GPIO_SPI4_MISO_2 /* PE5 */ -#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_2 /* PE6 */ -#define GPIO_SPI4_SCK GPIO_SPI4_SCK_2 /* PE2 */ - -/* I2C - */ - -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_1 /* PB6 */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_1 /* PB7 */ - -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN6) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN7) - -/* SDMMC1 - * - * VDD 3.3 - * GND - * SDMMC1_CK PC12 - * SDMMC1_CMD PD2 - * SDMMC1_D0 PC8 - * SDMMC1_D1 PC9 - * SDMMC1_D2 PC10 - * SDMMC1_D3 PC11 - * GPIO_SDMMC1_NCD PG0 - */ - -/* USB - * - * OTG_FS_DM PA11 - * OTG_FS_DP PA12 - * VBUS PA9 - */ - - -/* Board provides GPIO or other Hardware for signaling to timing analyzer */ - -# define PROBE_INIT(mask) -# define PROBE(n,s) -# define PROBE_MARK(n) - diff --git a/boards/holybro/kakuteh7/nuttx-config/include/board_dma_map.h b/boards/holybro/kakuteh7/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 1954ce3..0000000 --- a/boards/holybro/kakuteh7/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -#define DMAMAP_SPI4_RX DMAMAP_DMA12_SPI4RX_1 /* DMA2 */ -#define DMAMAP_SPI4_TX DMAMAP_DMA12_SPI4TX_1 /* DMA2 */ - -#define DMAMAP_USART2_RX DMAMAP_DMA12_USART2RX_1 /* DMA2 */ - diff --git a/boards/holybro/kakuteh7/nuttx-config/nsh/defconfig b/boards/holybro/kakuteh7/nuttx-config/nsh/defconfig deleted file mode 100644 index c7d29dd..0000000 --- a/boards/holybro/kakuteh7/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,247 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_SPI_CALLBACK is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/holybro/kakuteh7/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743II=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=95150 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0050 -CONFIG_CDCACM_PRODUCTSTR="PX4 KakuteH7" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x3162 -CONFIG_CDCACM_VENDORSTR="Holybro" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_MEMFAULT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXPERIMENTAL=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MM_REGIONS=4 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_PROGMEM=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_MMCSDSPIPORTNO=1 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32H7_ADC1=y -CONFIG_STM32H7_ADC3=y -CONFIG_STM32H7_BBSRAM=y -CONFIG_STM32H7_BBSRAM_FILES=5 -CONFIG_STM32H7_BDMA=y -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_DMA2=y -CONFIG_STM32H7_DMACAPABLE=y -CONFIG_STM32H7_FLOWCONTROL_BROKEN=y -CONFIG_STM32H7_I2C1=y -CONFIG_STM32H7_I2C_DYNTIMEO=y -CONFIG_STM32H7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_RTC=y -CONFIG_STM32H7_RTC_AUTO_LSECLOCK_START_DRV_CAPABILITY=y -CONFIG_STM32H7_RTC_MAGIC_REG=1 -CONFIG_STM32H7_SAVE_CRASHDUMP=y -CONFIG_STM32H7_SDMMC1=y -CONFIG_STM32H7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_SPI1=y -CONFIG_STM32H7_SPI2=y -CONFIG_STM32H7_SPI4=y -CONFIG_STM32H7_SPI4_DMA=y -CONFIG_STM32H7_SPI4_DMA_BUFFER=1024 -CONFIG_STM32H7_UART4=y -CONFIG_STM32H7_UART7=y -CONFIG_STM32H7_USART1=y -CONFIG_STM32H7_USART2=y -CONFIG_STM32H7_USART3=y -CONFIG_STM32H7_USART6=y -CONFIG_STM32H7_USART_BREAKS=y -CONFIG_STM32H7_USART_INVERT=y -CONFIG_STM32H7_USART_SINGLEWIRE=y -CONFIG_STM32H7_USART_SWAP=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGTSTP=y -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=2500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_SERIAL_CONSOLE=y -CONFIG_USART3_TXBUFSIZE=1500 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 -CONFIG_WATCHDOG=y diff --git a/boards/holybro/kakuteh7/nuttx-config/scripts/bootloader_script.ld b/boards/holybro/kakuteh7/nuttx-config/scripts/bootloader_script.ld deleted file mode 100644 index fc0a558..0000000 --- a/boards/holybro/kakuteh7/nuttx-config/scripts/bootloader_script.ld +++ /dev/null @@ -1,215 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016, 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The KakuteH7 uses an STM32H743VI has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743VI, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * The KakuteH7 has a switch on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the switch is - * depressed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743VI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The bootloader uses the first sector of the flash, which is 128K in length. - */ - -MEMORY -{ - itcm (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - flash (rx) : ORIGIN = 0x08000000, LENGTH = 128K - dtcm1 (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - dtcm2 (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - sram (rwx) : ORIGIN = 0x24000000, LENGTH = 512K - sram1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K - sram2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K - sram3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K - sram4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K - bbram (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/holybro/kakuteh7/nuttx-config/scripts/script.ld b/boards/holybro/kakuteh7/nuttx-config/scripts/script.ld deleted file mode 100644 index ae07f4b..0000000 --- a/boards/holybro/kakuteh7/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,228 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016, 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The KakuteH7 uses an STM32H743VI has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743VI, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * The KakuteH7 has a switch on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the switch is - * depressed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743VI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - FLASH (rx) : ORIGIN = 0x08020000, LENGTH = 1792K /* params in last sector */ - - DTCM1_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - DTCM2_RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */ - SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */ - SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */ - BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH - - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - - /* Pad out last section as the STM32H7 Flash write size is 256 bits. 32 bytes */ - . = ALIGN(16); - FILL(0xffff) - . += 16; - } > AXI_SRAM AT > FLASH = 0xffff - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > AXI_SRAM - - /* Emit the the D3 power domain section for locating BDMA data */ - - .sram4_reserve (NOLOAD) : - { - *(.sram4) - . = ALIGN(4); - _sram4_heap_start = ABSOLUTE(.); - } > SRAM4 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/holybro/kakuteh7/src/CMakeLists.txt b/boards/holybro/kakuteh7/src/CMakeLists.txt deleted file mode 100644 index 220642b..0000000 --- a/boards/holybro/kakuteh7/src/CMakeLists.txt +++ /dev/null @@ -1,67 +0,0 @@ -############################################################################ -# -# Copyright (c) 2016 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. -# -############################################################################ -if("${PX4_BOARD_LABEL}" STREQUAL "bootloader") - add_library(drivers_board - bootloader_main.c - usb.c - ) - target_link_libraries(drivers_board - PRIVATE - nuttx_arch # sdio - nuttx_drivers # sdio - bootloader - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/bootloader/common) - -else() - add_library(drivers_board - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - usb.c - ) - add_dependencies(drivers_board arch_board_hw_info) - - target_link_libraries(drivers_board - PRIVATE - arch_io_pins - arch_spi - arch_board_hw_info - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer - ) -endif() diff --git a/boards/holybro/kakuteh7/src/board_config.h b/boards/holybro/kakuteh7/src/board_config.h deleted file mode 100644 index 99395ea..0000000 --- a/boards/holybro/kakuteh7/src/board_config.h +++ /dev/null @@ -1,213 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * holybro KakuteH7 internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ - -/* Configuration ************************************************************************************/ - -# define BOARD_HAS_USB_VALID 1 -# define BOARD_HAS_NBAT_V 1 -# define BOARD_HAS_NBAT_I 1 - -/* Holybro KakuteH7 GPIOs ************************************************************************/ - -/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */ - -#define GPIO_nLED_RED /* PC2 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN2) - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_OVERLOAD_LED LED_RED - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that - * can be used by the Px4 Firmware in the adc driver - */ - -/* ADC defines to be used in sensors.cpp to read from a particular channel */ - -#define ADC1_CH(n) (n) - -/* Define GPIO pins used as ADC N.B. Channel numbers must match below */ - -#define PX4_ADC_GPIO \ - /* PC0 */ GPIO_ADC123_INP10, \ - /* PC1 */ GPIO_ADC123_INP11, \ - /* PC5 */ GPIO_ADC12_INP8 - -/* Define Channel numbers must match above GPIO pin IN(n)*/ - -#define ADC_BATTERY_VOLTAGE_CHANNEL /* PC0 */ ADC1_CH(10) -#define ADC_BATTERY_CURRENT_CHANNEL /* PC1 */ ADC1_CH(11) -#define ADC_RSSI_IN_CHANNEL /* PC5 */ ADC1_CH(8) - -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY_CURRENT_CHANNEL) | \ - (1 << ADC_RSSI_IN_CHANNEL)) - -#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f) - - - -/* PWM - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 8 - -#define BOARD_NUM_IO_TIMERS 4 - - -/* Tone alarm output */ - -#define GPIO_TONE_ALARM_IDLE /* PC13 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN13) -#define GPIO_TONE_ALARM_GPIO /* PC13 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN13) - -/* USB OTG FS - * - * PA9 OTG_FS_VBUS VBUS sensing - */ -#define GPIO_OTGFS_VBUS /* PA8 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN8) - -/* High-resolution timer */ -#define HRT_TIMER 4 /* use timer3 for the HRT */ -#define HRT_TIMER_CHANNEL 1 /* use capture/compare channel 1 */ - -/* RC Serial port */ - -/* PWM input driver. Use FMU AUX5 pins attached to timer4 channel 2 */ - -#define PWMIN_TIMER 5 -#define PWMIN_TIMER_CHANNEL /* T5C1 */ 1 -#define GPIO_PWM_IN /* PA0 */ GPIO_TIM5_CH1IN - -#define GPIO_RSSI_IN /* PC5 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTC|GPIO_PIN5) - -#define GPIO_RF_SWITCH /* PE13 */ (GPIO_OUTPUT|GPIO_PULLDOWN|GPIO_PORTE|GPIO_PIN13) - -/* Power switch controls ******************************************************/ - -#define SDIO_SLOTNO 0 /* Only one slot */ -#define SDIO_MINOR 0 - -/* SD card bringup does not work if performed on the IDLE thread because it - * will cause waiting. Use either: - * - * CONFIG_BOARDCTL=y, OR - * CONFIG_BOARD_INITIALIZE=y && CONFIG_BOARD_INITTHREAD=y - */ - -#if defined(CONFIG_BOARD_INITIALIZE) && !defined(CONFIG_BOARDCTL) && \ - !defined(CONFIG_BOARD_INITTHREAD) -# warning SDIO initialization cannot be perfomed on the IDLE thread -#endif - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) - -/* Board never powers off the Servo rail */ - -#define BOARD_ADC_SERVO_VALID (1) - -#define BOARD_ADC_BRICK1_VALID (1) - - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ - -#define BOARD_HAS_ON_RESET 1 - -#define PX4_GPIO_INIT_LIST { \ - PX4_ADC_GPIO, \ - GPIO_TONE_ALARM_IDLE, \ - GPIO_RSSI_IN, \ - GPIO_RF_SWITCH, \ - } - -#define BOARD_ENABLE_CONSOLE_BUFFER - -#define FLASH_BASED_PARAMS - -__BEGIN_DECLS - -/**************************************************************************************************** - * Public Types - ****************************************************************************************************/ - -/**************************************************************************************************** - * Public data - ****************************************************************************************************/ - -#ifndef __ASSEMBLY__ - -/**************************************************************************************************** - * Public Functions - ****************************************************************************************************/ - -extern void stm32_spiinitialize(void); - -extern void stm32_usbinitialize(void); - -extern void board_peripheral_reset(int ms); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/holybro/kakuteh7/src/bootloader_main.c b/boards/holybro/kakuteh7/src/bootloader_main.c deleted file mode 100644 index cec6abd..0000000 --- a/boards/holybro/kakuteh7/src/bootloader_main.c +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019-2021 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. - * - ****************************************************************************/ - -/** - * @file bootloader_main.c - * - * FMU-specific early startup code for bootloader -*/ - -#include "board_config.h" -#include "bl.h" - -#include -#include -#include -#include -#include -#include "arm_internal.h" -#include - -extern int sercon_main(int c, char **argv); - -__EXPORT void board_on_reset(int status) {} - -__EXPORT void stm32_boardinitialize(void) -{ - /* configure USB interfaces */ - stm32_usbinitialize(); -} - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - return 0; -} - -void board_late_initialize(void) -{ - sercon_main(0, NULL); -} - -extern void sys_tick_handler(void); -void board_timerhook(void) -{ - sys_tick_handler(); -} diff --git a/boards/holybro/kakuteh7/src/hw_config.h b/boards/holybro/kakuteh7/src/hw_config.h deleted file mode 100644 index 01f1a80..0000000 --- a/boards/holybro/kakuteh7/src/hw_config.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - * hw_config.h - * - * Created on: May 17, 2015 - * Author: david_s5 - */ - -#ifndef HW_CONFIG_H_ -#define HW_CONFIG_H_ - -/**************************************************************************** - * 10-8--2016: - * To simplify the ripple effect on the tools, we will be using - * /dev/serial/by-id/PX4 to locate PX4 devices. Therefore - * moving forward all Bootloaders must contain the prefix "PX4 BL " - * in the USBDEVICESTRING - * This Change will be made in an upcoming BL release - ****************************************************************************/ -/* - * Define usage to configure a bootloader - * - * - * Constant example Usage - * APP_LOAD_ADDRESS 0x08004000 - The address in Linker Script, where the app fw is org-ed - * BOOTLOADER_DELAY 5000 - Ms to wait while under USB pwr or bootloader request - * BOARD_FMUV2 - * INTERFACE_USB 1 - (Optional) Scan and use the USB interface for bootloading - * INTERFACE_USART 1 - (Optional) Scan and use the Serial interface for bootloading - * USBDEVICESTRING "PX4 BL FMU v2.x" - USB id string - * USBPRODUCTID 0x0011 - PID Should match defconfig - * BOOT_DELAY_ADDRESS 0x000001a0 - (Optional) From the linker script from Linker Script to get a custom - * delay provided by an APP FW - * BOARD_TYPE 9 - Must match .prototype boad_id - * _FLASH_KBYTES (*(uint16_t *)0x1fff7a22) - Run time flash size detection - * BOARD_FLASH_SECTORS ((_FLASH_KBYTES == 0x400) ? 11 : 23) - Run time determine the physical last sector - * BOARD_FLASH_SECTORS 11 - Hard coded zero based last sector - * BOARD_FLASH_SIZE (_FLASH_KBYTES*1024)- Total Flash size of device, determined at run time. - * (1024 * 1024) - Hard coded Total Flash of device - The bootloader and app reserved will be deducted - * programmatically - * - * BOARD_FIRST_FLASH_SECTOR_TO_ERASE 2 - Optional sectors index in the flash_sectors table (F4 only), to begin erasing. - * This is to allow sectors to be reserved for app fw usage. That will NOT be erased - * during a FW upgrade. - * The default is 0, and selects the first sector to be erased, as the 0th entry in the - * flash_sectors table. Which is the second physical sector of FLASH in the device. - * The first physical sector of FLASH is used by the bootloader, and is not defined - * in the table. - * - * APP_RESERVATION_SIZE (BOARD_FIRST_FLASH_SECTOR_TO_ERASE * 16 * 1024) - Number of bytes reserved by the APP FW. This number plus - * BOOTLOADER_RESERVATION_SIZE will be deducted from - * BOARD_FLASH_SIZE to determine the size of the App FW - * and hence the address space of FLASH to erase and program. - * USBMFGSTRING "PX4 AP" - Optional USB MFG string (default is '3D Robotics' if not defined.) - * SERIAL_BREAK_DETECT_DISABLED - Optional prevent break selection on Serial port from entering or staying in BL - * - * * Other defines are somewhat self explanatory. - */ - -/* Boot device selection list*/ -#define USB0_DEV 0x01 -#define SERIAL0_DEV 0x02 -#define SERIAL1_DEV 0x04 - -#define APP_LOAD_ADDRESS 0x08020000 -#define BOOTLOADER_DELAY 3000 -#define INTERFACE_USB 1 -#define INTERFACE_USB_CONFIG "/dev/ttyACM0" -#define BOARD_VBUS MK_GPIO_INPUT(GPIO_OTGFS_VBUS) - -//#define USE_VBUS_PULL_DOWN -#define BOOT_DELAY_ADDRESS 0x000001a0 -#define BOARD_TYPE 1048 -#define BOARD_FLASH_SECTORS (14) -#define BOARD_FLASH_SIZE (16 * 128 * 1024) -#define APP_RESERVATION_SIZE (1 * 128 * 1024) - -#define OSC_FREQ 8 - -#define BOARD_PIN_LED_ACTIVITY GPIO_nLED_RED -#define BOARD_LED_ON 0 -#define BOARD_LED_OFF 1 - -#define SERIAL_BREAK_DETECT_DISABLED 1 - -/* - * Uncommenting this allows to force the bootloader through - * a PWM output pin. As this can accidentally initialize - * an ESC prematurely, it is not recommended. This feature - * has not been used and hence defaults now to off. - * - * # define BOARD_FORCE_BL_PIN_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN14) - * # define BOARD_FORCE_BL_PIN_IN (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN11) - * - * # define BOARD_POWER_PIN_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN4) - * # define BOARD_POWER_ON 1 - * # define BOARD_POWER_OFF 0 - * # undef BOARD_POWER_PIN_RELEASE // Leave pin enabling Power - un comment to release (disable power) - * -*/ - -#if !defined(ARCH_SN_MAX_LENGTH) -# define ARCH_SN_MAX_LENGTH 12 -#endif - -#if !defined(APP_RESERVATION_SIZE) -# define APP_RESERVATION_SIZE 0 -#endif - -#if !defined(BOARD_FIRST_FLASH_SECTOR_TO_ERASE) -# define BOARD_FIRST_FLASH_SECTOR_TO_ERASE 1 -#endif - -#if !defined(USB_DATA_ALIGN) -# define USB_DATA_ALIGN -#endif - -#ifndef BOOT_DEVICES_SELECTION -# define BOOT_DEVICES_SELECTION USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif - -#ifndef BOOT_DEVICES_FILTER_ONUSB -# define BOOT_DEVICES_FILTER_ONUSB USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif - -#endif /* HW_CONFIG_H_ */ diff --git a/boards/holybro/kakuteh7/src/i2c.cpp b/boards/holybro/kakuteh7/src/i2c.cpp deleted file mode 100644 index e9f26f9..0000000 --- a/boards/holybro/kakuteh7/src/i2c.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), -}; diff --git a/boards/holybro/kakuteh7/src/init.c b/boards/holybro/kakuteh7/src/init.c deleted file mode 100644 index cf73735..0000000 --- a/boards/holybro/kakuteh7/src/init.c +++ /dev/null @@ -1,270 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-2019 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * PX4FMU-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include "board_config.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -# if defined(FLASH_BASED_PARAMS) -# include -#endif - - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* Configuration ************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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(); - - /* Turn bluetooth off by default (no mavlink support yet) */ - px4_arch_gpiowrite(GPIO_RF_SWITCH, 0); - - /* configure USB interfaces */ - - stm32_usbinitialize(); - -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Power on Interfaces */ - board_control_spi_sensors_power(true, 0xffff); - - /* Need hrt running before using the ADC */ - - px4_platform_init(); - - /* configure SPI interfaces */ - - stm32_spiinitialize(); - - /* configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - - /* Get the SPI port for the microSD slot */ - struct spi_dev_s *spi_dev = stm32_spibus_initialize(CONFIG_NSH_MMCSDSPIPORTNO); - - if (!spi_dev) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", CONFIG_NSH_MMCSDSPIPORTNO); - led_on(LED_BLUE); - } - - /* Now bind the SPI interface to the MMCSD driver */ - int result = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi_dev); - - if (result != OK) { - syslog(LOG_ERR, "[boot] Could not bind MMCSD driver, expected on Kakute H7 V2\n"); - } - - up_udelay(20); - - -#if defined(FLASH_BASED_PARAMS) - static sector_descriptor_t params_sector_map[] = { - {15, 128 * 1024, 0x081E0000}, - {0, 0, 0}, - }; - - /* Initialize the flashfs layer to use heap allocated memory */ - result = parameter_flashfs_init(params_sector_map, NULL, 0); - - if (result != OK) { - syslog(LOG_ERR, "[boot] FAILED to init params in FLASH %d\n", result); - led_on(LED_AMBER); - } - -#endif - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/holybro/kakuteh7/src/led.c b/boards/holybro/kakuteh7/src/led.c deleted file mode 100644 index 945c383..0000000 --- a/boards/holybro/kakuteh7/src/led.c +++ /dev/null @@ -1,223 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013 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 - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -#ifdef CONFIG_ARCH_LEDS -static bool nuttx_owns_leds = true; -// B R S G -// 0 1 2 3 -static const uint8_t xlatpx4[] = {1, 2, 4, 0}; -# define xlat(p) xlatpx4[(p)] -static uint32_t g_ledmap[] = { - GPIO_nLED_RED, // Indexed by BOARD_LED_RED -}; - -#else - -# define xlat(p) (p) -static uint32_t g_ledmap[] = { - GPIO_nLED_RED, // Indexed by LED_RED, LED_AMBER -}; - -#endif - -__EXPORT void led_init(void) -{ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - if (g_ledmap[l] != 0) { - stm32_configgpio(g_ledmap[l]); - } - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - - if (g_ledmap[led] != 0) { - stm32_gpiowrite(g_ledmap[led], !state); - } -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - if (g_ledmap[led] != 0) { - return !stm32_gpioread(g_ledmap[led]); - } - - return false; -} - -__EXPORT void led_on(int led) -{ - phy_set_led(xlat(led), true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(xlat(led), false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(xlat(led), !phy_get_led(xlat(led))); -} - -#ifdef CONFIG_ARCH_LEDS -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_autoled_initialize - ****************************************************************************/ - -void board_autoled_initialize(void) -{ - led_init(); -} - -/**************************************************************************** - * Name: board_autoled_on - ****************************************************************************/ - -void board_autoled_on(int led) -{ - if (!nuttx_owns_leds) { - return; - } - - switch (led) { - default: - break; - - case LED_HEAPALLOCATE: - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_IRQSENABLED: - phy_set_led(BOARD_LED_BLUE, false); - phy_set_led(BOARD_LED_GREEN, true); - break; - - case LED_STACKCREATED: - phy_set_led(BOARD_LED_GREEN, true); - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_INIRQ: - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_SIGNAL: - phy_set_led(BOARD_LED_GREEN, true); - break; - - case LED_ASSERTION: - phy_set_led(BOARD_LED_RED, true); - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_PANIC: - phy_set_led(BOARD_LED_RED, true); - break; - - case LED_IDLE : /* IDLE */ - phy_set_led(BOARD_LED_RED, true); - break; - } -} - -/**************************************************************************** - * Name: board_autoled_off - ****************************************************************************/ - -void board_autoled_off(int led) -{ - if (!nuttx_owns_leds) { - return; - } - - switch (led) { - default: - break; - - case LED_SIGNAL: - phy_set_led(BOARD_LED_GREEN, false); - break; - - case LED_INIRQ: - phy_set_led(BOARD_LED_BLUE, false); - break; - - case LED_ASSERTION: - phy_set_led(BOARD_LED_RED, false); - phy_set_led(BOARD_LED_BLUE, false); - break; - - case LED_PANIC: - phy_set_led(BOARD_LED_RED, false); - break; - - case LED_IDLE : /* IDLE */ - phy_set_led(BOARD_LED_RED, false); - break; - } -} - -#endif /* CONFIG_ARCH_LEDS */ diff --git a/boards/holybro/kakuteh7/src/spi.cpp b/boards/holybro/kakuteh7/src/spi.cpp deleted file mode 100644 index 1ff5b7f..0000000 --- a/boards/holybro/kakuteh7/src/spi.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020-2021 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(SPIDEV_MMCSD(0), SPI::CS{GPIO::PortA, GPIO::Pin4}) - }), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_OSD_DEVTYPE_ATXXXX, SPI::CS{GPIO::PortB, GPIO::Pin12}), - }), - initSPIBus(SPI::Bus::SPI4, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20689, SPI::CS{GPIO::PortE, GPIO::Pin4}, SPI::DRDY{GPIO::PortE, GPIO::Pin1}), - initSPIDevice(DRV_IMU_DEVTYPE_MPU6000, SPI::CS{GPIO::PortE, GPIO::Pin4}, SPI::DRDY{GPIO::PortE, GPIO::Pin1}), - initSPIDevice(DRV_IMU_DEVTYPE_BMI270, SPI::CS{GPIO::PortE, GPIO::Pin4}, SPI::DRDY{GPIO::PortE, GPIO::Pin1}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/holybro/kakuteh7/src/timer_config.cpp b/boards/holybro/kakuteh7/src/timer_config.cpp deleted file mode 100644 index 20eb0f1..0000000 --- a/boards/holybro/kakuteh7/src/timer_config.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer3, DMA{DMA::Index1}), - initIOTimer(Timer::Timer2, DMA{DMA::Index1}), - initIOTimer(Timer::Timer5, DMA{DMA::Index1}), - initIOTimer(Timer::Timer8, DMA{DMA::Index1}), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel3}, {GPIO::PortB, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel4}, {GPIO::PortB, GPIO::Pin1}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel2}, {GPIO::PortB, GPIO::Pin3}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel3}, {GPIO::PortB, GPIO::Pin10}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel1}, {GPIO::PortA, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel3}, {GPIO::PortA, GPIO::Pin2}), - initIOTimerChannel(io_timers, {Timer::Timer8, Timer::Channel3}, {GPIO::PortC, GPIO::Pin8}), - initIOTimerChannel(io_timers, {Timer::Timer8, Timer::Channel4}, {GPIO::PortC, GPIO::Pin9}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/holybro/kakuteh7/src/usb.c b/boards/holybro/kakuteh7/src/usb.c deleted file mode 100644 index 6d42476..0000000 --- a/boards/holybro/kakuteh7/src/usb.c +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016 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. - * - ****************************************************************************/ - -/** - * @file px4fmu_usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#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_STM32H7_OTGFS - stm32_configgpio(GPIO_OTGFS_VBUS); -#endif -} - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/holybro/kakuteh7mini/bootloader.px4board b/boards/holybro/kakuteh7mini/bootloader.px4board deleted file mode 100644 index 19b6e66..0000000 --- a/boards/holybro/kakuteh7mini/bootloader.px4board +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_ROMFSROOT="" diff --git a/boards/holybro/kakuteh7mini/default.px4board b/boards/holybro/kakuteh7mini/default.px4board deleted file mode 100644 index b019b75..0000000 --- a/boards/holybro/kakuteh7mini/default.px4board +++ /dev/null @@ -1,85 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS3" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS0" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS1" -CONFIG_BOARD_SERIAL_RC="/dev/ttyS4" -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_COMMON_BAROMETERS=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_BOSCH_BMI270=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU6000=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_PWM_OUT_SIM=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/holybro/kakuteh7mini/extras/holybro_kakuteh7mini_bootloader.bin b/boards/holybro/kakuteh7mini/extras/holybro_kakuteh7mini_bootloader.bin deleted file mode 100755 index fca97ea..0000000 Binary files a/boards/holybro/kakuteh7mini/extras/holybro_kakuteh7mini_bootloader.bin and /dev/null differ diff --git a/boards/holybro/kakuteh7mini/firmware.prototype b/boards/holybro/kakuteh7mini/firmware.prototype deleted file mode 100644 index 3698433..0000000 --- a/boards/holybro/kakuteh7mini/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 1054, - "magic": "PX4FWv1", - "description": "Firmware for the KakuteH7Mini board", - "image": "", - "build_time": 0, - "summary": "KAKUTEH7MINI-NAND", - "version": "0.1", - "image_size": 0, - "image_maxsize": 1835008, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/holybro/kakuteh7mini/init/rc.board_defaults b/boards/holybro/kakuteh7mini/init/rc.board_defaults deleted file mode 100644 index 4503905..0000000 --- a/boards/holybro/kakuteh7mini/init/rc.board_defaults +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -# transision from params file to flash-based params (2022-08) -if [ -f $PARAM_FILE ] -then - param load $PARAM_FILE - param save - # create a backup - mv $PARAM_FILE ${PARAM_FILE}.bak - reboot -fi - -param set-default BAT1_V_DIV 11.2 -param set-default BAT1_A_PER_V 59.5 - -# system_power unavailable -param set-default CBRK_SUPPLY_CHK 894281 - -# Select the Generic 250 Racer by default -param set-default SYS_AUTOSTART 4050 - -# use EKF2 without mag -param set-default SYS_HAS_MAG 0 -# and enable gravity fusion -param set-default EKF2_IMU_CONTROL 7 - -# the startup tune is not great on a binary output buzzer, so disable it -param set-default CBRK_BUZZER 782090 - -param set-default IMU_GYRO_RATEMAX 2000 - -# Store missions in RAM -param set-default SYS_DM_BACKEND 1 - -# Ignore that there is no SD card -param set-default COM_ARM_SDCARD 0 - -# Don't try to log onto SD card -param set-default SDLOG_MODE -1 diff --git a/boards/holybro/kakuteh7mini/init/rc.board_extras b/boards/holybro/kakuteh7mini/init/rc.board_extras deleted file mode 100644 index 256633f..0000000 --- a/boards/holybro/kakuteh7mini/init/rc.board_extras +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# -# KakuteH7 specific board extras init -#------------------------------------------------------------------------------ - -if ! param compare OSD_ATXXXX_CFG 0 -then - atxxxx start -s -fi - -# DShot telemetry is always on UART7 -dshot telemetry /dev/ttyS5 - diff --git a/boards/holybro/kakuteh7mini/init/rc.board_sensors b/boards/holybro/kakuteh7mini/init/rc.board_sensors deleted file mode 100644 index 89a18f5..0000000 --- a/boards/holybro/kakuteh7mini/init/rc.board_sensors +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# -# Holybro KakuteH7Mini specific board sensors init -#------------------------------------------------------------------------------ -board_adc start - -bmi270 -R 6 -s start - -bmp280 -X start diff --git a/boards/holybro/kakuteh7mini/nuttx-config/bootloader/defconfig b/boards/holybro/kakuteh7mini/nuttx-config/bootloader/defconfig deleted file mode 100644 index cefb442..0000000 --- a/boards/holybro/kakuteh7mini/nuttx-config/bootloader/defconfig +++ /dev/null @@ -1,89 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_CONSOLE is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_SPI_EXCHANGE is not set -# CONFIG_STM32H7_SYSCFG is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/holybro/kakuteh7mini/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743VI=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=512 -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_INITTHREAD_PRIORITY=254 -CONFIG_BOARD_LATE_INITIALIZE=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0050 -CONFIG_CDCACM_PRODUCTSTR="PX4 BL Holybro KakuteH7Mini" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x3162 -CONFIG_CDCACM_VENDORSTR="Holybro" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEFAULT_SMALL=y -CONFIG_EXPERIMENTAL=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="bootloader_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SPI=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_USART3=y -CONFIG_SYSTEMTICK_HOOK=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGINT_CHAR=0x03 -CONFIG_TTY_SIGTSTP=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/holybro/kakuteh7mini/nuttx-config/include/board.h b/boards/holybro/kakuteh7mini/nuttx-config/include/board.h deleted file mode 100644 index 83245ff..0000000 --- a/boards/holybro/kakuteh7mini/nuttx-config/include/board.h +++ /dev/null @@ -1,419 +0,0 @@ -/************************************************************************************ - * - * Copyright (C) 2016-2019 Gregory Nutt. 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 NuttX 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. - * - ************************************************************************************/ -#pragma once - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The holybro KakuteH7 board provides the following clock sources: - * - * X1: 8 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 16 MHz RC factory-trimmed - * HSE: 8 MHz crystal for HSE - */ - -#define STM32_BOARD_XTAL 8000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 32768 - -/* Main PLL Configuration. - * - * PLL source is HSE = 8,000,000 - * - * PLL_VCOx = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 1 <= PLLM <= 63 - * 4 <= PLLN <= 512 - * 150 MHz <= PLL_VCOL <= 420MHz - * 192 MHz <= PLL_VCOH <= 836MHz - * - * SYSCLK = PLL_VCO / PLLP - * CPUCLK = SYSCLK / D1CPRE - * Subject to - * - * PLLP1 = {2, 4, 6, 8, ..., 128} - * PLLP2,3 = {2, 3, 4, ..., 128} - * CPUCLK <= 480 MHz - */ - -#define STM32_BOARD_USEHSE - -#define STM32_PLLCFG_PLLSRC RCC_PLLCKSELR_PLLSRC_HSE - -/* PLL1, wide 4 - 8 MHz input, enable DIVP, DIVQ, DIVR - * - * PLL1_VCO = (8,000,000 / 1) * 120 = 960 MHz - * - * PLL1P = PLL1_VCO/2 = 960 MHz / 2 = 480 MHz - * PLL1Q = PLL1_VCO/4 = 960 MHz / 4 = 240 MHz - * PLL1R = PLL1_VCO/8 = 960 MHz / 8 = 120 MHz - */ - -#define STM32_PLLCFG_PLL1CFG (RCC_PLLCFGR_PLL1VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL1RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVP1EN | \ - RCC_PLLCFGR_DIVQ1EN | \ - RCC_PLLCFGR_DIVR1EN) -#define STM32_PLLCFG_PLL1M RCC_PLLCKSELR_DIVM1(1) -#define STM32_PLLCFG_PLL1N RCC_PLL1DIVR_N1(120) -#define STM32_PLLCFG_PLL1P RCC_PLL1DIVR_P1(2) -#define STM32_PLLCFG_PLL1Q RCC_PLL1DIVR_Q1(4) -#define STM32_PLLCFG_PLL1R RCC_PLL1DIVR_R1(8) - -#define STM32_VCO1_FREQUENCY ((STM32_HSE_FREQUENCY / 1) * 120) -#define STM32_PLL1P_FREQUENCY (STM32_VCO1_FREQUENCY / 2) -#define STM32_PLL1Q_FREQUENCY (STM32_VCO1_FREQUENCY / 4) -#define STM32_PLL1R_FREQUENCY (STM32_VCO1_FREQUENCY / 8) - -/* PLL2 */ - -#define STM32_PLLCFG_PLL2CFG (RCC_PLLCFGR_PLL2VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL2RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVP2EN | \ - RCC_PLLCFGR_DIVQ2EN | \ - RCC_PLLCFGR_DIVR2EN) -#define STM32_PLLCFG_PLL2M RCC_PLLCKSELR_DIVM2(2) -#define STM32_PLLCFG_PLL2N RCC_PLL2DIVR_N2(48) -#define STM32_PLLCFG_PLL2P RCC_PLL2DIVR_P2(2) -#define STM32_PLLCFG_PLL2Q RCC_PLL2DIVR_Q2(2) -#define STM32_PLLCFG_PLL2R RCC_PLL2DIVR_R2(2) - -#define STM32_VCO2_FREQUENCY ((STM32_HSE_FREQUENCY / 2) * 48) -#define STM32_PLL2P_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2Q_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2R_FREQUENCY (STM32_VCO2_FREQUENCY / 2) - -/* PLL3 */ - -#define STM32_PLLCFG_PLL3CFG (RCC_PLLCFGR_PLL3VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL3RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVQ3EN) -#define STM32_PLLCFG_PLL3M RCC_PLLCKSELR_DIVM3(2) -#define STM32_PLLCFG_PLL3N RCC_PLL3DIVR_N3(48) -#define STM32_PLLCFG_PLL3P RCC_PLL3DIVR_P3(2) -#define STM32_PLLCFG_PLL3Q RCC_PLL3DIVR_Q3(4) -#define STM32_PLLCFG_PLL3R RCC_PLL3DIVR_R3(2) - -#define STM32_VCO3_FREQUENCY ((STM32_HSE_FREQUENCY / 2) * 48) -#define STM32_PLL3P_FREQUENCY (STM32_VCO3_FREQUENCY / 2) -#define STM32_PLL3Q_FREQUENCY (STM32_VCO3_FREQUENCY / 4) -#define STM32_PLL3R_FREQUENCY (STM32_VCO3_FREQUENCY / 2) - -/* SYSCLK = PLL1P = 480MHz - * CPUCLK = SYSCLK / 1 = 480 MHz - */ - -#define STM32_RCC_D1CFGR_D1CPRE (RCC_D1CFGR_D1CPRE_SYSCLK) -#define STM32_SYSCLK_FREQUENCY (STM32_PLL1P_FREQUENCY) -#define STM32_CPUCLK_FREQUENCY (STM32_SYSCLK_FREQUENCY / 1) - -/* Configure Clock Assignments */ - -/* AHB clock (HCLK) is SYSCLK/2 (240 MHz max) - * HCLK1 = HCLK2 = HCLK3 = HCLK4 = 240 - */ - -#define STM32_RCC_D1CFGR_HPRE RCC_D1CFGR_HPRE_SYSCLKd2 /* HCLK = SYSCLK / 2 */ -#define STM32_ACLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* ACLK in D1, HCLK3 in D1 */ -#define STM32_HCLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* HCLK in D2, HCLK4 in D3 */ -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D2CFGR_D2PPRE1 RCC_D2CFGR_D2PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB2 clock (PCLK2) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D2CFGR_D2PPRE2 RCC_D2CFGR_D2PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB3 clock (PCLK3) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D1CFGR_D1PPRE RCC_D1CFGR_D1PPRE_HCLKd2 /* PCLK3 = HCLK / 2 */ -#define STM32_PCLK3_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB4 clock (PCLK4) is HCLK/4 (120 MHz) */ - -#define STM32_RCC_D3CFGR_D3PPRE RCC_D3CFGR_D3PPRE_HCLKd2 /* PCLK4 = HCLK / 2 */ -#define STM32_PCLK4_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timer clock frequencies */ - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM15_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM16_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM17_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Kernel Clock Configuration - * - * Note: look at Table 54 in ST Manual - */ - -/* I2C123 clock source */ - -#define STM32_RCC_D2CCIP2R_I2C123SRC RCC_D2CCIP2R_I2C123SEL_HSI - -/* I2C4 clock source */ - -#define STM32_RCC_D3CCIPR_I2C4SRC RCC_D3CCIPR_I2C4SEL_HSI - -/* SPI123 clock source */ - -#define STM32_RCC_D2CCIP1R_SPI123SRC RCC_D2CCIP1R_SPI123SEL_PLL2 - -/* SPI45 clock source */ - -#define STM32_RCC_D2CCIP1R_SPI45SRC RCC_D2CCIP1R_SPI45SEL_PLL2 - -/* SPI6 clock source */ - -#define STM32_RCC_D3CCIPR_SPI6SRC RCC_D3CCIPR_SPI6SEL_PLL2 - -/* USB 1 and 2 clock source */ - -#define STM32_RCC_D2CCIP2R_USBSRC RCC_D2CCIP2R_USBSEL_PLL3 - -/* ADC 1 2 3 clock source */ - -#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2 - -/* FDCAN 1 2 clock source */ - -#define STM32_RCC_D2CCIP1R_FDCANSEL RCC_D2CCIP1R_FDCANSEL_HSE /* FDCAN 1 2 clock source */ - -#define STM32_FDCANCLK STM32_HSE_FREQUENCY - -/* FLASH wait states - * - * ------------ ---------- ----------- - * Vcore MAX ACLK WAIT STATES - * ------------ ---------- ----------- - * 1.15-1.26 V 70 MHz 0 - * (VOS1 level) 140 MHz 1 - * 210 MHz 2 - * 1.05-1.15 V 55 MHz 0 - * (VOS2 level) 110 MHz 1 - * 165 MHz 2 - * 220 MHz 3 - * 0.95-1.05 V 45 MHz 0 - * (VOS3 level) 90 MHz 1 - * 135 MHz 2 - * 180 MHz 3 - * 225 MHz 4 - * ------------ ---------- ----------- - */ - -#define BOARD_FLASH_WAITSTATES 2 - -/* SDMMC definitions ********************************************************/ - -/* Init 400kHz, freq = PLL1Q/(2*div) div = PLL1Q/(2*freq) */ - -#define STM32_SDMMC_INIT_CLKDIV (300 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* 25 MHz Max for now, 25 mHZ = PLL1Q/(2*div), div = PLL1Q/(2*freq) - * div = 4.8 = 240 / 50, So round up to 5 for default speed 24 MB/s - */ - -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_MMCXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_SDXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - -/* LED definitions ******************************************************************/ -/* The holybro KakuteH7 board has three, LED_GREEN a Green LED, LED_BLUE - * a Blue LED and LED_RED a Red LED, that can be controlled by software. - * - * If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any way. - * The following definitions are used to access individual LEDs. - */ - -/* LED index values for use with board_userled() */ - -#define BOARD_LED1 0 -#define BOARD_NLEDS 1 - -#define BOARD_LED_RED BOARD_LED1 - -/* LED bits for use with board_userled_all() */ - -#define BOARD_LED1_BIT (1 << BOARD_LED1) - -/* If CONFIG_ARCH_LEDS is defined, the usage by the board port is defined in - * include/board.h and src/stm32_leds.c. The LEDs are used to encode OS-related - * events as follows: - * - * - * SYMBOL Meaning LED state - * Red Green Blue - * ---------------------- -------------------------- ------ ------ ----*/ - -#define LED_STARTED 0 /* NuttX has been started OFF OFF OFF */ -#define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF OFF ON */ -#define LED_IRQSENABLED 2 /* Interrupts enabled OFF ON OFF */ -#define LED_STACKCREATED 3 /* Idle stack created OFF ON ON */ -#define LED_INIRQ 4 /* In an interrupt N/C N/C GLOW */ -#define LED_SIGNAL 5 /* In a signal handler N/C GLOW N/C */ -#define LED_ASSERTION 6 /* An assertion failed GLOW N/C GLOW */ -#define LED_PANIC 7 /* The system has crashed Blink OFF N/C */ -#define LED_IDLE 8 /* MCU is is sleep mode ON OFF OFF */ - -/* Thus if the Green LED is statically on, NuttX has successfully booted and - * is, apparently, running normally. If the Red LED is flashing at - * approximately 2Hz, then a fatal error has been detected and the system - * has halted. - */ - -/* Alternate function pin selections ************************************************/ - - -#define GPIO_USART1_RX GPIO_USART1_RX_2 /* PA10 */ -#define GPIO_USART1_TX GPIO_USART1_TX_2 /* PA9 */ - -#define GPIO_USART2_RX GPIO_USART2_RX_2 /* PD6 */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ - -#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ -#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ - -#define GPIO_UART4_RX GPIO_UART4_RX_5 /* PD0 */ -#define GPIO_UART4_TX GPIO_UART4_TX_5 /* PD1 */ - -#define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC7 */ -#define GPIO_USART6_TX GPIO_USART6_TX_1 /* PC6 */ - -#define GPIO_UART7_RX GPIO_UART7_RX_3 /* PE7 */ -#define GPIO_UART7_TX GPIO_UART7_TX_3 /* PE8 */ - -/* SPI - * SPI1 SD Card - * SPI2 is OSD AT7456E - * SPI4 is IMU - */ - -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 /* PA7 */ -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 /* PA5 */ - -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 /* PB14 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 /* PB15 */ -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_4 /* PB13 */ - -#define GPIO_SPI4_MISO GPIO_SPI4_MISO_2 /* PE5 */ -#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_2 /* PE6 */ -#define GPIO_SPI4_SCK GPIO_SPI4_SCK_2 /* PE2 */ - -/* I2C - */ - -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_1 /* PB6 */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_1 /* PB7 */ - -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN6) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN7) - -/* SDMMC1 - * - * VDD 3.3 - * GND - * SDMMC1_CK PC12 - * SDMMC1_CMD PD2 - * SDMMC1_D0 PC8 - * SDMMC1_D1 PC9 - * SDMMC1_D2 PC10 - * SDMMC1_D3 PC11 - * GPIO_SDMMC1_NCD PG0 - */ - -/* USB - * - * OTG_FS_DM PA11 - * OTG_FS_DP PA12 - * VBUS PA9 - */ - - -/* Board provides GPIO or other Hardware for signaling to timing analyzer */ - -# define PROBE_INIT(mask) -# define PROBE(n,s) -# define PROBE_MARK(n) - diff --git a/boards/holybro/kakuteh7mini/nuttx-config/include/board_dma_map.h b/boards/holybro/kakuteh7mini/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 1954ce3..0000000 --- a/boards/holybro/kakuteh7mini/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -#define DMAMAP_SPI4_RX DMAMAP_DMA12_SPI4RX_1 /* DMA2 */ -#define DMAMAP_SPI4_TX DMAMAP_DMA12_SPI4TX_1 /* DMA2 */ - -#define DMAMAP_USART2_RX DMAMAP_DMA12_USART2RX_1 /* DMA2 */ - diff --git a/boards/holybro/kakuteh7mini/nuttx-config/nsh/defconfig b/boards/holybro/kakuteh7mini/nuttx-config/nsh/defconfig deleted file mode 100644 index f40b0cc..0000000 --- a/boards/holybro/kakuteh7mini/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,246 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_SPI_CALLBACK is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/holybro/kakuteh7mini/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743II=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=512 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=95150 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0050 -CONFIG_CDCACM_PRODUCTSTR="PX4 KakuteH7Mini-nand" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x3162 -CONFIG_CDCACM_VENDORSTR="Holybro" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_MEMFAULT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXPERIMENTAL=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MM_REGIONS=4 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_PROGMEM=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_MMCSDSPIPORTNO=1 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32H7_ADC1=y -CONFIG_STM32H7_ADC3=y -CONFIG_STM32H7_BBSRAM=y -CONFIG_STM32H7_BBSRAM_FILES=5 -CONFIG_STM32H7_BDMA=y -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_DMA2=y -CONFIG_STM32H7_DMACAPABLE=y -CONFIG_STM32H7_FLOWCONTROL_BROKEN=y -CONFIG_STM32H7_I2C1=y -CONFIG_STM32H7_I2C_DYNTIMEO=y -CONFIG_STM32H7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_RTC=y -CONFIG_STM32H7_RTC_AUTO_LSECLOCK_START_DRV_CAPABILITY=y -CONFIG_STM32H7_RTC_MAGIC_REG=1 -CONFIG_STM32H7_SAVE_CRASHDUMP=y -CONFIG_STM32H7_SDMMC1=y -CONFIG_STM32H7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_SPI1=y -CONFIG_STM32H7_SPI2=y -CONFIG_STM32H7_SPI4=y -CONFIG_STM32H7_SPI4_DMA=y -CONFIG_STM32H7_SPI4_DMA_BUFFER=1024 -CONFIG_STM32H7_UART4=y -CONFIG_STM32H7_UART7=y -CONFIG_STM32H7_USART1=y -CONFIG_STM32H7_USART2=y -CONFIG_STM32H7_USART3=y -CONFIG_STM32H7_USART6=y -CONFIG_STM32H7_USART_BREAKS=y -CONFIG_STM32H7_USART_INVERT=y -CONFIG_STM32H7_USART_SINGLEWIRE=y -CONFIG_STM32H7_USART_SWAP=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGTSTP=y -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=2500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_SERIAL_CONSOLE=y -CONFIG_USART3_TXBUFSIZE=1500 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 -CONFIG_WATCHDOG=y diff --git a/boards/holybro/kakuteh7mini/nuttx-config/scripts/bootloader_script.ld b/boards/holybro/kakuteh7mini/nuttx-config/scripts/bootloader_script.ld deleted file mode 100644 index fc0a558..0000000 --- a/boards/holybro/kakuteh7mini/nuttx-config/scripts/bootloader_script.ld +++ /dev/null @@ -1,215 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016, 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The KakuteH7 uses an STM32H743VI has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743VI, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * The KakuteH7 has a switch on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the switch is - * depressed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743VI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The bootloader uses the first sector of the flash, which is 128K in length. - */ - -MEMORY -{ - itcm (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - flash (rx) : ORIGIN = 0x08000000, LENGTH = 128K - dtcm1 (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - dtcm2 (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - sram (rwx) : ORIGIN = 0x24000000, LENGTH = 512K - sram1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K - sram2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K - sram3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K - sram4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K - bbram (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/holybro/kakuteh7mini/nuttx-config/scripts/script.ld b/boards/holybro/kakuteh7mini/nuttx-config/scripts/script.ld deleted file mode 100644 index ae07f4b..0000000 --- a/boards/holybro/kakuteh7mini/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,228 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016, 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The KakuteH7 uses an STM32H743VI has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743VI, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * The KakuteH7 has a switch on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the switch is - * depressed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743VI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - FLASH (rx) : ORIGIN = 0x08020000, LENGTH = 1792K /* params in last sector */ - - DTCM1_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - DTCM2_RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */ - SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */ - SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */ - BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH - - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - - /* Pad out last section as the STM32H7 Flash write size is 256 bits. 32 bytes */ - . = ALIGN(16); - FILL(0xffff) - . += 16; - } > AXI_SRAM AT > FLASH = 0xffff - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > AXI_SRAM - - /* Emit the the D3 power domain section for locating BDMA data */ - - .sram4_reserve (NOLOAD) : - { - *(.sram4) - . = ALIGN(4); - _sram4_heap_start = ABSOLUTE(.); - } > SRAM4 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/holybro/kakuteh7mini/src/CMakeLists.txt b/boards/holybro/kakuteh7mini/src/CMakeLists.txt deleted file mode 100644 index 220642b..0000000 --- a/boards/holybro/kakuteh7mini/src/CMakeLists.txt +++ /dev/null @@ -1,67 +0,0 @@ -############################################################################ -# -# Copyright (c) 2016 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. -# -############################################################################ -if("${PX4_BOARD_LABEL}" STREQUAL "bootloader") - add_library(drivers_board - bootloader_main.c - usb.c - ) - target_link_libraries(drivers_board - PRIVATE - nuttx_arch # sdio - nuttx_drivers # sdio - bootloader - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/bootloader/common) - -else() - add_library(drivers_board - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - usb.c - ) - add_dependencies(drivers_board arch_board_hw_info) - - target_link_libraries(drivers_board - PRIVATE - arch_io_pins - arch_spi - arch_board_hw_info - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer - ) -endif() diff --git a/boards/holybro/kakuteh7mini/src/board_config.h b/boards/holybro/kakuteh7mini/src/board_config.h deleted file mode 100644 index d40bbb0..0000000 --- a/boards/holybro/kakuteh7mini/src/board_config.h +++ /dev/null @@ -1,217 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * holybro KakuteH7 internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ - -/* Configuration ************************************************************************************/ - -# define BOARD_HAS_USB_VALID 1 -# define BOARD_HAS_NBAT_V 1 -# define BOARD_HAS_NBAT_I 1 - -/* Holybro KakuteH7 GPIOs ************************************************************************/ - -/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */ - -#define GPIO_nLED_RED /* PC2 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN2) - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_OVERLOAD_LED LED_RED - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that - * can be used by the Px4 Firmware in the adc driver - */ - -/* ADC defines to be used in sensors.cpp to read from a particular channel */ - -#define ADC1_CH(n) (n) - -/* Define GPIO pins used as ADC N.B. Channel numbers must match below */ - -#define PX4_ADC_GPIO \ - /* PC0 */ GPIO_ADC123_INP10, \ - /* PC1 */ GPIO_ADC123_INP11, \ - /* PC5 */ GPIO_ADC12_INP8 - -/* Define Channel numbers must match above GPIO pin IN(n)*/ - -#define ADC_BATTERY_VOLTAGE_CHANNEL /* PC0 */ ADC1_CH(10) -#define ADC_BATTERY_CURRENT_CHANNEL /* PC1 */ ADC1_CH(11) -#define ADC_RSSI_IN_CHANNEL /* PC5 */ ADC1_CH(8) - -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY_CURRENT_CHANNEL) | \ - (1 << ADC_RSSI_IN_CHANNEL)) - -#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f) - - - -/* PWM - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 8 - -#define BOARD_NUM_IO_TIMERS 4 - - -/* Tone alarm output */ - -#define GPIO_TONE_ALARM_IDLE /* PC13 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN13) -#define GPIO_TONE_ALARM_GPIO /* PC13 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN13) - -/* USB OTG FS - * - * PA9 OTG_FS_VBUS VBUS sensing - */ -#define GPIO_OTGFS_VBUS /* PA8 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN8) - -/* High-resolution timer */ -#define HRT_TIMER 4 /* use timer3 for the HRT */ -#define HRT_TIMER_CHANNEL 1 /* use capture/compare channel 1 */ - -// So we can run CRSF on ttyS4, which corresponds to the TX6/RX6 pins -/* RC Serial port */ -#define RC_SERIAL_PORT "/dev/ttyS4" -#define BOARD_SUPPORTS_RC_SERIAL_PORT_OUTPUT - -/* PWM input driver. Use FMU AUX5 pins attached to timer4 channel 2 */ - -#define PWMIN_TIMER 5 -#define PWMIN_TIMER_CHANNEL /* T5C1 */ 1 -#define GPIO_PWM_IN /* PA0 */ GPIO_TIM5_CH1IN - -#define GPIO_RSSI_IN /* PC5 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTC|GPIO_PIN5) - -#define GPIO_RF_SWITCH /* PE13 */ (GPIO_OUTPUT|GPIO_PULLDOWN|GPIO_PORTE|GPIO_PIN13) - -#define GPIO_VTX_ON /* PB11 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN11) - -/* Power switch controls ******************************************************/ - -#define SDIO_SLOTNO 0 /* Only one slot */ -#define SDIO_MINOR 0 - -/* SD card bringup does not work if performed on the IDLE thread because it - * will cause waiting. Use either: - * - * CONFIG_LIB_BOARDCTL=y, OR - * CONFIG_BOARD_INITIALIZE=y && CONFIG_BOARD_INITTHREAD=y - */ - -#if defined(CONFIG_BOARD_INITIALIZE) && !defined(CONFIG_LIB_BOARDCTL) && \ - !defined(CONFIG_BOARD_INITTHREAD) -# warning SDIO initialization cannot be perfomed on the IDLE thread -#endif - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) - -/* Board never powers off the Servo rail */ - -#define BOARD_ADC_SERVO_VALID (1) - -#define BOARD_ADC_BRICK1_VALID (1) - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ - -#define BOARD_HAS_ON_RESET 1 - -#define PX4_GPIO_INIT_LIST { \ - PX4_ADC_GPIO, \ - GPIO_TONE_ALARM_IDLE, \ - GPIO_RSSI_IN, \ - GPIO_RF_SWITCH, \ - GPIO_VTX_ON, \ - } - -#define BOARD_ENABLE_CONSOLE_BUFFER - -#define FLASH_BASED_PARAMS - -__BEGIN_DECLS - -/**************************************************************************************************** - * Public Types - ****************************************************************************************************/ - -/**************************************************************************************************** - * Public data - ****************************************************************************************************/ - -#ifndef __ASSEMBLY__ - -/**************************************************************************************************** - * Public Functions - ****************************************************************************************************/ - -extern void stm32_spiinitialize(void); - -extern void stm32_usbinitialize(void); - -extern void board_peripheral_reset(int ms); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/holybro/kakuteh7mini/src/bootloader_main.c b/boards/holybro/kakuteh7mini/src/bootloader_main.c deleted file mode 100644 index 915b7f3..0000000 --- a/boards/holybro/kakuteh7mini/src/bootloader_main.c +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019, 2021 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. - * - ****************************************************************************/ - -/** - * @file bootloader_main.c - * - * FMU-specific early startup code for bootloader -*/ - -#include "board_config.h" -#include "bl.h" - -#include -#include -#include -#include -#include -#include "arm_internal.h" -#include - -extern int sercon_main(int c, char **argv); - -__EXPORT void board_on_reset(int status) {} - -__EXPORT void stm32_boardinitialize(void) -{ - /* configure USB interfaces */ - stm32_usbinitialize(); -} - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - return 0; -} - -void board_late_initialize(void) -{ - sercon_main(0, NULL); -} - -extern void sys_tick_handler(void); -void board_timerhook(void) -{ - sys_tick_handler(); -} diff --git a/boards/holybro/kakuteh7mini/src/hw_config.h b/boards/holybro/kakuteh7mini/src/hw_config.h deleted file mode 100644 index 1ad290f..0000000 --- a/boards/holybro/kakuteh7mini/src/hw_config.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - * hw_config.h - * - * Created on: May 17, 2015 - * Author: david_s5 - */ - -#ifndef HW_CONFIG_H_ -#define HW_CONFIG_H_ - -/**************************************************************************** - * 10-8--2016: - * To simplify the ripple effect on the tools, we will be using - * /dev/serial/by-id/PX4 to locate PX4 devices. Therefore - * moving forward all Bootloaders must contain the prefix "PX4 BL " - * in the USBDEVICESTRING - * This Change will be made in an upcoming BL release - ****************************************************************************/ -/* - * Define usage to configure a bootloader - * - * - * Constant example Usage - * APP_LOAD_ADDRESS 0x08004000 - The address in Linker Script, where the app fw is org-ed - * BOOTLOADER_DELAY 5000 - Ms to wait while under USB pwr or bootloader request - * BOARD_FMUV2 - * INTERFACE_USB 1 - (Optional) Scan and use the USB interface for bootloading - * INTERFACE_USART 1 - (Optional) Scan and use the Serial interface for bootloading - * USBDEVICESTRING "PX4 BL FMU v2.x" - USB id string - * USBPRODUCTID 0x0011 - PID Should match defconfig - * BOOT_DELAY_ADDRESS 0x000001a0 - (Optional) From the linker script from Linker Script to get a custom - * delay provided by an APP FW - * BOARD_TYPE 9 - Must match .prototype boad_id - * _FLASH_KBYTES (*(uint16_t *)0x1fff7a22) - Run time flash size detection - * BOARD_FLASH_SECTORS ((_FLASH_KBYTES == 0x400) ? 11 : 23) - Run time determine the physical last sector - * BOARD_FLASH_SECTORS 11 - Hard coded zero based last sector - * BOARD_FLASH_SIZE (_FLASH_KBYTES*1024)- Total Flash size of device, determined at run time. - * (1024 * 1024) - Hard coded Total Flash of device - The bootloader and app reserved will be deducted - * programmatically - * - * BOARD_FIRST_FLASH_SECTOR_TO_ERASE 2 - Optional sectors index in the flash_sectors table (F4 only), to begin erasing. - * This is to allow sectors to be reserved for app fw usage. That will NOT be erased - * during a FW upgrade. - * The default is 0, and selects the first sector to be erased, as the 0th entry in the - * flash_sectors table. Which is the second physical sector of FLASH in the device. - * The first physical sector of FLASH is used by the bootloader, and is not defined - * in the table. - * - * APP_RESERVATION_SIZE (BOARD_FIRST_FLASH_SECTOR_TO_ERASE * 16 * 1024) - Number of bytes reserved by the APP FW. This number plus - * BOOTLOADER_RESERVATION_SIZE will be deducted from - * BOARD_FLASH_SIZE to determine the size of the App FW - * and hence the address space of FLASH to erase and program. - * USBMFGSTRING "PX4 AP" - Optional USB MFG string (default is '3D Robotics' if not defined.) - * SERIAL_BREAK_DETECT_DISABLED - Optional prevent break selection on Serial port from entering or staying in BL - * - * * Other defines are somewhat self explanatory. - */ - -/* Boot device selection list*/ -#define USB0_DEV 0x01 -#define SERIAL0_DEV 0x02 -#define SERIAL1_DEV 0x04 - -#define APP_LOAD_ADDRESS 0x08020000 -#define BOOTLOADER_DELAY 3000 -#define INTERFACE_USB 1 -#define INTERFACE_USB_CONFIG "/dev/ttyACM0" -#define BOARD_VBUS MK_GPIO_INPUT(GPIO_OTGFS_VBUS) - -//#define USE_VBUS_PULL_DOWN -#define BOOT_DELAY_ADDRESS 0x000001a0 -#define BOARD_TYPE 1054 -#define BOARD_FLASH_SECTORS (14) -#define BOARD_FLASH_SIZE (16 * 128 * 1024) -#define APP_RESERVATION_SIZE (1 * 128 * 1024) - -#define OSC_FREQ 8 - -#define BOARD_PIN_LED_ACTIVITY GPIO_nLED_RED -#define BOARD_LED_ON 0 -#define BOARD_LED_OFF 1 - -#define SERIAL_BREAK_DETECT_DISABLED 1 - -/* - * Uncommenting this allows to force the bootloader through - * a PWM output pin. As this can accidentally initialize - * an ESC prematurely, it is not recommended. This feature - * has not been used and hence defaults now to off. - * - * # define BOARD_FORCE_BL_PIN_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN14) - * # define BOARD_FORCE_BL_PIN_IN (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN11) - * - * # define BOARD_POWER_PIN_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN4) - * # define BOARD_POWER_ON 1 - * # define BOARD_POWER_OFF 0 - * # undef BOARD_POWER_PIN_RELEASE // Leave pin enabling Power - un comment to release (disable power) - * -*/ - -#if !defined(ARCH_SN_MAX_LENGTH) -# define ARCH_SN_MAX_LENGTH 12 -#endif - -#if !defined(APP_RESERVATION_SIZE) -# define APP_RESERVATION_SIZE 0 -#endif - -#if !defined(BOARD_FIRST_FLASH_SECTOR_TO_ERASE) -# define BOARD_FIRST_FLASH_SECTOR_TO_ERASE 1 -#endif - -#if !defined(USB_DATA_ALIGN) -# define USB_DATA_ALIGN -#endif - -#ifndef BOOT_DEVICES_SELECTION -# define BOOT_DEVICES_SELECTION USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif - -#ifndef BOOT_DEVICES_FILTER_ONUSB -# define BOOT_DEVICES_FILTER_ONUSB USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif - -#endif /* HW_CONFIG_H_ */ diff --git a/boards/holybro/kakuteh7mini/src/i2c.cpp b/boards/holybro/kakuteh7mini/src/i2c.cpp deleted file mode 100644 index e9f26f9..0000000 --- a/boards/holybro/kakuteh7mini/src/i2c.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), -}; diff --git a/boards/holybro/kakuteh7mini/src/init.c b/boards/holybro/kakuteh7mini/src/init.c deleted file mode 100644 index c8f19df..0000000 --- a/boards/holybro/kakuteh7mini/src/init.c +++ /dev/null @@ -1,261 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-2019 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * PX4FMU-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include "board_config.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -# if defined(FLASH_BASED_PARAMS) -# include -#endif - - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* Configuration ************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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(); - - /* Turn bluetooth off by default (no mavlink support yet) */ - px4_arch_gpiowrite(GPIO_RF_SWITCH, 0); - - /* configure USB interfaces */ - - stm32_usbinitialize(); - -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Power on Interfaces */ - board_control_spi_sensors_power(true, 0xffff); - - /* Need hrt running before using the ADC */ - - px4_platform_init(); - - /* configure SPI interfaces */ - - stm32_spiinitialize(); - - /* configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - - // MARK: this will *not* work as the minis have a W25N NAND flash chip - /* Get the SPI port for the microSD slot */ - struct spi_dev_s *spi_dev = stm32_spibus_initialize(CONFIG_NSH_MMCSDSPIPORTNO); - - if (!spi_dev) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", CONFIG_NSH_MMCSDSPIPORTNO); - led_on(LED_BLUE); - } - - up_udelay(20); - -#if defined(FLASH_BASED_PARAMS) - static sector_descriptor_t params_sector_map[] = { - {15, 128 * 1024, 0x081E0000}, - {0, 0, 0}, - }; - - /* Initialize the flashfs layer to use heap allocated memory */ - int result = parameter_flashfs_init(params_sector_map, NULL, 0); - - if (result != OK) { - syslog(LOG_ERR, "[boot] FAILED to init params in FLASH %d\n", result); - led_on(LED_AMBER); - } - -#endif - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/holybro/kakuteh7mini/src/led.c b/boards/holybro/kakuteh7mini/src/led.c deleted file mode 100644 index 945c383..0000000 --- a/boards/holybro/kakuteh7mini/src/led.c +++ /dev/null @@ -1,223 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013 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 - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -#ifdef CONFIG_ARCH_LEDS -static bool nuttx_owns_leds = true; -// B R S G -// 0 1 2 3 -static const uint8_t xlatpx4[] = {1, 2, 4, 0}; -# define xlat(p) xlatpx4[(p)] -static uint32_t g_ledmap[] = { - GPIO_nLED_RED, // Indexed by BOARD_LED_RED -}; - -#else - -# define xlat(p) (p) -static uint32_t g_ledmap[] = { - GPIO_nLED_RED, // Indexed by LED_RED, LED_AMBER -}; - -#endif - -__EXPORT void led_init(void) -{ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - if (g_ledmap[l] != 0) { - stm32_configgpio(g_ledmap[l]); - } - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - - if (g_ledmap[led] != 0) { - stm32_gpiowrite(g_ledmap[led], !state); - } -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - if (g_ledmap[led] != 0) { - return !stm32_gpioread(g_ledmap[led]); - } - - return false; -} - -__EXPORT void led_on(int led) -{ - phy_set_led(xlat(led), true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(xlat(led), false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(xlat(led), !phy_get_led(xlat(led))); -} - -#ifdef CONFIG_ARCH_LEDS -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_autoled_initialize - ****************************************************************************/ - -void board_autoled_initialize(void) -{ - led_init(); -} - -/**************************************************************************** - * Name: board_autoled_on - ****************************************************************************/ - -void board_autoled_on(int led) -{ - if (!nuttx_owns_leds) { - return; - } - - switch (led) { - default: - break; - - case LED_HEAPALLOCATE: - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_IRQSENABLED: - phy_set_led(BOARD_LED_BLUE, false); - phy_set_led(BOARD_LED_GREEN, true); - break; - - case LED_STACKCREATED: - phy_set_led(BOARD_LED_GREEN, true); - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_INIRQ: - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_SIGNAL: - phy_set_led(BOARD_LED_GREEN, true); - break; - - case LED_ASSERTION: - phy_set_led(BOARD_LED_RED, true); - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_PANIC: - phy_set_led(BOARD_LED_RED, true); - break; - - case LED_IDLE : /* IDLE */ - phy_set_led(BOARD_LED_RED, true); - break; - } -} - -/**************************************************************************** - * Name: board_autoled_off - ****************************************************************************/ - -void board_autoled_off(int led) -{ - if (!nuttx_owns_leds) { - return; - } - - switch (led) { - default: - break; - - case LED_SIGNAL: - phy_set_led(BOARD_LED_GREEN, false); - break; - - case LED_INIRQ: - phy_set_led(BOARD_LED_BLUE, false); - break; - - case LED_ASSERTION: - phy_set_led(BOARD_LED_RED, false); - phy_set_led(BOARD_LED_BLUE, false); - break; - - case LED_PANIC: - phy_set_led(BOARD_LED_RED, false); - break; - - case LED_IDLE : /* IDLE */ - phy_set_led(BOARD_LED_RED, false); - break; - } -} - -#endif /* CONFIG_ARCH_LEDS */ diff --git a/boards/holybro/kakuteh7mini/src/spi.cpp b/boards/holybro/kakuteh7mini/src/spi.cpp deleted file mode 100644 index 1f47a54..0000000 --- a/boards/holybro/kakuteh7mini/src/spi.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020, 2021 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(SPIDEV_MMCSD(0), SPI::CS{GPIO::PortA, GPIO::Pin4}) - }), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_OSD_DEVTYPE_ATXXXX, SPI::CS{GPIO::PortB, GPIO::Pin12}), - }), - initSPIBus(SPI::Bus::SPI4, { - // - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer3, DMA{DMA::Index1}), - initIOTimer(Timer::Timer2, DMA{DMA::Index1}), - initIOTimer(Timer::Timer5, DMA{DMA::Index1}), - initIOTimer(Timer::Timer8, DMA{DMA::Index1}), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel3}, {GPIO::PortB, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel4}, {GPIO::PortB, GPIO::Pin1}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel2}, {GPIO::PortB, GPIO::Pin3}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel3}, {GPIO::PortB, GPIO::Pin10}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel1}, {GPIO::PortA, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel3}, {GPIO::PortA, GPIO::Pin2}), - initIOTimerChannel(io_timers, {Timer::Timer8, Timer::Channel3}, {GPIO::PortC, GPIO::Pin8}), - initIOTimerChannel(io_timers, {Timer::Timer8, Timer::Channel4}, {GPIO::PortC, GPIO::Pin9}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/holybro/kakuteh7mini/src/usb.c b/boards/holybro/kakuteh7mini/src/usb.c deleted file mode 100644 index 6d42476..0000000 --- a/boards/holybro/kakuteh7mini/src/usb.c +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016 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. - * - ****************************************************************************/ - -/** - * @file px4fmu_usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#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_STM32H7_OTGFS - stm32_configgpio(GPIO_OTGFS_VBUS); -#endif -} - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/holybro/kakuteh7v2/bootloader.px4board b/boards/holybro/kakuteh7v2/bootloader.px4board deleted file mode 100644 index 19b6e66..0000000 --- a/boards/holybro/kakuteh7v2/bootloader.px4board +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_ROMFSROOT="" diff --git a/boards/holybro/kakuteh7v2/default.px4board b/boards/holybro/kakuteh7v2/default.px4board deleted file mode 100644 index d326a78..0000000 --- a/boards/holybro/kakuteh7v2/default.px4board +++ /dev/null @@ -1,87 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS3" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS0" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS1" -CONFIG_BOARD_SERIAL_RC="/dev/ttyS4" -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_COMMON_BAROMETERS=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_BOSCH_BMI270=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20689=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU6000=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/holybro/kakuteh7v2/extras/holybro_kakuteh7v2_bootloader.bin b/boards/holybro/kakuteh7v2/extras/holybro_kakuteh7v2_bootloader.bin deleted file mode 100755 index 7ed8c65..0000000 Binary files a/boards/holybro/kakuteh7v2/extras/holybro_kakuteh7v2_bootloader.bin and /dev/null differ diff --git a/boards/holybro/kakuteh7v2/firmware.prototype b/boards/holybro/kakuteh7v2/firmware.prototype deleted file mode 100644 index 8a69c40..0000000 --- a/boards/holybro/kakuteh7v2/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 1053, - "magic": "PX4FWv1", - "description": "Firmware for the KakuteH7v2 board", - "image": "", - "build_time": 0, - "summary": "KAKUTEH7V2", - "version": "0.1", - "image_size": 0, - "image_maxsize": 1835008, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/holybro/kakuteh7v2/init/rc.board_defaults b/boards/holybro/kakuteh7v2/init/rc.board_defaults deleted file mode 100644 index 4503905..0000000 --- a/boards/holybro/kakuteh7v2/init/rc.board_defaults +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -# transision from params file to flash-based params (2022-08) -if [ -f $PARAM_FILE ] -then - param load $PARAM_FILE - param save - # create a backup - mv $PARAM_FILE ${PARAM_FILE}.bak - reboot -fi - -param set-default BAT1_V_DIV 11.2 -param set-default BAT1_A_PER_V 59.5 - -# system_power unavailable -param set-default CBRK_SUPPLY_CHK 894281 - -# Select the Generic 250 Racer by default -param set-default SYS_AUTOSTART 4050 - -# use EKF2 without mag -param set-default SYS_HAS_MAG 0 -# and enable gravity fusion -param set-default EKF2_IMU_CONTROL 7 - -# the startup tune is not great on a binary output buzzer, so disable it -param set-default CBRK_BUZZER 782090 - -param set-default IMU_GYRO_RATEMAX 2000 - -# Store missions in RAM -param set-default SYS_DM_BACKEND 1 - -# Ignore that there is no SD card -param set-default COM_ARM_SDCARD 0 - -# Don't try to log onto SD card -param set-default SDLOG_MODE -1 diff --git a/boards/holybro/kakuteh7v2/init/rc.board_extras b/boards/holybro/kakuteh7v2/init/rc.board_extras deleted file mode 100644 index 256633f..0000000 --- a/boards/holybro/kakuteh7v2/init/rc.board_extras +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# -# KakuteH7 specific board extras init -#------------------------------------------------------------------------------ - -if ! param compare OSD_ATXXXX_CFG 0 -then - atxxxx start -s -fi - -# DShot telemetry is always on UART7 -dshot telemetry /dev/ttyS5 - diff --git a/boards/holybro/kakuteh7v2/init/rc.board_sensors b/boards/holybro/kakuteh7v2/init/rc.board_sensors deleted file mode 100644 index 221983e..0000000 --- a/boards/holybro/kakuteh7v2/init/rc.board_sensors +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# -# Holybro KakuteH7v2 specific board sensors init -#------------------------------------------------------------------------------ -board_adc start - -bmi270 -s start - -bmp280 -X start diff --git a/boards/holybro/kakuteh7v2/nuttx-config/bootloader/defconfig b/boards/holybro/kakuteh7v2/nuttx-config/bootloader/defconfig deleted file mode 100644 index 0f46c66..0000000 --- a/boards/holybro/kakuteh7v2/nuttx-config/bootloader/defconfig +++ /dev/null @@ -1,89 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_CONSOLE is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_SPI_EXCHANGE is not set -# CONFIG_STM32H7_SYSCFG is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/holybro/kakuteh7v2/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743VI=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=512 -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_INITTHREAD_PRIORITY=254 -CONFIG_BOARD_LATE_INITIALIZE=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0050 -CONFIG_CDCACM_PRODUCTSTR="PX4 BL Holybro KakuteH7v2" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x3162 -CONFIG_CDCACM_VENDORSTR="Holybro" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEFAULT_SMALL=y -CONFIG_EXPERIMENTAL=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="bootloader_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SPI=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_USART3=y -CONFIG_SYSTEMTICK_HOOK=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGINT_CHAR=0x03 -CONFIG_TTY_SIGTSTP=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/holybro/kakuteh7v2/nuttx-config/include/board.h b/boards/holybro/kakuteh7v2/nuttx-config/include/board.h deleted file mode 100644 index 83245ff..0000000 --- a/boards/holybro/kakuteh7v2/nuttx-config/include/board.h +++ /dev/null @@ -1,419 +0,0 @@ -/************************************************************************************ - * - * Copyright (C) 2016-2019 Gregory Nutt. 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 NuttX 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. - * - ************************************************************************************/ -#pragma once - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The holybro KakuteH7 board provides the following clock sources: - * - * X1: 8 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 16 MHz RC factory-trimmed - * HSE: 8 MHz crystal for HSE - */ - -#define STM32_BOARD_XTAL 8000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 32768 - -/* Main PLL Configuration. - * - * PLL source is HSE = 8,000,000 - * - * PLL_VCOx = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 1 <= PLLM <= 63 - * 4 <= PLLN <= 512 - * 150 MHz <= PLL_VCOL <= 420MHz - * 192 MHz <= PLL_VCOH <= 836MHz - * - * SYSCLK = PLL_VCO / PLLP - * CPUCLK = SYSCLK / D1CPRE - * Subject to - * - * PLLP1 = {2, 4, 6, 8, ..., 128} - * PLLP2,3 = {2, 3, 4, ..., 128} - * CPUCLK <= 480 MHz - */ - -#define STM32_BOARD_USEHSE - -#define STM32_PLLCFG_PLLSRC RCC_PLLCKSELR_PLLSRC_HSE - -/* PLL1, wide 4 - 8 MHz input, enable DIVP, DIVQ, DIVR - * - * PLL1_VCO = (8,000,000 / 1) * 120 = 960 MHz - * - * PLL1P = PLL1_VCO/2 = 960 MHz / 2 = 480 MHz - * PLL1Q = PLL1_VCO/4 = 960 MHz / 4 = 240 MHz - * PLL1R = PLL1_VCO/8 = 960 MHz / 8 = 120 MHz - */ - -#define STM32_PLLCFG_PLL1CFG (RCC_PLLCFGR_PLL1VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL1RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVP1EN | \ - RCC_PLLCFGR_DIVQ1EN | \ - RCC_PLLCFGR_DIVR1EN) -#define STM32_PLLCFG_PLL1M RCC_PLLCKSELR_DIVM1(1) -#define STM32_PLLCFG_PLL1N RCC_PLL1DIVR_N1(120) -#define STM32_PLLCFG_PLL1P RCC_PLL1DIVR_P1(2) -#define STM32_PLLCFG_PLL1Q RCC_PLL1DIVR_Q1(4) -#define STM32_PLLCFG_PLL1R RCC_PLL1DIVR_R1(8) - -#define STM32_VCO1_FREQUENCY ((STM32_HSE_FREQUENCY / 1) * 120) -#define STM32_PLL1P_FREQUENCY (STM32_VCO1_FREQUENCY / 2) -#define STM32_PLL1Q_FREQUENCY (STM32_VCO1_FREQUENCY / 4) -#define STM32_PLL1R_FREQUENCY (STM32_VCO1_FREQUENCY / 8) - -/* PLL2 */ - -#define STM32_PLLCFG_PLL2CFG (RCC_PLLCFGR_PLL2VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL2RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVP2EN | \ - RCC_PLLCFGR_DIVQ2EN | \ - RCC_PLLCFGR_DIVR2EN) -#define STM32_PLLCFG_PLL2M RCC_PLLCKSELR_DIVM2(2) -#define STM32_PLLCFG_PLL2N RCC_PLL2DIVR_N2(48) -#define STM32_PLLCFG_PLL2P RCC_PLL2DIVR_P2(2) -#define STM32_PLLCFG_PLL2Q RCC_PLL2DIVR_Q2(2) -#define STM32_PLLCFG_PLL2R RCC_PLL2DIVR_R2(2) - -#define STM32_VCO2_FREQUENCY ((STM32_HSE_FREQUENCY / 2) * 48) -#define STM32_PLL2P_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2Q_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2R_FREQUENCY (STM32_VCO2_FREQUENCY / 2) - -/* PLL3 */ - -#define STM32_PLLCFG_PLL3CFG (RCC_PLLCFGR_PLL3VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL3RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVQ3EN) -#define STM32_PLLCFG_PLL3M RCC_PLLCKSELR_DIVM3(2) -#define STM32_PLLCFG_PLL3N RCC_PLL3DIVR_N3(48) -#define STM32_PLLCFG_PLL3P RCC_PLL3DIVR_P3(2) -#define STM32_PLLCFG_PLL3Q RCC_PLL3DIVR_Q3(4) -#define STM32_PLLCFG_PLL3R RCC_PLL3DIVR_R3(2) - -#define STM32_VCO3_FREQUENCY ((STM32_HSE_FREQUENCY / 2) * 48) -#define STM32_PLL3P_FREQUENCY (STM32_VCO3_FREQUENCY / 2) -#define STM32_PLL3Q_FREQUENCY (STM32_VCO3_FREQUENCY / 4) -#define STM32_PLL3R_FREQUENCY (STM32_VCO3_FREQUENCY / 2) - -/* SYSCLK = PLL1P = 480MHz - * CPUCLK = SYSCLK / 1 = 480 MHz - */ - -#define STM32_RCC_D1CFGR_D1CPRE (RCC_D1CFGR_D1CPRE_SYSCLK) -#define STM32_SYSCLK_FREQUENCY (STM32_PLL1P_FREQUENCY) -#define STM32_CPUCLK_FREQUENCY (STM32_SYSCLK_FREQUENCY / 1) - -/* Configure Clock Assignments */ - -/* AHB clock (HCLK) is SYSCLK/2 (240 MHz max) - * HCLK1 = HCLK2 = HCLK3 = HCLK4 = 240 - */ - -#define STM32_RCC_D1CFGR_HPRE RCC_D1CFGR_HPRE_SYSCLKd2 /* HCLK = SYSCLK / 2 */ -#define STM32_ACLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* ACLK in D1, HCLK3 in D1 */ -#define STM32_HCLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* HCLK in D2, HCLK4 in D3 */ -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D2CFGR_D2PPRE1 RCC_D2CFGR_D2PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB2 clock (PCLK2) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D2CFGR_D2PPRE2 RCC_D2CFGR_D2PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB3 clock (PCLK3) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D1CFGR_D1PPRE RCC_D1CFGR_D1PPRE_HCLKd2 /* PCLK3 = HCLK / 2 */ -#define STM32_PCLK3_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB4 clock (PCLK4) is HCLK/4 (120 MHz) */ - -#define STM32_RCC_D3CFGR_D3PPRE RCC_D3CFGR_D3PPRE_HCLKd2 /* PCLK4 = HCLK / 2 */ -#define STM32_PCLK4_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timer clock frequencies */ - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM15_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM16_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM17_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Kernel Clock Configuration - * - * Note: look at Table 54 in ST Manual - */ - -/* I2C123 clock source */ - -#define STM32_RCC_D2CCIP2R_I2C123SRC RCC_D2CCIP2R_I2C123SEL_HSI - -/* I2C4 clock source */ - -#define STM32_RCC_D3CCIPR_I2C4SRC RCC_D3CCIPR_I2C4SEL_HSI - -/* SPI123 clock source */ - -#define STM32_RCC_D2CCIP1R_SPI123SRC RCC_D2CCIP1R_SPI123SEL_PLL2 - -/* SPI45 clock source */ - -#define STM32_RCC_D2CCIP1R_SPI45SRC RCC_D2CCIP1R_SPI45SEL_PLL2 - -/* SPI6 clock source */ - -#define STM32_RCC_D3CCIPR_SPI6SRC RCC_D3CCIPR_SPI6SEL_PLL2 - -/* USB 1 and 2 clock source */ - -#define STM32_RCC_D2CCIP2R_USBSRC RCC_D2CCIP2R_USBSEL_PLL3 - -/* ADC 1 2 3 clock source */ - -#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2 - -/* FDCAN 1 2 clock source */ - -#define STM32_RCC_D2CCIP1R_FDCANSEL RCC_D2CCIP1R_FDCANSEL_HSE /* FDCAN 1 2 clock source */ - -#define STM32_FDCANCLK STM32_HSE_FREQUENCY - -/* FLASH wait states - * - * ------------ ---------- ----------- - * Vcore MAX ACLK WAIT STATES - * ------------ ---------- ----------- - * 1.15-1.26 V 70 MHz 0 - * (VOS1 level) 140 MHz 1 - * 210 MHz 2 - * 1.05-1.15 V 55 MHz 0 - * (VOS2 level) 110 MHz 1 - * 165 MHz 2 - * 220 MHz 3 - * 0.95-1.05 V 45 MHz 0 - * (VOS3 level) 90 MHz 1 - * 135 MHz 2 - * 180 MHz 3 - * 225 MHz 4 - * ------------ ---------- ----------- - */ - -#define BOARD_FLASH_WAITSTATES 2 - -/* SDMMC definitions ********************************************************/ - -/* Init 400kHz, freq = PLL1Q/(2*div) div = PLL1Q/(2*freq) */ - -#define STM32_SDMMC_INIT_CLKDIV (300 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* 25 MHz Max for now, 25 mHZ = PLL1Q/(2*div), div = PLL1Q/(2*freq) - * div = 4.8 = 240 / 50, So round up to 5 for default speed 24 MB/s - */ - -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_MMCXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_SDXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - -/* LED definitions ******************************************************************/ -/* The holybro KakuteH7 board has three, LED_GREEN a Green LED, LED_BLUE - * a Blue LED and LED_RED a Red LED, that can be controlled by software. - * - * If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any way. - * The following definitions are used to access individual LEDs. - */ - -/* LED index values for use with board_userled() */ - -#define BOARD_LED1 0 -#define BOARD_NLEDS 1 - -#define BOARD_LED_RED BOARD_LED1 - -/* LED bits for use with board_userled_all() */ - -#define BOARD_LED1_BIT (1 << BOARD_LED1) - -/* If CONFIG_ARCH_LEDS is defined, the usage by the board port is defined in - * include/board.h and src/stm32_leds.c. The LEDs are used to encode OS-related - * events as follows: - * - * - * SYMBOL Meaning LED state - * Red Green Blue - * ---------------------- -------------------------- ------ ------ ----*/ - -#define LED_STARTED 0 /* NuttX has been started OFF OFF OFF */ -#define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF OFF ON */ -#define LED_IRQSENABLED 2 /* Interrupts enabled OFF ON OFF */ -#define LED_STACKCREATED 3 /* Idle stack created OFF ON ON */ -#define LED_INIRQ 4 /* In an interrupt N/C N/C GLOW */ -#define LED_SIGNAL 5 /* In a signal handler N/C GLOW N/C */ -#define LED_ASSERTION 6 /* An assertion failed GLOW N/C GLOW */ -#define LED_PANIC 7 /* The system has crashed Blink OFF N/C */ -#define LED_IDLE 8 /* MCU is is sleep mode ON OFF OFF */ - -/* Thus if the Green LED is statically on, NuttX has successfully booted and - * is, apparently, running normally. If the Red LED is flashing at - * approximately 2Hz, then a fatal error has been detected and the system - * has halted. - */ - -/* Alternate function pin selections ************************************************/ - - -#define GPIO_USART1_RX GPIO_USART1_RX_2 /* PA10 */ -#define GPIO_USART1_TX GPIO_USART1_TX_2 /* PA9 */ - -#define GPIO_USART2_RX GPIO_USART2_RX_2 /* PD6 */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ - -#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ -#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ - -#define GPIO_UART4_RX GPIO_UART4_RX_5 /* PD0 */ -#define GPIO_UART4_TX GPIO_UART4_TX_5 /* PD1 */ - -#define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC7 */ -#define GPIO_USART6_TX GPIO_USART6_TX_1 /* PC6 */ - -#define GPIO_UART7_RX GPIO_UART7_RX_3 /* PE7 */ -#define GPIO_UART7_TX GPIO_UART7_TX_3 /* PE8 */ - -/* SPI - * SPI1 SD Card - * SPI2 is OSD AT7456E - * SPI4 is IMU - */ - -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 /* PA7 */ -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 /* PA5 */ - -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 /* PB14 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 /* PB15 */ -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_4 /* PB13 */ - -#define GPIO_SPI4_MISO GPIO_SPI4_MISO_2 /* PE5 */ -#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_2 /* PE6 */ -#define GPIO_SPI4_SCK GPIO_SPI4_SCK_2 /* PE2 */ - -/* I2C - */ - -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_1 /* PB6 */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_1 /* PB7 */ - -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN6) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN7) - -/* SDMMC1 - * - * VDD 3.3 - * GND - * SDMMC1_CK PC12 - * SDMMC1_CMD PD2 - * SDMMC1_D0 PC8 - * SDMMC1_D1 PC9 - * SDMMC1_D2 PC10 - * SDMMC1_D3 PC11 - * GPIO_SDMMC1_NCD PG0 - */ - -/* USB - * - * OTG_FS_DM PA11 - * OTG_FS_DP PA12 - * VBUS PA9 - */ - - -/* Board provides GPIO or other Hardware for signaling to timing analyzer */ - -# define PROBE_INIT(mask) -# define PROBE(n,s) -# define PROBE_MARK(n) - diff --git a/boards/holybro/kakuteh7v2/nuttx-config/include/board_dma_map.h b/boards/holybro/kakuteh7v2/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 1954ce3..0000000 --- a/boards/holybro/kakuteh7v2/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -#define DMAMAP_SPI4_RX DMAMAP_DMA12_SPI4RX_1 /* DMA2 */ -#define DMAMAP_SPI4_TX DMAMAP_DMA12_SPI4TX_1 /* DMA2 */ - -#define DMAMAP_USART2_RX DMAMAP_DMA12_USART2RX_1 /* DMA2 */ - diff --git a/boards/holybro/kakuteh7v2/nuttx-config/nsh/defconfig b/boards/holybro/kakuteh7v2/nuttx-config/nsh/defconfig deleted file mode 100644 index 8ac32ef..0000000 --- a/boards/holybro/kakuteh7v2/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,246 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_SPI_CALLBACK is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/holybro/kakuteh7v2/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743II=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=512 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=95150 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0050 -CONFIG_CDCACM_PRODUCTSTR="PX4 KakuteH7v2" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x3162 -CONFIG_CDCACM_VENDORSTR="Holybro" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_MEMFAULT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXPERIMENTAL=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MM_REGIONS=4 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_PROGMEM=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_MMCSDSPIPORTNO=1 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32H7_ADC1=y -CONFIG_STM32H7_ADC3=y -CONFIG_STM32H7_BBSRAM=y -CONFIG_STM32H7_BBSRAM_FILES=5 -CONFIG_STM32H7_BDMA=y -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_DMA2=y -CONFIG_STM32H7_DMACAPABLE=y -CONFIG_STM32H7_FLOWCONTROL_BROKEN=y -CONFIG_STM32H7_I2C1=y -CONFIG_STM32H7_I2C_DYNTIMEO=y -CONFIG_STM32H7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_RTC=y -CONFIG_STM32H7_RTC_AUTO_LSECLOCK_START_DRV_CAPABILITY=y -CONFIG_STM32H7_RTC_MAGIC_REG=1 -CONFIG_STM32H7_SAVE_CRASHDUMP=y -CONFIG_STM32H7_SDMMC1=y -CONFIG_STM32H7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_SPI1=y -CONFIG_STM32H7_SPI2=y -CONFIG_STM32H7_SPI4=y -CONFIG_STM32H7_SPI4_DMA=y -CONFIG_STM32H7_SPI4_DMA_BUFFER=1024 -CONFIG_STM32H7_UART4=y -CONFIG_STM32H7_UART7=y -CONFIG_STM32H7_USART1=y -CONFIG_STM32H7_USART2=y -CONFIG_STM32H7_USART3=y -CONFIG_STM32H7_USART6=y -CONFIG_STM32H7_USART_BREAKS=y -CONFIG_STM32H7_USART_INVERT=y -CONFIG_STM32H7_USART_SINGLEWIRE=y -CONFIG_STM32H7_USART_SWAP=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGTSTP=y -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=2500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_SERIAL_CONSOLE=y -CONFIG_USART3_TXBUFSIZE=1500 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 -CONFIG_WATCHDOG=y diff --git a/boards/holybro/kakuteh7v2/nuttx-config/scripts/bootloader_script.ld b/boards/holybro/kakuteh7v2/nuttx-config/scripts/bootloader_script.ld deleted file mode 100644 index fc0a558..0000000 --- a/boards/holybro/kakuteh7v2/nuttx-config/scripts/bootloader_script.ld +++ /dev/null @@ -1,215 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016, 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The KakuteH7 uses an STM32H743VI has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743VI, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * The KakuteH7 has a switch on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the switch is - * depressed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743VI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The bootloader uses the first sector of the flash, which is 128K in length. - */ - -MEMORY -{ - itcm (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - flash (rx) : ORIGIN = 0x08000000, LENGTH = 128K - dtcm1 (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - dtcm2 (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - sram (rwx) : ORIGIN = 0x24000000, LENGTH = 512K - sram1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K - sram2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K - sram3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K - sram4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K - bbram (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/holybro/kakuteh7v2/nuttx-config/scripts/script.ld b/boards/holybro/kakuteh7v2/nuttx-config/scripts/script.ld deleted file mode 100644 index ae07f4b..0000000 --- a/boards/holybro/kakuteh7v2/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,228 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016, 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The KakuteH7 uses an STM32H743VI has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743VI, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * The KakuteH7 has a switch on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the switch is - * depressed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743VI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - FLASH (rx) : ORIGIN = 0x08020000, LENGTH = 1792K /* params in last sector */ - - DTCM1_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - DTCM2_RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */ - SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */ - SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */ - BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH - - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - - /* Pad out last section as the STM32H7 Flash write size is 256 bits. 32 bytes */ - . = ALIGN(16); - FILL(0xffff) - . += 16; - } > AXI_SRAM AT > FLASH = 0xffff - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > AXI_SRAM - - /* Emit the the D3 power domain section for locating BDMA data */ - - .sram4_reserve (NOLOAD) : - { - *(.sram4) - . = ALIGN(4); - _sram4_heap_start = ABSOLUTE(.); - } > SRAM4 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/holybro/kakuteh7v2/src/CMakeLists.txt b/boards/holybro/kakuteh7v2/src/CMakeLists.txt deleted file mode 100644 index 220642b..0000000 --- a/boards/holybro/kakuteh7v2/src/CMakeLists.txt +++ /dev/null @@ -1,67 +0,0 @@ -############################################################################ -# -# Copyright (c) 2016 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. -# -############################################################################ -if("${PX4_BOARD_LABEL}" STREQUAL "bootloader") - add_library(drivers_board - bootloader_main.c - usb.c - ) - target_link_libraries(drivers_board - PRIVATE - nuttx_arch # sdio - nuttx_drivers # sdio - bootloader - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/bootloader/common) - -else() - add_library(drivers_board - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - usb.c - ) - add_dependencies(drivers_board arch_board_hw_info) - - target_link_libraries(drivers_board - PRIVATE - arch_io_pins - arch_spi - arch_board_hw_info - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer - ) -endif() diff --git a/boards/holybro/kakuteh7v2/src/board_config.h b/boards/holybro/kakuteh7v2/src/board_config.h deleted file mode 100644 index c8ec2fa..0000000 --- a/boards/holybro/kakuteh7v2/src/board_config.h +++ /dev/null @@ -1,216 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * holybro KakuteH7 internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ - -/* Configuration ************************************************************************************/ - -# define BOARD_HAS_USB_VALID 1 -# define BOARD_HAS_NBAT_V 1 -# define BOARD_HAS_NBAT_I 1 - -/* Holybro KakuteH7 GPIOs ************************************************************************/ - -/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */ - -#define GPIO_nLED_RED /* PC2 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN2) - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_OVERLOAD_LED LED_RED - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that - * can be used by the Px4 Firmware in the adc driver - */ - -/* ADC defines to be used in sensors.cpp to read from a particular channel */ - -#define ADC1_CH(n) (n) - -/* Define GPIO pins used as ADC N.B. Channel numbers must match below */ - -#define PX4_ADC_GPIO \ - /* PC0 */ GPIO_ADC123_INP10, \ - /* PC1 */ GPIO_ADC123_INP11, \ - /* PC5 */ GPIO_ADC12_INP8 - -/* Define Channel numbers must match above GPIO pin IN(n)*/ - -#define ADC_BATTERY_VOLTAGE_CHANNEL /* PC0 */ ADC1_CH(10) -#define ADC_BATTERY_CURRENT_CHANNEL /* PC1 */ ADC1_CH(11) -#define ADC_RSSI_IN_CHANNEL /* PC5 */ ADC1_CH(8) - -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY_CURRENT_CHANNEL) | \ - (1 << ADC_RSSI_IN_CHANNEL)) - -#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f) - - - -/* PWM - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 8 - -#define BOARD_NUM_IO_TIMERS 4 - - -/* Tone alarm output */ - -#define GPIO_TONE_ALARM_IDLE /* PC13 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN13) -#define GPIO_TONE_ALARM_GPIO /* PC13 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN13) - -/* USB OTG FS - * - * PA9 OTG_FS_VBUS VBUS sensing - */ -#define GPIO_OTGFS_VBUS /* PA8 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN8) - -/* High-resolution timer */ -#define HRT_TIMER 4 /* use timer3 for the HRT */ -#define HRT_TIMER_CHANNEL 1 /* use capture/compare channel 1 */ - -/* RC Serial port */ - -/* PWM input driver. Use FMU AUX5 pins attached to timer4 channel 2 */ - -#define PWMIN_TIMER 5 -#define PWMIN_TIMER_CHANNEL /* T5C1 */ 1 -#define GPIO_PWM_IN /* PA0 */ GPIO_TIM5_CH1IN - -#define GPIO_RSSI_IN /* PC5 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTC|GPIO_PIN5) - -#define GPIO_RF_SWITCH /* PE13 */ (GPIO_OUTPUT|GPIO_PULLDOWN|GPIO_PORTE|GPIO_PIN13) - -#define GPIO_VTX_ON /* PB11 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN11) - -/* Power switch controls ******************************************************/ - -#define SDIO_SLOTNO 0 /* Only one slot */ -#define SDIO_MINOR 0 - -/* SD card bringup does not work if performed on the IDLE thread because it - * will cause waiting. Use either: - * - * CONFIG_BOARDCTL=y, OR - * CONFIG_BOARD_INITIALIZE=y && CONFIG_BOARD_INITTHREAD=y - */ - -#if defined(CONFIG_BOARD_INITIALIZE) && !defined(CONFIG_BOARDCTL) && \ - !defined(CONFIG_BOARD_INITTHREAD) -# warning SDIO initialization cannot be perfomed on the IDLE thread -#endif - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) - -/* Board never powers off the Servo rail */ - -#define BOARD_ADC_SERVO_VALID (1) - -#define BOARD_ADC_BRICK1_VALID (1) - - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ - -#define BOARD_HAS_ON_RESET 1 - -#define PX4_GPIO_INIT_LIST { \ - PX4_ADC_GPIO, \ - GPIO_TONE_ALARM_IDLE, \ - GPIO_RSSI_IN, \ - GPIO_RF_SWITCH, \ - GPIO_VTX_ON, \ - } - -#define BOARD_ENABLE_CONSOLE_BUFFER - -#define FLASH_BASED_PARAMS - -__BEGIN_DECLS - -/**************************************************************************************************** - * Public Types - ****************************************************************************************************/ - -/**************************************************************************************************** - * Public data - ****************************************************************************************************/ - -#ifndef __ASSEMBLY__ - -/**************************************************************************************************** - * Public Functions - ****************************************************************************************************/ - -extern void stm32_spiinitialize(void); - -extern void stm32_usbinitialize(void); - -extern void board_peripheral_reset(int ms); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/holybro/kakuteh7v2/src/bootloader_main.c b/boards/holybro/kakuteh7v2/src/bootloader_main.c deleted file mode 100644 index 915b7f3..0000000 --- a/boards/holybro/kakuteh7v2/src/bootloader_main.c +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019, 2021 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. - * - ****************************************************************************/ - -/** - * @file bootloader_main.c - * - * FMU-specific early startup code for bootloader -*/ - -#include "board_config.h" -#include "bl.h" - -#include -#include -#include -#include -#include -#include "arm_internal.h" -#include - -extern int sercon_main(int c, char **argv); - -__EXPORT void board_on_reset(int status) {} - -__EXPORT void stm32_boardinitialize(void) -{ - /* configure USB interfaces */ - stm32_usbinitialize(); -} - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - return 0; -} - -void board_late_initialize(void) -{ - sercon_main(0, NULL); -} - -extern void sys_tick_handler(void); -void board_timerhook(void) -{ - sys_tick_handler(); -} diff --git a/boards/holybro/kakuteh7v2/src/hw_config.h b/boards/holybro/kakuteh7v2/src/hw_config.h deleted file mode 100644 index 72b3d6a..0000000 --- a/boards/holybro/kakuteh7v2/src/hw_config.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - * hw_config.h - * - * Created on: May 17, 2015 - * Author: david_s5 - */ - -#ifndef HW_CONFIG_H_ -#define HW_CONFIG_H_ - -/**************************************************************************** - * 10-8--2016: - * To simplify the ripple effect on the tools, we will be using - * /dev/serial/by-id/PX4 to locate PX4 devices. Therefore - * moving forward all Bootloaders must contain the prefix "PX4 BL " - * in the USBDEVICESTRING - * This Change will be made in an upcoming BL release - ****************************************************************************/ -/* - * Define usage to configure a bootloader - * - * - * Constant example Usage - * APP_LOAD_ADDRESS 0x08004000 - The address in Linker Script, where the app fw is org-ed - * BOOTLOADER_DELAY 5000 - Ms to wait while under USB pwr or bootloader request - * BOARD_FMUV2 - * INTERFACE_USB 1 - (Optional) Scan and use the USB interface for bootloading - * INTERFACE_USART 1 - (Optional) Scan and use the Serial interface for bootloading - * USBDEVICESTRING "PX4 BL FMU v2.x" - USB id string - * USBPRODUCTID 0x0011 - PID Should match defconfig - * BOOT_DELAY_ADDRESS 0x000001a0 - (Optional) From the linker script from Linker Script to get a custom - * delay provided by an APP FW - * BOARD_TYPE 9 - Must match .prototype boad_id - * _FLASH_KBYTES (*(uint16_t *)0x1fff7a22) - Run time flash size detection - * BOARD_FLASH_SECTORS ((_FLASH_KBYTES == 0x400) ? 11 : 23) - Run time determine the physical last sector - * BOARD_FLASH_SECTORS 11 - Hard coded zero based last sector - * BOARD_FLASH_SIZE (_FLASH_KBYTES*1024)- Total Flash size of device, determined at run time. - * (1024 * 1024) - Hard coded Total Flash of device - The bootloader and app reserved will be deducted - * programmatically - * - * BOARD_FIRST_FLASH_SECTOR_TO_ERASE 2 - Optional sectors index in the flash_sectors table (F4 only), to begin erasing. - * This is to allow sectors to be reserved for app fw usage. That will NOT be erased - * during a FW upgrade. - * The default is 0, and selects the first sector to be erased, as the 0th entry in the - * flash_sectors table. Which is the second physical sector of FLASH in the device. - * The first physical sector of FLASH is used by the bootloader, and is not defined - * in the table. - * - * APP_RESERVATION_SIZE (BOARD_FIRST_FLASH_SECTOR_TO_ERASE * 16 * 1024) - Number of bytes reserved by the APP FW. This number plus - * BOOTLOADER_RESERVATION_SIZE will be deducted from - * BOARD_FLASH_SIZE to determine the size of the App FW - * and hence the address space of FLASH to erase and program. - * USBMFGSTRING "PX4 AP" - Optional USB MFG string (default is '3D Robotics' if not defined.) - * SERIAL_BREAK_DETECT_DISABLED - Optional prevent break selection on Serial port from entering or staying in BL - * - * * Other defines are somewhat self explanatory. - */ - -/* Boot device selection list*/ -#define USB0_DEV 0x01 -#define SERIAL0_DEV 0x02 -#define SERIAL1_DEV 0x04 - -#define APP_LOAD_ADDRESS 0x08020000 -#define BOOTLOADER_DELAY 3000 -#define INTERFACE_USB 1 -#define INTERFACE_USB_CONFIG "/dev/ttyACM0" -#define BOARD_VBUS MK_GPIO_INPUT(GPIO_OTGFS_VBUS) - -//#define USE_VBUS_PULL_DOWN -#define BOOT_DELAY_ADDRESS 0x000001a0 -#define BOARD_TYPE 1053 -#define BOARD_FLASH_SECTORS (14) -#define BOARD_FLASH_SIZE (16 * 128 * 1024) -#define APP_RESERVATION_SIZE (1 * 128 * 1024) - -#define OSC_FREQ 8 - -#define BOARD_PIN_LED_ACTIVITY GPIO_nLED_RED -#define BOARD_LED_ON 0 -#define BOARD_LED_OFF 1 - -#define SERIAL_BREAK_DETECT_DISABLED 1 - -/* - * Uncommenting this allows to force the bootloader through - * a PWM output pin. As this can accidentally initialize - * an ESC prematurely, it is not recommended. This feature - * has not been used and hence defaults now to off. - * - * # define BOARD_FORCE_BL_PIN_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN14) - * # define BOARD_FORCE_BL_PIN_IN (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN11) - * - * # define BOARD_POWER_PIN_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN4) - * # define BOARD_POWER_ON 1 - * # define BOARD_POWER_OFF 0 - * # undef BOARD_POWER_PIN_RELEASE // Leave pin enabling Power - un comment to release (disable power) - * -*/ - -#if !defined(ARCH_SN_MAX_LENGTH) -# define ARCH_SN_MAX_LENGTH 12 -#endif - -#if !defined(APP_RESERVATION_SIZE) -# define APP_RESERVATION_SIZE 0 -#endif - -#if !defined(BOARD_FIRST_FLASH_SECTOR_TO_ERASE) -# define BOARD_FIRST_FLASH_SECTOR_TO_ERASE 1 -#endif - -#if !defined(USB_DATA_ALIGN) -# define USB_DATA_ALIGN -#endif - -#ifndef BOOT_DEVICES_SELECTION -# define BOOT_DEVICES_SELECTION USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif - -#ifndef BOOT_DEVICES_FILTER_ONUSB -# define BOOT_DEVICES_FILTER_ONUSB USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif - -#endif /* HW_CONFIG_H_ */ diff --git a/boards/holybro/kakuteh7v2/src/i2c.cpp b/boards/holybro/kakuteh7v2/src/i2c.cpp deleted file mode 100644 index e9f26f9..0000000 --- a/boards/holybro/kakuteh7v2/src/i2c.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), -}; diff --git a/boards/holybro/kakuteh7v2/src/init.c b/boards/holybro/kakuteh7v2/src/init.c deleted file mode 100644 index 7e55cc1..0000000 --- a/boards/holybro/kakuteh7v2/src/init.c +++ /dev/null @@ -1,261 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-2019 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * PX4FMU-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include "board_config.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -# if defined(FLASH_BASED_PARAMS) -# include -#endif - - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* Configuration ************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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(); - - /* Turn bluetooth off by default (no mavlink support yet) */ - px4_arch_gpiowrite(GPIO_RF_SWITCH, 0); - - /* configure USB interfaces */ - - stm32_usbinitialize(); - -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Power on Interfaces */ - board_control_spi_sensors_power(true, 0xffff); - - /* Need hrt running before using the ADC */ - - px4_platform_init(); - - /* configure SPI interfaces */ - - stm32_spiinitialize(); - - /* configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - - /* Get the SPI port for the microSD slot */ - struct spi_dev_s *spi_dev = stm32_spibus_initialize(CONFIG_NSH_MMCSDSPIPORTNO); - - if (!spi_dev) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", CONFIG_NSH_MMCSDSPIPORTNO); - led_on(LED_BLUE); - } - - up_udelay(20); - - -#if defined(FLASH_BASED_PARAMS) - static sector_descriptor_t params_sector_map[] = { - {15, 128 * 1024, 0x081E0000}, - {0, 0, 0}, - }; - - /* Initialize the flashfs layer to use heap allocated memory */ - int result = parameter_flashfs_init(params_sector_map, NULL, 0); - - if (result != OK) { - syslog(LOG_ERR, "[boot] FAILED to init params in FLASH %d\n", result); - led_on(LED_AMBER); - } - -#endif - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/holybro/kakuteh7v2/src/led.c b/boards/holybro/kakuteh7v2/src/led.c deleted file mode 100644 index 945c383..0000000 --- a/boards/holybro/kakuteh7v2/src/led.c +++ /dev/null @@ -1,223 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013 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 - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -#ifdef CONFIG_ARCH_LEDS -static bool nuttx_owns_leds = true; -// B R S G -// 0 1 2 3 -static const uint8_t xlatpx4[] = {1, 2, 4, 0}; -# define xlat(p) xlatpx4[(p)] -static uint32_t g_ledmap[] = { - GPIO_nLED_RED, // Indexed by BOARD_LED_RED -}; - -#else - -# define xlat(p) (p) -static uint32_t g_ledmap[] = { - GPIO_nLED_RED, // Indexed by LED_RED, LED_AMBER -}; - -#endif - -__EXPORT void led_init(void) -{ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - if (g_ledmap[l] != 0) { - stm32_configgpio(g_ledmap[l]); - } - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - - if (g_ledmap[led] != 0) { - stm32_gpiowrite(g_ledmap[led], !state); - } -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - if (g_ledmap[led] != 0) { - return !stm32_gpioread(g_ledmap[led]); - } - - return false; -} - -__EXPORT void led_on(int led) -{ - phy_set_led(xlat(led), true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(xlat(led), false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(xlat(led), !phy_get_led(xlat(led))); -} - -#ifdef CONFIG_ARCH_LEDS -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_autoled_initialize - ****************************************************************************/ - -void board_autoled_initialize(void) -{ - led_init(); -} - -/**************************************************************************** - * Name: board_autoled_on - ****************************************************************************/ - -void board_autoled_on(int led) -{ - if (!nuttx_owns_leds) { - return; - } - - switch (led) { - default: - break; - - case LED_HEAPALLOCATE: - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_IRQSENABLED: - phy_set_led(BOARD_LED_BLUE, false); - phy_set_led(BOARD_LED_GREEN, true); - break; - - case LED_STACKCREATED: - phy_set_led(BOARD_LED_GREEN, true); - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_INIRQ: - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_SIGNAL: - phy_set_led(BOARD_LED_GREEN, true); - break; - - case LED_ASSERTION: - phy_set_led(BOARD_LED_RED, true); - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_PANIC: - phy_set_led(BOARD_LED_RED, true); - break; - - case LED_IDLE : /* IDLE */ - phy_set_led(BOARD_LED_RED, true); - break; - } -} - -/**************************************************************************** - * Name: board_autoled_off - ****************************************************************************/ - -void board_autoled_off(int led) -{ - if (!nuttx_owns_leds) { - return; - } - - switch (led) { - default: - break; - - case LED_SIGNAL: - phy_set_led(BOARD_LED_GREEN, false); - break; - - case LED_INIRQ: - phy_set_led(BOARD_LED_BLUE, false); - break; - - case LED_ASSERTION: - phy_set_led(BOARD_LED_RED, false); - phy_set_led(BOARD_LED_BLUE, false); - break; - - case LED_PANIC: - phy_set_led(BOARD_LED_RED, false); - break; - - case LED_IDLE : /* IDLE */ - phy_set_led(BOARD_LED_RED, false); - break; - } -} - -#endif /* CONFIG_ARCH_LEDS */ diff --git a/boards/holybro/kakuteh7v2/src/spi.cpp b/boards/holybro/kakuteh7v2/src/spi.cpp deleted file mode 100644 index a8ce482..0000000 --- a/boards/holybro/kakuteh7v2/src/spi.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020, 2021 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(SPIDEV_MMCSD(0), SPI::CS{GPIO::PortA, GPIO::Pin4}) - }), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_OSD_DEVTYPE_ATXXXX, SPI::CS{GPIO::PortB, GPIO::Pin12}), - }), - initSPIBus(SPI::Bus::SPI4, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20689, SPI::CS{GPIO::PortE, GPIO::Pin4}, SPI::DRDY{GPIO::PortE, GPIO::Pin1}), - initSPIDevice(DRV_IMU_DEVTYPE_MPU6000, SPI::CS{GPIO::PortE, GPIO::Pin4}, SPI::DRDY{GPIO::PortE, GPIO::Pin1}), - initSPIDevice(DRV_IMU_DEVTYPE_BMI270, SPI::CS{GPIO::PortE, GPIO::Pin4}, SPI::DRDY{GPIO::PortE, GPIO::Pin1}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/holybro/kakuteh7v2/src/timer_config.cpp b/boards/holybro/kakuteh7v2/src/timer_config.cpp deleted file mode 100644 index 20eb0f1..0000000 --- a/boards/holybro/kakuteh7v2/src/timer_config.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer3, DMA{DMA::Index1}), - initIOTimer(Timer::Timer2, DMA{DMA::Index1}), - initIOTimer(Timer::Timer5, DMA{DMA::Index1}), - initIOTimer(Timer::Timer8, DMA{DMA::Index1}), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel3}, {GPIO::PortB, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel4}, {GPIO::PortB, GPIO::Pin1}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel2}, {GPIO::PortB, GPIO::Pin3}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel3}, {GPIO::PortB, GPIO::Pin10}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel1}, {GPIO::PortA, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel3}, {GPIO::PortA, GPIO::Pin2}), - initIOTimerChannel(io_timers, {Timer::Timer8, Timer::Channel3}, {GPIO::PortC, GPIO::Pin8}), - initIOTimerChannel(io_timers, {Timer::Timer8, Timer::Channel4}, {GPIO::PortC, GPIO::Pin9}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/holybro/kakuteh7v2/src/usb.c b/boards/holybro/kakuteh7v2/src/usb.c deleted file mode 100644 index 6d42476..0000000 --- a/boards/holybro/kakuteh7v2/src/usb.c +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016 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. - * - ****************************************************************************/ - -/** - * @file px4fmu_usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#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_STM32H7_OTGFS - stm32_configgpio(GPIO_OTGFS_VBUS); -#endif -} - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/holybro/pix32v5/default.px4board b/boards/holybro/pix32v5/default.px4board deleted file mode 100644 index 45bd43e..0000000 --- a/boards/holybro/pix32v5/default.px4board +++ /dev/null @@ -1,106 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS0" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS2" -CONFIG_BOARD_SERIAL_TEL3="/dev/ttyS4" -CONFIG_BOARD_SERIAL_TEL4="/dev/ttyS3" -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_COMMON_BAROMETERS=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=y -CONFIG_DRIVERS_IMU_BOSCH_BMI055=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20689=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_DRIVERS_LIGHTS_RGBLED_PWM=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_PWM_INPUT=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_PX4IO=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SAFETY_BUTTON=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UUV_ATT_CONTROL=y -CONFIG_MODULES_UUV_POS_CONTROL=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BL_UPDATE=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SERIAL_TEST=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_FAKE_GPS=y diff --git a/boards/holybro/pix32v5/extras/holybro_pix32v5_bootloader.bin b/boards/holybro/pix32v5/extras/holybro_pix32v5_bootloader.bin deleted file mode 100644 index 76d4bf5..0000000 Binary files a/boards/holybro/pix32v5/extras/holybro_pix32v5_bootloader.bin and /dev/null differ diff --git a/boards/holybro/pix32v5/extras/px4_io-v2_default.bin b/boards/holybro/pix32v5/extras/px4_io-v2_default.bin deleted file mode 100755 index 957f0f1..0000000 Binary files a/boards/holybro/pix32v5/extras/px4_io-v2_default.bin and /dev/null differ diff --git a/boards/holybro/pix32v5/firmware.prototype b/boards/holybro/pix32v5/firmware.prototype deleted file mode 100644 index 695be97..0000000 --- a/boards/holybro/pix32v5/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 78, - "magic": "PX4FWv1", - "description": "Firmware for the PX4FMUv5 board", - "image": "", - "build_time": 0, - "summary": "PX4FMUv5", - "version": "0.1", - "image_size": 0, - "image_maxsize": 2064384, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/holybro/pix32v5/init/rc.board_defaults b/boards/holybro/pix32v5/init/rc.board_defaults deleted file mode 100644 index 94c5828..0000000 --- a/boards/holybro/pix32v5/init/rc.board_defaults +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 18.1 -param set-default BAT2_V_DIV 18.1 - -param set-default BAT1_A_PER_V 36.367515152 -param set-default BAT2_A_PER_V 36.367515152 - -param set-default SYS_USE_IO 1 - -rgbled_pwm start -safety_button start diff --git a/boards/holybro/pix32v5/init/rc.board_sensors b/boards/holybro/pix32v5/init/rc.board_sensors deleted file mode 100644 index 26d3e13..0000000 --- a/boards/holybro/pix32v5/init/rc.board_sensors +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -# -# PX4 FMUv5 specific board sensors init -#------------------------------------------------------------------------------ - -board_adc start - -# Internal SPI bus ICM-20602 -icm20602 -s -R 2 start - -# Internal SPI bus ICM-20689 -icm20689 -s -R 2 start - -# Internal SPI bus BMI055 accel/gyro -bmi055 -A -R 2 -s start -bmi055 -G -R 2 -s start - -# internal compass -ist8310 -I -R 10 start - -# Baro on internal SPI -ms5611 -s start - -# External compass on GPS1/I2C1 (the 3rd external bus): standard Holybro GPS/compass puck (with lights, safety button, and buzzer) -ist8310 -X -b 1 -R 10 start diff --git a/boards/holybro/pix32v5/nuttx-config/Kconfig b/boards/holybro/pix32v5/nuttx-config/Kconfig deleted file mode 100644 index a7f002b..0000000 --- a/boards/holybro/pix32v5/nuttx-config/Kconfig +++ /dev/null @@ -1,17 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see misc/tools/kconfig-language.txt. -# -config BOARD_HAS_PROBES - bool "Board provides GPIO or other Hardware for signaling to timing analyze." - default y - ---help--- - This board provides GPIO FMU-CH1-8, CAP1-3 as PROBE_1-11 to provide timing signals from selected drivers. - -config BOARD_USE_PROBES - bool "Enable the use the board provided FMU-CH1-8, CAP1-3 as PROBE_1-11" - default n - depends on BOARD_HAS_PROBES - - ---help--- - Select to use GPIO FMU-CH1-8, CAP1-3 to provide timing signals from selected drivers. diff --git a/boards/holybro/pix32v5/nuttx-config/include/board.h b/boards/holybro/pix32v5/nuttx-config/include/board.h deleted file mode 100644 index 26b14e1..0000000 --- a/boards/holybro/pix32v5/nuttx-config/include/board.h +++ /dev/null @@ -1,482 +0,0 @@ -/************************************************************************************ - * nuttx-configs/px4_fmu-v5/include/board.h - * - * Copyright (C) 2016-2018 Gregory Nutt. All rights reserved. - * Authors: David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ -#ifndef __NUTTX_CONFIG_PX4_FMU_V5_INCLUDE_BOARD_H -#define __NUTTX_CONFIG_PX4_FMU_V5_INCLUDE_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The px4_fmu-v5 board provides the following clock sources: - * - * X301: 16 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 16 MHz RC factory-trimmed - * HSE: 16 MHz crystal for HSE - */ - -#define STM32_BOARD_XTAL 16000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 0 - -/* Main PLL Configuration. - * - * PLL source is HSE = 16,000,000 - * - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 2 <= PLLM <= 63 - * 192 <= PLLN <= 432 - * 192 MHz <= PLL_VCO <= 432MHz - * - * SYSCLK = PLL_VCO / PLLP - * Subject to - * - * PLLP = {2, 4, 6, 8} - * SYSCLK <= 216 MHz - * - * USB OTG FS, SDMMC and RNG Clock = PLL_VCO / PLLQ - * Subject to - * The USB OTG FS requires a 48 MHz clock to work correctly. The SDMMC - * and the random number generator need a frequency lower than or equal - * to 48 MHz to work correctly. - * - * 2 <= PLLQ <= 15 - */ - -/* Highest SYSCLK with USB OTG FS clock = 48 MHz - * - * PLL_VCO = (16,000,000 / 8) * 216 = 432 MHz - * SYSCLK = 432 MHz / 2 = 216 MHz - * USB OTG FS, SDMMC and RNG Clock = 432 MHz / 9 = 48 MHz - */ - -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(8) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(216) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(9) - -#define STM32_VCO_FREQUENCY ((STM32_HSE_FREQUENCY / 8) * 216) -#define STM32_SYSCLK_FREQUENCY (STM32_VCO_FREQUENCY / 2) -#define STM32_OTGFS_FREQUENCY (STM32_VCO_FREQUENCY / 9) - -/* Configure factors for PLLSAI clock */ - -#define CONFIG_STM32F7_PLLSAI 1 -#define STM32_RCC_PLLSAICFGR_PLLSAIN RCC_PLLSAICFGR_PLLSAIN(192) -#define STM32_RCC_PLLSAICFGR_PLLSAIP RCC_PLLSAICFGR_PLLSAIP(8) -#define STM32_RCC_PLLSAICFGR_PLLSAIQ RCC_PLLSAICFGR_PLLSAIQ(4) -#define STM32_RCC_PLLSAICFGR_PLLSAIR RCC_PLLSAICFGR_PLLSAIR(2) - -/* Configure Dedicated Clock Configuration Register */ - -#define STM32_RCC_DCKCFGR1_PLLI2SDIVQ RCC_DCKCFGR1_PLLI2SDIVQ(1) -#define STM32_RCC_DCKCFGR1_PLLSAIDIVQ RCC_DCKCFGR1_PLLSAIDIVQ(1) -#define STM32_RCC_DCKCFGR1_PLLSAIDIVR RCC_DCKCFGR1_PLLSAIDIVR(0) -#define STM32_RCC_DCKCFGR1_SAI1SRC RCC_DCKCFGR1_SAI1SEL(0) -#define STM32_RCC_DCKCFGR1_SAI2SRC RCC_DCKCFGR1_SAI2SEL(0) -#define STM32_RCC_DCKCFGR1_TIMPRESRC 0 -#define STM32_RCC_DCKCFGR1_DFSDM1SRC 0 -#define STM32_RCC_DCKCFGR1_ADFSDM1SRC 0 - - - -/* Configure factors for PLLI2S clock */ - -#define CONFIG_STM32F7_PLLI2S 1 -#define STM32_RCC_PLLI2SCFGR_PLLI2SN RCC_PLLI2SCFGR_PLLI2SN(192) -#define STM32_RCC_PLLI2SCFGR_PLLI2SP RCC_PLLI2SCFGR_PLLI2SP(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SQ RCC_PLLI2SCFGR_PLLI2SQ(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SR RCC_PLLI2SCFGR_PLLI2SR(2) - -/* Configure Dedicated Clock Configuration Register 2 */ - -#define STM32_RCC_DCKCFGR2_USART1SRC RCC_DCKCFGR2_USART1SEL_APB -#define STM32_RCC_DCKCFGR2_USART2SRC RCC_DCKCFGR2_USART2SEL_APB -#define STM32_RCC_DCKCFGR2_UART4SRC RCC_DCKCFGR2_UART4SEL_APB -#define STM32_RCC_DCKCFGR2_UART5SRC RCC_DCKCFGR2_UART5SEL_APB -#define STM32_RCC_DCKCFGR2_USART6SRC RCC_DCKCFGR2_USART6SEL_APB -#define STM32_RCC_DCKCFGR2_UART7SRC RCC_DCKCFGR2_UART7SEL_APB -#define STM32_RCC_DCKCFGR2_UART8SRC RCC_DCKCFGR2_UART8SEL_APB -#define STM32_RCC_DCKCFGR2_I2C1SRC RCC_DCKCFGR2_I2C1SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C2SRC RCC_DCKCFGR2_I2C2SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C3SRC RCC_DCKCFGR2_I2C3SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C4SRC RCC_DCKCFGR2_I2C4SEL_HSI -#define STM32_RCC_DCKCFGR2_LPTIM1SRC RCC_DCKCFGR2_LPTIM1SEL_APB -#define STM32_RCC_DCKCFGR2_CECSRC RCC_DCKCFGR2_CECSEL_HSI -#define STM32_RCC_DCKCFGR2_CK48MSRC RCC_DCKCFGR2_CK48MSEL_PLL -#define STM32_RCC_DCKCFGR2_SDMMCSRC RCC_DCKCFGR2_SDMMCSEL_48MHZ -#define STM32_RCC_DCKCFGR2_SDMMC2SRC RCC_DCKCFGR2_SDMMC2SEL_48MHZ -#define STM32_RCC_DCKCFGR2_DSISRC RCC_DCKCFGR2_DSISEL_PHY - - -/* Several prescalers allow the configuration of the two AHB buses, the - * high-speed APB (APB2) and the low-speed APB (APB1) domains. The maximum - * frequency of the two AHB buses is 216 MHz while the maximum frequency of - * the high-speed APB domains is 108 MHz. The maximum allowed frequency of - * the low-speed APB domain is 54 MHz. - */ - -/* AHB clock (HCLK) is SYSCLK (216 MHz) */ - -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (54 MHz) */ - -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (108MHz) */ - -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* SDMMC dividers. Note that slower clocking is required when DMA is disabled - * in order to avoid RX overrun/TX underrun errors due to delayed responses - * to service FIFOs in interrupt driven mode. These values have not been - * tuned!!! - * - * SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(118+2)=400 KHz - */ - -/* Use the Falling edge of the SDIO_CLK clock to change the edge the - * data and commands are change on - */ - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - -#define STM32_SDMMC_INIT_CLKDIV (118 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* DMA ON: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(1+2)=16 MHz - * DMA OFF: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32F7_SDMMC_DMA -# define STM32_SDMMC_MMCXFR_CLKDIV (1 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (2 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -/* DMA ON: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(1+2)=16 MHz - * DMA OFF: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(2+2)=12 MHz - */ -//TODO #warning "Check Freq for 24mHz" - -#ifdef CONFIG_STM32F7_SDMMC_DMA -# define STM32_SDMMC_SDXFR_CLKDIV (1 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (2 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -/* FLASH wait states - * - * --------- ---------- ----------- - * VDD MAX SYSCLK WAIT STATES - * --------- ---------- ----------- - * 1.7-2.1 V 180 MHz 8 - * 2.1-2.4 V 216 MHz 9 - * 2.4-2.7 V 216 MHz 8 - * 2.7-3.6 V 216 MHz 7 - * --------- ---------- ----------- - */ - -#define BOARD_FLASH_WAITSTATES 7 - -/* LED definitions ******************************************************************/ -/* The px4_fmu-v5 board has numerous LEDs but only three, LED_GREEN a Green LED, LED_BLUE - * a Blue LED and LED_RED a Red LED, that can be controlled by software. - * - * If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any way. - * The following definitions are used to access individual LEDs. - */ - -/* LED index values for use with board_userled() */ - -#define BOARD_LED1 0 -#define BOARD_LED2 1 -#define BOARD_LED3 2 -#define BOARD_NLEDS 3 - -#define BOARD_LED_RED BOARD_LED1 -#define BOARD_LED_GREEN BOARD_LED2 -#define BOARD_LED_BLUE BOARD_LED3 - -/* LED bits for use with board_userled_all() */ - -#define BOARD_LED1_BIT (1 << BOARD_LED1) -#define BOARD_LED2_BIT (1 << BOARD_LED2) -#define BOARD_LED3_BIT (1 << BOARD_LED3) - -/* If CONFIG_ARCH_LEDS is defined, the usage by the board port is defined in - * include/board.h and src/stm32_leds.c. The LEDs are used to encode OS-related - * events as follows: - * - * - * SYMBOL Meaning LED state - * Red Green Blue - * ---------------------- -------------------------- ------ ------ ----*/ - -#define LED_STARTED 0 /* NuttX has been started OFF OFF OFF */ -#define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF OFF ON */ -#define LED_IRQSENABLED 2 /* Interrupts enabled OFF ON OFF */ -#define LED_STACKCREATED 3 /* Idle stack created OFF ON ON */ -#define LED_INIRQ 4 /* In an interrupt N/C N/C GLOW */ -#define LED_SIGNAL 5 /* In a signal handler N/C GLOW N/C */ -#define LED_ASSERTION 6 /* An assertion failed GLOW N/C GLOW */ -#define LED_PANIC 7 /* The system has crashed Blink OFF N/C */ -#define LED_IDLE 8 /* MCU is is sleep mode ON OFF OFF */ - -/* Thus if the Green LED is statically on, NuttX has successfully booted and - * is, apparently, running normally. If the Red LED is flashing at - * approximately 2Hz, then a fatal error has been detected and the system - * has halted. - */ - -/* Alternate function pin selections ************************************************/ - -#define GPIO_USART1_RX GPIO_USART1_RX_2 /* PB7 */ -#define GPIO_USART1_TX GPIO_USART1_TX_2 /* PB6 */ - -#define GPIO_USART2_RX GPIO_USART2_RX_2 /* PD6 */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 /* PD4 */ -#define GPIO_USART2_CTS GPIO_USART2_CTS_2 /* PD3 */ - -#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ -#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ -#define GPIO_USART3_RTS GPIO_USART3_RTS_2 /* PD12 */ -#define GPIO_USART3_CTS GPIO_USART3_CTS_2 /* PD11 */ - -#define GPIO_UART4_RX GPIO_UART4_RX_4 /* PD0 */ -#define GPIO_UART4_TX GPIO_UART4_TX_4 /* PD1 */ - -#define GPIO_USART6_RX GPIO_USART6_RX_2 /* PG9 */ -#define GPIO_USART6_TX GPIO_USART6_TX_2 /* PG14 */ -#define GPIO_USART6_RTS GPIO_USART6_RTS_2 /* PG8 */ -#define GPIO_USART6_CTS GPIO_USART6_CTS_2 /* PG15 */ - -#define GPIO_UART7_RX GPIO_UART7_RX_2 /* PF6 */ -#define GPIO_UART7_TX GPIO_UART7_TX_1 /* PE8 */ - -/* USART8: has no remap - * - * GPIO_UART8_RX PE0[CN12-64] - * GPIO_UART8_TX PE1[CN11-61] - */ - -/* CAN - * - * CAN1 is routed to transceiver. - * CAN2 is routed to transceiver. - * CAN3 is routed to transceiver. - */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_5 /* PI9 */ -#define GPIO_CAN1_TX GPIO_CAN1_TX_4 /* PH13 */ -#define GPIO_CAN2_RX GPIO_CAN2_RX_1 /* PB12 */ -#define GPIO_CAN2_TX GPIO_CAN2_TX_1 /* PB13 */ -#define GPIO_CAN3_RX GPIO_CAN3_RX_1 /* PA8 */ -#define GPIO_CAN3_TX GPIO_CAN3_TX_1 /* PA15 */ - -/* SPI - * SPI1 sensors - * SPI2 is FRAM. - * SPI4 is BARO - * SPI6 Reserved - * - */ - -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_3 /* PD7 */ -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_3 /* PG11 */ - -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_3 /* PI2 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_3 /* PI3 */ -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_5 /* PI1 */ - -#define GPIO_SPI4_MISO GPIO_SPI4_MISO_2 /* PE13 */ -#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_1 /* PE6 */ -#define GPIO_SPI4_SCK GPIO_SPI4_SCK_1 /* PE2 */ - -#define GPIO_SPI5_MISO GPIO_SPI5_MISO_1 /* PF8 */ -#define GPIO_SPI5_MOSI GPIO_SPI5_MOSI_1 /* PF9 */ -#define GPIO_SPI5_SCK GPIO_SPI5_SCK_1 /* PF7 */ - -#define GPIO_SPI6_MISO GPIO_SPI6_MISO_1 /* PG12 */ -#define GPIO_SPI6_MOSI GPIO_SPI6_MOSI_3 /* PB5 */ -#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, - * but are normally-high GPIOs. - * - */ - -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 /* PB8] */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 /* PB9 */ - -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN8) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN9) - -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_2 /* PF1 */ -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_2 /* PF0 */ - -#define GPIO_I2C2_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTF | GPIO_PIN1) -#define GPIO_I2C2_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTF | GPIO_PIN0) - -#define GPIO_I2C3_SCL GPIO_I2C3_SCL_2 /* PH7 */ -#define GPIO_I2C3_SDA GPIO_I2C3_SDA_2 /* PH8 */ - -#define GPIO_I2C3_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTH | GPIO_PIN7) -#define GPIO_I2C3_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTH | GPIO_PIN8) - -#define GPIO_I2C4_SCL GPIO_I2C4_SCL_2 /* PF14 */ -#define GPIO_I2C4_SDA GPIO_I2C4_SDA_2 /* PF15 */ - -#define GPIO_I2C4_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTF | GPIO_PIN14) -#define GPIO_I2C4_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTF | GPIO_PIN15) - -/* SDMMC1 - * - * VDD 3.3 - * GND - * SDMMC1_CK PC12 - * SDMMC1_CMD PD2 - * SDMMC1_D0 PC8 - * SDMMC1_D1 PC9 - * SDMMC1_D2 PC10 - * SDMMC1_D3 PC11 - * GPIO_SDMMC1_NCD PG0 - */ - -/* USB - * - * OTG_FS_DM PA11 - * OTG_FS_DP PA12 - * VBUS PA9 - */ - - -/* Board provides GPIO or other Hardware for signaling to timing analyzer */ - -#if defined(CONFIG_BOARD_USE_PROBES) -# include "stm32_gpio.h" -# define PROBE_N(n) (1<<((n)-1)) -# define PROBE_1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN14) /* PE14 AUX1 */ -# define PROBE_2 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN10) /* PA10 AUX2 */ -# define PROBE_3 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN11) /* PE11 AUX3 */ -# define PROBE_4 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN9) /* PE9 AUX4 */ -# define PROBE_5 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN13) /* PD13 AUX5 */ -# define PROBE_6 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN14) /* PD14 AUX6 */ -# define PROBE_7 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN6) /* PH6 AUX7 */ -# define PROBE_8 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN9) /* PH9 AUX8 */ -# define PROBE_9 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN5) /* PA5 CAP1 */ -# define PROBE_10 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN3) /* PB3 CAP2 */ -# define PROBE_11 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN11) /* PB11 CAP3 */ - -# define PROBE_INIT(mask) \ - do { \ - if ((mask)& PROBE_N(1)) { stm32_configgpio(PROBE_1); } \ - if ((mask)& PROBE_N(2)) { stm32_configgpio(PROBE_2); } \ - if ((mask)& PROBE_N(3)) { stm32_configgpio(PROBE_3); } \ - if ((mask)& PROBE_N(4)) { stm32_configgpio(PROBE_4); } \ - if ((mask)& PROBE_N(5)) { stm32_configgpio(PROBE_5); } \ - if ((mask)& PROBE_N(6)) { stm32_configgpio(PROBE_6); } \ - if ((mask)& PROBE_N(7)) { stm32_configgpio(PROBE_7); } \ - if ((mask)& PROBE_N(8)) { stm32_configgpio(PROBE_8); } \ - if ((mask)& PROBE_N(9)) { stm32_configgpio(PROBE_9); } \ - if ((mask)& PROBE_N(10)) { stm32_configgpio(PROBE_10); } \ - if ((mask)& PROBE_N(11)) { stm32_configgpio(PROBE_11); } \ - } while(0) - -# define PROBE(n,s) do {stm32_gpiowrite(PROBE_##n,(s));}while(0) -# define PROBE_MARK(n) PROBE(n,false);PROBE(n,true) -#else -# define PROBE_INIT(mask) -# define PROBE(n,s) -# define PROBE_MARK(n) -#endif - -#endif /*__NUTTX_CONFIG_PX4_FMU_V5_INCLUDE_BOARD_H */ diff --git a/boards/holybro/pix32v5/nuttx-config/include/board_dma_map.h b/boards/holybro/pix32v5/nuttx-config/include/board_dma_map.h deleted file mode 100644 index b5b9e8a..0000000 --- a/boards/holybro/pix32v5/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/* -| DMA1 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | SPI3_RX_1 | SPDIFRX_DT | SPI3_RX_2 | SPI2_RX | SPI2_TX | SPI3_TX_1 | SPDIFRX_CS | SPI3_TX_2 | -| Channel 1 | I2C1_RX | I2C3_RX | TIM7_UP_1 | - | TIM7_UP_2 | I2C1_RX_1 | I2C1_TX | I2C1_TX_1 | -| Channel 2 | TIM4_CH1 | - | I2C4_RX | TIM4_CH2 | - | I2C4_RX | TIM4_UP | TIM4_CH3 | -| Channel 3 | - | TIM2_UP_1 | I2C3_RX_1 | - | I2C3_TX | TIM2_CH1 | TIM2_CH2 | TIM2_UP_2 | -| | | TIM2_CH3 | | | | | TIM2_CH4_1 | TIM2_CH4_2 | -| Channel 4 | UART5_RX | USART3_RX | UART4_RX | USART3_TX_1 | UART4_TX | USART2_RX | USART2_TX | UART5_TX | -| Channel 5 | UART8_TX | UART7_TX | TIM3_CH4 | UART7_RX | TIM3_CH1 | TIM3_CH2 | UART8_RX | TIM3_CH3 | -| | | | TIM3_UP | | TIM3_TRIG | | | | -| Channel 6 | TIM5_CH3 | TIM5_CH4_1 | TIM5_CH1 | TIM5_CH4_2 | TIM5_CH2 | - | TIM5_UP_2 | - | -| | TIM5_UP_1 | TIM5_TRIG_1 | | TIM5_TRIG_2 | | | | | -| Channel 7 | - | TIM6_UP | I2C2_RX | I2C2_RX_1 | USART3_TX_2 | DAC1 | DAC2 | I2C2_TX | -| Channel 8 | I2C3_TX | I2C4_RX | - | - | I2C2_TX | - | I2C4_TX | - | -| Channel 9 | - | SPI2_RX | - | - | - | - | SPI2_TX | - | -| | | | | | | | | | -| Usage | UART8_TX | USART3_RX | UART4_RX | USART3_TX_1 | | USART2_RX | UART8_RX | | - - -| DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | ADC1_1 | SAI1_A | TIM8_CH1_1 | SAI1_A_1 | ADC1_2 | SAI1_B_1 | TIM1_CH1_1 | SAI2_B_2 | -| | | | TIM8_CH2_1 | | | | TIM1_CH2_1 | | -| | | | TIM8_CH3_1 | | | | TIM1_CH3_1 | | -| Channel 1 | - | DCMI_1 | ADC2_1 | ADC2_2 | SAI1_B | SPI6_TX | SPI6_RX | DCMI_2 | -| Channel 2 | ADC3_1 | ADC3_2 | - | SPI5_RX_1 | SPI5_TX_1 | CRYP_OUT | CRYP_IN | HASH_IN | -| Channel 3 | SPI1_RX_1 | - | SPI1_RX_2 | SPI1_TX_1 | SAI2_A | SPI1_TX_2 | SAI2_B | QUADSPI | -| Channel 4 | SPI4_RX_1 | SPI4_TX_1 | USART1_RX_1 | SDMMC1_1 | - | USART1_RX_2 | SDMMC1_2 | USART1_TX | -| Channel 5 | - | USART6_RX_1 | USART6_RX_2 | SPI4_RX_2 | SPI4_TX_2 | - | USART6_TX_1 | USART6_TX_2 | -| Channel 6 | TIM1_TRIG_1 | TIM1_CH1_2 | TIM1_CH2_2 | TIM1_CH1 | TIM1_CH4 | TIM1_UP | TIM1_CH3_2 | - | -| | | | | | TIM1_TRIG_2 | | | | -| | | | | | TIM1_COM | | | | -| Channel 7 | - | TIM8_UP | TIM8_CH1_2 | TIM8_CH2_2 | TIM8_CH3_2 | SPI5_RX_2 | SPI5_TX_2 | TIM8_CH4 | -| | | | | | | | | TIM8_TRIG | -| | | | | | | | | TIM8_COM | -| Channel 8 | DSFDM1_FLT0 | DSFDM1_FLT1 | DSFDM1_FLT2 | DSFDM1_FLT3 | DSFDM1_FLT0 | DSFDM1_FLT1 | DSFDM1_FLT2 | DSFDM1_FLT3 | -| Channel 9 | JPEG_IN | JPEG_OUT | SPI4_TX | JPEG_IN | JPEG_OUT | SPI5_RX | - | - | -| Channel 10 | SAI1_B | SAI2_B | SAI2_A | - | - | - | SAI1_A | - | -| Channel 11 | SDMMC2 | - | QUADSPI | - | - | SDMMC2 | - | - | -| | | | | | | | | | -| Usage | SPI1_RX_1 | | USART6_RX_2 | SPI1_TX_1 | | TIM1_UP | SDMMC1_2 | USART6_TX_2 | - */ - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// DMAMAP_UART8_TX // DMA1, Stream 0, Channel 5 (PX4IO TX) -// DMAMAP_USART3_RX // DMA1, Stream 1, Channel 4 (TELEM2 RX) -// DMAMAP_UART4_RX // DMA1, Stream 2, Channel 4 (TELEM4 RX) -#define DMAMAP_USART3_TX DMAMAP_USART3_TX_1 // DMA1, Stream 3, Channel 4 (TELEM2 TX) -// DMAMAP_USART2_RX // DMA1, Stream 5, Channel 4 (TELEM1 RX) -// DMAMAP_UART8_RX // DMA1, Stream 6, Channel 5 (PX4IO RX) - - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMAMAP_SPI1_RX DMAMAP_SPI1_RX_1 // DMA2, Stream 0, Channel 3 (SPI sensors RX) -// AVAILABLE // DMA2, Stream 1 -#define DMAMAP_USART6_RX DMAMAP_USART6_RX_2 // DMA2, Stream 2, Channel 5 -#define DMAMAP_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 3, Channel 3 (SPI sensors TX) -// AVAILABLE // DMA2, Stream 4 -// DMAMAP_TIM1_UP // DMA2, Stream 5, Channel 6 (DSHOT) -#define DMAMAP_SDMMC1 DMAMAP_SDMMC1_2 // DMA2, Stream 6, Channel 4 -#define DMAMAP_USART6_TX DMAMAP_USART6_TX_2 // DMA2, Stream 7, Channel 5 diff --git a/boards/holybro/pix32v5/nuttx-config/nsh/defconfig b/boards/holybro/pix32v5/nuttx-config/nsh/defconfig deleted file mode 100644 index 76efc7a..0000000 --- a/boards/holybro/pix32v5/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,265 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_FS_PROCFS_EXCLUDE_ENVIRON is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/holybro/pix32v5/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32f7" -CONFIG_ARCH_CHIP_STM32F765II=y -CONFIG_ARCH_CHIP_STM32F7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x004E -CONFIG_CDCACM_PRODUCTSTR="PX4 PIX32V5" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x3162 -CONFIG_CDCACM_VENDORSTR="Holybro" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=3 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_MODE=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32F7_ADC1=y -CONFIG_STM32F7_BBSRAM=y -CONFIG_STM32F7_BBSRAM_FILES=5 -CONFIG_STM32F7_BKPSRAM=y -CONFIG_STM32F7_DMA1=y -CONFIG_STM32F7_DMA2=y -CONFIG_STM32F7_DMACAPABLE=y -CONFIG_STM32F7_FLOWCONTROL_BROKEN=y -CONFIG_STM32F7_I2C1=y -CONFIG_STM32F7_I2C2=y -CONFIG_STM32F7_I2C3=y -CONFIG_STM32F7_I2C4=y -CONFIG_STM32F7_I2C_DYNTIMEO=y -CONFIG_STM32F7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32F7_OTGFS=y -CONFIG_STM32F7_PROGMEM=y -CONFIG_STM32F7_PWR=y -CONFIG_STM32F7_RTC=y -CONFIG_STM32F7_RTC_HSECLOCK=y -CONFIG_STM32F7_RTC_MAGIC_REG=1 -CONFIG_STM32F7_SAVE_CRASHDUMP=y -CONFIG_STM32F7_SDMMC1=y -CONFIG_STM32F7_SDMMC_DMA=y -CONFIG_STM32F7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32F7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32F7_SPI1=y -CONFIG_STM32F7_SPI1_DMA=y -CONFIG_STM32F7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI2=y -CONFIG_STM32F7_SPI4=y -CONFIG_STM32F7_SPI5=y -CONFIG_STM32F7_SPI6=y -CONFIG_STM32F7_SPI_DMATHRESHOLD=8 -CONFIG_STM32F7_TIM10=y -CONFIG_STM32F7_TIM11=y -CONFIG_STM32F7_UART4=y -CONFIG_STM32F7_UART7=y -CONFIG_STM32F7_UART8=y -CONFIG_STM32F7_USART1=y -CONFIG_STM32F7_USART2=y -CONFIG_STM32F7_USART3=y -CONFIG_STM32F7_USART6=y -CONFIG_STM32F7_USART_BREAKS=y -CONFIG_STM32F7_USART_INVERT=y -CONFIG_STM32F7_USART_SINGLEWIRE=y -CONFIG_STM32F7_USART_SWAP=y -CONFIG_STM32F7_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_RXDMA=y -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_RXDMA=y -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=3000 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/holybro/pix32v5/nuttx-config/scripts/script.ld b/boards/holybro/pix32v5/nuttx-config/scripts/script.ld deleted file mode 100644 index db0f740..0000000 --- a/boards/holybro/pix32v5/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,181 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F765IIT6 has 2048 KiB of main FLASH memory. This FLASH memory - * can be accessed from either the AXIM interface at address 0x0800:0000 or - * from the ITCM interface at address 0x0020:0000. - * - * Additional information, including the option bytes, is available at at - * FLASH at address 0x1ff0:0000 (AXIM) or 0x0010:0000 (ITCM). - * - * In the STM32F765IIT6, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash on ITCM at 0x0020:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x0010:0000 - * - * NuttX does not modify these option byes. On the unmodified NUCLEO-144 - * board, the BOOT0 pin is at ground so by default, the STM32F765IIT6 will - * boot from address 0x0020:0000 in ITCM FLASH. - * - * The STM32F765IIT6 also has 512 KiB of data SRAM (in addition to ITCM SRAM). - * SRAM is split up into three blocks: - * - * 1) 128 KiB of DTCM SRM beginning at address 0x2000:0000 - * 2) 368 KiB of SRAM1 beginning at address 0x2002:0000 - * 3) 16 KiB of SRAM2 beginning at address 0x2007:c000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * Bootloader reserves the first 32K bank (2 Mbytes Flash memory single bank) - * organization (256 bits read width) - */ - -MEMORY -{ - FLASH_ITCM (rx) : ORIGIN = 0x00208000, LENGTH = 2016K - FLASH_AXIM (rx) : ORIGIN = 0x08008000, LENGTH = 2016K - - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 16K - DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - SRAM1 (rwx) : ORIGIN = 0x20020000, LENGTH = 368K - SRAM2 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH_AXIM - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH_AXIM - - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH_AXIM - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH_AXIM - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > SRAM1 AT > FLASH_AXIM - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > SRAM1 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } - - .ramfunc : { - _sramfuncs = .; - *(.ramfunc .ramfunc.*) - . = ALIGN(4); - _eramfuncs = .; - } > ITCM_RAM AT > FLASH_AXIM - - _framfuncs = LOADADDR(.ramfunc); -} diff --git a/boards/holybro/pix32v5/src/CMakeLists.txt b/boards/holybro/pix32v5/src/CMakeLists.txt deleted file mode 100644 index 7866220..0000000 --- a/boards/holybro/pix32v5/src/CMakeLists.txt +++ /dev/null @@ -1,56 +0,0 @@ -############################################################################ -# -# Copyright (c) 2016 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. -# -############################################################################ - -add_library(drivers_board - can.c - i2c.cpp - init.c - led.c - manifest.c - sdio.c - spi.cpp - timer_config.cpp - usb.c -) -add_dependencies(drivers_board arch_board_hw_info) - -target_link_libraries(drivers_board - PRIVATE - arch_board_hw_info - arch_io_pins - arch_spi - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer -) diff --git a/boards/holybro/pix32v5/src/board_config.h b/boards/holybro/pix32v5/src/board_config.h deleted file mode 100644 index 67b3909..0000000 --- a/boards/holybro/pix32v5/src/board_config.h +++ /dev/null @@ -1,480 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2016 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * PX4FMU-v5 internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ - -/* PX4IO connection configuration */ - -#define BOARD_USES_PX4IO_VERSION 2 -#define PX4IO_SERIAL_DEVICE "/dev/ttyS6" -#define PX4IO_SERIAL_TX_GPIO GPIO_UART8_TX -#define PX4IO_SERIAL_RX_GPIO GPIO_UART8_RX -#define PX4IO_SERIAL_BASE STM32_UART8_BASE -#define PX4IO_SERIAL_VECTOR STM32_IRQ_UART8 -#define PX4IO_SERIAL_TX_DMAMAP DMAMAP_UART8_TX -#define PX4IO_SERIAL_RX_DMAMAP DMAMAP_UART8_RX -#define PX4IO_SERIAL_RCC_REG STM32_RCC_APB1ENR -#define PX4IO_SERIAL_RCC_EN RCC_APB1ENR_UART8EN -#define PX4IO_SERIAL_CLOCK STM32_PCLK1_FREQUENCY -#define PX4IO_SERIAL_BITRATE 1500000 /* 1.5Mbps -> max rate for IO */ - -/* Configuration ************************************************************************************/ - -#define BOARD_HAS_LTC4417 - -#if defined(BOARD_HAS_LTC4417) -# define BOARD_HAS_LTC44XX_VALIDS 2 // No LTC or N Bricks -# define BOARD_HAS_USB_VALID 1 // LTC Has No USB valid -# define BOARD_HAS_NBAT_V 2 // Only one Vbat to ADC -# define BOARD_HAS_NBAT_I 2 // No Ibat ADC -#else -# define BOARD_HAS_LTC44XX_VALIDS 0 // No LTC or N Bricks -# define BOARD_HAS_USB_VALID 0 // LTC Has No USB valid -# define BOARD_HAS_NBAT_V 1 // Only one Vbat to ADC -# define BOARD_HAS_NBAT_I 0 // No Ibat ADC -#endif - -/* PX4FMU GPIOs ***********************************************************************************/ - -/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */ - -#define GPIO_nLED_RED /* PB1 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN1) -#define GPIO_nLED_GREEN /* PC6 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN6) -#define GPIO_nLED_BLUE /* PC7 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN7) - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_OVERLOAD_LED LED_RED -#define BOARD_ARMED_STATE_LED LED_BLUE - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that - * can be used by the Px4 Firmware in the adc driver - */ - -/* ADC defines to be used in sensors.cpp to read from a particular channel */ - -#define ADC1_CH(n) (n) -#define ADC1_GPIO(n) GPIO_ADC1_IN##n - -/* Define GPIO pins used as ADC N.B. Channel numbers must match below */ - -#define PX4_ADC_GPIO \ - /* PA0 */ ADC1_GPIO(0), \ - /* PA1 */ ADC1_GPIO(1), \ - /* PA2 */ ADC1_GPIO(2), \ - /* PA3 */ ADC1_GPIO(3), \ - /* PA4 */ ADC1_GPIO(4), \ - /* PB8 */ ADC1_GPIO(8), \ - /* PC0 */ ADC1_GPIO(10), \ - /* PC1 */ ADC1_GPIO(11), \ - /* PC2 */ ADC1_GPIO(12), \ - /* PC3 */ ADC1_GPIO(13), \ - /* PC4 */ ADC1_GPIO(14) - -/* Define Channel numbers must match above GPIO pin IN(n)*/ - -#define ADC_BATTERY1_VOLTAGE_CHANNEL /* PA0 */ ADC1_CH(0) -#define ADC_BATTERY1_CURRENT_CHANNEL /* PA1 */ ADC1_CH(1) -#define ADC_BATTERY2_VOLTAGE_CHANNEL /* PA2 */ ADC1_CH(2) -#define ADC_BATTERY2_CURRENT_CHANNEL /* PA3 */ ADC1_CH(3) -#define ADC1_SPARE_2_CHANNEL /* PA4 */ ADC1_CH(4) -#define ADC_RSSI_IN_CHANNEL /* PB0 */ ADC1_CH(8) -#define ADC_SCALED_V5_CHANNEL /* PC0 */ ADC1_CH(10) -#define ADC_SCALED_VDD_3V3_SENSORS_CHANNEL /* PC1 */ ADC1_CH(11) -#define ADC_HW_VER_SENSE_CHANNEL /* PC2 */ ADC1_CH(12) -#define ADC_HW_REV_SENSE_CHANNEL /* PC3 */ ADC1_CH(13) -#define ADC1_SPARE_1_CHANNEL /* PC4 */ ADC1_CH(14) - -#if BOARD_HAS_NBAT_V == 2 && BOARD_HAS_NBAT_I == 2 -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY1_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY1_CURRENT_CHANNEL) | \ - (1 << ADC_BATTERY2_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY2_CURRENT_CHANNEL) | \ - (1 << ADC1_SPARE_2_CHANNEL) | \ - (1 << ADC_RSSI_IN_CHANNEL) | \ - (1 << ADC_SCALED_V5_CHANNEL) | \ - (1 << ADC_SCALED_VDD_3V3_SENSORS_CHANNEL) | \ - (1 << ADC_HW_VER_SENSE_CHANNEL) | \ - (1 << ADC_HW_REV_SENSE_CHANNEL) | \ - (1 << ADC1_SPARE_1_CHANNEL)) -#elif BOARD_HAS_NBAT_V == 1 && BOARD_HAS_NBAT_I == 1 -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY1_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY1_CURRENT_CHANNEL) | \ - (1 << ADC1_SPARE_2_CHANNEL) | \ - (1 << ADC_RSSI_IN_CHANNEL) | \ - (1 << ADC_SCALED_V5_CHANNEL) | \ - (1 << ADC_SCALED_VDD_3V3_SENSORS_CHANNEL) | \ - (1 << ADC_HW_VER_SENSE_CHANNEL) | \ - (1 << ADC_HW_REV_SENSE_CHANNEL) | \ - (1 << ADC1_SPARE_1_CHANNEL)) -#elif BOARD_HAS_NBAT_V == 1 && BOARD_HAS_NBAT_I == 0 -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY1_VOLTAGE_CHANNEL) | \ - (1 << ADC1_SPARE_2_CHANNEL) | \ - (1 << ADC_RSSI_IN_CHANNEL) | \ - (1 << ADC_SCALED_V5_CHANNEL) | \ - (1 << ADC_SCALED_VDD_3V3_SENSORS_CHANNEL) | \ - (1 << ADC_HW_VER_SENSE_CHANNEL) | \ - (1 << ADC_HW_REV_SENSE_CHANNEL) | \ - (1 << ADC1_SPARE_1_CHANNEL)) -#endif - -/* HW has to large of R termination on ADC todo:change when HW value is chosen */ - -#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f) - -/* HW Version and Revision drive signals Default to 1 to detect */ - -#define BOARD_HAS_HW_VERSIONING - -#define GPIO_HW_REV_DRIVE /* PH14 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTH|GPIO_PIN14) -#define GPIO_HW_REV_SENSE /* PC3 */ ADC1_GPIO(13) -#define GPIO_HW_VER_DRIVE /* PG0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN0) -#define GPIO_HW_VER_SENSE /* PC2 */ ADC1_GPIO(12) -#define HW_INFO_INIT_PREFIX "VPIX32V5" - -#define VPIX32V500 HW_VER_REV(0x0,0x0) // PIX32V5 Rev 0 -#define VPIX32V540 HW_VER_REV(0x4,0x0) // HolyBro mini no can 2,3 - -/* CAN Silence - * - * Silent mode control \ ESC Mux select - */ - -#define GPIO_CAN1_SILENT_S0 /* PH2 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN2) -#define GPIO_CAN2_SILENT_S1 /* PH3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN3) -#define GPIO_CAN3_SILENT_S2 /* PH4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN4) - -#define UAVCAN_NUM_IFACES_RUNTIME 1 - -/* HEATER - * PWM in future - */ -#define GPIO_HEATER_OUTPUT /* PA7 T14CH1 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN7) -#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true)) - -/* PI0 is nARMED - * The GPIO will be set as input while not armed HW will have external HW Pull UP. - * While armed it shall be configured at a GPIO OUT set LOW - */ -#define GPIO_nARMED_INIT /* PI0 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTI|GPIO_PIN0) -#define GPIO_nARMED /* PI0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTI|GPIO_PIN0) - -#define BOARD_INDICATE_EXTERNAL_LOCKOUT_STATE(enabled) px4_arch_configgpio((enabled) ? GPIO_nARMED : GPIO_nARMED_INIT) - -/* PWM - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 11 - -#define BOARD_HAS_LED_PWM 1 -#define BOARD_LED_PWM_DRIVE_ACTIVE_LOW 1 - -#define BOARD_HAS_UI_LED_PWM 1 - -#define BOARD_UI_LED_PWM_DRIVE_ACTIVE_LOW 1 - - -/* Power supply control and monitoring GPIOs */ - -#define GPIO_nPOWER_IN_A /* PG1 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN1) -#define GPIO_nPOWER_IN_B /* PG2 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN2) -#define GPIO_nPOWER_IN_C /* PG3 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN3) - -#define GPIO_nVDD_BRICK1_VALID GPIO_nPOWER_IN_A /* Brick 1 Is Chosen */ -#define GPIO_nVDD_BRICK2_VALID GPIO_nPOWER_IN_B /* Brick 2 Is Chosen */ -#define BOARD_NUMBER_BRICKS 2 -#define GPIO_nVDD_USB_VALID GPIO_nPOWER_IN_C /* USB Is Chosen */ - -#define GPIO_nVDD_5V_PERIPH_EN /* PG4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN4) -#define GPIO_nVDD_5V_PERIPH_OC /* PE15 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTE|GPIO_PIN15) -#define GPIO_nVDD_5V_HIPOWER_EN /* PF12 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTF|GPIO_PIN12) -#define GPIO_nVDD_5V_HIPOWER_OC /* PG13 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTF|GPIO_PIN13) -#define GPIO_VDD_3V3_SPEKTRUM_POWER_EN /* PE4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN4) -#define GPIO_VDD_5V_RC_EN /* PG5 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN5) -#define GPIO_VDD_5V_WIFI_EN /* PG6 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN5) -#define GPIO_VDD_3V3_SD_CARD_EN /* PG7 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN7) - - -/* Define True logic Power Control in arch agnostic form */ - -#define VDD_5V_PERIPH_EN(on_true) px4_arch_gpiowrite(GPIO_nVDD_5V_PERIPH_EN, !(on_true)) -#define VDD_5V_HIPOWER_EN(on_true) px4_arch_gpiowrite(GPIO_nVDD_5V_HIPOWER_EN, !(on_true)) -#define VDD_3V3_SPEKTRUM_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SPEKTRUM_POWER_EN, (on_true)) -#define READ_VDD_3V3_SPEKTRUM_POWER_EN() px4_arch_gpioread(GPIO_VDD_3V3_SPEKTRUM_POWER_EN) -#define VDD_5V_RC_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_RC_EN, (on_true)) -#define VDD_5V_WIFI_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_WIFI_EN, (on_true)) -#define VDD_3V3_SD_CARD_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SD_CARD_EN, (on_true)) - -/* Tone alarm output */ - -#define TONE_ALARM_TIMER 9 /* timer 9 */ -#define TONE_ALARM_CHANNEL 1 /* PE5 TIM9_CH1 */ - -#define GPIO_BUZZER_1 /* PE5 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN5) - -#define GPIO_TONE_ALARM_IDLE GPIO_BUZZER_1 -#define GPIO_TONE_ALARM GPIO_TIM9_CH1OUT_2 - -/* USB OTG FS - * - * PA9 OTG_FS_VBUS VBUS sensing - */ -#define GPIO_OTGFS_VBUS /* PA9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 8 /* use timer8 for the HRT */ -#define HRT_TIMER_CHANNEL 3 /* use capture/compare channel 3 */ - -#define HRT_PPM_CHANNEL /* T8C1 */ 1 /* use capture/compare channel 1 */ -#define GPIO_PPM_IN /* PI5 T8C1 */ GPIO_TIM8_CH1IN_2 - -/* RC Serial port */ - -#define RC_SERIAL_PORT "/dev/ttyS4" -#define RC_SERIAL_SINGLEWIRE - -/* PWM input driver. Use FMU AUX5 pins attached to timer4 channel 2 */ -#define PWMIN_TIMER 4 -#define PWMIN_TIMER_CHANNEL /* T4C2 */ 2 -#define GPIO_PWM_IN /* PD13 */ GPIO_TIM4_CH2IN_2 - -/* Shared pins Both FMU and PX4IO control/monitor - * FMU Initializes these pins to passive input until it is known - * if we have and PX4IO on board - */ - -#define GPIO_RSSI_IN /* PB0 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN0) -#define GPIO_RSSI_IN_INIT /* PB0 */ 0 /* Leave as ADC RSSI_IN */ - -/* Safety Switch is HW version dependent on having an PX4IO - * So we init to a benign state with the _INIT definition - * and provide the the non _INIT one for the driver to make a run time - * decision to use it. - */ -#define GPIO_nSAFETY_SWITCH_LED_OUT_INIT /* PE12 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTE|GPIO_PIN12) -#define GPIO_nSAFETY_SWITCH_LED_OUT /* PE12 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN12) - -/* Enable the FMU to control it if there is no px4io fixme:This should be BOARD_SAFETY_LED(__ontrue) */ -#define GPIO_LED_SAFETY GPIO_nSAFETY_SWITCH_LED_OUT -#define GPIO_SAFETY_SWITCH_IN /* PE10 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN10) -/* Enable the FMU to use the switch it if there is no px4io fixme:This should be BOARD_SAFTY_BUTTON() */ -#define GPIO_BTN_SAFETY GPIO_SAFETY_SWITCH_IN /* Enable the FMU to control it if there is no px4io */ - -/* Power switch controls ******************************************************/ - -#define SPEKTRUM_POWER(_on_true) VDD_3V3_SPEKTRUM_POWER_EN(_on_true) - -/* - * FMUv5 has a separate RC_IN - * - * GPIO PPM_IN on PI5 T8CH1 - * SPEKTRUM_RX (it's TX or RX in Bind) on UART6 PG9 (NOT FMUv5 test HW ONLY) - * In version is possible in the UART - * and can drive GPIO PPM_IN as an output - */ - -#define GPIO_PPM_IN_AS_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTI|GPIO_PIN5) -#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_PPM_IN_AS_OUT) -#define SPEKTRUM_RX_AS_UART() /* Can be left as uart */ -#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true)) - -#define SDIO_SLOTNO 0 /* Only one slot */ -#define SDIO_MINOR 0 - -/* SD card bringup does not work if performed on the IDLE thread because it - * will cause waiting. Use either: - * - * CONFIG_BOARDCTL=y, OR - * CONFIG_BOARD_INITIALIZE=y && CONFIG_BOARD_INITTHREAD=y - */ - -#if defined(CONFIG_BOARD_INITIALIZE) && !defined(CONFIG_BOARDCTL) && \ - !defined(CONFIG_BOARD_INITTHREAD) -# warning SDIO initialization cannot be perfomed on the IDLE thread -#endif - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) - -#if BOARD_HAS_USB_VALID == 1 -# define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID)) -#else -# define BOARD_ADC_USB_VALID BOARD_ADC_USB_CONNECTED -#endif - -/* FMUv5 never powers odd the Servo rail */ - -#define BOARD_ADC_SERVO_VALID (1) - -#if !defined(BOARD_HAS_LTC44XX_VALIDS) || BOARD_HAS_LTC44XX_VALIDS == 0 -# define BOARD_ADC_BRICK1_VALID (1) -# define BOARD_ADC_BRICK2_VALID (0) -#elif BOARD_HAS_LTC44XX_VALIDS == 1 -# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -# define BOARD_ADC_BRICK2_VALID (0) -#elif BOARD_HAS_LTC44XX_VALIDS == 2 -# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -# define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID)) -#elif BOARD_HAS_LTC44XX_VALIDS == 3 -# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -# define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID)) -# define BOARD_ADC_BRICK3_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK3_VALID)) -#elif BOARD_HAS_LTC44XX_VALIDS == 4 -# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -# define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID)) -# define BOARD_ADC_BRICK3_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK3_VALID)) -# define BOARD_ADC_BRICK4_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK4_VALID)) -#else -# error Unsupported BOARD_HAS_LTC44XX_VALIDS value -#endif - -#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_nVDD_5V_PERIPH_OC)) -#define BOARD_ADC_HIPOWER_5V_OC (!px4_arch_gpioread(GPIO_nVDD_5V_HIPOWER_OC)) - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ - -#define BOARD_HAS_ON_RESET 1 - -#define PX4_GPIO_INIT_LIST { \ - 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, \ - GPIO_nPOWER_IN_C, \ - GPIO_nVDD_5V_PERIPH_EN, \ - GPIO_nVDD_5V_PERIPH_OC, \ - GPIO_nVDD_5V_HIPOWER_EN, \ - GPIO_nVDD_5V_HIPOWER_OC, \ - GPIO_VDD_3V3_SPEKTRUM_POWER_EN, \ - GPIO_VDD_5V_RC_EN, \ - GPIO_VDD_5V_WIFI_EN, \ - GPIO_VDD_3V3_SD_CARD_EN, \ - GPIO_TONE_ALARM_IDLE, \ - GPIO_RSSI_IN_INIT, \ - GPIO_nSAFETY_SWITCH_LED_OUT_INIT, \ - GPIO_SAFETY_SWITCH_IN, \ - GPIO_nARMED_INIT \ - } - -#define BOARD_ENABLE_CONSOLE_BUFFER - -#define BOARD_NUM_IO_TIMERS 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 - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/holybro/pix32v5/src/can.c b/boards/holybro/pix32v5/src/can.c deleted file mode 100644 index fb3ecce..0000000 --- a/boards/holybro/pix32v5/src/can.c +++ /dev/null @@ -1,151 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file can.c - * - * Board-specific CAN functions. - */ - -#if !defined(CONFIG_CAN) - -#include - -#include "board_config.h" - - -__EXPORT -uint16_t board_get_can_interfaces(void) -{ - uint16_t enabled_interfaces = 0x7; - - if (!PX4_MFT_HW_SUPPORTED(PX4_MFT_CAN2)) { - enabled_interfaces &= ~(1 << 1); - } - - if (!PX4_MFT_HW_SUPPORTED(PX4_MFT_CAN3)) { - enabled_interfaces &= ~(1 << 2); - } - - return enabled_interfaces; -} - -#else - -#include -#include - -#include -#include - -#include "chip.h" -#include "arm_internal.h" - -#include "chip.h" -#include "stm32_can.h" -#include "board_config.h" - -#ifdef CONFIG_CAN - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) -# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." -# undef CONFIG_STM32_CAN2 -#endif - -#ifdef CONFIG_STM32_CAN1 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); - -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} - -#endif - -#endif /* CONFIG_CAN */ diff --git a/boards/holybro/pix32v5/src/i2c.cpp b/boards/holybro/pix32v5/src/i2c.cpp deleted file mode 100644 index a74041d..0000000 --- a/boards/holybro/pix32v5/src/i2c.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(4), - initI2CBusExternal(2), - initI2CBusExternal(1), - initI2CBusInternal(3), -}; diff --git a/boards/holybro/pix32v5/src/init.c b/boards/holybro/pix32v5/src/init.c deleted file mode 100644 index 2153838..0000000 --- a/boards/holybro/pix32v5/src/init.c +++ /dev/null @@ -1,284 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-2019 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * PX4FMU-specific early startup code. This file implements the - * board_app_initializ() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include "board_config.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ -#define _GPIO_PULL_DOWN_INPUT(def) (((def) & (GPIO_PORT_MASK | GPIO_PIN_MASK)) | (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_2MHz)) - -/* Configuration ************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - /* set the peripheral rails off */ - - VDD_5V_PERIPH_EN(false); - board_control_spi_sensors_power(false, 0xffff); - - bool last = READ_VDD_3V3_SPEKTRUM_POWER_EN(); - /* Keep Spektum on to discharge rail*/ - VDD_3V3_SPEKTRUM_POWER_EN(false); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ - VDD_3V3_SPEKTRUM_POWER_EN(last); - board_control_spi_sensors_power(true, 0xffff); - VDD_5V_PERIPH_EN(true); - -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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 - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Power on Interfaces */ - VDD_3V3_SD_CARD_EN(true); - VDD_5V_PERIPH_EN(true); - VDD_5V_HIPOWER_EN(true); - board_control_spi_sensors_power(true, 0xffff); - VDD_3V3_SPEKTRUM_POWER_EN(true); - VDD_5V_RC_EN(true); - VDD_5V_WIFI_EN(true); - - /* Need hrt running before using the ADC */ - - px4_platform_init(); - - - if (OK == board_determine_hw_info()) { - syslog(LOG_INFO, "[boot] Rev 0x%1x : Ver 0x%1x %s\n", board_get_hw_revision(), board_get_hw_version(), - board_get_hw_type_name()); - - } else { - syslog(LOG_ERR, "[boot] Failed to read HW revision and version\n"); - } - - /* configure SPI interfaces (after we determined the HW version) */ - - stm32_spiinitialize(); - - /* Does this board have CAN 2 or CAN 3 if not decouple the RX - * from IP block Leave TX connected - */ - - if (!PX4_MFT_HW_SUPPORTED(PX4_MFT_CAN2)) { - px4_arch_configgpio(_GPIO_PULL_DOWN_INPUT(GPIO_CAN2_RX)); - } - - if (!PX4_MFT_HW_SUPPORTED(PX4_MFT_CAN3)) { - px4_arch_configgpio(_GPIO_PULL_DOWN_INPUT(GPIO_CAN3_RX)); - } - - /* configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_on(LED_GREEN); // Indicate Power. - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - -#ifdef CONFIG_MMCSD - int ret = stm32_sdio_initialize(); - - if (ret != OK) { - led_on(LED_RED); - } - -#endif /* CONFIG_MMCSD */ - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/holybro/pix32v5/src/led.c b/boards/holybro/pix32v5/src/led.c deleted file mode 100644 index edc8784..0000000 --- a/boards/holybro/pix32v5/src/led.c +++ /dev/null @@ -1,232 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * PX4FMU LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -#ifdef CONFIG_ARCH_LEDS -static bool nuttx_owns_leds = true; -// B R S G -// 0 1 2 3 -static const uint8_t xlatpx4[] = {1, 2, 4, 0}; -# define xlat(p) xlatpx4[(p)] -static uint32_t g_ledmap[] = { - GPIO_nLED_GREEN, // Indexed by BOARD_LED_GREEN - GPIO_nLED_BLUE, // Indexed by BOARD_LED_BLUE - GPIO_nLED_RED, // Indexed by BOARD_LED_RED - GPIO_nSAFETY_SWITCH_LED_OUT, // Indexed by LED_SAFETY by xlatpx4 -}; - -#else - -# define xlat(p) (p) -static uint32_t g_ledmap[] = { - GPIO_nLED_BLUE, // Indexed by LED_BLUE - GPIO_nLED_RED, // Indexed by LED_RED, LED_AMBER - GPIO_nSAFETY_SWITCH_LED_OUT_INIT, // Indexed by LED_SAFETY (defaulted to an input) - GPIO_nLED_GREEN, // Indexed by LED_GREEN -}; - -#endif - -__EXPORT void led_init(void) -{ - /* Configure LED GPIOs for output */ - if (!PX4_MFT_HW_SUPPORTED(PX4_MFT_PX4IO)) { - g_ledmap[2] = GPIO_nSAFETY_SWITCH_LED_OUT; - } - - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - stm32_configgpio(g_ledmap[l]); - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - - stm32_gpiowrite(g_ledmap[led], !state); -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - return !stm32_gpioread(g_ledmap[led]); -} - -__EXPORT void led_on(int led) -{ - phy_set_led(xlat(led), true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(xlat(led), false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(xlat(led), !phy_get_led(xlat(led))); -} - -#ifdef CONFIG_ARCH_LEDS -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_autoled_initialize - ****************************************************************************/ - -void board_autoled_initialize(void) -{ - led_init(); -} - -/**************************************************************************** - * Name: board_autoled_on - ****************************************************************************/ - -void board_autoled_on(int led) -{ - if (!nuttx_owns_leds) { - return; - } - - switch (led) { - default: - break; - - case LED_HEAPALLOCATE: - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_IRQSENABLED: - phy_set_led(BOARD_LED_BLUE, false); - phy_set_led(BOARD_LED_GREEN, true); - break; - - case LED_STACKCREATED: - phy_set_led(BOARD_LED_GREEN, true); - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_INIRQ: - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_SIGNAL: - phy_set_led(BOARD_LED_GREEN, true); - break; - - case LED_ASSERTION: - phy_set_led(BOARD_LED_RED, true); - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_PANIC: - phy_set_led(BOARD_LED_RED, true); - break; - - case LED_IDLE : /* IDLE */ - phy_set_led(BOARD_LED_RED, true); - break; - } -} - -/**************************************************************************** - * Name: board_autoled_off - ****************************************************************************/ - -void board_autoled_off(int led) -{ - if (!nuttx_owns_leds) { - return; - } - - switch (led) { - default: - break; - - case LED_SIGNAL: - phy_set_led(BOARD_LED_GREEN, false); - break; - - case LED_INIRQ: - phy_set_led(BOARD_LED_BLUE, false); - break; - - case LED_ASSERTION: - phy_set_led(BOARD_LED_RED, false); - phy_set_led(BOARD_LED_BLUE, false); - break; - - case LED_PANIC: - phy_set_led(BOARD_LED_RED, false); - break; - - case LED_IDLE : /* IDLE */ - phy_set_led(BOARD_LED_RED, false); - break; - } -} - -#endif /* CONFIG_ARCH_LEDS */ diff --git a/boards/holybro/pix32v5/src/manifest.c b/boards/holybro/pix32v5/src/manifest.c deleted file mode 100644 index 6016087..0000000 --- a/boards/holybro/pix32v5/src/manifest.c +++ /dev/null @@ -1,179 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2018-2021 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. - * - ****************************************************************************/ - -/** - * @file manifest.c - * - * This module supplies the interface to the manifest of hardware that is - * optional and dependent on the HW REV and HW VER IDs - * - * The manifest allows the system to know whether a hardware option - * say for example the PX4IO is an no-pop option vs it is broken. - * - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include - -#include "systemlib/px4_macros.h" - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -typedef struct { - uint32_t hw_ver_rev; /* the version and revision */ - const px4_hw_mft_item_t *mft; /* The first entry */ - uint32_t entries; /* the lenght of the list */ -} px4_hw_mft_list_entry_t; - -typedef px4_hw_mft_list_entry_t *px4_hw_mft_list_entry; -#define px4_hw_mft_list_uninitialized (px4_hw_mft_list_entry) -1 - -static const px4_hw_mft_item_t device_unsupported = {0, 0, 0}; - -// List of components on a specific board configuration -// The index of those components is given by the enum (px4_hw_mft_item_id_t) -// declared in board_common.h - -static const px4_hw_mft_item_t hw_mft_list_v0500[] = { - { - // PX4_MFT_PX4IO - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, - { - // PX4_MFT_USB - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, - { - // PX4_MFT_CAN2 - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, - { - // PX4_MFT_CAN3 - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, -}; - -static const px4_hw_mft_item_t hw_mft_list_v0540[] = { - { - // PX4_MFT_PX4IO - .present = 0, - .mandatory = 0, - .connection = px4_hw_con_unknown, - }, - { - // PX4_MFT_USB - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, - { - // PX4_MFT_CAN2 - .present = 0, - .mandatory = 0, - .connection = px4_hw_con_unknown, - }, - { - // PX4_MFT_CAN3 - .present = 0, - .mandatory = 0, - .connection = px4_hw_con_unknown, - }, -}; - -static px4_hw_mft_list_entry_t mft_lists[] = { - {VPIX32V500, hw_mft_list_v0500, arraySize(hw_mft_list_v0500)}, - {VPIX32V540, hw_mft_list_v0540, arraySize(hw_mft_list_v0540)}, // HolyBro mini no can 2,3 -}; - -/************************************************************************************ - * Name: board_query_manifest - * - * Description: - * Optional returns manifest item. - * - * Input Parameters: - * manifest_id - the ID for the manifest item to retrieve - * - * Returned Value: - * 0 - item is not in manifest => assume legacy operations - * pointer to a manifest item - * - ************************************************************************************/ - -__EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) -{ - static px4_hw_mft_list_entry boards_manifest = px4_hw_mft_list_uninitialized; - - if (boards_manifest == px4_hw_mft_list_uninitialized) { - uint32_t ver_rev = board_get_hw_version() << 16; - ver_rev |= board_get_hw_revision(); - - for (unsigned i = 0; i < arraySize(mft_lists); i++) { - if (mft_lists[i].hw_ver_rev == ver_rev) { - boards_manifest = &mft_lists[i]; - break; - } - } - - if (boards_manifest == px4_hw_mft_list_uninitialized) { - syslog(LOG_ERR, "[boot] Board %08" PRIx32 " is not supported!\n", ver_rev); - } - } - - px4_hw_mft_item rv = &device_unsupported; - - if (boards_manifest != px4_hw_mft_list_uninitialized && - id < boards_manifest->entries) { - rv = &boards_manifest->mft[id]; - } - - return rv; -} diff --git a/boards/holybro/pix32v5/src/sdio.c b/boards/holybro/pix32v5/src/sdio.c deleted file mode 100644 index 869d757..0000000 --- a/boards/holybro/pix32v5/src/sdio.c +++ /dev/null @@ -1,177 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include "chip.h" -#include "board_config.h" -#include "stm32_gpio.h" -#include "stm32_sdmmc.h" - -#ifdef CONFIG_MMCSD - - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Card detections requires card support and a card detection GPIO */ - -#define HAVE_NCD 1 -#if !defined(GPIO_SDMMC1_NCD) -# undef HAVE_NCD -#endif - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -static FAR struct sdio_dev_s *sdio_dev; -#ifdef HAVE_NCD -static bool g_sd_inserted = 0xff; /* Impossible value */ -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_ncd_interrupt - * - * Description: - * Card detect interrupt handler. - * - ****************************************************************************/ - -#ifdef HAVE_NCD -static int stm32_ncd_interrupt(int irq, FAR void *context) -{ - bool present; - - present = !stm32_gpioread(GPIO_SDMMC1_NCD); - - if (sdio_dev && present != g_sd_inserted) { - sdio_mediachange(sdio_dev, present); - g_sd_inserted = present; - } - - return OK; -} -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_sdio_initialize - * - * Description: - * Initialize SDIO-based MMC/SD card support - * - ****************************************************************************/ - -int stm32_sdio_initialize(void) -{ - int ret; - -#ifdef HAVE_NCD - /* Card detect */ - - bool cd_status; - - /* Configure the card detect GPIO */ - - stm32_configgpio(GPIO_SDMMC1_NCD); - - /* Register an interrupt handler for the card detect pin */ - - stm32_gpiosetevent(GPIO_SDMMC1_NCD, true, true, true, stm32_ncd_interrupt); -#endif - - /* Mount the SDIO-based MMC/SD block driver */ - /* First, get an instance of the SDIO interface */ - - finfo("Initializing SDIO slot %d\n", SDIO_SLOTNO); - - sdio_dev = sdio_initialize(SDIO_SLOTNO); - - if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", SDIO_SLOTNO); - return -ENODEV; - } - - /* Now bind the SDIO interface to the MMC/SD driver */ - - finfo("Bind SDIO to the MMC/SD driver, minor=%d\n", SDIO_MINOR); - - ret = mmcsd_slotinitialize(SDIO_MINOR, sdio_dev); - - if (ret != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); - return ret; - } - - finfo("Successfully bound SDIO to the MMC/SD driver\n"); - -#ifdef HAVE_NCD - /* Use SD card detect pin to check if a card is g_sd_inserted */ - - cd_status = !stm32_gpioread(GPIO_SDMMC1_NCD); - finfo("Card detect : %d\n", cd_status); - - sdio_mediachange(sdio_dev, cd_status); -#else - /* Assume that the SD card is inserted. What choice do we have? */ - - sdio_mediachange(sdio_dev, true); -#endif - - return OK; -} - -#endif /* CONFIG_MMCSD */ diff --git a/boards/holybro/pix32v5/src/spi.cpp b/boards/holybro/pix32v5/src/spi.cpp deleted file mode 100644 index 15d9751..0000000 --- a/boards/holybro/pix32v5/src/spi.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20689, SPI::CS{GPIO::PortF, GPIO::Pin2}, SPI::DRDY{GPIO::PortB, GPIO::Pin4}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortF, GPIO::Pin3}, SPI::DRDY{GPIO::PortC, GPIO::Pin5}), - initSPIDevice(DRV_GYR_DEVTYPE_BMI055, SPI::CS{GPIO::PortF, GPIO::Pin4}, SPI::DRDY{GPIO::PortB, GPIO::Pin14}), - initSPIDevice(DRV_ACC_DEVTYPE_BMI055, SPI::CS{GPIO::PortG, GPIO::Pin10}, SPI::DRDY{GPIO::PortB, GPIO::Pin15}), - }, {GPIO::PortE, GPIO::Pin3}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortF, GPIO::Pin5}) - }), - initSPIBus(SPI::Bus::SPI4, { - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortF, GPIO::Pin10}), - }), - initSPIBusExternal(SPI::Bus::SPI5, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin4}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}), - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin11}) - }), - initSPIBusExternal(SPI::Bus::SPI6, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin6}), - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin7}), - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin8}) - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/holybro/pix32v5/src/timer_config.cpp b/boards/holybro/pix32v5/src/timer_config.cpp deleted file mode 100644 index 8bebdca..0000000 --- a/boards/holybro/pix32v5/src/timer_config.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1, DMA{DMA::Index2, DMA::Stream5, DMA::Channel6}), - initIOTimer(Timer::Timer4), - initIOTimer(Timer::Timer12), - initIOTimer(Timer::Timer2), - initIOTimer(Timer::Timer9), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortA, GPIO::Pin10}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer12, Timer::Channel1}, {GPIO::PortH, GPIO::Pin6}), - initIOTimerChannel(io_timers, {Timer::Timer12, Timer::Channel2}, {GPIO::PortH, GPIO::Pin9}), - initIOTimerChannelCapture(io_timers, {Timer::Timer2, Timer::Channel1}, {GPIO::PortA, GPIO::Pin5}), - initIOTimerChannelCapture(io_timers, {Timer::Timer2, Timer::Channel2}, {GPIO::PortB, GPIO::Pin3}), - initIOTimerChannelCapture(io_timers, {Timer::Timer2, Timer::Channel4}, {GPIO::PortB, GPIO::Pin11}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); - -#if defined(BOARD_HAS_LED_PWM) || defined(BOARD_HAS_UI_LED_PWM) -constexpr io_timers_t led_pwm_timers[MAX_LED_TIMERS] = { -# if defined(BOARD_HAS_UI_LED_PWM) - initIOTimer(Timer::Timer5), -# endif -# if defined(BOARD_HAS_LED_PWM) && !defined(BOARD_HAS_CONTROL_STATUS_LEDS) - initIOTimer(Timer::Timer3), -# endif -}; - -/* Support driving active low (preferred) or active high LED - * on both the onboard status LEDs or the [n]UI_LED_[_EXTERNAL] - * - * Use open drain to drive the LED. This will ensure that - * if the LED has a 5 Volt supply that the LED will be - * off when high. - */ -#define CCER_C1_NUM_BITS 4 -#define ACTIVE_LOW(c) (GTIM_CCER_CC1P << (((c)-1) * CCER_C1_NUM_BITS)) -#define ACTIVE_HIGH(c) 0 - -#if defined(BOARD_LED_PWM_DRIVE_ACTIVE_LOW) -# define POLARITY(c) ACTIVE_LOW(c) -# define DRIVE_TYPE(p) ((p)|GPIO_OPENDRAIN) -#else -# define POLARITY(c) ACTIVE_HIGH((c)) -# define DRIVE_TYPE(p) (p) -#endif - -#if defined(BOARD_UI_LED_PWM_DRIVE_ACTIVE_LOW) -# define UI_POLARITY(c) ACTIVE_LOW(c) -# define UI_DRIVE_TYPE(p) ((p)|GPIO_OPENDRAIN) -#else -# define UI_POLARITY(c) ACTIVE_HIGH((c)) -# define UI_DRIVE_TYPE(p) (p) -#endif - -static inline constexpr timer_io_channels_t initIOTimerChannelUILED(const io_timers_t io_timers_conf[MAX_LED_TIMERS], - Timer::TimerChannel timer, GPIO::GPIOPin pin, int ui_polarity) -{ - timer_io_channels_t ret = initIOTimerChannel(io_timers_conf, timer, pin); - ret.gpio_out = UI_DRIVE_TYPE(ret.gpio_out); - ret.masks = UI_POLARITY(ui_polarity); - return ret; -} - -static inline constexpr timer_io_channels_t initIOTimerChannelControlLED(const io_timers_t - io_timers_conf[MAX_LED_TIMERS], - Timer::TimerChannel timer, GPIO::GPIOPin pin, int polarity) -{ - timer_io_channels_t ret = initIOTimerChannel(io_timers_conf, timer, pin); - ret.gpio_out = DRIVE_TYPE(ret.gpio_out); - ret.masks = POLARITY(polarity); - return ret; -} - -constexpr timer_io_channels_t led_pwm_channels[MAX_TIMER_LED_CHANNELS] = { -# if defined(BOARD_HAS_UI_LED_PWM) -# if defined(BOARD_UI_LED_SWAP_RG) - initIOTimerChannelUILED(led_pwm_timers, {Timer::Timer5, Timer::Channel2}, {GPIO::PortH, GPIO::Pin11}, 2), - initIOTimerChannelUILED(led_pwm_timers, {Timer::Timer5, Timer::Channel1}, {GPIO::PortH, GPIO::Pin10}, 1), - initIOTimerChannelUILED(led_pwm_timers, {Timer::Timer5, Timer::Channel3}, {GPIO::PortH, GPIO::Pin12}, 3), -# else - initIOTimerChannelUILED(led_pwm_timers, {Timer::Timer5, Timer::Channel1}, {GPIO::PortH, GPIO::Pin10}, 1), - initIOTimerChannelUILED(led_pwm_timers, {Timer::Timer5, Timer::Channel2}, {GPIO::PortH, GPIO::Pin11}, 2), - initIOTimerChannelUILED(led_pwm_timers, {Timer::Timer5, Timer::Channel3}, {GPIO::PortH, GPIO::Pin12}, 3), -# endif -# endif -# if defined(BOARD_HAS_LED_PWM) && !defined(BOARD_HAS_CONTROL_STATUS_LEDS) - initIOTimerChannelControlLED(led_pwm_timers, {Timer::Timer3, Timer::Channel4}, {GPIO::PortB, GPIO::Pin1}, 4), - initIOTimerChannelControlLED(led_pwm_timers, {Timer::Timer3, Timer::Channel1}, {GPIO::PortC, GPIO::Pin6}, 1), - initIOTimerChannelControlLED(led_pwm_timers, {Timer::Timer3, Timer::Channel2}, {GPIO::PortC, GPIO::Pin7}, 2), -# endif -}; -#endif // BOARD_HAS_LED_PWM || BOARD_HAS_UI_LED_PWM diff --git a/boards/holybro/pix32v5/src/usb.c b/boards/holybro/pix32v5/src/usb.c deleted file mode 100644 index 0e28676..0000000 --- a/boards/holybro/pix32v5/src/usb.c +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#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 - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/matek/gnss-m9n-f4/canbootloader.px4board b/boards/matek/gnss-m9n-f4/canbootloader.px4board deleted file mode 100644 index 4691728..0000000 --- a/boards/matek/gnss-m9n-f4/canbootloader.px4board +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_ROMFSROOT="" -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_DRIVERS_BOOTLOADERS=y diff --git a/boards/matek/gnss-m9n-f4/default.px4board b/boards/matek/gnss-m9n-f4/default.px4board deleted file mode 100644 index 13ecd3e..0000000 --- a/boards/matek/gnss-m9n-f4/default.px4board +++ /dev/null @@ -1,42 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_ROMFSROOT="cannode" -CONFIG_BOARD_CONSTRAINED_FLASH=y -CONFIG_BOARD_NO_HELP=y -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS2" -CONFIG_DRIVERS_BAROMETER_DPS310=y -CONFIG_DRIVERS_BOOTLOADERS=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_MAGNETOMETER_RM3100=y -CONFIG_BOARD_UAVCAN_INTERFACES=1 -CONFIG_DRIVERS_UAVCANNODE=y -CONFIG_UAVCANNODE_BEEP_COMMAND=y -CONFIG_UAVCANNODE_GNSS_FIX=y -CONFIG_UAVCANNODE_LIGHTS_COMMAND=y -CONFIG_UAVCANNODE_MAGNETIC_FIELD_STRENGTH=y -CONFIG_UAVCANNODE_RTK_DATA=y -CONFIG_UAVCANNODE_SAFETY_BUTTON=y -CONFIG_UAVCANNODE_STATIC_PRESSURE=y -CONFIG_UAVCANNODE_STATIC_TEMPERATURE=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_SENSORS=y -# CONFIG_SENSORS_VEHICLE_AIRSPEED is not set -# CONFIG_SENSORS_VEHICLE_AIR_DATA is not set -# CONFIG_SENSORS_VEHICLE_GPS_POSITION is not set -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_SERIAL_PASSTHRU=y -CONFIG_SERIAL_PASSTHRU_UBLOX=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/matek/gnss-m9n-f4/firmware.prototype b/boards/matek/gnss-m9n-f4/firmware.prototype deleted file mode 100755 index 41a0906..0000000 --- a/boards/matek/gnss-m9n-f4/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 1014, - "magic": "PX4FWv1", - "description": "Firmware for the MatekM9nf4can cannode board", - "image": "", - "build_time": 0, - "summary": "MateksysGnss-m9n-f4", - "version": "0.1", - "image_size": 0, - "image_maxsize": 983040, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/matek/gnss-m9n-f4/init/rc.board_sensors b/boards/matek/gnss-m9n-f4/init/rc.board_sensors deleted file mode 100755 index 065107a..0000000 --- a/boards/matek/gnss-m9n-f4/init/rc.board_sensors +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# -# Matek M9NF4 CAN specific board sensors init -#------------------------------------------------------------------------------ - -icm20602 -s -R 10 start - -rm3100 -b 2 -s -R 12 start - -dps310 -a 118 -X start - -sensors start diff --git a/boards/matek/gnss-m9n-f4/nuttx-config/canbootloader/defconfig b/boards/matek/gnss-m9n-f4/nuttx-config/canbootloader/defconfig deleted file mode 100644 index 8c97388..0000000 --- a/boards/matek/gnss-m9n-f4/nuttx-config/canbootloader/defconfig +++ /dev/null @@ -1,60 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/matek/gnss-m9n-f4/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F405RG=y -CONFIG_ARCH_INTERRUPTSTACK=4096 -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BINFMT_DISABLE=y -CONFIG_BOARDCTL=y -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DISABLE_MOUNTPOINT=y -CONFIG_EXPERIMENTAL=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=4096 -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_MM_REGIONS=2 -CONFIG_NAME_MAX=0 -CONFIG_NUNGET_CHARS=0 -CONFIG_PREALLOC_TIMERS=0 -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=131072 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_DISABLE_BUFFERING=y -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_NOEXT_VECTORS=y -CONFIG_STM32_TIM8=y -CONFIG_TASK_NAME_SIZE=0 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/matek/gnss-m9n-f4/nuttx-config/include/board.h b/boards/matek/gnss-m9n-f4/nuttx-config/include/board.h deleted file mode 100755 index 27c84f0..0000000 --- a/boards/matek/gnss-m9n-f4/nuttx-config/include/board.h +++ /dev/null @@ -1,302 +0,0 @@ -/************************************************************************************ - * include/arch/board/board.h - * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Copyright (c) 2018 PX4 Development Team. All rights reserved. - * Author: Nathan Tsoi - * - * 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 NuttX 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. - * - ************************************************************************************/ - -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H - -#include "board_dma_map.h" - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include -#ifndef __ASSEMBLY__ -# include -#endif - -#include - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The Mateksys GNSS M9N-F4 board features a single 8MHz crystal. - * - * This is the canonical configuration: - * System Clock source : PLL (HSE) - * SYSCLK(Hz) : 168000000 Determined by PLL configuration - * HCLK(Hz) : 168000000 (STM32_RCC_CFGR_HPRE) - * AHB Prescaler : 1 (STM32_RCC_CFGR_HPRE) - * APB1 Prescaler : 4 (STM32_RCC_CFGR_PPRE1) - * APB2 Prescaler : 2 (STM32_RCC_CFGR_PPRE2) - * HSE Frequency(Hz) : 8000000 (STM32_BOARD_XTAL) - * PLLM : 8 (STM32_PLLCFG_PLLM) - * PLLN : 336 (STM32_PLLCFG_PLLN) - * PLLP : 2 (STM32_PLLCFG_PLLP) - * PLLQ : 7 (STM32_PLLCFG_PLLQ) - * Main regulator output voltage : Scale1 mode Needed for high speed SYSCLK - * Flash Latency(WS) : 5 - * Prefetch Buffer : OFF - * Instruction cache : ON - * Data cache : ON - * Require 48MHz for USB OTG FS, : Enabled - * SDIO and RNG clock - */ - -/* HSI - 16 MHz RC factory-trimmed - * LSI - 32 KHz RC - * HSE - On-board crystal frequency is 8MHz - * LSE - 32.768 kHz - */ - -#define STM32_BOARD_USEHSE 1 -#define STM32_BOARD_XTAL 8000000ul -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 - -/* Main PLL Configuration. - * - * PLL source is HSE - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * = (8,000,000 / 8) * 336 - * = 336,000,000 - * SYSCLK = PLL_VCO / PLLP - * = 336,000,000 / 2 = 168,000,000 - * USB OTG FS, SDIO and RNG Clock - * = PLL_VCO / PLLQ - * = 48,000,000 - */ - -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(8) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(336) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(7) - -#define STM32_SYSCLK_FREQUENCY 168000000ul - -/* AHB clock (HCLK) is SYSCLK (168MHz) */ - -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (42MHz) */ - -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (84MHz) */ - -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx - * otherwise frequency is 2xAPBx. - * Note: TIM1,8-11 are on APB2, others on APB1 - */ - -#define BOARD_TIM1_FREQUENCY STM32_APB2_TIM1_CLKIN -#define BOARD_TIM2_FREQUENCY STM32_APB1_TIM2_CLKIN -#define BOARD_TIM3_FREQUENCY STM32_APB1_TIM3_CLKIN -#define BOARD_TIM4_FREQUENCY STM32_APB1_TIM4_CLKIN -#define BOARD_TIM5_FREQUENCY STM32_APB1_TIM5_CLKIN -#define BOARD_TIM6_FREQUENCY STM32_APB1_TIM6_CLKIN -#define BOARD_TIM7_FREQUENCY STM32_APB1_TIM7_CLKIN -#define BOARD_TIM8_FREQUENCY STM32_APB2_TIM8_CLKIN -#define BOARD_TIM9_FREQUENCY STM32_APB2_TIM9_CLKIN -#define BOARD_TIM10_FREQUENCY STM32_APB2_TIM10_CLKIN -#define BOARD_TIM11_FREQUENCY STM32_APB2_TIM11_CLKIN -#define BOARD_TIM12_FREQUENCY STM32_APB1_TIM12_CLKIN -#define BOARD_TIM13_FREQUENCY STM32_APB1_TIM13_CLKIN -#define BOARD_TIM14_FREQUENCY STM32_APB1_TIM14_CLKIN - -/* LED definitions ******************************************************************/ -/* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any - * way. The following definitions are used to access individual LEDs. - */ - -/* LED index values for use with stm32_setled() */ - -#define BOARD_LED1 0 -#define BOARD_LED2 1 -#define BOARD_NLEDS 2 - -#define BOARD_LED_BLUE BOARD_LED1 -#define BOARD_LED_GREEN BOARD_LED2 - -/* LED bits for use with stm32_setleds() */ - -#define BOARD_LED1_BIT (1 << BOARD_LED1) -#define BOARD_LED2_BIT (1 << BOARD_LED2) - -/* If CONFIG_ARCH_LEDs is defined, then NuttX will control the 2 LEDs on board - * The following definitions describe how NuttX controls the LEDs: - */ - -#define LED_STARTED 0 /* LED1 */ -#define LED_HEAPALLOCATE 1 /* LED2 */ -#define LED_IRQSENABLED 2 /* LED1 */ -#define LED_STACKCREATED 3 /* LED1 + LED2 */ -#define LED_INIRQ 4 /* LED1 */ -#define LED_SIGNAL 5 /* LED2 */ -#define LED_ASSERTION 6 /* LED1 + LED2 */ -#define LED_PANIC 7 /* LED1 + LED2 */ - -/* Alternate function pin selections ************************************************/ - -/* UART1: - * - * PA10 (RX) and PA9 (TX) are broken out on J5 - */ - -#define GPIO_USART1_RX GPIO_USART1_RX_1 -#define GPIO_USART1_TX GPIO_USART1_TX_1 - -/* UART2: - * - * PA10 (RX) and PA9 (TX) are broken out on J5 - */ - -//#define GPIO_USART2_RX GPIO_USART2_RX_1 -//#define GPIO_USART2_TX GPIO_USART2_TX_1 - -/* USART3: - * - * PC10 (TX) and PC11 (RX) are broken out on J4 - * - * - * The Silkscreen pin labeled SCL is TX - * MISO is RX - */ -#define GPIO_USART3_RX GPIO_USART3_RX_2 -#define GPIO_USART3_TX GPIO_USART3_TX_2 - -/* UART4: - * - * PA0 (TX) -- Labeled RSSI on the silkscreen is only broken out on a test pad - * on the pro version. It's on a 2.54mm header on other versions - * PA1 (RX) -- Motor 5 out - */ -#define GPIO_UART4_RX GPIO_UART4_RX_1 -#define GPIO_UART4_TX GPIO_UART4_TX_1 - -/* UART5: - * - * PC6 (TX) and PC7 (RX) are broken out on J10 - */ - -//#define GPIO_UART5_RX GPIO_UART5_RX_1 -//#define GPIO_UART5_TX GPIO_UART5_TX_1 - -/* CAN */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_2 -#define GPIO_CAN1_TX GPIO_CAN1_TX_2 - -/* SPI1: - * CS: PA4 -- configured in board_config.h - * CLK: PA5 - * MISO: PA6 - * MOSI: PA7 - */ - -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 - -/* SPI2: - * SD Card - * CS: PB12 -- configured in board_config.h - * CLK: PB13 - * MISO: PB14 - * MOSI: PB15 - */ - -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_2 -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 - -/* SPI3: SD CARD - * CS: PC14 -- configured in board_config.h - * CLK: PB3 - * MISO: PB4 - * MOSI: PB5 - */ - -#define GPIO_SPI3_SCK GPIO_SPI3_SCK_1 -#define GPIO_SPI3_MISO GPIO_SPI3_MISO_1 -#define GPIO_SPI3_MOSI GPIO_SPI3_MOSI_1 - -/* - * I2C (external) - * - * SCL: PB10 - * SDA: PB11 - * - * TODO: - * The optional _GPIO configurations allow the I2C driver to manually - * reset the bus to clear stuck slaves. They match the pin configuration, - * but are normally-high GPIOs. - */ -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_1 -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_1 - -#endif /* __CONFIG_M9NF4_INCLUDE_BOARD_H */ diff --git a/boards/matek/gnss-m9n-f4/nuttx-config/include/board_dma_map.h b/boards/matek/gnss-m9n-f4/nuttx-config/include/board_dma_map.h deleted file mode 100755 index 81de4f9..0000000 --- a/boards/matek/gnss-m9n-f4/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/* -| DMA1 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | SPI3_RX_1 | - | SPI3_RX_2 | SPI2_RX | SPI2_TX | SPI3_TX_1 | - | SPI3_TX_2 | -| Channel 1 | I2C1_RX | - | TIM7_UP_1 | - | TIM7_UP_2 | I2C1_RX_1 | I2C1_TX | I2C1_TX_1 | -| Channel 2 | TIM4_CH1 | - | I2C4_RX | TIM4_CH2 | - | I2C4_RX | TIM4_UP | TIM4_CH3 | -| Channel 3 | - | TIM2_UP_1 | I2C3_RX_1 | I2C2_EXT_RX | I2C3_TX | TIM2_CH1 | TIM2_CH2 | TIM2_UP_2 | -| | | TIM2_CH3 | | | | | TIM2_CH4_1 | TIM2_CH4_2 | -| Channel 4 | UART5_RX | USART3_RX | UART4_RX | USART3_TX_1 | UART4_TX | USART2_RX | USART2_TX | UART5_TX | -| Channel 5 | UART8_TX | UART7_TX | TIM3_CH4 | UART7_RX | TIM3_CH1 | TIM3_CH2 | UART8_RX | TIM3_CH3 | -| | | | TIM3_UP | | TIM3_TRIG | | | | -| Channel 6 | TIM5_CH3 | TIM5_CH4_1 | TIM5_CH1 | TIM5_CH4_2 | TIM5_CH2 | - | TIM5_UP_2 | - | -| | TIM5_UP_1 | TIM5_TRIG_1 | | TIM5_TRIG_2 | | | | | -| Channel 7 | - | TIM6_UP | I2C2_RX | I2C2_RX_1 | USART3_TX_2 | DAC1 | DAC2 | I2C2_TX | -| | | | | | | | | | -| Usage | SPI3_RX | TIM2_UP_1 | UART4_RX | SPI2_RX | SPI2_TX | | | SPI3_TX | - - -| DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | ADC1_1 | SAI1_A | TIM8_CH1_1 | SAI1_A_1 | ADC1_2 | SAI1_B_1 | TIM1_CH1_1 | - | -| | | | TIM8_CH2_1 | | | | TIM1_CH2_1 | | -| | | | TIM8_CH3_1 | | | | TIM1_CH3_1 | | -| Channel 1 | - | DCMI_1 | ADC2_1 | ADC2_2 | SAI1_B | SPI6_TX | SPI6_RX | DCMI_2 | -| Channel 2 | ADC3_1 | ADC3_2 | - | SPI5_RX_1 | SPI5_TX_1 | CRYP_OUT | CRYP_IN | HASH_IN | -| Channel 3 | SPI1_RX_1 | - | SPI1_RX_2 | SPI1_TX_1 | - | SPI1_TX_2 | - | QUADSPI | -| Channel 4 | SPI4_RX_1 | SPI4_TX_1 | USART1_RX_1 | SDIO | - | USART1_RX_2 | SDIO | USART1_TX | -| Channel 5 | - | USART6_RX_1 | USART6_RX_2 | SPI4_RX_2 | SPI4_TX_2 | - | USART6_TX_1 | USART6_TX_2 | -| Channel 6 | TIM1_TRIG_1 | TIM1_CH1_2 | TIM1_CH2_2 | TIM1_CH1 | TIM1_CH4 | TIM1_UP | TIM1_CH3_2 | - | -| | | | | | TIM1_TRIG_2 | | | | -| | | | | | TIM1_COM | | | | -| Channel 7 | - | TIM8_UP | TIM8_CH1_2 | TIM8_CH2_2 | TIM8_CH3_2 | SPI5_RX_2 | SPI5_TX_2 | TIM8_CH4 | -| | | | | | | | | TIM8_TRIG | -| | | | | | | | | TIM8_COM | -| | | | | | | | | | -| Usage | SPI1_RX_1 | USART6_RX_1 | USART1_RX_1 | SPI1_TX_1 | | | | | - */ - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMAMAP_USART1_RX DMAMAP_USART1_RX_1 // DMA2, Stream 2, Channel 4 (CONSOLE) -//#define DMAMAP_UART4_RX DMAMAP_UART4_RX // DMA1, Stream 2, Channel 4 (GPS) - -#define DMACHAN_SPI2_RX DMAMAP_SPI2_RX // DMA1, Stream 3, Channel 0 (SPI2 RX) -#define DMACHAN_SPI2_TX DMAMAP_SPI2_TX // DMA1, Stream 4, Channel 0 (SPI2 TX) -#define DMACHAN_SPI3_RX DMAMAP_SPI3_RX_1 // DMA1, Stream 0, Channel 0 (SPI3 RX SD) -#define DMACHAN_SPI3_TX DMAMAP_SPI3_TX_2 // DMA1, Stream 7, Channel 0 (SPI3 TX SD) - -#define DMACHAN_SPI1_RX DMAMAP_SPI1_RX_1 // DMA2, Stream 0, Channel 3 (SPI1 RX) -#define DMACHAN_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 3, Channel 3 (SPI1 TX) diff --git a/boards/matek/gnss-m9n-f4/nuttx-config/nsh/defconfig b/boards/matek/gnss-m9n-f4/nuttx-config/nsh/defconfig deleted file mode 100644 index fb6ecf3..0000000 --- a/boards/matek/gnss-m9n-f4/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,217 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_OS_API is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CMP is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_SPI_CALLBACK is not set -# CONFIG_STM32_CCMEXCLUDE is not set -# CONFIG_STM32_DMACAPABLE is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/matek/gnss-m9n-f4/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F405RG=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_BULKIN_REQLEN=96 -CONFIG_CDCACM_PRODUCTID=0x1004 -CONFIG_CDCACM_PRODUCTSTR="Matekgnssm9nf4" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=2000 -CONFIG_CDCACM_VENDORID=0x120A -CONFIG_CDCACM_VENDORSTR="PX4" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MM_REGIONS=2 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_MMCSDSPIPORTNO=3 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=131072 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32_ADC1=y -CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y -CONFIG_STM32_DMA1=y -CONFIG_STM32_DMA2=y -CONFIG_STM32_FLASH_PREFETCH=y -CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_STM32_I2C2=y -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_OTGFS=y -CONFIG_STM32_OTGHS=y -CONFIG_STM32_PWR=y -CONFIG_STM32_RTC=y -CONFIG_STM32_RTC_HSECLOCK=y -CONFIG_STM32_RTC_MAGIC=0xfacefeee -CONFIG_STM32_RTC_MAGIC_REG=1 -CONFIG_STM32_RTC_MAGIC_TIME_SET=0xfacefeef -CONFIG_STM32_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32_SPI1=y -CONFIG_STM32_SPI1_DMA=y -CONFIG_STM32_SPI1_DMA_BUFFER=1024 -CONFIG_STM32_SPI2=y -CONFIG_STM32_SPI2_DMA=y -CONFIG_STM32_SPI2_DMA_BUFFER=1024 -CONFIG_STM32_SPI3=y -CONFIG_STM32_SPI3_DMA=y -CONFIG_STM32_SPI3_DMA_BUFFER=512 -CONFIG_STM32_SPI_DMATHRESHOLD=1024 -CONFIG_STM32_SYSCFG_IOCOMPENSATION=y -CONFIG_STM32_TIM5=y -CONFIG_STM32_UART4=y -CONFIG_STM32_USART1=y -CONFIG_STM32_USART3=y -CONFIG_STM32_USART_BREAKS=y -CONFIG_STM32_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=38400 -CONFIG_UART4_RXBUFSIZE=300 -CONFIG_UART4_RXDMA=y -CONFIG_UART4_TXBUFSIZE=300 -CONFIG_USART1_RXBUFSIZE=300 -CONFIG_USART1_RXDMA=y -CONFIG_USART1_SERIAL_CONSOLE=y -CONFIG_USART1_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_DUALSPEED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/matek/gnss-m9n-f4/nuttx-config/scripts/canbootloader_script.ld b/boards/matek/gnss-m9n-f4/nuttx-config/scripts/canbootloader_script.ld deleted file mode 100755 index e0510a2..0000000 --- a/boards/matek/gnss-m9n-f4/nuttx-config/scripts/canbootloader_script.ld +++ /dev/null @@ -1,137 +0,0 @@ -/**************************************************************************** - * configs/gnss-m9n-f4/scripts/ld.canbootloader - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F405RG has 1024Kb of FLASH beginning at address 0x0800:0000 and - * 192Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of CCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 32 KiB of flash is reserved for the bootloader. - * Paramater storage will use the next 32KiB Sector. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08000000, LENGTH = 32K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 192K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/matek/gnss-m9n-f4/nuttx-config/scripts/script.ld b/boards/matek/gnss-m9n-f4/nuttx-config/scripts/script.ld deleted file mode 100755 index 70696df..0000000 --- a/boards/matek/gnss-m9n-f4/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,147 +0,0 @@ -/**************************************************************************** - * configs/gnss-m9n-f4/scripts/ld.script - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F405RG has 1024Kb of FLASH beginning at address 0x0800:0000 and - * 192Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of CCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 32 KiB of flash is reserved for the bootloader. - * Paramater storage will use the next 32KiB Sector. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08010000, LENGTH = 960K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 192K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(8); - /* - * This section positions the app_descriptor_t used - * by the make_can_boot_descriptor.py tool to set - * the application image's descriptor so that the - * uavcan bootloader has the ability to validate the - * image crc, size etc - */ - KEEP(*(.app_descriptor)) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/matek/gnss-m9n-f4/src/CMakeLists.txt b/boards/matek/gnss-m9n-f4/src/CMakeLists.txt deleted file mode 100755 index d3ba916..0000000 --- a/boards/matek/gnss-m9n-f4/src/CMakeLists.txt +++ /dev/null @@ -1,70 +0,0 @@ -############################################################################ -# -# Copyright (c) 2018-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. -# -############################################################################ - -if("${PX4_BOARD_LABEL}" STREQUAL "canbootloader") - - add_library(drivers_board - boot_config.h - boot.c - led.c - usb.c - ) - target_link_libraries(drivers_board - PRIVATE - nuttx_arch - nuttx_drivers - canbootloader - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/canbootloader) - -else() - add_library(drivers_board - can.c - i2c.cpp - led.c - init.c - spi.cpp - timer_config.cpp - usb.c - ) - - target_link_libraries(drivers_board - PRIVATE - arch_spi - nuttx_arch - nuttx_drivers - px4_layer - arch_io_pins - drivers__led - ) -endif() diff --git a/boards/matek/gnss-m9n-f4/src/board_config.h b/boards/matek/gnss-m9n-f4/src/board_config.h deleted file mode 100755 index 7ca98af..0000000 --- a/boards/matek/gnss-m9n-f4/src/board_config.h +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2014-2021 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * M9nf4 can internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ -/* Configuration ************************************************************************************/ - -/* Matek M9nf4can GPIOs ***********************************************************************************/ -/* LEDs */ -// LED1 - PA14 - blue -// LED2 - PA13 - green - -#define GPIO_LED1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN14) -#define GPIO_LED_BLUE GPIO_LED1 - -#define GPIO_LED2 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN13) -#define GPIO_LED_GREEN GPIO_LED2 - -/* Boot config */ -#define GPIO_BOOT_CONFIG /* PB7 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN7|GPIO_EXTI) - -#define FLASH_BASED_PARAMS - -#define GPIO_CAN1_SILENT_S0 /* PC13 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN13) - -/* USB OTG FS - * - * PA9 OTG_FS_VBUS VBUS sensing - */ -#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTC|GPIO_PIN5) - -#define GPIO_I2C2_SCL_RESET /* PB10 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN10) -#define GPIO_I2C2_SDA_RESET /* PB11 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN11) - -/* High-resolution timer */ -#define HRT_TIMER 3 /* use timer 3 as HRT */ -#define HRT_TIMER_CHANNEL 4 /* use capture/compare channel 4 */ - -#define BOARD_ENABLE_CONSOLE_BUFFER - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - - -#define PX4_GPIO_INIT_LIST { \ - GPIO_I2C2_SCL_RESET, \ - GPIO_I2C2_SDA_RESET, \ - GPIO_BOOT_CONFIG, \ - GPIO_CAN1_TX, \ - GPIO_CAN1_RX, \ - GPIO_CAN1_SILENT_S0, \ - GPIO_OTGFS_VBUS \ - } - - -__BEGIN_DECLS - -/**************************************************************************************************** - * Public Types - ****************************************************************************************************/ - -/**************************************************************************************************** - * Public data - ****************************************************************************************************/ - -#ifndef __ASSEMBLY__ - -/**************************************************************************************************** - * Public Functions - ****************************************************************************************************/ - -/**************************************************************************************************** - * Name: stm32_spiinitialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the PX4FMU board. - * - ****************************************************************************************************/ - -extern void stm32_spiinitialize(void); - - -/**************************************************************************************************** - * Name: stm32_usbinitialize - * - * Description: - * Called to configure USB IO. - * - ****************************************************************************************************/ - -extern void stm32_usbinitialize(void); - -//extern void board_peripheral_reset(int ms); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/matek/gnss-m9n-f4/src/boot.c b/boards/matek/gnss-m9n-f4/src/boot.c deleted file mode 100755 index 3cb180d..0000000 --- a/boards/matek/gnss-m9n-f4/src/boot.c +++ /dev/null @@ -1,190 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 PX4 Development Team. All rights reserved. - * Author: Ben Dyer - * Pavel Kirienko - * David Sidrane - * - * 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include "boot_config.h" -#include "board.h" - -#include -#include -#include - -#include "led.h" -#include - - -/************************************************************************************ - * 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) -{ - putreg32(getreg32(STM32_RCC_APB1ENR) | RCC_APB1ENR_CAN1EN, STM32_RCC_APB1ENR); - stm32_configgpio(GPIO_CAN1_RX); - stm32_configgpio(GPIO_CAN1_TX); - stm32_configgpio(GPIO_CAN1_SILENT_S0); - putreg32(getreg32(STM32_RCC_APB1RSTR) | RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR); - putreg32(getreg32(STM32_RCC_APB1RSTR) & ~RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR); - - //led_init(); - -#if defined(OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO) - stm32_configgpio(GPIO_GETNODEINFO_JUMPER); -#endif - -} - -/************************************************************************************ - * Name: board_deinitialize - * - * Description: - * This function is called by the bootloader code prior to booting - * the application. Is should place the HW into an benign initialized state. - * - ************************************************************************************/ - -void board_deinitialize(void) -{ - putreg32(getreg32(STM32_RCC_APB1RSTR) | RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR); -} - -/**************************************************************************** - * Name: board_get_product_name - * - * Description: - * Called to retrieve the product name. The returned value is a assumed - * to be written to a pascal style string that will be length prefixed - * and not null terminated - * - * Input Parameters: - * product_name - A pointer to a buffer to write the name. - * maxlen - The maximum number of charter that can be written - * - * Returned Value: - * The length of characters written to the buffer. - * - ****************************************************************************/ - -uint8_t board_get_product_name(uint8_t *product_name, size_t maxlen) -{ - DEBUGASSERT(maxlen > UAVCAN_STRLEN(HW_UAVCAN_NAME)); - memcpy(product_name, HW_UAVCAN_NAME, UAVCAN_STRLEN(HW_UAVCAN_NAME)); - return UAVCAN_STRLEN(HW_UAVCAN_NAME); -} - -/**************************************************************************** - * Name: board_get_hardware_version - * - * Description: - * Called to retrieve the hardware version information. The function - * will first initialize the the callers struct to all zeros. - * - * Input Parameters: - * hw_version - A pointer to a uavcan_hardwareversion_t. - * - * Returned Value: - * Length of the unique_id - * - ****************************************************************************/ - -size_t board_get_hardware_version(uavcan_HardwareVersion_t *hw_version) -{ - memset(hw_version, 0, sizeof(uavcan_HardwareVersion_t)); - - hw_version->major = HW_VERSION_MAJOR; - hw_version->minor = HW_VERSION_MINOR; - - return board_get_mfguid(*(mfguid_t *) hw_version->unique_id); -} - -/**************************************************************************** - * Name: board_indicate - * - * Description: - * Provides User feedback to indicate the state of the bootloader - * on board specific hardware. - * - * Input Parameters: - * indication - A member of the uiindication_t - * - * Returned Value: - * None - * - ****************************************************************************/ -#define led(n, code, r , g , b, h) {.red = (r),.green = (g), .blue = (b),.hz = (h)} - -typedef begin_packed_struct struct led_t { - uint8_t red; - uint8_t green; - uint8_t blue; - uint8_t hz; -} end_packed_struct led_t; - -static const led_t i2l[] = { - - led(0, off, 0, 0, 0, 0), - led(1, reset, 128, 128, 128, 30), - led(2, autobaud_start, 0, 128, 0, 1), - led(3, autobaud_end, 0, 128, 0, 2), - led(4, allocation_start, 0, 0, 64, 2), - led(5, allocation_end, 0, 128, 64, 3), - led(6, fw_update_start, 32, 128, 64, 3), - led(7, fw_update_erase_fail, 32, 128, 32, 3), - led(8, fw_update_invalid_response, 64, 0, 0, 1), - led(9, fw_update_timeout, 64, 0, 0, 2), - led(a, fw_update_invalid_crc, 64, 0, 0, 4), - led(b, jump_to_app, 0, 128, 0, 10), - -}; - -void board_indicate(uiindication_t indication) -{ - rgb_led(i2l[indication].red, - i2l[indication].green, - i2l[indication].blue, - i2l[indication].hz); -} diff --git a/boards/matek/gnss-m9n-f4/src/boot_config.h b/boards/matek/gnss-m9n-f4/src/boot_config.h deleted file mode 100755 index 0a01b66..0000000 --- a/boards/matek/gnss-m9n-f4/src/boot_config.h +++ /dev/null @@ -1,129 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/* - * @file boot_config.h - * - * bootloader definitions that configures the behavior and options - * of the Boot loader - * This file is relies on the parent folder's boot_config.h file and defines - * different usages of the hardware for bootloading - */ - -#pragma once - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -/* Bring in the board_config.h definitions - * todo:make this be pulled in from a targed's build - * files in nuttx*/ - -#include "board_config.h" -#include "uavcan.h" -#include - -#include - -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define OPT_PREFERRED_NODE_ID ANY_NODE_ID - -//todo:wrap OPT_x in in ifdefs for command line definitions -#define OPT_TBOOT_MS 5000 -#define OPT_NODE_STATUS_RATE_MS 800 -#define OPT_NODE_INFO_RATE_MS 50 -#define OPT_BL_NUMBER_TIMERS 7 - -/* - * This Option set is set to 1 ensure a provider of firmware has an - * opportunity update the node's firmware. - * This Option is the default policy and can be overridden by - * a jumper - * When this Policy is set, the node will ignore tboot and - * wait indefinitely for a GetNodeInfo request before booting. - * - * OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO_INVERT is used to allow - * the polarity of the jumper to be True Active - * - * wait OPT_WAIT_FOR_GETNODEINFO OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO - * Jumper - * yes 1 0 x - * yes 1 1 Active - * no 1 1 Not Active - * no 0 0 X - * yes 0 1 Active - * no 0 1 Not Active - * - */ -#define OPT_WAIT_FOR_GETNODEINFO 0 -#define OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO 1 -#define OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO_INVERT 0 -#define OPT_ENABLE_WD 1 - -#define OPT_RESTART_TIMEOUT_MS 20000 - -/* Reserved for the Booloader */ -#define OPT_BOOTLOADER_SIZE_IN_K (1024*64) - -/* Reserved for the application out of the total - * system flash minus the BOOTLOADER_SIZE_IN_K - */ -#define OPT_APPLICATION_RESERVER_IN_K 0 - -#define OPT_APPLICATION_IMAGE_OFFSET OPT_BOOTLOADER_SIZE_IN_K -#define OPT_APPLICATION_IMAGE_LENGTH (FLASH_SIZE-(OPT_BOOTLOADER_SIZE_IN_K+OPT_APPLICATION_RESERVER_IN_K)) - - -#define FLASH_BASE STM32_FLASH_BASE -#define FLASH_SIZE STM32_FLASH_SIZE - -#define APPLICATION_LOAD_ADDRESS (FLASH_BASE + OPT_APPLICATION_IMAGE_OFFSET) -#define APPLICATION_SIZE (FLASH_SIZE-OPT_APPLICATION_IMAGE_OFFSET) -#define APPLICATION_LAST_8BIT_ADDRRESS ((uint8_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint8_t))) -#define APPLICATION_LAST_32BIT_ADDRRESS ((uint32_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint32_t))) -#define APPLICATION_LAST_64BIT_ADDRRESS ((uint64_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint64_t))) - -//* If this board uses big flash that have large sectors */ - -#define OPT_USE_YIELD - -/* Bootloader Option***************************************************************** - * - */ -#define GPIO_GETNODEINFO_JUMPER (GPIO_BOOT_CONFIG & ~GPIO_EXTI) diff --git a/boards/matek/gnss-m9n-f4/src/can.c b/boards/matek/gnss-m9n-f4/src/can.c deleted file mode 100755 index 7737965..0000000 --- a/boards/matek/gnss-m9n-f4/src/can.c +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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. - * - ****************************************************************************/ - -/** - * @file can.c - * - * Board-specific CAN functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include - -#include -#include - -#include "chip.h" -#include "arm_internal.h" - -#include "stm32.h" -#include "stm32_can.h" -#include "board_config.h" - -#ifdef CONFIG_CAN - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) -# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." -# undef CONFIG_STM32_CAN2 -#endif - -#ifdef CONFIG_STM32_CAN1 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); - -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} - -#endif diff --git a/boards/matek/gnss-m9n-f4/src/i2c.cpp b/boards/matek/gnss-m9n-f4/src/i2c.cpp deleted file mode 100755 index 7aa36d1..0000000 --- a/boards/matek/gnss-m9n-f4/src/i2c.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020-2021 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(2), -}; diff --git a/boards/matek/gnss-m9n-f4/src/init.c b/boards/matek/gnss-m9n-f4/src/init.c deleted file mode 100755 index 7556da2..0000000 --- a/boards/matek/gnss-m9n-f4/src/init.c +++ /dev/null @@ -1,203 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * Matek M9NF4 CAN -specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include "board_config.h" -#include - -#include - -#include -#include - -#include "led.h" - -#include - -#include - -#include -#include -# if defined(FLASH_BASED_PARAMS) -# include -#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) -{ - watchdog_init(); - - - /* configure LEDs */ - - board_autoled_initialize(); - - /* configure pins */ - const uint32_t gpio[] = PX4_GPIO_INIT_LIST; - px4_gpio_init(gpio, arraySize(gpio)); - - /* configure SPI all interfaces GPIO */ - - /* configure USB interfaces */ - - stm32_usbinitialize(); - -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -static struct spi_dev_s *spi3; - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - px4_platform_init(); - -#if defined(SERIAL_HAVE_RXDMA) - - /* set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. */ - - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "DMA alloc FAILED\n"); - } - - - stm32_spiinitialize(); - - - spi3 = stm32_spibus_initialize(CONFIG_NSH_MMCSDSPIPORTNO); - - if (!spi3) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 3\n"); - rgb_led(255, 0, 0, 0); - return -ENODEV; - } - - int ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi3); - - if (ret < 0) { - syslog(LOG_ERR, "[boot] Failed to bind SPI port 0 to SD slot 0\n"); - rgb_led(255, 0, 0, 0); - return ret; - } - -#if defined(FLASH_BASED_PARAMS) - static sector_descriptor_t params_sector_map[] = { - {2, 16 * 1024, 0x08008000}, - {3, 16 * 1024, 0x0800C000}, - {0, 0, 0}, - }; - - /* Initialize the flashfs layer to use heap allocated memory */ - int result = parameter_flashfs_init(params_sector_map, NULL, 0); - - if (result != OK) { - syslog(LOG_ERR, "[boot] FAILED to init params in FLASH %d\n", result); - rgb_led(255, 0, 0, 0); - return -ENODEV; - } - -#endif // FLASH_BASED_PARAMS - - rgb_led(0, 255, 0, 0); - - return OK; -} diff --git a/boards/matek/gnss-m9n-f4/src/led.c b/boards/matek/gnss-m9n-f4/src/led.c deleted file mode 100755 index 7cfcbdf..0000000 --- a/boards/matek/gnss-m9n-f4/src/led.c +++ /dev/null @@ -1,172 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -#include "led.h" - -#define TMR_BASE STM32_TIM1_BASE -#define TMR_FREQUENCY STM32_APB2_TIM1_CLKIN -#define TMR_REG(o) (TMR_BASE+(o)) - -static uint32_t g_ledmap[] = { - GPIO_LED_BLUE, -}; - -void rgb_led(int r, int g, int b, int freqs) -{ - - long fosc = TMR_FREQUENCY; - long prescale = 2048; - long p1s = fosc / prescale; - long p0p5s = p1s / 2; - uint16_t val; - static bool once = 0; - - if (!once) { - once = 1; - - /* Enabel Clock to Block */ - modifyreg32(STM32_RCC_APB2ENR, 0, RCC_APB2ENR_TIM1EN); - - /* Reload */ - - val = getreg16(TMR_REG(STM32_BTIM_EGR_OFFSET)); - val |= ATIM_EGR_UG; - putreg16(val, TMR_REG(STM32_BTIM_EGR_OFFSET)); - - /* Set Prescaler STM32_TIM_SETCLOCK */ - - putreg16(prescale, TMR_REG(STM32_BTIM_PSC_OFFSET)); - - /* Enable STM32_TIM_SETMODE*/ - - putreg16(ATIM_CR1_CEN | ATIM_CR1_ARPE, TMR_REG(STM32_BTIM_CR1_OFFSET)); - - - putreg16((ATIM_CCMR_MODE_PWM1 << ATIM_CCMR1_OC1M_SHIFT) | ATIM_CCMR1_OC1PE | - (ATIM_CCMR_MODE_PWM1 << ATIM_CCMR1_OC2M_SHIFT) | ATIM_CCMR1_OC2PE, TMR_REG(STM32_GTIM_CCMR1_OFFSET)); - putreg16((ATIM_CCMR_MODE_PWM1 << ATIM_CCMR2_OC3M_SHIFT) | ATIM_CCMR2_OC3PE, TMR_REG(STM32_GTIM_CCMR2_OFFSET)); - putreg16(ATIM_CCER_CC3E | ATIM_CCER_CC3P | - ATIM_CCER_CC2E | ATIM_CCER_CC2P | - ATIM_CCER_CC1E | ATIM_CCER_CC1P, TMR_REG(STM32_GTIM_CCER_OFFSET)); - - - stm32_configgpio(GPIO_TIM1_CH1N_1); - stm32_configgpio(GPIO_TIM1_CH2N_1); - stm32_configgpio(GPIO_TIM1_CH3N_1); - - /* master output enable = on */ - putreg16(ATIM_BDTR_MOE, (TMR_REG(STM32_ATIM_BDTR_OFFSET))); - } - - long p = freqs == 0 ? p1s : p1s / freqs; - putreg32(p, TMR_REG(STM32_BTIM_ARR_OFFSET)); - - p = freqs == 0 ? p1s + 1 : p0p5s / freqs; - - putreg32((r * p) / 255, TMR_REG(STM32_GTIM_CCR1_OFFSET)); - putreg32((g * p) / 255, TMR_REG(STM32_GTIM_CCR2_OFFSET)); - putreg32((b * p) / 255, TMR_REG(STM32_GTIM_CCR3_OFFSET)); - - val = getreg16(TMR_REG(STM32_BTIM_CR1_OFFSET)); - - if (freqs == 0) { - val &= ~ATIM_CR1_CEN; - - } else { - val |= ATIM_CR1_CEN; - } - - putreg16(val, TMR_REG(STM32_BTIM_CR1_OFFSET)); - -} - -__EXPORT void led_init(void) -{ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - stm32_configgpio(g_ledmap[l]); - } -} - -static void phy_set_led(int led, bool state) -{ - if (led == 0) { - stm32_gpiowrite(g_ledmap[led], !state); - } -} -/* -__EXPORT void board_autoled_on(int led) { - if (led == 1) { - stm32_gpiowrite(GPIO_LED1, false); - } -} - -__EXPORT void board_autoled_off(int led) { - if (led == 1) { - stm32_gpiowrite(GPIO_LED1, true); - } -}*/ - -__EXPORT void led_on(int led) -{ - phy_set_led(led, true); -} - - -__EXPORT void led_off(int led) -{ - phy_set_led(led, false); -} - -__EXPORT void led_toggle(int led) -{ - if (led == 0) { - phy_set_led(led, !stm32_gpioread(g_ledmap[led])); - } -} diff --git a/boards/matek/gnss-m9n-f4/src/led.h b/boards/matek/gnss-m9n-f4/src/led.h deleted file mode 100755 index 2968e55..0000000 --- a/boards/matek/gnss-m9n-f4/src/led.h +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2015-2021 PX4 Development Team. All rights reserved. - * Author: David Sidrane - * - * 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. - * - ****************************************************************************/ - -__BEGIN_DECLS -void rgb_led(int r, int g, int b, int freqs); -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS diff --git a/boards/matek/gnss-m9n-f4/src/spi.cpp b/boards/matek/gnss-m9n-f4/src/spi.cpp deleted file mode 100755 index f241900..0000000 --- a/boards/matek/gnss-m9n-f4/src/spi.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2018-2021 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortA, GPIO::Pin4}, SPI::DRDY{GPIO::PortC, GPIO::Pin4}), - }), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_MAG_DEVTYPE_RM3100, SPI::CS{GPIO::PortB, GPIO::Pin12}) - }), - initSPIBus(SPI::Bus::SPI3, { - initSPIDevice(DRV_DEVTYPE_UNUSED, SPI::CS{GPIO::PortC, GPIO::Pin14}) - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/matek/gnss-m9n-f4/src/timer_config.cpp b/boards/matek/gnss-m9n-f4/src/timer_config.cpp deleted file mode 100755 index c01af14..0000000 --- a/boards/matek/gnss-m9n-f4/src/timer_config.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2018-2021 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer3, DMA{DMA::Index1, DMA::Stream2, DMA::Channel5}), - initIOTimer(Timer::Timer2, DMA{DMA::Index1, DMA::Stream1, DMA::Channel3}), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel3}, {GPIO::PortB, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel4}, {GPIO::PortB, GPIO::Pin1}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel4}, {GPIO::PortA, GPIO::Pin3}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel3}, {GPIO::PortA, GPIO::Pin2}), -}; - -//constexpr io_timers_channel_mapping_t io_timers_channel_mapping = -// initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/matek/gnss-m9n-f4/src/usb.c b/boards/matek/gnss-m9n-f4/src/usb.c deleted file mode 100755 index 6ecbb60..0000000 --- a/boards/matek/gnss-m9n-f4/src/usb.c +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2018-2021 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include "board_config.h" - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -/************************************************************************************ - * Name: stm32_usbinitialize - * - * Description: - * Called to setup USB-related GPIO pins for the omnibusf4sd 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_STM32_OTGFS - stm32_configgpio(GPIO_OTGFS_VBUS); - /* XXX We only support device mode - stm32_configgpio(GPIO_OTGFS_PWRON); - stm32_configgpio(GPIO_OTGFS_OVER); - */ -#endif -} - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/matek/gnss-m9n-f4/uavcan_board_identity b/boards/matek/gnss-m9n-f4/uavcan_board_identity deleted file mode 100755 index 70123f7..0000000 --- a/boards/matek/gnss-m9n-f4/uavcan_board_identity +++ /dev/null @@ -1,17 +0,0 @@ -# UAVCAN boot loadable Module ID -set(uavcanblid_sw_version_major 0) -set(uavcanblid_sw_version_minor 1) -add_definitions( - -DAPP_VERSION_MAJOR=${uavcanblid_sw_version_major} - -DAPP_VERSION_MINOR=${uavcanblid_sw_version_minor} -) - -set(uavcanblid_hw_version_major 3) -set(uavcanblid_hw_version_minor 246) -set(uavcanblid_name "\"org.matek.gnss-m9n-f4\"") - -add_definitions( - -DHW_UAVCAN_NAME=${uavcanblid_name} - -DHW_VERSION_MAJOR=${uavcanblid_hw_version_major} - -DHW_VERSION_MINOR=${uavcanblid_hw_version_minor} -) diff --git a/boards/matek/h743-mini/bootloader.px4board b/boards/matek/h743-mini/bootloader.px4board deleted file mode 100644 index 19b6e66..0000000 --- a/boards/matek/h743-mini/bootloader.px4board +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_ROMFSROOT="" diff --git a/boards/matek/h743-mini/default.px4board b/boards/matek/h743-mini/default.px4board deleted file mode 100644 index 64e472d..0000000 --- a/boards/matek/h743-mini/default.px4board +++ /dev/null @@ -1,68 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS2" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS3" -CONFIG_BOARD_SERIAL_TEL3="/dev/ttyS5" -CONFIG_BOARD_SERIAL_TEL4="/dev/ttyS6" -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_BAROMETER_DPS310=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM42605=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU6000=y -CONFIG_DRIVERS_MAGNETOMETER_QMC5883L=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_BOARD_UAVCAN_INTERFACES=1 -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/matek/h743-mini/extras/matek_h743-mini_bootloader.bin b/boards/matek/h743-mini/extras/matek_h743-mini_bootloader.bin deleted file mode 100755 index 121b7ea..0000000 Binary files a/boards/matek/h743-mini/extras/matek_h743-mini_bootloader.bin and /dev/null differ diff --git a/boards/matek/h743-mini/extras/matek_h743-slim_bootloader.bin b/boards/matek/h743-mini/extras/matek_h743-slim_bootloader.bin deleted file mode 100644 index 9a03d6b..0000000 Binary files a/boards/matek/h743-mini/extras/matek_h743-slim_bootloader.bin and /dev/null differ diff --git a/boards/matek/h743-mini/firmware.prototype b/boards/matek/h743-mini/firmware.prototype deleted file mode 100644 index d715678..0000000 --- a/boards/matek/h743-mini/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 1013, - "magic": "PX4FWv1", - "description": "Firmware for the MatekH743-slim board", - "image": "", - "build_time": 0, - "summary": "MatekH743-mini", - "version": "0.1", - "image_size": 0, - "image_maxsize": 1966080, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/matek/h743-mini/init/rc.board_extras b/boards/matek/h743-mini/init/rc.board_extras deleted file mode 100644 index a39b81b..0000000 --- a/boards/matek/h743-mini/init/rc.board_extras +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -# -# board specific extras init -#------------------------------------------------------------------------------ - -# if ! param compare OSD_ATXXXX_CFG 0 -# then -# atxxxx start -s -# fi - -atxxxx start -s - - -# DShot telemetry is always on UART7 -# dshot telemetry /dev/ttyS5 - diff --git a/boards/matek/h743-mini/init/rc.board_sensors b/boards/matek/h743-mini/init/rc.board_sensors deleted file mode 100644 index c37c3b3..0000000 --- a/boards/matek/h743-mini/init/rc.board_sensors +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# -# board specific sensors init -#------------------------------------------------------------------------------ - -board_adc start - -# Internal SPI bus ICM-42605 -if ! icm42605 -R 14 -s start -then - # internal SPI bus ICM-20602 - icm20602 -R 12 -s start -fi - -# Internal SPI bus MPU-6000 -mpu6000 -R 12 -s start - -# Internal baro -dps310 -I start -a 118 - -# External mag -qmc5883l -X start -a 13 diff --git a/boards/matek/h743-mini/nuttx-config/Kconfig b/boards/matek/h743-mini/nuttx-config/Kconfig deleted file mode 100644 index bb33d3c..0000000 --- a/boards/matek/h743-mini/nuttx-config/Kconfig +++ /dev/null @@ -1,17 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see misc/tools/kconfig-language.txt. -# -config BOARD_HAS_PROBES - bool "Board provides GPIO or other Hardware for signaling to timing analyze." - default y - ---help--- - This board provides GPIO FMU-CH1-5, CAP1-6 as PROBE_1-11 to provide timing signals from selected drivers. - -config BOARD_USE_PROBES - bool "Enable the use the board provided FMU-CH1-5, CAP1-6 as PROBE_1-11" - default n - depends on BOARD_HAS_PROBES - - ---help--- - Select to use GPIO FMU-CH1-5, CAP1-6 to provide timing signals from selected drivers. diff --git a/boards/matek/h743-mini/nuttx-config/bootloader/defconfig b/boards/matek/h743-mini/nuttx-config/bootloader/defconfig deleted file mode 100644 index 9422380..0000000 --- a/boards/matek/h743-mini/nuttx-config/bootloader/defconfig +++ /dev/null @@ -1,89 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_CONSOLE is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_SPI_EXCHANGE is not set -# CONFIG_STM32H7_SYSCFG is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/matek/h743-mini/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743VI=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_INITTHREAD_PRIORITY=254 -CONFIG_BOARD_LATE_INITIALIZE=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_CDCACM=y -CONFIG_CDCACM_PRODUCTID=0x004b -CONFIG_CDCACM_PRODUCTSTR="Matek H743-mini" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x3162 -CONFIG_CDCACM_VENDORSTR="Matek" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_EXPERIMENTAL=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="bootloader_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SPI=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_USART1=y -CONFIG_SYSTEMTICK_HOOK=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGINT_CHAR=0x03 -CONFIG_TTY_SIGTSTP=y -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/matek/h743-mini/nuttx-config/include/board.h b/boards/matek/h743-mini/nuttx-config/include/board.h deleted file mode 100644 index 4bf2b6e..0000000 --- a/boards/matek/h743-mini/nuttx-config/include/board.h +++ /dev/null @@ -1,493 +0,0 @@ -/************************************************************************************ - * nuttx-configs/px4_fmu-v6u/include/board.h - * - * Copyright (C) 2016-2019 Gregory Nutt. All rights reserved. - * Authors: David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ -#ifndef __NUTTX_CONFIG_MATEKH743SLIM_INCLUDE_BOARD_H -#define __NUTTX_CONFIG_MATEKH743SLIM_INCLUDE_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The MatekH743-Slim board provides the following clock sources: - * - * X1: 8 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 64 MHz RC factory-trimmed - * HSE: 8 MHz crystal for HSE - */ - -#define STM32_BOARD_XTAL 8000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 32768 - -/* Main PLL Configuration. - * - * PLL source is HSE = 8,000,000 - * - * PLL_VCOx = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 1 <= PLLM <= 63 - * 4 <= PLLN <= 512 - * 150 MHz <= PLL_VCOL <= 420MHz - * 192 MHz <= PLL_VCOH <= 836MHz - * - * SYSCLK = PLL_VCO / PLLP - * CPUCLK = SYSCLK / D1CPRE - * Subject to - * - * PLLP1 = {2, 4, 6, 8, ..., 128} - * PLLP2,3 = {2, 3, 4, ..., 128} - * CPUCLK <= 480 MHz - */ - -#define STM32_BOARD_USEHSE - -#define STM32_PLLCFG_PLLSRC RCC_PLLCKSELR_PLLSRC_HSE - -/* PLL1, wide 4 - 8 MHz input, enable DIVP, DIVQ, DIVR - * - * PLL1_VCO = (8,000,000 / 1) * 120 = 960 MHz - * - * PLL1P = PLL1_VCO/2 = 960 MHz / 2 = 480 MHz - * PLL1Q = PLL1_VCO/4 = 960 MHz / 4 = 240 MHz - * PLL1R = PLL1_VCO/8 = 960 MHz / 8 = 120 MHz - */ - -#define STM32_PLLCFG_PLL1CFG (RCC_PLLCFGR_PLL1VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL1RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVP1EN | \ - RCC_PLLCFGR_DIVQ1EN | \ - RCC_PLLCFGR_DIVR1EN) -#define STM32_PLLCFG_PLL1M RCC_PLLCKSELR_DIVM1(1) -#define STM32_PLLCFG_PLL1N RCC_PLL1DIVR_N1(120) -#define STM32_PLLCFG_PLL1P RCC_PLL1DIVR_P1(2) -#define STM32_PLLCFG_PLL1Q RCC_PLL1DIVR_Q1(4) -#define STM32_PLLCFG_PLL1R RCC_PLL1DIVR_R1(8) - -#define STM32_VCO1_FREQUENCY ((STM32_HSE_FREQUENCY / 1) * 120) -#define STM32_PLL1P_FREQUENCY (STM32_VCO1_FREQUENCY / 2) -#define STM32_PLL1Q_FREQUENCY (STM32_VCO1_FREQUENCY / 4) -#define STM32_PLL1R_FREQUENCY (STM32_VCO1_FREQUENCY / 8) - -/* PLL2 */ - -#define STM32_PLLCFG_PLL2CFG (RCC_PLLCFGR_PLL2VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL2RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVP2EN | \ - RCC_PLLCFGR_DIVQ2EN | \ - RCC_PLLCFGR_DIVR2EN) -#define STM32_PLLCFG_PLL2M RCC_PLLCKSELR_DIVM2(2) -#define STM32_PLLCFG_PLL2N RCC_PLL2DIVR_N2(48) -#define STM32_PLLCFG_PLL2P RCC_PLL2DIVR_P2(2) -#define STM32_PLLCFG_PLL2Q RCC_PLL2DIVR_Q2(2) -#define STM32_PLLCFG_PLL2R RCC_PLL2DIVR_R2(2) - -#define STM32_VCO2_FREQUENCY ((STM32_HSE_FREQUENCY / 2) * 48) -#define STM32_PLL2P_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2Q_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2R_FREQUENCY (STM32_VCO2_FREQUENCY / 2) - -/* PLL3 */ - -#define STM32_PLLCFG_PLL3CFG (RCC_PLLCFGR_PLL3VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL3RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVQ3EN) -#define STM32_PLLCFG_PLL3M RCC_PLLCKSELR_DIVM3(2) -#define STM32_PLLCFG_PLL3N RCC_PLL3DIVR_N3(48) -#define STM32_PLLCFG_PLL3P RCC_PLL3DIVR_P3(2) -#define STM32_PLLCFG_PLL3Q RCC_PLL3DIVR_Q3(4) -#define STM32_PLLCFG_PLL3R RCC_PLL3DIVR_R3(2) - -#define STM32_VCO3_FREQUENCY ((STM32_HSE_FREQUENCY / 2) * 48) -#define STM32_PLL3P_FREQUENCY (STM32_VCO3_FREQUENCY / 2) -#define STM32_PLL3Q_FREQUENCY (STM32_VCO3_FREQUENCY / 4) -#define STM32_PLL3R_FREQUENCY (STM32_VCO3_FREQUENCY / 2) - -/* SYSCLK = PLL1P = 480MHz - * CPUCLK = SYSCLK / 1 = 480 MHz - */ - -#define STM32_RCC_D1CFGR_D1CPRE (RCC_D1CFGR_D1CPRE_SYSCLK) -#define STM32_SYSCLK_FREQUENCY (STM32_PLL1P_FREQUENCY) -#define STM32_CPUCLK_FREQUENCY (STM32_SYSCLK_FREQUENCY / 1) - -/* Configure Clock Assignments */ - -/* AHB clock (HCLK) is SYSCLK/2 (240 MHz max) - * HCLK1 = HCLK2 = HCLK3 = HCLK4 = 240 - */ - -#define STM32_RCC_D1CFGR_HPRE RCC_D1CFGR_HPRE_SYSCLKd2 /* HCLK = SYSCLK / 2 */ -#define STM32_ACLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* ACLK in D1, HCLK3 in D1 */ -#define STM32_HCLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* HCLK in D2, HCLK4 in D3 */ -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D2CFGR_D2PPRE1 RCC_D2CFGR_D2PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB2 clock (PCLK2) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D2CFGR_D2PPRE2 RCC_D2CFGR_D2PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB3 clock (PCLK3) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D1CFGR_D1PPRE RCC_D1CFGR_D1PPRE_HCLKd2 /* PCLK3 = HCLK / 2 */ -#define STM32_PCLK3_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB4 clock (PCLK4) is HCLK/4 (120 MHz) */ - -#define STM32_RCC_D3CFGR_D3PPRE RCC_D3CFGR_D3PPRE_HCLKd2 /* PCLK4 = HCLK / 2 */ -#define STM32_PCLK4_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timer clock frequencies */ - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM15_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM16_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM17_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Kernel Clock Configuration - * - * Note: look at Table 54 in ST Manual - */ - -/* I2C123 clock source */ - -#define STM32_RCC_D2CCIP2R_I2C123SRC RCC_D2CCIP2R_I2C123SEL_HSI - -/* I2C4 clock source */ - -#define STM32_RCC_D3CCIPR_I2C4SRC RCC_D3CCIPR_I2C4SEL_HSI - -/* SPI123 clock source */ - -#define STM32_RCC_D2CCIP1R_SPI123SRC RCC_D2CCIP1R_SPI123SEL_PLL2 - -/* SPI45 clock source */ - -#define STM32_RCC_D2CCIP1R_SPI45SRC RCC_D2CCIP1R_SPI45SEL_PLL2 - -/* SPI6 clock source */ - -#define STM32_RCC_D3CCIPR_SPI6SRC RCC_D3CCIPR_SPI6SEL_PLL2 - -/* USB 1 and 2 clock source */ - -#define STM32_RCC_D2CCIP2R_USBSRC RCC_D2CCIP2R_USBSEL_PLL3 - -/* ADC 1 2 3 clock source */ - -#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2 - -/* FDCAN 1 clock source */ - -#define STM32_RCC_D2CCIP1R_FDCANSEL RCC_D2CCIP1R_FDCANSEL_HSE /* FDCAN 1 2 clock source */ - -#define STM32_FDCANCLK STM32_HSE_FREQUENCY - -/* FLASH wait states - * - * ------------ ---------- ----------- - * Vcore MAX ACLK WAIT STATES - * ------------ ---------- ----------- - * 1.15-1.26 V 70 MHz 0 - * (VOS1 level) 140 MHz 1 - * 210 MHz 2 - * 1.05-1.15 V 55 MHz 0 - * (VOS2 level) 110 MHz 1 - * 165 MHz 2 - * 220 MHz 3 - * 0.95-1.05 V 45 MHz 0 - * (VOS3 level) 90 MHz 1 - * 135 MHz 2 - * 180 MHz 3 - * 225 MHz 4 - * ------------ ---------- ----------- - */ - -#define BOARD_FLASH_WAITSTATES 2 - -/* SDMMC definitions ********************************************************/ - -/* Init 480kHz, freq = PLL1Q/(2*div) div = PLL1Q/(2*freq) */ - -#define STM32_SDMMC_INIT_CLKDIV (300 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* 20 MHz Max for now - more reliable on some boards than 25 MHz - * 20 MHz = PLL1Q/(2*div), div = PLL1Q/(2*freq), div = 6 = 240 / 40 - */ - -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_MMCXFR_CLKDIV (6 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_SDXFR_CLKDIV (6 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - -/* LED definitions ******************************************************************/ -/* The board has two, LED_GREEN a Green LED and LED_BLUE a Blue LED, - * that can be controlled by software. - * - * If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any way. - * The following definitions are used to access individual LEDs. - */ - -/* LED index values for use with board_userled() */ - -#define BOARD_LED1 0 -#define BOARD_LED2 1 -#define BOARD_NLEDS 2 - -#define BOARD_LED_BLUE BOARD_LED1 -#define BOARD_LED_GREEN BOARD_LED2 - -/* LED bits for use with board_userled_all() */ - -#define BOARD_LED1_BIT (1 << BOARD_LED1) -#define BOARD_LED2_BIT (1 << BOARD_LED2) - -/* If CONFIG_ARCH_LEDS is defined, the usage by the board port is defined in - * include/board.h and src/stm32_leds.c. The LEDs are used to encode OS-related - * events as follows: - * - * - * SYMBOL Meaning LED state - * Red Green Blue - * ---------------------- -------------------------- ------ ------ ----*/ - -#define LED_STARTED 0 /* NuttX has been started OFF OFF OFF */ -#define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF OFF ON */ -#define LED_IRQSENABLED 2 /* Interrupts enabled OFF ON OFF */ -#define LED_STACKCREATED 3 /* Idle stack created OFF ON ON */ -#define LED_INIRQ 4 /* In an interrupt N/C N/C GLOW */ -#define LED_SIGNAL 5 /* In a signal handler N/C GLOW N/C */ -#define LED_ASSERTION 6 /* An assertion failed GLOW N/C GLOW */ -#define LED_PANIC 7 /* The system has crashed Blink OFF N/C */ -#define LED_IDLE 8 /* MCU is is sleep mode ON OFF OFF */ - -/* Thus if the Green LED is statically on, NuttX has successfully booted and - * is, apparently, running normally. If the Red LED is flashing at - * approximately 2Hz, then a fatal error has been detected and the system - * has halted. - */ - -/* Alternate function pin selections ************************************************/ - -#define GPIO_USART1_RX GPIO_USART1_RX_2 /* PA10 */ -#define GPIO_USART1_TX GPIO_USART1_TX_2 /* PA9 */ - -#define GPIO_USART2_RX GPIO_USART2_RX_2 /* PD6 */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ - -#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ -#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ - -#define GPIO_UART4_RX GPIO_UART4_RX_3 /* PB8 */ -#define GPIO_UART4_TX GPIO_UART4_TX_3 /* PB9 */ - -#define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC7 */ -#define GPIO_USART6_TX GPIO_USART6_TX_1 /* PC6 */ - -#define GPIO_UART7_RX GPIO_UART7_RX_3 /* PE7 */ -#define GPIO_UART7_TX GPIO_UART7_TX_3 /* PE8 */ -#define GPIO_UART7_RTS GPIO_UART7_RTS_1 /* PE9 */ -#define GPIO_UART7_CTS GPIO_UART7_CTS_1 /* PE10 */ - -#define GPIO_UART8_RX GPIO_UART8_RX_1 /* PE0 */ -#define GPIO_UART8_TX GPIO_UART8_TX_1 /* PE1 */ - - -/* CAN - * - * CAN1 is routed to transceiver. - */ - -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 /* PD0 */ -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 /* PD1 */ - -/* SPI - * - * SPI1 is MPU6000 - * SPI2 is MAX7456 - * SPI3 is extern with PD4 and PE2 as CS - * SPI4 is ICM20602 - */ - -#define ADJ_SLEW_RATE(p) (((p) & ~GPIO_SPEED_MASK) | (GPIO_SPEED_2MHz)) - -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_3 /* PD7 */ -#define GPIO_SPI1_SCK ADJ_SLEW_RATE(GPIO_SPI1_SCK_1) /* PA5 */ - -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 /* PB14 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 /* PB15 */ -#define GPIO_SPI2_SCK ADJ_SLEW_RATE(GPIO_SPI2_SCK_4) /* PB13 */ - -#define GPIO_SPI3_MISO GPIO_SPI3_MISO_1 /* PB4 */ -#define GPIO_SPI3_MOSI GPIO_SPI3_MOSI_4 /* PB5 */ -#define GPIO_SPI3_SCK ADJ_SLEW_RATE(GPIO_SPI3_SCK_1) /* PB3 */ - -#define GPIO_SPI4_MISO GPIO_SPI4_MISO_1 /* PE13 */ -#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_1 /* PE14 */ -#define GPIO_SPI4_SCK ADJ_SLEW_RATE(GPIO_SPI4_SCK_1) /* PE12 */ - -/* I2C - * - * The optional _GPIO configurations allow the I2C driver to manually - * reset the bus to clear stuck slaves. They match the pin configuration, - * but are normally-high GPIOs. - * - */ - -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_1 /* PB6 */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_1 /* PB7 */ - -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN6) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN7) - -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_1 /* PB10 */ -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_1 /* PB11 */ - -#define GPIO_I2C2_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN10) -#define GPIO_I2C2_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN11) - -/* SDMMC1 - * - * SDMMC1_D0 PC8 - * SDMMC1_D1 PC9 - * SDMMC1_D2 PC10 - * SDMMC1_D3 PC11 - * SDMMC1_CK PC12 - * SDMMC1_CMD PD2 - */ - -// #define GPIO_SDMMC1_D0 GPIO_SDMMC1_D0 /* PC8 */ -// #define GPIO_SDMMC1_D1 GPIO_SDMMC1_D1 /* PC9 */ -// #define GPIO_SDMMC1_D2 GPIO_SDMMC1_D2 /* PC10 */ -// #define GPIO_SDMMC1_D3 GPIO_SDMMC1_D3 /* PC11 */ -// #define GPIO_SDMMC1_CK GPIO_SDMMC1_CK /* PC12 */ -// #define GPIO_SDMMC1_CMD GPIO_SDMMC1_CMD /* PD2 */ - - -/* USB - * - * OTG_FS_DM PA11 - * OTG_FS_DP PA12 - * VBUS PA9 - */ - - -/* Board provides GPIO or other Hardware for signaling to timing analyzer */ - -#if defined(CONFIG_BOARD_USE_PROBES) -# include "stm32_gpio.h" -# define PROBE_N(n) (1<<((n)-1)) -# define PROBE_1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTI|GPIO_PIN0) /* PI0 AUX1 */ -# define PROBE_2 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN12) /* PH12 AUX2 */ -# define PROBE_3 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN11) /* PH11 AUX3 */ -# define PROBE_4 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN10) /* PH10 AUX4 */ -# define PROBE_5 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN13) /* PD13 AUX5 */ -# define PROBE_6 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN14) /* PD14 AUX6 */ -# define PROBE_7 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN6) /* PH6 AUX7 */ -# define PROBE_8 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN9) /* PH9 AUX8 */ -# define PROBE_9 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN11) /* PE11 CAP1 */ - -# define PROBE_INIT(mask) \ - do { \ - if ((mask)& PROBE_N(1)) { stm32_configgpio(PROBE_1); } \ - if ((mask)& PROBE_N(2)) { stm32_configgpio(PROBE_2); } \ - if ((mask)& PROBE_N(3)) { stm32_configgpio(PROBE_3); } \ - if ((mask)& PROBE_N(4)) { stm32_configgpio(PROBE_4); } \ - if ((mask)& PROBE_N(5)) { stm32_configgpio(PROBE_5); } \ - if ((mask)& PROBE_N(6)) { stm32_configgpio(PROBE_6); } \ - if ((mask)& PROBE_N(7)) { stm32_configgpio(PROBE_7); } \ - if ((mask)& PROBE_N(8)) { stm32_configgpio(PROBE_8); } \ - if ((mask)& PROBE_N(9)) { stm32_configgpio(PROBE_9); } \ - } while(0) - -# define PROBE(n,s) do {stm32_gpiowrite(PROBE_##n,(s));}while(0) -# define PROBE_MARK(n) PROBE(n,false);PROBE(n,true) -#else -# define PROBE_INIT(mask) -# define PROBE(n,s) -# define PROBE_MARK(n) -#endif - -#endif /*__NUTTX_CONFIG_MATEKH743SLIM_INCLUDE_BOARD_H */ diff --git a/boards/matek/h743-mini/nuttx-config/include/board_dma_map.h b/boards/matek/h743-mini/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 693132c..0000000 --- a/boards/matek/h743-mini/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -#pragma once - -// DMAMUX1 -#define DMAMAP_SPI1_RX DMAMAP_DMA12_SPI1RX_0 /* DMA1:37 */ -#define DMAMAP_SPI1_TX DMAMAP_DMA12_SPI1TX_0 /* DMA1:38 */ - - -// DMAMUX2 -#define DMAMAP_SPI4_RX DMAMAP_DMA12_SPI4RX_1 /* DMA2:83 */ -#define DMAMAP_SPI4_TX DMAMAP_DMA12_SPI4TX_1 /* DMA2:84 */ diff --git a/boards/matek/h743-mini/nuttx-config/nsh/defconfig b/boards/matek/h743-mini/nuttx-config/nsh/defconfig deleted file mode 100644 index a4c347f..0000000 --- a/boards/matek/h743-mini/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,252 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/matek/h743-mini/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743VI=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=95150 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_PRODUCTID=0x0036 -CONFIG_CDCACM_PRODUCTSTR="MatekH743-mini" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x1B8C -CONFIG_CDCACM_VENDORSTR="Matek" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_MEMFAULT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXPERIMENTAL=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=4 -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32H7_ADC1=y -CONFIG_STM32H7_ADC3=y -CONFIG_STM32H7_BBSRAM=y -CONFIG_STM32H7_BBSRAM_FILES=5 -CONFIG_STM32H7_BDMA=y -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_DMA2=y -CONFIG_STM32H7_DMACAPABLE=y -CONFIG_STM32H7_FLOWCONTROL_BROKEN=y -CONFIG_STM32H7_I2C1=y -CONFIG_STM32H7_I2C2=y -CONFIG_STM32H7_I2C_DYNTIMEO=y -CONFIG_STM32H7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_RTC=y -CONFIG_STM32H7_RTC_HSECLOCK=y -CONFIG_STM32H7_RTC_MAGIC_REG=1 -CONFIG_STM32H7_SAVE_CRASHDUMP=y -CONFIG_STM32H7_SDMMC1=y -CONFIG_STM32H7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_SPI1=y -CONFIG_STM32H7_SPI1_DMA=y -CONFIG_STM32H7_SPI1_DMA_BUFFER=2048 -CONFIG_STM32H7_SPI2=y -CONFIG_STM32H7_SPI3=y -CONFIG_STM32H7_SPI4=y -CONFIG_STM32H7_SPI4_DMA=y -CONFIG_STM32H7_SPI4_DMA_BUFFER=2048 -CONFIG_STM32H7_SPI_DMATHRESHOLD=8 -CONFIG_STM32H7_TIM15=y -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_TIM2=y -CONFIG_STM32H7_TIM4=y -CONFIG_STM32H7_TIM5=y -CONFIG_STM32H7_TIM8=y -CONFIG_STM32H7_UART4=y -CONFIG_STM32H7_UART7=y -CONFIG_STM32H7_UART8=y -CONFIG_STM32H7_USART1=y -CONFIG_STM32H7_USART2=y -CONFIG_STM32H7_USART3=y -CONFIG_STM32H7_USART6=y -CONFIG_STM32H7_USART_BREAKS=y -CONFIG_STM32H7_USART_INVERT=y -CONFIG_STM32H7_USART_SINGLEWIRE=y -CONFIG_STM32H7_USART_SWAP=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_IFLOWCONTROL=y -CONFIG_UART7_OFLOWCONTROL=y -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_SERIAL_CONSOLE=y -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_TXBUFSIZE=1500 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 -CONFIG_WATCHDOG=y diff --git a/boards/matek/h743-mini/nuttx-config/scripts/bootloader_script.ld b/boards/matek/h743-mini/nuttx-config/scripts/bootloader_script.ld deleted file mode 100644 index 511ef26..0000000 --- a/boards/matek/h743-mini/nuttx-config/scripts/bootloader_script.ld +++ /dev/null @@ -1,213 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016, 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The Durandal-v1 uses an STM32H743II has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * The Durandal has a Swtich on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the swiutch is - * drepresed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743ZI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - itcm (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - flash (rx) : ORIGIN = 0x08000000, LENGTH = 2048K - dtcm1 (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - dtcm2 (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - sram (rwx) : ORIGIN = 0x24000000, LENGTH = 512K - sram1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K - sram2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K - sram3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K - sram4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K - bbram (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/matek/h743-mini/nuttx-config/scripts/script.ld b/boards/matek/h743-mini/nuttx-config/scripts/script.ld deleted file mode 100644 index 85f4990..0000000 --- a/boards/matek/h743-mini/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,228 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2020 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The board uses an STM32H743II and has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * There's a switch on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the switch is - * drepresed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743ZI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - FLASH (rx) : ORIGIN = 0x08020000, LENGTH = 1920K - - DTCM1_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - DTCM2_RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */ - SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */ - SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */ - BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH - - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - - /* Pad out last section as the STM32H7 Flash write size is 256 bits. 32 bytes */ - . = ALIGN(16); - FILL(0xffff) - . += 16; - } > AXI_SRAM AT > FLASH = 0xffff - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > AXI_SRAM - - /* Emit the the D3 power domain section for locating BDMA data */ - - .sram4_reserve (NOLOAD) : - { - *(.sram4) - . = ALIGN(4); - _sram4_heap_start = ABSOLUTE(.); - } > SRAM4 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/matek/h743-mini/src/CMakeLists.txt b/boards/matek/h743-mini/src/CMakeLists.txt deleted file mode 100644 index c472153..0000000 --- a/boards/matek/h743-mini/src/CMakeLists.txt +++ /dev/null @@ -1,68 +0,0 @@ -############################################################################ -# -# Copyright (c) 2021 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. -# -############################################################################ -if("${PX4_BOARD_LABEL}" STREQUAL "bootloader") - add_library(drivers_board - bootloader_main.c - usb.c - ) - target_link_libraries(drivers_board - PRIVATE - nuttx_arch - nuttx_drivers - bootloader - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/bootloader/common) - -else() - add_library(drivers_board - i2c.cpp - init.c - led.c - sdio.c - spi.cpp - timer_config.cpp - usb.c - ) - add_dependencies(drivers_board arch_board_hw_info) - - target_link_libraries(drivers_board - PRIVATE - arch_io_pins - arch_spi - arch_board_hw_info - drivers__led - nuttx_arch - nuttx_drivers - px4_layer - ) -endif() diff --git a/boards/matek/h743-mini/src/board_config.h b/boards/matek/h743-mini/src/board_config.h deleted file mode 100644 index 151d6b5..0000000 --- a/boards/matek/h743-mini/src/board_config.h +++ /dev/null @@ -1,237 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * Board internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ - -// #define FLASH_BASED_PARAMS - - -/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */ - -#define GPIO_nLED_BLUE /* PE3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN3) -#define GPIO_nLED_GREEN /* PE4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN4) - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_ARMED_STATE_LED 1 // Green LED -#define BOARD_OVERLOAD_LED 0 // Blue LED - - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that - * can be used by the Px4 Firmware in the adc driver - */ - -/* ADC defines to be used in sensors.cpp to read from a particular channel */ -#define ADC1_CH(n) (n) - -/* Define GPIO pins used as ADC N.B. Channel numbers must match below */ -#define PX4_ADC_GPIO \ - /* PC0 */ GPIO_ADC123_INP10, \ - /* PC1 */ GPIO_ADC123_INP11, \ - /* PA4 */ GPIO_ADC12_INP18, \ - /* PA7 */ GPIO_ADC12_INP7, \ - /* PC4 */ GPIO_ADC12_INP4, \ - /* PC5 */ GPIO_ADC12_INP8 - -/* Define Channel numbers must match above GPIO pin IN(n)*/ -#define ADC_BATTERY_VOLTAGE_CHANNEL /* PC0 */ ADC1_CH(10) -#define ADC_BATTERY_CURRENT_CHANNEL /* PC1 */ ADC1_CH(11) -#define ADC_BATTERY2_VOLTAGE_CHANNEL /* PA4 */ ADC1_CH(18) -#define ADC_BATTERY2_CURRENT_CHANNEL /* PA7 */ ADC1_CH(7) -#define ADC_AIRSPEED_IN_CHANNEL /* PC4 */ ADC1_CH(4) -#define ADC_RSSI_IN_CHANNEL /* PC5 */ ADC1_CH(8) - -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY_CURRENT_CHANNEL) | \ - (1 << ADC_BATTERY2_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY2_CURRENT_CHANNEL) | \ - (1 << ADC_AIRSPEED_IN_CHANNEL) | \ - (1 << ADC_RSSI_IN_CHANNEL)) - - -/* Define Battery 1 Voltage Divider and A per V - */ - -#define BOARD_BATTERY1_V_DIV (11.0f) /* measured with the provided PM board */ -#define BOARD_BATTERY1_A_PER_V (40.0f) -#define BOARD_BATTERY2_V_DIV (11.0f) /* measured with the provided PM board */ - - -/* CAN Silence - * - * Silent mode control \ ESC Mux select - */ - -#define GPIO_CAN1_SILENT_S0 /* PD3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN3) - - -/* PWM - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 12 -#define DIRECT_INPUT_TIMER_CHANNELS 12 - -#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS - - -/* Spare GPIO */ - -// #define GPIO_PG6 /* PG6 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN6) -// #define GPIO_PD15 /* PD15 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTD|GPIO_PIN15) -// #define GPIO_PG15 /* PG15 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN15) - - -/* Tone alarm output */ - -#define GPIO_TONE_ALARM_IDLE /* PA15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) -#define GPIO_TONE_ALARM_GPIO /* PA15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) - -// #define TONE_ALARM_TIMER 2 /* Timer 2 */ -// #define TONE_ALARM_CHANNEL 1 /* PA15 GPIO_TIM2_CH1OUT_2 */ -// #define GPIO_TONE_ALARM_IDLE /* PA15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) -// #define GPIO_TONE_ALARM GPIO_TIM2_CH1OUT_2 - - -/* USB OTG FS - * - * PE2 OTG_FS_VBUS VBUS sensing - */ - -#define GPIO_OTGFS_VBUS /* PE2 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTE|GPIO_PIN2) - - -/* High-resolution timer */ -#define HRT_TIMER 2 /* use timer8 for the HRT */ -#define HRT_TIMER_CHANNEL 1 /* use capture/compare channel 3 */ - - -/* RC Serial port */ -#define RC_SERIAL_PORT "/dev/ttyS4" -#define BOARD_SUPPORTS_RC_SERIAL_PORT_OUTPUT - -// #define GPIO_RSSI_IN /* PC5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN5) - - -/* SD Card */ -#define SDIO_SLOTNO 0 /* Only one slot */ -#define SDIO_MINOR 0 - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ -#define BOARD_HAS_ON_RESET 1 - - -#define PX4_GPIO_INIT_LIST { \ - PX4_ADC_GPIO, \ - GPIO_CAN1_TX, \ - GPIO_CAN1_RX, \ - GPIO_CAN1_SILENT_S0, \ - GPIO_nLED_BLUE, \ - GPIO_nLED_GREEN, \ - GPIO_TONE_ALARM_IDLE, \ - } - -#define BOARD_ENABLE_CONSOLE_BUFFER - -#define BOARD_NUM_IO_TIMERS 4 - - -__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 board. - * - ****************************************************************************************************/ - -extern void stm32_spiinitialize(void); - -extern void stm32_usbinitialize(void); - -extern void board_peripheral_reset(int ms); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/matek/h743-mini/src/bootloader_main.c b/boards/matek/h743-mini/src/bootloader_main.c deleted file mode 100644 index 5670308..0000000 --- a/boards/matek/h743-mini/src/bootloader_main.c +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file bootloader_main.c - * - * FMU-specific early startup code for bootloader -*/ - -#include "board_config.h" -#include "bl.h" - -#include -#include -#include -#include -#include -#include "arm_internal.h" -#include - -extern int sercon_main(int c, char **argv); - -__EXPORT void board_on_reset(int status) {} - -__EXPORT void stm32_boardinitialize(void) -{ - /* configure USB interfaces */ - stm32_usbinitialize(); -} - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - return 0; -} - -void board_late_initialize(void) -{ - sercon_main(0, NULL); -} - -extern void sys_tick_handler(void); -void board_timerhook(void) -{ - sys_tick_handler(); -} diff --git a/boards/matek/h743-mini/src/hw_config.h b/boards/matek/h743-mini/src/hw_config.h deleted file mode 100644 index f289dc9..0000000 --- a/boards/matek/h743-mini/src/hw_config.h +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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. - * - ****************************************************************************/ - -#pragma once - -/**************************************************************************** - * 10-8--2016: - * To simplify the ripple effect on the tools, we will be using - * /dev/serial/by-id/PX4 to locate PX4 devices. Therefore - * moving forward all Bootloaders must contain the prefix "PX4 BL " - * in the USBDEVICESTRING - * This Change will be made in an upcoming BL release - ****************************************************************************/ -/* - * Define usage to configure a bootloader - * - * - * Constant example Usage - * APP_LOAD_ADDRESS 0x08004000 - The address in Linker Script, where the app fw is org-ed - * BOOTLOADER_DELAY 5000 - Ms to wait while under USB pwr or bootloader request - * BOARD_FMUV2 - * INTERFACE_USB 1 - (Optional) Scan and use the USB interface for bootloading - * INTERFACE_USART 1 - (Optional) Scan and use the Serial interface for bootloading - * USBDEVICESTRING "PX4 BL FMU v2.x" - USB id string - * USBPRODUCTID 0x0011 - PID Should match defconfig - * BOOT_DELAY_ADDRESS 0x000001a0 - (Optional) From the linker script from Linker Script to get a custom - * delay provided by an APP FW - * BOARD_TYPE 9 - Must match .prototype boad_id - * _FLASH_KBYTES (*(uint16_t *)0x1fff7a22) - Run time flash size detection - * BOARD_FLASH_SECTORS ((_FLASH_KBYTES == 0x400) ? 11 : 23) - Run time determine the physical last sector - * BOARD_FLASH_SECTORS 11 - Hard coded zero based last sector - * BOARD_FLASH_SIZE (_FLASH_KBYTES*1024)- Total Flash size of device, determined at run time. - * (1024 * 1024) - Hard coded Total Flash of device - The bootloader and app reserved will be deducted - * programmatically - * - * BOARD_FIRST_FLASH_SECTOR_TO_ERASE 2 - Optional sectors index in the flash_sectors table (F4 only), to begin erasing. - * This is to allow sectors to be reserved for app fw usage. That will NOT be erased - * during a FW upgrade. - * The default is 0, and selects the first sector to be erased, as the 0th entry in the - * flash_sectors table. Which is the second physical sector of FLASH in the device. - * The first physical sector of FLASH is used by the bootloader, and is not defined - * in the table. - * - * APP_RESERVATION_SIZE (BOARD_FIRST_FLASH_SECTOR_TO_ERASE * 16 * 1024) - Number of bytes reserved by the APP FW. This number plus - * BOOTLOADER_RESERVATION_SIZE will be deducted from - * BOARD_FLASH_SIZE to determine the size of the App FW - * and hence the address space of FLASH to erase and program. - * USBMFGSTRING "PX4 AP" - Optional USB MFG string (default is '3D Robotics' if not defined.) - * SERIAL_BREAK_DETECT_DISABLED - Optional prevent break selection on Serial port from entering or staying in BL - * - * * Other defines are somewhat self explanatory. - */ - -/* Boot device selection list*/ -#define USB0_DEV 0x01 -#define SERIAL0_DEV 0x02 -#define SERIAL1_DEV 0x04 - -#define APP_LOAD_ADDRESS 0x08020000 -#define BOOTLOADER_DELAY 5000 -#define INTERFACE_USB 1 -#define INTERFACE_USB_CONFIG "/dev/ttyACM0" -#define BOARD_VBUS MK_GPIO_INPUT(GPIO_OTGFS_VBUS) - -//#define USE_VBUS_PULL_DOWN -#define INTERFACE_USART 1 -#define INTERFACE_USART_CONFIG "/dev/ttyS0,57600" -#define BOOT_DELAY_ADDRESS 0x000001a0 -#define BOARD_TYPE 139 -#define _FLASH_KBYTES (*(uint32_t *)0x1FF1E880) -#define BOARD_FLASH_SECTORS (15) -#define BOARD_FLASH_SIZE (_FLASH_KBYTES * 1024) - -#define OSC_FREQ 8 - -#define BOARD_PIN_LED_ACTIVITY GPIO_nLED_BLUE // BLUE -#define BOARD_PIN_LED_BOOTLOADER GPIO_nLED_GREEN // GREEN -#define BOARD_LED_ON 0 -#define BOARD_LED_OFF 1 - -#define SERIAL_BREAK_DETECT_DISABLED 1 - -#if !defined(ARCH_SN_MAX_LENGTH) -# define ARCH_SN_MAX_LENGTH 12 -#endif - -#if !defined(APP_RESERVATION_SIZE) -# define APP_RESERVATION_SIZE 0 -#endif - -#if !defined(BOARD_FIRST_FLASH_SECTOR_TO_ERASE) -# define BOARD_FIRST_FLASH_SECTOR_TO_ERASE 1 -#endif - -#if !defined(USB_DATA_ALIGN) -# define USB_DATA_ALIGN -#endif - -#ifndef BOOT_DEVICES_SELECTION -# define BOOT_DEVICES_SELECTION USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif - -#ifndef BOOT_DEVICES_FILTER_ONUSB -# define BOOT_DEVICES_FILTER_ONUSB USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif diff --git a/boards/matek/h743-mini/src/i2c.cpp b/boards/matek/h743-mini/src/i2c.cpp deleted file mode 100644 index 1444ea1..0000000 --- a/boards/matek/h743-mini/src/i2c.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), - initI2CBusInternal(2), -}; diff --git a/boards/matek/h743-mini/src/init.c b/boards/matek/h743-mini/src/init.c deleted file mode 100644 index bb1c6f9..0000000 --- a/boards/matek/h743-mini/src/init.c +++ /dev/null @@ -1,182 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * FMU-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. - */ - -#include "board_config.h" - -#include - -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include - -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - UNUSED(ms); -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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 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 - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Need hrt running before using the ADC */ - px4_platform_init(); - - /* configure the DMA allocator */ - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_BLUE); - } - -#ifdef CONFIG_MMCSD - int ret = stm32_sdio_initialize(); - - if (ret != OK) { - led_on(LED_BLUE); - return ret; - } - -#endif - - /* Configure the HW based on the manifest */ - px4_platform_configure(); - - return OK; -} diff --git a/boards/matek/h743-mini/src/led.c b/boards/matek/h743-mini/src/led.c deleted file mode 100644 index 2d60d89..0000000 --- a/boards/matek/h743-mini/src/led.c +++ /dev/null @@ -1,112 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -# define xlat(p) (p) -static uint32_t g_ledmap[] = { - GPIO_nLED_BLUE, // Indexed by LED_BLUE (defaulted to an output) - GPIO_nLED_GREEN -}; - -__EXPORT void led_init(void) -{ - /* Configure LED GPIOs for output */ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - if (g_ledmap[l] != 0) { - stm32_configgpio(g_ledmap[l]); - } - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - if (g_ledmap[led] != 0) { - stm32_gpiowrite(g_ledmap[led], !state); - } -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - if (g_ledmap[led] != 0) { - return !stm32_gpioread(g_ledmap[led]); - } - - return false; -} - -__EXPORT void led_on(int led) -{ - phy_set_led(xlat(led), true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(xlat(led), false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(xlat(led), !phy_get_led(xlat(led))); -} diff --git a/boards/matek/h743-mini/src/sdio.c b/boards/matek/h743-mini/src/sdio.c deleted file mode 100644 index 869d757..0000000 --- a/boards/matek/h743-mini/src/sdio.c +++ /dev/null @@ -1,177 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include "chip.h" -#include "board_config.h" -#include "stm32_gpio.h" -#include "stm32_sdmmc.h" - -#ifdef CONFIG_MMCSD - - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Card detections requires card support and a card detection GPIO */ - -#define HAVE_NCD 1 -#if !defined(GPIO_SDMMC1_NCD) -# undef HAVE_NCD -#endif - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -static FAR struct sdio_dev_s *sdio_dev; -#ifdef HAVE_NCD -static bool g_sd_inserted = 0xff; /* Impossible value */ -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_ncd_interrupt - * - * Description: - * Card detect interrupt handler. - * - ****************************************************************************/ - -#ifdef HAVE_NCD -static int stm32_ncd_interrupt(int irq, FAR void *context) -{ - bool present; - - present = !stm32_gpioread(GPIO_SDMMC1_NCD); - - if (sdio_dev && present != g_sd_inserted) { - sdio_mediachange(sdio_dev, present); - g_sd_inserted = present; - } - - return OK; -} -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_sdio_initialize - * - * Description: - * Initialize SDIO-based MMC/SD card support - * - ****************************************************************************/ - -int stm32_sdio_initialize(void) -{ - int ret; - -#ifdef HAVE_NCD - /* Card detect */ - - bool cd_status; - - /* Configure the card detect GPIO */ - - stm32_configgpio(GPIO_SDMMC1_NCD); - - /* Register an interrupt handler for the card detect pin */ - - stm32_gpiosetevent(GPIO_SDMMC1_NCD, true, true, true, stm32_ncd_interrupt); -#endif - - /* Mount the SDIO-based MMC/SD block driver */ - /* First, get an instance of the SDIO interface */ - - finfo("Initializing SDIO slot %d\n", SDIO_SLOTNO); - - sdio_dev = sdio_initialize(SDIO_SLOTNO); - - if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", SDIO_SLOTNO); - return -ENODEV; - } - - /* Now bind the SDIO interface to the MMC/SD driver */ - - finfo("Bind SDIO to the MMC/SD driver, minor=%d\n", SDIO_MINOR); - - ret = mmcsd_slotinitialize(SDIO_MINOR, sdio_dev); - - if (ret != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); - return ret; - } - - finfo("Successfully bound SDIO to the MMC/SD driver\n"); - -#ifdef HAVE_NCD - /* Use SD card detect pin to check if a card is g_sd_inserted */ - - cd_status = !stm32_gpioread(GPIO_SDMMC1_NCD); - finfo("Card detect : %d\n", cd_status); - - sdio_mediachange(sdio_dev, cd_status); -#else - /* Assume that the SD card is inserted. What choice do we have? */ - - sdio_mediachange(sdio_dev, true); -#endif - - return OK; -} - -#endif /* CONFIG_MMCSD */ diff --git a/boards/matek/h743-mini/src/spi.cpp b/boards/matek/h743-mini/src/spi.cpp deleted file mode 100644 index db673be..0000000 --- a/boards/matek/h743-mini/src/spi.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 -#include -#include - - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_MPU6000, SPI::CS{GPIO::PortC, GPIO::Pin15}, SPI::DRDY{GPIO::PortB, GPIO::Pin2}), - }), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_OSD_DEVTYPE_ATXXXX, SPI::CS{GPIO::PortB, GPIO::Pin12}), - }), - initSPIBusExternal(SPI::Bus::SPI3, { - initSPIConfigExternal(SPI::CS{GPIO::PortD, GPIO::Pin4}), - initSPIConfigExternal(SPI::CS{GPIO::PortE, GPIO::Pin2}), - }), - initSPIBus(SPI::Bus::SPI4, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42605, SPI::CS{GPIO::PortC, GPIO::Pin13}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortE, GPIO::Pin11}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/matek/h743-mini/src/timer_config.cpp b/boards/matek/h743-mini/src/timer_config.cpp deleted file mode 100644 index e862bf2..0000000 --- a/boards/matek/h743-mini/src/timer_config.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer3, DMA{DMA::Index1, DMA::Stream2, DMA::Channel5}), - initIOTimer(Timer::Timer5, DMA{DMA::Index1, DMA::Stream0, DMA::Channel6}), - initIOTimer(Timer::Timer4, DMA{DMA::Index1, DMA::Stream6, DMA::Channel2}), - initIOTimer(Timer::Timer15), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel3}, {GPIO::PortB, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel4}, {GPIO::PortB, GPIO::Pin1}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel1}, {GPIO::PortA, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel2}, {GPIO::PortA, GPIO::Pin1}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel3}, {GPIO::PortA, GPIO::Pin2}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel4}, {GPIO::PortA, GPIO::Pin3}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel1}, {GPIO::PortD, GPIO::Pin12}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel4}, {GPIO::PortD, GPIO::Pin15}), - initIOTimerChannel(io_timers, {Timer::Timer15, Timer::Channel1}, {GPIO::PortE, GPIO::Pin5}), - initIOTimerChannel(io_timers, {Timer::Timer15, Timer::Channel2}, {GPIO::PortE, GPIO::Pin6}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); - - - -constexpr io_timers_t led_pwm_timers[MAX_LED_TIMERS] = { - initIOTimer(Timer::Timer1), -}; - -// #define CCER_C1_NUM_BITS 4 -// #define POLARITY(c) (GTIM_CCER_CC1P << (((c)-1) * CCER_C1_NUM_BITS)) -// #define DRIVE_TYPE(p) ((p)|GPIO_OPENDRAIN|GPIO_PULLUP) - -// static inline constexpr timer_io_channels_t initIOTimerChannelLED(const io_timers_t io_timers_conf[MAX_LED_TIMERS], -// Timer::TimerChannel timer, GPIO::GPIOPin pin, int ui_polarity) -// { -// timer_io_channels_t ret = initIOTimerChannel(io_timers_conf, timer, pin); -// ret.gpio_out = DRIVE_TYPE(ret.gpio_out); -// ret.masks = POLARITY(ui_polarity); -// return ret; -// } - -// constexpr timer_io_channels_t led_pwm_channels[MAX_TIMER_LED_CHANNELS] = { -// initIOTimerChannelLED(led_pwm_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortA, GPIO::Pin8}, 1), -// }; diff --git a/boards/matek/h743-mini/src/usb.c b/boards/matek/h743-mini/src/usb.c deleted file mode 100644 index 4fdfafd..0000000 --- a/boards/matek/h743-mini/src/usb.c +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -#include "board_config.h" -#include -#include -#include -#include - -/************************************************************************************ - * 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 - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/matek/h743-slim/bootloader.px4board b/boards/matek/h743-slim/bootloader.px4board deleted file mode 100644 index 19b6e66..0000000 --- a/boards/matek/h743-slim/bootloader.px4board +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_ROMFSROOT="" diff --git a/boards/matek/h743-slim/default.px4board b/boards/matek/h743-slim/default.px4board deleted file mode 100644 index fed4e6c..0000000 --- a/boards/matek/h743-slim/default.px4board +++ /dev/null @@ -1,69 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS2" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS3" -CONFIG_BOARD_SERIAL_TEL3="/dev/ttyS5" -CONFIG_BOARD_SERIAL_TEL4="/dev/ttyS6" -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_BAROMETER_DPS310=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM42605=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU6000=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_BOARD_UAVCAN_INTERFACES=1 -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/matek/h743-slim/extras/matek_h743-slim_bootloader.bin b/boards/matek/h743-slim/extras/matek_h743-slim_bootloader.bin deleted file mode 100755 index 2a5c57d..0000000 Binary files a/boards/matek/h743-slim/extras/matek_h743-slim_bootloader.bin and /dev/null differ diff --git a/boards/matek/h743-slim/firmware.prototype b/boards/matek/h743-slim/firmware.prototype deleted file mode 100644 index a1a9b1f..0000000 --- a/boards/matek/h743-slim/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 1013, - "magic": "PX4FWv1", - "description": "Firmware for the MatekH743 board", - "image": "", - "build_time": 0, - "summary": "MatekH743", - "version": "0.1", - "image_size": 0, - "image_maxsize": 1966080, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/matek/h743-slim/init/rc.board_defaults b/boards/matek/h743-slim/init/rc.board_defaults deleted file mode 100644 index 6d77662..0000000 --- a/boards/matek/h743-slim/init/rc.board_defaults +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 11 -param set-default BAT1_A_PER_V 40 - -param set-default BAT2_V_DIV 11 -param set-default BAT2_A_PER_V 40 diff --git a/boards/matek/h743-slim/init/rc.board_extras b/boards/matek/h743-slim/init/rc.board_extras deleted file mode 100644 index a39b81b..0000000 --- a/boards/matek/h743-slim/init/rc.board_extras +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -# -# board specific extras init -#------------------------------------------------------------------------------ - -# if ! param compare OSD_ATXXXX_CFG 0 -# then -# atxxxx start -s -# fi - -atxxxx start -s - - -# DShot telemetry is always on UART7 -# dshot telemetry /dev/ttyS5 - diff --git a/boards/matek/h743-slim/init/rc.board_sensors b/boards/matek/h743-slim/init/rc.board_sensors deleted file mode 100644 index c37c3b3..0000000 --- a/boards/matek/h743-slim/init/rc.board_sensors +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# -# board specific sensors init -#------------------------------------------------------------------------------ - -board_adc start - -# Internal SPI bus ICM-42605 -if ! icm42605 -R 14 -s start -then - # internal SPI bus ICM-20602 - icm20602 -R 12 -s start -fi - -# Internal SPI bus MPU-6000 -mpu6000 -R 12 -s start - -# Internal baro -dps310 -I start -a 118 - -# External mag -qmc5883l -X start -a 13 diff --git a/boards/matek/h743-slim/nuttx-config/Kconfig b/boards/matek/h743-slim/nuttx-config/Kconfig deleted file mode 100644 index bb33d3c..0000000 --- a/boards/matek/h743-slim/nuttx-config/Kconfig +++ /dev/null @@ -1,17 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see misc/tools/kconfig-language.txt. -# -config BOARD_HAS_PROBES - bool "Board provides GPIO or other Hardware for signaling to timing analyze." - default y - ---help--- - This board provides GPIO FMU-CH1-5, CAP1-6 as PROBE_1-11 to provide timing signals from selected drivers. - -config BOARD_USE_PROBES - bool "Enable the use the board provided FMU-CH1-5, CAP1-6 as PROBE_1-11" - default n - depends on BOARD_HAS_PROBES - - ---help--- - Select to use GPIO FMU-CH1-5, CAP1-6 to provide timing signals from selected drivers. diff --git a/boards/matek/h743-slim/nuttx-config/bootloader/defconfig b/boards/matek/h743-slim/nuttx-config/bootloader/defconfig deleted file mode 100644 index 7130c17..0000000 --- a/boards/matek/h743-slim/nuttx-config/bootloader/defconfig +++ /dev/null @@ -1,90 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_CONSOLE is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_SPI_EXCHANGE is not set -# CONFIG_STM32H7_SYSCFG is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/matek/h743-slim/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743VI=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_INITTHREAD_PRIORITY=254 -CONFIG_BOARD_LATE_INITIALIZE=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x1013 -CONFIG_CDCACM_PRODUCTSTR="MatekH743" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x1209 -CONFIG_CDCACM_VENDORSTR="Matek" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_EXPERIMENTAL=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="bootloader_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SPI=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_USART1=y -CONFIG_SYSTEMTICK_HOOK=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGINT_CHAR=0x03 -CONFIG_TTY_SIGTSTP=y -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/matek/h743-slim/nuttx-config/include/board.h b/boards/matek/h743-slim/nuttx-config/include/board.h deleted file mode 100644 index 4bf2b6e..0000000 --- a/boards/matek/h743-slim/nuttx-config/include/board.h +++ /dev/null @@ -1,493 +0,0 @@ -/************************************************************************************ - * nuttx-configs/px4_fmu-v6u/include/board.h - * - * Copyright (C) 2016-2019 Gregory Nutt. All rights reserved. - * Authors: David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ -#ifndef __NUTTX_CONFIG_MATEKH743SLIM_INCLUDE_BOARD_H -#define __NUTTX_CONFIG_MATEKH743SLIM_INCLUDE_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The MatekH743-Slim board provides the following clock sources: - * - * X1: 8 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 64 MHz RC factory-trimmed - * HSE: 8 MHz crystal for HSE - */ - -#define STM32_BOARD_XTAL 8000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 32768 - -/* Main PLL Configuration. - * - * PLL source is HSE = 8,000,000 - * - * PLL_VCOx = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 1 <= PLLM <= 63 - * 4 <= PLLN <= 512 - * 150 MHz <= PLL_VCOL <= 420MHz - * 192 MHz <= PLL_VCOH <= 836MHz - * - * SYSCLK = PLL_VCO / PLLP - * CPUCLK = SYSCLK / D1CPRE - * Subject to - * - * PLLP1 = {2, 4, 6, 8, ..., 128} - * PLLP2,3 = {2, 3, 4, ..., 128} - * CPUCLK <= 480 MHz - */ - -#define STM32_BOARD_USEHSE - -#define STM32_PLLCFG_PLLSRC RCC_PLLCKSELR_PLLSRC_HSE - -/* PLL1, wide 4 - 8 MHz input, enable DIVP, DIVQ, DIVR - * - * PLL1_VCO = (8,000,000 / 1) * 120 = 960 MHz - * - * PLL1P = PLL1_VCO/2 = 960 MHz / 2 = 480 MHz - * PLL1Q = PLL1_VCO/4 = 960 MHz / 4 = 240 MHz - * PLL1R = PLL1_VCO/8 = 960 MHz / 8 = 120 MHz - */ - -#define STM32_PLLCFG_PLL1CFG (RCC_PLLCFGR_PLL1VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL1RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVP1EN | \ - RCC_PLLCFGR_DIVQ1EN | \ - RCC_PLLCFGR_DIVR1EN) -#define STM32_PLLCFG_PLL1M RCC_PLLCKSELR_DIVM1(1) -#define STM32_PLLCFG_PLL1N RCC_PLL1DIVR_N1(120) -#define STM32_PLLCFG_PLL1P RCC_PLL1DIVR_P1(2) -#define STM32_PLLCFG_PLL1Q RCC_PLL1DIVR_Q1(4) -#define STM32_PLLCFG_PLL1R RCC_PLL1DIVR_R1(8) - -#define STM32_VCO1_FREQUENCY ((STM32_HSE_FREQUENCY / 1) * 120) -#define STM32_PLL1P_FREQUENCY (STM32_VCO1_FREQUENCY / 2) -#define STM32_PLL1Q_FREQUENCY (STM32_VCO1_FREQUENCY / 4) -#define STM32_PLL1R_FREQUENCY (STM32_VCO1_FREQUENCY / 8) - -/* PLL2 */ - -#define STM32_PLLCFG_PLL2CFG (RCC_PLLCFGR_PLL2VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL2RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVP2EN | \ - RCC_PLLCFGR_DIVQ2EN | \ - RCC_PLLCFGR_DIVR2EN) -#define STM32_PLLCFG_PLL2M RCC_PLLCKSELR_DIVM2(2) -#define STM32_PLLCFG_PLL2N RCC_PLL2DIVR_N2(48) -#define STM32_PLLCFG_PLL2P RCC_PLL2DIVR_P2(2) -#define STM32_PLLCFG_PLL2Q RCC_PLL2DIVR_Q2(2) -#define STM32_PLLCFG_PLL2R RCC_PLL2DIVR_R2(2) - -#define STM32_VCO2_FREQUENCY ((STM32_HSE_FREQUENCY / 2) * 48) -#define STM32_PLL2P_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2Q_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2R_FREQUENCY (STM32_VCO2_FREQUENCY / 2) - -/* PLL3 */ - -#define STM32_PLLCFG_PLL3CFG (RCC_PLLCFGR_PLL3VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL3RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVQ3EN) -#define STM32_PLLCFG_PLL3M RCC_PLLCKSELR_DIVM3(2) -#define STM32_PLLCFG_PLL3N RCC_PLL3DIVR_N3(48) -#define STM32_PLLCFG_PLL3P RCC_PLL3DIVR_P3(2) -#define STM32_PLLCFG_PLL3Q RCC_PLL3DIVR_Q3(4) -#define STM32_PLLCFG_PLL3R RCC_PLL3DIVR_R3(2) - -#define STM32_VCO3_FREQUENCY ((STM32_HSE_FREQUENCY / 2) * 48) -#define STM32_PLL3P_FREQUENCY (STM32_VCO3_FREQUENCY / 2) -#define STM32_PLL3Q_FREQUENCY (STM32_VCO3_FREQUENCY / 4) -#define STM32_PLL3R_FREQUENCY (STM32_VCO3_FREQUENCY / 2) - -/* SYSCLK = PLL1P = 480MHz - * CPUCLK = SYSCLK / 1 = 480 MHz - */ - -#define STM32_RCC_D1CFGR_D1CPRE (RCC_D1CFGR_D1CPRE_SYSCLK) -#define STM32_SYSCLK_FREQUENCY (STM32_PLL1P_FREQUENCY) -#define STM32_CPUCLK_FREQUENCY (STM32_SYSCLK_FREQUENCY / 1) - -/* Configure Clock Assignments */ - -/* AHB clock (HCLK) is SYSCLK/2 (240 MHz max) - * HCLK1 = HCLK2 = HCLK3 = HCLK4 = 240 - */ - -#define STM32_RCC_D1CFGR_HPRE RCC_D1CFGR_HPRE_SYSCLKd2 /* HCLK = SYSCLK / 2 */ -#define STM32_ACLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* ACLK in D1, HCLK3 in D1 */ -#define STM32_HCLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* HCLK in D2, HCLK4 in D3 */ -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D2CFGR_D2PPRE1 RCC_D2CFGR_D2PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB2 clock (PCLK2) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D2CFGR_D2PPRE2 RCC_D2CFGR_D2PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB3 clock (PCLK3) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D1CFGR_D1PPRE RCC_D1CFGR_D1PPRE_HCLKd2 /* PCLK3 = HCLK / 2 */ -#define STM32_PCLK3_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB4 clock (PCLK4) is HCLK/4 (120 MHz) */ - -#define STM32_RCC_D3CFGR_D3PPRE RCC_D3CFGR_D3PPRE_HCLKd2 /* PCLK4 = HCLK / 2 */ -#define STM32_PCLK4_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timer clock frequencies */ - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM15_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM16_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM17_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Kernel Clock Configuration - * - * Note: look at Table 54 in ST Manual - */ - -/* I2C123 clock source */ - -#define STM32_RCC_D2CCIP2R_I2C123SRC RCC_D2CCIP2R_I2C123SEL_HSI - -/* I2C4 clock source */ - -#define STM32_RCC_D3CCIPR_I2C4SRC RCC_D3CCIPR_I2C4SEL_HSI - -/* SPI123 clock source */ - -#define STM32_RCC_D2CCIP1R_SPI123SRC RCC_D2CCIP1R_SPI123SEL_PLL2 - -/* SPI45 clock source */ - -#define STM32_RCC_D2CCIP1R_SPI45SRC RCC_D2CCIP1R_SPI45SEL_PLL2 - -/* SPI6 clock source */ - -#define STM32_RCC_D3CCIPR_SPI6SRC RCC_D3CCIPR_SPI6SEL_PLL2 - -/* USB 1 and 2 clock source */ - -#define STM32_RCC_D2CCIP2R_USBSRC RCC_D2CCIP2R_USBSEL_PLL3 - -/* ADC 1 2 3 clock source */ - -#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2 - -/* FDCAN 1 clock source */ - -#define STM32_RCC_D2CCIP1R_FDCANSEL RCC_D2CCIP1R_FDCANSEL_HSE /* FDCAN 1 2 clock source */ - -#define STM32_FDCANCLK STM32_HSE_FREQUENCY - -/* FLASH wait states - * - * ------------ ---------- ----------- - * Vcore MAX ACLK WAIT STATES - * ------------ ---------- ----------- - * 1.15-1.26 V 70 MHz 0 - * (VOS1 level) 140 MHz 1 - * 210 MHz 2 - * 1.05-1.15 V 55 MHz 0 - * (VOS2 level) 110 MHz 1 - * 165 MHz 2 - * 220 MHz 3 - * 0.95-1.05 V 45 MHz 0 - * (VOS3 level) 90 MHz 1 - * 135 MHz 2 - * 180 MHz 3 - * 225 MHz 4 - * ------------ ---------- ----------- - */ - -#define BOARD_FLASH_WAITSTATES 2 - -/* SDMMC definitions ********************************************************/ - -/* Init 480kHz, freq = PLL1Q/(2*div) div = PLL1Q/(2*freq) */ - -#define STM32_SDMMC_INIT_CLKDIV (300 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* 20 MHz Max for now - more reliable on some boards than 25 MHz - * 20 MHz = PLL1Q/(2*div), div = PLL1Q/(2*freq), div = 6 = 240 / 40 - */ - -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_MMCXFR_CLKDIV (6 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_SDXFR_CLKDIV (6 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - -/* LED definitions ******************************************************************/ -/* The board has two, LED_GREEN a Green LED and LED_BLUE a Blue LED, - * that can be controlled by software. - * - * If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any way. - * The following definitions are used to access individual LEDs. - */ - -/* LED index values for use with board_userled() */ - -#define BOARD_LED1 0 -#define BOARD_LED2 1 -#define BOARD_NLEDS 2 - -#define BOARD_LED_BLUE BOARD_LED1 -#define BOARD_LED_GREEN BOARD_LED2 - -/* LED bits for use with board_userled_all() */ - -#define BOARD_LED1_BIT (1 << BOARD_LED1) -#define BOARD_LED2_BIT (1 << BOARD_LED2) - -/* If CONFIG_ARCH_LEDS is defined, the usage by the board port is defined in - * include/board.h and src/stm32_leds.c. The LEDs are used to encode OS-related - * events as follows: - * - * - * SYMBOL Meaning LED state - * Red Green Blue - * ---------------------- -------------------------- ------ ------ ----*/ - -#define LED_STARTED 0 /* NuttX has been started OFF OFF OFF */ -#define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF OFF ON */ -#define LED_IRQSENABLED 2 /* Interrupts enabled OFF ON OFF */ -#define LED_STACKCREATED 3 /* Idle stack created OFF ON ON */ -#define LED_INIRQ 4 /* In an interrupt N/C N/C GLOW */ -#define LED_SIGNAL 5 /* In a signal handler N/C GLOW N/C */ -#define LED_ASSERTION 6 /* An assertion failed GLOW N/C GLOW */ -#define LED_PANIC 7 /* The system has crashed Blink OFF N/C */ -#define LED_IDLE 8 /* MCU is is sleep mode ON OFF OFF */ - -/* Thus if the Green LED is statically on, NuttX has successfully booted and - * is, apparently, running normally. If the Red LED is flashing at - * approximately 2Hz, then a fatal error has been detected and the system - * has halted. - */ - -/* Alternate function pin selections ************************************************/ - -#define GPIO_USART1_RX GPIO_USART1_RX_2 /* PA10 */ -#define GPIO_USART1_TX GPIO_USART1_TX_2 /* PA9 */ - -#define GPIO_USART2_RX GPIO_USART2_RX_2 /* PD6 */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ - -#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ -#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ - -#define GPIO_UART4_RX GPIO_UART4_RX_3 /* PB8 */ -#define GPIO_UART4_TX GPIO_UART4_TX_3 /* PB9 */ - -#define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC7 */ -#define GPIO_USART6_TX GPIO_USART6_TX_1 /* PC6 */ - -#define GPIO_UART7_RX GPIO_UART7_RX_3 /* PE7 */ -#define GPIO_UART7_TX GPIO_UART7_TX_3 /* PE8 */ -#define GPIO_UART7_RTS GPIO_UART7_RTS_1 /* PE9 */ -#define GPIO_UART7_CTS GPIO_UART7_CTS_1 /* PE10 */ - -#define GPIO_UART8_RX GPIO_UART8_RX_1 /* PE0 */ -#define GPIO_UART8_TX GPIO_UART8_TX_1 /* PE1 */ - - -/* CAN - * - * CAN1 is routed to transceiver. - */ - -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 /* PD0 */ -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 /* PD1 */ - -/* SPI - * - * SPI1 is MPU6000 - * SPI2 is MAX7456 - * SPI3 is extern with PD4 and PE2 as CS - * SPI4 is ICM20602 - */ - -#define ADJ_SLEW_RATE(p) (((p) & ~GPIO_SPEED_MASK) | (GPIO_SPEED_2MHz)) - -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_3 /* PD7 */ -#define GPIO_SPI1_SCK ADJ_SLEW_RATE(GPIO_SPI1_SCK_1) /* PA5 */ - -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 /* PB14 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 /* PB15 */ -#define GPIO_SPI2_SCK ADJ_SLEW_RATE(GPIO_SPI2_SCK_4) /* PB13 */ - -#define GPIO_SPI3_MISO GPIO_SPI3_MISO_1 /* PB4 */ -#define GPIO_SPI3_MOSI GPIO_SPI3_MOSI_4 /* PB5 */ -#define GPIO_SPI3_SCK ADJ_SLEW_RATE(GPIO_SPI3_SCK_1) /* PB3 */ - -#define GPIO_SPI4_MISO GPIO_SPI4_MISO_1 /* PE13 */ -#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_1 /* PE14 */ -#define GPIO_SPI4_SCK ADJ_SLEW_RATE(GPIO_SPI4_SCK_1) /* PE12 */ - -/* I2C - * - * The optional _GPIO configurations allow the I2C driver to manually - * reset the bus to clear stuck slaves. They match the pin configuration, - * but are normally-high GPIOs. - * - */ - -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_1 /* PB6 */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_1 /* PB7 */ - -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN6) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN7) - -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_1 /* PB10 */ -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_1 /* PB11 */ - -#define GPIO_I2C2_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN10) -#define GPIO_I2C2_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN11) - -/* SDMMC1 - * - * SDMMC1_D0 PC8 - * SDMMC1_D1 PC9 - * SDMMC1_D2 PC10 - * SDMMC1_D3 PC11 - * SDMMC1_CK PC12 - * SDMMC1_CMD PD2 - */ - -// #define GPIO_SDMMC1_D0 GPIO_SDMMC1_D0 /* PC8 */ -// #define GPIO_SDMMC1_D1 GPIO_SDMMC1_D1 /* PC9 */ -// #define GPIO_SDMMC1_D2 GPIO_SDMMC1_D2 /* PC10 */ -// #define GPIO_SDMMC1_D3 GPIO_SDMMC1_D3 /* PC11 */ -// #define GPIO_SDMMC1_CK GPIO_SDMMC1_CK /* PC12 */ -// #define GPIO_SDMMC1_CMD GPIO_SDMMC1_CMD /* PD2 */ - - -/* USB - * - * OTG_FS_DM PA11 - * OTG_FS_DP PA12 - * VBUS PA9 - */ - - -/* Board provides GPIO or other Hardware for signaling to timing analyzer */ - -#if defined(CONFIG_BOARD_USE_PROBES) -# include "stm32_gpio.h" -# define PROBE_N(n) (1<<((n)-1)) -# define PROBE_1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTI|GPIO_PIN0) /* PI0 AUX1 */ -# define PROBE_2 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN12) /* PH12 AUX2 */ -# define PROBE_3 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN11) /* PH11 AUX3 */ -# define PROBE_4 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN10) /* PH10 AUX4 */ -# define PROBE_5 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN13) /* PD13 AUX5 */ -# define PROBE_6 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN14) /* PD14 AUX6 */ -# define PROBE_7 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN6) /* PH6 AUX7 */ -# define PROBE_8 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN9) /* PH9 AUX8 */ -# define PROBE_9 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN11) /* PE11 CAP1 */ - -# define PROBE_INIT(mask) \ - do { \ - if ((mask)& PROBE_N(1)) { stm32_configgpio(PROBE_1); } \ - if ((mask)& PROBE_N(2)) { stm32_configgpio(PROBE_2); } \ - if ((mask)& PROBE_N(3)) { stm32_configgpio(PROBE_3); } \ - if ((mask)& PROBE_N(4)) { stm32_configgpio(PROBE_4); } \ - if ((mask)& PROBE_N(5)) { stm32_configgpio(PROBE_5); } \ - if ((mask)& PROBE_N(6)) { stm32_configgpio(PROBE_6); } \ - if ((mask)& PROBE_N(7)) { stm32_configgpio(PROBE_7); } \ - if ((mask)& PROBE_N(8)) { stm32_configgpio(PROBE_8); } \ - if ((mask)& PROBE_N(9)) { stm32_configgpio(PROBE_9); } \ - } while(0) - -# define PROBE(n,s) do {stm32_gpiowrite(PROBE_##n,(s));}while(0) -# define PROBE_MARK(n) PROBE(n,false);PROBE(n,true) -#else -# define PROBE_INIT(mask) -# define PROBE(n,s) -# define PROBE_MARK(n) -#endif - -#endif /*__NUTTX_CONFIG_MATEKH743SLIM_INCLUDE_BOARD_H */ diff --git a/boards/matek/h743-slim/nuttx-config/include/board_dma_map.h b/boards/matek/h743-slim/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 693132c..0000000 --- a/boards/matek/h743-slim/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -#pragma once - -// DMAMUX1 -#define DMAMAP_SPI1_RX DMAMAP_DMA12_SPI1RX_0 /* DMA1:37 */ -#define DMAMAP_SPI1_TX DMAMAP_DMA12_SPI1TX_0 /* DMA1:38 */ - - -// DMAMUX2 -#define DMAMAP_SPI4_RX DMAMAP_DMA12_SPI4RX_1 /* DMA2:83 */ -#define DMAMAP_SPI4_TX DMAMAP_DMA12_SPI4TX_1 /* DMA2:84 */ diff --git a/boards/matek/h743-slim/nuttx-config/nsh/defconfig b/boards/matek/h743-slim/nuttx-config/nsh/defconfig deleted file mode 100644 index 94267a1..0000000 --- a/boards/matek/h743-slim/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,256 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/matek/h743-slim/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743VI=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=95150 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x1013 -CONFIG_CDCACM_PRODUCTSTR="MatekH743" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x1209 -CONFIG_CDCACM_VENDORSTR="Matek" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_MEMFAULT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXPERIMENTAL=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=4 -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32H7_ADC1=y -CONFIG_STM32H7_ADC3=y -CONFIG_STM32H7_BBSRAM=y -CONFIG_STM32H7_BBSRAM_FILES=5 -CONFIG_STM32H7_BDMA=y -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_DMA2=y -CONFIG_STM32H7_DMACAPABLE=y -CONFIG_STM32H7_FLOWCONTROL_BROKEN=y -CONFIG_STM32H7_I2C1=y -CONFIG_STM32H7_I2C2=y -CONFIG_STM32H7_I2C_DYNTIMEO=y -CONFIG_STM32H7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_RTC=y -CONFIG_STM32H7_RTC_HSECLOCK=y -CONFIG_STM32H7_RTC_MAGIC_REG=1 -CONFIG_STM32H7_SAVE_CRASHDUMP=y -CONFIG_STM32H7_SDMMC1=y -CONFIG_STM32H7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_SPI1=y -CONFIG_STM32H7_SPI1_DMA=y -CONFIG_STM32H7_SPI1_DMA_BUFFER=2048 -CONFIG_STM32H7_SPI2=y -CONFIG_STM32H7_SPI3=y -CONFIG_STM32H7_SPI4=y -CONFIG_STM32H7_SPI4_DMA=y -CONFIG_STM32H7_SPI4_DMA_BUFFER=2048 -CONFIG_STM32H7_SPI_DMATHRESHOLD=8 -CONFIG_STM32H7_TIM15=y -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_TIM2=y -CONFIG_STM32H7_TIM4=y -CONFIG_STM32H7_TIM5=y -CONFIG_STM32H7_TIM8=y -CONFIG_STM32H7_UART4=y -CONFIG_STM32H7_UART7=y -CONFIG_STM32H7_UART8=y -CONFIG_STM32H7_USART1=y -CONFIG_STM32H7_USART2=y -CONFIG_STM32H7_USART3=y -CONFIG_STM32H7_USART6=y -CONFIG_STM32H7_USART_BREAKS=y -CONFIG_STM32H7_USART_INVERT=y -CONFIG_STM32H7_USART_SINGLEWIRE=y -CONFIG_STM32H7_USART_SWAP=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_IFLOWCONTROL=y -CONFIG_UART7_OFLOWCONTROL=y -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_SERIAL_CONSOLE=y -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_TXBUFSIZE=1500 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 -CONFIG_WATCHDOG=y diff --git a/boards/matek/h743-slim/nuttx-config/scripts/bootloader_script.ld b/boards/matek/h743-slim/nuttx-config/scripts/bootloader_script.ld deleted file mode 100644 index 511ef26..0000000 --- a/boards/matek/h743-slim/nuttx-config/scripts/bootloader_script.ld +++ /dev/null @@ -1,213 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016, 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The Durandal-v1 uses an STM32H743II has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * The Durandal has a Swtich on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the swiutch is - * drepresed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743ZI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - itcm (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - flash (rx) : ORIGIN = 0x08000000, LENGTH = 2048K - dtcm1 (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - dtcm2 (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - sram (rwx) : ORIGIN = 0x24000000, LENGTH = 512K - sram1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K - sram2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K - sram3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K - sram4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K - bbram (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/matek/h743-slim/nuttx-config/scripts/script.ld b/boards/matek/h743-slim/nuttx-config/scripts/script.ld deleted file mode 100644 index c6a8ee1..0000000 --- a/boards/matek/h743-slim/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,228 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016, 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The board uses an STM32H743II and has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * There's a switch on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the switch is - * drepresed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743ZI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - FLASH (rx) : ORIGIN = 0x08020000, LENGTH = 1920K - - DTCM1_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - DTCM2_RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */ - SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */ - SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */ - BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH - - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - - /* Pad out last section as the STM32H7 Flash write size is 256 bits. 32 bytes */ - . = ALIGN(16); - FILL(0xffff) - . += 16; - } > AXI_SRAM AT > FLASH = 0xffff - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > AXI_SRAM - - /* Emit the the D3 power domain section for locating BDMA data */ - - .sram4_reserve (NOLOAD) : - { - *(.sram4) - . = ALIGN(4); - _sram4_heap_start = ABSOLUTE(.); - } > SRAM4 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/matek/h743-slim/src/CMakeLists.txt b/boards/matek/h743-slim/src/CMakeLists.txt deleted file mode 100644 index c472153..0000000 --- a/boards/matek/h743-slim/src/CMakeLists.txt +++ /dev/null @@ -1,68 +0,0 @@ -############################################################################ -# -# Copyright (c) 2021 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. -# -############################################################################ -if("${PX4_BOARD_LABEL}" STREQUAL "bootloader") - add_library(drivers_board - bootloader_main.c - usb.c - ) - target_link_libraries(drivers_board - PRIVATE - nuttx_arch - nuttx_drivers - bootloader - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/bootloader/common) - -else() - add_library(drivers_board - i2c.cpp - init.c - led.c - sdio.c - spi.cpp - timer_config.cpp - usb.c - ) - add_dependencies(drivers_board arch_board_hw_info) - - target_link_libraries(drivers_board - PRIVATE - arch_io_pins - arch_spi - arch_board_hw_info - drivers__led - nuttx_arch - nuttx_drivers - px4_layer - ) -endif() diff --git a/boards/matek/h743-slim/src/board_config.h b/boards/matek/h743-slim/src/board_config.h deleted file mode 100644 index f977a2e..0000000 --- a/boards/matek/h743-slim/src/board_config.h +++ /dev/null @@ -1,230 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * Board internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ - -// #define FLASH_BASED_PARAMS - - -/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */ - -#define GPIO_nLED_BLUE /* PE3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN3) -#define GPIO_nLED_GREEN /* PE4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN4) - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_ARMED_STATE_LED 1 // Green LED -#define BOARD_OVERLOAD_LED 0 // Blue LED - - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that - * can be used by the Px4 Firmware in the adc driver - */ - -/* ADC defines to be used in sensors.cpp to read from a particular channel */ -#define ADC1_CH(n) (n) - -/* Define GPIO pins used as ADC N.B. Channel numbers must match below */ -#define PX4_ADC_GPIO \ - /* PC0 */ GPIO_ADC123_INP10, \ - /* PC1 */ GPIO_ADC123_INP11, \ - /* PA4 */ GPIO_ADC12_INP18, \ - /* PA7 */ GPIO_ADC12_INP7, \ - /* PC4 */ GPIO_ADC12_INP4, \ - /* PC5 */ GPIO_ADC12_INP8 - -/* Define Channel numbers must match above GPIO pin IN(n)*/ -#define ADC_BATTERY_VOLTAGE_CHANNEL /* PC0 */ ADC1_CH(10) -#define ADC_BATTERY_CURRENT_CHANNEL /* PC1 */ ADC1_CH(11) -#define ADC_BATTERY2_VOLTAGE_CHANNEL /* PA4 */ ADC1_CH(18) -#define ADC_BATTERY2_CURRENT_CHANNEL /* PA7 */ ADC1_CH(7) -#define ADC_AIRSPEED_IN_CHANNEL /* PC4 */ ADC1_CH(4) -#define ADC_RSSI_IN_CHANNEL /* PC5 */ ADC1_CH(8) - -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY_CURRENT_CHANNEL) | \ - (1 << ADC_BATTERY2_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY2_CURRENT_CHANNEL) | \ - (1 << ADC_AIRSPEED_IN_CHANNEL) | \ - (1 << ADC_RSSI_IN_CHANNEL)) - -/* CAN Silence - * - * Silent mode control \ ESC Mux select - */ - -#define GPIO_CAN1_SILENT_S0 /* PD3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN3) - - -/* PWM - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 12 -#define DIRECT_INPUT_TIMER_CHANNELS 12 - -#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS - - -/* Spare GPIO */ - -#define GPIO_VIDEO_PWR /* PD10 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN10) -#define GPIO_VIDEO_CAM /* PD11 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN11) -// #define GPIO_PG15 /* PG15 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN15) - - -/* Tone alarm output */ - -#define GPIO_TONE_ALARM_IDLE /* PA15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) -#define GPIO_TONE_ALARM_GPIO /* PA15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) - -// #define TONE_ALARM_TIMER 2 /* Timer 2 */ -// #define TONE_ALARM_CHANNEL 1 /* PA15 GPIO_TIM2_CH1OUT_2 */ -// #define GPIO_TONE_ALARM_IDLE /* PA15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) -// #define GPIO_TONE_ALARM GPIO_TIM2_CH1OUT_2 - - -/* USB OTG FS - * - * PE2 OTG_FS_VBUS VBUS sensing - */ - -#define GPIO_OTGFS_VBUS /* PE2 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTE|GPIO_PIN2) - - -/* High-resolution timer */ -#define HRT_TIMER 2 /* use timer8 for the HRT */ -#define HRT_TIMER_CHANNEL 1 /* use capture/compare channel 3 */ - - -/* RC Serial port */ -#define RC_SERIAL_PORT "/dev/ttyS4" -#define BOARD_SUPPORTS_RC_SERIAL_PORT_OUTPUT - -// #define GPIO_RSSI_IN /* PC5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN5) - - -/* SD Card */ -#define SDIO_SLOTNO 0 /* Only one slot */ -#define SDIO_MINOR 0 - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ -#define BOARD_HAS_ON_RESET 1 - - -#define PX4_GPIO_INIT_LIST { \ - PX4_ADC_GPIO, \ - GPIO_CAN1_TX, \ - GPIO_CAN1_RX, \ - GPIO_CAN1_SILENT_S0, \ - GPIO_nLED_BLUE, \ - GPIO_nLED_GREEN, \ - GPIO_TONE_ALARM_IDLE, \ - GPIO_VIDEO_PWR, \ - GPIO_VIDEO_CAM, \ - } - -#define BOARD_ENABLE_CONSOLE_BUFFER - -#define BOARD_NUM_IO_TIMERS 4 - - -__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 board. - * - ****************************************************************************************************/ - -extern void stm32_spiinitialize(void); - -extern void stm32_usbinitialize(void); - -extern void board_peripheral_reset(int ms); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/matek/h743-slim/src/bootloader_main.c b/boards/matek/h743-slim/src/bootloader_main.c deleted file mode 100644 index 5670308..0000000 --- a/boards/matek/h743-slim/src/bootloader_main.c +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file bootloader_main.c - * - * FMU-specific early startup code for bootloader -*/ - -#include "board_config.h" -#include "bl.h" - -#include -#include -#include -#include -#include -#include "arm_internal.h" -#include - -extern int sercon_main(int c, char **argv); - -__EXPORT void board_on_reset(int status) {} - -__EXPORT void stm32_boardinitialize(void) -{ - /* configure USB interfaces */ - stm32_usbinitialize(); -} - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - return 0; -} - -void board_late_initialize(void) -{ - sercon_main(0, NULL); -} - -extern void sys_tick_handler(void); -void board_timerhook(void) -{ - sys_tick_handler(); -} diff --git a/boards/matek/h743-slim/src/hw_config.h b/boards/matek/h743-slim/src/hw_config.h deleted file mode 100644 index 3256b9c..0000000 --- a/boards/matek/h743-slim/src/hw_config.h +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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. - * - ****************************************************************************/ - -#pragma once - -/**************************************************************************** - * 10-8--2016: - * To simplify the ripple effect on the tools, we will be using - * /dev/serial/by-id/PX4 to locate PX4 devices. Therefore - * moving forward all Bootloaders must contain the prefix "PX4 BL " - * in the USBDEVICESTRING - * This Change will be made in an upcoming BL release - ****************************************************************************/ -/* - * Define usage to configure a bootloader - * - * - * Constant example Usage - * APP_LOAD_ADDRESS 0x08004000 - The address in Linker Script, where the app fw is org-ed - * BOOTLOADER_DELAY 5000 - Ms to wait while under USB pwr or bootloader request - * BOARD_FMUV2 - * INTERFACE_USB 1 - (Optional) Scan and use the USB interface for bootloading - * INTERFACE_USART 1 - (Optional) Scan and use the Serial interface for bootloading - * USBDEVICESTRING "PX4 BL FMU v2.x" - USB id string - * USBPRODUCTID 0x0011 - PID Should match defconfig - * BOOT_DELAY_ADDRESS 0x000001a0 - (Optional) From the linker script from Linker Script to get a custom - * delay provided by an APP FW - * BOARD_TYPE 9 - Must match .prototype boad_id - * _FLASH_KBYTES (*(uint16_t *)0x1fff7a22) - Run time flash size detection - * BOARD_FLASH_SECTORS ((_FLASH_KBYTES == 0x400) ? 11 : 23) - Run time determine the physical last sector - * BOARD_FLASH_SECTORS 11 - Hard coded zero based last sector - * BOARD_FLASH_SIZE (_FLASH_KBYTES*1024)- Total Flash size of device, determined at run time. - * (1024 * 1024) - Hard coded Total Flash of device - The bootloader and app reserved will be deducted - * programmatically - * - * BOARD_FIRST_FLASH_SECTOR_TO_ERASE 2 - Optional sectors index in the flash_sectors table (F4 only), to begin erasing. - * This is to allow sectors to be reserved for app fw usage. That will NOT be erased - * during a FW upgrade. - * The default is 0, and selects the first sector to be erased, as the 0th entry in the - * flash_sectors table. Which is the second physical sector of FLASH in the device. - * The first physical sector of FLASH is used by the bootloader, and is not defined - * in the table. - * - * APP_RESERVATION_SIZE (BOARD_FIRST_FLASH_SECTOR_TO_ERASE * 16 * 1024) - Number of bytes reserved by the APP FW. This number plus - * BOOTLOADER_RESERVATION_SIZE will be deducted from - * BOARD_FLASH_SIZE to determine the size of the App FW - * and hence the address space of FLASH to erase and program. - * USBMFGSTRING "PX4 AP" - Optional USB MFG string (default is '3D Robotics' if not defined.) - * SERIAL_BREAK_DETECT_DISABLED - Optional prevent break selection on Serial port from entering or staying in BL - * - * * Other defines are somewhat self explanatory. - */ - -/* Boot device selection list*/ -#define USB0_DEV 0x01 -#define SERIAL0_DEV 0x02 -#define SERIAL1_DEV 0x04 - -#define APP_LOAD_ADDRESS 0x08020000 -#define BOOTLOADER_DELAY 5000 -#define INTERFACE_USB 1 -#define INTERFACE_USB_CONFIG "/dev/ttyACM0" -#define BOARD_VBUS MK_GPIO_INPUT(GPIO_OTGFS_VBUS) - -//#define USE_VBUS_PULL_DOWN -#define INTERFACE_USART 1 -#define INTERFACE_USART_CONFIG "/dev/ttyS0,57600" -#define BOOT_DELAY_ADDRESS 0x000001a0 -#define BOARD_TYPE 1013 -#define _FLASH_KBYTES (*(uint32_t *)0x1FF1E880) -#define BOARD_FLASH_SECTORS (15) -#define BOARD_FLASH_SIZE (_FLASH_KBYTES * 1024) - -#define OSC_FREQ 8 - -#define BOARD_PIN_LED_ACTIVITY GPIO_nLED_BLUE // BLUE -#define BOARD_PIN_LED_BOOTLOADER GPIO_nLED_GREEN // GREEN -#define BOARD_LED_ON 0 -#define BOARD_LED_OFF 1 - -#define SERIAL_BREAK_DETECT_DISABLED 1 - -#if !defined(ARCH_SN_MAX_LENGTH) -# define ARCH_SN_MAX_LENGTH 12 -#endif - -#if !defined(APP_RESERVATION_SIZE) -# define APP_RESERVATION_SIZE 0 -#endif - -#if !defined(BOARD_FIRST_FLASH_SECTOR_TO_ERASE) -# define BOARD_FIRST_FLASH_SECTOR_TO_ERASE 1 -#endif - -#if !defined(USB_DATA_ALIGN) -# define USB_DATA_ALIGN -#endif - -#ifndef BOOT_DEVICES_SELECTION -# define BOOT_DEVICES_SELECTION USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif - -#ifndef BOOT_DEVICES_FILTER_ONUSB -# define BOOT_DEVICES_FILTER_ONUSB USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif diff --git a/boards/matek/h743-slim/src/i2c.cpp b/boards/matek/h743-slim/src/i2c.cpp deleted file mode 100644 index 1444ea1..0000000 --- a/boards/matek/h743-slim/src/i2c.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), - initI2CBusInternal(2), -}; diff --git a/boards/matek/h743-slim/src/init.c b/boards/matek/h743-slim/src/init.c deleted file mode 100644 index f78e570..0000000 --- a/boards/matek/h743-slim/src/init.c +++ /dev/null @@ -1,204 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * FMU-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. - */ - -#include "board_config.h" - -#include - -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include - -// # if defined(FLASH_BASED_PARAMS) -// # include -// #endif - -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - UNUSED(ms); -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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 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 - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Need hrt running before using the ADC */ - px4_platform_init(); - - /* configure the DMA allocator */ - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_BLUE); - } - -#ifdef CONFIG_MMCSD - int ret = stm32_sdio_initialize(); - - if (ret != OK) { - led_on(LED_BLUE); - } - -#endif - - -// #if defined(FLASH_BASED_PARAMS) -// static sector_descriptor_t params_sector_map[] = { -// {6, 128 * 1024, 0x081C0000}, -// {7, 128 * 1024, 0x081E0000}, -// {0, 0, 0}, -// }; - -// /* Initialize the flashfs layer to use heap allocated memory */ -// int result = parameter_flashfs_init(params_sector_map, NULL, 0); - -// if (result != OK) { -// syslog(LOG_ERR, "[boot] FAILED to init params in FLASH %d\n", result); -// led_on(LED_BLUE); -// return -ENODEV; -// } - -// #endif - - /* Configure the HW based on the manifest */ - px4_platform_configure(); - - return OK; -} diff --git a/boards/matek/h743-slim/src/led.c b/boards/matek/h743-slim/src/led.c deleted file mode 100644 index 2d60d89..0000000 --- a/boards/matek/h743-slim/src/led.c +++ /dev/null @@ -1,112 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -# define xlat(p) (p) -static uint32_t g_ledmap[] = { - GPIO_nLED_BLUE, // Indexed by LED_BLUE (defaulted to an output) - GPIO_nLED_GREEN -}; - -__EXPORT void led_init(void) -{ - /* Configure LED GPIOs for output */ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - if (g_ledmap[l] != 0) { - stm32_configgpio(g_ledmap[l]); - } - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - if (g_ledmap[led] != 0) { - stm32_gpiowrite(g_ledmap[led], !state); - } -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - if (g_ledmap[led] != 0) { - return !stm32_gpioread(g_ledmap[led]); - } - - return false; -} - -__EXPORT void led_on(int led) -{ - phy_set_led(xlat(led), true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(xlat(led), false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(xlat(led), !phy_get_led(xlat(led))); -} diff --git a/boards/matek/h743-slim/src/sdio.c b/boards/matek/h743-slim/src/sdio.c deleted file mode 100644 index 869d757..0000000 --- a/boards/matek/h743-slim/src/sdio.c +++ /dev/null @@ -1,177 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include "chip.h" -#include "board_config.h" -#include "stm32_gpio.h" -#include "stm32_sdmmc.h" - -#ifdef CONFIG_MMCSD - - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Card detections requires card support and a card detection GPIO */ - -#define HAVE_NCD 1 -#if !defined(GPIO_SDMMC1_NCD) -# undef HAVE_NCD -#endif - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -static FAR struct sdio_dev_s *sdio_dev; -#ifdef HAVE_NCD -static bool g_sd_inserted = 0xff; /* Impossible value */ -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_ncd_interrupt - * - * Description: - * Card detect interrupt handler. - * - ****************************************************************************/ - -#ifdef HAVE_NCD -static int stm32_ncd_interrupt(int irq, FAR void *context) -{ - bool present; - - present = !stm32_gpioread(GPIO_SDMMC1_NCD); - - if (sdio_dev && present != g_sd_inserted) { - sdio_mediachange(sdio_dev, present); - g_sd_inserted = present; - } - - return OK; -} -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_sdio_initialize - * - * Description: - * Initialize SDIO-based MMC/SD card support - * - ****************************************************************************/ - -int stm32_sdio_initialize(void) -{ - int ret; - -#ifdef HAVE_NCD - /* Card detect */ - - bool cd_status; - - /* Configure the card detect GPIO */ - - stm32_configgpio(GPIO_SDMMC1_NCD); - - /* Register an interrupt handler for the card detect pin */ - - stm32_gpiosetevent(GPIO_SDMMC1_NCD, true, true, true, stm32_ncd_interrupt); -#endif - - /* Mount the SDIO-based MMC/SD block driver */ - /* First, get an instance of the SDIO interface */ - - finfo("Initializing SDIO slot %d\n", SDIO_SLOTNO); - - sdio_dev = sdio_initialize(SDIO_SLOTNO); - - if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", SDIO_SLOTNO); - return -ENODEV; - } - - /* Now bind the SDIO interface to the MMC/SD driver */ - - finfo("Bind SDIO to the MMC/SD driver, minor=%d\n", SDIO_MINOR); - - ret = mmcsd_slotinitialize(SDIO_MINOR, sdio_dev); - - if (ret != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); - return ret; - } - - finfo("Successfully bound SDIO to the MMC/SD driver\n"); - -#ifdef HAVE_NCD - /* Use SD card detect pin to check if a card is g_sd_inserted */ - - cd_status = !stm32_gpioread(GPIO_SDMMC1_NCD); - finfo("Card detect : %d\n", cd_status); - - sdio_mediachange(sdio_dev, cd_status); -#else - /* Assume that the SD card is inserted. What choice do we have? */ - - sdio_mediachange(sdio_dev, true); -#endif - - return OK; -} - -#endif /* CONFIG_MMCSD */ diff --git a/boards/matek/h743-slim/src/spi.cpp b/boards/matek/h743-slim/src/spi.cpp deleted file mode 100644 index db673be..0000000 --- a/boards/matek/h743-slim/src/spi.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 -#include -#include - - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_MPU6000, SPI::CS{GPIO::PortC, GPIO::Pin15}, SPI::DRDY{GPIO::PortB, GPIO::Pin2}), - }), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_OSD_DEVTYPE_ATXXXX, SPI::CS{GPIO::PortB, GPIO::Pin12}), - }), - initSPIBusExternal(SPI::Bus::SPI3, { - initSPIConfigExternal(SPI::CS{GPIO::PortD, GPIO::Pin4}), - initSPIConfigExternal(SPI::CS{GPIO::PortE, GPIO::Pin2}), - }), - initSPIBus(SPI::Bus::SPI4, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42605, SPI::CS{GPIO::PortC, GPIO::Pin13}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortE, GPIO::Pin11}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/matek/h743-slim/src/timer_config.cpp b/boards/matek/h743-slim/src/timer_config.cpp deleted file mode 100644 index e862bf2..0000000 --- a/boards/matek/h743-slim/src/timer_config.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer3, DMA{DMA::Index1, DMA::Stream2, DMA::Channel5}), - initIOTimer(Timer::Timer5, DMA{DMA::Index1, DMA::Stream0, DMA::Channel6}), - initIOTimer(Timer::Timer4, DMA{DMA::Index1, DMA::Stream6, DMA::Channel2}), - initIOTimer(Timer::Timer15), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel3}, {GPIO::PortB, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel4}, {GPIO::PortB, GPIO::Pin1}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel1}, {GPIO::PortA, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel2}, {GPIO::PortA, GPIO::Pin1}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel3}, {GPIO::PortA, GPIO::Pin2}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel4}, {GPIO::PortA, GPIO::Pin3}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel1}, {GPIO::PortD, GPIO::Pin12}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel4}, {GPIO::PortD, GPIO::Pin15}), - initIOTimerChannel(io_timers, {Timer::Timer15, Timer::Channel1}, {GPIO::PortE, GPIO::Pin5}), - initIOTimerChannel(io_timers, {Timer::Timer15, Timer::Channel2}, {GPIO::PortE, GPIO::Pin6}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); - - - -constexpr io_timers_t led_pwm_timers[MAX_LED_TIMERS] = { - initIOTimer(Timer::Timer1), -}; - -// #define CCER_C1_NUM_BITS 4 -// #define POLARITY(c) (GTIM_CCER_CC1P << (((c)-1) * CCER_C1_NUM_BITS)) -// #define DRIVE_TYPE(p) ((p)|GPIO_OPENDRAIN|GPIO_PULLUP) - -// static inline constexpr timer_io_channels_t initIOTimerChannelLED(const io_timers_t io_timers_conf[MAX_LED_TIMERS], -// Timer::TimerChannel timer, GPIO::GPIOPin pin, int ui_polarity) -// { -// timer_io_channels_t ret = initIOTimerChannel(io_timers_conf, timer, pin); -// ret.gpio_out = DRIVE_TYPE(ret.gpio_out); -// ret.masks = POLARITY(ui_polarity); -// return ret; -// } - -// constexpr timer_io_channels_t led_pwm_channels[MAX_TIMER_LED_CHANNELS] = { -// initIOTimerChannelLED(led_pwm_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortA, GPIO::Pin8}, 1), -// }; diff --git a/boards/matek/h743-slim/src/usb.c b/boards/matek/h743-slim/src/usb.c deleted file mode 100644 index 4fdfafd..0000000 --- a/boards/matek/h743-slim/src/usb.c +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -#include "board_config.h" -#include -#include -#include -#include - -/************************************************************************************ - * 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 - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/matek/h743/bootloader.px4board b/boards/matek/h743/bootloader.px4board deleted file mode 100644 index 19b6e66..0000000 --- a/boards/matek/h743/bootloader.px4board +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_ROMFSROOT="" diff --git a/boards/matek/h743/default.px4board b/boards/matek/h743/default.px4board deleted file mode 100644 index ce5f222..0000000 --- a/boards/matek/h743/default.px4board +++ /dev/null @@ -1,70 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS2" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS3" -CONFIG_BOARD_SERIAL_TEL3="/dev/ttyS5" -CONFIG_BOARD_SERIAL_TEL4="/dev/ttyS6" -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_BAROMETER_DPS310=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM42605=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU6000=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_BOARD_UAVCAN_INTERFACES=1 -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/matek/h743/extras/matek_h743_bootloader.bin b/boards/matek/h743/extras/matek_h743_bootloader.bin deleted file mode 100755 index 605024f..0000000 Binary files a/boards/matek/h743/extras/matek_h743_bootloader.bin and /dev/null differ diff --git a/boards/matek/h743/firmware.prototype b/boards/matek/h743/firmware.prototype deleted file mode 100644 index a9177f6..0000000 --- a/boards/matek/h743/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 1013, - "magic": "PX4FWv1", - "description": "Firmware for the MatekH743 boards", - "image": "", - "build_time": 0, - "summary": "MatekH743", - "version": "0.1", - "image_size": 0, - "image_maxsize": 1966080, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/matek/h743/init/rc.board_extras b/boards/matek/h743/init/rc.board_extras deleted file mode 100644 index a39b81b..0000000 --- a/boards/matek/h743/init/rc.board_extras +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -# -# board specific extras init -#------------------------------------------------------------------------------ - -# if ! param compare OSD_ATXXXX_CFG 0 -# then -# atxxxx start -s -# fi - -atxxxx start -s - - -# DShot telemetry is always on UART7 -# dshot telemetry /dev/ttyS5 - diff --git a/boards/matek/h743/init/rc.board_sensors b/boards/matek/h743/init/rc.board_sensors deleted file mode 100644 index 7e970b2..0000000 --- a/boards/matek/h743/init/rc.board_sensors +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -# -# board specific sensors init -#------------------------------------------------------------------------------ - -board_adc start - -# Internal SPI bus ICM-42605 -if ! mpu6000 -R 12 -b 1 -s start -then - # Internal SPI bus ICM-42688P - icm42688p -R 12 -b 1 -s start -fi - -# internal SPI bus ICM-20602 -if ! icm20602 -R 12 -b 4 -s start -then - # Internal SPI bus ICM-42605 - icm42605 -R 14 -b 4 -s start -fi - -# Internal baro -dps310 -I start -a 118 - -# External mag -qmc5883l -X start -a 13 diff --git a/boards/matek/h743/nuttx-config/Kconfig b/boards/matek/h743/nuttx-config/Kconfig deleted file mode 100644 index bb33d3c..0000000 --- a/boards/matek/h743/nuttx-config/Kconfig +++ /dev/null @@ -1,17 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see misc/tools/kconfig-language.txt. -# -config BOARD_HAS_PROBES - bool "Board provides GPIO or other Hardware for signaling to timing analyze." - default y - ---help--- - This board provides GPIO FMU-CH1-5, CAP1-6 as PROBE_1-11 to provide timing signals from selected drivers. - -config BOARD_USE_PROBES - bool "Enable the use the board provided FMU-CH1-5, CAP1-6 as PROBE_1-11" - default n - depends on BOARD_HAS_PROBES - - ---help--- - Select to use GPIO FMU-CH1-5, CAP1-6 to provide timing signals from selected drivers. diff --git a/boards/matek/h743/nuttx-config/bootloader/defconfig b/boards/matek/h743/nuttx-config/bootloader/defconfig deleted file mode 100644 index 2bdea5e..0000000 --- a/boards/matek/h743/nuttx-config/bootloader/defconfig +++ /dev/null @@ -1,89 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_CONSOLE is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_SPI_EXCHANGE is not set -# CONFIG_STM32H7_SYSCFG is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/matek/h743/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743VI=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_INITTHREAD_PRIORITY=254 -CONFIG_BOARD_LATE_INITIALIZE=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_CDCACM=y -CONFIG_CDCACM_PRODUCTID=0x004b -CONFIG_CDCACM_PRODUCTSTR="Matek H743-slim" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x3162 -CONFIG_CDCACM_VENDORSTR="Matek" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_EXPERIMENTAL=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="bootloader_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SPI=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_USART1=y -CONFIG_SYSTEMTICK_HOOK=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGINT_CHAR=0x03 -CONFIG_TTY_SIGTSTP=y -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/matek/h743/nuttx-config/include/board.h b/boards/matek/h743/nuttx-config/include/board.h deleted file mode 100644 index 4bf2b6e..0000000 --- a/boards/matek/h743/nuttx-config/include/board.h +++ /dev/null @@ -1,493 +0,0 @@ -/************************************************************************************ - * nuttx-configs/px4_fmu-v6u/include/board.h - * - * Copyright (C) 2016-2019 Gregory Nutt. All rights reserved. - * Authors: David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ -#ifndef __NUTTX_CONFIG_MATEKH743SLIM_INCLUDE_BOARD_H -#define __NUTTX_CONFIG_MATEKH743SLIM_INCLUDE_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The MatekH743-Slim board provides the following clock sources: - * - * X1: 8 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 64 MHz RC factory-trimmed - * HSE: 8 MHz crystal for HSE - */ - -#define STM32_BOARD_XTAL 8000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 32768 - -/* Main PLL Configuration. - * - * PLL source is HSE = 8,000,000 - * - * PLL_VCOx = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 1 <= PLLM <= 63 - * 4 <= PLLN <= 512 - * 150 MHz <= PLL_VCOL <= 420MHz - * 192 MHz <= PLL_VCOH <= 836MHz - * - * SYSCLK = PLL_VCO / PLLP - * CPUCLK = SYSCLK / D1CPRE - * Subject to - * - * PLLP1 = {2, 4, 6, 8, ..., 128} - * PLLP2,3 = {2, 3, 4, ..., 128} - * CPUCLK <= 480 MHz - */ - -#define STM32_BOARD_USEHSE - -#define STM32_PLLCFG_PLLSRC RCC_PLLCKSELR_PLLSRC_HSE - -/* PLL1, wide 4 - 8 MHz input, enable DIVP, DIVQ, DIVR - * - * PLL1_VCO = (8,000,000 / 1) * 120 = 960 MHz - * - * PLL1P = PLL1_VCO/2 = 960 MHz / 2 = 480 MHz - * PLL1Q = PLL1_VCO/4 = 960 MHz / 4 = 240 MHz - * PLL1R = PLL1_VCO/8 = 960 MHz / 8 = 120 MHz - */ - -#define STM32_PLLCFG_PLL1CFG (RCC_PLLCFGR_PLL1VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL1RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVP1EN | \ - RCC_PLLCFGR_DIVQ1EN | \ - RCC_PLLCFGR_DIVR1EN) -#define STM32_PLLCFG_PLL1M RCC_PLLCKSELR_DIVM1(1) -#define STM32_PLLCFG_PLL1N RCC_PLL1DIVR_N1(120) -#define STM32_PLLCFG_PLL1P RCC_PLL1DIVR_P1(2) -#define STM32_PLLCFG_PLL1Q RCC_PLL1DIVR_Q1(4) -#define STM32_PLLCFG_PLL1R RCC_PLL1DIVR_R1(8) - -#define STM32_VCO1_FREQUENCY ((STM32_HSE_FREQUENCY / 1) * 120) -#define STM32_PLL1P_FREQUENCY (STM32_VCO1_FREQUENCY / 2) -#define STM32_PLL1Q_FREQUENCY (STM32_VCO1_FREQUENCY / 4) -#define STM32_PLL1R_FREQUENCY (STM32_VCO1_FREQUENCY / 8) - -/* PLL2 */ - -#define STM32_PLLCFG_PLL2CFG (RCC_PLLCFGR_PLL2VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL2RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVP2EN | \ - RCC_PLLCFGR_DIVQ2EN | \ - RCC_PLLCFGR_DIVR2EN) -#define STM32_PLLCFG_PLL2M RCC_PLLCKSELR_DIVM2(2) -#define STM32_PLLCFG_PLL2N RCC_PLL2DIVR_N2(48) -#define STM32_PLLCFG_PLL2P RCC_PLL2DIVR_P2(2) -#define STM32_PLLCFG_PLL2Q RCC_PLL2DIVR_Q2(2) -#define STM32_PLLCFG_PLL2R RCC_PLL2DIVR_R2(2) - -#define STM32_VCO2_FREQUENCY ((STM32_HSE_FREQUENCY / 2) * 48) -#define STM32_PLL2P_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2Q_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2R_FREQUENCY (STM32_VCO2_FREQUENCY / 2) - -/* PLL3 */ - -#define STM32_PLLCFG_PLL3CFG (RCC_PLLCFGR_PLL3VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL3RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVQ3EN) -#define STM32_PLLCFG_PLL3M RCC_PLLCKSELR_DIVM3(2) -#define STM32_PLLCFG_PLL3N RCC_PLL3DIVR_N3(48) -#define STM32_PLLCFG_PLL3P RCC_PLL3DIVR_P3(2) -#define STM32_PLLCFG_PLL3Q RCC_PLL3DIVR_Q3(4) -#define STM32_PLLCFG_PLL3R RCC_PLL3DIVR_R3(2) - -#define STM32_VCO3_FREQUENCY ((STM32_HSE_FREQUENCY / 2) * 48) -#define STM32_PLL3P_FREQUENCY (STM32_VCO3_FREQUENCY / 2) -#define STM32_PLL3Q_FREQUENCY (STM32_VCO3_FREQUENCY / 4) -#define STM32_PLL3R_FREQUENCY (STM32_VCO3_FREQUENCY / 2) - -/* SYSCLK = PLL1P = 480MHz - * CPUCLK = SYSCLK / 1 = 480 MHz - */ - -#define STM32_RCC_D1CFGR_D1CPRE (RCC_D1CFGR_D1CPRE_SYSCLK) -#define STM32_SYSCLK_FREQUENCY (STM32_PLL1P_FREQUENCY) -#define STM32_CPUCLK_FREQUENCY (STM32_SYSCLK_FREQUENCY / 1) - -/* Configure Clock Assignments */ - -/* AHB clock (HCLK) is SYSCLK/2 (240 MHz max) - * HCLK1 = HCLK2 = HCLK3 = HCLK4 = 240 - */ - -#define STM32_RCC_D1CFGR_HPRE RCC_D1CFGR_HPRE_SYSCLKd2 /* HCLK = SYSCLK / 2 */ -#define STM32_ACLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* ACLK in D1, HCLK3 in D1 */ -#define STM32_HCLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* HCLK in D2, HCLK4 in D3 */ -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D2CFGR_D2PPRE1 RCC_D2CFGR_D2PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB2 clock (PCLK2) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D2CFGR_D2PPRE2 RCC_D2CFGR_D2PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB3 clock (PCLK3) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D1CFGR_D1PPRE RCC_D1CFGR_D1PPRE_HCLKd2 /* PCLK3 = HCLK / 2 */ -#define STM32_PCLK3_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB4 clock (PCLK4) is HCLK/4 (120 MHz) */ - -#define STM32_RCC_D3CFGR_D3PPRE RCC_D3CFGR_D3PPRE_HCLKd2 /* PCLK4 = HCLK / 2 */ -#define STM32_PCLK4_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timer clock frequencies */ - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM15_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM16_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM17_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Kernel Clock Configuration - * - * Note: look at Table 54 in ST Manual - */ - -/* I2C123 clock source */ - -#define STM32_RCC_D2CCIP2R_I2C123SRC RCC_D2CCIP2R_I2C123SEL_HSI - -/* I2C4 clock source */ - -#define STM32_RCC_D3CCIPR_I2C4SRC RCC_D3CCIPR_I2C4SEL_HSI - -/* SPI123 clock source */ - -#define STM32_RCC_D2CCIP1R_SPI123SRC RCC_D2CCIP1R_SPI123SEL_PLL2 - -/* SPI45 clock source */ - -#define STM32_RCC_D2CCIP1R_SPI45SRC RCC_D2CCIP1R_SPI45SEL_PLL2 - -/* SPI6 clock source */ - -#define STM32_RCC_D3CCIPR_SPI6SRC RCC_D3CCIPR_SPI6SEL_PLL2 - -/* USB 1 and 2 clock source */ - -#define STM32_RCC_D2CCIP2R_USBSRC RCC_D2CCIP2R_USBSEL_PLL3 - -/* ADC 1 2 3 clock source */ - -#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2 - -/* FDCAN 1 clock source */ - -#define STM32_RCC_D2CCIP1R_FDCANSEL RCC_D2CCIP1R_FDCANSEL_HSE /* FDCAN 1 2 clock source */ - -#define STM32_FDCANCLK STM32_HSE_FREQUENCY - -/* FLASH wait states - * - * ------------ ---------- ----------- - * Vcore MAX ACLK WAIT STATES - * ------------ ---------- ----------- - * 1.15-1.26 V 70 MHz 0 - * (VOS1 level) 140 MHz 1 - * 210 MHz 2 - * 1.05-1.15 V 55 MHz 0 - * (VOS2 level) 110 MHz 1 - * 165 MHz 2 - * 220 MHz 3 - * 0.95-1.05 V 45 MHz 0 - * (VOS3 level) 90 MHz 1 - * 135 MHz 2 - * 180 MHz 3 - * 225 MHz 4 - * ------------ ---------- ----------- - */ - -#define BOARD_FLASH_WAITSTATES 2 - -/* SDMMC definitions ********************************************************/ - -/* Init 480kHz, freq = PLL1Q/(2*div) div = PLL1Q/(2*freq) */ - -#define STM32_SDMMC_INIT_CLKDIV (300 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* 20 MHz Max for now - more reliable on some boards than 25 MHz - * 20 MHz = PLL1Q/(2*div), div = PLL1Q/(2*freq), div = 6 = 240 / 40 - */ - -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_MMCXFR_CLKDIV (6 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_SDXFR_CLKDIV (6 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - -/* LED definitions ******************************************************************/ -/* The board has two, LED_GREEN a Green LED and LED_BLUE a Blue LED, - * that can be controlled by software. - * - * If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any way. - * The following definitions are used to access individual LEDs. - */ - -/* LED index values for use with board_userled() */ - -#define BOARD_LED1 0 -#define BOARD_LED2 1 -#define BOARD_NLEDS 2 - -#define BOARD_LED_BLUE BOARD_LED1 -#define BOARD_LED_GREEN BOARD_LED2 - -/* LED bits for use with board_userled_all() */ - -#define BOARD_LED1_BIT (1 << BOARD_LED1) -#define BOARD_LED2_BIT (1 << BOARD_LED2) - -/* If CONFIG_ARCH_LEDS is defined, the usage by the board port is defined in - * include/board.h and src/stm32_leds.c. The LEDs are used to encode OS-related - * events as follows: - * - * - * SYMBOL Meaning LED state - * Red Green Blue - * ---------------------- -------------------------- ------ ------ ----*/ - -#define LED_STARTED 0 /* NuttX has been started OFF OFF OFF */ -#define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF OFF ON */ -#define LED_IRQSENABLED 2 /* Interrupts enabled OFF ON OFF */ -#define LED_STACKCREATED 3 /* Idle stack created OFF ON ON */ -#define LED_INIRQ 4 /* In an interrupt N/C N/C GLOW */ -#define LED_SIGNAL 5 /* In a signal handler N/C GLOW N/C */ -#define LED_ASSERTION 6 /* An assertion failed GLOW N/C GLOW */ -#define LED_PANIC 7 /* The system has crashed Blink OFF N/C */ -#define LED_IDLE 8 /* MCU is is sleep mode ON OFF OFF */ - -/* Thus if the Green LED is statically on, NuttX has successfully booted and - * is, apparently, running normally. If the Red LED is flashing at - * approximately 2Hz, then a fatal error has been detected and the system - * has halted. - */ - -/* Alternate function pin selections ************************************************/ - -#define GPIO_USART1_RX GPIO_USART1_RX_2 /* PA10 */ -#define GPIO_USART1_TX GPIO_USART1_TX_2 /* PA9 */ - -#define GPIO_USART2_RX GPIO_USART2_RX_2 /* PD6 */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ - -#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ -#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ - -#define GPIO_UART4_RX GPIO_UART4_RX_3 /* PB8 */ -#define GPIO_UART4_TX GPIO_UART4_TX_3 /* PB9 */ - -#define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC7 */ -#define GPIO_USART6_TX GPIO_USART6_TX_1 /* PC6 */ - -#define GPIO_UART7_RX GPIO_UART7_RX_3 /* PE7 */ -#define GPIO_UART7_TX GPIO_UART7_TX_3 /* PE8 */ -#define GPIO_UART7_RTS GPIO_UART7_RTS_1 /* PE9 */ -#define GPIO_UART7_CTS GPIO_UART7_CTS_1 /* PE10 */ - -#define GPIO_UART8_RX GPIO_UART8_RX_1 /* PE0 */ -#define GPIO_UART8_TX GPIO_UART8_TX_1 /* PE1 */ - - -/* CAN - * - * CAN1 is routed to transceiver. - */ - -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 /* PD0 */ -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 /* PD1 */ - -/* SPI - * - * SPI1 is MPU6000 - * SPI2 is MAX7456 - * SPI3 is extern with PD4 and PE2 as CS - * SPI4 is ICM20602 - */ - -#define ADJ_SLEW_RATE(p) (((p) & ~GPIO_SPEED_MASK) | (GPIO_SPEED_2MHz)) - -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_3 /* PD7 */ -#define GPIO_SPI1_SCK ADJ_SLEW_RATE(GPIO_SPI1_SCK_1) /* PA5 */ - -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 /* PB14 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 /* PB15 */ -#define GPIO_SPI2_SCK ADJ_SLEW_RATE(GPIO_SPI2_SCK_4) /* PB13 */ - -#define GPIO_SPI3_MISO GPIO_SPI3_MISO_1 /* PB4 */ -#define GPIO_SPI3_MOSI GPIO_SPI3_MOSI_4 /* PB5 */ -#define GPIO_SPI3_SCK ADJ_SLEW_RATE(GPIO_SPI3_SCK_1) /* PB3 */ - -#define GPIO_SPI4_MISO GPIO_SPI4_MISO_1 /* PE13 */ -#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_1 /* PE14 */ -#define GPIO_SPI4_SCK ADJ_SLEW_RATE(GPIO_SPI4_SCK_1) /* PE12 */ - -/* I2C - * - * The optional _GPIO configurations allow the I2C driver to manually - * reset the bus to clear stuck slaves. They match the pin configuration, - * but are normally-high GPIOs. - * - */ - -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_1 /* PB6 */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_1 /* PB7 */ - -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN6) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN7) - -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_1 /* PB10 */ -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_1 /* PB11 */ - -#define GPIO_I2C2_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN10) -#define GPIO_I2C2_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN11) - -/* SDMMC1 - * - * SDMMC1_D0 PC8 - * SDMMC1_D1 PC9 - * SDMMC1_D2 PC10 - * SDMMC1_D3 PC11 - * SDMMC1_CK PC12 - * SDMMC1_CMD PD2 - */ - -// #define GPIO_SDMMC1_D0 GPIO_SDMMC1_D0 /* PC8 */ -// #define GPIO_SDMMC1_D1 GPIO_SDMMC1_D1 /* PC9 */ -// #define GPIO_SDMMC1_D2 GPIO_SDMMC1_D2 /* PC10 */ -// #define GPIO_SDMMC1_D3 GPIO_SDMMC1_D3 /* PC11 */ -// #define GPIO_SDMMC1_CK GPIO_SDMMC1_CK /* PC12 */ -// #define GPIO_SDMMC1_CMD GPIO_SDMMC1_CMD /* PD2 */ - - -/* USB - * - * OTG_FS_DM PA11 - * OTG_FS_DP PA12 - * VBUS PA9 - */ - - -/* Board provides GPIO or other Hardware for signaling to timing analyzer */ - -#if defined(CONFIG_BOARD_USE_PROBES) -# include "stm32_gpio.h" -# define PROBE_N(n) (1<<((n)-1)) -# define PROBE_1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTI|GPIO_PIN0) /* PI0 AUX1 */ -# define PROBE_2 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN12) /* PH12 AUX2 */ -# define PROBE_3 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN11) /* PH11 AUX3 */ -# define PROBE_4 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN10) /* PH10 AUX4 */ -# define PROBE_5 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN13) /* PD13 AUX5 */ -# define PROBE_6 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN14) /* PD14 AUX6 */ -# define PROBE_7 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN6) /* PH6 AUX7 */ -# define PROBE_8 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN9) /* PH9 AUX8 */ -# define PROBE_9 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN11) /* PE11 CAP1 */ - -# define PROBE_INIT(mask) \ - do { \ - if ((mask)& PROBE_N(1)) { stm32_configgpio(PROBE_1); } \ - if ((mask)& PROBE_N(2)) { stm32_configgpio(PROBE_2); } \ - if ((mask)& PROBE_N(3)) { stm32_configgpio(PROBE_3); } \ - if ((mask)& PROBE_N(4)) { stm32_configgpio(PROBE_4); } \ - if ((mask)& PROBE_N(5)) { stm32_configgpio(PROBE_5); } \ - if ((mask)& PROBE_N(6)) { stm32_configgpio(PROBE_6); } \ - if ((mask)& PROBE_N(7)) { stm32_configgpio(PROBE_7); } \ - if ((mask)& PROBE_N(8)) { stm32_configgpio(PROBE_8); } \ - if ((mask)& PROBE_N(9)) { stm32_configgpio(PROBE_9); } \ - } while(0) - -# define PROBE(n,s) do {stm32_gpiowrite(PROBE_##n,(s));}while(0) -# define PROBE_MARK(n) PROBE(n,false);PROBE(n,true) -#else -# define PROBE_INIT(mask) -# define PROBE(n,s) -# define PROBE_MARK(n) -#endif - -#endif /*__NUTTX_CONFIG_MATEKH743SLIM_INCLUDE_BOARD_H */ diff --git a/boards/matek/h743/nuttx-config/include/board_dma_map.h b/boards/matek/h743/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 693132c..0000000 --- a/boards/matek/h743/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -#pragma once - -// DMAMUX1 -#define DMAMAP_SPI1_RX DMAMAP_DMA12_SPI1RX_0 /* DMA1:37 */ -#define DMAMAP_SPI1_TX DMAMAP_DMA12_SPI1TX_0 /* DMA1:38 */ - - -// DMAMUX2 -#define DMAMAP_SPI4_RX DMAMAP_DMA12_SPI4RX_1 /* DMA2:83 */ -#define DMAMAP_SPI4_TX DMAMAP_DMA12_SPI4TX_1 /* DMA2:84 */ diff --git a/boards/matek/h743/nuttx-config/nsh/defconfig b/boards/matek/h743/nuttx-config/nsh/defconfig deleted file mode 100644 index 39e976d..0000000 --- a/boards/matek/h743/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,253 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/matek/h743/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743VI=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=95150 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_PRODUCTID=0x0036 -CONFIG_CDCACM_PRODUCTSTR="MatekH743" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x1B8C -CONFIG_CDCACM_VENDORSTR="Matek" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_MEMFAULT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXPERIMENTAL=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=4 -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32H7_ADC1=y -CONFIG_STM32H7_ADC3=y -CONFIG_STM32H7_BBSRAM=y -CONFIG_STM32H7_BBSRAM_FILES=5 -CONFIG_STM32H7_BDMA=y -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_DMA2=y -CONFIG_STM32H7_DMACAPABLE=y -CONFIG_STM32H7_FLOWCONTROL_BROKEN=y -CONFIG_STM32H7_I2C1=y -CONFIG_STM32H7_I2C2=y -CONFIG_STM32H7_I2C_DYNTIMEO=y -CONFIG_STM32H7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_RTC=y -CONFIG_STM32H7_RTC_HSECLOCK=y -CONFIG_STM32H7_RTC_MAGIC_REG=1 -CONFIG_STM32H7_SAVE_CRASHDUMP=y -CONFIG_STM32H7_SDMMC1=y -CONFIG_STM32H7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_SPI1=y -CONFIG_STM32H7_SPI1_DMA=y -CONFIG_STM32H7_SPI1_DMA_BUFFER=2048 -CONFIG_STM32H7_SPI2=y -CONFIG_STM32H7_SPI3=y -CONFIG_STM32H7_SPI4=y -CONFIG_STM32H7_SPI4_DMA=y -CONFIG_STM32H7_SPI4_DMA_BUFFER=2048 -CONFIG_STM32H7_SPI_DMATHRESHOLD=8 -CONFIG_STM32H7_TIM15=y -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_TIM2=y -CONFIG_STM32H7_TIM4=y -CONFIG_STM32H7_TIM5=y -CONFIG_STM32H7_TIM8=y -CONFIG_STM32H7_UART4=y -CONFIG_STM32H7_UART7=y -CONFIG_STM32H7_UART8=y -CONFIG_STM32H7_USART1=y -CONFIG_STM32H7_USART2=y -CONFIG_STM32H7_USART3=y -CONFIG_STM32H7_USART6=y -CONFIG_STM32H7_USART_BREAKS=y -CONFIG_STM32H7_USART_INVERT=y -CONFIG_STM32H7_USART_SINGLEWIRE=y -CONFIG_STM32H7_USART_SWAP=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_IFLOWCONTROL=y -CONFIG_UART7_OFLOWCONTROL=y -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_SERIAL_CONSOLE=y -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_TXBUFSIZE=1500 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 -CONFIG_WATCHDOG=y diff --git a/boards/matek/h743/nuttx-config/scripts/bootloader_script.ld b/boards/matek/h743/nuttx-config/scripts/bootloader_script.ld deleted file mode 100644 index 511ef26..0000000 --- a/boards/matek/h743/nuttx-config/scripts/bootloader_script.ld +++ /dev/null @@ -1,213 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016, 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The Durandal-v1 uses an STM32H743II has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * The Durandal has a Swtich on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the swiutch is - * drepresed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743ZI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - itcm (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - flash (rx) : ORIGIN = 0x08000000, LENGTH = 2048K - dtcm1 (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - dtcm2 (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - sram (rwx) : ORIGIN = 0x24000000, LENGTH = 512K - sram1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K - sram2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K - sram3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K - sram4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K - bbram (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/matek/h743/nuttx-config/scripts/script.ld b/boards/matek/h743/nuttx-config/scripts/script.ld deleted file mode 100644 index c6a8ee1..0000000 --- a/boards/matek/h743/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,228 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016, 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The board uses an STM32H743II and has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * There's a switch on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the switch is - * drepresed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743ZI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - FLASH (rx) : ORIGIN = 0x08020000, LENGTH = 1920K - - DTCM1_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - DTCM2_RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */ - SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */ - SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */ - BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH - - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - - /* Pad out last section as the STM32H7 Flash write size is 256 bits. 32 bytes */ - . = ALIGN(16); - FILL(0xffff) - . += 16; - } > AXI_SRAM AT > FLASH = 0xffff - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > AXI_SRAM - - /* Emit the the D3 power domain section for locating BDMA data */ - - .sram4_reserve (NOLOAD) : - { - *(.sram4) - . = ALIGN(4); - _sram4_heap_start = ABSOLUTE(.); - } > SRAM4 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/matek/h743/src/CMakeLists.txt b/boards/matek/h743/src/CMakeLists.txt deleted file mode 100644 index c472153..0000000 --- a/boards/matek/h743/src/CMakeLists.txt +++ /dev/null @@ -1,68 +0,0 @@ -############################################################################ -# -# Copyright (c) 2021 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. -# -############################################################################ -if("${PX4_BOARD_LABEL}" STREQUAL "bootloader") - add_library(drivers_board - bootloader_main.c - usb.c - ) - target_link_libraries(drivers_board - PRIVATE - nuttx_arch - nuttx_drivers - bootloader - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/bootloader/common) - -else() - add_library(drivers_board - i2c.cpp - init.c - led.c - sdio.c - spi.cpp - timer_config.cpp - usb.c - ) - add_dependencies(drivers_board arch_board_hw_info) - - target_link_libraries(drivers_board - PRIVATE - arch_io_pins - arch_spi - arch_board_hw_info - drivers__led - nuttx_arch - nuttx_drivers - px4_layer - ) -endif() diff --git a/boards/matek/h743/src/board_config.h b/boards/matek/h743/src/board_config.h deleted file mode 100644 index 151d6b5..0000000 --- a/boards/matek/h743/src/board_config.h +++ /dev/null @@ -1,237 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * Board internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ - -// #define FLASH_BASED_PARAMS - - -/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */ - -#define GPIO_nLED_BLUE /* PE3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN3) -#define GPIO_nLED_GREEN /* PE4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN4) - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_ARMED_STATE_LED 1 // Green LED -#define BOARD_OVERLOAD_LED 0 // Blue LED - - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that - * can be used by the Px4 Firmware in the adc driver - */ - -/* ADC defines to be used in sensors.cpp to read from a particular channel */ -#define ADC1_CH(n) (n) - -/* Define GPIO pins used as ADC N.B. Channel numbers must match below */ -#define PX4_ADC_GPIO \ - /* PC0 */ GPIO_ADC123_INP10, \ - /* PC1 */ GPIO_ADC123_INP11, \ - /* PA4 */ GPIO_ADC12_INP18, \ - /* PA7 */ GPIO_ADC12_INP7, \ - /* PC4 */ GPIO_ADC12_INP4, \ - /* PC5 */ GPIO_ADC12_INP8 - -/* Define Channel numbers must match above GPIO pin IN(n)*/ -#define ADC_BATTERY_VOLTAGE_CHANNEL /* PC0 */ ADC1_CH(10) -#define ADC_BATTERY_CURRENT_CHANNEL /* PC1 */ ADC1_CH(11) -#define ADC_BATTERY2_VOLTAGE_CHANNEL /* PA4 */ ADC1_CH(18) -#define ADC_BATTERY2_CURRENT_CHANNEL /* PA7 */ ADC1_CH(7) -#define ADC_AIRSPEED_IN_CHANNEL /* PC4 */ ADC1_CH(4) -#define ADC_RSSI_IN_CHANNEL /* PC5 */ ADC1_CH(8) - -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY_CURRENT_CHANNEL) | \ - (1 << ADC_BATTERY2_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY2_CURRENT_CHANNEL) | \ - (1 << ADC_AIRSPEED_IN_CHANNEL) | \ - (1 << ADC_RSSI_IN_CHANNEL)) - - -/* Define Battery 1 Voltage Divider and A per V - */ - -#define BOARD_BATTERY1_V_DIV (11.0f) /* measured with the provided PM board */ -#define BOARD_BATTERY1_A_PER_V (40.0f) -#define BOARD_BATTERY2_V_DIV (11.0f) /* measured with the provided PM board */ - - -/* CAN Silence - * - * Silent mode control \ ESC Mux select - */ - -#define GPIO_CAN1_SILENT_S0 /* PD3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN3) - - -/* PWM - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 12 -#define DIRECT_INPUT_TIMER_CHANNELS 12 - -#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS - - -/* Spare GPIO */ - -// #define GPIO_PG6 /* PG6 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN6) -// #define GPIO_PD15 /* PD15 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTD|GPIO_PIN15) -// #define GPIO_PG15 /* PG15 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN15) - - -/* Tone alarm output */ - -#define GPIO_TONE_ALARM_IDLE /* PA15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) -#define GPIO_TONE_ALARM_GPIO /* PA15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) - -// #define TONE_ALARM_TIMER 2 /* Timer 2 */ -// #define TONE_ALARM_CHANNEL 1 /* PA15 GPIO_TIM2_CH1OUT_2 */ -// #define GPIO_TONE_ALARM_IDLE /* PA15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) -// #define GPIO_TONE_ALARM GPIO_TIM2_CH1OUT_2 - - -/* USB OTG FS - * - * PE2 OTG_FS_VBUS VBUS sensing - */ - -#define GPIO_OTGFS_VBUS /* PE2 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTE|GPIO_PIN2) - - -/* High-resolution timer */ -#define HRT_TIMER 2 /* use timer8 for the HRT */ -#define HRT_TIMER_CHANNEL 1 /* use capture/compare channel 3 */ - - -/* RC Serial port */ -#define RC_SERIAL_PORT "/dev/ttyS4" -#define BOARD_SUPPORTS_RC_SERIAL_PORT_OUTPUT - -// #define GPIO_RSSI_IN /* PC5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN5) - - -/* SD Card */ -#define SDIO_SLOTNO 0 /* Only one slot */ -#define SDIO_MINOR 0 - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ -#define BOARD_HAS_ON_RESET 1 - - -#define PX4_GPIO_INIT_LIST { \ - PX4_ADC_GPIO, \ - GPIO_CAN1_TX, \ - GPIO_CAN1_RX, \ - GPIO_CAN1_SILENT_S0, \ - GPIO_nLED_BLUE, \ - GPIO_nLED_GREEN, \ - GPIO_TONE_ALARM_IDLE, \ - } - -#define BOARD_ENABLE_CONSOLE_BUFFER - -#define BOARD_NUM_IO_TIMERS 4 - - -__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 board. - * - ****************************************************************************************************/ - -extern void stm32_spiinitialize(void); - -extern void stm32_usbinitialize(void); - -extern void board_peripheral_reset(int ms); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/matek/h743/src/bootloader_main.c b/boards/matek/h743/src/bootloader_main.c deleted file mode 100644 index 5670308..0000000 --- a/boards/matek/h743/src/bootloader_main.c +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file bootloader_main.c - * - * FMU-specific early startup code for bootloader -*/ - -#include "board_config.h" -#include "bl.h" - -#include -#include -#include -#include -#include -#include "arm_internal.h" -#include - -extern int sercon_main(int c, char **argv); - -__EXPORT void board_on_reset(int status) {} - -__EXPORT void stm32_boardinitialize(void) -{ - /* configure USB interfaces */ - stm32_usbinitialize(); -} - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - return 0; -} - -void board_late_initialize(void) -{ - sercon_main(0, NULL); -} - -extern void sys_tick_handler(void); -void board_timerhook(void) -{ - sys_tick_handler(); -} diff --git a/boards/matek/h743/src/hw_config.h b/boards/matek/h743/src/hw_config.h deleted file mode 100644 index f289dc9..0000000 --- a/boards/matek/h743/src/hw_config.h +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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. - * - ****************************************************************************/ - -#pragma once - -/**************************************************************************** - * 10-8--2016: - * To simplify the ripple effect on the tools, we will be using - * /dev/serial/by-id/PX4 to locate PX4 devices. Therefore - * moving forward all Bootloaders must contain the prefix "PX4 BL " - * in the USBDEVICESTRING - * This Change will be made in an upcoming BL release - ****************************************************************************/ -/* - * Define usage to configure a bootloader - * - * - * Constant example Usage - * APP_LOAD_ADDRESS 0x08004000 - The address in Linker Script, where the app fw is org-ed - * BOOTLOADER_DELAY 5000 - Ms to wait while under USB pwr or bootloader request - * BOARD_FMUV2 - * INTERFACE_USB 1 - (Optional) Scan and use the USB interface for bootloading - * INTERFACE_USART 1 - (Optional) Scan and use the Serial interface for bootloading - * USBDEVICESTRING "PX4 BL FMU v2.x" - USB id string - * USBPRODUCTID 0x0011 - PID Should match defconfig - * BOOT_DELAY_ADDRESS 0x000001a0 - (Optional) From the linker script from Linker Script to get a custom - * delay provided by an APP FW - * BOARD_TYPE 9 - Must match .prototype boad_id - * _FLASH_KBYTES (*(uint16_t *)0x1fff7a22) - Run time flash size detection - * BOARD_FLASH_SECTORS ((_FLASH_KBYTES == 0x400) ? 11 : 23) - Run time determine the physical last sector - * BOARD_FLASH_SECTORS 11 - Hard coded zero based last sector - * BOARD_FLASH_SIZE (_FLASH_KBYTES*1024)- Total Flash size of device, determined at run time. - * (1024 * 1024) - Hard coded Total Flash of device - The bootloader and app reserved will be deducted - * programmatically - * - * BOARD_FIRST_FLASH_SECTOR_TO_ERASE 2 - Optional sectors index in the flash_sectors table (F4 only), to begin erasing. - * This is to allow sectors to be reserved for app fw usage. That will NOT be erased - * during a FW upgrade. - * The default is 0, and selects the first sector to be erased, as the 0th entry in the - * flash_sectors table. Which is the second physical sector of FLASH in the device. - * The first physical sector of FLASH is used by the bootloader, and is not defined - * in the table. - * - * APP_RESERVATION_SIZE (BOARD_FIRST_FLASH_SECTOR_TO_ERASE * 16 * 1024) - Number of bytes reserved by the APP FW. This number plus - * BOOTLOADER_RESERVATION_SIZE will be deducted from - * BOARD_FLASH_SIZE to determine the size of the App FW - * and hence the address space of FLASH to erase and program. - * USBMFGSTRING "PX4 AP" - Optional USB MFG string (default is '3D Robotics' if not defined.) - * SERIAL_BREAK_DETECT_DISABLED - Optional prevent break selection on Serial port from entering or staying in BL - * - * * Other defines are somewhat self explanatory. - */ - -/* Boot device selection list*/ -#define USB0_DEV 0x01 -#define SERIAL0_DEV 0x02 -#define SERIAL1_DEV 0x04 - -#define APP_LOAD_ADDRESS 0x08020000 -#define BOOTLOADER_DELAY 5000 -#define INTERFACE_USB 1 -#define INTERFACE_USB_CONFIG "/dev/ttyACM0" -#define BOARD_VBUS MK_GPIO_INPUT(GPIO_OTGFS_VBUS) - -//#define USE_VBUS_PULL_DOWN -#define INTERFACE_USART 1 -#define INTERFACE_USART_CONFIG "/dev/ttyS0,57600" -#define BOOT_DELAY_ADDRESS 0x000001a0 -#define BOARD_TYPE 139 -#define _FLASH_KBYTES (*(uint32_t *)0x1FF1E880) -#define BOARD_FLASH_SECTORS (15) -#define BOARD_FLASH_SIZE (_FLASH_KBYTES * 1024) - -#define OSC_FREQ 8 - -#define BOARD_PIN_LED_ACTIVITY GPIO_nLED_BLUE // BLUE -#define BOARD_PIN_LED_BOOTLOADER GPIO_nLED_GREEN // GREEN -#define BOARD_LED_ON 0 -#define BOARD_LED_OFF 1 - -#define SERIAL_BREAK_DETECT_DISABLED 1 - -#if !defined(ARCH_SN_MAX_LENGTH) -# define ARCH_SN_MAX_LENGTH 12 -#endif - -#if !defined(APP_RESERVATION_SIZE) -# define APP_RESERVATION_SIZE 0 -#endif - -#if !defined(BOARD_FIRST_FLASH_SECTOR_TO_ERASE) -# define BOARD_FIRST_FLASH_SECTOR_TO_ERASE 1 -#endif - -#if !defined(USB_DATA_ALIGN) -# define USB_DATA_ALIGN -#endif - -#ifndef BOOT_DEVICES_SELECTION -# define BOOT_DEVICES_SELECTION USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif - -#ifndef BOOT_DEVICES_FILTER_ONUSB -# define BOOT_DEVICES_FILTER_ONUSB USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif diff --git a/boards/matek/h743/src/i2c.cpp b/boards/matek/h743/src/i2c.cpp deleted file mode 100644 index 1444ea1..0000000 --- a/boards/matek/h743/src/i2c.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), - initI2CBusInternal(2), -}; diff --git a/boards/matek/h743/src/init.c b/boards/matek/h743/src/init.c deleted file mode 100644 index a2a5318..0000000 --- a/boards/matek/h743/src/init.c +++ /dev/null @@ -1,181 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * FMU-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. - */ - -#include "board_config.h" - -#include - -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include - -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - UNUSED(ms); -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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 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 - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Need hrt running before using the ADC */ - px4_platform_init(); - - /* configure the DMA allocator */ - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_BLUE); - } - -#ifdef CONFIG_MMCSD - int ret = stm32_sdio_initialize(); - - if (ret != OK) { - led_on(LED_BLUE); - } - -#endif - - /* Configure the HW based on the manifest */ - px4_platform_configure(); - - return OK; -} diff --git a/boards/matek/h743/src/led.c b/boards/matek/h743/src/led.c deleted file mode 100644 index 2d60d89..0000000 --- a/boards/matek/h743/src/led.c +++ /dev/null @@ -1,112 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -# define xlat(p) (p) -static uint32_t g_ledmap[] = { - GPIO_nLED_BLUE, // Indexed by LED_BLUE (defaulted to an output) - GPIO_nLED_GREEN -}; - -__EXPORT void led_init(void) -{ - /* Configure LED GPIOs for output */ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - if (g_ledmap[l] != 0) { - stm32_configgpio(g_ledmap[l]); - } - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - if (g_ledmap[led] != 0) { - stm32_gpiowrite(g_ledmap[led], !state); - } -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - if (g_ledmap[led] != 0) { - return !stm32_gpioread(g_ledmap[led]); - } - - return false; -} - -__EXPORT void led_on(int led) -{ - phy_set_led(xlat(led), true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(xlat(led), false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(xlat(led), !phy_get_led(xlat(led))); -} diff --git a/boards/matek/h743/src/sdio.c b/boards/matek/h743/src/sdio.c deleted file mode 100644 index 869d757..0000000 --- a/boards/matek/h743/src/sdio.c +++ /dev/null @@ -1,177 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include "chip.h" -#include "board_config.h" -#include "stm32_gpio.h" -#include "stm32_sdmmc.h" - -#ifdef CONFIG_MMCSD - - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Card detections requires card support and a card detection GPIO */ - -#define HAVE_NCD 1 -#if !defined(GPIO_SDMMC1_NCD) -# undef HAVE_NCD -#endif - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -static FAR struct sdio_dev_s *sdio_dev; -#ifdef HAVE_NCD -static bool g_sd_inserted = 0xff; /* Impossible value */ -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_ncd_interrupt - * - * Description: - * Card detect interrupt handler. - * - ****************************************************************************/ - -#ifdef HAVE_NCD -static int stm32_ncd_interrupt(int irq, FAR void *context) -{ - bool present; - - present = !stm32_gpioread(GPIO_SDMMC1_NCD); - - if (sdio_dev && present != g_sd_inserted) { - sdio_mediachange(sdio_dev, present); - g_sd_inserted = present; - } - - return OK; -} -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_sdio_initialize - * - * Description: - * Initialize SDIO-based MMC/SD card support - * - ****************************************************************************/ - -int stm32_sdio_initialize(void) -{ - int ret; - -#ifdef HAVE_NCD - /* Card detect */ - - bool cd_status; - - /* Configure the card detect GPIO */ - - stm32_configgpio(GPIO_SDMMC1_NCD); - - /* Register an interrupt handler for the card detect pin */ - - stm32_gpiosetevent(GPIO_SDMMC1_NCD, true, true, true, stm32_ncd_interrupt); -#endif - - /* Mount the SDIO-based MMC/SD block driver */ - /* First, get an instance of the SDIO interface */ - - finfo("Initializing SDIO slot %d\n", SDIO_SLOTNO); - - sdio_dev = sdio_initialize(SDIO_SLOTNO); - - if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", SDIO_SLOTNO); - return -ENODEV; - } - - /* Now bind the SDIO interface to the MMC/SD driver */ - - finfo("Bind SDIO to the MMC/SD driver, minor=%d\n", SDIO_MINOR); - - ret = mmcsd_slotinitialize(SDIO_MINOR, sdio_dev); - - if (ret != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); - return ret; - } - - finfo("Successfully bound SDIO to the MMC/SD driver\n"); - -#ifdef HAVE_NCD - /* Use SD card detect pin to check if a card is g_sd_inserted */ - - cd_status = !stm32_gpioread(GPIO_SDMMC1_NCD); - finfo("Card detect : %d\n", cd_status); - - sdio_mediachange(sdio_dev, cd_status); -#else - /* Assume that the SD card is inserted. What choice do we have? */ - - sdio_mediachange(sdio_dev, true); -#endif - - return OK; -} - -#endif /* CONFIG_MMCSD */ diff --git a/boards/matek/h743/src/spi.cpp b/boards/matek/h743/src/spi.cpp deleted file mode 100644 index a83701f..0000000 --- a/boards/matek/h743/src/spi.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 -#include -#include - - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_MPU6000, SPI::CS{GPIO::PortC, GPIO::Pin15}, SPI::DRDY{GPIO::PortB, GPIO::Pin2}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortC, GPIO::Pin15}, SPI::DRDY{GPIO::PortB, GPIO::Pin2}), - }), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_OSD_DEVTYPE_ATXXXX, SPI::CS{GPIO::PortB, GPIO::Pin12}), - }), - initSPIBusExternal(SPI::Bus::SPI3, { - initSPIConfigExternal(SPI::CS{GPIO::PortD, GPIO::Pin4}), - initSPIConfigExternal(SPI::CS{GPIO::PortE, GPIO::Pin2}), - }), - initSPIBus(SPI::Bus::SPI4, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42605, SPI::CS{GPIO::PortC, GPIO::Pin13}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortE, GPIO::Pin11}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/matek/h743/src/timer_config.cpp b/boards/matek/h743/src/timer_config.cpp deleted file mode 100644 index e862bf2..0000000 --- a/boards/matek/h743/src/timer_config.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer3, DMA{DMA::Index1, DMA::Stream2, DMA::Channel5}), - initIOTimer(Timer::Timer5, DMA{DMA::Index1, DMA::Stream0, DMA::Channel6}), - initIOTimer(Timer::Timer4, DMA{DMA::Index1, DMA::Stream6, DMA::Channel2}), - initIOTimer(Timer::Timer15), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel3}, {GPIO::PortB, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel4}, {GPIO::PortB, GPIO::Pin1}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel1}, {GPIO::PortA, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel2}, {GPIO::PortA, GPIO::Pin1}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel3}, {GPIO::PortA, GPIO::Pin2}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel4}, {GPIO::PortA, GPIO::Pin3}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel1}, {GPIO::PortD, GPIO::Pin12}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel4}, {GPIO::PortD, GPIO::Pin15}), - initIOTimerChannel(io_timers, {Timer::Timer15, Timer::Channel1}, {GPIO::PortE, GPIO::Pin5}), - initIOTimerChannel(io_timers, {Timer::Timer15, Timer::Channel2}, {GPIO::PortE, GPIO::Pin6}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); - - - -constexpr io_timers_t led_pwm_timers[MAX_LED_TIMERS] = { - initIOTimer(Timer::Timer1), -}; - -// #define CCER_C1_NUM_BITS 4 -// #define POLARITY(c) (GTIM_CCER_CC1P << (((c)-1) * CCER_C1_NUM_BITS)) -// #define DRIVE_TYPE(p) ((p)|GPIO_OPENDRAIN|GPIO_PULLUP) - -// static inline constexpr timer_io_channels_t initIOTimerChannelLED(const io_timers_t io_timers_conf[MAX_LED_TIMERS], -// Timer::TimerChannel timer, GPIO::GPIOPin pin, int ui_polarity) -// { -// timer_io_channels_t ret = initIOTimerChannel(io_timers_conf, timer, pin); -// ret.gpio_out = DRIVE_TYPE(ret.gpio_out); -// ret.masks = POLARITY(ui_polarity); -// return ret; -// } - -// constexpr timer_io_channels_t led_pwm_channels[MAX_TIMER_LED_CHANNELS] = { -// initIOTimerChannelLED(led_pwm_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortA, GPIO::Pin8}, 1), -// }; diff --git a/boards/matek/h743/src/usb.c b/boards/matek/h743/src/usb.c deleted file mode 100644 index 4fdfafd..0000000 --- a/boards/matek/h743/src/usb.c +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -#include "board_config.h" -#include -#include -#include -#include - -/************************************************************************************ - * 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 - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/modalai/fc-v1/default.px4board b/boards/modalai/fc-v1/default.px4board deleted file mode 100644 index 5999659..0000000 --- a/boards/modalai/fc-v1/default.px4board +++ /dev/null @@ -1,105 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS0" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS6" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS4" -CONFIG_BOARD_SERIAL_TEL3="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL4="/dev/ttyS3" -CONFIG_DRIVERS_ACTUATORS_MODAL_IO=y -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_COMMON_BAROMETERS=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_BOSCH_BMI088=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_COMMON_OSD=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_POWER_MONITOR_VOXLPM=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SAFETY_BUTTON=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_BOARD_UAVCAN_INTERFACES=1 -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UUV_ATT_CONTROL=y -CONFIG_MODULES_UUV_POS_CONTROL=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BL_UPDATE=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SERIAL_TEST=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_FAKE_GPS=y diff --git a/boards/modalai/fc-v1/extras/modalai_fc-v1_bootloader.bin b/boards/modalai/fc-v1/extras/modalai_fc-v1_bootloader.bin deleted file mode 100644 index ab1887a..0000000 Binary files a/boards/modalai/fc-v1/extras/modalai_fc-v1_bootloader.bin and /dev/null differ diff --git a/boards/modalai/fc-v1/firmware.prototype b/boards/modalai/fc-v1/firmware.prototype deleted file mode 100644 index 26a37e9..0000000 --- a/boards/modalai/fc-v1/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 41775, - "magic": "PX4FWv1", - "description": "Firmware for the ModalAI Flight Core v1 board", - "image": "", - "build_time": 0, - "summary": "modalaifcv1", - "version": "0.1", - "image_size": 0, - "image_maxsize": 2064384, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/modalai/fc-v1/init/rc.board_defaults b/boards/modalai/fc-v1/init/rc.board_defaults deleted file mode 100644 index 49b6ced..0000000 --- a/boards/modalai/fc-v1/init/rc.board_defaults +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -# -# Summary: -# Flight Core can be used on many airframes, but is meant to be paired with -# VOXL (either through a cable or in the combo board flavor). For this reason -# this script has a bit more Logic (aka Bobby Tarantino) than normal. -# -# Flight Core Version Information: -# V106 - Flight Core Stand Alone configuration -# V110 - Flight Core VOXL-Flight configuration -# - -# -# Common settings across Flight Core configurations -# - - -# TELEM2 is used to connect to VOXL via the MAV_1 mavlink channel -# MAV_0 & TELEM1 are left alone for use with SIK radio links -param set-default MAV_1_CONFIG 102 -param set-default MAV_1_MODE 2 -param set-default SER_TEL2_BAUD 921600 - -safety_button start diff --git a/boards/modalai/fc-v1/init/rc.board_sensors b/boards/modalai/fc-v1/init/rc.board_sensors deleted file mode 100644 index 7268fce..0000000 --- a/boards/modalai/fc-v1/init/rc.board_sensors +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# ModalAI FC-v1 specific board sensors init -#------------------------------------------------------------------------------ - -if param greater MODAL_IO_CONFIG 0 -then - modal_io start -fi - -board_adc start - -# Start Digital power monitors -voxlpm -X -b 3 -k -T VBATT start -voxlpm -X -b 3 -T P5VDC start - -# Internal SPI bus ICM-20602 -icm20602 -R 12 -s start - -# Internal SPI bus ICM-42688 -icm42688p -R 12 -s start - -# Internal SPI4 BMI088 -bmi088 -A -R 12 -s start -bmi088 -G -R 12 -s start - -# Internal I2C Baro -bmp388 -I start diff --git a/boards/modalai/fc-v1/nuttx-config/Kconfig b/boards/modalai/fc-v1/nuttx-config/Kconfig deleted file mode 100644 index 520c5ab..0000000 --- a/boards/modalai/fc-v1/nuttx-config/Kconfig +++ /dev/null @@ -1,17 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see misc/tools/kconfig-language.txt. -# -config BOARD_HAS_PROBES - bool "Board provides GPIO or other Hardware for signaling to timing analyze." - default y - ---help--- - This board provides GPIO FMU-CH1-8, CAP1 as PROBE_1-9 to provide timing signals from selected drivers. - -config BOARD_USE_PROBES - bool "Enable the use the board provided FMU-CH1-8, CAP1 as PROBE_1-9" - default n - depends on BOARD_HAS_PROBES - - ---help--- - Select to use GPIO FMU-CH1-8, CAP1 to provide timing signals from selected drivers. diff --git a/boards/modalai/fc-v1/nuttx-config/include/board.h b/boards/modalai/fc-v1/nuttx-config/include/board.h deleted file mode 100644 index 58d8fe2..0000000 --- a/boards/modalai/fc-v1/nuttx-config/include/board.h +++ /dev/null @@ -1,482 +0,0 @@ -/************************************************************************************ - * nuttx-configs/modalai_fcv1/include/board.h - * - * Copyright (C) 2016-2019 Gregory Nutt. All rights reserved. - * Authors: David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ -#ifndef __NUTTX_CONFIG_MODALAI_FCV1_INCLUDE_BOARD_H -#define __NUTTX_CONFIG_MODALAI_FCV1_INCLUDE_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The modalai_fcv1 board provides the following clock sources: - * - * X301: 16 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 16 MHz RC factory-trimmed - * HSE: 16 MHz crystal for HSE - */ - -#define STM32_BOARD_XTAL 16000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 0 - -/* Main PLL Configuration. - * - * PLL source is HSE = 16,000,000 - * - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 2 <= PLLM <= 63 - * 192 <= PLLN <= 432 - * 192 MHz <= PLL_VCO <= 432MHz - * - * SYSCLK = PLL_VCO / PLLP - * Subject to - * - * PLLP = {2, 4, 6, 8} - * SYSCLK <= 216 MHz - * - * USB OTG FS, SDMMC and RNG Clock = PLL_VCO / PLLQ - * Subject to - * The USB OTG FS requires a 48 MHz clock to work correctly. The SDMMC - * and the random number generator need a frequency lower than or equal - * to 48 MHz to work correctly. - * - * 2 <= PLLQ <= 15 - */ - -/* Highest SYSCLK with USB OTG FS clock = 48 MHz - * - * PLL_VCO = (16,000,000 / 8) * 216 = 432 MHz - * SYSCLK = 432 MHz / 2 = 216 MHz - * USB OTG FS, SDMMC and RNG Clock = 432 MHz / 9 = 48 MHz - */ - -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(8) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(216) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(9) - -#define STM32_VCO_FREQUENCY ((STM32_HSE_FREQUENCY / 8) * 216) -#define STM32_SYSCLK_FREQUENCY (STM32_VCO_FREQUENCY / 2) -#define STM32_OTGFS_FREQUENCY (STM32_VCO_FREQUENCY / 9) - -/* Configure factors for PLLSAI clock */ - -#define CONFIG_STM32F7_PLLSAI 1 -#define STM32_RCC_PLLSAICFGR_PLLSAIN RCC_PLLSAICFGR_PLLSAIN(192) -#define STM32_RCC_PLLSAICFGR_PLLSAIP RCC_PLLSAICFGR_PLLSAIP(8) -#define STM32_RCC_PLLSAICFGR_PLLSAIQ RCC_PLLSAICFGR_PLLSAIQ(4) -#define STM32_RCC_PLLSAICFGR_PLLSAIR RCC_PLLSAICFGR_PLLSAIR(2) - -/* Configure Dedicated Clock Configuration Register */ - -#define STM32_RCC_DCKCFGR1_PLLI2SDIVQ RCC_DCKCFGR1_PLLI2SDIVQ(1) -#define STM32_RCC_DCKCFGR1_PLLSAIDIVQ RCC_DCKCFGR1_PLLSAIDIVQ(1) -#define STM32_RCC_DCKCFGR1_PLLSAIDIVR RCC_DCKCFGR1_PLLSAIDIVR(0) -#define STM32_RCC_DCKCFGR1_SAI1SRC RCC_DCKCFGR1_SAI1SEL(0) -#define STM32_RCC_DCKCFGR1_SAI2SRC RCC_DCKCFGR1_SAI2SEL(0) -#define STM32_RCC_DCKCFGR1_TIMPRESRC 0 -#define STM32_RCC_DCKCFGR1_DFSDM1SRC 0 -#define STM32_RCC_DCKCFGR1_ADFSDM1SRC 0 - - - -/* Configure factors for PLLI2S clock */ - -#define CONFIG_STM32F7_PLLI2S 1 -#define STM32_RCC_PLLI2SCFGR_PLLI2SN RCC_PLLI2SCFGR_PLLI2SN(192) -#define STM32_RCC_PLLI2SCFGR_PLLI2SP RCC_PLLI2SCFGR_PLLI2SP(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SQ RCC_PLLI2SCFGR_PLLI2SQ(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SR RCC_PLLI2SCFGR_PLLI2SR(2) - -/* Configure Dedicated Clock Configuration Register 2 */ - -#define STM32_RCC_DCKCFGR2_USART1SRC RCC_DCKCFGR2_USART1SEL_APB -#define STM32_RCC_DCKCFGR2_USART2SRC RCC_DCKCFGR2_USART2SEL_APB -#define STM32_RCC_DCKCFGR2_UART4SRC RCC_DCKCFGR2_UART4SEL_APB -#define STM32_RCC_DCKCFGR2_UART5SRC RCC_DCKCFGR2_UART5SEL_APB -#define STM32_RCC_DCKCFGR2_USART6SRC RCC_DCKCFGR2_USART6SEL_APB -#define STM32_RCC_DCKCFGR2_UART7SRC RCC_DCKCFGR2_UART7SEL_APB -#define STM32_RCC_DCKCFGR2_UART8SRC RCC_DCKCFGR2_UART8SEL_APB -#define STM32_RCC_DCKCFGR2_I2C1SRC RCC_DCKCFGR2_I2C1SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C2SRC RCC_DCKCFGR2_I2C2SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C3SRC RCC_DCKCFGR2_I2C3SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C4SRC RCC_DCKCFGR2_I2C4SEL_HSI -#define STM32_RCC_DCKCFGR2_LPTIM1SRC RCC_DCKCFGR2_LPTIM1SEL_APB -#define STM32_RCC_DCKCFGR2_CECSRC RCC_DCKCFGR2_CECSEL_HSI -#define STM32_RCC_DCKCFGR2_CK48MSRC RCC_DCKCFGR2_CK48MSEL_PLL -#define STM32_RCC_DCKCFGR2_SDMMCSRC RCC_DCKCFGR2_SDMMCSEL_48MHZ -#define STM32_RCC_DCKCFGR2_SDMMC2SRC RCC_DCKCFGR2_SDMMC2SEL_48MHZ -#define STM32_RCC_DCKCFGR2_DSISRC RCC_DCKCFGR2_DSISEL_PHY - - -/* Several prescalers allow the configuration of the two AHB buses, the - * high-speed APB (APB2) and the low-speed APB (APB1) domains. The maximum - * frequency of the two AHB buses is 216 MHz while the maximum frequency of - * the high-speed APB domains is 108 MHz. The maximum allowed frequency of - * the low-speed APB domain is 54 MHz. - */ - -/* AHB clock (HCLK) is SYSCLK (216 MHz) */ - -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (54 MHz) */ - -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (108MHz) */ - -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* SDMMC dividers. Note that slower clocking is required when DMA is disabled - * in order to avoid RX overrun/TX underrun errors due to delayed responses - * to service FIFOs in interrupt driven mode. These values have not been - * tuned!!! - * - * SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(118+2)=400 KHz - */ - -/* Use the Falling edge of the SDIO_CLK clock to change the edge the - * data and commands are change on - */ - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - -#define STM32_SDMMC_INIT_CLKDIV (118 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* DMA ON: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(1+2)=16 MHz - * DMA OFF: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32F7_SDMMC_DMA -# define STM32_SDMMC_MMCXFR_CLKDIV (1 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (2 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -/* DMA ON: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(1+2)=16 MHz - * DMA OFF: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(2+2)=12 MHz - */ -//TODO #warning "Check Freq for 24mHz" - -#ifdef CONFIG_STM32F7_SDMMC_DMA -# define STM32_SDMMC_SDXFR_CLKDIV (1 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (2 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -/* FLASH wait states - * - * --------- ---------- ----------- - * VDD MAX SYSCLK WAIT STATES - * --------- ---------- ----------- - * 1.7-2.1 V 180 MHz 8 - * 2.1-2.4 V 216 MHz 9 - * 2.4-2.7 V 216 MHz 8 - * 2.7-3.6 V 216 MHz 7 - * --------- ---------- ----------- - */ - -#define BOARD_FLASH_WAITSTATES 7 - -/* LED definitions ******************************************************************/ -/* The modalai_fcv1 board has numerous LEDs but only three, LED_GREEN a Green LED, LED_BLUE - * a Blue LED and LED_RED a Red LED, that can be controlled by software. - * - * If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any way. - * The following definitions are used to access individual LEDs. - */ - -/* LED index values for use with board_userled() */ - -#define BOARD_LED1 0 -#define BOARD_LED2 1 -#define BOARD_LED3 2 -#define BOARD_NLEDS 3 - -#define BOARD_LED_RED BOARD_LED1 -#define BOARD_LED_GREEN BOARD_LED2 -#define BOARD_LED_BLUE BOARD_LED3 - -/* LED bits for use with board_userled_all() */ - -#define BOARD_LED1_BIT (1 << BOARD_LED1) -#define BOARD_LED2_BIT (1 << BOARD_LED2) -#define BOARD_LED3_BIT (1 << BOARD_LED3) - -/* If CONFIG_ARCH_LEDS is defined, the usage by the board port is defined in - * include/board.h and src/stm32_leds.c. The LEDs are used to encode OS-related - * events as follows: - * - * - * SYMBOL Meaning LED state - * Red Green Blue - * ---------------------- -------------------------- ------ ------ ----*/ - -#define LED_STARTED 0 /* NuttX has been started OFF OFF OFF */ -#define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF OFF ON */ -#define LED_IRQSENABLED 2 /* Interrupts enabled OFF ON OFF */ -#define LED_STACKCREATED 3 /* Idle stack created OFF ON ON */ -#define LED_INIRQ 4 /* In an interrupt N/C N/C GLOW */ -#define LED_SIGNAL 5 /* In a signal handler N/C GLOW N/C */ -#define LED_ASSERTION 6 /* An assertion failed GLOW N/C GLOW */ -#define LED_PANIC 7 /* The system has crashed Blink OFF N/C */ -#define LED_IDLE 8 /* MCU is is sleep mode ON OFF OFF */ - -/* Thus if the Green LED is statically on, NuttX has successfully booted and - * is, apparently, running normally. If the Red LED is flashing at - * approximately 2Hz, then a fatal error has been detected and the system - * has halted. - */ - -/* Alternate function pin selections ************************************************/ - -#define GPIO_USART1_RX GPIO_USART1_RX_3 /* PB15 */ -#define GPIO_USART1_TX GPIO_USART1_TX_3 /* PB14 */ - -#define GPIO_USART2_RX GPIO_USART2_RX_1 /* PA3 */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 /* PD4 */ -#define GPIO_USART2_CTS GPIO_USART2_CTS_2 /* PD3 */ - -#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ -#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ - -#define GPIO_UART4_RX GPIO_UART4_RX_5 /* PH14 */ -#define GPIO_UART4_TX GPIO_UART4_TX_5 /* PH13 */ - -#define GPIO_UART5_RX GPIO_UART5_RX_1 /* PD2 */ -#define GPIO_UART5_TX GPIO_UART5_TX_4 /* PB9 */ -#define GPIO_UART5_RTS GPIO_UART5_RTS_1 /* PC8 */ -#define GPIO_UART5_CTS GPIO_UART5_CTS_1 /* PC9 */ - -#define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC 7 */ -#define GPIO_USART6_TX GPIO_USART6_TX_1 /* PC6 */ - -#define GPIO_UART7_RX GPIO_UART7_RX_1 /* PE7 */ -#define GPIO_UART7_TX GPIO_UART7_TX_1 /* PE8 */ -#define GPIO_UART7_RTS GPIO_UART7_RTS_1 /* PE9 */ -#define GPIO_UART7_CTS GPIO_UART7_CTS_1 /* PE10 */ - -/* UART8: has no remap - * - * GPIO_UART8_RX PE0 - * GPIO_UART8_TX PE1 - */ - -/* CAN - * - * CAN1 is routed to transceiver. - * CAN2 is routed to transceiver. - */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 /* PD0 */ -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 /* PD1 */ -#define GPIO_CAN2_RX GPIO_CAN2_RX_1 /* PB12 */ -#define GPIO_CAN2_TX GPIO_CAN2_TX_2 /* PB6 */ - -/* SPI - * SPI1 is IMU 20648 (Rev A) - * SPI2 is none (Rev A) - * SPI3 is none (Rev A) - * SPI4 is none (Rev A) - * SPI5 is FRAM - * SPI6 is none (Rev A) - * - */ - -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_2 /* PB4 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_2 /* PB5 */ -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 /* PA5 */ - -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_3 /* PI2 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_3 /* PI3 */ -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_5 /* PI1 */ - -#define GPIO_SPI3_MISO GPIO_SPI3_MISO_2 /* PC11 */ -#define GPIO_SPI3_MOSI GPIO_SPI3_MOSI_1 /* PB2 */ -#define GPIO_SPI3_SCK GPIO_SPI3_SCK_2 /* PC10 */ - -#define GPIO_SPI4_MISO GPIO_SPI4_MISO_2 /* PE13 */ -#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_1 /* PE6 */ -#define GPIO_SPI4_SCK GPIO_SPI4_SCK_2 /* PE12 */ - -#define GPIO_SPI5_MISO GPIO_SPI5_MISO_1 /* PF8 */ -#define GPIO_SPI5_MOSI GPIO_SPI5_MOSI_2 /* PF11 */ -#define GPIO_SPI5_SCK GPIO_SPI5_SCK_1 /* PF7 */ - -#define GPIO_SPI6_MISO GPIO_SPI6_MISO_2 /* PA6 */ -#define GPIO_SPI6_MOSI GPIO_SPI6_MOSI_1 /* PG14 */ -#define GPIO_SPI6_SCK GPIO_SPI6_SCK_3 /* PB3 */ - -/* I2C - * - * The optional _GPIO configurations allow the I2C driver to manually - * reset the bus to clear stuck slaves. They match the pin configuration, - * but are normally-high GPIOs. - * - */ - -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 /* PB8 */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_1 /* PB7 */ - -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN8) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN7) - -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_2 /* PF1 */ -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_2 /* PF0 */ - -#define GPIO_I2C2_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTF | GPIO_PIN1) -#define GPIO_I2C2_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTF | GPIO_PIN0) - -#define GPIO_I2C3_SCL GPIO_I2C3_SCL_2 /* PH7 */ -#define GPIO_I2C3_SDA GPIO_I2C3_SDA_2 /* PH8 */ - -#define GPIO_I2C3_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTH | GPIO_PIN7) -#define GPIO_I2C3_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTH | GPIO_PIN8) - -#define GPIO_I2C4_SCL GPIO_I2C4_SCL_2 /* PF14 */ -#define GPIO_I2C4_SDA GPIO_I2C4_SDA_2 /* PF15 */ - -#define GPIO_I2C4_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTF | GPIO_PIN14) -#define GPIO_I2C4_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTF | GPIO_PIN15) - -/* SDMMC2 - * - * VDD 3.3 - * GND - * SDMMC2_CK PD6 - * SDMMC2_CMD PD7 - * SDMMC2_D0 PG9 - * SDMMC2_D1 PG10 - * SDMMC2_D2 PG11 - * SDMMC2_D3 PG12 - */ - -#define GPIO_SDMMC2_D0 GPIO_SDMMC2_D0_2 -#define GPIO_SDMMC2_D1 GPIO_SDMMC2_D1_2 -#define GPIO_SDMMC2_D2 GPIO_SDMMC2_D2_2 -#define GPIO_SDMMC2_D3 GPIO_SDMMC2_D3_2 - -/* USB - * - * OTG_FS_DM PA11 - * OTG_FS_DP PA12 - * VBUS PA9 - */ - - -/* Board provides GPIO or other Hardware for signaling to timing analyzer */ - -#if defined(CONFIG_BOARD_USE_PROBES) -# include "stm32_gpio.h" -# define PROBE_N(n) (1<<((n)-1)) -# define PROBE_1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN14) /* PE14 AUX1 */ -# define PROBE_2 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN10) /* PA10 AUX2 */ -# define PROBE_3 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN11) /* PE11 AUX3 */ -# define PROBE_4 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN8) /* PA8 AUX4 */ -# define PROBE_5 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN13) /* PD13 AUX5 */ -# define PROBE_6 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN14) /* PD14 AUX6 */ -# define PROBE_7 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN6) /* PH6 AUX7 */ -# define PROBE_8 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN9) /* PH9 AUX8 */ -# define PROBE_9 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTI|GPIO_PIN0) /* PI0 CAP1 */ - -# define PROBE_INIT(mask) \ - do { \ - if ((mask)& PROBE_N(1)) { stm32_configgpio(PROBE_1); } \ - if ((mask)& PROBE_N(2)) { stm32_configgpio(PROBE_2); } \ - if ((mask)& PROBE_N(3)) { stm32_configgpio(PROBE_3); } \ - if ((mask)& PROBE_N(4)) { stm32_configgpio(PROBE_4); } \ - if ((mask)& PROBE_N(5)) { stm32_configgpio(PROBE_5); } \ - if ((mask)& PROBE_N(6)) { stm32_configgpio(PROBE_6); } \ - if ((mask)& PROBE_N(7)) { stm32_configgpio(PROBE_7); } \ - if ((mask)& PROBE_N(8)) { stm32_configgpio(PROBE_8); } \ - if ((mask)& PROBE_N(9)) { stm32_configgpio(PROBE_9); } \ - } while(0) - -# define PROBE(n,s) do {stm32_gpiowrite(PROBE_##n,(s));}while(0) -# define PROBE_MARK(n) PROBE(n,false);PROBE(n,true) -#else -# define PROBE_INIT(mask) -# define PROBE(n,s) -# define PROBE_MARK(n) -#endif - -#endif /*__NUTTX_CONFIG_MODALAI_FCV1_INCLUDE_BOARD_H */ diff --git a/boards/modalai/fc-v1/nuttx-config/include/board_dma_map.h b/boards/modalai/fc-v1/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 249e6a0..0000000 --- a/boards/modalai/fc-v1/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/* -| DMA1 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | SPI3_RX_1 | SPDIFRX_DT | SPI3_RX_2 | SPI2_RX | SPI2_TX | SPI3_TX_1 | SPDIFRX_CS | SPI3_TX_2 | -| Channel 1 | I2C1_RX | I2C3_RX | TIM7_UP_1 | - | TIM7_UP_2 | I2C1_RX_1 | I2C1_TX | I2C1_TX_1 | -| Channel 2 | TIM4_CH1 | - | I2C4_RX | TIM4_CH2 | - | I2C4_RX | TIM4_UP | TIM4_CH3 | -| Channel 3 | - | TIM2_UP_1 | I2C3_RX_1 | - | I2C3_TX | TIM2_CH1 | TIM2_CH2 | TIM2_UP_2 | -| | | TIM2_CH3 | | | | | TIM2_CH4_1 | TIM2_CH4_2 | -| Channel 4 | UART5_RX | USART3_RX | UART4_RX | USART3_TX_1 | UART4_TX | USART2_RX | USART2_TX | UART5_TX | -| Channel 5 | UART8_TX | UART7_TX | TIM3_CH4 | UART7_RX | TIM3_CH1 | TIM3_CH2 | UART8_RX | TIM3_CH3 | -| | | | TIM3_UP | | TIM3_TRIG | | | | -| Channel 6 | TIM5_CH3 | TIM5_CH4_1 | TIM5_CH1 | TIM5_CH4_2 | TIM5_CH2 | - | TIM5_UP_2 | - | -| | TIM5_UP_1 | TIM5_TRIG_1 | | TIM5_TRIG_2 | | | | | -| Channel 7 | - | TIM6_UP | I2C2_RX | I2C2_RX_1 | USART3_TX_2 | DAC1 | DAC2 | I2C2_TX | -| Channel 8 | I2C3_TX | I2C4_RX | - | - | I2C2_TX | - | I2C4_TX | - | -| Channel 9 | - | SPI2_RX | - | - | - | - | SPI2_TX | - | -| | | | | | | | | | -| Usage | | SPI2_RX | SPI3_RX_2 | UART7_RX | SPI2_TX | SPI3_TX_1 | TIM4_UP | | - - -| DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | ADC1_1 | SAI1_A | TIM8_CH1_1 | SAI1_A_1 | ADC1_2 | SAI1_B_1 | TIM1_CH1_1 | SAI2_B_2 | -| | | | TIM8_CH2_1 | | | | TIM1_CH2_1 | | -| | | | TIM8_CH3_1 | | | | TIM1_CH3_1 | | -| Channel 1 | - | DCMI_1 | ADC2_1 | ADC2_2 | SAI1_B | SPI6_TX | SPI6_RX | DCMI_2 | -| Channel 2 | ADC3_1 | ADC3_2 | - | SPI5_RX_1 | SPI5_TX_1 | CRYP_OUT | CRYP_IN | HASH_IN | -| Channel 3 | SPI1_RX_1 | - | SPI1_RX_2 | SPI1_TX_1 | SAI2_A | SPI1_TX_2 | SAI2_B | QUADSPI | -| Channel 4 | SPI4_RX_1 | SPI4_TX_1 | USART1_RX_1 | SDMMC1_1 | - | USART1_RX_2 | SDMMC1_2 | USART1_TX | -| Channel 5 | - | USART6_RX_1 | USART6_RX_2 | SPI4_RX_2 | SPI4_TX_2 | - | USART6_TX_1 | USART6_TX_2 | -| Channel 6 | TIM1_TRIG_1 | TIM1_CH1_2 | TIM1_CH2_2 | TIM1_CH1 | TIM1_CH4 | TIM1_UP | TIM1_CH3_2 | - | -| | | | | | TIM1_TRIG_2 | | | | -| | | | | | TIM1_COM | | | | -| Channel 7 | - | TIM8_UP | TIM8_CH1_2 | TIM8_CH2_2 | TIM8_CH3_2 | SPI5_RX_2 | SPI5_TX_2 | TIM8_CH4 | -| | | | | | | | | TIM8_TRIG | -| | | | | | | | | TIM8_COM | -| Channel 8 | DSFDM1_FLT0 | DSFDM1_FLT1 | DSFDM1_FLT2 | DSFDM1_FLT3 | DSFDM1_FLT0 | DSFDM1_FLT1 | DSFDM1_FLT2 | DSFDM1_FLT3 | -| Channel 9 | JPEG_IN | JPEG_OUT | SPI4_TX | JPEG_IN | JPEG_OUT | SPI5_RX | - | - | -| Channel 10 | SAI1_B | SAI2_B | SAI2_A | - | - | - | SAI1_A | - | -| Channel 11 | SDMMC2 | - | QUADSPI | - | - | SDMMC2 | - | - | -| | | | | | | | | | -| Usage | SDMMC2 | USART6_RX_1 | SPI1_RX_2 | SPI1_TX_1 | | TIM1_UP | | USART6_TX_2 | - */ - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// DMAMAP_UART5_RX // DMA1, Stream 0, Channel 4 (TELEM2 RX) -#define DMAMAP_SPI2_RX DMAMAP_SPI2_RX_1 // DMA1, Stream 1, Channel 9 (SPI2 RX) -#define DMAMAP_SPI3_RX DMAMAP_SPI3_RX_2 // DMA1, Stream 2, Channel 0 (SPI3 RX) -// DMAMAP_UART7_RX // DMA1, Stream 3, Channel 5 (TELEM1 RX) -#define DMAMAP_SPI2_TX DMAMAP_SPI2_TX_2 // DMA1, Stream 4, Channel 0 (SPI2 TX) -#define DMAMAP_SPI3_TX DMAMAP_SPI3_TX_1 // DMA1, Stream 5, Channel 0 (SPI3 TX) -// DMAMAP_TIM4_UP // DMA1, Stream 6, Channel 2 (DSHOT) - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMAMAP_SDMMC2 DMAMAP_SDMMC2_1 // DMA2, Stream 0, Channel 11 -#define DMAMAP_USART6_RX DMAMAP_USART6_RX_1 // DMA2, Stream 1, Channel 5 -#define DMAMAP_SPI1_RX DMAMAP_SPI1_RX_2 // DMA2, Stream 2, Channel 3 (SPI sensors RX) -#define DMAMAP_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 3, Channel 3 (SPI sensors TX) -// AVAILABLE // DMA2, Stream 4 -// DMAMAP_TIM1_UP // DMA2, Stream 5, Channel 6 (DSHOT) -// AVAILABLE // DMA2, Stream 6 -#define DMAMAP_USART6_TX DMAMAP_USART6_TX_2 // DMA2, Stream 7, Channel 5 diff --git a/boards/modalai/fc-v1/nuttx-config/nsh/defconfig b/boards/modalai/fc-v1/nuttx-config/nsh/defconfig deleted file mode 100644 index b2d2e7e..0000000 --- a/boards/modalai/fc-v1/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,270 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/modalai/fc-v1/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32f7" -CONFIG_ARCH_CHIP_STM32F765II=y -CONFIG_ARCH_CHIP_STM32F7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0xa32f -CONFIG_CDCACM_PRODUCTSTR="PX4 FMU ModalAI FCv1" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x0483 -CONFIG_CDCACM_VENDORSTR="ModalAI" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=3 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC2_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32F7_ADC1=y -CONFIG_STM32F7_ADC3=y -CONFIG_STM32F7_BBSRAM=y -CONFIG_STM32F7_BBSRAM_FILES=5 -CONFIG_STM32F7_BKPSRAM=y -CONFIG_STM32F7_DMA1=y -CONFIG_STM32F7_DMA2=y -CONFIG_STM32F7_DMACAPABLE=y -CONFIG_STM32F7_FLOWCONTROL_BROKEN=y -CONFIG_STM32F7_I2C1=y -CONFIG_STM32F7_I2C2=y -CONFIG_STM32F7_I2C3=y -CONFIG_STM32F7_I2C4=y -CONFIG_STM32F7_I2C_DYNTIMEO=y -CONFIG_STM32F7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32F7_OTGFS=y -CONFIG_STM32F7_PROGMEM=y -CONFIG_STM32F7_PWR=y -CONFIG_STM32F7_RTC=y -CONFIG_STM32F7_RTC_HSECLOCK=y -CONFIG_STM32F7_RTC_MAGIC_REG=1 -CONFIG_STM32F7_SAVE_CRASHDUMP=y -CONFIG_STM32F7_SDMMC2=y -CONFIG_STM32F7_SDMMC_DMA=y -CONFIG_STM32F7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32F7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32F7_SPI1=y -CONFIG_STM32F7_SPI1_DMA=y -CONFIG_STM32F7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI2=y -CONFIG_STM32F7_SPI2_DMA=y -CONFIG_STM32F7_SPI2_DMA_BUFFER=2048 -CONFIG_STM32F7_SPI5=y -CONFIG_STM32F7_SPI6=y -CONFIG_STM32F7_SPI_DMATHRESHOLD=8 -CONFIG_STM32F7_TIM10=y -CONFIG_STM32F7_TIM11=y -CONFIG_STM32F7_TIM3=y -CONFIG_STM32F7_TIM9=y -CONFIG_STM32F7_UART4=y -CONFIG_STM32F7_UART5=y -CONFIG_STM32F7_UART7=y -CONFIG_STM32F7_UART8=y -CONFIG_STM32F7_USART1=y -CONFIG_STM32F7_USART2=y -CONFIG_STM32F7_USART3=y -CONFIG_STM32F7_USART6=y -CONFIG_STM32F7_USART_BREAKS=y -CONFIG_STM32F7_USART_INVERT=y -CONFIG_STM32F7_USART_SINGLEWIRE=y -CONFIG_STM32F7_USART_SWAP=y -CONFIG_STM32F7_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART5_IFLOWCONTROL=y -CONFIG_UART5_OFLOWCONTROL=y -CONFIG_UART5_RXBUFSIZE=600 -CONFIG_UART5_RXDMA=y -CONFIG_UART5_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_IFLOWCONTROL=y -CONFIG_UART7_OFLOWCONTROL=y -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_RXDMA=y -CONFIG_UART7_TXBUFSIZE=3000 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_TXBUFSIZE=3000 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_RXBUFSIZE=180 -CONFIG_USART3_SERIAL_CONSOLE=y -CONFIG_USART3_TXBUFSIZE=1500 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/modalai/fc-v1/nuttx-config/scripts/script.ld b/boards/modalai/fc-v1/nuttx-config/scripts/script.ld deleted file mode 100644 index db0f740..0000000 --- a/boards/modalai/fc-v1/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,181 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F765IIT6 has 2048 KiB of main FLASH memory. This FLASH memory - * can be accessed from either the AXIM interface at address 0x0800:0000 or - * from the ITCM interface at address 0x0020:0000. - * - * Additional information, including the option bytes, is available at at - * FLASH at address 0x1ff0:0000 (AXIM) or 0x0010:0000 (ITCM). - * - * In the STM32F765IIT6, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash on ITCM at 0x0020:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x0010:0000 - * - * NuttX does not modify these option byes. On the unmodified NUCLEO-144 - * board, the BOOT0 pin is at ground so by default, the STM32F765IIT6 will - * boot from address 0x0020:0000 in ITCM FLASH. - * - * The STM32F765IIT6 also has 512 KiB of data SRAM (in addition to ITCM SRAM). - * SRAM is split up into three blocks: - * - * 1) 128 KiB of DTCM SRM beginning at address 0x2000:0000 - * 2) 368 KiB of SRAM1 beginning at address 0x2002:0000 - * 3) 16 KiB of SRAM2 beginning at address 0x2007:c000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * Bootloader reserves the first 32K bank (2 Mbytes Flash memory single bank) - * organization (256 bits read width) - */ - -MEMORY -{ - FLASH_ITCM (rx) : ORIGIN = 0x00208000, LENGTH = 2016K - FLASH_AXIM (rx) : ORIGIN = 0x08008000, LENGTH = 2016K - - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 16K - DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - SRAM1 (rwx) : ORIGIN = 0x20020000, LENGTH = 368K - SRAM2 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH_AXIM - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH_AXIM - - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH_AXIM - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH_AXIM - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > SRAM1 AT > FLASH_AXIM - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > SRAM1 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } - - .ramfunc : { - _sramfuncs = .; - *(.ramfunc .ramfunc.*) - . = ALIGN(4); - _eramfuncs = .; - } > ITCM_RAM AT > FLASH_AXIM - - _framfuncs = LOADADDR(.ramfunc); -} diff --git a/boards/modalai/fc-v1/src/CMakeLists.txt b/boards/modalai/fc-v1/src/CMakeLists.txt deleted file mode 100644 index c8d256b..0000000 --- a/boards/modalai/fc-v1/src/CMakeLists.txt +++ /dev/null @@ -1,56 +0,0 @@ -############################################################################ -# -# Copyright (c) 2016 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. -# -############################################################################ - -add_library(drivers_board - can.c - i2c.cpp - init.c - led.c - manifest.c - sdio.c - spi.cpp - timer_config.cpp - usb.c -) -add_dependencies(drivers_board arch_board_hw_info) - -target_link_libraries(drivers_board - PRIVATE - arch_io_pins - arch_spi - arch_board_hw_info - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer -) diff --git a/boards/modalai/fc-v1/src/board_config.h b/boards/modalai/fc-v1/src/board_config.h deleted file mode 100644 index dcc1824..0000000 --- a/boards/modalai/fc-v1/src/board_config.h +++ /dev/null @@ -1,313 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * ModalAI FC-v1 internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ - -/* Configuration ************************************************************************************/ - -// NA on ModalAI FC-v1 - -/* PX4FMU GPIOs ***********************************************************************************/ - -#undef TRACE_PINS - -/* LEDs are driven with push open drain to support Anode to 5V or 3.3V or used as TRACE0-2 */ - -#if !defined(TRACE_PINS) -# define GPIO_nLED_RED /* PB0 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN0) -# define GPIO_nLED_GREEN /* PB1 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN1) -# define GPIO_nLED_BLUE /* PA7 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN7) - -# define GPIO_nLED_2_RED /* PI0 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTI|GPIO_PIN0) -# define GPIO_nLED_2_GREEN /* PH11 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTH|GPIO_PIN11) -# define GPIO_nLED_2_BLUE /* PA2 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN2) - -# define BOARD_HAS_CONTROL_STATUS_LEDS 1 -# define BOARD_OVERLOAD_LED LED_RED -# define BOARD_ARMED_STATE_LED LED_BLUE -#endif - -/* SPI */ -#define GPIO_FYSNC_INT_ICM42688 /* PA0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN0) -#define GPIO_FYSNC_INT_ICM20602 /* PH10 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN10) - -/* I2C busses */ - -/* Devices on the onboard bus. - * - * Note that these are unshifted addresses. - */ -#define PX4_I2C_OBDEV_A71CH 0x49 - -#define GPIO_I2C4_DRDY1_BMP388 /* PG5 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTG|GPIO_PIN5) -#define GPIO_A71CH_nRST /* PH3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTH|GPIO_PIN3) - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that - * can be used by the Px4 Firmware in the adc driver - */ - -/* ADC defines to be used in sensors.cpp to read from a particular channel */ - -#define ADC1_CH(n) (n) -#define ADC1_GPIO(n) GPIO_ADC1_IN##n -#define ADC3_CH(n) (n) -#define ADC3_GPIO(n) GPIO_ADC3_IN##n - -/* Define GPIO pins used as ADC N.B. Channel numbers must match below */ - -#define PX4_ADC_GPIO \ - /* PC0 */ ADC1_GPIO(10), \ - /* PC1 */ ADC1_GPIO(11), \ - /* PF4 */ ADC3_GPIO(14), \ - /* PF5 */ ADC3_GPIO(15) - -/* Define Channel numbers must match above GPIO pin IN(n)*/ - -#define ADC_SCALED_V5_CHANNEL /* PC0 */ ADC1_CH(10) -#define ADC_SCALED_VDD_3V3_SENSORS_CHANNEL /* PC1 */ ADC1_CH(11) -#define ADC_HW_VER_SENSE_CHANNEL /* PF4 */ ADC3_CH(14) -#define ADC_HW_REV_SENSE_CHANNEL /* PF5 */ ADC3_CH(15) - -#define ADC_CHANNELS \ - ((1 << ADC_SCALED_V5_CHANNEL) | \ - (1 << ADC_SCALED_VDD_3V3_SENSORS_CHANNEL) | \ - (1 << ADC_HW_VER_SENSE_CHANNEL) | \ - (1 << ADC_HW_REV_SENSE_CHANNEL)) - -/* HW has to large of R termination on ADC todo:change when HW value is chosen */ - -#define HW_REV_VER_ADC_BASE STM32_ADC3_BASE - -#define SYSTEM_ADC_BASE STM32_ADC1_BASE - -#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f) - -/* HW Version and Revision drive signals Default to 1 to detect */ - -#define BOARD_HAS_HW_VERSIONING - -#define GPIO_HW_VER_REV_DRIVE /* PG0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN0) -#define GPIO_HW_REV_SENSE /* PF5 */ ADC3_GPIO(15) -#define GPIO_HW_VER_SENSE /* PF4 */ ADC3_GPIO(14) -#define HW_INFO_INIT_PREFIX "V1" -#define V10006 HW_VER_REV(0x0,0x6) // V1006 Rev 6 -#define V10100 HW_VER_REV(0x1,0x0) // V1010 Rev 0 - - -/* PWM - */ - -#define DIRECT_PWM_OUTPUT_CHANNELS 8 - -#define GPIO_CAN1_SILENT /* PI11 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTI|GPIO_PIN11) - -#define GPIO_VDD_3V3_SPEKTRUM_POWER_EN /* PH2 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN2) -#define GPIO_VDD_3V3_SD_CARD_EN /* PC13 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN13) - -/* For primary/backup signaling with VOXL, 2 pins on J4 are exposed */ - -#define GPIO_VOXL_STATUS_OUT /* PE4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN4) -#define GPIO_VOXL_STATUS_IN /* PE3 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTE|GPIO_PIN3) - -/* Define True logic Power Control in arch agnostic form */ - -#define VDD_3V3_SPEKTRUM_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SPEKTRUM_POWER_EN, (on_true)) -#define READ_VDD_3V3_SPEKTRUM_POWER_EN() px4_arch_gpioread(GPIO_VDD_3V3_SPEKTRUM_POWER_EN) -#define VDD_3V3_SD_CARD_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SD_CARD_EN, (on_true)) - -/* USB OTG FS - * - * PA9 OTG_FS_VBUS VBUS sensing - */ -#define GPIO_OTGFS_VBUS /* PA9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 8 /* use timer8 for the HRT */ -#define HRT_TIMER_CHANNEL 3 /* use capture/compare channel 3 */ - -#define HRT_PPM_CHANNEL /* T8C1 */ 1 /* use capture/compare channel 1 */ -#define GPIO_PPM_IN /* PI5 T8C1 */ GPIO_TIM8_CH1IN_2 - -/* RC Serial port */ - -#define RC_SERIAL_PORT "/dev/ttyS5" -#define BOARD_SUPPORTS_RC_SERIAL_PORT_OUTPUT - -/* Safety Switch: Enable the FMU to control it as there is no px4io in ModalAI FC-v1 */ -#define GPIO_SAFETY_SWITCH_IN /* PF3 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTF|GPIO_PIN3) -#define GPIO_BTN_SAFETY GPIO_SAFETY_SWITCH_IN /* Enable the FMU to control it if there is no px4io */ - -/* Power switch controls ******************************************************/ - -#define SPEKTRUM_POWER(_on_true) VDD_3V3_SPEKTRUM_POWER_EN(_on_true) - -/* - * ModalAI FC-v1 has a separate RC_IN - * - * GPIO PPM_IN on PI5 T8CH1 - * SPEKTRUM_RX (it's TX or RX in Bind) on UART6 PC7 - * Inversion is possible in the UART and can drive GPIO PPM_IN as an output - */ - -#define GPIO_PPM_IN_AS_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTI|GPIO_PIN5) - -#define SPEKTRUM_RX_AS_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN7) -#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(SPEKTRUM_RX_AS_OUT) -#define SPEKTRUM_RX_AS_UART() /* Can be left as uart */ -#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(SPEKTRUM_RX_AS_OUT, (_one_true)) - -#define SDIO_SLOTNO 0 /* Only one slot */ -#define SDIO_MINOR 0 - -/* SD card bringup does not work if performed on the IDLE thread because it - * will cause waiting. Use either: - * - * CONFIG_BOARDCTL=y, OR - * CONFIG_BOARD_INITIALIZE=y && CONFIG_BOARD_INITTHREAD=y - */ - -#if defined(CONFIG_BOARD_INITIALIZE) && !defined(CONFIG_BOARDCTL) && \ - !defined(CONFIG_BOARD_INITTHREAD) -# warning SDIO initialization cannot be perfomed on the IDLE thread -#endif - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) - -/* ModalAI FC-v1 never powers off the Servo rail */ - -#define BOARD_ADC_SERVO_VALID (1) -#define BOARD_ADC_BRICK_VALID (1) - - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ - -#define BOARD_HAS_ON_RESET 1 - -#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, \ - GPIO_VOXL_STATUS_OUT, \ - GPIO_VOXL_STATUS_IN, \ - GPIO_SAFETY_SWITCH_IN, \ - GPIO_FYSNC_INT_ICM42688, \ - GPIO_FYSNC_INT_ICM20602 \ - } - -#define BOARD_ENABLE_CONSOLE_BUFFER - -#define BOARD_NUM_IO_TIMERS 5 - -// J4 / TELEM3 / UART2 -#define MODAL_IO_DEFAULT_PORT "/dev/ttyS1" - -__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 - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/modalai/fc-v1/src/can.c b/boards/modalai/fc-v1/src/can.c deleted file mode 100644 index 1523056..0000000 --- a/boards/modalai/fc-v1/src/can.c +++ /dev/null @@ -1,123 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2019 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. - * - ****************************************************************************/ - -/** - * @file px4fmu_can.c - * - * Board-specific CAN functions. - */ - -#ifdef CONFIG_CAN - -#include -#include - -#include -#include - -#include "chip.h" -#include "arm_internal.h" - -#include "chip.h" -#include "stm32_can.h" -#include "board_config.h" - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(CONFIG_STM32F7_CAN1) && defined(CONFIG_STM32F7_CAN2) -# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." -# undef CONFIG_STM32F7_CAN2 -#endif - -#ifdef CONFIG_STM32F7_CAN1 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); - -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} -#endif /* CONFIG_CAN */ diff --git a/boards/modalai/fc-v1/src/i2c.cpp b/boards/modalai/fc-v1/src/i2c.cpp deleted file mode 100644 index 8a55707..0000000 --- a/boards/modalai/fc-v1/src/i2c.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), - initI2CBusExternal(2), - initI2CBusExternal(3), - initI2CBusInternal(4), -}; diff --git a/boards/modalai/fc-v1/src/init.c b/boards/modalai/fc-v1/src/init.c deleted file mode 100644 index beee10b..0000000 --- a/boards/modalai/fc-v1/src/init.c +++ /dev/null @@ -1,289 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-2019 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * PX4FMU-specific early startup code. This file implements the - * board_app_initializ() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include "board_config.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* Configuration ************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - /* set the peripheral rails off */ - - // NA, rails not controlled in ModalAI FC-v1 - - bool last = READ_VDD_3V3_SPEKTRUM_POWER_EN(); - /* Keep Spektum on to discharge rail*/ - VDD_3V3_SPEKTRUM_POWER_EN(false); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ - VDD_3V3_SPEKTRUM_POWER_EN(last); - - // NA, rails not controlled in ModalAI FC-v1 - -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/**************************************************************************** - * 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 - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - - -__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()) { - syslog(LOG_INFO, "[boot] Rev 0x%1x : Ver 0x%1x %s\n", board_get_hw_revision(), board_get_hw_version(), - board_get_hw_type_name()); - - } else { - syslog(LOG_ERR, "[boot] Failed to read HW revision and version\n"); - } - - /* configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_on(LED_GREEN); // Indicate Power. - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - -#ifdef CONFIG_MMCSD - int ret = stm32_sdio_initialize(); - - if (ret != OK) { - led_on(LED_RED); - } - -#endif /* CONFIG_MMCSD */ - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/modalai/fc-v1/src/led.c b/boards/modalai/fc-v1/src/led.c deleted file mode 100644 index 4b429b2..0000000 --- a/boards/modalai/fc-v1/src/led.c +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019 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. - * - ****************************************************************************/ - -/** - * @file px4fmu2_led.c - * - * PX4FMU LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -# define xlat(p) (p) -static uint32_t g_ledmap[] = { - GPIO_nLED_BLUE, // Indexed by LED_BLUE - GPIO_nLED_RED, // Indexed by LED_RED, LED_AMBER - 0, // Indexed by LED_SAFETY (defaulted to an input) - GPIO_nLED_GREEN, // Indexed by LED_GREEN -}; - -__EXPORT void led_init(void) -{ - /* Configure LED GPIOs for output */ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - stm32_configgpio(g_ledmap[l]); - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - - stm32_gpiowrite(g_ledmap[led], !state); -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - return !stm32_gpioread(g_ledmap[led]); -} - -__EXPORT void led_on(int led) -{ - phy_set_led(xlat(led), true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(xlat(led), false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(xlat(led), !phy_get_led(xlat(led))); -} diff --git a/boards/modalai/fc-v1/src/manifest.c b/boards/modalai/fc-v1/src/manifest.c deleted file mode 100644 index f755d35..0000000 --- a/boards/modalai/fc-v1/src/manifest.c +++ /dev/null @@ -1,140 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2018-2021 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. - * - ****************************************************************************/ - -/** - * @file manifest.c - * - * This module supplies the interface to the manifest of hardware that is - * optional and dependent on the HW REV and HW VER IDs - * - * The manifest allows the system to know whether a hardware option - * say for example the PX4IO is an no-pop option vs it is broken. - * - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include - -#include "systemlib/px4_macros.h" - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -typedef struct { - uint32_t hw_ver_rev; /* the version and revision */ - const px4_hw_mft_item_t *mft; /* The first entry */ - uint32_t entries; /* the lenght of the list */ -} px4_hw_mft_list_entry_t; - -typedef px4_hw_mft_list_entry_t *px4_hw_mft_list_entry; -#define px4_hw_mft_list_uninitialized (px4_hw_mft_list_entry) -1 - -static const px4_hw_mft_item_t device_unsupported = {0, 0, 0}; - -// List of components on a specific board configuration -// The index of those components is given by the enum (px4_hw_mft_item_id_t) -// declared in board_common.h -static const px4_hw_mft_item_t hw_mft_list_fc0006[] = { - { - .present = 0, - .mandatory = 0, - .connection = px4_hw_con_unknown, - }, -}; - -static const px4_hw_mft_item_t hw_mft_list_fc0100[] = { - { - .present = 0, - .mandatory = 0, - .connection = px4_hw_con_unknown, - }, -}; - -static px4_hw_mft_list_entry_t mft_lists[] = { - {V10006, hw_mft_list_fc0006, arraySize(hw_mft_list_fc0006)}, - {V10100, hw_mft_list_fc0100, arraySize(hw_mft_list_fc0100)} -}; - -/************************************************************************************ - * Name: board_query_manifest - * - * Description: - * Optional returns manifest item. - * - * Input Parameters: - * manifest_id - the ID for the manifest item to retrieve - * - * Returned Value: - * 0 - item is not in manifest => assume legacy operations - * pointer to a manifest item - * - ************************************************************************************/ - -__EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) -{ - static px4_hw_mft_list_entry boards_manifest = px4_hw_mft_list_uninitialized; - - if (boards_manifest == px4_hw_mft_list_uninitialized) { - uint32_t ver_rev = board_get_hw_version() << 16; - ver_rev |= board_get_hw_revision(); - - for (unsigned i = 0; i < arraySize(mft_lists); i++) { - if (mft_lists[i].hw_ver_rev == ver_rev) { - boards_manifest = &mft_lists[i]; - break; - } - } - - if (boards_manifest == px4_hw_mft_list_uninitialized) { - syslog(LOG_ERR, "[boot] Board %08" PRIx32 " is not supported!\n", ver_rev); - } - } - - px4_hw_mft_item rv = &device_unsupported; - - if (boards_manifest != px4_hw_mft_list_uninitialized && - id < boards_manifest->entries) { - rv = &boards_manifest->mft[id]; - } - - return rv; -} diff --git a/boards/modalai/fc-v1/src/sdio.c b/boards/modalai/fc-v1/src/sdio.c deleted file mode 100644 index 869d757..0000000 --- a/boards/modalai/fc-v1/src/sdio.c +++ /dev/null @@ -1,177 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include "chip.h" -#include "board_config.h" -#include "stm32_gpio.h" -#include "stm32_sdmmc.h" - -#ifdef CONFIG_MMCSD - - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Card detections requires card support and a card detection GPIO */ - -#define HAVE_NCD 1 -#if !defined(GPIO_SDMMC1_NCD) -# undef HAVE_NCD -#endif - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -static FAR struct sdio_dev_s *sdio_dev; -#ifdef HAVE_NCD -static bool g_sd_inserted = 0xff; /* Impossible value */ -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_ncd_interrupt - * - * Description: - * Card detect interrupt handler. - * - ****************************************************************************/ - -#ifdef HAVE_NCD -static int stm32_ncd_interrupt(int irq, FAR void *context) -{ - bool present; - - present = !stm32_gpioread(GPIO_SDMMC1_NCD); - - if (sdio_dev && present != g_sd_inserted) { - sdio_mediachange(sdio_dev, present); - g_sd_inserted = present; - } - - return OK; -} -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_sdio_initialize - * - * Description: - * Initialize SDIO-based MMC/SD card support - * - ****************************************************************************/ - -int stm32_sdio_initialize(void) -{ - int ret; - -#ifdef HAVE_NCD - /* Card detect */ - - bool cd_status; - - /* Configure the card detect GPIO */ - - stm32_configgpio(GPIO_SDMMC1_NCD); - - /* Register an interrupt handler for the card detect pin */ - - stm32_gpiosetevent(GPIO_SDMMC1_NCD, true, true, true, stm32_ncd_interrupt); -#endif - - /* Mount the SDIO-based MMC/SD block driver */ - /* First, get an instance of the SDIO interface */ - - finfo("Initializing SDIO slot %d\n", SDIO_SLOTNO); - - sdio_dev = sdio_initialize(SDIO_SLOTNO); - - if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", SDIO_SLOTNO); - return -ENODEV; - } - - /* Now bind the SDIO interface to the MMC/SD driver */ - - finfo("Bind SDIO to the MMC/SD driver, minor=%d\n", SDIO_MINOR); - - ret = mmcsd_slotinitialize(SDIO_MINOR, sdio_dev); - - if (ret != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); - return ret; - } - - finfo("Successfully bound SDIO to the MMC/SD driver\n"); - -#ifdef HAVE_NCD - /* Use SD card detect pin to check if a card is g_sd_inserted */ - - cd_status = !stm32_gpioread(GPIO_SDMMC1_NCD); - finfo("Card detect : %d\n", cd_status); - - sdio_mediachange(sdio_dev, cd_status); -#else - /* Assume that the SD card is inserted. What choice do we have? */ - - sdio_mediachange(sdio_dev, true); -#endif - - return OK; -} - -#endif /* CONFIG_MMCSD */ diff --git a/boards/modalai/fc-v1/src/spi.cpp b/boards/modalai/fc-v1/src/spi.cpp deleted file mode 100644 index 0990776..0000000 --- a/boards/modalai/fc-v1/src/spi.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}), - }), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortH, GPIO::Pin12}), - }), - initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7}) - }), - initSPIBus(SPI::Bus::SPI6, { - initSPIDevice(DRV_GYR_DEVTYPE_BMI088, SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortI, GPIO::Pin7}), - initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::PortI, GPIO::Pin10}, SPI::DRDY{GPIO::PortI, GPIO::Pin6}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/modalai/fc-v1/src/timer_config.cpp b/boards/modalai/fc-v1/src/timer_config.cpp deleted file mode 100644 index 322f1cb..0000000 --- a/boards/modalai/fc-v1/src/timer_config.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 - -/* Timer allocation - * - * FMU_CH1 : PE14 : TIM1_CH4 - * FMU_CH2 : PA10 : TIM1_CH3 - * FMU_CH3 : PE11 : TIM1_CH2 - * FMU_CH4 : PA8 : TIM1_CH1 - * FMU_CH5 : PD13 : TIM4_CH2 - * FMU_CH6 : PD14 : TIM4_CH3 - * FMU_CH7 : PD12 : TIM4_CH1 - * FMU_CH8 : PH15 : TIM4_CH4 - */ - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1, DMA{DMA::Index2, DMA::Stream5, DMA::Channel6}), - initIOTimer(Timer::Timer4, DMA{DMA::Index1, DMA::Stream6, DMA::Channel2}), -}; - - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortA, GPIO::Pin10}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortA, GPIO::Pin8}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel1}, {GPIO::PortD, GPIO::Pin12}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel4}, {GPIO::PortD, GPIO::Pin15}) -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/modalai/fc-v1/src/usb.c b/boards/modalai/fc-v1/src/usb.c deleted file mode 100644 index 28965c4..0000000 --- a/boards/modalai/fc-v1/src/usb.c +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016 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. - * - ****************************************************************************/ - -/** - * @file px4fmu_usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#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 - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/modalai/fc-v2/bootloader.px4board b/boards/modalai/fc-v2/bootloader.px4board deleted file mode 100644 index 19b6e66..0000000 --- a/boards/modalai/fc-v2/bootloader.px4board +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_ROMFSROOT="" diff --git a/boards/modalai/fc-v2/default.px4board b/boards/modalai/fc-v2/default.px4board deleted file mode 100644 index a3eb561..0000000 --- a/boards/modalai/fc-v2/default.px4board +++ /dev/null @@ -1,93 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS0" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS6" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS4" -CONFIG_DRIVERS_ACTUATORS_MODAL_IO=y -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_BAROMETER_INVENSENSE_ICP201XX=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_BOSCH_BMI088=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20649=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_COMMON_OSD=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_POWER_MONITOR_VOXLPM=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_BOARD_UAVCAN_INTERFACES=1 -CONFIG_BOARD_UAVCAN_TIMER_OVERRIDE=2 -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/modalai/fc-v2/extras/modalai_fc-v2_bootloader.bin b/boards/modalai/fc-v2/extras/modalai_fc-v2_bootloader.bin deleted file mode 100755 index c80dba5..0000000 Binary files a/boards/modalai/fc-v2/extras/modalai_fc-v2_bootloader.bin and /dev/null differ diff --git a/boards/modalai/fc-v2/firmware.prototype b/boards/modalai/fc-v2/firmware.prototype deleted file mode 100644 index 7cd48b5..0000000 --- a/boards/modalai/fc-v2/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 41776, - "magic": "PX4FWv1", - "description": "Firmware for the ModalAI Flight Core v2 board", - "image": "", - "build_time": 0, - "summary": "modalaifcv2", - "version": "0.1", - "image_size": 0, - "image_maxsize": 1966080, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/modalai/fc-v2/init/rc.board_defaults b/boards/modalai/fc-v2/init/rc.board_defaults deleted file mode 100644 index c452275..0000000 --- a/boards/modalai/fc-v2/init/rc.board_defaults +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -# Like FCV1, MAV_1 mavlink channel is used to talk to VOXL via onboard mode -# unlike FCV1, TELEM1 is used to connect to VOXL instead of TELEM2 -param set-default MAV_0_CONFIG 0 -param set-default MAV_1_CONFIG 101 -param set-default MAV_1_MODE 2 -param set-default MAV_1_RATE 0 -param set-default SER_TEL1_BAUD 921600 diff --git a/boards/modalai/fc-v2/init/rc.board_sensors b/boards/modalai/fc-v2/init/rc.board_sensors deleted file mode 100644 index b312425..0000000 --- a/boards/modalai/fc-v2/init/rc.board_sensors +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -# -# ModalAI FC-v2 specific board sensors init -#------------------------------------------------------------------------------ - -if param greater MODAL_IO_CONFIG 0 -then - modal_io start -fi - -board_adc start - -# VOXL Power Module -voxlpm -X -b 3 -k -T VBATT start -voxlpm -X -b 3 -T P5VDC start - -# Internal SPI1 ICM-42688 -icm42688p -s -b 1 -R 12 start - -# Internal SPI2 ICM-42688 -icm42688p -s -b 2 -R 12 start - -# Internal I2C mag -bmm150 -I start - -# Internal I2C baro -icp201xx -I start diff --git a/boards/modalai/fc-v2/nuttx-config/Kconfig b/boards/modalai/fc-v2/nuttx-config/Kconfig deleted file mode 100644 index bb33d3c..0000000 --- a/boards/modalai/fc-v2/nuttx-config/Kconfig +++ /dev/null @@ -1,17 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see misc/tools/kconfig-language.txt. -# -config BOARD_HAS_PROBES - bool "Board provides GPIO or other Hardware for signaling to timing analyze." - default y - ---help--- - This board provides GPIO FMU-CH1-5, CAP1-6 as PROBE_1-11 to provide timing signals from selected drivers. - -config BOARD_USE_PROBES - bool "Enable the use the board provided FMU-CH1-5, CAP1-6 as PROBE_1-11" - default n - depends on BOARD_HAS_PROBES - - ---help--- - Select to use GPIO FMU-CH1-5, CAP1-6 to provide timing signals from selected drivers. diff --git a/boards/modalai/fc-v2/nuttx-config/bootloader/defconfig b/boards/modalai/fc-v2/nuttx-config/bootloader/defconfig deleted file mode 100644 index 58ac858..0000000 --- a/boards/modalai/fc-v2/nuttx-config/bootloader/defconfig +++ /dev/null @@ -1,90 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_CONSOLE is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_SPI_EXCHANGE is not set -# CONFIG_STM32H7_SYSCFG is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/modalai/fc-v2/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H753II=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_INITTHREAD_PRIORITY=254 -CONFIG_BOARD_LATE_INITIALIZE=y -CONFIG_BOARD_LOOPSPERMSEC=95150 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0xa330 -CONFIG_CDCACM_PRODUCTSTR="PX4 BL ModalAI FCv2" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x0483 -CONFIG_CDCACM_VENDORSTR="ModalAI" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_EXPERIMENTAL=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="bootloader_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SPI=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_USART3=y -CONFIG_SYSTEMTICK_HOOK=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGINT_CHAR=0x03 -CONFIG_TTY_SIGTSTP=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/modalai/fc-v2/nuttx-config/include/board.h b/boards/modalai/fc-v2/nuttx-config/include/board.h deleted file mode 100644 index 34a8d2c..0000000 --- a/boards/modalai/fc-v2/nuttx-config/include/board.h +++ /dev/null @@ -1,555 +0,0 @@ -/************************************************************************************ - * nuttx-configs/px4_fmu-v6x/include/board.h - * - * Copyright (C) 2016-2019 Gregory Nutt. All rights reserved. - * Authors: David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ -#ifndef __NUTTX_CONFIG_PX4_FMU_V6X_INCLUDE_BOARD_H -#define __NUTTX_CONFIG_PX4_FMU_V6X_INCLUDE_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The px4_fmu-v6X board provides the following clock sources: - * - * X1: 16 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 16 MHz RC factory-trimmed - * HSE: 16 MHz crystal for HSE - */ - -#define STM32_BOARD_XTAL 16000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 32768 - -/* Main PLL Configuration. - * - * PLL source is HSE = 16,000,000 - * - * PLL_VCOx = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 1 <= PLLM <= 63 - * 4 <= PLLN <= 512 - * 150 MHz <= PLL_VCOL <= 420MHz - * 192 MHz <= PLL_VCOH <= 836MHz - * - * SYSCLK = PLL_VCO / PLLP - * CPUCLK = SYSCLK / D1CPRE - * Subject to - * - * PLLP1 = {2, 4, 6, 8, ..., 128} - * PLLP2,3 = {2, 3, 4, ..., 128} - * CPUCLK <= 480 MHz - */ - -#define STM32_BOARD_USEHSE - -#define STM32_PLLCFG_PLLSRC RCC_PLLCKSELR_PLLSRC_HSE - -/* PLL1, wide 4 - 8 MHz input, enable DIVP, DIVQ, DIVR - * - * PLL1_VCO = (16,000,000 / 1) * 60 = 960 MHz - * - * PLL1P = PLL1_VCO/2 = 960 MHz / 2 = 480 MHz - * PLL1Q = PLL1_VCO/4 = 960 MHz / 4 = 240 MHz - * PLL1R = PLL1_VCO/8 = 960 MHz / 8 = 120 MHz - */ - -#define STM32_PLLCFG_PLL1CFG (RCC_PLLCFGR_PLL1VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL1RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVP1EN | \ - RCC_PLLCFGR_DIVQ1EN | \ - RCC_PLLCFGR_DIVR1EN) -#define STM32_PLLCFG_PLL1M RCC_PLLCKSELR_DIVM1(1) -#define STM32_PLLCFG_PLL1N RCC_PLL1DIVR_N1(60) -#define STM32_PLLCFG_PLL1P RCC_PLL1DIVR_P1(2) -#define STM32_PLLCFG_PLL1Q RCC_PLL1DIVR_Q1(4) -#define STM32_PLLCFG_PLL1R RCC_PLL1DIVR_R1(8) - -#define STM32_VCO1_FREQUENCY ((STM32_HSE_FREQUENCY / 1) * 60) -#define STM32_PLL1P_FREQUENCY (STM32_VCO1_FREQUENCY / 2) -#define STM32_PLL1Q_FREQUENCY (STM32_VCO1_FREQUENCY / 4) -#define STM32_PLL1R_FREQUENCY (STM32_VCO1_FREQUENCY / 8) - -/* PLL2 */ - -#define STM32_PLLCFG_PLL2CFG (RCC_PLLCFGR_PLL2VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL2RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVP2EN | \ - RCC_PLLCFGR_DIVQ2EN | \ - RCC_PLLCFGR_DIVR2EN) -#define STM32_PLLCFG_PLL2M RCC_PLLCKSELR_DIVM2(4) -#define STM32_PLLCFG_PLL2N RCC_PLL2DIVR_N2(48) -#define STM32_PLLCFG_PLL2P RCC_PLL2DIVR_P2(2) -#define STM32_PLLCFG_PLL2Q RCC_PLL2DIVR_Q2(2) -#define STM32_PLLCFG_PLL2R RCC_PLL2DIVR_R2(2) - -#define STM32_VCO2_FREQUENCY ((STM32_HSE_FREQUENCY / 4) * 48) -#define STM32_PLL2P_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2Q_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2R_FREQUENCY (STM32_VCO2_FREQUENCY / 2) - -/* PLL3 */ - -#define STM32_PLLCFG_PLL3CFG (RCC_PLLCFGR_PLL3VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL3RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVQ3EN) -#define STM32_PLLCFG_PLL3M RCC_PLLCKSELR_DIVM3(4) -#define STM32_PLLCFG_PLL3N RCC_PLL3DIVR_N3(48) -#define STM32_PLLCFG_PLL3P RCC_PLL3DIVR_P3(2) -#define STM32_PLLCFG_PLL3Q RCC_PLL3DIVR_Q3(4) -#define STM32_PLLCFG_PLL3R RCC_PLL3DIVR_R3(2) - -#define STM32_VCO3_FREQUENCY ((STM32_HSE_FREQUENCY / 4) * 48) -#define STM32_PLL3P_FREQUENCY (STM32_VCO3_FREQUENCY / 2) -#define STM32_PLL3Q_FREQUENCY (STM32_VCO3_FREQUENCY / 4) -#define STM32_PLL3R_FREQUENCY (STM32_VCO3_FREQUENCY / 2) - -/* SYSCLK = PLL1P = 480MHz - * CPUCLK = SYSCLK / 1 = 480 MHz - */ - -#define STM32_RCC_D1CFGR_D1CPRE (RCC_D1CFGR_D1CPRE_SYSCLK) -#define STM32_SYSCLK_FREQUENCY (STM32_PLL1P_FREQUENCY) -#define STM32_CPUCLK_FREQUENCY (STM32_SYSCLK_FREQUENCY / 1) - -/* Configure Clock Assignments */ - -/* AHB clock (HCLK) is SYSCLK/2 (240 MHz max) - * HCLK1 = HCLK2 = HCLK3 = HCLK4 = 240 - */ - -#define STM32_RCC_D1CFGR_HPRE RCC_D1CFGR_HPRE_SYSCLKd2 /* HCLK = SYSCLK / 2 */ -#define STM32_ACLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* ACLK in D1, HCLK3 in D1 */ -#define STM32_HCLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* HCLK in D2, HCLK4 in D3 */ -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D2CFGR_D2PPRE1 RCC_D2CFGR_D2PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB2 clock (PCLK2) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D2CFGR_D2PPRE2 RCC_D2CFGR_D2PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB3 clock (PCLK3) is HCLK/2 (120 MHz) */ - -#define STM32_RCC_D1CFGR_D1PPRE RCC_D1CFGR_D1PPRE_HCLKd2 /* PCLK3 = HCLK / 2 */ -#define STM32_PCLK3_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB4 clock (PCLK4) is HCLK/4 (120 MHz) */ - -#define STM32_RCC_D3CFGR_D3PPRE RCC_D3CFGR_D3PPRE_HCLKd2 /* PCLK4 = HCLK / 2 */ -#define STM32_PCLK4_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timer clock frequencies */ - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM15_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM16_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM17_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Kernel Clock Configuration - * - * Note: look at Table 54 in ST Manual - */ - -/* I2C123 clock source */ - -#define STM32_RCC_D2CCIP2R_I2C123SRC RCC_D2CCIP2R_I2C123SEL_HSI - -/* I2C4 clock source */ - -#define STM32_RCC_D3CCIPR_I2C4SRC RCC_D3CCIPR_I2C4SEL_HSI - -/* SPI123 clock source */ - -#define STM32_RCC_D2CCIP1R_SPI123SRC RCC_D2CCIP1R_SPI123SEL_PLL2 - -/* SPI45 clock source */ - -#define STM32_RCC_D2CCIP1R_SPI45SRC RCC_D2CCIP1R_SPI45SEL_PLL2 - -/* SPI6 clock source */ - -#define STM32_RCC_D3CCIPR_SPI6SRC RCC_D3CCIPR_SPI6SEL_PLL2 - -/* USB 1 and 2 clock source */ - -#define STM32_RCC_D2CCIP2R_USBSRC RCC_D2CCIP2R_USBSEL_PLL3 - -/* ADC 1 2 3 clock source */ - -#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2 - -/* FDCAN 1 2 clock source */ - -#define STM32_RCC_D2CCIP1R_FDCANSEL RCC_D2CCIP1R_FDCANSEL_HSE /* FDCAN 1 2 clock source */ - -#define STM32_FDCANCLK STM32_HSE_FREQUENCY - -/* FLASH wait states - * - * ------------ ---------- ----------- - * Vcore MAX ACLK WAIT STATES - * ------------ ---------- ----------- - * 1.15-1.26 V 70 MHz 0 - * (VOS1 level) 140 MHz 1 - * 210 MHz 2 - * 1.05-1.15 V 55 MHz 0 - * (VOS2 level) 110 MHz 1 - * 165 MHz 2 - * 220 MHz 3 - * 0.95-1.05 V 45 MHz 0 - * (VOS3 level) 90 MHz 1 - * 135 MHz 2 - * 180 MHz 3 - * 225 MHz 4 - * ------------ ---------- ----------- - */ - -#define BOARD_FLASH_WAITSTATES 2 - -/* SDMMC definitions ********************************************************/ - -/* Init 400kHz, freq = PLL1Q/(2*div) div = PLL1Q/(2*freq) */ - -#define STM32_SDMMC_INIT_CLKDIV (300 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* 25 MHz Max for now, 25 mHZ = PLL1Q/(2*div), div = PLL1Q/(2*freq) - * div = 4.8 = 240 / 50, So round up to 5 for default speed 24 MB/s - */ - -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_MMCXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_SDXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - -/* LED definitions ******************************************************************/ -/* The PX4 FMUV6X board has three, LED_GREEN a Green LED, LED_BLUE a Blue LED and - * LED_RED a Red LED, that can be controlled by software. - * - * If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any way. - * The following definitions are used to access individual LEDs. - */ - -/* LED index values for use with board_userled() */ - -/* LED definitions ******************************************************************/ -/* The px4_fmu-v6x board has three, LED_GREEN a Green LED, LED_BLUE a Blue LED and - * LED_RED a Red LED, that can be controlled by software. - * - * If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any way. - * The following definitions are used to access individual LEDs. - */ - -/* LED index values for use with board_userled() */ - -#define BOARD_LED1 0 -#define BOARD_LED2 1 -#define BOARD_LED3 2 -#define BOARD_NLEDS 3 - -#define BOARD_LED_RED BOARD_LED1 -#define BOARD_LED_GREEN BOARD_LED2 -#define BOARD_LED_BLUE BOARD_LED3 - -/* LED bits for use with board_userled_all() */ - -#define BOARD_LED1_BIT (1 << BOARD_LED1) -#define BOARD_LED2_BIT (1 << BOARD_LED2) -#define BOARD_LED3_BIT (1 << BOARD_LED3) - -/* If CONFIG_ARCH_LEDS is defined, the usage by the board port is defined in - * include/board.h and src/stm32_leds.c. The LEDs are used to encode OS-related - * events as follows: - * - * - * SYMBOL Meaning LED state - * Red Green Blue - * ---------------------- -------------------------- ------ ------ ----*/ - -#define LED_STARTED 0 /* NuttX has been started OFF OFF OFF */ -#define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF OFF ON */ -#define LED_IRQSENABLED 2 /* Interrupts enabled OFF ON OFF */ -#define LED_STACKCREATED 3 /* Idle stack created OFF ON ON */ -#define LED_INIRQ 4 /* In an interrupt N/C N/C GLOW */ -#define LED_SIGNAL 5 /* In a signal handler N/C GLOW N/C */ -#define LED_ASSERTION 6 /* An assertion failed GLOW N/C GLOW */ -#define LED_PANIC 7 /* The system has crashed Blink OFF N/C */ -#define LED_IDLE 8 /* MCU is is sleep mode ON OFF OFF */ - -/* Thus if the Green LED is statically on, NuttX has successfully booted and - * is, apparently, running normally. If the Red LED is flashing at - * approximately 2Hz, then a fatal error has been detected and the system - * has halted. - */ - -/* Alternate function pin selections ************************************************/ - -#define GPIO_USART1_RX GPIO_USART1_RX_3 /* PB7 */ -#define GPIO_USART1_TX GPIO_USART1_TX_3 /* PB6 */ - -#define GPIO_USART2_RX GPIO_USART2_RX_1 /* PA3 */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 /* PD4 */ -#define GPIO_USART2_CTS GPIO_USART2_CTS_NSS_2 /* PD3 */ - -#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ -#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ - -#define GPIO_UART4_RX GPIO_UART4_RX_6 /* PH14 */ -#define GPIO_UART4_TX GPIO_UART4_TX_6 /* PH13 */ - -#define GPIO_UART5_RX GPIO_UART5_RX_3 /* PD2 */ -#define GPIO_UART5_TX GPIO_UART5_TX_3 /* PC12 */ -// GPIO_UART5_RTS no remap /* PC8 */ -// GPIO_UART5_CTS No remap /* PC9 */ - -#define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC7 */ -#define GPIO_USART6_TX GPIO_USART6_TX_1 /* PC6 */ - -#define GPIO_UART7_RX GPIO_UART7_RX_4 /* PF6 */ -#define GPIO_UART7_TX GPIO_UART7_TX_3 /* PE8 */ -#define GPIO_UART7_RTS GPIO_UART7_RTS_2 /* PF8 */ -#define GPIO_UART7_CTS GPIO_UART7_CTS_1 /* PE10 */ - -#define GPIO_UART8_RX GPIO_UART8_RX_1 /* PE0 */ -#define GPIO_UART8_TX GPIO_UART8_TX_1 /* PE1 */ - - -/* CAN - * - * CAN1 is routed to transceiver. - */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 /* PD0 */ -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 /* PD1 */ - -/* SPI - * SPI1 is IMU1 - * SPI2 is IMU2 - * SPI3 is Not Used - * SPI4 is Magnetometer - * SPI5 is FRAM - * SPI6 is EXTERNAL1 - * - */ - -#define ADJ_SLEW_RATE(p) (((p) & ~GPIO_SPEED_MASK) | (GPIO_SPEED_2MHz)) - -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_3 /* PG9 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_2 /* PB5 */ -#define GPIO_SPI1_SCK ADJ_SLEW_RATE(GPIO_SPI1_SCK_1) /* PA5 */ - -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_3 /* PI2 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_4 /* PI3 */ -#define GPIO_SPI2_SCK ADJ_SLEW_RATE(GPIO_SPI2_SCK_6) /* PI1 */ - -#define GPIO_SPI4_MISO GPIO_SPI4_MISO_2 /* PE13 */ -#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_2 /* PE14 */ -#define GPIO_SPI4_SCK ADJ_SLEW_RATE(GPIO_SPI4_SCK_2) /* PE12 */ - -#define GPIO_SPI5_MISO GPIO_SPI5_MISO_2 /* PH7 */ -#define GPIO_SPI5_MOSI GPIO_SPI5_MOSI_1 /* PF11 */ -#define GPIO_SPI5_SCK ADJ_SLEW_RATE(GPIO_SPI5_SCK_1) /* PF7 */ - -#define GPIO_SPI6_MISO GPIO_SPI6_MISO_2 /* PA6 */ -#define GPIO_SPI6_MOSI GPIO_SPI6_MOSI_1 /* PG14 */ -#define GPIO_SPI6_SCK ADJ_SLEW_RATE(GPIO_SPI6_SCK_3) /* PB3 */ - -/* I2C - * - * The optional _GPIO configurations allow the I2C driver to manually - * reset the bus to clear stuck slaves. They match the pin configuration, - * but are normally-high GPIOs. - * - */ - -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 /* PB8 */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 /* PB9 */ - -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN8) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN9) - -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_2 /* PF1 */ -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_2 /* PF0 */ - -#define GPIO_I2C2_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTF | GPIO_PIN1) -#define GPIO_I2C2_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTF | GPIO_PIN0) - -#define GPIO_I2C3_SCL GPIO_I2C3_SCL_1 /* PA8 */ -#define GPIO_I2C3_SDA GPIO_I2C3_SDA_2 /* PH8 */ - -#define GPIO_I2C3_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTA | GPIO_PIN8) -#define GPIO_I2C3_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTH | GPIO_PIN8) - -#define GPIO_I2C4_SCL GPIO_I2C4_SCL_2 /* PF14 */ -#define GPIO_I2C4_SDA GPIO_I2C4_SDA_2 /* PF15 */ - -#define GPIO_I2C4_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTF | GPIO_PIN14) -#define GPIO_I2C4_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTF | GPIO_PIN15) - -/* SDMMC2 - * - * VDD 3.3 - * GND - * SDMMC2_CK PD6 - * SDMMC2_CMD PD7 - * SDMMC2_D0 PB14 - * SDMMC2_D1 PB15 - * SDMMC2_D2 PG11 - * SDMMC2_D3 PB4 - */ - -#define GPIO_SDMMC2_CK GPIO_SDMMC2_CK_1 /* PD6 */ -#define GPIO_SDMMC2_CMD GPIO_SDMMC2_CMD_1 /* PD7 */ -// GPIO_SDMMC2_D0 No Remap /* PB14 */ -// GPIO_SDMMC2_D1 No Remap /* PB15 */ -#define GPIO_SDMMC2_D2 GPIO_SDMMC2_D2_1 /* PG11 */ -// GPIO_SDMMC2_D3 No Remap /* PB4 */ - -/* The STM32 H7 connects to a TI DP83848TSQ/NOPB - * using RMII - * - * STM32 H7 BOARD DP83848TSQ/NOPB - * GPIO SIGNAL PIN NAME - * -------- ------------ ------------- - * PA7 ETH_CRS_DV CRS_DV - * PC1 ETH_MDC MDC - * PA2 ETH_MDIO MDIO - * PA1 ETH_REF_CL X1 - * PC4 ETH_RXD0 RX_D0 - * PC5 ETH_RXD1 RX_D1 - * PB11 ETH_TX_EN TX_EN - * PG13 ETH_TXD0 TX_D0 - * PG12 ETH_TXD1 TX_D1 - * - * The PHY address is 1, since COL/PHYAD0 features a pull up. - */ - -#define GPIO_ETH_RMII_TX_EN GPIO_ETH_RMII_TX_EN_1 /* PB11 */ -#define GPIO_ETH_RMII_TXD0 GPIO_ETH_RMII_TXD0_2 /* PG13 */ -#define GPIO_ETH_RMII_TXD1 GPIO_ETH_RMII_TXD1_2 /* PG12 */ - - -/* USB - * - * OTG_FS_DM PA11 - * OTG_FS_DP PA12 - * VBUS PA9 - */ - - -/* Board provides GPIO or other Hardware for signaling to timing analyzer */ - -#if defined(CONFIG_BOARD_USE_PROBES) -# include "stm32_gpio.h" -# define PROBE_N(n) (1<<((n)-1)) -# define PROBE_1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTI|GPIO_PIN0) /* PI0 AUX1 */ -# define PROBE_2 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN12) /* PH12 AUX2 */ -# define PROBE_3 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN11) /* PH11 AUX3 */ -# define PROBE_4 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN10) /* PH10 AUX4 */ -# define PROBE_5 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN13) /* PD13 AUX5 */ -# define PROBE_6 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN14) /* PD14 AUX6 */ -# define PROBE_7 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN6) /* PH6 AUX7 */ -# define PROBE_8 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN9) /* PH9 AUX8 */ -# define PROBE_9 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN11) /* PE11 CAP1 */ - -# define PROBE_INIT(mask) \ - do { \ - if ((mask)& PROBE_N(1)) { stm32_configgpio(PROBE_1); } \ - if ((mask)& PROBE_N(2)) { stm32_configgpio(PROBE_2); } \ - if ((mask)& PROBE_N(3)) { stm32_configgpio(PROBE_3); } \ - if ((mask)& PROBE_N(4)) { stm32_configgpio(PROBE_4); } \ - if ((mask)& PROBE_N(5)) { stm32_configgpio(PROBE_5); } \ - if ((mask)& PROBE_N(6)) { stm32_configgpio(PROBE_6); } \ - if ((mask)& PROBE_N(7)) { stm32_configgpio(PROBE_7); } \ - if ((mask)& PROBE_N(8)) { stm32_configgpio(PROBE_8); } \ - if ((mask)& PROBE_N(9)) { stm32_configgpio(PROBE_9); } \ - } while(0) - -# define PROBE(n,s) do {stm32_gpiowrite(PROBE_##n,(s));}while(0) -# define PROBE_MARK(n) PROBE(n,false);PROBE(n,true) -#else -# define PROBE_INIT(mask) -# define PROBE(n,s) -# define PROBE_MARK(n) -#endif - -#endif /*__NUTTX_CONFIG_PX4_FMU_V6X_INCLUDE_BOARD_H */ diff --git a/boards/modalai/fc-v2/nuttx-config/include/board_dma_map.h b/boards/modalai/fc-v2/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 7685974..0000000 --- a/boards/modalai/fc-v2/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -// DMAMUX1 -#define DMAMAP_SPI1_RX DMAMAP_DMA12_SPI1RX_0 /* DMA1:37 */ -#define DMAMAP_SPI1_TX DMAMAP_DMA12_SPI1TX_0 /* DMA1:38 */ - -#define DMAMAP_SPI2_RX DMAMAP_DMA12_SPI2RX_0 /* DMA1:39 */ -#define DMAMAP_SPI2_TX DMAMAP_DMA12_SPI2TX_0 /* DMA1:40 */ - -#define DMAMAP_USART6_RX DMAMAP_DMA12_USART6RX_0 /* DMA1:71 */ -#define DMAMAP_USART6_TX DMAMAP_DMA12_USART6TX_0 /* DMA1:72 */ - -// DMAMUX2 -#define DMAMAP_SPI3_RX DMAMAP_DMA12_SPI3RX_1 /* DMA2:61 */ -#define DMAMAP_SPI3_TX DMAMAP_DMA12_SPI3TX_1 /* DMA2:62 */ - -#define DMAMAP_SPI6_RX DMAMAP_BDMA_SPI6_RX /* BDMA:11 */ -#define DMAMAP_SPI6_TX DMAMAP_BDMA_SPI6_TX /* BDMA:12 */ diff --git a/boards/modalai/fc-v2/nuttx-config/nsh/defconfig b/boards/modalai/fc-v2/nuttx-config/nsh/defconfig deleted file mode 100644 index 11bb3c3..0000000 --- a/boards/modalai/fc-v2/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,273 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/modalai/fc-v2/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H753II=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=95751 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0xa330 -CONFIG_CDCACM_PRODUCTSTR="PX4 FMU ModalAI FCv2" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x0483 -CONFIG_CDCACM_VENDORSTR="ModalAI" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_MEMFAULT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXPERIMENTAL=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_IOB_NBUFFERS=24 -CONFIG_IOB_NCHAINS=24 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_IOB=y -CONFIG_MM_REGIONS=4 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_PROGMEM=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC2_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32H7_ADC1=y -CONFIG_STM32H7_ADC3=y -CONFIG_STM32H7_BBSRAM=y -CONFIG_STM32H7_BBSRAM_FILES=5 -CONFIG_STM32H7_BDMA=y -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_DMA2=y -CONFIG_STM32H7_DMACAPABLE=y -CONFIG_STM32H7_FLASH_OVERRIDE_I=y -CONFIG_STM32H7_FLOWCONTROL_BROKEN=y -CONFIG_STM32H7_I2C1=y -CONFIG_STM32H7_I2C2=y -CONFIG_STM32H7_I2C3=y -CONFIG_STM32H7_I2C4=y -CONFIG_STM32H7_I2C_DYNTIMEO=y -CONFIG_STM32H7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_RTC=y -CONFIG_STM32H7_RTC_AUTO_LSECLOCK_START_DRV_CAPABILITY=y -CONFIG_STM32H7_RTC_MAGIC_REG=1 -CONFIG_STM32H7_SAVE_CRASHDUMP=y -CONFIG_STM32H7_SDMMC2=y -CONFIG_STM32H7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_SPI1=y -CONFIG_STM32H7_SPI1_DMA=y -CONFIG_STM32H7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32H7_SPI2=y -CONFIG_STM32H7_SPI2_DMA=y -CONFIG_STM32H7_SPI2_DMA_BUFFER=1024 -CONFIG_STM32H7_SPI5=y -CONFIG_STM32H7_SPI6=y -CONFIG_STM32H7_SPI6_DMA=y -CONFIG_STM32H7_SPI6_DMA_BUFFER=1024 -CONFIG_STM32H7_TIM12=y -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_TIM4=y -CONFIG_STM32H7_TIM5=y -CONFIG_STM32H7_UART4=y -CONFIG_STM32H7_UART5=y -CONFIG_STM32H7_UART7=y -CONFIG_STM32H7_UART8=y -CONFIG_STM32H7_USART1=y -CONFIG_STM32H7_USART2=y -CONFIG_STM32H7_USART3=y -CONFIG_STM32H7_USART6=y -CONFIG_STM32H7_USART_BREAKS=y -CONFIG_STM32H7_USART_INVERT=y -CONFIG_STM32H7_USART_SINGLEWIRE=y -CONFIG_STM32H7_USART_SWAP=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART5_IFLOWCONTROL=y -CONFIG_UART5_OFLOWCONTROL=y -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_IFLOWCONTROL=y -CONFIG_UART7_OFLOWCONTROL=y -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_TXBUFSIZE=3000 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_TXBUFSIZE=3000 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_RXBUFSIZE=180 -CONFIG_USART3_SERIAL_CONSOLE=y -CONFIG_USART3_TXBUFSIZE=1500 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 -CONFIG_WATCHDOG=y -CONFIG_WQUEUE_NOTIFIER=y diff --git a/boards/modalai/fc-v2/nuttx-config/scripts/bootloader_script.ld b/boards/modalai/fc-v2/nuttx-config/scripts/bootloader_script.ld deleted file mode 100644 index 5cc69e6..0000000 --- a/boards/modalai/fc-v2/nuttx-config/scripts/bootloader_script.ld +++ /dev/null @@ -1,215 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016, 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The ModalAi FlightCore v2 uses an STM32H756II has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H756II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * The ModalAi FlightCore v2 has a test point on board, the BOOT0 pin is at ground so by - * default, the STM32 will boot to address 0x0800:0000 in FLASH unless the test - * point is pulled to 3.3V.then the boot will be from 0x1FF0:0000 - * - * The STM32H756II also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The bootloader uses the first sector of the flash, which is 128K in length. - */ - -MEMORY -{ - itcm (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - flash (rx) : ORIGIN = 0x08000000, LENGTH = 128K - dtcm1 (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - dtcm2 (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - sram (rwx) : ORIGIN = 0x24000000, LENGTH = 512K - sram1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K - sram2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K - sram3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K - sram4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K - bbram (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/modalai/fc-v2/nuttx-config/scripts/script.ld b/boards/modalai/fc-v2/nuttx-config/scripts/script.ld deleted file mode 100644 index b31de77..0000000 --- a/boards/modalai/fc-v2/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,229 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016, 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The ModalAi FlightCore v2 uses an STM32H756II has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H756II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * The ModalAi FlightCore v2 has a test point on board, the BOOT0 pin is at ground so by - * default, the STM32 will boot to address 0x0800:0000 in FLASH unless the test - * point is pulled to 3.3V.then the boot will be from 0x1FF0:0000 - * - * The STM32H756II also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - FLASH (rx) : ORIGIN = 0x08020000, LENGTH = 1920K - - DTCM1_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - DTCM2_RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */ - SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */ - SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */ - BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) -EXTERN(board_get_manifest) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH - - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - - /* Pad out last section as the STM32H7 Flash write size is 256 bits. 32 bytes */ - . = ALIGN(16); - FILL(0xffff) - . += 16; - } > AXI_SRAM AT > FLASH = 0xffff - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > AXI_SRAM - - /* Emit the the D3 power domain section for locating BDMA data */ - - .sram4_reserve (NOLOAD) : - { - *(.sram4) - . = ALIGN(4); - _sram4_heap_start = ABSOLUTE(.); - } > SRAM4 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/modalai/fc-v2/src/CMakeLists.txt b/boards/modalai/fc-v2/src/CMakeLists.txt deleted file mode 100644 index c84d6f2..0000000 --- a/boards/modalai/fc-v2/src/CMakeLists.txt +++ /dev/null @@ -1,71 +0,0 @@ -############################################################################ -# -# Copyright (c) 2016 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. -# -############################################################################ -if("${PX4_BOARD_LABEL}" STREQUAL "bootloader") - add_library(drivers_board - bootloader_main.c - usb.c - ) - target_link_libraries(drivers_board - PRIVATE - nuttx_arch # sdio - nuttx_drivers # sdio - bootloader - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/bootloader/common) - -else() - add_library(drivers_board - can.c - i2c.cpp - init.c - led.c - mtd.cpp - manifest.c - sdio.c - spi.cpp - timer_config.cpp - usb.c - ) - add_dependencies(drivers_board arch_board_hw_info) - - target_link_libraries(drivers_board - PRIVATE - arch_io_pins - arch_spi - arch_board_hw_info - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer - ) -endif() diff --git a/boards/modalai/fc-v2/src/board_config.h b/boards/modalai/fc-v2/src/board_config.h deleted file mode 100644 index 1d9b338..0000000 --- a/boards/modalai/fc-v2/src/board_config.h +++ /dev/null @@ -1,388 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2016, 2020 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * ModalAI FC v2 internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ - -/* PX4IO connection configuration */ - -#define BOARD_USES_PX4IO_VERSION 2 -#define PX4IO_SERIAL_DEVICE "/dev/ttyS5" -#define PX4IO_SERIAL_TX_GPIO GPIO_USART6_TX -#define PX4IO_SERIAL_RX_GPIO GPIO_USART6_RX -#define PX4IO_SERIAL_BASE STM32_USART6_BASE -#define PX4IO_SERIAL_VECTOR STM32_IRQ_USART6 -#define PX4IO_SERIAL_TX_DMAMAP DMAMAP_USART6_TX -#define PX4IO_SERIAL_RX_DMAMAP DMAMAP_USART6_RX -#define PX4IO_SERIAL_RCC_REG STM32_RCC_APB2ENR -#define PX4IO_SERIAL_RCC_EN RCC_APB2ENR_USART6EN -#define PX4IO_SERIAL_CLOCK STM32_PCLK2_FREQUENCY -#define PX4IO_SERIAL_BITRATE 1500000 /* 1.5Mbps -> max rate for IO */ - -/* Configuration ************************************************************************************/ - - -/* PX4FMU GPIOs ***********************************************************************************/ - -/* Trace Clock and D0-D3 are available on the trace connector - * - * TRACECLK PE2 - Dedicated - Trace Connector Pin 1 - * TRACED0 PE3 - nLED_RED - Trace Connector Pin 3 - * TRACED1 PE4 - nLED_GREEN - Trace Connector Pin 5 - * TRACED2 PE5 - nLED_BLUE - Trace Connector Pin 7 - * TRACED3 PC12 - UART5_TX_TELEM2 - Trace Connector Pin 8 - - */ -#undef TRACE_PINS - -/* LEDs are driven with push open drain to support Anode to 5V or 3.3V or used as TRACE0-2 */ - -#if !defined(TRACE_PINS) -# define GPIO_nLED_RED /* PE3 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN3) -# define GPIO_nLED_GREEN /* PE4 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN4) -# define GPIO_nLED_BLUE /* PE5 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN5) - -# define BOARD_HAS_CONTROL_STATUS_LEDS 1 -# define BOARD_OVERLOAD_LED LED_RED -# define BOARD_ARMED_STATE_LED LED_BLUE - -#else -# if defined(CONFIG_STM32H7_UART5) && (GPIO_UART5_TX == GPIO_UART5_TX_3) -# error Need to disable CONFIG_STM32H7_UART5 for Trace 3 (Retarget to CAN2 if need be) -# endif -#endif - - -/* SPI */ - -#define GPIO_SPI4_MAG_INT /* PD12 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTD|GPIO_PIN12) - -#define GPIO_SYNC /* PE9 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_100MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN9) - -/* I2C busses */ - -/* Devices on the onboard buses. - * - * Note that these are unshifted addresses. - */ -#define PX4_I2C_OBDEV_BMP388 0x76 - -#define GPIO_I2C4_DRDY1_BMP388 /* PG5 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTG|GPIO_PIN5) - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that - * can be used by the Px4 Firmware in the adc driver - */ - -/* ADC defines to be used in sensors.cpp to read from a particular channel */ - -#define ADC1_CH(n) (n) - -/* N.B. there is no offset mapping needed for ADC3 because */ -#define ADC3_CH(n) (n) - -/* We are only use ADC3 for REV/VER. - * ADC3_6V6 and ADC3_3V3 are mapped back to ADC1 - * To do this We are relying on PC2_C, PC3_C being connected to PC2, PC3 - * respectively by the SYSCFG_PMCR default of setting for PC3SO PC2SO PA1SO - * PA0SO of 0. - * - * 0 Analog switch closed (pads are connected through the analog switch) - * - * So ADC3_INP0 is GPIO_ADC123_INP12 - * ADC3_INP1 is GPIO_ADC12_INP13 - */ - -/* Define GPIO pins used as ADC N.B. Channel numbers must match below */ - -#define PX4_ADC_GPIO \ - /* PB1 */ GPIO_ADC12_INP5, \ - /* PC2 */ GPIO_ADC123_INP12, \ - /* PC3 */ GPIO_ADC12_INP13, \ - /* PH3 */ GPIO_ADC3_INP14, \ - /* PH4 */ GPIO_ADC3_INP15 - -/* Define Channel numbers must match above GPIO pin IN(n)*/ -#define ADC_SCALED_V5_CHANNEL /* PB1 */ ADC1_CH(5) -#define ADC_ADC3_6V6_CHANNEL /* PC2 */ ADC3_CH(12) -#define ADC_ADC3_3V3_CHANNEL /* PC3 */ ADC3_CH(13) -#define ADC_HW_VER_SENSE_CHANNEL /* PH3 */ ADC3_CH(14) -#define ADC_HW_REV_SENSE_CHANNEL /* PH4 */ ADC3_CH(15) - -#define ADC_CHANNELS \ - ((1 << ADC_SCALED_V5_CHANNEL) | \ - (1 << ADC_ADC3_6V6_CHANNEL) | \ - (1 << ADC_ADC3_3V3_CHANNEL)) - -/* HW has to large of R termination on ADC todo:change when HW value is chosen */ - -#define HW_REV_VER_ADC_BASE STM32_ADC3_BASE - -#define SYSTEM_ADC_BASE STM32_ADC1_BASE - -/* HW has to large of R termination on ADC todo:change when HW value is chosen */ - -#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f) - -/* HW Version and Revision drive signals Default to 1 to detect */ - -#define BOARD_HAS_HW_VERSIONING - -#define GPIO_HW_VER_REV_DRIVE /* PG0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN0) -#define GPIO_HW_REV_SENSE /* PH4 */ GPIO_ADC3_INP15 -#define GPIO_HW_VER_SENSE /* PH3 */ GPIO_ADC3_INP14 -#define HW_INFO_INIT_PREFIX "V2" -#define V20300 HW_VER_REV(0x3,0x0) - -/* PE6 is nARMED --> FCv2 this goes to TP13 - * The GPIO will be set as input while not armed HW will have external HW Pull UP. - * While armed it shall be configured at a GPIO OUT set LOW - */ -#define GPIO_nARMED_INIT /* PE6 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN6) -#define GPIO_nARMED /* PE6 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN6) - -#define BOARD_INDICATE_ARMED_STATE(enabled) px4_arch_configgpio((enabled) ? GPIO_nARMED : GPIO_nARMED_INIT) - -/* PWM - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 8 - - -/* Power supply control and monitoring GPIOs */ -#define GPIO_nVDD_USB_VALID /* PF13 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTF|GPIO_PIN13) /* Low for USB power, High for DC power */ - -#define GPIO_VDD_3V3_SPEKTRUM_POWER_EN /* PH2 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN2) - -/* Spare GPIO */ - -#define CAN1_SILENT /* PD15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN15) - -/* Define True logic Power Control in arch agnostic form */ - -#define VDD_3V3_SPEKTRUM_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SPEKTRUM_POWER_EN, (on_true)) -#define READ_VDD_3V3_SPEKTRUM_POWER_EN() px4_arch_gpioread(GPIO_VDD_3V3_SPEKTRUM_POWER_EN) - -/* Future Use - IMU FSYNC */ - -#define IMU_FYSNC_TIMER 14 /* Timer 14 */ -#define IMU_FYSNC_CHANNEL 1 /* PF9 GPIO_TIM14_CH1OUT_2 */ - -#define GPIO_IMU_FYSNC_1 /* PF9 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTF|GPIO_PIN9) - -#define GPIO_IMU_FYSNC_IDLE GPIO_IMU_FYSNC_1 -#define GPIO_IMU_FYSNC GPIO_TIM14_CH1OUT_2 - -/* USB OTG FS - * - * PA9 OTG_FS_VBUS VBUS sensing - */ -#define GPIO_OTGFS_VBUS /* PA9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 8 /* use timer8 for the HRT */ -#define HRT_TIMER_CHANNEL 3 /* use capture/compare channel 3 */ - -//#define HRT_PPM_CHANNEL /* T8C1 */ 1 /* use capture/compare channel 1 */ -//#define GPIO_PPM_IN /* PI5 T8C1 */ GPIO_TIM8_CH1IN_2 - -/* RC Serial port */ - -#define RC_SERIAL_PORT "/dev/ttyS5" - -/* Input Capture Channels. */ -#define INPUT_CAP1_TIMER 1 -#define INPUT_CAP1_CHANNEL /* T1C2 */ 2 -#define GPIO_INPUT_CAP1 /* PE11 */ GPIO_TIM1_CH2IN - -/* PWM input driver. Use FMU AUX5 pins attached to timer4 channel 2 */ -#define PWMIN_TIMER 4 -#define PWMIN_TIMER_CHANNEL /* T4C2 */ 2 -#define GPIO_PWM_IN /* PD13 */ GPIO_TIM4_CH2IN_2 - -/* Power switch controls ******************************************************/ - -#define SPEKTRUM_POWER(_on_true) VDD_3V3_SPEKTRUM_POWER_EN(_on_true) - -/* - * ModalAI FC v2 has NO separate RC_IN - * - * SPEKTRUM_RX (it's TX or RX in Bind) on UART6 PC7 - * Inversion is possible in the UART - */ - -#define SPEKTRUM_RX_AS_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN7) -#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(SPEKTRUM_RX_AS_OUT) -#define SPEKTRUM_RX_AS_UART() /* Can be left as uart */ -#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(SPEKTRUM_RX_AS_OUT, (_one_true)) - -#define SDIO_SLOTNO 0 /* Only one slot */ -#define SDIO_MINOR 0 - -/* SD card bringup does not work if performed on the IDLE thread because it - * will cause waiting. Use either: - * - * CONFIG_BOARDCTL=y, OR - * CONFIG_BOARD_INITIALIZE=y && CONFIG_BOARD_INITTHREAD=y - */ - -#if defined(CONFIG_BOARD_INITIALIZE) && !defined(CONFIG_BOARDCTL) && \ - !defined(CONFIG_BOARD_INITTHREAD) -# warning SDIO initialization cannot be perfomed on the IDLE thread -#endif - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID)) - -/* ModalAI FC v2 never powers off the Servo rail */ - -#define BOARD_ADC_SERVO_VALID (1) - -#if !defined(BOARD_HAS_LTC44XX_VALIDS) || BOARD_HAS_LTC44XX_VALIDS == 0 -# define BOARD_ADC_BRICK1_VALID (1) -# define BOARD_ADC_BRICK2_VALID (0) -#elif BOARD_HAS_LTC44XX_VALIDS == 1 -# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -# define BOARD_ADC_BRICK2_VALID (0) -#elif BOARD_HAS_LTC44XX_VALIDS == 2 -# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -# define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID)) -#elif BOARD_HAS_LTC44XX_VALIDS == 3 -# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -# define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID)) -# define BOARD_ADC_BRICK3_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK3_VALID)) -#elif BOARD_HAS_LTC44XX_VALIDS == 4 -# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -# define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID)) -# define BOARD_ADC_BRICK3_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK3_VALID)) -# define BOARD_ADC_BRICK4_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK4_VALID)) -#else -# error Unsupported BOARD_HAS_LTC44XX_VALIDS value -#endif - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ - -#define BOARD_HAS_ON_RESET 1 - -#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, \ - CAN1_SILENT, \ - GPIO_SYNC, \ - GPIO_IMU_FYSNC_IDLE, \ - GPIO_IMU_FYSNC, \ - } - -#define BOARD_ENABLE_CONSOLE_BUFFER - -#define BOARD_NUM_IO_TIMERS 5 - -// J1 / TELEM1 / USART7 -#define MODAL_IO_DEFAULT_PORT "/dev/ttyS6" - -__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 - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/modalai/fc-v2/src/bootloader_main.c b/boards/modalai/fc-v2/src/bootloader_main.c deleted file mode 100644 index cb84261..0000000 --- a/boards/modalai/fc-v2/src/bootloader_main.c +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019 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. - * - ****************************************************************************/ - -/** - * @file bootloader_main.c - * - * FMU-specific early startup code for bootloader -*/ - -#include "board_config.h" -#include "bl.h" - -#include -#include -#include -#include -#include -#include "arm_internal.h" -#include - -extern int sercon_main(int c, char **argv); - -__EXPORT void board_on_reset(int status) {} - -__EXPORT void stm32_boardinitialize(void) -{ - /* configure USB interfaces */ - stm32_usbinitialize(); -} - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - return 0; -} - -void board_late_initialize(void) -{ - sercon_main(0, NULL); -} - -extern void sys_tick_handler(void); -void board_timerhook(void) -{ - sys_tick_handler(); -} diff --git a/boards/modalai/fc-v2/src/can.c b/boards/modalai/fc-v2/src/can.c deleted file mode 100644 index f65a195..0000000 --- a/boards/modalai/fc-v2/src/can.c +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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. - * - ****************************************************************************/ - -/** - * @file px4fmu_can.c - * - * Board-specific CAN functions. - */ - -#ifdef CONFIG_CAN - -#include -#include - -#include -#include - -#include "chip.h" -#include "arm_internal.h" - -#include "chip.h" -#include "stm32_can.h" -#include "board_config.h" - -#ifdef CONFIG_CAN - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) -# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." -# undef CONFIG_STM32_CAN2 -#endif - -#ifdef CONFIG_STM32_CAN1 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); - -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} - -#endif - -#endif /* CONFIG_CAN */ diff --git a/boards/modalai/fc-v2/src/hw_config.h b/boards/modalai/fc-v2/src/hw_config.h deleted file mode 100644 index 474a55c..0000000 --- a/boards/modalai/fc-v2/src/hw_config.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * hw_config.h - * - * Created on: May 17, 2015 - * Author: david_s5 - */ - -#ifndef HW_CONFIG_H_ -#define HW_CONFIG_H_ - -/**************************************************************************** - * 10-8--2016: - * To simplify the ripple effect on the tools, we will be using - * /dev/serial/by-id/PX4 to locate PX4 devices. Therefore - * moving forward all Bootloaders must contain the prefix "PX4 BL " - * in the USBDEVICESTRING - * This Change will be made in an upcoming BL release - ****************************************************************************/ -/* - * Define usage to configure a bootloader - * - * - * Constant example Usage - * APP_LOAD_ADDRESS 0x08004000 - The address in Linker Script, where the app fw is org-ed - * BOOTLOADER_DELAY 5000 - Ms to wait while under USB pwr or bootloader request - * BOARD_FMUV2 - * INTERFACE_USB 1 - (Optional) Scan and use the USB interface for bootloading - * INTERFACE_USART 1 - (Optional) Scan and use the Serial interface for bootloading - * USBDEVICESTRING "PX4 BL FMU v2.x" - USB id string - * USBPRODUCTID 0x0011 - PID Should match defconfig - * BOOT_DELAY_ADDRESS 0x000001a0 - (Optional) From the linker script from Linker Script to get a custom - * delay provided by an APP FW - * BOARD_TYPE 9 - Must match .prototype boad_id - * _FLASH_KBYTES (*(uint16_t *)0x1fff7a22) - Run time flash size detection - * BOARD_FLASH_SECTORS ((_FLASH_KBYTES == 0x400) ? 11 : 23) - Run time determine the physical last sector - * BOARD_FLASH_SECTORS 11 - Hard coded zero based last sector - * BOARD_FLASH_SIZE (_FLASH_KBYTES*1024)- Total Flash size of device, determined at run time. - * (1024 * 1024) - Hard coded Total Flash of device - The bootloader and app reserved will be deducted - * programmatically - * - * BOARD_FIRST_FLASH_SECTOR_TO_ERASE 2 - Optional sectors index in the flash_sectors table (F4 only), to begin erasing. - * This is to allow sectors to be reserved for app fw usage. That will NOT be erased - * during a FW upgrade. - * The default is 0, and selects the first sector to be erased, as the 0th entry in the - * flash_sectors table. Which is the second physical sector of FLASH in the device. - * The first physical sector of FLASH is used by the bootloader, and is not defined - * in the table. - * - * APP_RESERVATION_SIZE (BOARD_FIRST_FLASH_SECTOR_TO_ERASE * 16 * 1024) - Number of bytes reserved by the APP FW. This number plus - * BOOTLOADER_RESERVATION_SIZE will be deducted from - * BOARD_FLASH_SIZE to determine the size of the App FW - * and hence the address space of FLASH to erase and program. - * USBMFGSTRING "PX4 AP" - Optional USB MFG string (default is '3D Robotics' if not defined.) - * SERIAL_BREAK_DETECT_DISABLED - Optional prevent break selection on Serial port from entering or staying in BL - * - * * Other defines are somewhat self explanatory. - */ - -/* Boot device selection list*/ -#define USB0_DEV 0x01 -#define SERIAL0_DEV 0x02 -#define SERIAL1_DEV 0x04 - -#define APP_LOAD_ADDRESS 0x08020000 -#define BOOTLOADER_DELAY 5000 -#define INTERFACE_USB 1 -#define INTERFACE_USB_CONFIG "/dev/ttyACM0" -#define BOARD_VBUS MK_GPIO_INPUT(GPIO_OTGFS_VBUS) - -//#define USE_VBUS_PULL_DOWN -#define INTERFACE_USART 1 -#define INTERFACE_USART_CONFIG "/dev/ttyS0,115200" -#define BOOT_DELAY_ADDRESS 0x000001a0 -#define BOARD_TYPE 41776 -#define _FLASH_KBYTES (*(uint32_t *)0x1FF1E880) -#define BOARD_FLASH_SECTORS (15) -#define BOARD_FLASH_SIZE (_FLASH_KBYTES * 1024) - -#define OSC_FREQ 16 - -#define BOARD_PIN_LED_ACTIVITY GPIO_nLED_BLUE // BLUE -#define BOARD_PIN_LED_BOOTLOADER GPIO_nLED_GREEN // GREEN -#define BOARD_LED_ON 0 -#define BOARD_LED_OFF 1 - -#define SERIAL_BREAK_DETECT_DISABLED 1 - -/* - * Uncommenting this allows to force the bootloader through - * a PWM output pin. As this can accidentally initialize - * an ESC prematurely, it is not recommended. This feature - * has not been used and hence defaults now to off. - * - * # define BOARD_FORCE_BL_PIN_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN14) - * # define BOARD_FORCE_BL_PIN_IN (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN11) - * - * # define BOARD_POWER_PIN_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN4) - * # define BOARD_POWER_ON 1 - * # define BOARD_POWER_OFF 0 - * # undef BOARD_POWER_PIN_RELEASE // Leave pin enabling Power - un comment to release (disable power) - * -*/ - -#if !defined(ARCH_SN_MAX_LENGTH) -# define ARCH_SN_MAX_LENGTH 12 -#endif - -#if !defined(APP_RESERVATION_SIZE) -# define APP_RESERVATION_SIZE 0 -#endif - -#if !defined(BOARD_FIRST_FLASH_SECTOR_TO_ERASE) -# define BOARD_FIRST_FLASH_SECTOR_TO_ERASE 1 -#endif - -#if !defined(USB_DATA_ALIGN) -# define USB_DATA_ALIGN -#endif - -#ifndef BOOT_DEVICES_SELECTION -# define BOOT_DEVICES_SELECTION USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif - -#ifndef BOOT_DEVICES_FILTER_ONUSB -# define BOOT_DEVICES_FILTER_ONUSB USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif - -#endif /* HW_CONFIG_H_ */ diff --git a/boards/modalai/fc-v2/src/i2c.cpp b/boards/modalai/fc-v2/src/i2c.cpp deleted file mode 100644 index 56f17e3..0000000 --- a/boards/modalai/fc-v2/src/i2c.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), // External GPS/Mag, suggested - initI2CBusExternal(2), // External Aviator - initI2CBusExternal(3), // External VOXL PM - initI2CBusInternal(4), // Internal Barometer, Internal Mag -}; diff --git a/boards/modalai/fc-v2/src/init.c b/boards/modalai/fc-v2/src/init.c deleted file mode 100644 index dbc6ec4..0000000 --- a/boards/modalai/fc-v2/src/init.c +++ /dev/null @@ -1,264 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-2021 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * PX4FMU-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include "board_config.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* Configuration ************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - /* set the peripheral rails off */ - board_control_spi_sensors_power(false, 0xffff); - - bool last = READ_VDD_3V3_SPEKTRUM_POWER_EN(); - /* Keep Spektum on to discharge rail*/ - VDD_3V3_SPEKTRUM_POWER_EN(false); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ - VDD_3V3_SPEKTRUM_POWER_EN(last); - board_control_spi_sensors_power(true, 0xffff); - -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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 (we can do this here as long as we only have a single SPI hw config version - - * otherwise we need to move this after board_determine_hw_info()) */ - _Static_assert(BOARD_NUM_SPI_CFG_HW_VERSIONS == 1, "Need to move the SPI initialization for multi-version support"); - - stm32_spiinitialize(); - - /* configure USB interfaces */ - - stm32_usbinitialize(); - -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Power on Interfaces */ - board_spi_reset(10, 0xffff); - VDD_3V3_SPEKTRUM_POWER_EN(true); - - /* Need hrt running before using the ADC */ - - px4_platform_init(); - - - if (OK == board_determine_hw_info()) { - syslog(LOG_INFO, "[boot] Rev 0x%1x : Ver 0x%1x %s\n", board_get_hw_revision(), board_get_hw_version(), - board_get_hw_type_name()); - - } else { - syslog(LOG_ERR, "[boot] Failed to read HW revision and version\n"); - } - - /* configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_on(LED_GREEN); // Indicate Power. - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - -#ifdef CONFIG_MMCSD - int ret = stm32_sdio_initialize(); - - if (ret != OK) { - led_on(LED_RED); - } - -#endif /* CONFIG_MMCSD */ - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/modalai/fc-v2/src/led.c b/boards/modalai/fc-v2/src/led.c deleted file mode 100644 index bff4b09..0000000 --- a/boards/modalai/fc-v2/src/led.c +++ /dev/null @@ -1,235 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013 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. - * - ****************************************************************************/ - -/** - * @file px4fmu2_led.c - * - * PX4FMU LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -#ifdef CONFIG_ARCH_LEDS -static bool nuttx_owns_leds = true; -// B R S G -// 0 1 2 3 -static const uint8_t xlatpx4[] = {1, 2, 4, 0}; -# define xlat(p) xlatpx4[(p)] -static uint32_t g_ledmap[] = { - GPIO_nLED_GREEN, // Indexed by BOARD_LED_GREEN - GPIO_nLED_BLUE, // Indexed by BOARD_LED_BLUE - GPIO_nLED_RED, // Indexed by BOARD_LED_RED - GPIO_nSAFETY_SWITCH_LED_OUT, // Indexed by LED_SAFETY by xlatpx4 -}; - -#else - -# define xlat(p) (p) -static uint32_t g_ledmap[] = { - GPIO_nLED_BLUE, // Indexed by LED_BLUE - GPIO_nLED_RED, // Indexed by LED_RED, LED_AMBER - 0, // Indexed by LED_SAFETY (defaulted to an input) - GPIO_nLED_GREEN, // Indexed by LED_GREEN -}; - -#endif - -__EXPORT void led_init(void) -{ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - if (g_ledmap[l] != 0) { - stm32_configgpio(g_ledmap[l]); - } - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - - if (g_ledmap[led] != 0) { - stm32_gpiowrite(g_ledmap[led], !state); - } -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - if (g_ledmap[led] != 0) { - return !stm32_gpioread(g_ledmap[led]); - } - - return false; -} - -__EXPORT void led_on(int led) -{ - phy_set_led(xlat(led), true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(xlat(led), false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(xlat(led), !phy_get_led(xlat(led))); -} - -#ifdef CONFIG_ARCH_LEDS -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_autoled_initialize - ****************************************************************************/ - -void board_autoled_initialize(void) -{ - led_init(); -} - -/**************************************************************************** - * Name: board_autoled_on - ****************************************************************************/ - -void board_autoled_on(int led) -{ - if (!nuttx_owns_leds) { - return; - } - - switch (led) { - default: - break; - - case LED_HEAPALLOCATE: - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_IRQSENABLED: - phy_set_led(BOARD_LED_BLUE, false); - phy_set_led(BOARD_LED_GREEN, true); - break; - - case LED_STACKCREATED: - phy_set_led(BOARD_LED_GREEN, true); - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_INIRQ: - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_SIGNAL: - phy_set_led(BOARD_LED_GREEN, true); - break; - - case LED_ASSERTION: - phy_set_led(BOARD_LED_RED, true); - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_PANIC: - phy_set_led(BOARD_LED_RED, true); - break; - - case LED_IDLE : /* IDLE */ - phy_set_led(BOARD_LED_RED, true); - break; - } -} - -/**************************************************************************** - * Name: board_autoled_off - ****************************************************************************/ - -void board_autoled_off(int led) -{ - if (!nuttx_owns_leds) { - return; - } - - switch (led) { - default: - break; - - case LED_SIGNAL: - phy_set_led(BOARD_LED_GREEN, false); - break; - - case LED_INIRQ: - phy_set_led(BOARD_LED_BLUE, false); - break; - - case LED_ASSERTION: - phy_set_led(BOARD_LED_RED, false); - phy_set_led(BOARD_LED_BLUE, false); - break; - - case LED_PANIC: - phy_set_led(BOARD_LED_RED, false); - break; - - case LED_IDLE : /* IDLE */ - phy_set_led(BOARD_LED_RED, false); - break; - } -} - -#endif /* CONFIG_ARCH_LEDS */ diff --git a/boards/modalai/fc-v2/src/manifest.c b/boards/modalai/fc-v2/src/manifest.c deleted file mode 100644 index 485e5ed..0000000 --- a/boards/modalai/fc-v2/src/manifest.c +++ /dev/null @@ -1,132 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2018 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. - * - ****************************************************************************/ - -/** - * @file manifest.c - * - * This module supplies the interface to the manifest of hardware that is - * optional and dependent on the HW REV and HW VER IDs - * - * The manifest allows the system to know whether a hardware option - * say for example the PX4IO is an no-pop option vs it is broken. - * - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include - -#include "systemlib/px4_macros.h" - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -typedef struct { - uint32_t hw_ver_rev; /* the version and revision */ - const px4_hw_mft_item_t *mft; /* The first entry */ - uint32_t entries; /* the lenght of the list */ -} px4_hw_mft_list_entry_t; - -typedef px4_hw_mft_list_entry_t *px4_hw_mft_list_entry; -#define px4_hw_mft_list_uninitialized (px4_hw_mft_list_entry) -1 - -static const px4_hw_mft_item_t device_unsupported = {0, 0, 0}; - -// List of components on a specific board configuration -// The index of those components is given by the enum (px4_hw_mft_item_id_t) -// declared in board_common.h -// M0079 -static const px4_hw_mft_item_t hw_mft_list_fc0200[] = { - { - .present = 0, - .mandatory = 0, - .connection = px4_hw_con_unknown, - }, -}; - -static px4_hw_mft_list_entry_t mft_lists[] = { - {V20300, hw_mft_list_fc0200, arraySize(hw_mft_list_fc0200)}, -}; - -/************************************************************************************ - * Name: board_query_manifest - * - * Description: - * Optional returns manifest item. - * - * Input Parameters: - * manifest_id - the ID for the manifest item to retrieve - * - * Returned Value: - * 0 - item is not in manifest => assume legacy operations - * pointer to a manifest item - * - ************************************************************************************/ - -__EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) -{ - static px4_hw_mft_list_entry boards_manifest = px4_hw_mft_list_uninitialized; - - if (boards_manifest == px4_hw_mft_list_uninitialized) { - uint32_t ver_rev = board_get_hw_version() << 16; - ver_rev |= board_get_hw_revision(); - - for (unsigned i = 0; i < arraySize(mft_lists); i++) { - if (mft_lists[i].hw_ver_rev == ver_rev) { - boards_manifest = &mft_lists[i]; - break; - } - } - - if (boards_manifest == px4_hw_mft_list_uninitialized) { - syslog(LOG_ERR, "[boot] Board %08" PRIx32 " is not supported!\n", ver_rev); - } - } - - px4_hw_mft_item rv = &device_unsupported; - - if (boards_manifest != px4_hw_mft_list_uninitialized && - id < boards_manifest->entries) { - rv = &boards_manifest->mft[id]; - } - - return rv; -} diff --git a/boards/modalai/fc-v2/src/mtd.cpp b/boards/modalai/fc-v2/src/mtd.cpp deleted file mode 100644 index 644b965..0000000 --- a/boards/modalai/fc-v2/src/mtd.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include -// KiB BS nB -static const px4_mft_device_t spi5 = { // FM25V02A on FMUM 32K 512 X 64 - .bus_type = px4_mft_device_t::SPI, - .devid = SPIDEV_FLASH(0) -}; - -static const px4_mtd_entry_t fmum_fram = { - .device = &spi5, - .npart = 2, - .partd = { - { - .type = MTD_PARAMETERS, - .path = "/fs/mtd_params", - .nblocks = 32 - }, - { - .type = MTD_WAYPOINTS, - .path = "/fs/mtd_waypoints", - .nblocks = 32 - - } - }, -}; - -static const px4_mtd_manifest_t board_mtd_config = { - .nconfigs = 1, - .entries = { - &fmum_fram - } -}; - -static const px4_mft_entry_s mtd_mft = { - .type = MTD, - .pmft = (void *) &board_mtd_config, -}; - -static const px4_mft_s mft = { - .nmft = 1, - .mfts = { - &mtd_mft - } -}; - -const px4_mft_s *board_get_manifest(void) -{ - return &mft; -} diff --git a/boards/modalai/fc-v2/src/sdio.c b/boards/modalai/fc-v2/src/sdio.c deleted file mode 100644 index 869d757..0000000 --- a/boards/modalai/fc-v2/src/sdio.c +++ /dev/null @@ -1,177 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include "chip.h" -#include "board_config.h" -#include "stm32_gpio.h" -#include "stm32_sdmmc.h" - -#ifdef CONFIG_MMCSD - - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Card detections requires card support and a card detection GPIO */ - -#define HAVE_NCD 1 -#if !defined(GPIO_SDMMC1_NCD) -# undef HAVE_NCD -#endif - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -static FAR struct sdio_dev_s *sdio_dev; -#ifdef HAVE_NCD -static bool g_sd_inserted = 0xff; /* Impossible value */ -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_ncd_interrupt - * - * Description: - * Card detect interrupt handler. - * - ****************************************************************************/ - -#ifdef HAVE_NCD -static int stm32_ncd_interrupt(int irq, FAR void *context) -{ - bool present; - - present = !stm32_gpioread(GPIO_SDMMC1_NCD); - - if (sdio_dev && present != g_sd_inserted) { - sdio_mediachange(sdio_dev, present); - g_sd_inserted = present; - } - - return OK; -} -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_sdio_initialize - * - * Description: - * Initialize SDIO-based MMC/SD card support - * - ****************************************************************************/ - -int stm32_sdio_initialize(void) -{ - int ret; - -#ifdef HAVE_NCD - /* Card detect */ - - bool cd_status; - - /* Configure the card detect GPIO */ - - stm32_configgpio(GPIO_SDMMC1_NCD); - - /* Register an interrupt handler for the card detect pin */ - - stm32_gpiosetevent(GPIO_SDMMC1_NCD, true, true, true, stm32_ncd_interrupt); -#endif - - /* Mount the SDIO-based MMC/SD block driver */ - /* First, get an instance of the SDIO interface */ - - finfo("Initializing SDIO slot %d\n", SDIO_SLOTNO); - - sdio_dev = sdio_initialize(SDIO_SLOTNO); - - if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", SDIO_SLOTNO); - return -ENODEV; - } - - /* Now bind the SDIO interface to the MMC/SD driver */ - - finfo("Bind SDIO to the MMC/SD driver, minor=%d\n", SDIO_MINOR); - - ret = mmcsd_slotinitialize(SDIO_MINOR, sdio_dev); - - if (ret != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); - return ret; - } - - finfo("Successfully bound SDIO to the MMC/SD driver\n"); - -#ifdef HAVE_NCD - /* Use SD card detect pin to check if a card is g_sd_inserted */ - - cd_status = !stm32_gpioread(GPIO_SDMMC1_NCD); - finfo("Card detect : %d\n", cd_status); - - sdio_mediachange(sdio_dev, cd_status); -#else - /* Assume that the SD card is inserted. What choice do we have? */ - - sdio_mediachange(sdio_dev, true); -#endif - - return OK; -} - -#endif /* CONFIG_MMCSD */ diff --git a/boards/modalai/fc-v2/src/spi.cpp b/boards/modalai/fc-v2/src/spi.cpp deleted file mode 100644 index 8a9541f..0000000 --- a/boards/modalai/fc-v2/src/spi.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}), - }), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortA, GPIO::Pin10}), - }), - initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7}) - }), - initSPIBusExternal(SPI::Bus::SPI6, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/modalai/fc-v2/src/timer_config.cpp b/boards/modalai/fc-v2/src/timer_config.cpp deleted file mode 100644 index 6df6c8d..0000000 --- a/boards/modalai/fc-v2/src/timer_config.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 - -/* Timer allocation - * - * TIM5_CH4 T FMU_CH1 - * TIM5_CH3 T FMU_CH2 - * TIM5_CH2 T FMU_CH3 - * TIM5_CH1 T FMU_CH4 - * - * TIM4_CH2 T FMU_CH5 - * TIM4_CH3 T FMU_CH6 - * - * TIM12_CH1 T FMU_CH7 - * TIM12_CH2 T FMU_CH8 - * - */ - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer5, DMA{DMA::Index1}), - initIOTimer(Timer::Timer4, DMA{DMA::Index1}), - initIOTimer(Timer::Timer12), - initIOTimer(Timer::Timer1), - initIOTimer(Timer::Timer2), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel4}, {GPIO::PortI, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel3}, {GPIO::PortH, GPIO::Pin12}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel2}, {GPIO::PortH, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel1}, {GPIO::PortH, GPIO::Pin10}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer12, Timer::Channel1}, {GPIO::PortH, GPIO::Pin6}), - initIOTimerChannel(io_timers, {Timer::Timer12, Timer::Channel2}, {GPIO::PortH, GPIO::Pin9}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/modalai/fc-v2/src/usb.c b/boards/modalai/fc-v2/src/usb.c deleted file mode 100644 index 6d42476..0000000 --- a/boards/modalai/fc-v2/src/usb.c +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016 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. - * - ****************************************************************************/ - -/** - * @file px4fmu_usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#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_STM32H7_OTGFS - stm32_configgpio(GPIO_OTGFS_VBUS); -#endif -} - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/modalai/voxl2-io/default.px4board b/boards/modalai/voxl2-io/default.px4board deleted file mode 100644 index 9e69a1e..0000000 --- a/boards/modalai/voxl2-io/default.px4board +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m3" -CONFIG_BOARD_ROMFSROOT="" -CONFIG_BOARD_CONSTRAINED_FLASH=y -CONFIG_MODULES_PX4IOFIRMWARE=y diff --git a/boards/modalai/voxl2-io/firmware.prototype b/boards/modalai/voxl2-io/firmware.prototype deleted file mode 100644 index 8166531..0000000 --- a/boards/modalai/voxl2-io/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 41777, - "magic": "PX4FWv2", - "description": "Firmware for the voxl2-io board", - "image": "", - "build_time": 0, - "summary": "voxl2io", - "version": "2.0", - "image_size": 0, - "image_maxsize": 61440, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/modalai/voxl2-io/nuttx-config/include/board.h b/boards/modalai/voxl2-io/nuttx-config/include/board.h deleted file mode 100644 index 936360a..0000000 --- a/boards/modalai/voxl2-io/nuttx-config/include/board.h +++ /dev/null @@ -1,141 +0,0 @@ -/************************************************************************************ - * nuttx-configs/px4io/include/board.h - * include/arch/board/board.h - * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * Copyright (C) 2012 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 NuttX 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. - * - ************************************************************************************/ - -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include -#ifndef __ASSEMBLY__ -# include -#endif -#include - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ - -/* On-board crystal frequency is 24MHz (HSE) */ - -#define STM32_BOARD_XTAL 16000000ul - -/* Use the HSE output as the system clock */ - -#define STM32_SYSCLK_SW RCC_CFGR_SW_HSE -#define STM32_SYSCLK_SWS RCC_CFGR_SWS_HSE -#define STM32_SYSCLK_FREQUENCY STM32_BOARD_XTAL - -/* AHB clock (HCLK) is SYSCLK (24MHz) */ - -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB2 clock (PCLK2) is HCLK (24MHz) */ - -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLK -#define STM32_PCLK2_FREQUENCY STM32_HCLK_FREQUENCY -#define STM32_APB2_CLKIN (STM32_PCLK2_FREQUENCY) /* Timers 2-4 */ - -/* APB2 timer 1 will receive PCLK2. */ - -#define STM32_APB2_TIM1_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM15_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM16_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM17_CLKIN (STM32_PCLK2_FREQUENCY) - -/* APB1 clock (PCLK1) is HCLK (24MHz) */ - -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLK -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY) - -/* All timers run off PCLK */ - - -#define STM32_APB1_TIM2_CLKIN (STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (STM32_PCLK1_FREQUENCY) - -/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx - * otherwise frequency is 2xAPBx. - * Note: TIM1, 15-17 are on APB2, others on APB1 - */ - -#define BOARD_TIM1_FREQUENCY STM32_APB2_TIM1_CLKIN -#define BOARD_TIM2_FREQUENCY STM32_APB1_TIM2_CLKIN -#define BOARD_TIM3_FREQUENCY STM32_APB1_TIM3_CLKIN -#define BOARD_TIM4_FREQUENCY STM32_APB1_TIM4_CLKIN -#define BOARD_TIM5_FREQUENCY STM32_APB1_TIM5_CLKIN -#define BOARD_TIM6_FREQUENCY STM32_APB1_TIM6_CLKIN -#define BOARD_TIM7_FREQUENCY STM32_APB1_TIM7_CLKIN -#define BOARD_TIM12_FREQUENCY STM32_APB1_TIM12_CLKIN -#define BOARD_TIM13_FREQUENCY STM32_APB1_TIM13_CLKIN -#define BOARD_TIM14_FREQUENCY STM32_APB1_TIM14_CLKIN -#define BOARD_TIM15_FREQUENCY STM32_APB2_TIM15_CLKIN -#define BOARD_TIM16_FREQUENCY STM32_APB2_TIM16_CLKIN -#define BOARD_TIM17_FREQUENCY STM32_APB2_TIM17_CLKIN - - -/* - * Some of the USART pins are not available; override the GPIO - * definitions with an invalid pin configuration. - */ -#undef GPIO_USART2_CTS -#define GPIO_USART2_CTS 0xffffffff -#undef GPIO_USART2_RTS -#define GPIO_USART2_RTS 0xffffffff -#undef GPIO_USART2_CK -#define GPIO_USART2_CK 0xffffffff -#undef GPIO_USART3_CK -#define GPIO_USART3_CK 0xffffffff -#undef GPIO_USART3_CTS -#define GPIO_USART3_CTS 0xffffffff -#undef GPIO_USART3_RTS -#define GPIO_USART3_RTS 0xffffffff - -#endif /* __ARCH_BOARD_BOARD_H */ diff --git a/boards/modalai/voxl2-io/nuttx-config/nsh/defconfig b/boards/modalai/voxl2-io/nuttx-config/nsh/defconfig deleted file mode 100644 index 2fec96f..0000000 --- a/boards/modalai/voxl2-io/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,61 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_NULL is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/modalai/voxl2-io/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F100C8=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARD_LOOPSPERMSEC=2000 -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DISABLE_MOUNTPOINT=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=316 -CONFIG_INIT_ENTRYPOINT="user_start" -CONFIG_INIT_STACKSIZE=1100 -CONFIG_MM_FILL_ALLOCATIONS=y -CONFIG_MM_SMALL=y -CONFIG_NAME_MAX=12 -CONFIG_PREALLOC_TIMERS=0 -CONFIG_RAM_SIZE=8192 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_DISABLE_BUFFERING=y -CONFIG_STM32_ADC1=y -CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y -CONFIG_STM32_DMA1=y -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_USART1=y -CONFIG_STM32_USART2=y -CONFIG_STM32_USART3=y -CONFIG_STM32_USART_SINGLEWIRE=y -CONFIG_TASK_NAME_SIZE=0 -CONFIG_USART1_RXBUFSIZE=64 -CONFIG_USART1_RXDMA=y -CONFIG_USART1_SERIAL_CONSOLE=y -CONFIG_USART1_TXBUFSIZE=32 -CONFIG_USART2_RXBUFSIZE=64 -CONFIG_USART2_TXBUFSIZE=64 -CONFIG_USART3_RXBUFSIZE=64 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=64 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/modalai/voxl2-io/nuttx-config/scripts/script.ld b/boards/modalai/voxl2-io/nuttx-config/scripts/script.ld deleted file mode 100644 index c842153..0000000 --- a/boards/modalai/voxl2-io/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,131 +0,0 @@ -/**************************************************************************** - * configs/px4io-v2/scripts/ld.script - * - * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F100C8 has 64Kb of FLASH beginning at address 0x0800:0000 and - * 8Kb of SRAM beginning at address 0x2000:0000. When booting from FLASH, - * FLASH memory is aliased to address 0x0000:0000 where the code expects to - * begin execution by jumping to the entry point in the 0x0800:0000 address - * range. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08001000, LENGTH = 60K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 8K -} - -OUTPUT_ARCH(arm) -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - /* The STM32F100CB has 8Kb of SRAM beginning at the following address */ - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - . = ALIGN(4); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/modalai/voxl2-io/src/CMakeLists.txt b/boards/modalai/voxl2-io/src/CMakeLists.txt deleted file mode 100644 index 5cef2f6..0000000 --- a/boards/modalai/voxl2-io/src/CMakeLists.txt +++ /dev/null @@ -1,42 +0,0 @@ -############################################################################ -# -# Copyright (c) 2015 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. -# -############################################################################ - -add_library(drivers_board - init.c - timer_config.cpp -) - -target_link_libraries(drivers_board - PRIVATE - nuttx_arch -) diff --git a/boards/modalai/voxl2-io/src/board_config.h b/boards/modalai/voxl2-io/src/board_config.h deleted file mode 100644 index d69aee5..0000000 --- a/boards/modalai/voxl2-io/src/board_config.h +++ /dev/null @@ -1,157 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013, 2014 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * PX4IOV2 internal definitions - */ - -#pragma once - -/****************************************************************************** - * Included Files - ******************************************************************************/ - -#include -#include -#include - -/****************************************************************************** - * Definitions - ******************************************************************************/ -/* Configuration **************************************************************/ - -/****************************************************************************** - * Serial - ******************************************************************************/ -#define PX4FMU_SERIAL_BASE STM32_USART2_BASE -#define PX4FMU_SERIAL_VECTOR STM32_IRQ_USART2 -#define PX4FMU_SERIAL_TX_GPIO GPIO_USART2_TX -#define PX4FMU_SERIAL_RX_GPIO GPIO_USART2_RX -#define PX4FMU_SERIAL_TX_DMA DMACHAN_USART2_TX -#define PX4FMU_SERIAL_RX_DMA DMACHAN_USART2_RX -#define PX4FMU_SERIAL_CLOCK STM32_PCLK1_FREQUENCY -#define PX4FMU_SERIAL_BITRATE 921600 - -/****************************************************************************** - * GPIOS - ******************************************************************************/ - -/* LEDS **********************************************************************/ - -#define GPIO_LED_BLUE (GPIO_OUTPUT|GPIO_CNF_OUTOD|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN14) -#define GPIO_LED_AMBER (GPIO_OUTPUT|GPIO_CNF_OUTOD|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN15) -#define GPIO_LED_SAFETY (GPIO_OUTPUT|GPIO_CNF_OUTOD|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN13) - -#define LED_BLUE(on_true) stm32_gpiowrite(GPIO_LED_BLUE, !(on_true)) -#define LED_AMBER(on_true) stm32_gpiowrite(GPIO_LED_AMBER, !(on_true)) -#define LED_SAFETY(on_true) stm32_gpiowrite(GPIO_LED_SAFETY, !(on_true)) - -//#define GPIO_LED4 (GPIO_OUTPUT|GPIO_CNF_OUTOD|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN11) - -//#define GPIO_HEATER_OFF 0 // (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN14) - -#define GPIO_PC14 (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN14) -#define GPIO_PC15 (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN15) - -#define GPIO_SENSE_PC14_DN (GPIO_INPUT|GPIO_CNF_INPULLDWN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN14) -#define GPIO_SENSE_PC15_UP (GPIO_INPUT|GPIO_CNF_INPULLUP|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN15) -# define SENSE_PH1 0b10 /* Floating pulled as set */ -# define SENSE_PH2 0b01 /* Driven as tied */ - -#define GPIO_USART1_RX_SPEKTRUM (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN10) - -/* Safety switch button *******************************************************/ - -/* CONNECTED TO TP8 - pulled down via SW */ - -#define GPIO_BTN_SAFETY (GPIO_INPUT|GPIO_CNF_INPULLDWN|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN5) - -/* Power switch controls ******************************************************/ - -#define GPIO_SPEKTRUM_PWR_EN (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN13) -#define SPEKTRUM_POWER(_on_true) px4_arch_gpiowrite(GPIO_SPEKTRUM_PWR_EN, (_on_true)) - -#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_USART1_RX_SPEKTRUM, (_one_true)) -#define SPEKTRUM_RX_AS_UART() px4_arch_configgpio(GPIO_USART1_RX) -#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_USART1_RX_SPEKTRUM) - -#define GPIO_SERVO_FAULT_DETECT 0 // (GPIO_INPUT|GPIO_CNF_INPULLUP|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN15) - -/* Analog inputs **************************************************************/ - -/* PWM pins **************************************************************/ - -#define GPIO_PWM1 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN0) -#define GPIO_PWM2 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN1) -#define GPIO_PWM3 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN8) -#define GPIO_PWM4 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN9) -#define GPIO_PWM5 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN6) -#define GPIO_PWM6 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN7) -#define GPIO_PWM7 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN0) -#define GPIO_PWM8 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN1) - -#define DIRECT_PWM_OUTPUT_CHANNELS 8 -#define BOARD_HAS_NO_CAPTURE - -/* SBUS pins *************************************************************/ - -/* XXX these should be UART pins */ -#define GPIO_SBUS_INPUT (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN11) -#define GPIO_SBUS_OUTPUT (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN10) -#define GPIO_SBUS_OENABLE 0 // (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN4) - -/* - * High-resolution timer - */ -#define HRT_TIMER 1 /* use timer1 for the HRT */ -#define HRT_TIMER_CHANNEL 2 /* use capture/compare channel 2 */ -#define HRT_PPM_CHANNEL 1 /* use capture/compare channel 1 PA8 */ -#define GPIO_PPM_IN (GPIO_ALT|GPIO_CNF_INPULLUP|GPIO_PORTA|GPIO_PIN8) - -/* LED definitions ******************************************************************/ -/* PX4 has two LEDs that we will encode as: */ - -#define LED_STARTED 0 /* LED? */ -#define LED_HEAPALLOCATE 1 /* LED? */ -#define LED_IRQSENABLED 2 /* LED? + LED? */ -#define LED_STACKCREATED 3 /* LED? */ -#define LED_INIRQ 4 /* LED? + LED? */ -#define LED_SIGNAL 5 /* LED? + LED? */ -#define LED_ASSERTION 6 /* LED? + LED? + LED? */ -#define LED_PANIC 7 /* N/C + N/C + N/C + LED? */ - -#define BOARD_NUM_IO_TIMERS 3 - -#include diff --git a/boards/modalai/voxl2-io/src/init.c b/boards/modalai/voxl2-io/src/init.c deleted file mode 100644 index 1e432eb..0000000 --- a/boards/modalai/voxl2-io/src/init.c +++ /dev/null @@ -1,133 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * PX4FMU-specific early startup code. This file implements the - * stm32_boardinitialize() function that is called during cpu startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include -#include -#include - -#include - -#include -#include "board_config.h" - -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Protected Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/************************************************************************************ - * Name: stm32_boardinitialize - * - * Description: - * All STM32 architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. - * - ************************************************************************************/ - -__EXPORT void stm32_boardinitialize(void) -{ - /* configure GPIOs */ - - /* Set up for sensing HW */ - stm32_configgpio(GPIO_SENSE_PC14_DN); - stm32_configgpio(GPIO_SENSE_PC15_UP); - - /* LEDS - default to off */ - stm32_configgpio(GPIO_LED_BLUE); - stm32_configgpio(GPIO_LED_AMBER); - stm32_configgpio(GPIO_LED_SAFETY); - - stm32_configgpio(GPIO_PC14); - stm32_configgpio(GPIO_PC15); - - - stm32_configgpio(GPIO_BTN_SAFETY); - - /* spektrum power enable is active high - enable it by default */ - stm32_configgpio(GPIO_SPEKTRUM_PWR_EN); - - stm32_configgpio(GPIO_SBUS_INPUT); /* xxx alternate function */ - stm32_configgpio(GPIO_SBUS_OUTPUT); - - stm32_gpiowrite(GPIO_PWM1, true); - stm32_configgpio(GPIO_PWM1); - - stm32_gpiowrite(GPIO_PWM2, true); - stm32_configgpio(GPIO_PWM2); - - stm32_gpiowrite(GPIO_PWM3, true); - stm32_configgpio(GPIO_PWM3); - - stm32_gpiowrite(GPIO_PWM4, true); - stm32_configgpio(GPIO_PWM4); - - stm32_gpiowrite(GPIO_PWM5, true); - stm32_configgpio(GPIO_PWM5); - - stm32_gpiowrite(GPIO_PWM6, true); - stm32_configgpio(GPIO_PWM6); - - stm32_gpiowrite(GPIO_PWM7, true); - stm32_configgpio(GPIO_PWM7); - - stm32_gpiowrite(GPIO_PWM8, true); - stm32_configgpio(GPIO_PWM8); -} diff --git a/boards/modalai/voxl2-io/src/timer_config.cpp b/boards/modalai/voxl2-io/src/timer_config.cpp deleted file mode 100644 index f84e699..0000000 --- a/boards/modalai/voxl2-io/src/timer_config.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer2), - initIOTimer(Timer::Timer3), - initIOTimer(Timer::Timer4), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel1}, {GPIO::PortA, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel2}, {GPIO::PortA, GPIO::Pin1}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortB, GPIO::Pin8}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel4}, {GPIO::PortB, GPIO::Pin9}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel1}, {GPIO::PortA, GPIO::Pin6}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel2}, {GPIO::PortA, GPIO::Pin7}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel3}, {GPIO::PortB, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel4}, {GPIO::PortB, GPIO::Pin1}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/modalai/voxl2-slpi/default.px4board b/boards/modalai/voxl2-slpi/default.px4board deleted file mode 100644 index 8dcfe4c..0000000 --- a/boards/modalai/voxl2-slpi/default.px4board +++ /dev/null @@ -1,26 +0,0 @@ -CONFIG_PLATFORM_QURT=y -CONFIG_BOARD_TOOLCHAIN="qurt" -CONFIG_DRIVERS_ACTUATORS_MODAL_IO=y -CONFIG_DRIVERS_BAROMETER_INVENSENSE_ICP101XX=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_LIGHTS_RGBLED_NCP5623C=y -CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8310=y -CONFIG_DRIVERS_MAGNETOMETER_QMC5883L=y -CONFIG_DRIVERS_POWER_MONITOR_VOXLPM=y -CONFIG_DRIVERS_QSHELL_QURT=y -CONFIG_DRIVERS_RC_CRSF_RC=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_MUORB_SLPI=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_SENSORS=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_ORB_COMMUNICATOR=y diff --git a/boards/modalai/voxl2-slpi/src/CMakeLists.txt b/boards/modalai/voxl2-slpi/src/CMakeLists.txt deleted file mode 100644 index 7d1867d..0000000 --- a/boards/modalai/voxl2-slpi/src/CMakeLists.txt +++ /dev/null @@ -1,50 +0,0 @@ -############################################################################ -# -# Copyright (c) 2022 ModalAI, Inc. 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. -# -############################################################################ - -# Need to make sure that the DSP processor on VOXL2 -# knows about all parameters since some modules need parameters -# from other modules that are not running on the DSP. -set(DISABLE_PARAMS_MODULE_SCOPING TRUE PARENT_SCOPE) - -add_library(drivers_board - board_config.h - i2c.cpp - init.c - spi.cpp - ) - -# Add custom drivers for SLPI -add_subdirectory(${PX4_BOARD_DIR}/src/drivers/icm42688p) -add_subdirectory(${PX4_BOARD_DIR}/src/drivers/rc_controller) -add_subdirectory(${PX4_BOARD_DIR}/src/drivers/mavlink_rc_in) -add_subdirectory(${PX4_BOARD_DIR}/src/drivers/spektrum_rc) diff --git a/boards/modalai/voxl2-slpi/src/board_config.h b/boards/modalai/voxl2-slpi/src/board_config.h deleted file mode 100644 index 2aa91b4..0000000 --- a/boards/modalai/voxl2-slpi/src/board_config.h +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2022 ModalAI, Inc. 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * VOXL2 internal definitions - */ - -#pragma once - -#define BOARD_HAS_NO_RESET -#define BOARD_HAS_NO_BOOTLOADER -/* - * I2C buses - */ -#define CONFIG_I2C 1 -#define PX4_NUMBER_I2C_BUSES 4 - -/* - * SPI buses - */ -#define CONFIG_SPI 1 -#define BOARD_SPI_BUS_MAX_BUS_ITEMS 1 - -/* - * Include these last to make use of the definitions above - */ -#include -#include - -/* - * Default port for the ESC - */ -#define MODAL_IO_DEFAULT_PORT "2" diff --git a/boards/modalai/voxl2-slpi/src/drivers/icm42688p/CMakeLists.txt b/boards/modalai/voxl2-slpi/src/drivers/icm42688p/CMakeLists.txt deleted file mode 100644 index 1f8e210..0000000 --- a/boards/modalai/voxl2-slpi/src/drivers/icm42688p/CMakeLists.txt +++ /dev/null @@ -1,48 +0,0 @@ -############################################################################ -# -# Copyright (c) 2020 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. -# -############################################################################ -px4_add_module( - MODULE drivers__imu__invensense__icm42688p - MAIN icm42688p - COMPILE_FLAGS - ${MAX_CUSTOM_OPT_LEVEL} - SRCS - icm42688p_main.cpp - ICM42688P.cpp - ICM42688P.hpp - InvenSense_ICM42688P_registers.hpp - DEPENDS - px4_work_queue - drivers_accelerometer - drivers_gyroscope - drivers__device - ) diff --git a/boards/modalai/voxl2-slpi/src/drivers/icm42688p/ICM42688P.cpp b/boards/modalai/voxl2-slpi/src/drivers/icm42688p/ICM42688P.cpp deleted file mode 100644 index daf593d..0000000 --- a/boards/modalai/voxl2-slpi/src/drivers/icm42688p/ICM42688P.cpp +++ /dev/null @@ -1,985 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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 "ICM42688P.hpp" - -bool hitl_mode = false; - -using namespace time_literals; - -static constexpr int16_t combine(uint8_t msb, uint8_t lsb) -{ - return (msb << 8u) | lsb; -} - -ICM42688P::ICM42688P(const I2CSPIDriverConfig &config) : - // SPI(DRV_IMU_DEVTYPE_ICM42688P, MODULE_NAME, bus, device, spi_mode, bus_frequency), - // I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus), - // _drdy_gpio(drdy_gpio) - SPI(config), - I2CSPIDriver(config), - _drdy_gpio(config.drdy_gpio), - _px4_accel(get_device_id(), config.rotation), - _px4_gyro(get_device_id(), config.rotation) -{ - if (config.drdy_gpio != 0) { - _drdy_missed_perf = perf_alloc(PC_COUNT, MODULE_NAME": DRDY missed"); - } - - if (!hitl_mode) { - // _px4_accel = std::make_shared(get_device_id(), rotation); - // _px4_gyro = std::make_shared(get_device_id(), rotation); - ConfigureSampleRate(_px4_gyro.get_max_rate_hz()); - // _imu_server_pub.advertise(); - - } else { - ConfigureSampleRate(0); - } -} - -ICM42688P::~ICM42688P() -{ - perf_free(_bad_register_perf); - perf_free(_bad_transfer_perf); - perf_free(_fifo_empty_perf); - perf_free(_fifo_overflow_perf); - perf_free(_fifo_reset_perf); - perf_free(_drdy_missed_perf); - - // if (!hitl_mode){ - // _imu_server_pub.unadvertise(); - // } -} - -int ICM42688P::init() -{ - int ret = SPI::init(); - - if (ret != PX4_OK) { - DEVICE_DEBUG("SPI::init failed (%i)", ret); - return ret; - } - - return Reset() ? 0 : -1; -} - -bool ICM42688P::Reset() -{ - _state = STATE::RESET; - DataReadyInterruptDisable(); - ScheduleClear(); - ScheduleNow(); - return true; -} - -void ICM42688P::exit_and_cleanup() -{ - DataReadyInterruptDisable(); - I2CSPIDriverBase::exit_and_cleanup(); -} - -void ICM42688P::print_status() -{ - I2CSPIDriverBase::print_status(); - - PX4_INFO("FIFO empty interval: %d us (%.1f Hz)", _fifo_empty_interval_us, 1e6 / _fifo_empty_interval_us); - - perf_print_counter(_bad_register_perf); - perf_print_counter(_bad_transfer_perf); - perf_print_counter(_fifo_empty_perf); - perf_print_counter(_fifo_overflow_perf); - perf_print_counter(_fifo_reset_perf); - perf_print_counter(_drdy_missed_perf); -} - -int ICM42688P::probe() -{ - for (int i = 0; i < 3; i++) { - uint8_t whoami = RegisterRead(Register::BANK_0::WHO_AM_I); - - if (whoami == WHOAMI) { - PX4_INFO("ICM42688P::probe successful!"); - return PX4_OK; - - } else { - DEVICE_DEBUG("unexpected WHO_AM_I 0x%02x", whoami); - - uint8_t reg_bank_sel = RegisterRead(Register::BANK_0::REG_BANK_SEL); - int bank = reg_bank_sel >> 4; - - if (bank >= 1 && bank <= 3) { - DEVICE_DEBUG("incorrect register bank for WHO_AM_I REG_BANK_SEL:0x%02x, bank:%d", reg_bank_sel, bank); - // force bank selection and retry - SelectRegisterBank(REG_BANK_SEL_BIT::USER_BANK_0, true); - } - } - } - - return PX4_ERROR; -} - -void ICM42688P::RunImpl() -{ - PX4_INFO(">>> ICM42688P this: %p", this); - - const hrt_abstime now = hrt_absolute_time(); - - switch (_state) { - case STATE::RESET: - // DEVICE_CONFIG: Software reset configuration - RegisterWrite(Register::BANK_0::DEVICE_CONFIG, DEVICE_CONFIG_BIT::SOFT_RESET_CONFIG); - _reset_timestamp = now; - _failure_count = 0; - _state = STATE::WAIT_FOR_RESET; - ScheduleDelayed(2_ms); // to be safe wait 2 ms for soft reset to be effective - break; - - case STATE::WAIT_FOR_RESET: - if ((RegisterRead(Register::BANK_0::WHO_AM_I) == WHOAMI) - && (RegisterRead(Register::BANK_0::DEVICE_CONFIG) == 0x00) - && (RegisterRead(Register::BANK_0::INT_STATUS) & INT_STATUS_BIT::RESET_DONE_INT)) { - - _state = STATE::CONFIGURE; - ScheduleDelayed(10_ms); // 30 ms gyro startup time, 10 ms accel from sleep to valid data - - } else { - // RESET not complete - if (hrt_elapsed_time(&_reset_timestamp) > 1000_ms) { - PX4_DEBUG("Reset failed, retrying"); - _state = STATE::RESET; - ScheduleDelayed(100_ms); - - } else { - PX4_DEBUG("Reset not complete, check again in 10 ms"); - ScheduleDelayed(10_ms); - } - } - - break; - - case STATE::CONFIGURE: - - if (Configure()) { - - // Wakeup accel and gyro after configuring registers - ScheduleDelayed(1_ms); // add a delay here to be safe - RegisterWrite(Register::BANK_0::PWR_MGMT0, PWR_MGMT0_BIT::GYRO_MODE_LOW_NOISE | PWR_MGMT0_BIT::ACCEL_MODE_LOW_NOISE); - ScheduleDelayed(30_ms); // 30 ms gyro startup time, 10 ms accel from sleep to valid data - - // if configure succeeded then start reading from FIFO - _state = STATE::FIFO_READ; - - if (DataReadyInterruptConfigure()) { - _data_ready_interrupt_enabled = true; - - // backup schedule as a watchdog timeout - ScheduleDelayed(100_ms); - - } else { - PX4_ERR("ICM42688P::RunImpl interrupt configuration failed"); - - _data_ready_interrupt_enabled = false; - ScheduleOnInterval(_fifo_empty_interval_us, _fifo_empty_interval_us); - } - - FIFOReset(); - - } else { - - PX4_ERR("ICM42688P::RunImpl configuration failed"); - - // CONFIGURE not complete - if (hrt_elapsed_time(&_reset_timestamp) > 1000_ms) { - PX4_DEBUG("Configure failed, resetting"); - _state = STATE::RESET; - - } else { - PX4_DEBUG("Configure failed, retrying"); - } - - ScheduleDelayed(100_ms); - } - - break; - - case STATE::FIFO_READ: { -#ifndef __PX4_QURT - uint32_t samples = 0; - - if (_data_ready_interrupt_enabled) { - // scheduled from interrupt if _drdy_fifo_read_samples was set as expected - if (_drdy_fifo_read_samples.fetch_and(0) != _fifo_gyro_samples) { - perf_count(_drdy_missed_perf); - - } else { - samples = _fifo_gyro_samples; - } - - // push backup schedule back - ScheduleDelayed(_fifo_empty_interval_us * 2); - } - - if (samples == 0) { - // check current FIFO count - const uint16_t fifo_count = FIFOReadCount(); - - if (fifo_count >= FIFO::SIZE) { - FIFOReset(); - perf_count(_fifo_overflow_perf); - - } else if (fifo_count == 0) { - perf_count(_fifo_empty_perf); - - } else { - // FIFO count (size in bytes) - samples = (fifo_count / sizeof(FIFO::DATA)); - - if (samples > FIFO_MAX_SAMPLES) { - // not technically an overflow, but more samples than we expected or can publish - FIFOReset(); - perf_count(_fifo_overflow_perf); - samples = 0; - } - } - } - - bool success = false; - - if (samples >= 1) { - if (FIFORead(now, samples)) { - success = true; - - if (_failure_count > 0) { - _failure_count--; - } - } - } - - if (!success) { - _failure_count++; - - // full reset if things are failing consistently - if (_failure_count > 10) { - Reset(); - return; - } - } - - // check configuration registers periodically or immediately following any failure - if (RegisterCheck(_register_bank0_cfg[_checked_register_bank0]) - && RegisterCheck(_register_bank1_cfg[_checked_register_bank1]) - && RegisterCheck(_register_bank2_cfg[_checked_register_bank2]) - ) { - _last_config_check_timestamp = now; - _checked_register_bank0 = (_checked_register_bank0 + 1) % size_register_bank0_cfg; - _checked_register_bank1 = (_checked_register_bank1 + 1) % size_register_bank1_cfg; - _checked_register_bank2 = (_checked_register_bank2 + 1) % size_register_bank2_cfg; - - } else { - // register check failed, force reset - perf_count(_bad_register_perf); - Reset(); - } - -#endif - } - - break; - } -} - -void ICM42688P::ConfigureSampleRate(int sample_rate) -{ - if (sample_rate == 0) { - sample_rate = 800; // default to 800 Hz - } - - // round down to nearest FIFO sample dt - const float min_interval = FIFO_SAMPLE_DT; - _fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval); - - _fifo_gyro_samples = roundf(math::min((float)_fifo_empty_interval_us / (1e6f / GYRO_RATE), (float)FIFO_MAX_SAMPLES)); - - // recompute FIFO empty interval (us) with actual gyro sample limit - _fifo_empty_interval_us = _fifo_gyro_samples * (1e6f / GYRO_RATE); - - ConfigureFIFOWatermark(_fifo_gyro_samples); -} - -void ICM42688P::ConfigureFIFOWatermark(uint8_t samples) -{ - // FIFO watermark threshold in number of bytes - const uint16_t fifo_watermark_threshold = samples * sizeof(FIFO::DATA); - - for (auto &r : _register_bank0_cfg) { - if (r.reg == Register::BANK_0::FIFO_CONFIG2) { - // FIFO_WM[7:0] FIFO_CONFIG2 - r.set_bits = fifo_watermark_threshold & 0xFF; - - } else if (r.reg == Register::BANK_0::FIFO_CONFIG3) { - // FIFO_WM[11:8] FIFO_CONFIG3 - r.set_bits = (fifo_watermark_threshold >> 8) & 0x0F; - } - } -} - -void ICM42688P::SelectRegisterBank(enum REG_BANK_SEL_BIT bank, bool force) -{ - if (bank != _last_register_bank || force) { - // select BANK_0 - uint8_t cmd_bank_sel[2] {}; - cmd_bank_sel[0] = static_cast(Register::BANK_0::REG_BANK_SEL); - cmd_bank_sel[1] = bank; - transfer(cmd_bank_sel, cmd_bank_sel, sizeof(cmd_bank_sel)); - - _last_register_bank = bank; - } -} - -bool ICM42688P::Configure() -{ - // first set and clear all configured register bits - for (const auto ®_cfg : _register_bank0_cfg) { - RegisterSetAndClearBits(reg_cfg.reg, reg_cfg.set_bits, reg_cfg.clear_bits); - } - - for (const auto ®_cfg : _register_bank1_cfg) { - RegisterSetAndClearBits(reg_cfg.reg, reg_cfg.set_bits, reg_cfg.clear_bits); - } - - for (const auto ®_cfg : _register_bank2_cfg) { - RegisterSetAndClearBits(reg_cfg.reg, reg_cfg.set_bits, reg_cfg.clear_bits); - } - - // now check that all are configured - bool success = true; - - for (const auto ®_cfg : _register_bank0_cfg) { - if (!RegisterCheck(reg_cfg)) { - success = false; - } - } - - for (const auto ®_cfg : _register_bank1_cfg) { - if (!RegisterCheck(reg_cfg)) { - success = false; - } - } - - for (const auto ®_cfg : _register_bank2_cfg) { - if (!RegisterCheck(reg_cfg)) { - success = false; - } - } - - // // 20-bits data format used - // // the only FSR settings that are operational are ±2000dps for gyroscope and ±16g for accelerometer - if (!hitl_mode) { - _px4_accel.set_range(16.f * CONSTANTS_ONE_G); - _px4_accel.set_scale(CONSTANTS_ONE_G / 8192.f); - _px4_gyro.set_range(math::radians(2000.f)); - _px4_gyro.set_scale(math::radians(1.f / 131.f)); - } - - return success; -} - -static bool interrupt_debug = false; -static uint32_t interrupt_debug_count = 0; -static const uint32_t interrupt_debug_trigger = 800; -static hrt_abstime last_interrupt_time = 0; -static hrt_abstime avg_interrupt_delta = 0; -static hrt_abstime max_interrupt_delta = 0; -static hrt_abstime min_interrupt_delta = 60 * 1000 * 1000; -static hrt_abstime cumulative_interrupt_delta = 0; - -int ICM42688P::DataReadyInterruptCallback(int irq, void *context, void *arg) -{ - hrt_abstime current_interrupt_time = hrt_absolute_time(); - - if (interrupt_debug) { - if (last_interrupt_time) { - hrt_abstime interrupt_delta_time = current_interrupt_time - last_interrupt_time; - - if (interrupt_delta_time > max_interrupt_delta) { max_interrupt_delta = interrupt_delta_time; } - - if (interrupt_delta_time < min_interrupt_delta) { min_interrupt_delta = interrupt_delta_time; } - - cumulative_interrupt_delta += interrupt_delta_time; - } - - last_interrupt_time = current_interrupt_time; - - interrupt_debug_count++; - - if (interrupt_debug_count == interrupt_debug_trigger) { - avg_interrupt_delta = cumulative_interrupt_delta / interrupt_debug_trigger; - PX4_INFO(">>> Max: %llu, Min: %llu, Avg: %llu", max_interrupt_delta, - min_interrupt_delta, avg_interrupt_delta); - interrupt_debug_count = 0; - cumulative_interrupt_delta = 0; - } - } - - static_cast(arg)->DataReady(); - - return 0; -} - -void ICM42688P::DataReady() -{ -#ifndef __PX4_QURT - uint32_t expected = 0; - - if (_drdy_fifo_read_samples.compare_exchange(&expected, _fifo_gyro_samples)) { - ScheduleNow(); - } - -#else - uint16_t fifo_byte_count = FIFOReadCount(); - - FIFORead(hrt_absolute_time(), fifo_byte_count / sizeof(FIFO::DATA)); -#endif -} - -bool ICM42688P::DataReadyInterruptConfigure() -{ - if (_drdy_gpio == 0) { - return false; - } - - // Setup data ready on falling edge - return px4_arch_gpiosetevent(_drdy_gpio, false, true, true, &DataReadyInterruptCallback, this) == 0; -} - -bool ICM42688P::DataReadyInterruptDisable() -{ - if (_drdy_gpio == 0) { - return false; - } - - return px4_arch_gpiosetevent(_drdy_gpio, false, false, false, nullptr, nullptr) == 0; -} - -template -bool ICM42688P::RegisterCheck(const T ®_cfg) -{ - bool success = true; - - const uint8_t reg_value = RegisterRead(reg_cfg.reg); - - if (reg_cfg.set_bits && ((reg_value & reg_cfg.set_bits) != reg_cfg.set_bits)) { - PX4_DEBUG("0x%02hhX: 0x%02hhX (0x%02hhX not set)", (uint8_t)reg_cfg.reg, reg_value, reg_cfg.set_bits); - success = false; - } - - if (reg_cfg.clear_bits && ((reg_value & reg_cfg.clear_bits) != 0)) { - PX4_DEBUG("0x%02hhX: 0x%02hhX (0x%02hhX not cleared)", (uint8_t)reg_cfg.reg, reg_value, reg_cfg.clear_bits); - success = false; - } - - return success; -} - -template -uint8_t ICM42688P::RegisterRead(T reg) -{ - uint8_t cmd[2] {}; - cmd[0] = static_cast(reg) | DIR_READ; - SelectRegisterBank(reg); - transfer(cmd, cmd, sizeof(cmd)); - return cmd[1]; -} - -template -void ICM42688P::RegisterWrite(T reg, uint8_t value) -{ - uint8_t cmd[2] { (uint8_t)reg, value }; - SelectRegisterBank(reg); - transfer(cmd, cmd, sizeof(cmd)); -} - -template -void ICM42688P::RegisterSetAndClearBits(T reg, uint8_t setbits, uint8_t clearbits) -{ - const uint8_t orig_val = RegisterRead(reg); - - uint8_t val = (orig_val & ~clearbits) | setbits; - - if (orig_val != val) { - RegisterWrite(reg, val); - } -} - -uint16_t ICM42688P::FIFOReadCount() -{ - // read FIFO count - uint8_t fifo_count_buf[3] {}; - fifo_count_buf[0] = static_cast(Register::BANK_0::FIFO_COUNTH) | DIR_READ; - SelectRegisterBank(REG_BANK_SEL_BIT::USER_BANK_0); - - if (transfer(fifo_count_buf, fifo_count_buf, sizeof(fifo_count_buf)) != PX4_OK) { - perf_count(_bad_transfer_perf); - return 0; - } - - return combine(fifo_count_buf[1], fifo_count_buf[2]); -} - -// static uint32_t debug_decimator = 0; -// static hrt_abstime last_sample_time = 0; -// static bool imu_debug = true; - -bool ICM42688P::FIFORead(const hrt_abstime ×tamp_sample, uint16_t samples) -{ - FIFOTransferBuffer buffer{}; - const size_t max_transfer_size = 10 * sizeof(FIFO::DATA) + 4; - const size_t transfer_size = math::min(samples * sizeof(FIFO::DATA) + 4, max_transfer_size); - SelectRegisterBank(REG_BANK_SEL_BIT::USER_BANK_0); - - if (transfer((uint8_t *)&buffer, (uint8_t *)&buffer, transfer_size) != PX4_OK) { - perf_count(_bad_transfer_perf); - return false; - } - - if (buffer.INT_STATUS & INT_STATUS_BIT::FIFO_FULL_INT) { - perf_count(_fifo_overflow_perf); - FIFOReset(); - return false; - } - - const uint16_t fifo_count_bytes = combine(buffer.FIFO_COUNTH, buffer.FIFO_COUNTL); - - if (fifo_count_bytes >= FIFO::SIZE) { - perf_count(_fifo_overflow_perf); - FIFOReset(); - return false; - } - - const uint16_t fifo_count_samples = fifo_count_bytes / sizeof(FIFO::DATA); - - if (fifo_count_samples == 0) { - perf_count(_fifo_empty_perf); - return false; - } - - // check FIFO header in every sample - uint16_t valid_samples = 0; - - // for (int i = 0; i < math::min(samples, fifo_count_samples); i++) { - for (int i = 0; i < math::min(samples, (uint16_t) 10); i++) { - bool valid = true; - - // With FIFO_ACCEL_EN and FIFO_GYRO_EN header should be 8’b_0110_10xx - const uint8_t FIFO_HEADER = buffer.f[i].FIFO_Header; - - if (FIFO_HEADER & FIFO::FIFO_HEADER_BIT::HEADER_MSG) { - // FIFO sample empty if HEADER_MSG set - valid = false; - - } else if (!(FIFO_HEADER & FIFO::FIFO_HEADER_BIT::HEADER_ACCEL)) { - // accel bit not set - valid = false; - - } else if (!(FIFO_HEADER & FIFO::FIFO_HEADER_BIT::HEADER_GYRO)) { - // gyro bit not set - valid = false; - - } else if (!(FIFO_HEADER & FIFO::FIFO_HEADER_BIT::HEADER_20)) { - // Packet does not contain a new and valid extended 20-bit data - valid = false; - - } else if (FIFO_HEADER & FIFO::FIFO_HEADER_BIT::HEADER_ODR_ACCEL) { - // accel ODR changed - valid = false; - - } else if (FIFO_HEADER & FIFO::FIFO_HEADER_BIT::HEADER_ODR_GYRO) { - // gyro ODR changed - valid = false; - } - - if (valid) { - valid_samples++; - - } else { - perf_count(_bad_transfer_perf); - break; - } - } - - // if (imu_debug) { - // debug_decimator++; - // if (debug_decimator == 801) { - // debug_decimator = 0; - // PX4_INFO("Initial: %u Next: %u Valid: %u Delta: %llu", samples, fifo_count_samples, valid_samples, timestamp_sample - last_sample_time); - // } - // last_sample_time = timestamp_sample; - // } - - if (valid_samples > 0) { - if (ProcessTemperature(buffer.f, valid_samples)) { - ProcessGyro(timestamp_sample, buffer.f, valid_samples); - ProcessAccel(timestamp_sample, buffer.f, valid_samples); - // Pass only most recent valid sample to IMU server - // ProcessIMU(timestamp_sample, buffer.f[valid_samples - 1]); - return true; - } - } - - return false; -} - -void ICM42688P::FIFOReset() -{ - perf_count(_fifo_reset_perf); - - // SIGNAL_PATH_RESET: FIFO flush - RegisterSetBits(Register::BANK_0::SIGNAL_PATH_RESET, SIGNAL_PATH_RESET_BIT::FIFO_FLUSH); - - // reset while FIFO is disabled - _drdy_fifo_read_samples.store(0); -} - -static constexpr int32_t reassemble_20bit(const uint32_t a, const uint32_t b, const uint32_t c) -{ - // 0xXXXAABBC - uint32_t high = ((a << 12) & 0x000FF000); - uint32_t low = ((b << 4) & 0x00000FF0); - uint32_t lowest = (c & 0x0000000F); - - uint32_t x = high | low | lowest; - - if (a & Bit7) { - // sign extend - x |= 0xFFF00000u; - } - - return static_cast(x); -} - -void ICM42688P::ProcessIMU(const hrt_abstime ×tamp_sample, const FIFO::DATA &fifo) -{ - // float accel_x = 0.0, accel_y = 0.0, accel_z = 0.0; - // float gyro_x = 0.0, gyro_y = 0.0, gyro_z = 0.0; - // - // // 20 bit hires mode - // - // // Sign extension + Accel [19:12] + Accel [11:4] + Accel [3:2] (20 bit extension byte) - // // Accel data is 18 bit - // int32_t temp_accel_x = reassemble_20bit(fifo.ACCEL_DATA_X1, fifo.ACCEL_DATA_X0, - // fifo.Ext_Accel_X_Gyro_X & 0xF0 >> 4); - // int32_t temp_accel_y = reassemble_20bit(fifo.ACCEL_DATA_Y1, fifo.ACCEL_DATA_Y0, - // fifo.Ext_Accel_Y_Gyro_Y & 0xF0 >> 4); - // int32_t temp_accel_z = reassemble_20bit(fifo.ACCEL_DATA_Z1, fifo.ACCEL_DATA_Z0, - // fifo.Ext_Accel_Z_Gyro_Z & 0xF0 >> 4); - // - // // Gyro [19:12] + Gyro [11:4] + Gyro [3:0] (bottom 4 bits of 20 bit extension byte) - // int32_t temp_gyro_x = reassemble_20bit(fifo.GYRO_DATA_X1, fifo.GYRO_DATA_X0, - // fifo.Ext_Accel_X_Gyro_X & 0x0F); - // int32_t temp_gyro_y = reassemble_20bit(fifo.GYRO_DATA_Y1, fifo.GYRO_DATA_Y0, - // fifo.Ext_Accel_Y_Gyro_Y & 0x0F); - // int32_t temp_gyro_z = reassemble_20bit(fifo.GYRO_DATA_Z1, fifo.GYRO_DATA_Z0, - // fifo.Ext_Accel_Z_Gyro_Z & 0x0F); - - // // accel samples invalid if -524288 - // if (temp_accel_x != -524288 && temp_accel_y != -524288 && temp_accel_z != -524288) { - // // shift accel by 2 (2 least significant bits are always 0) - // accel_x = (float) temp_accel_x / 4.f; - // accel_y = (float) temp_accel_y / 4.f; - // accel_z = (float) temp_accel_z / 4.f; - // - // // shift gyro by 1 (least significant bit is always 0) - // gyro_x = (float) temp_gyro_x / 2.f; - // gyro_y = (float) temp_gyro_y / 2.f; - // gyro_z = (float) temp_gyro_z / 2.f; - // - // // correct frame for publication - // // sensor's frame is +x forward, +y left, +z up - // // flip y & z to publish right handed with z down (x forward, y right, z down) - // accel_y = -accel_y; - // accel_z = -accel_z; - // gyro_y = -gyro_y; - // gyro_z = -gyro_z; - // - // // Scale everything appropriately - // float accel_scale_factor = (CONSTANTS_ONE_G / 8192.f); - // accel_x *= accel_scale_factor; - // accel_y *= accel_scale_factor; - // accel_z *= accel_scale_factor; - // - // float gyro_scale_factor = math::radians(1.f / 131.f); - // gyro_x *= gyro_scale_factor; - // gyro_y *= gyro_scale_factor; - // gyro_z *= gyro_scale_factor; - // - // // Store the data in our array - // _imu_server_data.accel_x[_imu_server_index] = accel_x; - // _imu_server_data.accel_y[_imu_server_index] = accel_y; - // _imu_server_data.accel_z[_imu_server_index] = accel_z; - // _imu_server_data.gyro_x[_imu_server_index] = gyro_x; - // _imu_server_data.gyro_y[_imu_server_index] = gyro_y; - // _imu_server_data.gyro_z[_imu_server_index] = gyro_z; - // _imu_server_data.ts[_imu_server_index] = timestamp_sample; - // _imu_server_index++; - // - // // If array is full, publish the data - // if (_imu_server_index == 10) { - // _imu_server_index = 0; - // _imu_server_data.timestamp = hrt_absolute_time(); - // _imu_server_data.temperature = 0; // Not used right now - // _imu_server_pub.publish(_imu_server_data); - // } - // } -} - -void ICM42688P::ProcessAccel(const hrt_abstime ×tamp_sample, const FIFO::DATA fifo[], const uint8_t samples) -{ - sensor_accel_fifo_s accel{}; - accel.timestamp_sample = timestamp_sample; - accel.samples = 0; - accel.dt = FIFO_SAMPLE_DT; - - // 18-bits of accelerometer data - bool scale_20bit = false; - - // first pass - for (int i = 0; i < samples; i++) { - // 20 bit hires mode - // Sign extension + Accel [19:12] + Accel [11:4] + Accel [3:2] (20 bit extension byte) - // Accel data is 18 bit () - int32_t accel_x = reassemble_20bit(fifo[i].ACCEL_DATA_X1, fifo[i].ACCEL_DATA_X0, - fifo[i].Ext_Accel_X_Gyro_X & 0xF0 >> 4); - int32_t accel_y = reassemble_20bit(fifo[i].ACCEL_DATA_Y1, fifo[i].ACCEL_DATA_Y0, - fifo[i].Ext_Accel_Y_Gyro_Y & 0xF0 >> 4); - int32_t accel_z = reassemble_20bit(fifo[i].ACCEL_DATA_Z1, fifo[i].ACCEL_DATA_Z0, - fifo[i].Ext_Accel_Z_Gyro_Z & 0xF0 >> 4); - - // sample invalid if -524288 - if (accel_x != -524288 && accel_y != -524288 && accel_z != -524288) { - // check if any values are going to exceed int16 limits - static constexpr int16_t max_accel = INT16_MAX; - static constexpr int16_t min_accel = INT16_MIN; - - if (accel_x >= max_accel || accel_x <= min_accel) { - scale_20bit = true; - } - - if (accel_y >= max_accel || accel_y <= min_accel) { - scale_20bit = true; - } - - if (accel_z >= max_accel || accel_z <= min_accel) { - scale_20bit = true; - } - - // shift by 2 (2 least significant bits are always 0) - accel.x[accel.samples] = accel_x / 4; - accel.y[accel.samples] = accel_y / 4; - accel.z[accel.samples] = accel_z / 4; - accel.samples++; - } - } - - if (!scale_20bit) { - // if highres enabled accel data is always 8192 LSB/g - if (!hitl_mode) { - _px4_accel.set_scale(CONSTANTS_ONE_G / 8192.f); - } - - } else { - // 20 bit data scaled to 16 bit (2^4) - for (int i = 0; i < samples; i++) { - // 20 bit hires mode - // Sign extension + Accel [19:12] + Accel [11:4] + Accel [3:2] (20 bit extension byte) - // Accel data is 18 bit () - int16_t accel_x = combine(fifo[i].ACCEL_DATA_X1, fifo[i].ACCEL_DATA_X0); - int16_t accel_y = combine(fifo[i].ACCEL_DATA_Y1, fifo[i].ACCEL_DATA_Y0); - int16_t accel_z = combine(fifo[i].ACCEL_DATA_Z1, fifo[i].ACCEL_DATA_Z0); - - accel.x[i] = accel_x; - accel.y[i] = accel_y; - accel.z[i] = accel_z; - } - - if (!hitl_mode) { - _px4_accel.set_scale(CONSTANTS_ONE_G / 2048.f); - } - } - - // correct frame for publication - for (int i = 0; i < accel.samples; i++) { - // sensor's frame is +x forward, +y left, +z up - // flip y & z to publish right handed with z down (x forward, y right, z down) - accel.x[i] = accel.x[i]; - accel.y[i] = (accel.y[i] == INT16_MIN) ? INT16_MAX : -accel.y[i]; - accel.z[i] = (accel.z[i] == INT16_MIN) ? INT16_MAX : -accel.z[i]; - } - - if (!hitl_mode) { - _px4_accel.set_error_count(perf_event_count(_bad_register_perf) + perf_event_count(_bad_transfer_perf) + - perf_event_count(_fifo_empty_perf) + perf_event_count(_fifo_overflow_perf)); - } - - if (accel.samples > 0) { - if (!hitl_mode) { - _px4_accel.updateFIFO(accel); - } - } -} - -void ICM42688P::ProcessGyro(const hrt_abstime ×tamp_sample, const FIFO::DATA fifo[], const uint8_t samples) -{ - sensor_gyro_fifo_s gyro{}; - gyro.timestamp_sample = timestamp_sample; - gyro.samples = 0; - gyro.dt = FIFO_SAMPLE_DT; - - // 20-bits of gyroscope data - bool scale_20bit = false; - - // first pass - for (int i = 0; i < samples; i++) { - // 20 bit hires mode - // Gyro [19:12] + Gyro [11:4] + Gyro [3:0] (bottom 4 bits of 20 bit extension byte) - int32_t gyro_x = reassemble_20bit(fifo[i].GYRO_DATA_X1, fifo[i].GYRO_DATA_X0, fifo[i].Ext_Accel_X_Gyro_X & 0x0F); - int32_t gyro_y = reassemble_20bit(fifo[i].GYRO_DATA_Y1, fifo[i].GYRO_DATA_Y0, fifo[i].Ext_Accel_Y_Gyro_Y & 0x0F); - int32_t gyro_z = reassemble_20bit(fifo[i].GYRO_DATA_Z1, fifo[i].GYRO_DATA_Z0, fifo[i].Ext_Accel_Z_Gyro_Z & 0x0F); - - // check if any values are going to exceed int16 limits - static constexpr int16_t max_gyro = INT16_MAX; - static constexpr int16_t min_gyro = INT16_MIN; - - if (gyro_x >= max_gyro || gyro_x <= min_gyro) { - scale_20bit = true; - } - - if (gyro_y >= max_gyro || gyro_y <= min_gyro) { - scale_20bit = true; - } - - if (gyro_z >= max_gyro || gyro_z <= min_gyro) { - scale_20bit = true; - } - - gyro.x[gyro.samples] = gyro_x / 2; - gyro.y[gyro.samples] = gyro_y / 2; - gyro.z[gyro.samples] = gyro_z / 2; - gyro.samples++; - } - - if (!scale_20bit) { - // if highres enabled gyro data is always 131 LSB/dps - if (!hitl_mode) { - _px4_gyro.set_scale(math::radians(1.f / 131.f)); - } - - } else { - // 20 bit data scaled to 16 bit (2^4) - for (int i = 0; i < samples; i++) { - gyro.x[i] = combine(fifo[i].GYRO_DATA_X1, fifo[i].GYRO_DATA_X0); - gyro.y[i] = combine(fifo[i].GYRO_DATA_Y1, fifo[i].GYRO_DATA_Y0); - gyro.z[i] = combine(fifo[i].GYRO_DATA_Z1, fifo[i].GYRO_DATA_Z0); - } - - if (!hitl_mode) { - _px4_gyro.set_scale(math::radians(2000.f / 32768.f)); - } - } - - // correct frame for publication - for (int i = 0; i < gyro.samples; i++) { - // sensor's frame is +x forward, +y left, +z up - // flip y & z to publish right handed with z down (x forward, y right, z down) - gyro.x[i] = gyro.x[i]; - gyro.y[i] = (gyro.y[i] == INT16_MIN) ? INT16_MAX : -gyro.y[i]; - gyro.z[i] = (gyro.z[i] == INT16_MIN) ? INT16_MAX : -gyro.z[i]; - } - - if (!hitl_mode) { - _px4_gyro.set_error_count(perf_event_count(_bad_register_perf) + perf_event_count(_bad_transfer_perf) + - perf_event_count(_fifo_empty_perf) + perf_event_count(_fifo_overflow_perf)); - } - - if (gyro.samples > 0) { - if (!hitl_mode) { - _px4_gyro.updateFIFO(gyro); - } - } -} - -bool ICM42688P::ProcessTemperature(const FIFO::DATA fifo[], const uint8_t samples) -{ - int16_t temperature[FIFO_MAX_SAMPLES]; - float temperature_sum{0}; - - int valid_samples = 0; - - for (int i = 0; i < samples; i++) { - const int16_t t = combine(fifo[i].TEMP_DATA1, fifo[i].TEMP_DATA0); - - // sample invalid if -32768 - if (t != -32768) { - temperature_sum += t; - temperature[valid_samples] = t; - valid_samples++; - } - } - - if (valid_samples > 0) { - const float temperature_avg = temperature_sum / valid_samples; - - for (int i = 0; i < valid_samples; i++) { - // temperature changing wildly is an indication of a transfer error - if (fabsf(temperature[i] - temperature_avg) > 1000) { - perf_count(_bad_transfer_perf); - return false; - } - } - - // use average temperature reading - const float TEMP_degC = (temperature_avg / TEMPERATURE_SENSITIVITY) + TEMPERATURE_OFFSET; - - if (PX4_ISFINITE(TEMP_degC)) { - if (!hitl_mode) { - _px4_accel.set_temperature(TEMP_degC); - _px4_gyro.set_temperature(TEMP_degC); - return true; - } - - } else { - perf_count(_bad_transfer_perf); - } - } - - return false; -} diff --git a/boards/modalai/voxl2-slpi/src/drivers/icm42688p/ICM42688P.hpp b/boards/modalai/voxl2-slpi/src/drivers/icm42688p/ICM42688P.hpp deleted file mode 100644 index c1aa595..0000000 --- a/boards/modalai/voxl2-slpi/src/drivers/icm42688p/ICM42688P.hpp +++ /dev/null @@ -1,233 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -/** - * @file ICM42688P.hpp - * - * Driver for the Invensense ICM42688P connected via SPI. - * - */ - -#pragma once - -#include "InvenSense_ICM42688P_registers.hpp" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace InvenSense_ICM42688P; - -extern bool hitl_mode; - -class ICM42688P : public device::SPI, public I2CSPIDriver -{ -public: - // ICM42688P(I2CSPIBusOption bus_option, int bus, uint32_t device, enum Rotation rotation, int bus_frequency, - // spi_mode_e spi_mode, spi_drdy_gpio_t drdy_gpio); - ICM42688P(const I2CSPIDriverConfig &config); - ~ICM42688P() override; - - // static I2CSPIDriverBase *instantiate(const BusCLIArguments &cli, const BusInstanceIterator &iterator, - // int runtime_instance); - static void print_usage(); - - void RunImpl(); - - int init() override; - void print_status() override; - -private: - void exit_and_cleanup() override; - - // Sensor Configuration - static constexpr float IMU_ODR{8000.f}; // 8kHz accel & gyro ODR configured - static constexpr float FIFO_SAMPLE_DT{1e6f / IMU_ODR}; - static constexpr float GYRO_RATE{1e6f / FIFO_SAMPLE_DT}; - static constexpr float ACCEL_RATE{1e6f / FIFO_SAMPLE_DT}; - - // maximum FIFO samples per transfer is limited to the size of sensor_accel_fifo/sensor_gyro_fifo - // static constexpr uint32_t FIFO_MAX_SAMPLES{math::min(math::min(FIFO::SIZE / sizeof(FIFO::DATA), sizeof(sensor_gyro_fifo_s::x) / sizeof(sensor_gyro_fifo_s::x[0])), sizeof(sensor_accel_fifo_s::x) / sizeof(sensor_accel_fifo_s::x[0]) * (int)(GYRO_RATE / ACCEL_RATE))}; - static constexpr uint32_t FIFO_MAX_SAMPLES{10}; - - // Transfer data - struct FIFOTransferBuffer { - uint8_t cmd{static_cast(Register::BANK_0::INT_STATUS) | DIR_READ}; - uint8_t INT_STATUS{0}; - uint8_t FIFO_COUNTH{0}; - uint8_t FIFO_COUNTL{0}; - FIFO::DATA f[FIFO_MAX_SAMPLES] {}; - }; - // ensure no struct padding - static_assert(sizeof(FIFOTransferBuffer) == (4 + FIFO_MAX_SAMPLES *sizeof(FIFO::DATA)), - "Invalid FIFOTransferBuffer size"); - - struct register_bank0_config_t { - Register::BANK_0 reg; - uint8_t set_bits{0}; - uint8_t clear_bits{0}; - }; - - struct register_bank1_config_t { - Register::BANK_1 reg; - uint8_t set_bits{0}; - uint8_t clear_bits{0}; - }; - - struct register_bank2_config_t { - Register::BANK_2 reg; - uint8_t set_bits{0}; - uint8_t clear_bits{0}; - }; - - int probe() override; - - bool Reset(); - - bool Configure(); - void ConfigureSampleRate(int sample_rate); - void ConfigureFIFOWatermark(uint8_t samples); - - void SelectRegisterBank(enum REG_BANK_SEL_BIT bank, bool force = false); - void SelectRegisterBank(Register::BANK_0 reg) { SelectRegisterBank(REG_BANK_SEL_BIT::USER_BANK_0); } - void SelectRegisterBank(Register::BANK_1 reg) { SelectRegisterBank(REG_BANK_SEL_BIT::USER_BANK_1); } - void SelectRegisterBank(Register::BANK_2 reg) { SelectRegisterBank(REG_BANK_SEL_BIT::USER_BANK_2); } - - static int DataReadyInterruptCallback(int irq, void *context, void *arg); - void DataReady(); - bool DataReadyInterruptConfigure(); - bool DataReadyInterruptDisable(); - - template bool RegisterCheck(const T ®_cfg); - template uint8_t RegisterRead(T reg); - template void RegisterWrite(T reg, uint8_t value); - template void RegisterSetAndClearBits(T reg, uint8_t setbits, uint8_t clearbits); - template void RegisterSetBits(T reg, uint8_t setbits) { RegisterSetAndClearBits(reg, setbits, 0); } - template void RegisterClearBits(T reg, uint8_t clearbits) { RegisterSetAndClearBits(reg, 0, clearbits); } - - uint16_t FIFOReadCount(); - bool FIFORead(const hrt_abstime ×tamp_sample, uint16_t samples); - void FIFOReset(); - - void ProcessIMU(const hrt_abstime ×tamp_sample, const FIFO::DATA &fifo); - void ProcessAccel(const hrt_abstime ×tamp_sample, const FIFO::DATA fifo[], const uint8_t samples); - void ProcessGyro(const hrt_abstime ×tamp_sample, const FIFO::DATA fifo[], const uint8_t samples); - bool ProcessTemperature(const FIFO::DATA fifo[], const uint8_t samples); - - const spi_drdy_gpio_t _drdy_gpio; - - // std::shared_ptr _px4_accel; - // std::shared_ptr _px4_gyro; - PX4Accelerometer _px4_accel; - PX4Gyroscope _px4_gyro; - - perf_counter_t _bad_register_perf{perf_alloc(PC_COUNT, MODULE_NAME": bad register")}; - perf_counter_t _bad_transfer_perf{perf_alloc(PC_COUNT, MODULE_NAME": bad transfer")}; - perf_counter_t _fifo_empty_perf{perf_alloc(PC_COUNT, MODULE_NAME": FIFO empty")}; - perf_counter_t _fifo_overflow_perf{perf_alloc(PC_COUNT, MODULE_NAME": FIFO overflow")}; - perf_counter_t _fifo_reset_perf{perf_alloc(PC_COUNT, MODULE_NAME": FIFO reset")}; - perf_counter_t _drdy_missed_perf{nullptr}; - - hrt_abstime _reset_timestamp{0}; - hrt_abstime _last_config_check_timestamp{0}; - hrt_abstime _temperature_update_timestamp{0}; - int _failure_count{0}; - - enum REG_BANK_SEL_BIT _last_register_bank {REG_BANK_SEL_BIT::USER_BANK_0}; - - px4::atomic _drdy_fifo_read_samples{0}; - bool _data_ready_interrupt_enabled{false}; - - enum class STATE : uint8_t { - RESET, - WAIT_FOR_RESET, - CONFIGURE, - FIFO_READ, - } _state{STATE::RESET}; - - uint16_t _fifo_empty_interval_us{1250}; // default 1250 us / 800 Hz transfer interval - uint32_t _fifo_gyro_samples{static_cast(_fifo_empty_interval_us / (1000000 / GYRO_RATE))}; - - uint8_t _checked_register_bank0{0}; - static constexpr uint8_t size_register_bank0_cfg{12}; - register_bank0_config_t _register_bank0_cfg[size_register_bank0_cfg] { - // Register | Set bits, Clear bits - { Register::BANK_0::INT_CONFIG, INT_CONFIG_BIT::INT1_MODE | INT_CONFIG_BIT::INT1_DRIVE_CIRCUIT, INT_CONFIG_BIT::INT1_POLARITY }, - { Register::BANK_0::FIFO_CONFIG, FIFO_CONFIG_BIT::FIFO_MODE_STOP_ON_FULL, 0 }, - { Register::BANK_0::GYRO_CONFIG0, GYRO_CONFIG0_BIT::GYRO_FS_SEL_2000_DPS | GYRO_CONFIG0_BIT::GYRO_ODR_8KHZ_SET, GYRO_CONFIG0_BIT::GYRO_ODR_8KHZ_CLEAR }, - { Register::BANK_0::ACCEL_CONFIG0, ACCEL_CONFIG0_BIT::ACCEL_FS_SEL_16G | ACCEL_CONFIG0_BIT::ACCEL_ODR_8KHZ_SET, ACCEL_CONFIG0_BIT::ACCEL_ODR_8KHZ_CLEAR }, - { Register::BANK_0::GYRO_CONFIG1, 0, GYRO_CONFIG1_BIT::GYRO_UI_FILT_ORD }, - { Register::BANK_0::GYRO_ACCEL_CONFIG0, 0, GYRO_ACCEL_CONFIG0_BIT::ACCEL_UI_FILT_BW | GYRO_ACCEL_CONFIG0_BIT::GYRO_UI_FILT_BW }, - { Register::BANK_0::ACCEL_CONFIG1, 0, ACCEL_CONFIG1_BIT::ACCEL_UI_FILT_ORD }, - { Register::BANK_0::FIFO_CONFIG1, FIFO_CONFIG1_BIT::FIFO_WM_GT_TH | FIFO_CONFIG1_BIT::FIFO_HIRES_EN | FIFO_CONFIG1_BIT::FIFO_TEMP_EN | FIFO_CONFIG1_BIT::FIFO_GYRO_EN | FIFO_CONFIG1_BIT::FIFO_ACCEL_EN, 0 }, - { Register::BANK_0::FIFO_CONFIG2, 0, 0 }, // FIFO_WM[7:0] set at runtime - { Register::BANK_0::FIFO_CONFIG3, 0, 0 }, // FIFO_WM[11:8] set at runtime - { Register::BANK_0::INT_CONFIG0, INT_CONFIG0_BIT::CLEAR_ON_FIFO_READ, 0 }, - { Register::BANK_0::INT_SOURCE0, INT_SOURCE0_BIT::FIFO_THS_INT1_EN, 0 }, - }; - - uint8_t _checked_register_bank1{0}; - static constexpr uint8_t size_register_bank1_cfg{4}; - register_bank1_config_t _register_bank1_cfg[size_register_bank1_cfg] { - // Register | Set bits, Clear bits - { Register::BANK_1::GYRO_CONFIG_STATIC2, 0, GYRO_CONFIG_STATIC2_BIT::GYRO_NF_DIS | GYRO_CONFIG_STATIC2_BIT::GYRO_AAF_DIS }, - { Register::BANK_1::GYRO_CONFIG_STATIC3, GYRO_CONFIG_STATIC3_BIT::GYRO_AAF_DELT_SET, GYRO_CONFIG_STATIC3_BIT::GYRO_AAF_DELT_CLEAR}, - { Register::BANK_1::GYRO_CONFIG_STATIC4, GYRO_CONFIG_STATIC4_BIT::GYRO_AAF_DELTSQR_LOW_SET, GYRO_CONFIG_STATIC4_BIT::GYRO_AAF_DELTSQR_LOW_CLEAR}, - { Register::BANK_1::GYRO_CONFIG_STATIC5, GYRO_CONFIG_STATIC5_BIT::GYRO_AAF_BITSHIFT_SET | GYRO_CONFIG_STATIC5_BIT::GYRO_AAF_DELTSQR_HIGH_SET, GYRO_CONFIG_STATIC5_BIT::GYRO_AAF_BITSHIFT_CLEAR | GYRO_CONFIG_STATIC5_BIT::GYRO_AAF_DELTSQR_HIGH_CLEAR}, - }; - - uint8_t _checked_register_bank2{0}; - static constexpr uint8_t size_register_bank2_cfg{3}; - register_bank2_config_t _register_bank2_cfg[size_register_bank2_cfg] { - // Register | Set bits, Clear bits - { Register::BANK_2::ACCEL_CONFIG_STATIC2, ACCEL_CONFIG_STATIC2_BIT::ACCEL_AAF_DELT_SET, ACCEL_CONFIG_STATIC2_BIT::ACCEL_AAF_DELT_CLEAR | ACCEL_CONFIG_STATIC2_BIT::ACCEL_AAF_DIS }, - { Register::BANK_2::ACCEL_CONFIG_STATIC3, ACCEL_CONFIG_STATIC3_BIT::ACCEL_AAF_DELTSQR_LOW_SET, ACCEL_CONFIG_STATIC3_BIT::ACCEL_AAF_DELTSQR_LOW_CLEAR }, - { Register::BANK_2::ACCEL_CONFIG_STATIC4, ACCEL_CONFIG_STATIC4_BIT::ACCEL_AAF_BITSHIFT_SET | ACCEL_CONFIG_STATIC4_BIT::ACCEL_AAF_DELTSQR_HIGH_SET, ACCEL_CONFIG_STATIC4_BIT::ACCEL_AAF_BITSHIFT_CLEAR | ACCEL_CONFIG_STATIC4_BIT::ACCEL_AAF_DELTSQR_HIGH_CLEAR }, - }; - - uint32_t _temperature_samples{0}; - - // Support for the IMU server - // uint32_t _imu_server_index{0}; - // imu_server_s _imu_server_data; - // uORB::Publication _imu_server_pub{ORB_ID(imu_server)}; - -}; diff --git a/boards/modalai/voxl2-slpi/src/drivers/icm42688p/InvenSense_ICM42688P_registers.hpp b/boards/modalai/voxl2-slpi/src/drivers/icm42688p/InvenSense_ICM42688P_registers.hpp deleted file mode 100644 index b3c020b..0000000 --- a/boards/modalai/voxl2-slpi/src/drivers/icm42688p/InvenSense_ICM42688P_registers.hpp +++ /dev/null @@ -1,430 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -/** - * @file InvenSense_ICM42688P_registers.hpp - * - * Invensense ICM-42688-P registers. - * - */ - -#pragma once - -#include - -namespace InvenSense_ICM42688P -{ -// TODO: move to a central header -static constexpr uint8_t Bit0 = (1 << 0); -static constexpr uint8_t Bit1 = (1 << 1); -static constexpr uint8_t Bit2 = (1 << 2); -static constexpr uint8_t Bit3 = (1 << 3); -static constexpr uint8_t Bit4 = (1 << 4); -static constexpr uint8_t Bit5 = (1 << 5); -static constexpr uint8_t Bit6 = (1 << 6); -static constexpr uint8_t Bit7 = (1 << 7); - -static constexpr uint32_t SPI_SPEED = 24 * 1000 * 1000; // 24 MHz SPI -static constexpr uint8_t DIR_READ = 0x80; - -static constexpr uint8_t WHOAMI = 0x47; - -static constexpr float TEMPERATURE_SENSITIVITY = 132.48f; // LSB/C -static constexpr float TEMPERATURE_OFFSET = 25.f; // C - -namespace Register -{ - -enum class BANK_0 : uint8_t { - DEVICE_CONFIG = 0x11, - - INT_CONFIG = 0x14, - - FIFO_CONFIG = 0x16, - - TEMP_DATA1 = 0x1D, - TEMP_DATA0 = 0x1E, - - INT_STATUS = 0x2D, - FIFO_COUNTH = 0x2E, - FIFO_COUNTL = 0x2F, - FIFO_DATA = 0x30, - - SIGNAL_PATH_RESET = 0x4B, - INTF_CONFIG0 = 0x4C, - INTF_CONFIG1 = 0x4D, - PWR_MGMT0 = 0x4E, - GYRO_CONFIG0 = 0x4F, - ACCEL_CONFIG0 = 0x50, - GYRO_CONFIG1 = 0x51, - GYRO_ACCEL_CONFIG0 = 0x52, - ACCEL_CONFIG1 = 0x53, - - FIFO_CONFIG1 = 0x5F, - FIFO_CONFIG2 = 0x60, - FIFO_CONFIG3 = 0x61, - - INT_CONFIG0 = 0x63, - - INT_SOURCE0 = 0x65, - - SELF_TEST_CONFIG = 0x70, - - WHO_AM_I = 0x75, - REG_BANK_SEL = 0x76, -}; - -enum class BANK_1 : uint8_t { - GYRO_CONFIG_STATIC2 = 0x0B, - GYRO_CONFIG_STATIC3 = 0x0C, - GYRO_CONFIG_STATIC4 = 0x0D, - GYRO_CONFIG_STATIC5 = 0x0E, - INTF_CONFIG5 = 0x7B, -}; -enum class BANK_2 : uint8_t { - ACCEL_CONFIG_STATIC2 = 0x03, - ACCEL_CONFIG_STATIC3 = 0x04, - ACCEL_CONFIG_STATIC4 = 0x05, -}; - -}; - -//---------------- BANK0 Register bits - -// DEVICE_CONFIG -enum DEVICE_CONFIG_BIT : uint8_t { - SOFT_RESET_CONFIG = Bit0, // -}; - -// INT_CONFIG -enum INT_CONFIG_BIT : uint8_t { - INT1_MODE = Bit2, - INT1_DRIVE_CIRCUIT = Bit1, - INT1_POLARITY = Bit0, -}; - -// FIFO_CONFIG -enum FIFO_CONFIG_BIT : uint8_t { - // 7:6 FIFO_MODE - FIFO_MODE_STOP_ON_FULL = Bit7 | Bit6, // 11: STOP-on-FULL Mode -}; - -// INT_STATUS -enum INT_STATUS_BIT : uint8_t { - RESET_DONE_INT = Bit4, - DATA_RDY_INT = Bit3, - FIFO_THS_INT = Bit2, - FIFO_FULL_INT = Bit1, -}; - -// SIGNAL_PATH_RESET -enum SIGNAL_PATH_RESET_BIT : uint8_t { - ABORT_AND_RESET = Bit3, - FIFO_FLUSH = Bit1, -}; - -// PWR_MGMT0 -enum PWR_MGMT0_BIT : uint8_t { - GYRO_MODE_LOW_NOISE = Bit3 | Bit2, // 11: Places gyroscope in Low Noise (LN) Mode - ACCEL_MODE_LOW_NOISE = Bit1 | Bit0, // 11: Places accelerometer in Low Noise (LN) Mode -}; - -// GYRO_CONFIG0 -enum GYRO_CONFIG0_BIT : uint8_t { - // 7:5 GYRO_FS_SEL - GYRO_FS_SEL_2000_DPS = 0, // 0b000 = ±2000dps (default) - GYRO_FS_SEL_1000_DPS = Bit5, - GYRO_FS_SEL_500_DPS = Bit6, - GYRO_FS_SEL_250_DPS = Bit6 | Bit5, - GYRO_FS_SEL_125_DPS = Bit7, - - - // 3:0 GYRO_ODR - // 0001: 32kHz - GYRO_ODR_32KHZ_SET = Bit0, - GYRO_ODR_32KHZ_CLEAR = Bit3 | Bit2 | Bit0, - // 0010: 16kHz - GYRO_ODR_16KHZ_SET = Bit1, - GYRO_ODR_16KHZ_CLEAR = Bit3 | Bit2 | Bit0, - // 0011: 8kHz - GYRO_ODR_8KHZ_SET = Bit1 | Bit0, - GYRO_ODR_8KHZ_CLEAR = Bit3 | Bit2, - // 0110: 1kHz (default) - GYRO_ODR_1KHZ_SET = Bit2 | Bit1, - GYRO_ODR_1KHZ_CLEAR = Bit3 | Bit0, -}; - -// ACCEL_CONFIG0 -enum ACCEL_CONFIG0_BIT : uint8_t { - // 7:5 ACCEL_FS_SEL - ACCEL_FS_SEL_16G = 0, // 000: ±16g (default) - ACCEL_FS_SEL_8G = Bit5, - ACCEL_FS_SEL_4G = Bit6, - ACCEL_FS_SEL_2G = Bit6 | Bit5, - - - // 3:0 ACCEL_ODR - // 0001: 32kHz - ACCEL_ODR_32KHZ_SET = Bit0, - ACCEL_ODR_32KHZ_CLEAR = Bit3 | Bit2 | Bit0, - // 0010: 16kHz - ACCEL_ODR_16KHZ_SET = Bit1, - ACCEL_ODR_16KHZ_CLEAR = Bit3 | Bit2 | Bit0, - // 0011: 8kHz - ACCEL_ODR_8KHZ_SET = Bit1 | Bit0, - ACCEL_ODR_8KHZ_CLEAR = Bit3 | Bit2, - // 0110: 1kHz (default) - ACCEL_ODR_1KHZ_SET = Bit2 | Bit1, - ACCEL_ODR_1KHZ_CLEAR = Bit3 | Bit0, -}; - -// GYRO_CONFIG1 -enum GYRO_CONFIG1_BIT : uint8_t { - GYRO_UI_FILT_ORD = Bit3 | Bit2, // 00: 1st Order -}; - -// GYRO_ACCEL_CONFIG0 -enum GYRO_ACCEL_CONFIG0_BIT : uint8_t { - // 7:4 ACCEL_UI_FILT_BW - ACCEL_UI_FILT_BW = Bit7 | Bit6 | Bit5 | Bit4, // 0: BW=ODR/2 - - // 3:0 GYRO_UI_FILT_BW - GYRO_UI_FILT_BW = Bit3 | Bit2 | Bit1 | Bit0, // 0: BW=ODR/2 -}; - -// ACCEL_CONFIG1 -enum ACCEL_CONFIG1_BIT : uint8_t { - ACCEL_UI_FILT_ORD = Bit4 | Bit3, // 00: 1st Order -}; - -// FIFO_CONFIG1 -enum FIFO_CONFIG1_BIT : uint8_t { - FIFO_RESUME_PARTIAL_RD = Bit6, - FIFO_WM_GT_TH = Bit5, - FIFO_HIRES_EN = Bit4, - FIFO_TEMP_EN = Bit2, - FIFO_GYRO_EN = Bit1, - FIFO_ACCEL_EN = Bit0, -}; - -// INT_CONFIG0 -enum INT_CONFIG0_BIT : uint8_t { - // 3:2 FIFO_THS_INT_CLEAR - CLEAR_ON_FIFO_READ = Bit3, -}; - -// INT_SOURCE0 -enum INT_SOURCE0_BIT : uint8_t { - UI_FSYNC_INT1_EN = Bit6, - PLL_RDY_INT1_EN = Bit5, - RESET_DONE_INT1_EN = Bit4, - UI_DRDY_INT1_EN = Bit3, - FIFO_THS_INT1_EN = Bit2, // FIFO threshold interrupt routed to INT1 - FIFO_FULL_INT1_EN = Bit1, - UI_AGC_RDY_INT1_EN = Bit0, -}; - -// REG_BANK_SEL -enum REG_BANK_SEL_BIT : uint8_t { - USER_BANK_0 = 0, // 0: Select USER BANK 0. - USER_BANK_1 = Bit0, // 1: Select USER BANK 1. - USER_BANK_2 = Bit1, // 2: Select USER BANK 2. - USER_BANK_3 = Bit1 | Bit0, // 3: Select USER BANK 3. -}; - - -//---------------- BANK1 Register bits - -// GYRO_CONFIG_STATIC2 -enum GYRO_CONFIG_STATIC2_BIT : uint8_t { - GYRO_AAF_DIS = Bit1, - GYRO_NF_DIS = Bit0, -}; - -// GYRO_CONFIG_STATIC3 -enum GYRO_CONFIG_STATIC3_BIT : uint8_t { - - // 585 Hz - GYRO_AAF_DELT_SET = Bit3 | Bit2 | Bit0, //13 - GYRO_AAF_DELT_CLEAR = Bit5 | Bit4 | Bit1, - - // 213 Hz - // GYRO_AAF_DELT_SET = Bit2 | Bit0, //5 - // GYRO_AAF_DELT_CLEAR = Bit5 | Bit4 | Bit3 | Bit1, - - // 126 Hz - //GYRO_AAF_DELT_SET = Bit1 | Bit0, //3 - //GYRO_AAF_DELT_CLEAR = Bit5 | Bit4 | Bit3 | Bit2, - - // 42 Hz - // GYRO_AAF_DELT_SET = Bit0, //1 - // GYRO_AAF_DELT_CLEAR = Bit5 | Bit4 | Bit3 | Bit2 | Bit1, - -}; - -// GYRO_CONFIG_STATIC4 -enum GYRO_CONFIG_STATIC4_BIT : uint8_t { - - // 585 Hz - GYRO_AAF_DELTSQR_LOW_SET = Bit7 | Bit5 | Bit3 | Bit1, //170 - GYRO_AAF_DELTSQR_LOW_CLEAR = Bit6 | Bit4 | Bit2 | Bit0, - - // 213 Hz - // GYRO_AAF_DELTSQR_LOW_SET = Bit4 | Bit3 | Bit0, //25 - // GYRO_AAF_DELTSQR_LOW_CLEAR = Bit7 | Bit6 | Bit5 | Bit2 | Bit1, - - // 126 Hz - //GYRO_AAF_DELTSQR_LOW_SET = Bit3 | Bit0, //9 - //GYRO_AAF_DELTSQR_LOW_CLEAR = Bit7 | Bit6 | Bit5 | Bit4 | Bit2 | Bit1, - - // 42 Hz - // GYRO_AAF_DELTSQR_LOW_SET = Bit0, //1 - // GYRO_AAF_DELTSQR_LOW_CLEAR = Bit7 | Bit6 | Bit5 | Bit4 | Bit3 | Bit2 | Bit1, -}; - -// GYRO_CONFIG_STATIC5 -enum GYRO_CONFIG_STATIC5_BIT : uint8_t { - - // 585 Hz - GYRO_AAF_DELTSQR_HIGH_SET = 0, - GYRO_AAF_DELTSQR_HIGH_CLEAR = Bit3 | Bit2 | Bit1 | Bit0, - GYRO_AAF_BITSHIFT_SET = Bit7, // 8 << 4 - GYRO_AAF_BITSHIFT_CLEAR = Bit6 | Bit5 | Bit4, - - // 213 Hz - // GYRO_AAF_DELTSQR_HIGH_SET = 0, - // GYRO_AAF_DELTSQR_HIGH_CLEAR = Bit3 | Bit2 | Bit1 | Bit0, - // GYRO_AAF_BITSHIFT_SET = Bit7 | Bit5, //10 - // GYRO_AAF_BITSHIFT_CLEAR = Bit6 | Bit4, - - // 126 Hz - // GYRO_AAF_BITSHIFT_SET = Bit7 | Bit6, //12 - // GYRO_AAF_BITSHIFT_CLEAR = Bit5 | Bit4, - - // 42 Hz - // GYRO_AAF_BITSHIFT_SET = Bit7 | Bit6 | Bit5 | Bit4, //15 - // GYRO_AAF_BITSHIFT_CLEAR = 0, - - -}; - - -//---------------- BANK2 Register bits - -// ACCEL_CONFIG_STATIC2 -enum ACCEL_CONFIG_STATIC2_BIT : uint8_t { - ACCEL_AAF_DIS = Bit0, - ACCEL_AAF_DELT = Bit3 | Bit1, - - // 213 Hz - ACCEL_AAF_DELT_SET = Bit3 | Bit1, //5 - ACCEL_AAF_DELT_CLEAR = Bit6 | Bit5 | Bit4 | Bit2, - - // 42 Hz - // ACCEL_AAF_DELT_SET = Bit1, //1 - // ACCEL_AAF_DELT_CLEAR = Bit6 | Bit5 | Bit4 | Bit3 | Bit2, -}; - -// ACCEL_CONFIG_STATIC3 -enum ACCEL_CONFIG_STATIC3_BIT : uint8_t { - ACCEL_AAF_DELTSQR_LOW = Bit4 | Bit3 | Bit0, - // 213 Hz - ACCEL_AAF_DELTSQR_LOW_SET = Bit4 | Bit3 | Bit0, //25 - ACCEL_AAF_DELTSQR_LOW_CLEAR = Bit7 | Bit6 | Bit5 | Bit2 | Bit1, - - // 42 Hz - // ACCEL_AAF_DELTSQR_LOW_SET = Bit0, //1 - // ACCEL_AAF_DELTSQR_LOW_CLEAR = Bit7 | Bit6 | Bit5 | Bit4 | Bit3 | Bit2 | Bit1, - -}; - -// ACCEL_CONFIG_STATIC4 -enum ACCEL_CONFIG_STATIC4_BIT : uint8_t { - ACCEL_AAF_BITSHIFT = Bit7 | Bit5, - ACCEL_AAF_DELTSQR_HIGH = 0, - // 213 Hz - ACCEL_AAF_BITSHIFT_SET = Bit7 | Bit5, //10 - ACCEL_AAF_BITSHIFT_CLEAR = Bit6 | Bit4, - - // 42 Hz - // ACCEL_AAF_BITSHIFT_SET = Bit7 | Bit6 | Bit5 | Bit4, //15 - // ACCEL_AAF_BITSHIFT_CLEAR = 0, - - ACCEL_AAF_DELTSQR_HIGH_SET = 0, - ACCEL_AAF_DELTSQR_HIGH_CLEAR = Bit3 | Bit2 | Bit1 | Bit0, -}; - - -namespace FIFO -{ -static constexpr size_t SIZE = 2048; - -// FIFO_DATA layout when FIFO_CONFIG1 has FIFO_GYRO_EN and FIFO_ACCEL_EN set - -// Packet 4 -struct DATA { - uint8_t FIFO_Header; - uint8_t ACCEL_DATA_X1; // Accel X [19:12] - uint8_t ACCEL_DATA_X0; // Accel X [11:4] - uint8_t ACCEL_DATA_Y1; // Accel Y [19:12] - uint8_t ACCEL_DATA_Y0; // Accel Y [11:4] - uint8_t ACCEL_DATA_Z1; // Accel Z [19:12] - uint8_t ACCEL_DATA_Z0; // Accel Z [11:4] - uint8_t GYRO_DATA_X1; // Gyro X [19:12] - uint8_t GYRO_DATA_X0; // Gyro X [11:4] - uint8_t GYRO_DATA_Y1; // Gyro Y [19:12] - uint8_t GYRO_DATA_Y0; // Gyro Y [11:4] - uint8_t GYRO_DATA_Z1; // Gyro Z [19:12] - uint8_t GYRO_DATA_Z0; // Gyro Z [11:4] - uint8_t TEMP_DATA1; // Temperature[15:8] - uint8_t TEMP_DATA0; // Temperature[7:0] - uint8_t TimeStamp_h; // TimeStamp[15:8] - uint8_t TimeStamp_l; // TimeStamp[7:0] - uint8_t Ext_Accel_X_Gyro_X; // Accel X [3:0] Gyro X [3:0] - uint8_t Ext_Accel_Y_Gyro_Y; // Accel Y [3:0] Gyro Y [3:0] - uint8_t Ext_Accel_Z_Gyro_Z; // Accel Z [3:0] Gyro Z [3:0] -}; - -// With FIFO_ACCEL_EN and FIFO_GYRO_EN header should be 8’b_0110_10xx -enum FIFO_HEADER_BIT : uint8_t { - HEADER_MSG = Bit7, // 1: FIFO is empty - HEADER_ACCEL = Bit6, // 1: Packet is sized so that accel data have location in the packet, FIFO_ACCEL_EN must be 1 - HEADER_GYRO = Bit5, // 1: Packet is sized so that gyro data have location in the packet, FIFO_GYRO_EN must be1 - HEADER_20 = Bit4, // 1: Packet has a new and valid sample of extended 20-bit data for gyro and/or accel - HEADER_TIMESTAMP_FSYNC = Bit3 | Bit2, - HEADER_ODR_ACCEL = Bit1, // 1: The ODR for accel is different for this accel data packet compared to the previous accel packet - HEADER_ODR_GYRO = Bit0, // 1: The ODR for gyro is different for this gyro data packet compared to the previous gyro packet -}; - -} -} // namespace InvenSense_ICM42688P diff --git a/boards/modalai/voxl2-slpi/src/drivers/icm42688p/icm42688p_main.cpp b/boards/modalai/voxl2-slpi/src/drivers/icm42688p/icm42688p_main.cpp deleted file mode 100644 index 38deecd..0000000 --- a/boards/modalai/voxl2-slpi/src/drivers/icm42688p/icm42688p_main.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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 "ICM42688P.hpp" - -#include -#include -#include - -void ICM42688P::print_usage() -{ - PRINT_MODULE_USAGE_NAME("icm42688p", "driver"); - PRINT_MODULE_USAGE_SUBCATEGORY("imu"); - PRINT_MODULE_USAGE_COMMAND("start"); - PRINT_MODULE_USAGE_PARAMS_I2C_SPI_DRIVER(false, true); - PRINT_MODULE_USAGE_PARAM_INT('R', 0, 0, 35, "Rotation", true); - PRINT_MODULE_USAGE_DEFAULT_COMMANDS(); -} - -// I2CSPIDriverBase *ICM42688P::instantiate(const BusCLIArguments &cli, const BusInstanceIterator &iterator, -// int runtime_instance) -// { -// ICM42688P *instance = new ICM42688P(iterator.configuredBusOption(), iterator.bus(), iterator.devid(), cli.rotation, -// cli.bus_frequency, cli.spi_mode, iterator.DRDYGPIO()); -// -// if (!instance) { -// PX4_ERR("alloc failed"); -// return nullptr; -// } -// -// if (OK != instance->init()) { -// delete instance; -// return nullptr; -// } -// -// return instance; -// } - -extern "C" int icm42688p_main(int argc, char *argv[]) -{ - - for (int i = 0; i <= argc - 1; i++) { - if (std::string(argv[i]) == "-h") { - argv[i] = 0; - hitl_mode = true; - break; - } - } - - int ch; - using ThisDriver = ICM42688P; - BusCLIArguments cli{false, true}; - cli.default_spi_frequency = SPI_SPEED; - - while ((ch = cli.getOpt(argc, argv, "R:")) != EOF) { - switch (ch) { - case 'R': - cli.rotation = (enum Rotation)atoi(cli.optArg()); - break; - } - } - - const char *verb = cli.optArg(); - - if (!verb) { - ThisDriver::print_usage(); - return -1; - } - - BusInstanceIterator iterator(MODULE_NAME, cli, DRV_IMU_DEVTYPE_ICM42688P); - - if (!strcmp(verb, "start")) { - return ThisDriver::module_start(cli, iterator); - } - - if (!strcmp(verb, "stop")) { - return ThisDriver::module_stop(iterator); - } - - if (!strcmp(verb, "status")) { - return ThisDriver::module_status(iterator); - } - - ThisDriver::print_usage(); - return -1; -} diff --git a/boards/modalai/voxl2-slpi/src/drivers/mavlink_rc_in/CMakeLists.txt b/boards/modalai/voxl2-slpi/src/drivers/mavlink_rc_in/CMakeLists.txt deleted file mode 100644 index eb2bf73..0000000 --- a/boards/modalai/voxl2-slpi/src/drivers/mavlink_rc_in/CMakeLists.txt +++ /dev/null @@ -1,49 +0,0 @@ -############################################################################ -# -# 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. -# -############################################################################ - -message(STATUS "Mavlink include directory: ${PX4_SOURCE_DIR}/../build/modalai_voxl2_default/mavlink/standard") - -px4_add_module( - MODULE drivers__modalai__mavlink_rc_in - MAIN mavlink_rc_in - COMPILE_FLAGS - -Wno-cast-align # TODO: fix and enable - -Wno-address-of-packed-member # TODO: fix in c_library_v2 - INCLUDES - ${PX4_SOURCE_DIR}/src/drivers/rc_input - ${PX4_SOURCE_DIR}/build/modalai_voxl2_default/mavlink/common - SRCS - mavlink_rc_in.cpp - DEPENDS - px4_work_queue - ) diff --git a/boards/modalai/voxl2-slpi/src/drivers/mavlink_rc_in/mavlink_rc_in.cpp b/boards/modalai/voxl2-slpi/src/drivers/mavlink_rc_in/mavlink_rc_in.cpp deleted file mode 100644 index 709f7e2..0000000 --- a/boards/modalai/voxl2-slpi/src/drivers/mavlink_rc_in/mavlink_rc_in.cpp +++ /dev/null @@ -1,527 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "uORB/uORBManager.hpp" -#include -#include -#include -#include - - -#define ASYNC_UART_READ_WAIT_US 500 -#define RC_INPUT_RSSI_MAX 100 - -#define TX_BUFFER_LEN 20 - -extern "C" { __EXPORT int mavlink_rc_in_main(int argc, char *argv[]); } - -namespace mavlink_rc_in -{ - -static bool _is_running = false; -volatile bool _task_should_exit = false; - -static px4_task_t _task_handle = -1; -static px4_task_t _mav_task_handle = -1; - -static int _uart_fd = -1; - -static bool debug = false; -static bool mav_en = true; -static bool crsf_en = false; -static bool fake_heartbeat_enable = true; -static bool filter_local_rc_messages = true; -static bool dump_received_messages = false; -static bool dump_transmitted_messages = false; - -std::string port = "7"; -uint32_t baudrate = 115200; - -uORB::PublicationMulti _rc_pub{ORB_ID(input_rc)}; -uORB::PublicationMulti _radio_status_pub{ORB_ID(radio_status)}; - -perf_counter_t _perf_rx_rate = nullptr; - -static uint8_t _rc_lq; -static uint8_t _rc_rssi_dbm; - -int open_port(const char *dev, speed_t speed); -int close_port(); - -int write_response(void *buf, size_t len); - -int start(int argc, char *argv[]); -int stop(); -int status(); - -void usage(); -void task_main(int argc, char *argv[]); - -void handle_message_dsp(mavlink_message_t *msg); -void handle_message_rc_channels_override_dsp(mavlink_message_t *msg); -void handle_message_radio_status_dsp(mavlink_message_t *msg); - -void handle_message_dsp(mavlink_message_t *msg) -{ - if (debug) { - if (filter_local_rc_messages) { - if ((msg->msgid != MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE) && - (msg->msgid != MAVLINK_MSG_ID_RADIO_STATUS)) { - PX4_INFO("**^^ MSG ID: %d ^^*****************************************************", msg->msgid); - } - - } else { - PX4_INFO("msg ID: %d", msg->msgid); - } - } - - switch (msg->msgid) { - case MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE: - handle_message_rc_channels_override_dsp(msg); - break; - - case MAVLINK_MSG_ID_RADIO_STATUS: - handle_message_radio_status_dsp(msg); - break; - - default: - break; - } -} - -void mavlink_out_task(int argc, char *argv[]) -{ - uint64_t last_heartbeat_timestamp = hrt_absolute_time(); - - while (! _task_should_exit) { - uint64_t timestamp = hrt_absolute_time(); - int nwrite = 0; - - // We need to provide heartbeat messages to the receiver. Otherwise it - // won't send us anything! - if ((timestamp - last_heartbeat_timestamp) > 1000000) { - mavlink_heartbeat_t hb = {}; - mavlink_message_t hb_message = {}; - hb.type = MAV_TYPE_QUADROTOR; - hb.autopilot = MAV_AUTOPILOT_PX4; - mavlink_msg_heartbeat_encode(1, 1, &hb_message, &hb); - - uint8_t hb_newBuf[MAVLINK_MAX_PACKET_LEN]; - uint16_t hb_newBufLen = 0; - hb_newBufLen = mavlink_msg_to_send_buffer(hb_newBuf, &hb_message); - - nwrite = qurt_uart_write(_uart_fd, (char *) &hb_newBuf[0], hb_newBufLen); - - if (nwrite != hb_newBufLen) { - PX4_ERR("Heartbeat write failed. Expected %d, got %d", hb_newBufLen, nwrite); - - } else if (debug) { - PX4_INFO("Sending local heartbeat to TBS"); - - if (dump_transmitted_messages) { - for (int i = 0; i <= hb_newBufLen; i += 16) { - PX4_INFO(" %.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x", - hb_newBuf[i + 0], hb_newBuf[i + 1], hb_newBuf[i + 2], hb_newBuf[i + 3], - hb_newBuf[i + 4], hb_newBuf[i + 5], hb_newBuf[i + 6], hb_newBuf[i + 7], - hb_newBuf[i + 8], hb_newBuf[i + 9], hb_newBuf[i + 10], hb_newBuf[i + 11], - hb_newBuf[i + 12], hb_newBuf[i + 13], hb_newBuf[i + 14], hb_newBuf[i + 15]); - } - } - } - - last_heartbeat_timestamp = timestamp; - } - - px4_usleep(100000); - } -} - -void task_main(int argc, char *argv[]) -{ - int ch; - int myoptind = 1; - const char *myoptarg = nullptr; - - while ((ch = px4_getopt(argc, argv, "rtdmclfp:b:", &myoptind, &myoptarg)) != EOF) { - switch (ch) { - case 'd': - debug = true; - PX4_INFO("Setting debug flag on"); - break; - - case 'm': - mav_en = true; - crsf_en = false; - - if (debug) { PX4_INFO("Using MAVLink mode"); } - - break; - - case 'c': - mav_en = false; - crsf_en = true; - - if (debug) { PX4_INFO("Using CRSF mode"); } - - break; - - case 'p': - port = myoptarg; - - if (debug) { PX4_INFO("Setting port to %s", port.c_str()); } - - break; - - case 'b': - baudrate = atoi(myoptarg); - - if (debug) { PX4_INFO("Setting baudrate to %u", baudrate); } - - break; - - case 'f': - fake_heartbeat_enable = false; - - if (debug) { PX4_INFO("Disabling fake heartbeats"); } - - break; - - case 'l': - filter_local_rc_messages = true; - - if (debug) { PX4_INFO("Filtering debug messages from the RC receiver"); } - - break; - - case 'r': - dump_received_messages = true; - - if (debug) { PX4_INFO("Enabling hex dump of received messages"); } - - break; - - case 't': - dump_transmitted_messages = true; - - if (debug) { PX4_INFO("Enabling hex dump of transmitted messages"); } - - break; - - default: - break; - } - } - - if (open_port(port.c_str(), (speed_t) baudrate) == -1) { - PX4_ERR("Failed to open UART"); - return; - } - - _mav_task_handle = px4_task_spawn_cmd("mavlink_rc_in_mav", - SCHED_DEFAULT, - SCHED_PRIORITY_DEFAULT, - 2000, - (px4_main_t)&mavlink_out_task, - (char *const *)argv); - - if (_mav_task_handle < 0) { - PX4_ERR("_mav_task_handle task start failed"); - return; - } - - _is_running = true; - _perf_rx_rate = perf_alloc(PC_INTERVAL, "mavlink_rc_in: rx interval"); - - uint8_t rx_buf[1024]; - mavlink_message_t msg; - mavlink_status_t status{}; - - while (! _task_should_exit) { - // Check for incoming messages from the TBS Crossfire receiver - int nread = qurt_uart_read(_uart_fd, (char *) rx_buf, sizeof(rx_buf), ASYNC_UART_READ_WAIT_US); - - if (nread) { - if (debug) { - PX4_INFO("TBS Crossfire (MAVLink mode): read %d bytes", nread); - - if (dump_received_messages) { - for (int i = 0; i <= nread; i += 16) { - PX4_INFO(" %.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x", - rx_buf[i + 0], rx_buf[i + 1], rx_buf[i + 2], rx_buf[i + 3], - rx_buf[i + 4], rx_buf[i + 5], rx_buf[i + 6], rx_buf[i + 7], - rx_buf[i + 8], rx_buf[i + 9], rx_buf[i + 10], rx_buf[i + 11], - rx_buf[i + 12], rx_buf[i + 13], rx_buf[i + 14], rx_buf[i + 15]); - } - } - } - - //Take buffer and convert it into mavlink msg - for (int i = 0; i < nread; i++) { - if (mavlink_parse_char(MAVLINK_COMM_0, rx_buf[i], &msg, &status)) { - handle_message_dsp(&msg); - } - } - } - - px4_usleep(5000); - } -} - -void handle_message_radio_status_dsp(mavlink_message_t *msg) -{ - if (debug) { PX4_INFO("Radio status msg received"); } - - mavlink_radio_status_t rstatus; - mavlink_msg_radio_status_decode(msg, &rstatus); - - radio_status_s status{}; - - status.timestamp = hrt_absolute_time(); - status.rssi = rstatus.rssi; - status.remote_rssi = rstatus.remrssi; - status.txbuf = rstatus.txbuf; - status.noise = rstatus.noise; - status.remote_noise = rstatus.remnoise; - status.rxerrors = rstatus.rxerrors; - status.fix = rstatus.fixed; - - _radio_status_pub.publish(status); -} - -void handle_message_rc_channels_override_dsp(mavlink_message_t *msg) -{ - mavlink_rc_channels_override_t man; - mavlink_msg_rc_channels_override_decode(msg, &man); - - if (debug) { PX4_INFO("RC channels override msg received"); } - - // Check target - if (man.target_system != 0) { - PX4_ERR("Message has incorrect target system %u", man.target_system); - return; - } - - // fill uORB message - input_rc_s rc{}; - - // metadata - rc.timestamp = hrt_absolute_time(); - rc.timestamp_last_signal = rc.timestamp; - rc.rssi = RC_INPUT_RSSI_MAX; - rc.rc_failsafe = false; - rc.rc_lost = false; - rc.rc_lost_frame_count = 0; - rc.rc_total_frame_count = 1; - rc.rc_ppm_frame_length = 0; - rc.input_source = input_rc_s::RC_INPUT_SOURCE_MAVLINK; - - // channels - rc.values[0] = man.chan1_raw; - rc.values[1] = man.chan2_raw; - rc.values[2] = man.chan3_raw; - rc.values[3] = man.chan4_raw; - rc.values[4] = man.chan5_raw; - rc.values[5] = man.chan6_raw; - rc.values[6] = man.chan7_raw; - rc.values[7] = man.chan8_raw; - rc.values[8] = man.chan9_raw; - rc.values[9] = man.chan10_raw; - rc.values[10] = man.chan11_raw; - rc.values[11] = man.chan12_raw; - rc.values[12] = man.chan13_raw; - rc.values[13] = man.chan14_raw; - rc.values[14] = man.chan15_raw; - rc.values[15] = man.chan16_raw; - rc.values[16] = man.chan17_raw; - rc.values[17] = man.chan18_raw; - - // check how many channels are valid - for (int i = 17; i >= 0; i--) { - const bool ignore_max = rc.values[i] == UINT16_MAX; // ignore any channel with value UINT16_MAX - const bool ignore_zero = (i > 7) && (rc.values[i] == 0); // ignore channel 8-18 if value is 0 - - if (ignore_max || ignore_zero) { - // set all ignored values to zero - rc.values[i] = 0; - - } else { - // first channel to not ignore -> set count considering zero-based index - rc.channel_count = i + 1; - break; - } - } - - // publish uORB message - _rc_pub.publish(rc); -} - -int open_port(const char *dev, speed_t speed) -{ - if (_uart_fd >= 0) { - PX4_ERR("Port already in use: %s", dev); - return -1; - } - - _uart_fd = qurt_uart_open(dev, speed); - - if (_uart_fd < 0) { - PX4_ERR("Error opening port: %s (%i)", dev, errno); - return -1; - - } else if (debug) { PX4_INFO("qurt uart opened successfully"); } - - return 0; -} - -int close_port() -{ - _uart_fd = -1; - - return 0; -} - -int write_response(void *buf, size_t len) -{ - if (_uart_fd < 0 || buf == NULL) { - PX4_ERR("invalid state for writing or buffer"); - return -1; - } - - return qurt_uart_write(_uart_fd, (const char *) buf, len); -} - -int start(int argc, char *argv[]) -{ - if (_is_running) { - PX4_WARN("already running"); - return -1; - } - - _task_should_exit = false; - - _task_handle = px4_task_spawn_cmd("mavlink_rc_in_main", - SCHED_DEFAULT, - SCHED_PRIORITY_DEFAULT, - 2000, - (px4_main_t)&task_main, - (char *const *)argv); - - if (_task_handle < 0) { - PX4_ERR("task start failed"); - return -1; - } - - return 0; -} - -int stop() -{ - if (!_is_running) { - PX4_WARN("not running"); - return -1; - } - - _task_should_exit = true; - - while (_is_running) { - usleep(200000); - PX4_INFO("."); - } - - _task_handle = -1; - return 0; -} - -int status() -{ - PX4_INFO("running: %s", _is_running ? "yes" : "no"); - PX4_INFO(""); - PX4_INFO(" RSSI: %i", _rc_rssi_dbm); - PX4_INFO(" LQ: %i", _rc_lq); - PX4_INFO(""); - perf_print_counter(_perf_rx_rate); - return 0; -} - -void -usage() -{ - PX4_INFO("Usage: mavlink_rc_in {start|info|stop} [options]"); - PX4_INFO("Options: -d enable debug messages"); - PX4_INFO(" -p uart port number"); - PX4_INFO(" -b uart baudrate"); - PX4_INFO(" -c use CRSF protocol over the wire"); - PX4_INFO(" -m use MAVLink protocol over the wire"); - PX4_INFO(" -f disable fake hearbeats"); - PX4_INFO(" -l filter out local rc received debug messages"); - PX4_INFO(" -r enable received messages hex dump"); - PX4_INFO(" -t enable transmitted messages hex dump"); -} - -} - -int mavlink_rc_in_main(int argc, char *argv[]) -{ - int myoptind = 1; - - if (argc <= 1) { - mavlink_rc_in::usage(); - return -1; - } - - const char *verb = argv[myoptind]; - - if (!strcmp(verb, "start")) { - return mavlink_rc_in::start(argc - 1, argv + 1); - - } else if (!strcmp(verb, "stop")) { - return mavlink_rc_in::stop(); - - } else if (!strcmp(verb, "status")) { - return mavlink_rc_in::status(); - - } else { - mavlink_rc_in::usage(); - return -1; - } -} diff --git a/boards/modalai/voxl2-slpi/src/drivers/rc_controller/CMakeLists.txt b/boards/modalai/voxl2-slpi/src/drivers/rc_controller/CMakeLists.txt deleted file mode 100644 index 1c51cb5..0000000 --- a/boards/modalai/voxl2-slpi/src/drivers/rc_controller/CMakeLists.txt +++ /dev/null @@ -1,38 +0,0 @@ -############################################################################ -# -# Copyright (c) 2021 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. -# -############################################################################ -px4_add_module( - MODULE drivers__modalai__rc_controller - MAIN rc_controller - SRCS - rc_controller.cpp - ) diff --git a/boards/modalai/voxl2-slpi/src/drivers/rc_controller/rc_controller.cpp b/boards/modalai/voxl2-slpi/src/drivers/rc_controller/rc_controller.cpp deleted file mode 100644 index 47b8b90..0000000 --- a/boards/modalai/voxl2-slpi/src/drivers/rc_controller/rc_controller.cpp +++ /dev/null @@ -1,256 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-2019 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. - * - ****************************************************************************/ - -/** - * @file px4_simple_app.c - * Minimal application example for PX4 autopilot - * - * @author Example User - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "rc_controller.hpp" - -int RC_ControllerModule::print_status() -{ - PX4_INFO("Running"); - // TODO: print additional runtime information about the state of the module - - return 0; -} - -int RC_ControllerModule::custom_command(int argc, char *argv[]) -{ - if (!is_running()) { - print_usage("not running"); - return 1; - } - - if (!strcmp(argv[0], "throttle")) { - uint16_t val = atoi(argv[1]); - get_instance()->set_throttle(val); - PX4_INFO("Setting throttle to %u", val); - return 0; - } - - if (!strcmp(argv[0], "yaw")) { - uint16_t val = atoi(argv[1]); - get_instance()->set_yaw(val); - PX4_INFO("Setting yaw to %u", val); - return 0; - } - - if (!strcmp(argv[0], "pitch")) { - uint16_t val = atoi(argv[1]); - get_instance()->set_pitch(val); - PX4_INFO("Setting pitch to %u", val); - return 0; - } - - if (!strcmp(argv[0], "roll")) { - uint16_t val = atoi(argv[1]); - get_instance()->set_roll(val); - PX4_INFO("Setting roll to %u", val); - return 0; - } - - return print_usage("unknown command"); -} - - -int RC_ControllerModule::task_spawn(int argc, char *argv[]) -{ - _task_id = px4_task_spawn_cmd("RC_ControllerModule", - SCHED_DEFAULT, - SCHED_PRIORITY_MAX, - 1024, - (px4_main_t)&run_trampoline, - (char *const *)argv); - - if (_task_id < 0) { - _task_id = -1; - return -errno; - } - - return 0; -} - -RC_ControllerModule *RC_ControllerModule::instantiate(int argc, char *argv[]) -{ - // int example_param = 0; - // bool example_flag = false; - // bool error_flag = false; - // - // int myoptind = 1; - // int ch; - // const char *myoptarg = nullptr; - // - // // parse CLI arguments - // while ((ch = px4_getopt(argc, argv, "p:f", &myoptind, &myoptarg)) != EOF) { - // switch (ch) { - // case 'p': - // example_param = (int)strtol(myoptarg, nullptr, 10); - // break; - // - // case 'f': - // example_flag = true; - // break; - // - // case '?': - // error_flag = true; - // break; - // - // default: - // PX4_WARN("unrecognized flag"); - // error_flag = true; - // break; - // } - // } - // - // if (error_flag) { - // return nullptr; - // } - - // RC_ControllerModule *instance = new RC_ControllerModule(example_param, example_flag); - RC_ControllerModule *instance = new RC_ControllerModule(); - - if (instance == nullptr) { - PX4_ERR("alloc failed"); - } - - return instance; -} - -// RC_ControllerModule::RC_ControllerModule(int example_param, bool example_flag) -RC_ControllerModule::RC_ControllerModule() - : ModuleParams(nullptr) -{ - _throttle = 800; - // _yaw = 1500; - // _pitch = 1500; - // _roll = 1500; - _yaw = 800; - _pitch = 800; - _roll = 800; -} - -void RC_ControllerModule::run() -{ - PX4_INFO("ModalAI RC_ControllerModule starting"); - - input_rc_s rc_data; - memset(&rc_data, 0, sizeof(input_rc_s)); - orb_advert_t input_rc_pub_fd = orb_advertise(ORB_ID(input_rc), &rc_data); - - while (!should_exit()) { - - usleep(10000); - - rc_data.input_source = input_rc_s::RC_INPUT_SOURCE_QURT; - rc_data.channel_count = 4; - // for (unsigned i = 0; i < rc_data.channel_count; ++i) { - // rc_data.values[i] = 1024; - // } - rc_data.values[0] = _throttle; - rc_data.values[1] = _yaw; - rc_data.values[2] = _pitch; - rc_data.values[3] = _roll; - - rc_data.timestamp = hrt_absolute_time(); - rc_data.timestamp_last_signal = rc_data.timestamp; - rc_data.rc_ppm_frame_length = 0; - rc_data.rssi = 100; - rc_data.rc_failsafe = false; - rc_data.rc_lost = 0; - rc_data.rc_lost_frame_count = 0; - rc_data.rc_total_frame_count = 0; - - orb_publish(ORB_ID(input_rc), input_rc_pub_fd, &rc_data); - - parameters_update(); - } - - PX4_INFO("RC_ControllerModule Exiting"); -} - -void RC_ControllerModule::parameters_update(bool force) -{ - // check for parameter updates - if (_parameter_update_sub.updated() || force) { - // clear update - parameter_update_s update; - _parameter_update_sub.copy(&update); - - // update parameters from storage - updateParams(); - } -} - -int RC_ControllerModule::print_usage(const char *reason) -{ - if (reason) { - PX4_WARN("%s\n", reason); - } - - // TODO: PRINT_MODULE_DESCRIPTION - - PRINT_MODULE_USAGE_NAME("rc_controller", "driver"); - PRINT_MODULE_USAGE_SUBCATEGORY("rc"); - PRINT_MODULE_USAGE_COMMAND("start"); - PRINT_MODULE_USAGE_DEFAULT_COMMANDS(); - - return 0; -} - -int rc_controller_main(int argc, char *argv[]) -{ - return RC_ControllerModule::main(argc, argv); -} diff --git a/boards/modalai/voxl2-slpi/src/drivers/rc_controller/rc_controller.hpp b/boards/modalai/voxl2-slpi/src/drivers/rc_controller/rc_controller.hpp deleted file mode 100644 index bfcaf40..0000000 --- a/boards/modalai/voxl2-slpi/src/drivers/rc_controller/rc_controller.hpp +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -#pragma once - -#include -#include -#include -#include -#include - -extern "C" __EXPORT int rc_controller_main(int argc, char *argv[]); - -class RC_ControllerModule : public ModuleBase, public ModuleParams -{ -public: - RC_ControllerModule(); - - virtual ~RC_ControllerModule() = default; - - /** @see ModuleBase */ - static int task_spawn(int argc, char *argv[]); - - /** @see ModuleBase */ - static RC_ControllerModule *instantiate(int argc, char *argv[]); - - /** @see ModuleBase */ - static int custom_command(int argc, char *argv[]); - - /** @see ModuleBase */ - static int print_usage(const char *reason = nullptr); - - /** @see ModuleBase::run() */ - void run() override; - - /** @see ModuleBase::print_status() */ - int print_status() override; - - void set_throttle(uint16_t val) { _throttle = val; } - void set_yaw(uint16_t val) { _yaw = val; } - void set_pitch(uint16_t val) { _pitch = val; } - void set_roll(uint16_t val) { _roll = val; } - -private: - - /** - * Check for parameter changes and update them if needed. - * @param parameter_update_sub uorb subscription to parameter_update - * @param force for a parameter update - */ - void parameters_update(bool force = false); - - - DEFINE_PARAMETERS( - (ParamInt) _param_sys_autostart, /**< example parameter */ - (ParamInt) _param_sys_autoconfig /**< another parameter */ - ) - - uint16_t _throttle; - uint16_t _yaw; - uint16_t _pitch; - uint16_t _roll; - - // Subscriptions - // uORB::SubscriptionInterval _parameter_update_sub{ORB_ID(parameter_update), 1_s}; - uORB::SubscriptionInterval _parameter_update_sub{ORB_ID(parameter_update), 1000000}; - -}; diff --git a/boards/modalai/voxl2-slpi/src/drivers/spektrum_rc/CMakeLists.txt b/boards/modalai/voxl2-slpi/src/drivers/spektrum_rc/CMakeLists.txt deleted file mode 100644 index 6d80876..0000000 --- a/boards/modalai/voxl2-slpi/src/drivers/spektrum_rc/CMakeLists.txt +++ /dev/null @@ -1,44 +0,0 @@ -############################################################################ -# -# Copyright (c) 2016 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. -# -############################################################################ - -px4_add_module( - MODULE drivers__spektrum_rc - MAIN spektrum_rc - INCLUDES - ${PX4_SOURCE_DIR}/src/drivers/rc_input - SRCS - spektrum_rc.cpp - DEPENDS - rc - ) - diff --git a/boards/modalai/voxl2-slpi/src/drivers/spektrum_rc/drv_rc_input.h b/boards/modalai/voxl2-slpi/src/drivers/spektrum_rc/drv_rc_input.h deleted file mode 100644 index f9a915a..0000000 --- a/boards/modalai/voxl2-slpi/src/drivers/spektrum_rc/drv_rc_input.h +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-2014 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. - * - ****************************************************************************/ - -/** - * @file drv_rc_input.h - * - * R/C input interface. - */ - -#ifndef _DRV_RC_INPUT_H -#define _DRV_RC_INPUT_H - -#include -#include -#include - -// #include "drv_orb_dev.h" - -/** - * Path for the default R/C input device. - * - * Note that on systems with more than one R/C input path (e.g. - * PX4FMU with PX4IO connected) there may be other devices that - * respond to this protocol. - * - * Input data may be obtained by subscribing to the input_rc - * object, or by poll/reading from the device. - */ -#define RC_INPUT0_DEVICE_PATH "/dev/input_rc0" - -/** - * Maximum RSSI value - */ -#define RC_INPUT_RSSI_MAX 100 - -/** - * Input signal type, value is a control position from zero to 100 - * percent. - */ -typedef uint16_t rc_input_t; - -#define _RC_INPUT_BASE 0x2b00 - -/** Enable RSSI input via ADC */ -#ifdef __PX4_POSIX -#define RC_INPUT_ENABLE_RSSI_ANALOG (_RC_INPUT_BASE | 1) -#else -#define RC_INPUT_ENABLE_RSSI_ANALOG _IOC(_RC_INPUT_BASE, 1) -#endif - -/** Enable RSSI input via PWM signal */ -#ifdef __PX4_POSIX -#define RC_INPUT_ENABLE_RSSI_PWM (_RC_INPUT_BASE | 2) -#else -#define RC_INPUT_ENABLE_RSSI_PWM _IOC(_RC_INPUT_BASE, 2) -#endif - -#endif /* _DRV_RC_INPUT_H */ diff --git a/boards/modalai/voxl2-slpi/src/drivers/spektrum_rc/spektrum_rc.cpp b/boards/modalai/voxl2-slpi/src/drivers/spektrum_rc/spektrum_rc.cpp deleted file mode 100644 index c2405de..0000000 --- a/boards/modalai/voxl2-slpi/src/drivers/spektrum_rc/spektrum_rc.cpp +++ /dev/null @@ -1,358 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2016 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. - * - ****************************************************************************/ - - -/** - * @file spektrum_rc.cpp - * - * This is a driver for a Spektrum satellite receiver connected to a Snapdragon - * on the serial port. By default port J12 (next to J13, power module side) is used. - */ - -#include - -#include -#include -#include - -#include -#include -#include "drv_rc_input.h" -#include - -#ifdef __PX4_QURT -#include -#endif - -#include -#include - -// Snapdraogon: use J12 (next to J13, power module side) -#ifdef __PX4_QURT -#define SPEKTRUM_UART_DEVICE_PATH "7" -#else -#define SPEKTRUM_UART_DEVICE_PATH "/dev/tty-3" -#endif - -#define UNUSED(x) (void)(x) - -extern "C" { __EXPORT int spektrum_rc_main(int argc, char *argv[]); } - - -namespace spektrum_rc -{ - -volatile bool _task_should_exit = false; -static bool _is_running = false; -static px4_task_t _task_handle = -1; - -int start(); -int stop(); -int info(); -void usage(); -void task_main(int argc, char *argv[]); - -void fill_input_rc(uint16_t raw_rc_count, uint16_t raw_rc_values[input_rc_s::RC_INPUT_MAX_CHANNELS], - hrt_abstime now, bool frame_drop, bool failsafe, unsigned frame_drops, int rssi, - input_rc_s &input_rc); - -void task_main(int argc, char *argv[]) -{ - const char *device_path = SPEKTRUM_UART_DEVICE_PATH; - int ch; - int myoptind = 1; - const char *myoptarg = NULL; - bool verbose = false; - - while ((ch = px4_getopt(argc, argv, "vd:", &myoptind, &myoptarg)) != EOF) { - switch (ch) { - case 'd': - device_path = myoptarg; - break; - - case 'v': - PX4_INFO("Spektrum RC: Enabling verbose mode"); - verbose = true; - break; - - default: - break; - } - } - - int uart_fd = dsm_init(device_path); - - if (uart_fd < 0) { - PX4_ERR("dsm init failed"); - return; - - } else if (verbose) { - PX4_INFO("Spektrum RC: dsm_init succeeded"); - } - - orb_advert_t rc_pub = nullptr; - - // Use a buffer size of the double of the minimum, just to be safe. - uint8_t rx_buf[2 * DSM_BUFFER_SIZE]; - - _is_running = true; - uint16_t raw_rc_values[input_rc_s::RC_INPUT_MAX_CHANNELS]; - uint16_t raw_rc_count = 0; - uint32_t loop_counter = 0; - bool print_msg = false; - bool first_correct_frame_received = false; - int newbytes = 0; - - // Main loop - while (!_task_should_exit) { - - if (((loop_counter % 20) == 0) && verbose) { print_msg = true; } - - loop_counter++; - -#ifdef __PX4_QURT -#define ASYNC_UART_READ_WAIT_US 2000 - // The UART read on SLPI is via an asynchronous service so specify a timeout - // for the return. The driver will poll periodically until the read comes in - // so this may block for a while. However, it will timeout if no read comes in. - newbytes = qurt_uart_read(uart_fd, (char *) &rx_buf[0], sizeof(rx_buf), ASYNC_UART_READ_WAIT_US); -#else - newbytes = read(uart_fd, &rx_buf[0], sizeof(rx_buf)); -#endif - - if (newbytes <= 0) { - if (print_msg) { PX4_INFO("Spektrum RC: Read no bytes from UART"); } - - } else if (((newbytes != DSM_FRAME_SIZE) || ((rx_buf[1] & 0x0F) != 0x02)) && (! first_correct_frame_received)) { - PX4_ERR("Spektrum RC: Read something other than correct DSM frame on read. Got %d bytes. Protocol byte is 0x%.2x", - newbytes, rx_buf[1]); - - } else { - if (print_msg) { PX4_INFO("Spektrum RC: Read %d bytes from UART", newbytes); } - - first_correct_frame_received = true; - - const hrt_abstime now = hrt_absolute_time(); - - bool dsm_11_bit; - unsigned frame_drops; - int8_t dsm_rssi; - - // parse new data - bool rc_updated = dsm_parse(now, rx_buf, newbytes, &raw_rc_values[0], &raw_rc_count, - &dsm_11_bit, &frame_drops, &dsm_rssi, input_rc_s::RC_INPUT_MAX_CHANNELS); - UNUSED(dsm_11_bit); - - if (rc_updated) { - if (print_msg) { PX4_INFO("Spektrum RC: DSM message parsed successfully"); } - - input_rc_s input_rc = {}; - - fill_input_rc(raw_rc_count, raw_rc_values, now, false, false, frame_drops, dsm_rssi, - input_rc); - - if (rc_pub == nullptr) { - rc_pub = orb_advertise(ORB_ID(input_rc), &input_rc); - - } else { - if (print_msg) { PX4_INFO("Spektrum RC: Publishing input_rc"); } - - orb_publish(ORB_ID(input_rc), rc_pub, &input_rc); - } - } - - if (print_msg) { - PX4_INFO("0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x", - rx_buf[0], - rx_buf[1], - rx_buf[2], - rx_buf[3], - rx_buf[4], - rx_buf[5], - rx_buf[6], - rx_buf[7], - rx_buf[8], - rx_buf[9], - rx_buf[10], - rx_buf[11], - rx_buf[12], - rx_buf[13], - rx_buf[14], - rx_buf[15]); - } - } - - print_msg = false; - - // sleep since no poll for qurt - usleep(10000); - } - - orb_unadvertise(rc_pub); - dsm_deinit(); - - _is_running = false; -} - -void fill_input_rc(uint16_t raw_rc_count, uint16_t raw_rc_values[input_rc_s::RC_INPUT_MAX_CHANNELS], - hrt_abstime now, bool frame_drop, bool failsafe, unsigned frame_drops, int rssi, - input_rc_s &input_rc) -{ - input_rc.input_source = input_rc_s::RC_INPUT_SOURCE_QURT; - - input_rc.channel_count = raw_rc_count; - - if (input_rc.channel_count > input_rc_s::RC_INPUT_MAX_CHANNELS) { - input_rc.channel_count = input_rc_s::RC_INPUT_MAX_CHANNELS; - } - - unsigned valid_chans = 0; - - for (unsigned i = 0; i < input_rc.channel_count; ++i) { - input_rc.values[i] = raw_rc_values[i]; - - if (raw_rc_values[i] != UINT16_MAX) { - valid_chans++; - } - } - - input_rc.timestamp = now; - input_rc.timestamp_last_signal = input_rc.timestamp; - input_rc.rc_ppm_frame_length = 0; - - /* fake rssi if no value was provided */ - if (rssi == -1) { - - input_rc.rssi = 255; - - } else { - input_rc.rssi = rssi; - } - - if (valid_chans == 0) { - input_rc.rssi = 0; - } - - input_rc.rc_failsafe = failsafe; - input_rc.rc_lost = (valid_chans == 0); - input_rc.rc_lost_frame_count = frame_drops; - input_rc.rc_total_frame_count = 0; -} - -int start(int argc, char *argv[]) -{ - if (_is_running) { - PX4_WARN("already running"); - return -1; - } - - _task_should_exit = false; - - _task_handle = px4_task_spawn_cmd("spektrum_rc_main", - SCHED_DEFAULT, - SCHED_PRIORITY_DEFAULT, - 2000, - (px4_main_t)&task_main, - (char *const *)argv); - - if (_task_handle < 0) { - PX4_ERR("task start failed"); - return -1; - } - - return 0; -} - -int stop() -{ - if (!_is_running) { - PX4_WARN("not running"); - return -1; - } - - _task_should_exit = true; - - while (_is_running) { - usleep(200000); - PX4_INFO("."); - } - - _task_handle = -1; - return 0; -} - -int info() -{ - PX4_INFO("running: %s", _is_running ? "yes" : "no"); - - return 0; -} - -void -usage() -{ - PX4_INFO("Usage: spektrum_rc {start|info|stop}"); -} - -} // namespace spektrum_rc - - -int spektrum_rc_main(int argc, char *argv[]) -{ - int myoptind = 1; - - if (argc <= 1) { - spektrum_rc::usage(); - return 1; - } - - const char *verb = argv[myoptind]; - - - if (!strcmp(verb, "start")) { - return spektrum_rc::start(argc - 1, argv + 1); - } - - else if (!strcmp(verb, "stop")) { - return spektrum_rc::stop(); - } - - else if (!strcmp(verb, "info")) { - return spektrum_rc::info(); - } - - else { - spektrum_rc::usage(); - return 1; - } -} diff --git a/boards/modalai/voxl2-slpi/src/i2c.cpp b/boards/modalai/voxl2-slpi/src/i2c.cpp deleted file mode 100644 index da40791..0000000 --- a/boards/modalai/voxl2-slpi/src/i2c.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include -#include - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), - initI2CBusExternal(2), - initI2CBusExternal(4), - initI2CBusInternal(5) -}; diff --git a/boards/modalai/voxl2-slpi/src/init.c b/boards/modalai/voxl2-slpi/src/init.c deleted file mode 100644 index f9a71ff..0000000 --- a/boards/modalai/voxl2-slpi/src/init.c +++ /dev/null @@ -1,35 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2022 ModalAI, Inc. 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" - -// Place holder for VOXL2-specific early startup code diff --git a/boards/modalai/voxl2-slpi/src/spi.cpp b/boards/modalai/voxl2-slpi/src/spi.cpp deleted file mode 100644 index cd8eea2..0000000 --- a/boards/modalai/voxl2-slpi/src/spi.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(1, {initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P), }), -}; diff --git a/boards/modalai/voxl2/README.md b/boards/modalai/voxl2/README.md deleted file mode 100644 index 02d7f6f..0000000 --- a/boards/modalai/voxl2/README.md +++ /dev/null @@ -1,98 +0,0 @@ -# PX4 on VOXL 2 - -VOXL 2 from ModalAI can be used as a companion computer to a flight control board -but it can also run PX4 directly. - -## Overview - -When running PX4 directly on the QRB5165 SoC it runs partially on the Sensor Low Power Island (SLPI) DSP (aka sdsp) and partially on the application processor (ARM64 / aarch64). -The portion running on the DSP hosts the flight critical portions of PX4 such as -the IMU, barometer, magnetometer, GPS, ESC, and power management drivers, and the -state estimation. The DSP acts as the real time portion of the system. Non flight -critical applications such as Mavlink, logging, and commander are running on the -ARM CPU cluster (aka apps proc). The DSP and ARM CPU cluster communicate via a -Qualcomm proprietary shared memory interface. - -## Build environment - -In order to build for this platform both the Qualcomm Hexagon (DSP) toolchain and the Linaro ARM64 toolchain need to be installed. The (nearly) complete setup including the ARM64 toolchain is provided in the base Docker image provided by ModalAI, but since ModalAI is not allowed to redistribute the Qualcomm Hexagon DSP SDK this must be added by the end user. - -The full instructions are available here: -- https://gitlab.com/voxl-public/rb5-flight/rb5-flight-px4-build-docker - -## Build overview - -- Clone the repo (Don't forget to update and initialize all submodules) -- In the top level directory -``` -px4$ boards/modalai/voxl2/scripts/run-docker.sh -root@9373fa1401b8:/usr/local/workspace# boards/modalai/voxl2/scripts/clean.sh -root@9373fa1401b8:/usr/local/workspace# boards/modalai/voxl2/scripts/build-apps.sh -root@9373fa1401b8:/usr/local/workspace# boards/modalai/voxl2/scripts/build-slpi.sh -root@9373fa1401b8:/usr/local/workspace# exit -``` - -## Install and run on VOXL 2 - -Once the DSP and Linux images have been built they can be installed on a VOXL 2 -board using ADB. There is a script to do this. -``` -px4$ boards/modalai/voxl2/scripts/install-voxl.sh -``` - -## Running PX4 on VOXL 2 - -After installing PX4 on the board, open a terminal on VOXL 2 using ADB shell. -PX4 can be run using a start script. -``` -root@m0054:/# voxl-px4 -Found DSP signature file -/ -INFO [px4] mlockall() enabled. PX4's virtual address space is locked into RAM. -INFO [px4] assuming working directory is rootfs, no symlinks needed. - -______ __ __ ___ -| ___ \ \ \ / / / | -| |_/ / \ V / / /| | -| __/ / \ / /_| | -| | / /^\ \ \___ | -\_| \/ \/ |_/ - -px4 starting. - -INFO [px4] Calling startup script: /bin/sh /etc/modalai/voxl-px4.config 0 -INFO [muorb] muorb protobuf initalize method succeeded -INFO [px4] Startup script returned successfully -pxh> -``` - -## Notes - -You cannot cleanly shutdown PX4 with the shutdown command on VOXL 2. You have -to power cycle the board and restart everything. - -## Tips - -Start with a VOXL 2 that only has the system image installed, not the SDK - -Run the command ```voxl-px4 -s``` on target to run the self-test - -In order to see DSP specific debug messages the mini-dm tool in the Hexagon SDK -can be used: -``` -modalai@modalai-XPS-15-9570:/local/mnt/workspace/Qualcomm/Hexagon_SDK/4.1.0.4/tools/debug/mini-dm/Ubuntu18$ sudo ./mini-dm -[sudo] password for modalai: -Running mini-dm version: 3.2 -Completed processing command line --- -Connecting to the only usbport connected -mini-dm is waiting for a DMSS connection... -DMSS is connected. Running mini-dm... -------------Mini-dm is ready to log------------- -[08500/02] 06:21.030 0069:01: SDSP: Creating new instance. 0355 sns_flight_controller_sensor. -[08500/02] 06:21.030 0069:01: SDSP: Creating data streams 0292 sns_flight_controller_sensor_ -[08500/02] 06:21.030 0069:01: SDSP: Configuring devices 0305 sns_flight_controller_sensor_ -[08500/02] 06:21.030 0069:01: SDSP: Flight controller sensor instance initialized 0344 sns_flight_controller_sensor_ -[08500/01] 06:21.092 0069:01: SDSP: Hello, world! 0000 test -[08500/02] 06:21.092 006a:01: SDSP: CPU Utilization: 0.04, wait percentage 99.94 0162 sns_flight_controller_sensor. -[08500/02] 06:21.092 006a:01: SDSP: Got interrupt registered event 0082 sns_flight_controller_sensor_ -``` diff --git a/boards/modalai/voxl2/cmake/link_libraries.cmake b/boards/modalai/voxl2/cmake/link_libraries.cmake deleted file mode 100644 index 42c9fea..0000000 --- a/boards/modalai/voxl2/cmake/link_libraries.cmake +++ /dev/null @@ -1,7 +0,0 @@ - -# libfc_sensor.so is provided in the Docker build environment -target_link_libraries(px4 PRIVATE - /home/libfc_sensor.so - px4_layer - ${module_libraries} -) diff --git a/boards/modalai/voxl2/default.px4board b/boards/modalai/voxl2/default.px4board deleted file mode 100644 index ed1e0ed..0000000 --- a/boards/modalai/voxl2/default.px4board +++ /dev/null @@ -1,24 +0,0 @@ -CONFIG_PLATFORM_POSIX=y -CONFIG_BOARD_LINUX_TARGET=y -CONFIG_BOARD_TOOLCHAIN="aarch64-linux-gnu" -CONFIG_BOARD_ROOTFSDIR="/data/px4" -CONFIG_DRIVERS_ACTUATORS_MODAL_IO=y -CONFIG_DRIVERS_OSD_MSP_OSD=y -CONFIG_DRIVERS_QSHELL_POSIX=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MUORB_APPS=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_ORB_COMMUNICATOR=y diff --git a/boards/modalai/voxl2/scripts/build-apps.sh b/boards/modalai/voxl2/scripts/build-apps.sh deleted file mode 100755 index 28b6a8d..0000000 --- a/boards/modalai/voxl2/scripts/build-apps.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -echo "*** Starting apps processor build ***" - -source /home/build-env.sh - -make modalai_voxl2 - -cat build/modalai_voxl2_default/src/lib/version/build_git_version.h - -echo "*** End of apps processor build ***" diff --git a/boards/modalai/voxl2/scripts/build-slpi.sh b/boards/modalai/voxl2/scripts/build-slpi.sh deleted file mode 100755 index 4c05f8f..0000000 --- a/boards/modalai/voxl2/scripts/build-slpi.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -echo "*** Starting qurt slpi build ***" - -source /home/build-env.sh - -make modalai_voxl2-slpi - -cat build/modalai_voxl2-slpi_default/src/lib/version/build_git_version.h - -echo "*** End of qurt slpi build ***" diff --git a/boards/modalai/voxl2/scripts/clean.sh b/boards/modalai/voxl2/scripts/clean.sh deleted file mode 100755 index 51cef9c..0000000 --- a/boards/modalai/voxl2/scripts/clean.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -# Clean out the build artifacts -source /home/build-env.sh -make clean diff --git a/boards/modalai/voxl2/scripts/install-voxl.sh b/boards/modalai/voxl2/scripts/install-voxl.sh deleted file mode 100755 index 37f2ede..0000000 --- a/boards/modalai/voxl2/scripts/install-voxl.sh +++ /dev/null @@ -1,133 +0,0 @@ -#!/bin/bash - -# Push slpi image to voxl2 -adb push build/modalai_voxl2-slpi_default/platforms/qurt/libpx4.so /usr/lib/rfsa/adsp - -# Push apps processor image to voxl2 -adb push build/modalai_voxl2_default/bin/px4 /usr/bin - -# Push scripts to voxl2 -adb push build/modalai_voxl2_default/bin/px4-alias.sh /usr/bin -adb push boards/modalai/voxl2/target/voxl-px4 /usr/bin -adb push boards/modalai/voxl2/target/voxl-px4-start /usr/bin -adb shell chmod a+x /usr/bin/px4-alias.sh -adb shell chmod a+x /usr/bin/voxl-px4 -adb shell chmod a+x /usr/bin/voxl-px4-start - -# Push configuration file -adb shell mkdir -p /etc/modalai -adb push boards/modalai/voxl2/target/voxl-px4-set-default-parameters.config /etc/modalai -adb push boards/modalai/voxl2/target/voxl-px4-fake-imu-calibration.config /etc/modalai - -# Make sure to setup all of the needed px4 aliases. -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-accelsim" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-attitude_estimator_q" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-barosim" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-batt_smbus" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-bottle_drop" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-camera_feedback" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-camera_trigger" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-cdev_test" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-cm8jl65" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-commander" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-commander_tests" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-control_allocator" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-controllib_test" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-dataman" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-ekf2" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-esc_calib" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-ets_airspeed" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-ex_fixedwing_control" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-fw_att_control" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-fw_pos_control_l1" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-gnd_att_control" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-gnd_pos_control" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-gps" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-gpssim" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-gyrosim" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-hello" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-hrt_test" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-land_detector" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-landing_target_estimator" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-led_control" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-leddar_one" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-linux_sbus" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-listener" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-ll40ls" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-load_mon" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-local_position_estimator" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-logger" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-manual_control" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-mavlink" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-mavlink_bridge" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-mavlink_tests" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-mb12xx" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-mc_att_control" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-mc_pos_control" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-measairspeedsim" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-mixer" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-motor_ramp" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-modalai_gps_timer" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-ms4525_airspeed" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-ms5525_airspeed" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-msp_osd" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-muorb" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-muorb_test" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-navigator" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-param" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-perf" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-pga460" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-position_estimator_inav" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-pwm" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-pwm_out_sim" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-px4io" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-px4_mavlink_debug" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-px4_simple_app" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-qshell" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-rc_tests" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-rc_update" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-reboot" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-rgbled" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-rover_steering_control" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-sd_bench" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-sdp3x_airspeed" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-segway" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-send_event" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-sensors" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-sf0x" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-sf0x_tests" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-sf1xx" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-shutdown" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-sih" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-simulator" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-spektrum_rc" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-srf02" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-teraranger" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-tests" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-tfmini" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-top" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-tune_control" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-ulanding_radar" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-uorb" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-uorb_tests" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-ver" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-vl53lxx" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-vmount" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-vtol_att_control" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-wind_estimator" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-rc_controller" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-uart_esc_driver" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-flight_mode_manager" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-imu_server" - -# Make sure any required directories exist -adb shell "/bin/mkdir -p /data/px4/param" -adb shell "/bin/mkdir -p /data/px4/etc/extras" - -# Push the json files for the component metadata -adb push build/modalai_voxl2_default/actuators.json.xz /data/px4/etc/extras -adb push build/modalai_voxl2_default/component_general.json.xz /data/px4/etc/extras -adb push build/modalai_voxl2_default/parameters.json.xz /data/px4/etc/extras -adb push build/modalai_voxl2_default/events/all_events.json.xz /data/px4/etc/extras - -adb shell sync diff --git a/boards/modalai/voxl2/scripts/run-docker.sh b/boards/modalai/voxl2/scripts/run-docker.sh deleted file mode 100755 index 4df4076..0000000 --- a/boards/modalai/voxl2/scripts/run-docker.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -# Run this from the px4 project top level directory -docker run -it --rm -v `pwd`:/usr/local/workspace rb5-flight-px4-build-docker diff --git a/boards/modalai/voxl2/src/CMakeLists.txt b/boards/modalai/voxl2/src/CMakeLists.txt deleted file mode 100644 index f23ed05..0000000 --- a/boards/modalai/voxl2/src/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ -############################################################################ -# -# Copyright (c) 2022 ModalAI, Inc. 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. -# -############################################################################ - -# Need to make sure that the Linux processor on VOXL2 -# knows about all parameters since it is acting as the -# parameter server for other processors that may define -# parameters that it doesn't normally know about. -set(DISABLE_PARAMS_MODULE_SCOPING TRUE PARENT_SCOPE) - -add_library(drivers_board - board_config.h - init.c - ) diff --git a/boards/modalai/voxl2/src/board_config.h b/boards/modalai/voxl2/src/board_config.h deleted file mode 100644 index 9fe0f35..0000000 --- a/boards/modalai/voxl2/src/board_config.h +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2022 ModalAI, Inc. 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * VOXL2 internal definitions - */ - -#pragma once - -#define BOARD_HAS_NO_RESET -#define BOARD_HAS_NO_BOOTLOADER - -// Define this as empty since there are no I2C buses -#define BOARD_I2C_BUS_CLOCK_INIT - -#include -#include - -#define BOARD_OVERRIDE_UUID "MODALAIVOXL20000" // must be of length 16 -#define PX4_SOC_ARCH_ID PX4_SOC_ARCH_ID_VOXL2 - -#define MODAL_IO_DEFAULT_PORT "2" diff --git a/boards/modalai/voxl2/src/init.c b/boards/modalai/voxl2/src/init.c deleted file mode 100644 index f9a71ff..0000000 --- a/boards/modalai/voxl2/src/init.c +++ /dev/null @@ -1,35 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2022 ModalAI, Inc. 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" - -// Place holder for VOXL2-specific early startup code diff --git a/boards/modalai/voxl2/target/voxl-px4 b/boards/modalai/voxl2/target/voxl-px4 deleted file mode 100755 index 38560b4..0000000 --- a/boards/modalai/voxl2/target/voxl-px4 +++ /dev/null @@ -1,147 +0,0 @@ -#!/bin/bash - -CONFIG_FILE="/etc/modalai/voxl-px4.conf" - -GPS=NONE -RC=SPEKTRUM -IMU_ROTATION=NONE -OSD=DISABLE -DAEMON_MODE=DISABLE -SENSOR_CAL=ACTUAL -EXTRA_STEPS=() - -# Try to source configuration variables from a file. -# This will override anything already set in the environment. -if [ -f "$CONFIG_FILE" ]; then - echo "[INFO] Reading from $CONFIG_FILE" - source $CONFIG_FILE -else - echo "[INFO] $CONFIG_FILE not found, using defaults" -fi - -# Make sure that the SLPI DSP test signature is there otherwise px4 cannot run -# on the DSP -if /bin/ls /usr/lib/rfsa/adsp/testsig-*.so &> /dev/null; then - /bin/echo "Found DSP signature file" -else - /bin/echo "[WARNING] Could not find DSP signature file" - # Look for the DSP signature generation script - if [ -f /share/modalai/qrb5165-slpi-test-sig/generate-test-sig.sh ]; then - /bin/echo "[INFO] Attempting to generate the DSP signature file" - # Automatically generate the test signature so that px4 can run on SLPI DSP - /share/modalai/qrb5165-slpi-test-sig/generate-test-sig.sh - else - /bin/echo "[ERROR] Could not find the DSP signature file generation script" - exit 0 - fi -fi - -print_usage() { - echo -e "\nUsage: voxl-px4 [-b (Specify Holybro GPS unit)]" - echo " [-c delete configuration file and exit]" - echo " [-d start px4 in daemon mode]" - echo " [-f (Use fake rc input instead of from a real transmitter)]" - echo " [-i (Set IMU_ROTATION to ROTATION_YAW_180)]" - echo " [-m (Specify Matek GPS unit)]" - echo " [-o (Start OSD module on the apps processor)]" - echo " [-r (Specify TBS Crossfire RC receiver, MAVLINK)]" - echo " [-w (Specify TBS Crossfire RC receiver, raw)]" - echo " [-z (Use fake sensor calibration values)]" - echo " [-h (show help)]" - - exit 1 -} - -print_config_settings(){ - echo -e "\n*************************" - echo "GPS=$GPS" - echo "RC=$RC" - echo "IMU_ROTATION=$IMU_ROTATION" - echo "OSD=$OSD" - echo "DAEMON_MODE=$DAEMON_MODE" - echo "SENSOR_CAL=$SENSOR_CAL" - echo "EXTRA STEPS:" - for i in "${EXTRA_STEPS[@]}" - do - echo -e "\t$i" - done - echo -e "*************************\n" -} - -while getopts "bcdhifmorwz" flag -do - case "${flag}" in - b) - echo "[INFO] Holybro GPS selected" - GPS=HOLYBRO - ;; - c) - echo "[INFO] Wiping old config file" - if [ -f "$CONFIG_FILE" ]; then - rm -rf ${CONFIG_FILE} - fi - exit 0 - ;; - d) - echo "[INFO] Enabling daemon mode" - DAEMON_MODE=ENABLE - ;; - h) - print_usage - ;; - i) - echo "[INFO] Setting IMU_ROTATION to 4: ROTATION_YAW_180" - IMU_ROTATION=4 - ;; - f) - echo "[INFO] Setting RC to FAKE_RC_INPUT" - RC=FAKE_RC_INPUT - ;; - m) - echo "[INFO] Matek GPS selected" - GPS=MATEK - ;; - o) - echo "[INFO] OSD module selected" - OSD=ENABLE - ;; - r) - echo "[INFO] TBS Crossfire RC receiver, MAVLINK selected" - RC=CRSF_MAV - ;; - w) - echo "[INFO] TBS Crossfire RC receiver, raw selected" - RC=CRSF_RAW - ;; - z) - echo "[INFO] Fake sensor calibration values selected" - SENSOR_CAL=FAKE - ;; - *) - print_usage - ;; - esac -done - -if [ $DAEMON_MODE == "DISABLE" ]; then - DAEMON=" " -else - echo "[INFO] Daemon mode enabled" - DAEMON="-d" -fi - -if [ ! -f /data/px4/param/parameters ]; then - echo "[INFO] Setting default parameters for PX4 on voxl" - px4 $DAEMON -s /etc/modalai/voxl-px4-set-default-parameters.config - /bin/sync -fi - -if [ $SENSOR_CAL == "FAKE" ]; then - /bin/echo "[INFO] Setting up fake sensor calibration values" - px4 $DAEMON -s /etc/modalai/voxl-px4-fake-imu-calibration.config - /bin/sync -fi - -print_config_settings - -GPS=$GPS RC=$RC OSD=$OSD IMU_ROTATION=$IMU_ROTATION EXTRA_STEPS=$EXTRA_STEPS px4 $DAEMON -s /usr/bin/voxl-px4-start diff --git a/boards/modalai/voxl2/target/voxl-px4-fake-imu-calibration.config b/boards/modalai/voxl2/target/voxl-px4-fake-imu-calibration.config deleted file mode 100755 index 8d270a5..0000000 --- a/boards/modalai/voxl2/target/voxl-px4-fake-imu-calibration.config +++ /dev/null @@ -1,37 +0,0 @@ - -#!/bin/sh -# PX4 commands need the 'px4-' prefix in bash. -# (px4-alias.sh is expected to be in the PATH) -. px4-alias.sh - -# uorb start - -param select /data/px4/param/parameters - -# Load in all of the current parameters that have been saved in the file -param load - -# Fake Accel calibration parameters for testing -param set CAL_ACC0_ID 2490378 -param set CAL_ACC0_PRIO 75 -param set CAL_ACC0_ROT -1 -param set CAL_ACC0_XOFF -0.005 -param set CAL_ACC0_XSCALE 1.008 -param set CAL_ACC0_YOFF 0.008 -param set CAL_ACC0_YSCALE 1.0008 -param set CAL_ACC0_ZOFF -0.1 -param set CAL_ACC0_ZSCALE 1.008 - -# Fake gyro calibration parameters for testing -param set CAL_GYRO0_ID 2490378 -param set CAL_GYRO0_PRIO 75 -param set CAL_GYRO0_ROT 0 -param set CAL_GYRO0_XOFF -0.0008 -param set CAL_GYRO0_YOFF -0.03 -param set CAL_GYRO0_ZOFF 0.002 - -param save - -sleep 2 - -/usr/bin/px4-shutdown diff --git a/boards/modalai/voxl2/target/voxl-px4-set-default-parameters.config b/boards/modalai/voxl2/target/voxl-px4-set-default-parameters.config deleted file mode 100755 index 9d1569c..0000000 --- a/boards/modalai/voxl2/target/voxl-px4-set-default-parameters.config +++ /dev/null @@ -1,183 +0,0 @@ -#!/bin/sh -# PX4 commands need the 'px4-' prefix in bash. -# (px4-alias.sh is expected to be in the PATH) -. px4-alias.sh - -param select /data/px4/param/parameters - -# Make sure we are running at 800Hz on IMU -param set IMU_GYRO_RATEMAX 800 - -# EKF2 Parameters -param set EKF2_IMU_POS_X 0.027 -param set EKF2_IMU_POS_Y 0.009 -param set EKF2_IMU_POS_Z -0.019 -param set EKF2_EV_CTRL 15 -param set EKF2_EV_DELAY 5 -param set EKF2_GPS_CTRL 0 -param set EKF2_ABL_LIM 0.8 -param set EKF2_TAU_POS 0.25 -param set EKF2_TAU_VEL 0.25 - -param set MC_AIRMODE 0 - -param set MC_YAW_P 2.0 -param set MC_YAWRATE_P 0.15 -param set MC_YAWRATE_I 0.1 -param set MC_YAWRATE_D 0.0 -param set MC_YAWRATE_K 1.0 - -param set MC_PITCH_P 5.5 -param set MC_PITCHRATE_P 0.08 -param set MC_PITCHRATE_I 0.2 -param set MC_PITCHRATE_D 0.0013 -param set MC_PITCHRATE_K 1.0 - -param set MC_ROLL_P 5.5 -param set MC_ROLLRATE_P 0.08 -param set MC_ROLLRATE_I 0.2 -param set MC_ROLLRATE_D 0.0013 -param set MC_ROLLRATE_K 1.0 - -param set MPC_VELD_LP 5.0 - -# tweak MPC_THR_MIN to prevent roll/pitch losing control -# authority under rapid downward acceleration -param set MPC_THR_MAX 0.75 -param set MPC_THR_MIN 0.08 -param set MPC_THR_HOVER 0.42 -param set MPC_MANTHR_MIN 0.05 - -# default position mode with a little expo, smooth mode is terrible -param set MPC_POS_MODE 0 -param set MPC_YAW_EXPO 0.20 -param set MPC_XY_MAN_EXPO 0.20 -param set MPC_Z_MAN_EXPO 0.20 - -# max velocities -param set MPC_VEL_MANUAL 5.0 -param set MPC_XY_VEL_MAX 5.0 -param set MPC_XY_CRUISE 5.0 -param set MPC_Z_VEL_MAX_DN 1.5 -param set MPC_Z_VEL_MAX_UP 4.0 -param set MPC_LAND_SPEED 1.0 - -# Horizontal position PID -param set MPC_XY_P 0.95 -param set MPC_XY_VEL_P_ACC 3.00 -param set MPC_XY_VEL_I_ACC 0.10 -param set MPC_XY_VEL_D_ACC 0.00 - -# Vertical position PID -# PX4 Defaults -param set MPC_Z_P 1.0 -param set MPC_Z_VEL_P_ACC 8.0 -param set MPC_Z_VEL_I_ACC 2.0 -param set MPC_Z_VEL_D_ACC 0.0 - -param set MPC_TKO_RAMP_T 1.50 -param set MPC_TKO_SPEED 1.50 - -# Set the ESC outputs to function as motors -param set MODAL_IO_FUNC1 101 -param set MODAL_IO_FUNC2 103 -param set MODAL_IO_FUNC3 104 -param set MODAL_IO_FUNC4 102 - -param set MODAL_IO_SDIR1 0 -param set MODAL_IO_SDIR2 0 -param set MODAL_IO_SDIR3 0 -param set MODAL_IO_SDIR4 0 - -param set MODAL_IO_CONFIG 1 -param set MODAL_IO_REV 0 -param set MODAL_IO_MODE 0 -param set MODAL_IO_BAUD 2000000 -param set MODAL_IO_RPM_MAX 10500 -param set MODAL_IO_RPM_MIN 1000 - -# Some parameters for control allocation -param set CA_ROTOR_COUNT 4 -param set CA_R_REV 0 -param set CA_AIRFRAME 0 -param set CA_ROTOR_COUNT 4 -param set CA_ROTOR0_PX 0.15 -param set CA_ROTOR0_PY 0.15 -param set CA_ROTOR1_PX -0.15 -param set CA_ROTOR1_PY -0.15 -param set CA_ROTOR2_PX 0.15 -param set CA_ROTOR2_PY -0.15 -param set CA_ROTOR2_KM -0.05 -param set CA_ROTOR3_PX -0.15 -param set CA_ROTOR3_PY 0.15 -param set CA_ROTOR3_KM -0.05 - -# Some parameter settings to disable / ignore certain preflight checks - -# No GPS driver yet so disable it -param set SYS_HAS_GPS 0 - -# Allow arming wihtout a magnetometer (Need magnetometer driver) -param set SYS_HAS_MAG 0 -param set EKF2_MAG_TYPE 5 - -# Allow arming without battery check (Need voxlpm driver) -param set CBRK_SUPPLY_CHK 894281 - -# Allow arming without an SD card -param set COM_ARM_SDCARD 0 - -# Allow arming wihtout CPU load information -param set COM_CPU_MAX 0.0 - -# Disable auto disarm. This is number of seconds to wait for takeoff -# after arming. If no takeoff happens then it will disarm. A negative -# value disables this. -param set COM_DISARM_PRFLT -1 - -# This parameter doesn't exist anymore. Need to see what the new method is. -# param set MAV_BROADCAST 0 - -# Doesn't work without setting this to Quadcopter -param set MAV_TYPE 2 - -# Parameters that we don't use but QGC complains about if they aren't there -param set SYS_AUTOSTART 4001 - -# Default RC channel mappings -param set RC_MAP_ACRO_SW 0 -param set RC_MAP_ARM_SW 0 -param set RC_MAP_AUX1 0 -param set RC_MAP_AUX2 0 -param set RC_MAP_AUX3 0 -param set RC_MAP_AUX4 0 -param set RC_MAP_AUX5 0 -param set RC_MAP_AUX6 0 -param set RC_MAP_FAILSAFE 0 -param set RC_MAP_FLAPS 0 -param set RC_MAP_FLTMODE 6 -param set RC_MAP_GEAR_SW 0 -param set RC_MAP_KILL_SW 7 -param set RC_MAP_LOITER_SW 0 -param set RC_MAP_MAN_SW 0 -param set RC_MAP_MODE_SW 0 -param set RC_MAP_OFFB_SW 0 -param set RC_MAP_PARAM1 0 -param set RC_MAP_PARAM2 0 -param set RC_MAP_PARAM3 0 -param set RC_MAP_PITCH 2 -param set RC_MAP_POSCTL_SW 0 -param set RC_MAP_RATT_SW 0 -param set RC_MAP_RETURN_SW 0 -param set RC_MAP_ROLL 1 -param set RC_MAP_STAB_SW 0 -param set RC_MAP_THROTTLE 3 -param set RC_MAP_TRANS_SW 0 -param set RC_MAP_YAW 4 - -param save - -sleep 2 - -# Need px4-shutdown otherwise Linux system shutdown is called -px4-shutdown diff --git a/boards/modalai/voxl2/target/voxl-px4-start b/boards/modalai/voxl2/target/voxl-px4-start deleted file mode 100755 index 2611de9..0000000 --- a/boards/modalai/voxl2/target/voxl-px4-start +++ /dev/null @@ -1,164 +0,0 @@ -#!/bin/sh -# PX4 commands need the 'px4-' prefix in bash. -# (px4-alias.sh is expected to be in the PATH) -. px4-alias.sh - -echo -e "\n*************************" -echo "GPS: $GPS" -echo "RC: $RC" -echo "IMU ROTATION: $IMU_ROTATION" -echo "OSD: $OSD" -echo "EXTRA STEPS:" -for i in "${EXTRA_STEPS[@]}" -do - echo -e "\t$i" -done -echo -e "*************************\n" - -# In order to just exit after starting the uorb / muorb modules define -# the environment variable MINIMAL_PX4. (e.g. export MINIMAL_PX4=1) -# This is useful for testing / debug where you may want to start drivers -# and modules manually from the px4 command shell -if [ ! -z $MINIMAL_PX4 ]; then - /bin/echo "Running minimal script" - exit 0 -fi - -# Sleep a little here. A lot happens when the uorb and muorb start -# and we need to make sure that it all completes successfully to avoid -# any possible race conditions. -/bin/sleep 1 - -param select /data/px4/param/parameters - -# Load in all of the parameters that have been saved in the file -param load - -# Start logging and use timestamps for log files when possible. -# Add the "-e" option to start logging immediately. Default is -# to log only when armed. Caution must be used with the "-e" option -# because if power is removed without stopping the logger gracefully then -# the log file may be corrupted. -logger start -t - -/bin/sleep 1 - -# IMU (accelerometer / gyroscope) -if [ "$IMU_ROTATION" != "NONE" ]; then - /bin/echo "Starting IMU driver with rotation: $IMU_ROTATION" - qshell icm42688p start -s -R $IMU_ROTATION -else - qshell icm42688p start -s -fi - - -/bin/sleep 1 - -# Start Invensense ICP 101xx barometer built on to VOXL 2 -qshell icp101xx start -I -b 5 - -# Magnetometer -if [ "$GPS" == "MATEK" ]; then - # Use this line for the magnetometer in the Matek Systems M8Q-5883 module - /bin/echo "Starting Mateksys M8Q-5883 magnetometer" - qshell qmc5883l start -R 10 -X -b 1 -elif [ "$GPS" == "HOLYBRO" ]; then - # Use this line for the magnetometer in the Holybro GPS module - /bin/echo "Starting Holybro magnetometer" - qshell ist8310 start -R 10 -X -b 1 -fi - -# GPS -if [ "$GPS" == "MATEK" ]; then - # Use this gps start line instead for Matek Systems M8Q-5883 module - /bin/echo "Starting Mateksys M8Q-5883 GPS" - qshell gps start -elif [ "$GPS" == "HOLYBRO" ]; then - # Only the newer Holybro unit is supported on M0054 - /bin/echo "Starting Holybro GPS" - qshell gps start -b 115200 -fi - -# LED driver for the Pixhawk 4 GPS module -if [ "$GPS" == "HOLYBRO" ]; then - /bin/echo "Starting Holybro LED driver" - qshell rgbled_ncp5623c start -X -b 1 -f 400 -a 56 -fi - -# We do not change the value of SYS_AUTOCONFIG but if it does not -# show up as used then it is not reported to QGC and we get a -# missing parameter error. -param touch SYS_AUTOCONFIG - -# ESC driver -qshell modal_io start - -/bin/sleep 1 - -if [ "$RC" == "FAKE_RC_INPUT" ]; then - /bin/echo "Starting fake RC driver" - qshell rc_controller start -elif [ "$RC" == "CRSF_RAW" ]; then - /bin/echo "Starting CRSF RC driver" - qshell crsf_rc start -d 7 -elif [ "$RC" == "CRSF_MAV" ]; then - /bin/echo "Starting TBS crossfire RC - MAV Mode" - qshell mavlink_rc_in start -m -p 7 -b 115200 -elif [ "$RC" == "SPEKTRUM" ]; then - /bin/echo "Starting Spektrum RC" - qshell spektrum_rc start -fi - -/bin/sleep 1 - -# APM power monitor -qshell voxlpm start -X -b 2 - -# Start all of the processing modules on DSP -qshell sensors start -qshell ekf2 start -qshell mc_pos_control start -qshell mc_att_control start -qshell mc_rate_control start -qshell mc_hover_thrust_estimator start -qshell land_detector start multicopter -qshell manual_control start -qshell control_allocator start -qshell rc_update start -qshell commander start -qshell commander mode manual - -/bin/sleep 1 - -# Start all of the processing modules on the applications processor -dataman start -navigator start - -# This is needed for altitude and position hold modes -flight_mode_manager start - -mavlink start -x -u 14556 -o 14557 -r 100000 -n lo -m onboard - -# slow down some of the fastest streams in onboard mode -mavlink stream -u 14556 -s HIGHRES_IMU -r 10 -mavlink stream -u 14556 -s ATTITUDE -r 10 -mavlink stream -u 14556 -s ATTITUDE_QUATERNION -r 10 -# speed up rc_channels -mavlink stream -u 14556 -s RC_CHANNELS -r 50 - -/bin/sleep 1 - -mavlink boot_complete - -# Optional MSP OSD driver for DJI goggles -# This is only supported on M0054 (with M0125 accessory board) -if [ "$OSD" == "ENABLE" ]; then - /bin/echo "Starting OSD driver" - msp_osd start -d /dev/ttyHS1 -fi - -# Start optional EXTRA_STEPS -for i in "${EXTRA_STEPS[@]}" -do - $i -done diff --git a/boards/mro/ctrl-zero-classic/bootloader.px4board b/boards/mro/ctrl-zero-classic/bootloader.px4board deleted file mode 100644 index 19b6e66..0000000 --- a/boards/mro/ctrl-zero-classic/bootloader.px4board +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_ROMFSROOT="" diff --git a/boards/mro/ctrl-zero-classic/default.px4board b/boards/mro/ctrl-zero-classic/default.px4board deleted file mode 100644 index f88c948..0000000 --- a/boards/mro/ctrl-zero-classic/default.px4board +++ /dev/null @@ -1,99 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS2" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS0" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL3="/dev/ttyS4" -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_BAROMETER_DPS310=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_BOSCH_BMI088=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UUV_ATT_CONTROL=y -CONFIG_MODULES_UUV_POS_CONTROL=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SERIAL_TEST=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_FAKE_GPS=y diff --git a/boards/mro/ctrl-zero-classic/extras/mro_ctrl-zero-classic_bootloader.bin b/boards/mro/ctrl-zero-classic/extras/mro_ctrl-zero-classic_bootloader.bin deleted file mode 100755 index 0a9fb48..0000000 Binary files a/boards/mro/ctrl-zero-classic/extras/mro_ctrl-zero-classic_bootloader.bin and /dev/null differ diff --git a/boards/mro/ctrl-zero-classic/firmware.prototype b/boards/mro/ctrl-zero-classic/firmware.prototype deleted file mode 100644 index cc84996..0000000 --- a/boards/mro/ctrl-zero-classic/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 1022, - "magic": "mRo-ctrl-zero-classic", - "description": "Firmware for the mRo-ctrl-zero-classic board", - "image": "", - "build_time": 0, - "summary": "mRo-ctrl-zero-classic", - "version": "0.1", - "image_size": 0, - "image_maxsize": 1966080, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/mro/ctrl-zero-classic/init/rc.board_defaults b/boards/mro/ctrl-zero-classic/init/rc.board_defaults deleted file mode 100644 index 32117f4..0000000 --- a/boards/mro/ctrl-zero-classic/init/rc.board_defaults +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 10.1 -param set-default BAT1_A_PER_V 17 - -safety_button start diff --git a/boards/mro/ctrl-zero-classic/init/rc.board_sensors b/boards/mro/ctrl-zero-classic/init/rc.board_sensors deleted file mode 100644 index 111e3eb..0000000 --- a/boards/mro/ctrl-zero-classic/init/rc.board_sensors +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# -# board specific sensors init -#------------------------------------------------------------------------------ -board_adc start - -# Internal ICM-20602 -icm20602 -s -b 1 -R 8 start - -# Internal SPI bus BMI088 accel & gyro -bmi088 -A -s -b 5 -R 8 start -bmi088 -G -s -b 5 -R 8 start - -# Internal ICM-20948 (with magnetometer) -icm20948 -s -b 1 -R 8 -M start - -# Interal DPS310 (barometer) -dps310 -s -b 2 start diff --git a/boards/mro/ctrl-zero-classic/nuttx-config/bootloader/defconfig b/boards/mro/ctrl-zero-classic/nuttx-config/bootloader/defconfig deleted file mode 100644 index c8a5905..0000000 --- a/boards/mro/ctrl-zero-classic/nuttx-config/bootloader/defconfig +++ /dev/null @@ -1,90 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_CONSOLE is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_SPI_EXCHANGE is not set -# CONFIG_STM32H7_SYSCFG is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/mro/ctrl-zero-classic/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743II=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_INITTHREAD_PRIORITY=254 -CONFIG_BOARD_LATE_INITIALIZE=y -CONFIG_BOARD_LOOPSPERMSEC=95150 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x1022 -CONFIG_CDCACM_PRODUCTSTR="PX4 BL mRo ControlZero Classic" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="mRo" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_EXPERIMENTAL=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="bootloader_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SPI=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_USART3=y -CONFIG_SYSTEMTICK_HOOK=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGINT_CHAR=0x03 -CONFIG_TTY_SIGTSTP=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/mro/ctrl-zero-classic/nuttx-config/include/board.h b/boards/mro/ctrl-zero-classic/nuttx-config/include/board.h deleted file mode 100644 index 9b1ae63..0000000 --- a/boards/mro/ctrl-zero-classic/nuttx-config/include/board.h +++ /dev/null @@ -1,280 +0,0 @@ -/************************************************************************************ - * nuttx-config/include/board.h - * - * Copyright (C) 2020 Gregory Nutt. All rights reserved. - * Authors: David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ -#pragma once - -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/* Clocking *************************************************************************/ -/* The board provides the following clock sources: - * - * X1: 24 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 16 MHz RC factory-trimmed internal oscillator - * HSE: 24 MHz crystal for HSE - */ -#define STM32_BOARD_XTAL 24000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 0 - -/* Main PLL Configuration. - * - * PLL source is HSE = 24,000,000 - * - * PLL_VCOx = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 1 <= PLLM <= 63 - * 4 <= PLLN <= 512 - * 150 MHz <= PLL_VCOL <= 420MHz - * 192 MHz <= PLL_VCOH <= 836MHz - * - * SYSCLK = PLL_VCO / PLLP - * CPUCLK = SYSCLK / D1CPRE - * Subject to - * - * PLLP1 = {2, 4, 6, 8, ..., 128} - * PLLP2,3 = {2, 3, 4, ..., 128} - * CPUCLK <= 480 MHz - */ -#define STM32_PLLCFG_PLLSRC RCC_PLLCKSELR_PLLSRC_HSE - -/* PLL1, wide 4 - 8 MHz input, enable DIVP, DIVQ, DIVR - * - * PLL1_VCO = (24,000,000 / 2) * 80 = 960 MHz - * - * PLL1P = PLL1_VCO/2 = 960 MHz / 2 = 480 MHz - * PLL1Q = PLL1_VCO/4 = 960 MHz / 4 = 240 MHz - * PLL1R = PLL1_VCO/8 = 960 MHz / 8 = 120 MHz - */ -#define STM32_PLLCFG_PLL1CFG (RCC_PLLCFGR_PLL1VCOSEL_WIDE|RCC_PLLCFGR_PLL1RGE_4_8_MHZ|RCC_PLLCFGR_DIVP1EN|RCC_PLLCFGR_DIVQ1EN|RCC_PLLCFGR_DIVR1EN) -#define STM32_PLLCFG_PLL1M RCC_PLLCKSELR_DIVM1(2) -#define STM32_PLLCFG_PLL1N RCC_PLL1DIVR_N1(80) -#define STM32_PLLCFG_PLL1P RCC_PLL1DIVR_P1(2) -#define STM32_PLLCFG_PLL1Q RCC_PLL1DIVR_Q1(4) -#define STM32_PLLCFG_PLL1R RCC_PLL1DIVR_R1(8) - -#define STM32_VCO1_FREQUENCY ((STM32_HSE_FREQUENCY / 2) * 80) -#define STM32_PLL1P_FREQUENCY (STM32_VCO1_FREQUENCY / 2) -#define STM32_PLL1Q_FREQUENCY (STM32_VCO1_FREQUENCY / 4) -#define STM32_PLL1R_FREQUENCY (STM32_VCO1_FREQUENCY / 8) - -/* PLL2 */ -#define STM32_PLLCFG_PLL2CFG (RCC_PLLCFGR_PLL2VCOSEL_WIDE|RCC_PLLCFGR_PLL2RGE_4_8_MHZ|RCC_PLLCFGR_DIVP2EN|RCC_PLLCFGR_DIVQ2EN|RCC_PLLCFGR_DIVR2EN) -#define STM32_PLLCFG_PLL2M RCC_PLLCKSELR_DIVM2(4) -#define STM32_PLLCFG_PLL2N RCC_PLL2DIVR_N2(32) -#define STM32_PLLCFG_PLL2P RCC_PLL2DIVR_P2(2) -#define STM32_PLLCFG_PLL2Q RCC_PLL2DIVR_Q2(2) -#define STM32_PLLCFG_PLL2R RCC_PLL2DIVR_R2(2) - -#define STM32_VCO2_FREQUENCY ((STM32_HSE_FREQUENCY / 4) * 32) -#define STM32_PLL2P_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2Q_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2R_FREQUENCY (STM32_VCO2_FREQUENCY / 2) - -/* PLL3 */ -#define STM32_PLLCFG_PLL3CFG (RCC_PLLCFGR_PLL3VCOSEL_WIDE|RCC_PLLCFGR_PLL3RGE_4_8_MHZ|RCC_PLLCFGR_DIVQ3EN) -#define STM32_PLLCFG_PLL3M RCC_PLLCKSELR_DIVM3(4) -#define STM32_PLLCFG_PLL3N RCC_PLL3DIVR_N3(32) -#define STM32_PLLCFG_PLL3P RCC_PLL3DIVR_P3(2) -#define STM32_PLLCFG_PLL3Q RCC_PLL3DIVR_Q3(4) -#define STM32_PLLCFG_PLL3R RCC_PLL3DIVR_R3(2) - -#define STM32_VCO3_FREQUENCY ((STM32_HSE_FREQUENCY / 4) * 32) -#define STM32_PLL3P_FREQUENCY (STM32_VCO3_FREQUENCY / 2) -#define STM32_PLL3Q_FREQUENCY (STM32_VCO3_FREQUENCY / 4) -#define STM32_PLL3R_FREQUENCY (STM32_VCO3_FREQUENCY / 2) - -/* SYSCLK = PLL1P = 480MHz - * CPUCLK = SYSCLK / 1 = 480 MHz - */ -#define STM32_RCC_D1CFGR_D1CPRE (RCC_D1CFGR_D1CPRE_SYSCLK) -#define STM32_SYSCLK_FREQUENCY (STM32_PLL1P_FREQUENCY) -#define STM32_CPUCLK_FREQUENCY (STM32_SYSCLK_FREQUENCY / 1) - -/* Configure Clock Assignments */ - -/* AHB clock (HCLK) is SYSCLK/2 (240 MHz max) - * HCLK1 = HCLK2 = HCLK3 = HCLK4 = 240 - */ -#define STM32_RCC_D1CFGR_HPRE RCC_D1CFGR_HPRE_SYSCLKd2 /* HCLK = SYSCLK / 2 */ -#define STM32_ACLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* ACLK in D1, HCLK3 in D1 */ -#define STM32_HCLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* HCLK in D2, HCLK4 in D3 */ -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/2 (120 MHz) */ -#define STM32_RCC_D2CFGR_D2PPRE1 RCC_D2CFGR_D2PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB2 clock (PCLK2) is HCLK/2 (120 MHz) */ -#define STM32_RCC_D2CFGR_D2PPRE2 RCC_D2CFGR_D2PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB3 clock (PCLK3) is HCLK/2 (120 MHz) */ -#define STM32_RCC_D1CFGR_D1PPRE RCC_D1CFGR_D1PPRE_HCLKd2 /* PCLK3 = HCLK / 2 */ -#define STM32_PCLK3_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB4 clock (PCLK4) is HCLK/4 (120 MHz) */ -#define STM32_RCC_D3CFGR_D3PPRE RCC_D3CFGR_D3PPRE_HCLKd2 /* PCLK4 = HCLK / 2 */ -#define STM32_PCLK4_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timer clock frequencies */ - -/* Timers driven from APB1 will be twice PCLK1 */ -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* Timers driven from APB2 will be twice PCLK2 */ -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM15_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM16_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM17_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Kernel Clock Configuration - * Note: look at Table 54 in ST Manual - */ -#define STM32_RCC_D2CCIP2R_I2C123SRC RCC_D2CCIP2R_I2C123SEL_HSI /* I2C123 clock source */ -#define STM32_RCC_D3CCIPR_I2C4SRC RCC_D3CCIPR_I2C4SEL_HSI /* I2C4 clock source */ -#define STM32_RCC_D2CCIP1R_SPI123SRC RCC_D2CCIP1R_SPI123SEL_PLL2 /* SPI123 clock source */ -#define STM32_RCC_D2CCIP1R_SPI45SRC RCC_D2CCIP1R_SPI45SEL_PLL2 /* SPI45 clock source */ -#define STM32_RCC_D3CCIPR_SPI6SRC RCC_D3CCIPR_SPI6SEL_PLL2 /* SPI6 clock source */ -#define STM32_RCC_D2CCIP2R_USBSRC RCC_D2CCIP2R_USBSEL_PLL3 /* USB 1 and 2 clock source */ -#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2 /* ADC 1 2 3 clock source */ -#define STM32_RCC_D2CCIP1R_FDCANSEL RCC_D2CCIP1R_FDCANSEL_HSE /* FDCAN 1 2 clock source */ - -#define STM32_FDCANCLK STM32_HSE_FREQUENCY - -/* FLASH wait states */ -#define BOARD_FLASH_WAITSTATES 2 - -/* SDMMC definitions ********************************************************/ -/* Init 400kHz, freq = PLL1Q/(2*div) div = PLL1Q/(2*freq) */ -#define STM32_SDMMC_INIT_CLKDIV (300 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* 25 MHz Max for now, 25 mHZ = PLL1Q/(2*div), div = PLL1Q/(2*freq) - * div = 4.8 = 240 / 50, So round up to 5 for default speed 24 MB/s - */ -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_MMCXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_SDXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - - -/* UART/USART */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ -#define GPIO_USART2_RX GPIO_USART2_RX_2 /* PD6 */ -#define GPIO_USART2_CTS GPIO_USART2_CTS_NSS_2 /* PD3 */ -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 /* PD4 */ - -#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ -#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ -#define GPIO_USART3_CTS GPIO_USART3_CTS_NSS_2 /* PD11 */ -#define GPIO_USART3_RTS GPIO_USART3_RTS_2 /* PD12 */ - -#define GPIO_UART4_TX GPIO_UART4_TX_2 /* PA0 */ -#define GPIO_UART4_RX GPIO_UART4_RX_2 /* PA1 */ - -#define GPIO_USART6_TX 0 /* USART6 is RX-only */ -#define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC7 */ - -#define GPIO_UART7_TX GPIO_UART7_TX_3 /* PE8 */ -#define GPIO_UART7_RX GPIO_UART7_RX_3 /* PE7 */ - -#define GPIO_UART8_TX GPIO_UART8_TX_1 /* PE1 */ -#define GPIO_UART8_RX GPIO_UART8_RX_1 /* PE0 */ - - -/* CAN */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 /* PD0 */ -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 /* PD1 */ - -#define GPIO_CAN2_RX GPIO_CAN2_RX_1 /* PB12 */ -#define GPIO_CAN2_TX GPIO_CAN2_TX_1 /* PB13 */ - - -/* SPI */ -#define ADJ_SLEW_RATE(p) (((p) & ~GPIO_SPEED_MASK) | (GPIO_SPEED_2MHz)) - -#define GPIO_SPI1_SCK ADJ_SLEW_RATE(GPIO_SPI1_SCK_1) /* PA5 */ -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 /* PA7 */ - -#define GPIO_SPI2_SCK ADJ_SLEW_RATE(GPIO_SPI2_SCK_3) /* PB10 */ -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 /* PB14 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 /* PB15 */ - -#define GPIO_SPI5_SCK ADJ_SLEW_RATE(GPIO_SPI5_SCK_1) /* PF7 */ -#define GPIO_SPI5_MISO GPIO_SPI5_MISO_1 /* PF8 */ -#define GPIO_SPI5_MOSI GPIO_SPI5_MOSI_2 /* PF9 */ - - -/* I2C */ -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 /* PB8 */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 /* PB9 */ - -#define GPIO_I2C3_SCL GPIO_I2C3_SCL_2 /* PH7 */ -#define GPIO_I2C3_SDA GPIO_I2C3_SDA_2 /* PH8 */ - -#define GPIO_I2C4_SCL GPIO_I2C4_SCL_4 /* PB6 */ -#define GPIO_I2C4_SDA GPIO_I2C4_SDA_4 /* PB7 */ diff --git a/boards/mro/ctrl-zero-classic/nuttx-config/include/board_dma_map.h b/boards/mro/ctrl-zero-classic/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 10011ed..0000000 --- a/boards/mro/ctrl-zero-classic/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -#pragma once - -// DMAMUX1 -#define DMAMAP_SPI1_RX DMAMAP_DMA12_SPI1RX_0 /* DMA1:37 */ -#define DMAMAP_SPI1_TX DMAMAP_DMA12_SPI1TX_0 /* DMA1:38 */ - -#define DMAMAP_USART6_RX DMAMAP_DMA12_USART6RX_1 /* DMA1:71 */ -#define DMAMAP_USART6_TX DMAMAP_DMA12_USART6TX_1 /* DMA1:72 */ - -#define DMAMAP_SPI5_RX DMAMAP_DMA12_SPI5RX_0 /* DMA1:83 */ -#define DMAMAP_SPI5_TX DMAMAP_DMA12_SPI5TX_0 /* DMA1:84 */ diff --git a/boards/mro/ctrl-zero-classic/nuttx-config/nsh/defconfig b/boards/mro/ctrl-zero-classic/nuttx-config/nsh/defconfig deleted file mode 100644 index e5169e7..0000000 --- a/boards/mro/ctrl-zero-classic/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,259 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_FS_PROCFS_EXCLUDE_ENVIRON is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/mro/ctrl-zero-classic/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743II=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=95150 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x1022 -CONFIG_CDCACM_PRODUCTSTR="mRoControlZero Classic" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="mRo" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_MEMFAULT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXPERIMENTAL=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=4 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_PROGMEM=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32H7_ADC1=y -CONFIG_STM32H7_ADC3=y -CONFIG_STM32H7_BBSRAM=y -CONFIG_STM32H7_BBSRAM_FILES=5 -CONFIG_STM32H7_BDMA=y -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_DMA2=y -CONFIG_STM32H7_DMACAPABLE=y -CONFIG_STM32H7_FLOWCONTROL_BROKEN=y -CONFIG_STM32H7_I2C1=y -CONFIG_STM32H7_I2C3=y -CONFIG_STM32H7_I2C4=y -CONFIG_STM32H7_I2C_DYNTIMEO=y -CONFIG_STM32H7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_RTC=y -CONFIG_STM32H7_RTC_HSECLOCK=y -CONFIG_STM32H7_RTC_MAGIC_REG=1 -CONFIG_STM32H7_SAVE_CRASHDUMP=y -CONFIG_STM32H7_SDMMC1=y -CONFIG_STM32H7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_SPI1=y -CONFIG_STM32H7_SPI1_DMA=y -CONFIG_STM32H7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32H7_SPI2=y -CONFIG_STM32H7_SPI5=y -CONFIG_STM32H7_SPI5_DMA=y -CONFIG_STM32H7_SPI5_DMA_BUFFER=1024 -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_TIM2=y -CONFIG_STM32H7_TIM3=y -CONFIG_STM32H7_TIM4=y -CONFIG_STM32H7_TIM8=y -CONFIG_STM32H7_UART4=y -CONFIG_STM32H7_UART7=y -CONFIG_STM32H7_UART8=y -CONFIG_STM32H7_USART2=y -CONFIG_STM32H7_USART3=y -CONFIG_STM32H7_USART6=y -CONFIG_STM32H7_USART_BREAKS=y -CONFIG_STM32H7_USART_INVERT=y -CONFIG_STM32H7_USART_SINGLEWIRE=y -CONFIG_STM32H7_USART_SWAP=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGTSTP=y -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_SERIAL_CONSOLE=y -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_TXBUFSIZE=3000 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/mro/ctrl-zero-classic/nuttx-config/scripts/bootloader_script.ld b/boards/mro/ctrl-zero-classic/nuttx-config/scripts/bootloader_script.ld deleted file mode 100644 index 3fb4cc1..0000000 --- a/boards/mro/ctrl-zero-classic/nuttx-config/scripts/bootloader_script.ld +++ /dev/null @@ -1,221 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2020 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The board uses an STM32H743II has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * There's a switch on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the switch is - * drepresed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743ZI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 128K - DTCM1_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - DTCM2_RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */ - SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */ - SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */ - BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > AXI_SRAM AT > FLASH - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > AXI_SRAM - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } - - .ramfunc : { - _sramfuncs = .; - *(.ramfunc .ramfunc.*) - . = ALIGN(4); - _eramfuncs = .; - } > ITCM_RAM AT > FLASH - - _framfuncs = LOADADDR(.ramfunc); -} diff --git a/boards/mro/ctrl-zero-classic/nuttx-config/scripts/script.ld b/boards/mro/ctrl-zero-classic/nuttx-config/scripts/script.ld deleted file mode 100644 index 02e763a..0000000 --- a/boards/mro/ctrl-zero-classic/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,228 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2021 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The board uses an STM32H743XIH6 and has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * There's a switch on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the switch is - * drepresed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743ZI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - FLASH (rx) : ORIGIN = 0x08020000, LENGTH = 1920K - - DTCM1_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - DTCM2_RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */ - SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */ - SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */ - BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH - - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - - /* Pad out last section as the STM32H7 Flash write size is 256 bits. 32 bytes */ - . = ALIGN(16); - FILL(0xffff) - . += 16; - } > AXI_SRAM AT > FLASH = 0xffff - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > AXI_SRAM - - /* Emit the the D3 power domain section for locating BDMA data */ - - .sram4_reserve (NOLOAD) : - { - *(.sram4) - . = ALIGN(4); - _sram4_heap_start = ABSOLUTE(.); - } > SRAM4 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/mro/ctrl-zero-classic/src/CMakeLists.txt b/boards/mro/ctrl-zero-classic/src/CMakeLists.txt deleted file mode 100644 index 822841a..0000000 --- a/boards/mro/ctrl-zero-classic/src/CMakeLists.txt +++ /dev/null @@ -1,64 +0,0 @@ -############################################################################ -# -# Copyright (c) 2021 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. -# -############################################################################ -if("${PX4_BOARD_LABEL}" STREQUAL "bootloader") - add_library(drivers_board - bootloader_main.c - usb.c - ) - target_link_libraries(drivers_board - PRIVATE - nuttx_arch - nuttx_drivers - bootloader - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/bootloader/common) - -else() - add_library(drivers_board - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - usb.c - ) - - target_link_libraries(drivers_board - PRIVATE - arch_spi - drivers__led - nuttx_arch - nuttx_drivers - px4_layer - ) -endif() diff --git a/boards/mro/ctrl-zero-classic/src/board_config.h b/boards/mro/ctrl-zero-classic/src/board_config.h deleted file mode 100644 index dfb0dfc..0000000 --- a/boards/mro/ctrl-zero-classic/src/board_config.h +++ /dev/null @@ -1,187 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * Board internal definitions - */ - -#pragma once - -#include -#include -#include -#include - -/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */ -#define GPIO_nLED_RED /* PB11 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN11) -#define GPIO_nLED_GREEN /* PB1 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN1) -#define GPIO_nLED_BLUE /* PB3 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN3) - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_OVERLOAD_LED LED_RED -#define BOARD_ARMED_STATE_LED LED_BLUE - -/* ADC channels */ -#define PX4_ADC_GPIO \ - /* PA2 */ GPIO_ADC12_INP14, \ - /* PA3 */ GPIO_ADC12_INP15, \ - /* PA4 */ GPIO_ADC12_INP18, \ - /* PC1 */ GPIO_ADC123_INP11 - -/* Define Channel numbers must match above GPIO pins */ -#define ADC_BATTERY_VOLTAGE_CHANNEL 14 /* PA2 BATT_VOLT_SENS */ -#define ADC_BATTERY_CURRENT_CHANNEL 15 /* PA3 BATT_CURRENT_SENS */ -#define ADC_SCALED_V5_CHANNEL 18 /* PA4 VDD_5V_SENS */ -#define ADC_RC_RSSI_CHANNEL 11 /* PC1 */ - -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY_CURRENT_CHANNEL) | \ - (1 << ADC_SCALED_V5_CHANNEL) | \ - (1 << ADC_RC_RSSI_CHANNEL)) - -/* HW has to large of R termination on ADC todo:change when HW value is chosen */ -#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f) - -/* CAN Silence: Silent mode control */ -#define GPIO_CAN1_SILENT_S0 /* PF5 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTF|GPIO_PIN5) -#define GPIO_CAN2_SILENT_S0 /* PF5 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTF|GPIO_PIN5) - -/* PWM */ -#define DIRECT_PWM_OUTPUT_CHANNELS 12 - -/* Power supply control and monitoring GPIOs */ -#define GPIO_nPOWER_IN_A /* PB5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5) - -#define GPIO_VDD_BRICK1_VALID GPIO_nPOWER_IN_A /* Brick 1 Is Chosen */ -#define BOARD_NUMBER_BRICKS 1 - -#define GPIO_VDD_3V3_SPEKTRUM_POWER_EN /* PE4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN4) - -/* Define True logic Power Control in arch agnostic form */ -#define VDD_3V3_SPEKTRUM_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SPEKTRUM_POWER_EN, (!on_true)) -#define READ_VDD_3V3_SPEKTRUM_POWER_EN() (px4_arch_gpioread(GPIO_VDD_3V3_SPEKTRUM_POWER_EN) == 0) - -/* Tone alarm output */ -#define TONE_ALARM_TIMER 2 /* timer 2 */ -#define TONE_ALARM_CHANNEL 1 /* PA15 TIM2_CH1 */ - -#define GPIO_BUZZER_1 /* PA15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) - -#define GPIO_TONE_ALARM_IDLE GPIO_BUZZER_1 -#define GPIO_TONE_ALARM GPIO_TIM2_CH1OUT_2 - -/* USB OTG FS */ -#define GPIO_OTGFS_VBUS /* PA9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 3 /* use timer3 for the HRT */ -#define HRT_TIMER_CHANNEL 1 /* use capture/compare channel 1 */ - -#define HRT_PPM_CHANNEL /* T3C3 */ 3 /* use capture/compare channel 3 */ -#define GPIO_PPM_IN /* PB0 T3C3 */ GPIO_TIM3_CH3IN_1 - -/* RC Serial port */ -#define RC_SERIAL_PORT "/dev/ttyS3" - -#define GPIO_RSSI_IN /* PC1 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN1) - -/* Safety Switch: Enable the FMU to control it if there is no px4io fixme:This should be BOARD_SAFETY_LED(__ontrue) */ -#define GPIO_SAFETY_SWITCH_IN /* PC4 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN4) -/* Enable the FMU to use the switch it if there is no px4io fixme:This should be BOARD_SAFTY_BUTTON() */ -#define GPIO_BTN_SAFETY GPIO_SAFETY_SWITCH_IN /* Enable the FMU to control it if there is no px4io */ - -/* Power switch controls ******************************************************/ -#define SPEKTRUM_POWER(_on_true) VDD_3V3_SPEKTRUM_POWER_EN(_on_true) - -/* - * Board has a separate RC_IN - * - * GPIO PPM_IN on PB0 T3CH3 - * SPEKTRUM_RX (it's TX or RX in Bind) on UART6 PC7 - * Inversion is possible in the UART and can drive GPIO_PPM_IN as an output - */ -#define GPIO_PPM_IN_AS_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN0) -#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_PPM_IN_AS_OUT) -#define SPEKTRUM_RX_AS_UART() /* Can be left as uart */ -#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true)) - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_USB_VALID BOARD_ADC_USB_CONNECTED -#define BOARD_ADC_SERVO_VALID (1) /* never powers off the Servo rail */ -#define BOARD_ADC_BRICK_VALID (px4_arch_gpioread(GPIO_VDD_BRICK1_VALID)) - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ -#define BOARD_HAS_ON_RESET 1 - -#define BOARD_HAS_STATIC_MANIFEST 1 - - -#define BOARD_NUM_IO_TIMERS 5 - - -#define BOARD_ENABLE_CONSOLE_BUFFER - -#define PX4_GPIO_INIT_LIST { \ - PX4_ADC_GPIO, \ - GPIO_CAN1_TX, \ - GPIO_CAN1_RX, \ - GPIO_CAN2_TX, \ - GPIO_CAN2_RX, \ - GPIO_CAN1_SILENT_S0, \ - GPIO_CAN2_SILENT_S0, \ - GPIO_nPOWER_IN_A, \ - GPIO_VDD_3V3_SPEKTRUM_POWER_EN, \ - GPIO_TONE_ALARM_IDLE, \ - GPIO_SAFETY_SWITCH_IN, \ - GPIO_OTGFS_VBUS, \ - } - -__BEGIN_DECLS -#ifndef __ASSEMBLY__ - -extern void stm32_spiinitialize(void); -extern void board_peripheral_reset(int ms); - -#include -#endif /* __ASSEMBLY__ */ -__END_DECLS diff --git a/boards/mro/ctrl-zero-classic/src/bootloader_main.c b/boards/mro/ctrl-zero-classic/src/bootloader_main.c deleted file mode 100644 index 3a0e1a1..0000000 --- a/boards/mro/ctrl-zero-classic/src/bootloader_main.c +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020-2021 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. - * - ****************************************************************************/ - -/** - * @file bootloader_main.c - * - * FMU-specific early startup code for bootloader -*/ - -#include "board_config.h" -#include "bl.h" - -#include -#include -#include -#include -#include -#include "arm_internal.h" -#include - -extern int sercon_main(int c, char **argv); - -__EXPORT void board_on_reset(int status) {} - -__EXPORT void stm32_boardinitialize(void) -{ - /* configure USB interfaces */ - stm32_configgpio(GPIO_OTGFS_VBUS); -} - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - return 0; -} - -void board_late_initialize(void) -{ - sercon_main(0, NULL); -} - -extern void sys_tick_handler(void); -void board_timerhook(void) -{ - sys_tick_handler(); -} diff --git a/boards/mro/ctrl-zero-classic/src/hw_config.h b/boards/mro/ctrl-zero-classic/src/hw_config.h deleted file mode 100644 index 8fdaec9..0000000 --- a/boards/mro/ctrl-zero-classic/src/hw_config.h +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/**************************************************************************** - * 10-8--2016: - * To simplify the ripple effect on the tools, we will be using - * /dev/serial/by-id/PX4 to locate PX4 devices. Therefore - * moving forward all Bootloaders must contain the prefix "PX4 BL " - * in the USBDEVICESTRING - * This Change will be made in an upcoming BL release - ****************************************************************************/ -/* - * Define usage to configure a bootloader - * - * - * Constant example Usage - * APP_LOAD_ADDRESS 0x08004000 - The address in Linker Script, where the app fw is org-ed - * BOOTLOADER_DELAY 5000 - Ms to wait while under USB pwr or bootloader request - * BOARD_FMUV2 - * INTERFACE_USB 1 - (Optional) Scan and use the USB interface for bootloading - * INTERFACE_USART 1 - (Optional) Scan and use the Serial interface for bootloading - * USBDEVICESTRING "PX4 BL FMU v2.x" - USB id string - * USBPRODUCTID 0x0011 - PID Should match defconfig - * BOOT_DELAY_ADDRESS 0x000001a0 - (Optional) From the linker script from Linker Script to get a custom - * delay provided by an APP FW - * BOARD_TYPE 9 - Must match .prototype boad_id - * _FLASH_KBYTES (*(uint16_t *)0x1fff7a22) - Run time flash size detection - * BOARD_FLASH_SECTORS ((_FLASH_KBYTES == 0x400) ? 11 : 23) - Run time determine the physical last sector - * BOARD_FLASH_SECTORS 11 - Hard coded zero based last sector - * BOARD_FLASH_SIZE (_FLASH_KBYTES*1024)- Total Flash size of device, determined at run time. - * (1024 * 1024) - Hard coded Total Flash of device - The bootloader and app reserved will be deducted - * programmatically - * - * BOARD_FIRST_FLASH_SECTOR_TO_ERASE 2 - Optional sectors index in the flash_sectors table (F4 only), to begin erasing. - * This is to allow sectors to be reserved for app fw usage. That will NOT be erased - * during a FW upgrade. - * The default is 0, and selects the first sector to be erased, as the 0th entry in the - * flash_sectors table. Which is the second physical sector of FLASH in the device. - * The first physical sector of FLASH is used by the bootloader, and is not defined - * in the table. - * - * APP_RESERVATION_SIZE (BOARD_FIRST_FLASH_SECTOR_TO_ERASE * 16 * 1024) - Number of bytes reserved by the APP FW. This number plus - * BOOTLOADER_RESERVATION_SIZE will be deducted from - * BOARD_FLASH_SIZE to determine the size of the App FW - * and hence the address space of FLASH to erase and program. - * USBMFGSTRING "PX4 AP" - Optional USB MFG string (default is '3D Robotics' if not defined.) - * SERIAL_BREAK_DETECT_DISABLED - Optional prevent break selection on Serial port from entering or staying in BL - * - * * Other defines are somewhat self explanatory. - */ - -/* Boot device selection list*/ -#define USB0_DEV 0x01 -#define SERIAL0_DEV 0x02 -#define SERIAL1_DEV 0x04 - -#define APP_LOAD_ADDRESS 0x08020000 -#define BOOTLOADER_DELAY 5000 -#define INTERFACE_USB 1 -#define INTERFACE_USB_CONFIG "/dev/ttyACM0" -#define BOARD_VBUS MK_GPIO_INPUT(GPIO_OTGFS_VBUS) - -//#define USE_VBUS_PULL_DOWN -#define INTERFACE_USART 1 -#define INTERFACE_USART_CONFIG "/dev/ttyS0,115200" -#define BOOT_DELAY_ADDRESS 0x000001a0 -#define BOARD_TYPE 1024 -#define _FLASH_KBYTES (*(uint32_t *)0x1FF1E880) -#define BOARD_FLASH_SECTORS (15) -#define BOARD_FLASH_SIZE (_FLASH_KBYTES * 1024) - -#define OSC_FREQ 24 - -#define BOARD_PIN_LED_ACTIVITY GPIO_nLED_RED -#define BOARD_PIN_LED_BOOTLOADER GPIO_nLED_RED -#define BOARD_LED_ON 0 -#define BOARD_LED_OFF 1 - -#define SERIAL_BREAK_DETECT_DISABLED 1 - -#if !defined(ARCH_SN_MAX_LENGTH) -# define ARCH_SN_MAX_LENGTH 12 -#endif - -#if !defined(APP_RESERVATION_SIZE) -# define APP_RESERVATION_SIZE 0 -#endif - -#if !defined(BOARD_FIRST_FLASH_SECTOR_TO_ERASE) -# define BOARD_FIRST_FLASH_SECTOR_TO_ERASE 1 -#endif - -#if !defined(USB_DATA_ALIGN) -# define USB_DATA_ALIGN -#endif - -#ifndef BOOT_DEVICES_SELECTION -# define BOOT_DEVICES_SELECTION USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif - -#ifndef BOOT_DEVICES_FILTER_ONUSB -# define BOOT_DEVICES_FILTER_ONUSB USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif diff --git a/boards/mro/ctrl-zero-classic/src/i2c.cpp b/boards/mro/ctrl-zero-classic/src/i2c.cpp deleted file mode 100644 index 1b8927c..0000000 --- a/boards/mro/ctrl-zero-classic/src/i2c.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), - initI2CBusExternal(3), - initI2CBusExternal(4), -}; diff --git a/boards/mro/ctrl-zero-classic/src/init.c b/boards/mro/ctrl-zero-classic/src/init.c deleted file mode 100644 index daaace4..0000000 --- a/boards/mro/ctrl-zero-classic/src/init.c +++ /dev/null @@ -1,204 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * board-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. - */ - -#include "board_config.h" - -#include - -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include - -#include - -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - bool last = READ_VDD_3V3_SPEKTRUM_POWER_EN(); - /* Keep Spektum on to discharge rail*/ - VDD_3V3_SPEKTRUM_POWER_EN(false); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ - VDD_3V3_SPEKTRUM_POWER_EN(last); -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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 - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Power on Interfaces */ - board_control_spi_sensors_power(true, 0xffff); - VDD_3V3_SPEKTRUM_POWER_EN(true); - - px4_platform_init(); - - stm32_spiinitialize(); - - /* configure the DMA allocator */ - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_on(LED_GREEN); // Indicate Power. - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - -#ifdef CONFIG_MMCSD - /* Mount the SDIO-based MMC/SD block driver */ - /* First, get an instance of the SDIO interface */ - struct sdio_dev_s *sdio_dev = sdio_initialize(0); // SDIO_SLOTNO 0 Only one slot - - if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", 0); - } - - if (mmcsd_slotinitialize(0, sdio_dev) != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver\n"); - } - - /* Assume that the SD card is inserted. What choice do we have? */ - sdio_mediachange(sdio_dev, true); -#endif /* CONFIG_MMCSD */ - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/mro/ctrl-zero-classic/src/led.c b/boards/mro/ctrl-zero-classic/src/led.c deleted file mode 100644 index 0e7beb3..0000000 --- a/boards/mro/ctrl-zero-classic/src/led.c +++ /dev/null @@ -1,111 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -static uint32_t g_ledmap[] = { - GPIO_nLED_BLUE, // Indexed by LED_BLUE - GPIO_nLED_RED, // Indexed by LED_RED - GPIO_nLED_GREEN, // Indexed by LED_GREEN -}; - -__EXPORT void led_init(void) -{ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - if (g_ledmap[l] != 0) { - stm32_configgpio(g_ledmap[l]); - } - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - if (g_ledmap[led] != 0) { - stm32_gpiowrite(g_ledmap[led], !state); - } -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - if (g_ledmap[led] != 0) { - return !stm32_gpioread(g_ledmap[led]); - } - - return false; -} - -__EXPORT void led_on(int led) -{ - phy_set_led(led, true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(led, false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(led, !phy_get_led(led)); -} diff --git a/boards/mro/ctrl-zero-classic/src/spi.cpp b/boards/mro/ctrl-zero-classic/src/spi.cpp deleted file mode 100644 index 4a4c350..0000000 --- a/boards/mro/ctrl-zero-classic/src/spi.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20948, SPI::CS{GPIO::PortE, GPIO::Pin15}, SPI::DRDY{GPIO::PortE, GPIO::Pin12}), - }, {GPIO::PortE, GPIO::Pin3}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10}), - initSPIDevice(DRV_BARO_DEVTYPE_DPS310, SPI::CS{GPIO::PortD, GPIO::Pin7}), - }), - initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(DRV_GYR_DEVTYPE_BMI088, SPI::CS{GPIO::PortF, GPIO::Pin10}, SPI::DRDY{GPIO::PortF, GPIO::Pin3}), - initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::PortF, GPIO::Pin6}, SPI::DRDY{GPIO::PortF, GPIO::Pin1}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/mro/ctrl-zero-classic/src/timer_config.cpp b/boards/mro/ctrl-zero-classic/src/timer_config.cpp deleted file mode 100644 index 23bb7a1..0000000 --- a/boards/mro/ctrl-zero-classic/src/timer_config.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1, DMA{DMA::Index1}), - initIOTimer(Timer::Timer4, DMA{DMA::Index1}), - initIOTimer(Timer::Timer2, DMA{DMA::Index1}), - initIOTimer(Timer::Timer15), //DMA{DMA::Index2}), - initIOTimer(Timer::Timer8, DMA{DMA::Index1}), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortE, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel4}, {GPIO::PortD, GPIO::Pin15}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel3}, {GPIO::PortA, GPIO::Pin2}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel1}, {GPIO::PortA, GPIO::Pin15}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel4}, {GPIO::PortB, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::Timer15, Timer::Channel1}, {GPIO::PortE, GPIO::Pin5}), - initIOTimerChannel(io_timers, {Timer::Timer8, Timer::Channel1}, {GPIO::PortC, GPIO::Pin6}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/mro/ctrl-zero-classic/src/usb.c b/boards/mro/ctrl-zero-classic/src/usb.c deleted file mode 100644 index fe32ce7..0000000 --- a/boards/mro/ctrl-zero-classic/src/usb.c +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include "board_config.h" - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ -__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_STM32H7_OTGFS - stm32_configgpio(GPIO_OTGFS_VBUS); -#endif -} - - - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/mro/ctrl-zero-f7-oem/default.px4board b/boards/mro/ctrl-zero-f7-oem/default.px4board deleted file mode 100644 index b070185..0000000 --- a/boards/mro/ctrl-zero-f7-oem/default.px4board +++ /dev/null @@ -1,100 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS2" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS0" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL3="/dev/ttyS4" -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_BAROMETER_DPS310=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_BOSCH_BMI088=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SAFETY_BUTTON=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UUV_ATT_CONTROL=y -CONFIG_MODULES_UUV_POS_CONTROL=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BL_UPDATE=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SERIAL_TEST=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_FAKE_GPS=y diff --git a/boards/mro/ctrl-zero-f7-oem/firmware.prototype b/boards/mro/ctrl-zero-f7-oem/firmware.prototype deleted file mode 100644 index eb7d32c..0000000 --- a/boards/mro/ctrl-zero-f7-oem/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 141, - "magic": "mRo-ctrl-zero-f7-oem", - "description": "Firmware for the mRo-ctrl-zero-f7-oem board", - "image": "", - "build_time": 0, - "summary": "mRo-ctrl-zero-f7-oem", - "version": "0.1", - "image_size": 0, - "image_maxsize": 2064384, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/mro/ctrl-zero-f7-oem/init/rc.board_defaults b/boards/mro/ctrl-zero-f7-oem/init/rc.board_defaults deleted file mode 100644 index 32117f4..0000000 --- a/boards/mro/ctrl-zero-f7-oem/init/rc.board_defaults +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 10.1 -param set-default BAT1_A_PER_V 17 - -safety_button start diff --git a/boards/mro/ctrl-zero-f7-oem/init/rc.board_sensors b/boards/mro/ctrl-zero-f7-oem/init/rc.board_sensors deleted file mode 100644 index 88205f4..0000000 --- a/boards/mro/ctrl-zero-f7-oem/init/rc.board_sensors +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# -# mRo Control Zero specific board sensors init -#------------------------------------------------------------------------------ - -board_adc start - -# Internal ICM-20602 -icm20602 -s -b 1 -R 8 start - -# Internal SPI bus BMI088 accel & gyro -bmi088 -A -s -b 5 -R 8 start -bmi088 -G -s -b 5 -R 8 start - -# Internal ICM-20948 (with magnetometer) -icm20948 -s -b 1 -R 8 -M start - -# Interal DPS310 (barometer) -dps310 -s -b 2 start diff --git a/boards/mro/ctrl-zero-f7-oem/nuttx-config/include/board.h b/boards/mro/ctrl-zero-f7-oem/nuttx-config/include/board.h deleted file mode 100644 index 4f7dfd3..0000000 --- a/boards/mro/ctrl-zero-f7-oem/nuttx-config/include/board.h +++ /dev/null @@ -1,300 +0,0 @@ -/************************************************************************************ - * board.h - * - * Copyright (C) 2016-2018 Gregory Nutt. All rights reserved. - * Authors: David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ - -#pragma once - -/************************************************************************************ - * Included Files - ************************************************************************************/ -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The mRo Control Zero F7 OEM board provides the following clock sources: - * - * 24 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 16 MHz RC factory-trimmed - * HSE: 24 MHz crystal for HSE - */ -#define STM32_BOARD_XTAL 24000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 0 - -/* Main PLL Configuration. - * - * PLL source is HSE = 24,000,000 - * - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 2 <= PLLM <= 63 - * 192 <= PLLN <= 432 - * 192 MHz <= PLL_VCO <= 432MHz - * - * SYSCLK = PLL_VCO / PLLP - * Subject to - * - * PLLP = {2, 4, 6, 8} - * SYSCLK <= 216 MHz - * - * SDMMC and RNG Clock = PLL_VCO / PLLQ - * Subject to - * The SDMMC and the random number generator need a frequency lower than or equal - * to 48 MHz to work correctly. - * - * 2 <= PLLQ <= 15 - */ - -/* SDMMCCLK (= USB OTG FS clock = RNGCLK) should be <= 48MHz - * - * PLL_VCO = (16,000,000 / 24) * 432 = 432 MHz - * SYSCLK = 432 MHz / 2 = 216 MHz - * SDMMC and RNG Clock = 432 MHz / 9 = 48 MHz - */ -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(24) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(432) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(9) - -#define STM32_VCO_FREQUENCY ((STM32_HSE_FREQUENCY / 24) * 432) -#define STM32_SYSCLK_FREQUENCY (STM32_VCO_FREQUENCY / 2) -#define STM32_OTGFS_FREQUENCY (STM32_VCO_FREQUENCY / 9) - -/* Configure factors for PLLSAI clock */ -#define CONFIG_STM32F7_PLLSAI 1 -#define STM32_RCC_PLLSAICFGR_PLLSAIN RCC_PLLSAICFGR_PLLSAIN(192) -#define STM32_RCC_PLLSAICFGR_PLLSAIP RCC_PLLSAICFGR_PLLSAIP(8) -#define STM32_RCC_PLLSAICFGR_PLLSAIQ RCC_PLLSAICFGR_PLLSAIQ(4) -#define STM32_RCC_PLLSAICFGR_PLLSAIR RCC_PLLSAICFGR_PLLSAIR(2) - -/* Configure Dedicated Clock Configuration Register */ -#define STM32_RCC_DCKCFGR1_PLLI2SDIVQ RCC_DCKCFGR1_PLLI2SDIVQ(1) -#define STM32_RCC_DCKCFGR1_PLLSAIDIVQ RCC_DCKCFGR1_PLLSAIDIVQ(1) -#define STM32_RCC_DCKCFGR1_PLLSAIDIVR RCC_DCKCFGR1_PLLSAIDIVR(0) -#define STM32_RCC_DCKCFGR1_SAI1SRC RCC_DCKCFGR1_SAI1SEL(0) -#define STM32_RCC_DCKCFGR1_SAI2SRC RCC_DCKCFGR1_SAI2SEL(0) -#define STM32_RCC_DCKCFGR1_TIMPRESRC 0 -#define STM32_RCC_DCKCFGR1_DFSDM1SRC 0 -#define STM32_RCC_DCKCFGR1_ADFSDM1SRC 0 - -/* Configure factors for PLLI2S clock */ -#define CONFIG_STM32F7_PLLI2S 1 -#define STM32_RCC_PLLI2SCFGR_PLLI2SN RCC_PLLI2SCFGR_PLLI2SN(192) -#define STM32_RCC_PLLI2SCFGR_PLLI2SP RCC_PLLI2SCFGR_PLLI2SP(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SQ RCC_PLLI2SCFGR_PLLI2SQ(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SR RCC_PLLI2SCFGR_PLLI2SR(2) - -/* Configure Dedicated Clock Configuration Register 2 */ -#define STM32_RCC_DCKCFGR2_USART1SRC RCC_DCKCFGR2_USART1SEL_APB -#define STM32_RCC_DCKCFGR2_USART2SRC RCC_DCKCFGR2_USART2SEL_APB -#define STM32_RCC_DCKCFGR2_UART4SRC RCC_DCKCFGR2_UART4SEL_APB -#define STM32_RCC_DCKCFGR2_UART5SRC RCC_DCKCFGR2_UART5SEL_APB -#define STM32_RCC_DCKCFGR2_USART6SRC RCC_DCKCFGR2_USART6SEL_APB -#define STM32_RCC_DCKCFGR2_UART7SRC RCC_DCKCFGR2_UART7SEL_APB -#define STM32_RCC_DCKCFGR2_UART8SRC RCC_DCKCFGR2_UART8SEL_APB -#define STM32_RCC_DCKCFGR2_I2C1SRC RCC_DCKCFGR2_I2C1SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C2SRC RCC_DCKCFGR2_I2C2SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C3SRC RCC_DCKCFGR2_I2C3SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C4SRC RCC_DCKCFGR2_I2C4SEL_HSI -#define STM32_RCC_DCKCFGR2_LPTIM1SRC RCC_DCKCFGR2_LPTIM1SEL_APB -#define STM32_RCC_DCKCFGR2_CECSRC RCC_DCKCFGR2_CECSEL_HSI -#define STM32_RCC_DCKCFGR2_CK48MSRC RCC_DCKCFGR2_CK48MSEL_PLL -#define STM32_RCC_DCKCFGR2_SDMMCSRC RCC_DCKCFGR2_SDMMCSEL_48MHZ -#define STM32_RCC_DCKCFGR2_SDMMC2SRC RCC_DCKCFGR2_SDMMC2SEL_48MHZ -#define STM32_RCC_DCKCFGR2_DSISRC RCC_DCKCFGR2_DSISEL_PHY - - -/* Several prescalers allow the configuration of the two AHB buses, the - * high-speed APB (APB2) and the low-speed APB (APB1) domains. The maximum - * frequency of the two AHB buses is 216 MHz while the maximum frequency of - * the high-speed APB domains is 108 MHz. The maximum allowed frequency of - * the low-speed APB domain is 54 MHz. - */ - -/* AHB clock (HCLK) is SYSCLK (216 MHz) */ -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (54 MHz) */ -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (108MHz) */ -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* SDMMC dividers. Note that slower clocking is required when DMA is disabled - * in order to avoid RX overrun/TX underrun errors due to delayed responses - * to service FIFOs in interrupt driven mode. These values have not been - * tuned!!! - * - * SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(118+2)=400 KHz - */ - -/* Use the Falling edge of the SDIO_CLK clock to change the edge the - * data and commands are change on - */ -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - -#define STM32_SDMMC_INIT_CLKDIV (118 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* DMA ON: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(1+2)=16 MHz - * DMA OFF: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32F7_SDMMC_DMA -# define STM32_SDMMC_MMCXFR_CLKDIV (1 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (2 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -/* DMA ON: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(1+2)=16 MHz - * DMA OFF: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(2+2)=12 MHz - */ -#ifdef CONFIG_STM32F7_SDMMC_DMA -# define STM32_SDMMC_SDXFR_CLKDIV (1 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (2 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -/* FLASH wait states - * - * --------- ---------- ----------- - * VDD MAX SYSCLK WAIT STATES - * --------- ---------- ----------- - * 1.7-2.1 V 180 MHz 8 - * 2.1-2.4 V 216 MHz 9 - * 2.4-2.7 V 216 MHz 8 - * 2.7-3.6 V 216 MHz 7 - * --------- ---------- ----------- - */ - -#define BOARD_FLASH_WAITSTATES 7 - - -/* UART/USART */ -#define GPIO_USART2_RX GPIO_USART2_RX_2 /* PD6 */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 /* PD4 */ -#define GPIO_USART2_CTS GPIO_USART2_CTS_2 /* PD3 */ - -#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ -#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ -#define GPIO_USART3_RTS GPIO_USART3_RTS_2 /* PD12 */ -#define GPIO_USART3_CTS GPIO_USART3_CTS_2 /* PD11 */ - -#define GPIO_UART4_RX GPIO_UART4_RX_1 /* PA1 */ -#define GPIO_UART4_TX GPIO_UART4_TX_1 /* PA0 */ - -#define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC7 */ -#define GPIO_USART6_TX GPIO_USART6_TX_2 /* PG14 */ - -#define GPIO_UART7_RX GPIO_UART7_RX_1 /* PE7 */ -#define GPIO_UART7_TX GPIO_UART7_TX_1 /* PE8 */ - -/* USART8: has no remap - * - * GPIO_UART8_RX PE0 - * GPIO_UART8_TX PE1 - */ - - -/* CAN */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 /* PD0 */ -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 /* PD1 */ -#define GPIO_CAN2_RX GPIO_CAN2_RX_1 /* PB12 */ -#define GPIO_CAN2_TX GPIO_CAN2_TX_1 /* PB13 */ - - -/* SPI */ -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 /* PA5 */ -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 /* PA7 */ - -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_2 /* PB10 */ -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 /* PB14 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 /* PB15 */ - -#define GPIO_SPI5_SCK GPIO_SPI5_SCK_1 /* PF7 */ -#define GPIO_SPI5_MISO GPIO_SPI5_MISO_1 /* PF8 */ -#define GPIO_SPI5_MOSI GPIO_SPI5_MOSI_1 /* PF9 */ - - -/* I2C */ -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 /* PB8 */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 /* PB9 */ - -#define GPIO_I2C3_SCL GPIO_I2C3_SCL_2 /* PH7 */ -#define GPIO_I2C3_SDA GPIO_I2C3_SDA_2 /* PH8 */ - -#define GPIO_I2C4_SCL GPIO_I2C4_SCL_4 /* PB6 */ -#define GPIO_I2C4_SDA GPIO_I2C4_SDA_5 /* PB7 */ diff --git a/boards/mro/ctrl-zero-f7-oem/nuttx-config/include/board_dma_map.h b/boards/mro/ctrl-zero-f7-oem/nuttx-config/include/board_dma_map.h deleted file mode 100644 index c3df4fe..0000000 --- a/boards/mro/ctrl-zero-f7-oem/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/* -| DMA1 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | SPI3_RX_1 | SPDIFRX_DT | SPI3_RX_2 | SPI2_RX | SPI2_TX | SPI3_TX_1 | SPDIFRX_CS | SPI3_TX_2 | -| Channel 1 | I2C1_RX | I2C3_RX | TIM7_UP_1 | - | TIM7_UP_2 | I2C1_RX_1 | I2C1_TX | I2C1_TX_1 | -| Channel 2 | TIM4_CH1 | - | I2C4_RX | TIM4_CH2 | - | I2C4_RX | TIM4_UP | TIM4_CH3 | -| Channel 3 | - | TIM2_UP_1 | I2C3_RX_1 | - | I2C3_TX | TIM2_CH1 | TIM2_CH2 | TIM2_UP_2 | -| | | TIM2_CH3 | | | | | TIM2_CH4_1 | TIM2_CH4_2 | -| Channel 4 | UART5_RX | USART3_RX | UART4_RX | USART3_TX_1 | UART4_TX | USART2_RX | USART2_TX | UART5_TX | -| Channel 5 | UART8_TX | UART7_TX | TIM3_CH4 | UART7_RX | TIM3_CH1 | TIM3_CH2 | UART8_RX | TIM3_CH3 | -| | | | TIM3_UP | | TIM3_TRIG | | | | -| Channel 6 | TIM5_CH3 | TIM5_CH4_1 | TIM5_CH1 | TIM5_CH4_2 | TIM5_CH2 | - | TIM5_UP_2 | - | -| | TIM5_UP_1 | TIM5_TRIG_1 | | TIM5_TRIG_2 | | | | | -| Channel 7 | - | TIM6_UP | I2C2_RX | I2C2_RX_1 | USART3_TX_2 | DAC1 | DAC2 | I2C2_TX | -| Channel 8 | I2C3_TX | I2C4_RX | - | - | I2C2_TX | - | I2C4_TX | - | -| Channel 9 | - | SPI2_RX | - | - | - | - | SPI2_TX | - | -| | | | | | | | | | -| Usage | | USART3_RX | UART4_RX | USART3_TX_1 | | USART2_RX | | | - - -| DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | ADC1_1 | SAI1_A | TIM8_CH1_1 | SAI1_A_1 | ADC1_2 | SAI1_B_1 | TIM1_CH1_1 | SAI2_B_2 | -| | | | TIM8_CH2_1 | | | | TIM1_CH2_1 | | -| | | | TIM8_CH3_1 | | | | TIM1_CH3_1 | | -| Channel 1 | - | DCMI_1 | ADC2_1 | ADC2_2 | SAI1_B | SPI6_TX | SPI6_RX | DCMI_2 | -| Channel 2 | ADC3_1 | ADC3_2 | - | SPI5_RX_1 | SPI5_TX_1 | CRYP_OUT | CRYP_IN | HASH_IN | -| Channel 3 | SPI1_RX_1 | - | SPI1_RX_2 | SPI1_TX_1 | SAI2_A | SPI1_TX_2 | SAI2_B | QUADSPI | -| Channel 4 | SPI4_RX_1 | SPI4_TX_1 | USART1_RX_1 | SDMMC1_1 | - | USART1_RX_2 | SDMMC1_2 | USART1_TX | -| Channel 5 | - | USART6_RX_1 | USART6_RX_2 | SPI4_RX_2 | SPI4_TX_2 | - | USART6_TX_1 | USART6_TX_2 | -| Channel 6 | TIM1_TRIG_1 | TIM1_CH1_2 | TIM1_CH2_2 | TIM1_CH1 | TIM1_CH4 | TIM1_UP | TIM1_CH3_2 | - | -| | | | | | TIM1_TRIG_2 | | | | -| | | | | | TIM1_COM | | | | -| Channel 7 | - | TIM8_UP | TIM8_CH1_2 | TIM8_CH2_2 | TIM8_CH3_2 | SPI5_RX_2 | SPI5_TX_2 | TIM8_CH4 | -| | | | | | | | | TIM8_TRIG | -| | | | | | | | | TIM8_COM | -| Channel 8 | DSFDM1_FLT0 | DSFDM1_FLT1 | DSFDM1_FLT2 | DSFDM1_FLT3 | DSFDM1_FLT0 | DSFDM1_FLT1 | DSFDM1_FLT2 | DSFDM1_FLT3 | -| Channel 9 | JPEG_IN | JPEG_OUT | SPI4_TX | JPEG_IN | JPEG_OUT | SPI5_RX | - | - | -| Channel 10 | SAI1_B | SAI2_B | SAI2_A | - | - | - | SAI1_A | - | -| Channel 11 | SDMMC2 | - | QUADSPI | - | - | SDMMC2 | - | - | -| | | | | | | | | | -| Usage | SPI1_RX_1 | USART6_RX_2 | | SPI1_TX_1 | SPI5_TX_1 | SPI5_RX_2 | SDMMC1_2 | | - */ - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// DMAMAP_USART3_RX // DMA1, Stream 1, Channel 4 -// DMAMAP_UART4_RX // DMA1, Stream 2, Channel 4 -#define DMAMAP_USART3_TX DMAMAP_USART3_TX_1 // DMA1, Stream 3, Channel 4 -// AVAILABLE // DMA2, Stream 4 -// DMAMAP_USART2_RX // DMA1, Stream 5, Channel 4 - - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMAMAP_SPI1_RX DMAMAP_SPI1_RX_1 // DMA2, Stream 0, Channel 3 (SPI1 sensors RX) -#define DMAMAP_USART6_RX DMAMAP_USART6_RX_1 // DMA2, Stream 1, Channel 5 -// AVAILABLE // DMA2, Stream 2 -#define DMAMAP_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 3, Channel 3 (SPI1 sensors TX) -#define DMAMAP_SPI5_TX DMAMAP_SPI5_TX_1 // DMA2, Stream 4, Channel 3 (SPI5 sensors TX) -#define DMAMAP_SPI5_RX DMAMAP_SPI5_RX_2 // DMA2, Stream 5, Channel 3 (SPI5 sensors RX) -#define DMAMAP_SDMMC1 DMAMAP_SDMMC1_2 // DMA2, Stream 6, Channel 4 -// AVAILABLE // DMA2, Stream 7, Channel 5 diff --git a/boards/mro/ctrl-zero-f7-oem/nuttx-config/nsh/defconfig b/boards/mro/ctrl-zero-f7-oem/nuttx-config/nsh/defconfig deleted file mode 100644 index da43bb2..0000000 --- a/boards/mro/ctrl-zero-f7-oem/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,260 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_FS_PROCFS_EXCLUDE_ENVIRON is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/mro/ctrl-zero-f7-oem/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32f7" -CONFIG_ARCH_CHIP_STM32F777II=y -CONFIG_ARCH_CHIP_STM32F7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x008D -CONFIG_CDCACM_PRODUCTSTR="mRoControlZeroF7" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="mRo" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=3 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_MODE=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32F7_ADC1=y -CONFIG_STM32F7_BBSRAM=y -CONFIG_STM32F7_BBSRAM_FILES=5 -CONFIG_STM32F7_BKPSRAM=y -CONFIG_STM32F7_DMA1=y -CONFIG_STM32F7_DMA2=y -CONFIG_STM32F7_DMACAPABLE=y -CONFIG_STM32F7_FLOWCONTROL_BROKEN=y -CONFIG_STM32F7_I2C1=y -CONFIG_STM32F7_I2C3=y -CONFIG_STM32F7_I2C4=y -CONFIG_STM32F7_I2C_DYNTIMEO=y -CONFIG_STM32F7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32F7_OTGFS=y -CONFIG_STM32F7_PROGMEM=y -CONFIG_STM32F7_PWR=y -CONFIG_STM32F7_RTC=y -CONFIG_STM32F7_RTC_HSECLOCK=y -CONFIG_STM32F7_RTC_MAGIC_REG=1 -CONFIG_STM32F7_SAVE_CRASHDUMP=y -CONFIG_STM32F7_SDMMC1=y -CONFIG_STM32F7_SDMMC_DMA=y -CONFIG_STM32F7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32F7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32F7_SPI1=y -CONFIG_STM32F7_SPI1_DMA=y -CONFIG_STM32F7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI2=y -CONFIG_STM32F7_SPI5=y -CONFIG_STM32F7_SPI5_DMA=y -CONFIG_STM32F7_SPI5_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI_DMATHRESHOLD=8 -CONFIG_STM32F7_TIM10=y -CONFIG_STM32F7_TIM11=y -CONFIG_STM32F7_TIM3=y -CONFIG_STM32F7_TIM9=y -CONFIG_STM32F7_UART4=y -CONFIG_STM32F7_UART7=y -CONFIG_STM32F7_UART8=y -CONFIG_STM32F7_USART2=y -CONFIG_STM32F7_USART3=y -CONFIG_STM32F7_USART6=y -CONFIG_STM32F7_USART_BREAKS=y -CONFIG_STM32F7_USART_INVERT=y -CONFIG_STM32F7_USART_SINGLEWIRE=y -CONFIG_STM32F7_USART_SWAP=y -CONFIG_STM32F7_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_RXDMA=y -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_SERIAL_CONSOLE=y -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=3000 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/mro/ctrl-zero-f7-oem/nuttx-config/scripts/script.ld b/boards/mro/ctrl-zero-f7-oem/nuttx-config/scripts/script.ld deleted file mode 100644 index 47b29d3..0000000 --- a/boards/mro/ctrl-zero-f7-oem/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,181 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2019-2020 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F765IIT6 has 2048 KiB of main FLASH memory. This FLASH memory - * can be accessed from either the AXIM interface at address 0x0800:0000 or - * from the ITCM interface at address 0x0020:0000. - * - * Additional information, including the option bytes, is available at at - * FLASH at address 0x1ff0:0000 (AXIM) or 0x0010:0000 (ITCM). - * - * In the STM32F765IIT6, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash on ITCM at 0x0020:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x0010:0000 - * - * NuttX does not modify these option byes. On the unmodified NUCLEO-144 - * board, the BOOT0 pin is at ground so by default, the STM32F765IIT6 will - * boot from address 0x0020:0000 in ITCM FLASH. - * - * The STM32F765IIT6 also has 512 KiB of data SRAM (in addition to ITCM SRAM). - * SRAM is split up into three blocks: - * - * 1) 128 KiB of DTCM SRM beginning at address 0x2000:0000 - * 2) 368 KiB of SRAM1 beginning at address 0x2002:0000 - * 3) 16 KiB of SRAM2 beginning at address 0x2007:c000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * Bootloader reserves three 32K banks (2 Mbytes Flash memory single bank) - * organization (256 bits read width) - */ - -MEMORY -{ - FLASH_ITCM (rx) : ORIGIN = 0x00218000, LENGTH = 1952K - FLASH_AXIM (rx) : ORIGIN = 0x08018000, LENGTH = 1952K /* start on 4th sector (1st sector for bootloader, 2 for extra storage) */ - - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 16K - DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - SRAM1 (rwx) : ORIGIN = 0x20020000, LENGTH = 368K - SRAM2 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH_AXIM - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH_AXIM - - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH_AXIM - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH_AXIM - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > SRAM1 AT > FLASH_AXIM - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > SRAM1 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } - - .ramfunc : { - _sramfuncs = .; - *(.ramfunc .ramfunc.*) - . = ALIGN(4); - _eramfuncs = .; - } > ITCM_RAM AT > FLASH_AXIM - - _framfuncs = LOADADDR(.ramfunc); -} diff --git a/boards/mro/ctrl-zero-f7-oem/src/CMakeLists.txt b/boards/mro/ctrl-zero-f7-oem/src/CMakeLists.txt deleted file mode 100644 index faaf0f3..0000000 --- a/boards/mro/ctrl-zero-f7-oem/src/CMakeLists.txt +++ /dev/null @@ -1,52 +0,0 @@ -############################################################################ -# -# Copyright (c) 2019 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. -# -############################################################################ - -add_library(drivers_board - init.c - i2c.cpp - led.c - sdio.c - spi.cpp - timer_config.cpp - usb.c -) - -target_link_libraries(drivers_board - PRIVATE - arch_io_pins - arch_spi - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer -) diff --git a/boards/mro/ctrl-zero-f7-oem/src/board_config.h b/boards/mro/ctrl-zero-f7-oem/src/board_config.h deleted file mode 100644 index 5f00959..0000000 --- a/boards/mro/ctrl-zero-f7-oem/src/board_config.h +++ /dev/null @@ -1,237 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019-2020 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * mro_ctrl-zero-f7 internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ - -/* GPIOs ***********************************************************************************/ - -/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */ - -#define GPIO_nLED_RED /* PB11 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN11) -#define GPIO_nLED_GREEN /* PB1 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN1) -#define GPIO_nLED_BLUE /* PB3 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN3) - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_OVERLOAD_LED LED_RED -#define BOARD_ARMED_STATE_LED LED_BLUE - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that - * can be used by the Px4 Firmware in the adc driver - */ - -/* ADC defines to be used in sensors.cpp to read from a particular channel */ -#define ADC1_CH(n) (n) -#define ADC1_GPIO(n) GPIO_ADC1_IN##n - -/* Define GPIO pins used as ADC N.B. Channel numbers must match below */ -#define PX4_ADC_GPIO \ - /* PA2 */ ADC1_GPIO(2), \ - /* PA3 */ ADC1_GPIO(3), \ - /* PA4 */ ADC1_GPIO(4), \ - /* PC1 */ ADC1_GPIO(11) - -/* Define Channel numbers must match above GPIO pin IN(n)*/ -#define ADC_BATTERY_VOLTAGE_CHANNEL /* PA2 */ ADC1_CH(2) -#define ADC_BATTERY_CURRENT_CHANNEL /* PA3 */ ADC1_CH(3) -#define ADC_SCALED_V5_CHANNEL /* PA4 */ ADC1_CH(4) -#define ADC_RC_RSSI_CHANNEL /* PC1 */ ADC1_CH(11) - -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY_CURRENT_CHANNEL) | \ - (1 << ADC_SCALED_V5_CHANNEL) | \ - (1 << ADC_RC_RSSI_CHANNEL)) - -/* HW has to large of R termination on ADC todo:change when HW value is chosen */ -#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f) - -/* CAN Silence: Silent mode control \ ESC Mux select */ -#define GPIO_CAN1_SILENT_S0 /* PF5 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTF|GPIO_PIN5) -#define GPIO_CAN2_SILENT_S0 /* PF5 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTF|GPIO_PIN5) - -/* PWM */ -#define DIRECT_PWM_OUTPUT_CHANNELS 8 - -/* Power supply control and monitoring GPIOs */ -#define GPIO_nPOWER_IN_A /* PB5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5) - -#define GPIO_VDD_BRICK1_VALID GPIO_nPOWER_IN_A /* Brick 1 Is Chosen */ -#define BOARD_NUMBER_BRICKS 1 - -#define GPIO_VDD_3V3_SPEKTRUM_POWER_EN /* PE4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN4) - -/* Define True logic Power Control in arch agnostic form */ -#define VDD_3V3_SPEKTRUM_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SPEKTRUM_POWER_EN, (!on_true)) -#define READ_VDD_3V3_SPEKTRUM_POWER_EN() (px4_arch_gpioread(GPIO_VDD_3V3_SPEKTRUM_POWER_EN) == 0) - -/* Tone alarm output */ -#define TONE_ALARM_TIMER 2 /* timer 2 */ -#define TONE_ALARM_CHANNEL 1 /* PA15 TIM2_CH1 */ - -#define GPIO_BUZZER_1 /* PA15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) - -#define GPIO_TONE_ALARM_IDLE GPIO_BUZZER_1 -#define GPIO_TONE_ALARM GPIO_TIM2_CH1OUT_2 - -/* USB OTG FS */ -#define GPIO_OTGFS_VBUS /* PA9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 3 /* use timer3 for the HRT */ -#define HRT_TIMER_CHANNEL 2 /* use capture/compare channel 2 */ - -#define HRT_PPM_CHANNEL /* T3C3 */ 3 /* use capture/compare channel 3 */ -#define GPIO_PPM_IN /* PB0 T3C3 */ GPIO_TIM3_CH3IN_1 - -/* RC Serial port */ -#define RC_SERIAL_PORT "/dev/ttyS3" - -#define GPIO_RSSI_IN /* PC1 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN1) - -/* Safety Switch: Enable the FMU to control it if there is no px4io fixme:This should be BOARD_SAFETY_LED(__ontrue) */ -#define GPIO_SAFETY_SWITCH_IN /* PC4 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN4) -/* Enable the FMU to use the switch it if there is no px4io fixme:This should be BOARD_SAFTY_BUTTON() */ -#define GPIO_BTN_SAFETY GPIO_SAFETY_SWITCH_IN /* Enable the FMU to control it if there is no px4io */ - -/* Power switch controls ******************************************************/ -#define SPEKTRUM_POWER(_on_true) VDD_3V3_SPEKTRUM_POWER_EN(_on_true) - -/* - * Board has a separate RC_IN - * - * GPIO PPM_IN on PB0 T3CH3 - * SPEKTRUM_RX (it's TX or RX in Bind) on UART6 PC7 - * Inversion is possible in the UART and can drive GPIO_PPM_IN as an output - */ -#define GPIO_PPM_IN_AS_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN0) -#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_PPM_IN_AS_OUT) -#define SPEKTRUM_RX_AS_UART() /* Can be left as uart */ -#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true)) - -#define SDIO_SLOTNO 0 /* Only one slot */ -#define SDIO_MINOR 0 - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_USB_VALID BOARD_ADC_USB_CONNECTED -#define BOARD_ADC_SERVO_VALID (1) /* never powers off the Servo rail */ -#define BOARD_ADC_BRICK_VALID (px4_arch_gpioread(GPIO_VDD_BRICK1_VALID)) - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ -#define BOARD_HAS_ON_RESET 1 - -#define PX4_GPIO_INIT_LIST { \ - PX4_ADC_GPIO, \ - GPIO_CAN1_TX, \ - GPIO_CAN1_RX, \ - GPIO_CAN2_TX, \ - GPIO_CAN2_RX, \ - GPIO_CAN1_SILENT_S0, \ - GPIO_CAN2_SILENT_S0, \ - GPIO_nPOWER_IN_A, \ - GPIO_VDD_3V3_SPEKTRUM_POWER_EN, \ - GPIO_TONE_ALARM_IDLE, \ - GPIO_SAFETY_SWITCH_IN, \ - } - -#define BOARD_ENABLE_CONSOLE_BUFFER - -#define BOARD_NUM_IO_TIMERS 3 - -__BEGIN_DECLS - -#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 - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/mro/ctrl-zero-f7-oem/src/i2c.cpp b/boards/mro/ctrl-zero-f7-oem/src/i2c.cpp deleted file mode 100644 index 1b8927c..0000000 --- a/boards/mro/ctrl-zero-f7-oem/src/i2c.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), - initI2CBusExternal(3), - initI2CBusExternal(4), -}; diff --git a/boards/mro/ctrl-zero-f7-oem/src/init.c b/boards/mro/ctrl-zero-f7-oem/src/init.c deleted file mode 100644 index 0b0b07f..0000000 --- a/boards/mro/ctrl-zero-f7-oem/src/init.c +++ /dev/null @@ -1,238 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019-2020 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * Board-specific early startup code. This file implements the - * board_app_initializ() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include "board_config.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* Configuration ************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - bool last = READ_VDD_3V3_SPEKTRUM_POWER_EN(); - /* Keep Spektum on to discharge rail*/ - VDD_3V3_SPEKTRUM_POWER_EN(false); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ - VDD_3V3_SPEKTRUM_POWER_EN(last); -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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 - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initialization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Power on Interfaces */ - board_control_spi_sensors_power(true, 0xffff); - VDD_3V3_SPEKTRUM_POWER_EN(true); - - px4_platform_init(); - - stm32_spiinitialize(); - - /* configure the DMA allocator */ - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_on(LED_GREEN); // Indicate Power. - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - -#ifdef CONFIG_MMCSD - int ret = stm32_sdio_initialize(); - - if (ret != OK) { - led_on(LED_RED); - } - -#endif /* CONFIG_MMCSD */ - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/mro/ctrl-zero-f7-oem/src/led.c b/boards/mro/ctrl-zero-f7-oem/src/led.c deleted file mode 100644 index e88d37c..0000000 --- a/boards/mro/ctrl-zero-f7-oem/src/led.c +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -static uint32_t g_ledmap[] = { - GPIO_nLED_BLUE, // Indexed by LED_BLUE - GPIO_nLED_RED, // Indexed by LED_RED - GPIO_nLED_GREEN, // Indexed by LED_GREEN -}; - -__EXPORT void led_init(void) -{ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - stm32_configgpio(g_ledmap[l]); - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - stm32_gpiowrite(g_ledmap[led], !state); -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - return !stm32_gpioread(g_ledmap[led]); -} - -__EXPORT void led_on(int led) -{ - phy_set_led(led, true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(led, false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(led, !phy_get_led(led)); -} diff --git a/boards/mro/ctrl-zero-f7-oem/src/sdio.c b/boards/mro/ctrl-zero-f7-oem/src/sdio.c deleted file mode 100644 index bb56cc8..0000000 --- a/boards/mro/ctrl-zero-f7-oem/src/sdio.c +++ /dev/null @@ -1,171 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include "chip.h" -#include "board_config.h" -#include "stm32_gpio.h" -#include "stm32_sdmmc.h" - -#ifdef CONFIG_MMCSD - - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Card detections requires card support and a card detection GPIO */ - -#define HAVE_NCD 1 -#if !defined(GPIO_SDMMC1_NCD) -# undef HAVE_NCD -#endif - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -static FAR struct sdio_dev_s *sdio_dev; -#ifdef HAVE_NCD -static bool g_sd_inserted = 0xff; /* Impossible value */ -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_ncd_interrupt - * - * Description: - * Card detect interrupt handler. - * - ****************************************************************************/ - -#ifdef HAVE_NCD -static int stm32_ncd_interrupt(int irq, FAR void *context) -{ - bool present = !stm32_gpioread(GPIO_SDMMC1_NCD); - - if (sdio_dev && present != g_sd_inserted) { - sdio_mediachange(sdio_dev, present); - g_sd_inserted = present; - } - - return OK; -} -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_sdio_initialize - * - * Description: - * Initialize SDIO-based MMC/SD card support - * - ****************************************************************************/ - -int stm32_sdio_initialize(void) -{ - int ret; - -#ifdef HAVE_NCD - /* Card detect */ - bool cd_status; - - /* Configure the card detect GPIO */ - stm32_configgpio(GPIO_SDMMC1_NCD); - - /* Register an interrupt handler for the card detect pin */ - stm32_gpiosetevent(GPIO_SDMMC1_NCD, true, true, true, stm32_ncd_interrupt); -#endif - - /* Mount the SDIO-based MMC/SD block driver */ - /* First, get an instance of the SDIO interface */ - finfo("Initializing SDIO slot %d\n", SDIO_SLOTNO); - - sdio_dev = sdio_initialize(SDIO_SLOTNO); - - if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", SDIO_SLOTNO); - return -ENODEV; - } - - /* Now bind the SDIO interface to the MMC/SD driver */ - - finfo("Bind SDIO to the MMC/SD driver, minor=%d\n", SDIO_MINOR); - - ret = mmcsd_slotinitialize(SDIO_MINOR, sdio_dev); - - if (ret != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); - return ret; - } - - finfo("Successfully bound SDIO to the MMC/SD driver\n"); - -#ifdef HAVE_NCD - /* Use SD card detect pin to check if a card is g_sd_inserted */ - - cd_status = !stm32_gpioread(GPIO_SDMMC1_NCD); - finfo("Card detect : %d\n", cd_status); - - sdio_mediachange(sdio_dev, cd_status); -#else - /* Assume that the SD card is inserted. What choice do we have? */ - - sdio_mediachange(sdio_dev, true); -#endif - - return OK; -} - -#endif /* CONFIG_MMCSD */ diff --git a/boards/mro/ctrl-zero-f7-oem/src/spi.cpp b/boards/mro/ctrl-zero-f7-oem/src/spi.cpp deleted file mode 100644 index c64c0d5..0000000 --- a/boards/mro/ctrl-zero-f7-oem/src/spi.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20948, SPI::CS{GPIO::PortE, GPIO::Pin15}, SPI::DRDY{GPIO::PortE, GPIO::Pin12}), - }, {GPIO::PortE, GPIO::Pin3}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10}), - initSPIDevice(DRV_BARO_DEVTYPE_DPS310, SPI::CS{GPIO::PortD, GPIO::Pin7}), - }), - initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(DRV_GYR_DEVTYPE_BMI088, SPI::CS{GPIO::PortF, GPIO::Pin10}, SPI::DRDY{GPIO::PortF, GPIO::Pin3}), - initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::PortF, GPIO::Pin6}, SPI::DRDY{GPIO::PortF, GPIO::Pin1}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/mro/ctrl-zero-f7-oem/src/timer_config.cpp b/boards/mro/ctrl-zero-f7-oem/src/timer_config.cpp deleted file mode 100644 index 52109c4..0000000 --- a/boards/mro/ctrl-zero-f7-oem/src/timer_config.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2019 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1), - initIOTimer(Timer::Timer4), - initIOTimer(Timer::Timer8), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortE, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer8, Timer::Channel1}, {GPIO::PortI, GPIO::Pin5}), - initIOTimerChannel(io_timers, {Timer::Timer8, Timer::Channel2}, {GPIO::PortI, GPIO::Pin6}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/mro/ctrl-zero-f7-oem/src/usb.c b/boards/mro/ctrl-zero-f7-oem/src/usb.c deleted file mode 100644 index 4ac9829..0000000 --- a/boards/mro/ctrl-zero-f7-oem/src/usb.c +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2019 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#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 - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/mro/ctrl-zero-f7/default.px4board b/boards/mro/ctrl-zero-f7/default.px4board deleted file mode 100644 index 074a4f2..0000000 --- a/boards/mro/ctrl-zero-f7/default.px4board +++ /dev/null @@ -1,100 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS2" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS0" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS1" -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_BAROMETER_DPS310=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_BOSCH_BMI088=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SAFETY_BUTTON=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_BOARD_UAVCAN_INTERFACES=1 -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UUV_ATT_CONTROL=y -CONFIG_MODULES_UUV_POS_CONTROL=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BL_UPDATE=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SERIAL_TEST=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_FAKE_GPS=y diff --git a/boards/mro/ctrl-zero-f7/firmware.prototype b/boards/mro/ctrl-zero-f7/firmware.prototype deleted file mode 100644 index c3f1229..0000000 --- a/boards/mro/ctrl-zero-f7/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 141, - "magic": "mRo-ctrl-zero-f7", - "description": "Firmware for the mRo-ctrl-zero-f7 board", - "image": "", - "build_time": 0, - "summary": "mRo-ctrl-zero-f7", - "version": "0.1", - "image_size": 0, - "image_maxsize": 2064384, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/mro/ctrl-zero-f7/init/rc.board_defaults b/boards/mro/ctrl-zero-f7/init/rc.board_defaults deleted file mode 100644 index 32117f4..0000000 --- a/boards/mro/ctrl-zero-f7/init/rc.board_defaults +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 10.1 -param set-default BAT1_A_PER_V 17 - -safety_button start diff --git a/boards/mro/ctrl-zero-f7/init/rc.board_sensors b/boards/mro/ctrl-zero-f7/init/rc.board_sensors deleted file mode 100644 index 88205f4..0000000 --- a/boards/mro/ctrl-zero-f7/init/rc.board_sensors +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# -# mRo Control Zero specific board sensors init -#------------------------------------------------------------------------------ - -board_adc start - -# Internal ICM-20602 -icm20602 -s -b 1 -R 8 start - -# Internal SPI bus BMI088 accel & gyro -bmi088 -A -s -b 5 -R 8 start -bmi088 -G -s -b 5 -R 8 start - -# Internal ICM-20948 (with magnetometer) -icm20948 -s -b 1 -R 8 -M start - -# Interal DPS310 (barometer) -dps310 -s -b 2 start diff --git a/boards/mro/ctrl-zero-f7/nuttx-config/include/board.h b/boards/mro/ctrl-zero-f7/nuttx-config/include/board.h deleted file mode 100644 index 47ba227..0000000 --- a/boards/mro/ctrl-zero-f7/nuttx-config/include/board.h +++ /dev/null @@ -1,292 +0,0 @@ -/************************************************************************************ - * board.h - * - * Copyright (C) 2016-2018 Gregory Nutt. All rights reserved. - * Authors: David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ - -#pragma once - -/************************************************************************************ - * Included Files - ************************************************************************************/ -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The mRo Control Zero F7 board provides the following clock sources: - * - * 24 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 16 MHz RC factory-trimmed - * HSE: 24 MHz crystal for HSE - */ -#define STM32_BOARD_XTAL 24000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 0 - -/* Main PLL Configuration. - * - * PLL source is HSE = 24,000,000 - * - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 2 <= PLLM <= 63 - * 192 <= PLLN <= 432 - * 192 MHz <= PLL_VCO <= 432MHz - * - * SYSCLK = PLL_VCO / PLLP - * Subject to - * - * PLLP = {2, 4, 6, 8} - * SYSCLK <= 216 MHz - * - * SDMMC and RNG Clock = PLL_VCO / PLLQ - * Subject to - * The SDMMC and the random number generator need a frequency lower than or equal - * to 48 MHz to work correctly. - * - * 2 <= PLLQ <= 15 - */ - -/* SDMMCCLK (= USB OTG FS clock = RNGCLK) should be <= 48MHz - * - * PLL_VCO = (16,000,000 / 24) * 432 = 432 MHz - * SYSCLK = 432 MHz / 2 = 216 MHz - * SDMMC and RNG Clock = 432 MHz / 9 = 48 MHz - */ -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(24) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(432) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(9) - -#define STM32_VCO_FREQUENCY ((STM32_HSE_FREQUENCY / 24) * 432) -#define STM32_SYSCLK_FREQUENCY (STM32_VCO_FREQUENCY / 2) -#define STM32_OTGFS_FREQUENCY (STM32_VCO_FREQUENCY / 9) - -/* Configure factors for PLLSAI clock */ -#define CONFIG_STM32F7_PLLSAI 1 -#define STM32_RCC_PLLSAICFGR_PLLSAIN RCC_PLLSAICFGR_PLLSAIN(192) -#define STM32_RCC_PLLSAICFGR_PLLSAIP RCC_PLLSAICFGR_PLLSAIP(8) -#define STM32_RCC_PLLSAICFGR_PLLSAIQ RCC_PLLSAICFGR_PLLSAIQ(4) -#define STM32_RCC_PLLSAICFGR_PLLSAIR RCC_PLLSAICFGR_PLLSAIR(2) - -/* Configure Dedicated Clock Configuration Register */ -#define STM32_RCC_DCKCFGR1_PLLI2SDIVQ RCC_DCKCFGR1_PLLI2SDIVQ(1) -#define STM32_RCC_DCKCFGR1_PLLSAIDIVQ RCC_DCKCFGR1_PLLSAIDIVQ(1) -#define STM32_RCC_DCKCFGR1_PLLSAIDIVR RCC_DCKCFGR1_PLLSAIDIVR(0) -#define STM32_RCC_DCKCFGR1_SAI1SRC RCC_DCKCFGR1_SAI1SEL(0) -#define STM32_RCC_DCKCFGR1_SAI2SRC RCC_DCKCFGR1_SAI2SEL(0) -#define STM32_RCC_DCKCFGR1_TIMPRESRC 0 -#define STM32_RCC_DCKCFGR1_DFSDM1SRC 0 -#define STM32_RCC_DCKCFGR1_ADFSDM1SRC 0 - -/* Configure factors for PLLI2S clock */ -#define CONFIG_STM32F7_PLLI2S 1 -#define STM32_RCC_PLLI2SCFGR_PLLI2SN RCC_PLLI2SCFGR_PLLI2SN(192) -#define STM32_RCC_PLLI2SCFGR_PLLI2SP RCC_PLLI2SCFGR_PLLI2SP(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SQ RCC_PLLI2SCFGR_PLLI2SQ(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SR RCC_PLLI2SCFGR_PLLI2SR(2) - -/* Configure Dedicated Clock Configuration Register 2 */ -#define STM32_RCC_DCKCFGR2_USART1SRC RCC_DCKCFGR2_USART1SEL_APB -#define STM32_RCC_DCKCFGR2_USART2SRC RCC_DCKCFGR2_USART2SEL_APB -#define STM32_RCC_DCKCFGR2_UART4SRC RCC_DCKCFGR2_UART4SEL_APB -#define STM32_RCC_DCKCFGR2_UART5SRC RCC_DCKCFGR2_UART5SEL_APB -#define STM32_RCC_DCKCFGR2_USART6SRC RCC_DCKCFGR2_USART6SEL_APB -#define STM32_RCC_DCKCFGR2_UART7SRC RCC_DCKCFGR2_UART7SEL_APB -#define STM32_RCC_DCKCFGR2_UART8SRC RCC_DCKCFGR2_UART8SEL_APB -#define STM32_RCC_DCKCFGR2_I2C1SRC RCC_DCKCFGR2_I2C1SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C2SRC RCC_DCKCFGR2_I2C2SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C3SRC RCC_DCKCFGR2_I2C3SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C4SRC RCC_DCKCFGR2_I2C4SEL_HSI -#define STM32_RCC_DCKCFGR2_LPTIM1SRC RCC_DCKCFGR2_LPTIM1SEL_APB -#define STM32_RCC_DCKCFGR2_CECSRC RCC_DCKCFGR2_CECSEL_HSI -#define STM32_RCC_DCKCFGR2_CK48MSRC RCC_DCKCFGR2_CK48MSEL_PLL -#define STM32_RCC_DCKCFGR2_SDMMCSRC RCC_DCKCFGR2_SDMMCSEL_48MHZ -#define STM32_RCC_DCKCFGR2_SDMMC2SRC RCC_DCKCFGR2_SDMMC2SEL_48MHZ -#define STM32_RCC_DCKCFGR2_DSISRC RCC_DCKCFGR2_DSISEL_PHY - - -/* Several prescalers allow the configuration of the two AHB buses, the - * high-speed APB (APB2) and the low-speed APB (APB1) domains. The maximum - * frequency of the two AHB buses is 216 MHz while the maximum frequency of - * the high-speed APB domains is 108 MHz. The maximum allowed frequency of - * the low-speed APB domain is 54 MHz. - */ - -/* AHB clock (HCLK) is SYSCLK (216 MHz) */ -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (54 MHz) */ -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (108MHz) */ -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* SDMMC dividers. Note that slower clocking is required when DMA is disabled - * in order to avoid RX overrun/TX underrun errors due to delayed responses - * to service FIFOs in interrupt driven mode. These values have not been - * tuned!!! - * - * SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(118+2)=400 KHz - */ - -/* Use the Falling edge of the SDIO_CLK clock to change the edge the - * data and commands are change on - */ -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - -#define STM32_SDMMC_INIT_CLKDIV (118 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* DMA ON: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(1+2)=16 MHz - * DMA OFF: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32F7_SDMMC_DMA -# define STM32_SDMMC_MMCXFR_CLKDIV (1 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (2 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -/* DMA ON: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(1+2)=16 MHz - * DMA OFF: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(2+2)=12 MHz - */ -#ifdef CONFIG_STM32F7_SDMMC_DMA -# define STM32_SDMMC_SDXFR_CLKDIV (1 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (2 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -/* FLASH wait states - * - * --------- ---------- ----------- - * VDD MAX SYSCLK WAIT STATES - * --------- ---------- ----------- - * 1.7-2.1 V 180 MHz 8 - * 2.1-2.4 V 216 MHz 9 - * 2.4-2.7 V 216 MHz 8 - * 2.7-3.6 V 216 MHz 7 - * --------- ---------- ----------- - */ - -#define BOARD_FLASH_WAITSTATES 7 - - -/* UART/USART */ -#define GPIO_USART2_RX GPIO_USART2_RX_2 /* PD6 */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 /* PD4 */ -#define GPIO_USART2_CTS GPIO_USART2_CTS_2 /* PD3 */ - -#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ -#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ -#define GPIO_USART3_RTS GPIO_USART3_RTS_2 /* PD12 */ -#define GPIO_USART3_CTS GPIO_USART3_CTS_2 /* PD11 */ - -#define GPIO_UART4_RX GPIO_UART4_RX_1 /* PA1 */ -#define GPIO_UART4_TX GPIO_UART4_TX_1 /* PA0 */ - -#define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC7 */ -#define GPIO_USART6_TX GPIO_USART6_TX_2 /* PG14 */ - -#define GPIO_UART7_RX GPIO_UART7_RX_1 /* PE7 */ -#define GPIO_UART7_TX GPIO_UART7_TX_1 /* PE8 */ - -/* USART8: has no remap - * - * GPIO_UART8_RX PE0 - * GPIO_UART8_TX PE1 - */ - - -/* CAN */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 /* PD0 */ -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 /* PD1 */ - - -/* SPI */ -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 /* PA5 */ -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 /* PA7 */ - -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_2 /* PB10 */ -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 /* PB14 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 /* PB15 */ - -#define GPIO_SPI5_SCK GPIO_SPI5_SCK_1 /* PF7 */ -#define GPIO_SPI5_MISO GPIO_SPI5_MISO_1 /* PF8 */ -#define GPIO_SPI5_MOSI GPIO_SPI5_MOSI_1 /* PF9 */ - - -/* I2C */ -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 /* PB8 */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 /* PB9 */ diff --git a/boards/mro/ctrl-zero-f7/nuttx-config/include/board_dma_map.h b/boards/mro/ctrl-zero-f7/nuttx-config/include/board_dma_map.h deleted file mode 100644 index c3df4fe..0000000 --- a/boards/mro/ctrl-zero-f7/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/* -| DMA1 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | SPI3_RX_1 | SPDIFRX_DT | SPI3_RX_2 | SPI2_RX | SPI2_TX | SPI3_TX_1 | SPDIFRX_CS | SPI3_TX_2 | -| Channel 1 | I2C1_RX | I2C3_RX | TIM7_UP_1 | - | TIM7_UP_2 | I2C1_RX_1 | I2C1_TX | I2C1_TX_1 | -| Channel 2 | TIM4_CH1 | - | I2C4_RX | TIM4_CH2 | - | I2C4_RX | TIM4_UP | TIM4_CH3 | -| Channel 3 | - | TIM2_UP_1 | I2C3_RX_1 | - | I2C3_TX | TIM2_CH1 | TIM2_CH2 | TIM2_UP_2 | -| | | TIM2_CH3 | | | | | TIM2_CH4_1 | TIM2_CH4_2 | -| Channel 4 | UART5_RX | USART3_RX | UART4_RX | USART3_TX_1 | UART4_TX | USART2_RX | USART2_TX | UART5_TX | -| Channel 5 | UART8_TX | UART7_TX | TIM3_CH4 | UART7_RX | TIM3_CH1 | TIM3_CH2 | UART8_RX | TIM3_CH3 | -| | | | TIM3_UP | | TIM3_TRIG | | | | -| Channel 6 | TIM5_CH3 | TIM5_CH4_1 | TIM5_CH1 | TIM5_CH4_2 | TIM5_CH2 | - | TIM5_UP_2 | - | -| | TIM5_UP_1 | TIM5_TRIG_1 | | TIM5_TRIG_2 | | | | | -| Channel 7 | - | TIM6_UP | I2C2_RX | I2C2_RX_1 | USART3_TX_2 | DAC1 | DAC2 | I2C2_TX | -| Channel 8 | I2C3_TX | I2C4_RX | - | - | I2C2_TX | - | I2C4_TX | - | -| Channel 9 | - | SPI2_RX | - | - | - | - | SPI2_TX | - | -| | | | | | | | | | -| Usage | | USART3_RX | UART4_RX | USART3_TX_1 | | USART2_RX | | | - - -| DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | ADC1_1 | SAI1_A | TIM8_CH1_1 | SAI1_A_1 | ADC1_2 | SAI1_B_1 | TIM1_CH1_1 | SAI2_B_2 | -| | | | TIM8_CH2_1 | | | | TIM1_CH2_1 | | -| | | | TIM8_CH3_1 | | | | TIM1_CH3_1 | | -| Channel 1 | - | DCMI_1 | ADC2_1 | ADC2_2 | SAI1_B | SPI6_TX | SPI6_RX | DCMI_2 | -| Channel 2 | ADC3_1 | ADC3_2 | - | SPI5_RX_1 | SPI5_TX_1 | CRYP_OUT | CRYP_IN | HASH_IN | -| Channel 3 | SPI1_RX_1 | - | SPI1_RX_2 | SPI1_TX_1 | SAI2_A | SPI1_TX_2 | SAI2_B | QUADSPI | -| Channel 4 | SPI4_RX_1 | SPI4_TX_1 | USART1_RX_1 | SDMMC1_1 | - | USART1_RX_2 | SDMMC1_2 | USART1_TX | -| Channel 5 | - | USART6_RX_1 | USART6_RX_2 | SPI4_RX_2 | SPI4_TX_2 | - | USART6_TX_1 | USART6_TX_2 | -| Channel 6 | TIM1_TRIG_1 | TIM1_CH1_2 | TIM1_CH2_2 | TIM1_CH1 | TIM1_CH4 | TIM1_UP | TIM1_CH3_2 | - | -| | | | | | TIM1_TRIG_2 | | | | -| | | | | | TIM1_COM | | | | -| Channel 7 | - | TIM8_UP | TIM8_CH1_2 | TIM8_CH2_2 | TIM8_CH3_2 | SPI5_RX_2 | SPI5_TX_2 | TIM8_CH4 | -| | | | | | | | | TIM8_TRIG | -| | | | | | | | | TIM8_COM | -| Channel 8 | DSFDM1_FLT0 | DSFDM1_FLT1 | DSFDM1_FLT2 | DSFDM1_FLT3 | DSFDM1_FLT0 | DSFDM1_FLT1 | DSFDM1_FLT2 | DSFDM1_FLT3 | -| Channel 9 | JPEG_IN | JPEG_OUT | SPI4_TX | JPEG_IN | JPEG_OUT | SPI5_RX | - | - | -| Channel 10 | SAI1_B | SAI2_B | SAI2_A | - | - | - | SAI1_A | - | -| Channel 11 | SDMMC2 | - | QUADSPI | - | - | SDMMC2 | - | - | -| | | | | | | | | | -| Usage | SPI1_RX_1 | USART6_RX_2 | | SPI1_TX_1 | SPI5_TX_1 | SPI5_RX_2 | SDMMC1_2 | | - */ - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// DMAMAP_USART3_RX // DMA1, Stream 1, Channel 4 -// DMAMAP_UART4_RX // DMA1, Stream 2, Channel 4 -#define DMAMAP_USART3_TX DMAMAP_USART3_TX_1 // DMA1, Stream 3, Channel 4 -// AVAILABLE // DMA2, Stream 4 -// DMAMAP_USART2_RX // DMA1, Stream 5, Channel 4 - - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMAMAP_SPI1_RX DMAMAP_SPI1_RX_1 // DMA2, Stream 0, Channel 3 (SPI1 sensors RX) -#define DMAMAP_USART6_RX DMAMAP_USART6_RX_1 // DMA2, Stream 1, Channel 5 -// AVAILABLE // DMA2, Stream 2 -#define DMAMAP_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 3, Channel 3 (SPI1 sensors TX) -#define DMAMAP_SPI5_TX DMAMAP_SPI5_TX_1 // DMA2, Stream 4, Channel 3 (SPI5 sensors TX) -#define DMAMAP_SPI5_RX DMAMAP_SPI5_RX_2 // DMA2, Stream 5, Channel 3 (SPI5 sensors RX) -#define DMAMAP_SDMMC1 DMAMAP_SDMMC1_2 // DMA2, Stream 6, Channel 4 -// AVAILABLE // DMA2, Stream 7, Channel 5 diff --git a/boards/mro/ctrl-zero-f7/nuttx-config/nsh/defconfig b/boards/mro/ctrl-zero-f7/nuttx-config/nsh/defconfig deleted file mode 100644 index 8ec771c..0000000 --- a/boards/mro/ctrl-zero-f7/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,258 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_FS_PROCFS_EXCLUDE_ENVIRON is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/mro/ctrl-zero-f7/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32f7" -CONFIG_ARCH_CHIP_STM32F777II=y -CONFIG_ARCH_CHIP_STM32F7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x008D -CONFIG_CDCACM_PRODUCTSTR="mRoControlZeroF7" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="mRo" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=3 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_MODE=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32F7_ADC1=y -CONFIG_STM32F7_BBSRAM=y -CONFIG_STM32F7_BBSRAM_FILES=5 -CONFIG_STM32F7_BKPSRAM=y -CONFIG_STM32F7_DMA1=y -CONFIG_STM32F7_DMA2=y -CONFIG_STM32F7_DMACAPABLE=y -CONFIG_STM32F7_FLOWCONTROL_BROKEN=y -CONFIG_STM32F7_I2C1=y -CONFIG_STM32F7_I2C_DYNTIMEO=y -CONFIG_STM32F7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32F7_OTGFS=y -CONFIG_STM32F7_PROGMEM=y -CONFIG_STM32F7_PWR=y -CONFIG_STM32F7_RTC=y -CONFIG_STM32F7_RTC_HSECLOCK=y -CONFIG_STM32F7_RTC_MAGIC_REG=1 -CONFIG_STM32F7_SAVE_CRASHDUMP=y -CONFIG_STM32F7_SDMMC1=y -CONFIG_STM32F7_SDMMC_DMA=y -CONFIG_STM32F7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32F7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32F7_SPI1=y -CONFIG_STM32F7_SPI1_DMA=y -CONFIG_STM32F7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI2=y -CONFIG_STM32F7_SPI5=y -CONFIG_STM32F7_SPI5_DMA=y -CONFIG_STM32F7_SPI5_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI_DMATHRESHOLD=8 -CONFIG_STM32F7_TIM10=y -CONFIG_STM32F7_TIM11=y -CONFIG_STM32F7_TIM3=y -CONFIG_STM32F7_TIM9=y -CONFIG_STM32F7_UART4=y -CONFIG_STM32F7_UART7=y -CONFIG_STM32F7_UART8=y -CONFIG_STM32F7_USART2=y -CONFIG_STM32F7_USART3=y -CONFIG_STM32F7_USART6=y -CONFIG_STM32F7_USART_BREAKS=y -CONFIG_STM32F7_USART_INVERT=y -CONFIG_STM32F7_USART_SINGLEWIRE=y -CONFIG_STM32F7_USART_SWAP=y -CONFIG_STM32F7_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_RXDMA=y -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=3000 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/mro/ctrl-zero-f7/nuttx-config/scripts/script.ld b/boards/mro/ctrl-zero-f7/nuttx-config/scripts/script.ld deleted file mode 100644 index 47b29d3..0000000 --- a/boards/mro/ctrl-zero-f7/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,181 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2019-2020 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F765IIT6 has 2048 KiB of main FLASH memory. This FLASH memory - * can be accessed from either the AXIM interface at address 0x0800:0000 or - * from the ITCM interface at address 0x0020:0000. - * - * Additional information, including the option bytes, is available at at - * FLASH at address 0x1ff0:0000 (AXIM) or 0x0010:0000 (ITCM). - * - * In the STM32F765IIT6, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash on ITCM at 0x0020:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x0010:0000 - * - * NuttX does not modify these option byes. On the unmodified NUCLEO-144 - * board, the BOOT0 pin is at ground so by default, the STM32F765IIT6 will - * boot from address 0x0020:0000 in ITCM FLASH. - * - * The STM32F765IIT6 also has 512 KiB of data SRAM (in addition to ITCM SRAM). - * SRAM is split up into three blocks: - * - * 1) 128 KiB of DTCM SRM beginning at address 0x2000:0000 - * 2) 368 KiB of SRAM1 beginning at address 0x2002:0000 - * 3) 16 KiB of SRAM2 beginning at address 0x2007:c000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * Bootloader reserves three 32K banks (2 Mbytes Flash memory single bank) - * organization (256 bits read width) - */ - -MEMORY -{ - FLASH_ITCM (rx) : ORIGIN = 0x00218000, LENGTH = 1952K - FLASH_AXIM (rx) : ORIGIN = 0x08018000, LENGTH = 1952K /* start on 4th sector (1st sector for bootloader, 2 for extra storage) */ - - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 16K - DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - SRAM1 (rwx) : ORIGIN = 0x20020000, LENGTH = 368K - SRAM2 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH_AXIM - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH_AXIM - - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH_AXIM - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH_AXIM - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > SRAM1 AT > FLASH_AXIM - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > SRAM1 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } - - .ramfunc : { - _sramfuncs = .; - *(.ramfunc .ramfunc.*) - . = ALIGN(4); - _eramfuncs = .; - } > ITCM_RAM AT > FLASH_AXIM - - _framfuncs = LOADADDR(.ramfunc); -} diff --git a/boards/mro/ctrl-zero-f7/src/CMakeLists.txt b/boards/mro/ctrl-zero-f7/src/CMakeLists.txt deleted file mode 100644 index faaf0f3..0000000 --- a/boards/mro/ctrl-zero-f7/src/CMakeLists.txt +++ /dev/null @@ -1,52 +0,0 @@ -############################################################################ -# -# Copyright (c) 2019 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. -# -############################################################################ - -add_library(drivers_board - init.c - i2c.cpp - led.c - sdio.c - spi.cpp - timer_config.cpp - usb.c -) - -target_link_libraries(drivers_board - PRIVATE - arch_io_pins - arch_spi - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer -) diff --git a/boards/mro/ctrl-zero-f7/src/board_config.h b/boards/mro/ctrl-zero-f7/src/board_config.h deleted file mode 100644 index 7dc7ce0..0000000 --- a/boards/mro/ctrl-zero-f7/src/board_config.h +++ /dev/null @@ -1,233 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019-2020 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * mro_ctrl-zero-f7 internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ - -/* GPIOs ***********************************************************************************/ - -/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */ - -#define GPIO_nLED_RED /* PB11 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN11) -#define GPIO_nLED_GREEN /* PB1 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN1) -#define GPIO_nLED_BLUE /* PB3 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN3) - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_OVERLOAD_LED LED_RED -#define BOARD_ARMED_STATE_LED LED_BLUE - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that - * can be used by the Px4 Firmware in the adc driver - */ - -/* ADC defines to be used in sensors.cpp to read from a particular channel */ -#define ADC1_CH(n) (n) -#define ADC1_GPIO(n) GPIO_ADC1_IN##n - -/* Define GPIO pins used as ADC N.B. Channel numbers must match below */ -#define PX4_ADC_GPIO \ - /* PA2 */ ADC1_GPIO(2), \ - /* PA3 */ ADC1_GPIO(3), \ - /* PA4 */ ADC1_GPIO(4), \ - /* PC1 */ ADC1_GPIO(11) - -/* Define Channel numbers must match above GPIO pin IN(n)*/ -#define ADC_BATTERY_VOLTAGE_CHANNEL /* PA2 */ ADC1_CH(2) -#define ADC_BATTERY_CURRENT_CHANNEL /* PA3 */ ADC1_CH(3) -#define ADC_SCALED_V5_CHANNEL /* PA4 */ ADC1_CH(4) -#define ADC_RC_RSSI_CHANNEL /* PC1 */ ADC1_CH(11) - -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY_CURRENT_CHANNEL) | \ - (1 << ADC_SCALED_V5_CHANNEL) | \ - (1 << ADC_RC_RSSI_CHANNEL)) - -/* HW has to large of R termination on ADC todo:change when HW value is chosen */ -#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f) - -/* CAN Silence: Silent mode control \ ESC Mux select */ -#define GPIO_CAN1_SILENT_S0 /* PF5 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTF|GPIO_PIN5) - -/* PWM */ -#define DIRECT_PWM_OUTPUT_CHANNELS 8 - -/* Power supply control and monitoring GPIOs */ -#define GPIO_nPOWER_IN_A /* PB5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5) - -#define GPIO_VDD_BRICK1_VALID GPIO_nPOWER_IN_A /* Brick 1 Is Chosen */ -#define BOARD_NUMBER_BRICKS 1 - -#define GPIO_VDD_3V3_SPEKTRUM_POWER_EN /* PE4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN4) - -/* Define True logic Power Control in arch agnostic form */ -#define VDD_3V3_SPEKTRUM_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SPEKTRUM_POWER_EN, (!on_true)) -#define READ_VDD_3V3_SPEKTRUM_POWER_EN() (px4_arch_gpioread(GPIO_VDD_3V3_SPEKTRUM_POWER_EN) == 0) - -/* Tone alarm output */ -#define TONE_ALARM_TIMER 2 /* timer 2 */ -#define TONE_ALARM_CHANNEL 1 /* PA15 TIM2_CH1 */ - -#define GPIO_BUZZER_1 /* PA15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) - -#define GPIO_TONE_ALARM_IDLE GPIO_BUZZER_1 -#define GPIO_TONE_ALARM GPIO_TIM2_CH1OUT_2 - -/* USB OTG FS */ -#define GPIO_OTGFS_VBUS /* PA9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 3 /* use timer3 for the HRT */ -#define HRT_TIMER_CHANNEL 2 /* use capture/compare channel 2 */ - -#define HRT_PPM_CHANNEL /* T3C3 */ 3 /* use capture/compare channel 3 */ -#define GPIO_PPM_IN /* PB0 T3C3 */ GPIO_TIM3_CH3IN_1 - -/* RC Serial port */ -#define RC_SERIAL_PORT "/dev/ttyS3" - -#define GPIO_RSSI_IN /* PC1 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN1) - -/* Safety Switch: Enable the FMU to control it if there is no px4io fixme:This should be BOARD_SAFETY_LED(__ontrue) */ -#define GPIO_SAFETY_SWITCH_IN /* PC4 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN4) -/* Enable the FMU to use the switch it if there is no px4io fixme:This should be BOARD_SAFTY_BUTTON() */ -#define GPIO_BTN_SAFETY GPIO_SAFETY_SWITCH_IN /* Enable the FMU to control it if there is no px4io */ - -/* Power switch controls ******************************************************/ -#define SPEKTRUM_POWER(_on_true) VDD_3V3_SPEKTRUM_POWER_EN(_on_true) - -/* - * Board has a separate RC_IN - * - * GPIO PPM_IN on PB0 T3CH3 - * SPEKTRUM_RX (it's TX or RX in Bind) on UART6 PC7 - * Inversion is possible in the UART and can drive GPIO_PPM_IN as an output - */ -#define GPIO_PPM_IN_AS_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN0) -#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_PPM_IN_AS_OUT) -#define SPEKTRUM_RX_AS_UART() /* Can be left as uart */ -#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true)) - -#define SDIO_SLOTNO 0 /* Only one slot */ -#define SDIO_MINOR 0 - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_USB_VALID BOARD_ADC_USB_CONNECTED -#define BOARD_ADC_SERVO_VALID (1) /* never powers off the Servo rail */ -#define BOARD_ADC_BRICK_VALID (px4_arch_gpioread(GPIO_VDD_BRICK1_VALID)) - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ -#define BOARD_HAS_ON_RESET 1 - -#define PX4_GPIO_INIT_LIST { \ - PX4_ADC_GPIO, \ - GPIO_CAN1_TX, \ - GPIO_CAN1_RX, \ - GPIO_CAN1_SILENT_S0, \ - GPIO_nPOWER_IN_A, \ - GPIO_VDD_3V3_SPEKTRUM_POWER_EN, \ - GPIO_TONE_ALARM_IDLE, \ - GPIO_SAFETY_SWITCH_IN, \ - } - -#define BOARD_ENABLE_CONSOLE_BUFFER - -#define BOARD_NUM_IO_TIMERS 3 - -__BEGIN_DECLS - -#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 - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/mro/ctrl-zero-f7/src/i2c.cpp b/boards/mro/ctrl-zero-f7/src/i2c.cpp deleted file mode 100644 index e9f26f9..0000000 --- a/boards/mro/ctrl-zero-f7/src/i2c.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), -}; diff --git a/boards/mro/ctrl-zero-f7/src/init.c b/boards/mro/ctrl-zero-f7/src/init.c deleted file mode 100644 index 0b0b07f..0000000 --- a/boards/mro/ctrl-zero-f7/src/init.c +++ /dev/null @@ -1,238 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019-2020 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * Board-specific early startup code. This file implements the - * board_app_initializ() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include "board_config.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* Configuration ************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - bool last = READ_VDD_3V3_SPEKTRUM_POWER_EN(); - /* Keep Spektum on to discharge rail*/ - VDD_3V3_SPEKTRUM_POWER_EN(false); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ - VDD_3V3_SPEKTRUM_POWER_EN(last); -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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 - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initialization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Power on Interfaces */ - board_control_spi_sensors_power(true, 0xffff); - VDD_3V3_SPEKTRUM_POWER_EN(true); - - px4_platform_init(); - - stm32_spiinitialize(); - - /* configure the DMA allocator */ - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_on(LED_GREEN); // Indicate Power. - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - -#ifdef CONFIG_MMCSD - int ret = stm32_sdio_initialize(); - - if (ret != OK) { - led_on(LED_RED); - } - -#endif /* CONFIG_MMCSD */ - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/mro/ctrl-zero-f7/src/led.c b/boards/mro/ctrl-zero-f7/src/led.c deleted file mode 100644 index e88d37c..0000000 --- a/boards/mro/ctrl-zero-f7/src/led.c +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -static uint32_t g_ledmap[] = { - GPIO_nLED_BLUE, // Indexed by LED_BLUE - GPIO_nLED_RED, // Indexed by LED_RED - GPIO_nLED_GREEN, // Indexed by LED_GREEN -}; - -__EXPORT void led_init(void) -{ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - stm32_configgpio(g_ledmap[l]); - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - stm32_gpiowrite(g_ledmap[led], !state); -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - return !stm32_gpioread(g_ledmap[led]); -} - -__EXPORT void led_on(int led) -{ - phy_set_led(led, true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(led, false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(led, !phy_get_led(led)); -} diff --git a/boards/mro/ctrl-zero-f7/src/sdio.c b/boards/mro/ctrl-zero-f7/src/sdio.c deleted file mode 100644 index bb56cc8..0000000 --- a/boards/mro/ctrl-zero-f7/src/sdio.c +++ /dev/null @@ -1,171 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include "chip.h" -#include "board_config.h" -#include "stm32_gpio.h" -#include "stm32_sdmmc.h" - -#ifdef CONFIG_MMCSD - - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Card detections requires card support and a card detection GPIO */ - -#define HAVE_NCD 1 -#if !defined(GPIO_SDMMC1_NCD) -# undef HAVE_NCD -#endif - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -static FAR struct sdio_dev_s *sdio_dev; -#ifdef HAVE_NCD -static bool g_sd_inserted = 0xff; /* Impossible value */ -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_ncd_interrupt - * - * Description: - * Card detect interrupt handler. - * - ****************************************************************************/ - -#ifdef HAVE_NCD -static int stm32_ncd_interrupt(int irq, FAR void *context) -{ - bool present = !stm32_gpioread(GPIO_SDMMC1_NCD); - - if (sdio_dev && present != g_sd_inserted) { - sdio_mediachange(sdio_dev, present); - g_sd_inserted = present; - } - - return OK; -} -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_sdio_initialize - * - * Description: - * Initialize SDIO-based MMC/SD card support - * - ****************************************************************************/ - -int stm32_sdio_initialize(void) -{ - int ret; - -#ifdef HAVE_NCD - /* Card detect */ - bool cd_status; - - /* Configure the card detect GPIO */ - stm32_configgpio(GPIO_SDMMC1_NCD); - - /* Register an interrupt handler for the card detect pin */ - stm32_gpiosetevent(GPIO_SDMMC1_NCD, true, true, true, stm32_ncd_interrupt); -#endif - - /* Mount the SDIO-based MMC/SD block driver */ - /* First, get an instance of the SDIO interface */ - finfo("Initializing SDIO slot %d\n", SDIO_SLOTNO); - - sdio_dev = sdio_initialize(SDIO_SLOTNO); - - if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", SDIO_SLOTNO); - return -ENODEV; - } - - /* Now bind the SDIO interface to the MMC/SD driver */ - - finfo("Bind SDIO to the MMC/SD driver, minor=%d\n", SDIO_MINOR); - - ret = mmcsd_slotinitialize(SDIO_MINOR, sdio_dev); - - if (ret != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); - return ret; - } - - finfo("Successfully bound SDIO to the MMC/SD driver\n"); - -#ifdef HAVE_NCD - /* Use SD card detect pin to check if a card is g_sd_inserted */ - - cd_status = !stm32_gpioread(GPIO_SDMMC1_NCD); - finfo("Card detect : %d\n", cd_status); - - sdio_mediachange(sdio_dev, cd_status); -#else - /* Assume that the SD card is inserted. What choice do we have? */ - - sdio_mediachange(sdio_dev, true); -#endif - - return OK; -} - -#endif /* CONFIG_MMCSD */ diff --git a/boards/mro/ctrl-zero-f7/src/spi.cpp b/boards/mro/ctrl-zero-f7/src/spi.cpp deleted file mode 100644 index c64c0d5..0000000 --- a/boards/mro/ctrl-zero-f7/src/spi.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20948, SPI::CS{GPIO::PortE, GPIO::Pin15}, SPI::DRDY{GPIO::PortE, GPIO::Pin12}), - }, {GPIO::PortE, GPIO::Pin3}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10}), - initSPIDevice(DRV_BARO_DEVTYPE_DPS310, SPI::CS{GPIO::PortD, GPIO::Pin7}), - }), - initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(DRV_GYR_DEVTYPE_BMI088, SPI::CS{GPIO::PortF, GPIO::Pin10}, SPI::DRDY{GPIO::PortF, GPIO::Pin3}), - initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::PortF, GPIO::Pin6}, SPI::DRDY{GPIO::PortF, GPIO::Pin1}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/mro/ctrl-zero-f7/src/timer_config.cpp b/boards/mro/ctrl-zero-f7/src/timer_config.cpp deleted file mode 100644 index 52109c4..0000000 --- a/boards/mro/ctrl-zero-f7/src/timer_config.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2019 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1), - initIOTimer(Timer::Timer4), - initIOTimer(Timer::Timer8), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortE, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer8, Timer::Channel1}, {GPIO::PortI, GPIO::Pin5}), - initIOTimerChannel(io_timers, {Timer::Timer8, Timer::Channel2}, {GPIO::PortI, GPIO::Pin6}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/mro/ctrl-zero-f7/src/usb.c b/boards/mro/ctrl-zero-f7/src/usb.c deleted file mode 100644 index 4ac9829..0000000 --- a/boards/mro/ctrl-zero-f7/src/usb.c +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2019 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#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 - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/mro/ctrl-zero-h7-oem/bootloader.px4board b/boards/mro/ctrl-zero-h7-oem/bootloader.px4board deleted file mode 100644 index 19b6e66..0000000 --- a/boards/mro/ctrl-zero-h7-oem/bootloader.px4board +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_ROMFSROOT="" diff --git a/boards/mro/ctrl-zero-h7-oem/default.px4board b/boards/mro/ctrl-zero-h7-oem/default.px4board deleted file mode 100644 index 549ba99..0000000 --- a/boards/mro/ctrl-zero-h7-oem/default.px4board +++ /dev/null @@ -1,96 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS2" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS0" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL3="/dev/ttyS4" -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_BAROMETER_DPS310=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_BOSCH_BMI088=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UUV_ATT_CONTROL=y -CONFIG_MODULES_UUV_POS_CONTROL=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SERIAL_TEST=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/mro/ctrl-zero-h7-oem/extras/mro_ctrl-zero-h7-oem_bootloader.bin b/boards/mro/ctrl-zero-h7-oem/extras/mro_ctrl-zero-h7-oem_bootloader.bin deleted file mode 100755 index 1a056ae..0000000 Binary files a/boards/mro/ctrl-zero-h7-oem/extras/mro_ctrl-zero-h7-oem_bootloader.bin and /dev/null differ diff --git a/boards/mro/ctrl-zero-h7-oem/firmware.prototype b/boards/mro/ctrl-zero-h7-oem/firmware.prototype deleted file mode 100644 index cb21149..0000000 --- a/boards/mro/ctrl-zero-h7-oem/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 1024, - "magic": "mRo-ctrl-zero-h7-oem", - "description": "Firmware for the mRo-ctrl-zero-h7-oem board", - "image": "", - "build_time": 0, - "summary": "mRo-ctrl-zero-h7-oem", - "version": "0.1", - "image_size": 0, - "image_maxsize": 1966080, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/mro/ctrl-zero-h7-oem/init/rc.board_defaults b/boards/mro/ctrl-zero-h7-oem/init/rc.board_defaults deleted file mode 100644 index 32117f4..0000000 --- a/boards/mro/ctrl-zero-h7-oem/init/rc.board_defaults +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 10.1 -param set-default BAT1_A_PER_V 17 - -safety_button start diff --git a/boards/mro/ctrl-zero-h7-oem/init/rc.board_sensors b/boards/mro/ctrl-zero-h7-oem/init/rc.board_sensors deleted file mode 100644 index 111e3eb..0000000 --- a/boards/mro/ctrl-zero-h7-oem/init/rc.board_sensors +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# -# board specific sensors init -#------------------------------------------------------------------------------ -board_adc start - -# Internal ICM-20602 -icm20602 -s -b 1 -R 8 start - -# Internal SPI bus BMI088 accel & gyro -bmi088 -A -s -b 5 -R 8 start -bmi088 -G -s -b 5 -R 8 start - -# Internal ICM-20948 (with magnetometer) -icm20948 -s -b 1 -R 8 -M start - -# Interal DPS310 (barometer) -dps310 -s -b 2 start diff --git a/boards/mro/ctrl-zero-h7-oem/nuttx-config/bootloader/defconfig b/boards/mro/ctrl-zero-h7-oem/nuttx-config/bootloader/defconfig deleted file mode 100644 index 6d94535..0000000 --- a/boards/mro/ctrl-zero-h7-oem/nuttx-config/bootloader/defconfig +++ /dev/null @@ -1,90 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_CONSOLE is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_SPI_EXCHANGE is not set -# CONFIG_STM32H7_SYSCFG is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/mro/ctrl-zero-h7-oem/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743II=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_INITTHREAD_PRIORITY=254 -CONFIG_BOARD_LATE_INITIALIZE=y -CONFIG_BOARD_LOOPSPERMSEC=95150 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x1024 -CONFIG_CDCACM_PRODUCTSTR="PX4 BL mRo ControlZeroH7 OEM" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="mRo" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_EXPERIMENTAL=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="bootloader_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SPI=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_USART3=y -CONFIG_SYSTEMTICK_HOOK=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGINT_CHAR=0x03 -CONFIG_TTY_SIGTSTP=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/mro/ctrl-zero-h7-oem/nuttx-config/include/board.h b/boards/mro/ctrl-zero-h7-oem/nuttx-config/include/board.h deleted file mode 100644 index 9b1ae63..0000000 --- a/boards/mro/ctrl-zero-h7-oem/nuttx-config/include/board.h +++ /dev/null @@ -1,280 +0,0 @@ -/************************************************************************************ - * nuttx-config/include/board.h - * - * Copyright (C) 2020 Gregory Nutt. All rights reserved. - * Authors: David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ -#pragma once - -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/* Clocking *************************************************************************/ -/* The board provides the following clock sources: - * - * X1: 24 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 16 MHz RC factory-trimmed internal oscillator - * HSE: 24 MHz crystal for HSE - */ -#define STM32_BOARD_XTAL 24000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 0 - -/* Main PLL Configuration. - * - * PLL source is HSE = 24,000,000 - * - * PLL_VCOx = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 1 <= PLLM <= 63 - * 4 <= PLLN <= 512 - * 150 MHz <= PLL_VCOL <= 420MHz - * 192 MHz <= PLL_VCOH <= 836MHz - * - * SYSCLK = PLL_VCO / PLLP - * CPUCLK = SYSCLK / D1CPRE - * Subject to - * - * PLLP1 = {2, 4, 6, 8, ..., 128} - * PLLP2,3 = {2, 3, 4, ..., 128} - * CPUCLK <= 480 MHz - */ -#define STM32_PLLCFG_PLLSRC RCC_PLLCKSELR_PLLSRC_HSE - -/* PLL1, wide 4 - 8 MHz input, enable DIVP, DIVQ, DIVR - * - * PLL1_VCO = (24,000,000 / 2) * 80 = 960 MHz - * - * PLL1P = PLL1_VCO/2 = 960 MHz / 2 = 480 MHz - * PLL1Q = PLL1_VCO/4 = 960 MHz / 4 = 240 MHz - * PLL1R = PLL1_VCO/8 = 960 MHz / 8 = 120 MHz - */ -#define STM32_PLLCFG_PLL1CFG (RCC_PLLCFGR_PLL1VCOSEL_WIDE|RCC_PLLCFGR_PLL1RGE_4_8_MHZ|RCC_PLLCFGR_DIVP1EN|RCC_PLLCFGR_DIVQ1EN|RCC_PLLCFGR_DIVR1EN) -#define STM32_PLLCFG_PLL1M RCC_PLLCKSELR_DIVM1(2) -#define STM32_PLLCFG_PLL1N RCC_PLL1DIVR_N1(80) -#define STM32_PLLCFG_PLL1P RCC_PLL1DIVR_P1(2) -#define STM32_PLLCFG_PLL1Q RCC_PLL1DIVR_Q1(4) -#define STM32_PLLCFG_PLL1R RCC_PLL1DIVR_R1(8) - -#define STM32_VCO1_FREQUENCY ((STM32_HSE_FREQUENCY / 2) * 80) -#define STM32_PLL1P_FREQUENCY (STM32_VCO1_FREQUENCY / 2) -#define STM32_PLL1Q_FREQUENCY (STM32_VCO1_FREQUENCY / 4) -#define STM32_PLL1R_FREQUENCY (STM32_VCO1_FREQUENCY / 8) - -/* PLL2 */ -#define STM32_PLLCFG_PLL2CFG (RCC_PLLCFGR_PLL2VCOSEL_WIDE|RCC_PLLCFGR_PLL2RGE_4_8_MHZ|RCC_PLLCFGR_DIVP2EN|RCC_PLLCFGR_DIVQ2EN|RCC_PLLCFGR_DIVR2EN) -#define STM32_PLLCFG_PLL2M RCC_PLLCKSELR_DIVM2(4) -#define STM32_PLLCFG_PLL2N RCC_PLL2DIVR_N2(32) -#define STM32_PLLCFG_PLL2P RCC_PLL2DIVR_P2(2) -#define STM32_PLLCFG_PLL2Q RCC_PLL2DIVR_Q2(2) -#define STM32_PLLCFG_PLL2R RCC_PLL2DIVR_R2(2) - -#define STM32_VCO2_FREQUENCY ((STM32_HSE_FREQUENCY / 4) * 32) -#define STM32_PLL2P_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2Q_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2R_FREQUENCY (STM32_VCO2_FREQUENCY / 2) - -/* PLL3 */ -#define STM32_PLLCFG_PLL3CFG (RCC_PLLCFGR_PLL3VCOSEL_WIDE|RCC_PLLCFGR_PLL3RGE_4_8_MHZ|RCC_PLLCFGR_DIVQ3EN) -#define STM32_PLLCFG_PLL3M RCC_PLLCKSELR_DIVM3(4) -#define STM32_PLLCFG_PLL3N RCC_PLL3DIVR_N3(32) -#define STM32_PLLCFG_PLL3P RCC_PLL3DIVR_P3(2) -#define STM32_PLLCFG_PLL3Q RCC_PLL3DIVR_Q3(4) -#define STM32_PLLCFG_PLL3R RCC_PLL3DIVR_R3(2) - -#define STM32_VCO3_FREQUENCY ((STM32_HSE_FREQUENCY / 4) * 32) -#define STM32_PLL3P_FREQUENCY (STM32_VCO3_FREQUENCY / 2) -#define STM32_PLL3Q_FREQUENCY (STM32_VCO3_FREQUENCY / 4) -#define STM32_PLL3R_FREQUENCY (STM32_VCO3_FREQUENCY / 2) - -/* SYSCLK = PLL1P = 480MHz - * CPUCLK = SYSCLK / 1 = 480 MHz - */ -#define STM32_RCC_D1CFGR_D1CPRE (RCC_D1CFGR_D1CPRE_SYSCLK) -#define STM32_SYSCLK_FREQUENCY (STM32_PLL1P_FREQUENCY) -#define STM32_CPUCLK_FREQUENCY (STM32_SYSCLK_FREQUENCY / 1) - -/* Configure Clock Assignments */ - -/* AHB clock (HCLK) is SYSCLK/2 (240 MHz max) - * HCLK1 = HCLK2 = HCLK3 = HCLK4 = 240 - */ -#define STM32_RCC_D1CFGR_HPRE RCC_D1CFGR_HPRE_SYSCLKd2 /* HCLK = SYSCLK / 2 */ -#define STM32_ACLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* ACLK in D1, HCLK3 in D1 */ -#define STM32_HCLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* HCLK in D2, HCLK4 in D3 */ -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/2 (120 MHz) */ -#define STM32_RCC_D2CFGR_D2PPRE1 RCC_D2CFGR_D2PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB2 clock (PCLK2) is HCLK/2 (120 MHz) */ -#define STM32_RCC_D2CFGR_D2PPRE2 RCC_D2CFGR_D2PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB3 clock (PCLK3) is HCLK/2 (120 MHz) */ -#define STM32_RCC_D1CFGR_D1PPRE RCC_D1CFGR_D1PPRE_HCLKd2 /* PCLK3 = HCLK / 2 */ -#define STM32_PCLK3_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB4 clock (PCLK4) is HCLK/4 (120 MHz) */ -#define STM32_RCC_D3CFGR_D3PPRE RCC_D3CFGR_D3PPRE_HCLKd2 /* PCLK4 = HCLK / 2 */ -#define STM32_PCLK4_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timer clock frequencies */ - -/* Timers driven from APB1 will be twice PCLK1 */ -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* Timers driven from APB2 will be twice PCLK2 */ -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM15_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM16_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM17_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Kernel Clock Configuration - * Note: look at Table 54 in ST Manual - */ -#define STM32_RCC_D2CCIP2R_I2C123SRC RCC_D2CCIP2R_I2C123SEL_HSI /* I2C123 clock source */ -#define STM32_RCC_D3CCIPR_I2C4SRC RCC_D3CCIPR_I2C4SEL_HSI /* I2C4 clock source */ -#define STM32_RCC_D2CCIP1R_SPI123SRC RCC_D2CCIP1R_SPI123SEL_PLL2 /* SPI123 clock source */ -#define STM32_RCC_D2CCIP1R_SPI45SRC RCC_D2CCIP1R_SPI45SEL_PLL2 /* SPI45 clock source */ -#define STM32_RCC_D3CCIPR_SPI6SRC RCC_D3CCIPR_SPI6SEL_PLL2 /* SPI6 clock source */ -#define STM32_RCC_D2CCIP2R_USBSRC RCC_D2CCIP2R_USBSEL_PLL3 /* USB 1 and 2 clock source */ -#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2 /* ADC 1 2 3 clock source */ -#define STM32_RCC_D2CCIP1R_FDCANSEL RCC_D2CCIP1R_FDCANSEL_HSE /* FDCAN 1 2 clock source */ - -#define STM32_FDCANCLK STM32_HSE_FREQUENCY - -/* FLASH wait states */ -#define BOARD_FLASH_WAITSTATES 2 - -/* SDMMC definitions ********************************************************/ -/* Init 400kHz, freq = PLL1Q/(2*div) div = PLL1Q/(2*freq) */ -#define STM32_SDMMC_INIT_CLKDIV (300 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* 25 MHz Max for now, 25 mHZ = PLL1Q/(2*div), div = PLL1Q/(2*freq) - * div = 4.8 = 240 / 50, So round up to 5 for default speed 24 MB/s - */ -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_MMCXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_SDXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - - -/* UART/USART */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ -#define GPIO_USART2_RX GPIO_USART2_RX_2 /* PD6 */ -#define GPIO_USART2_CTS GPIO_USART2_CTS_NSS_2 /* PD3 */ -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 /* PD4 */ - -#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ -#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ -#define GPIO_USART3_CTS GPIO_USART3_CTS_NSS_2 /* PD11 */ -#define GPIO_USART3_RTS GPIO_USART3_RTS_2 /* PD12 */ - -#define GPIO_UART4_TX GPIO_UART4_TX_2 /* PA0 */ -#define GPIO_UART4_RX GPIO_UART4_RX_2 /* PA1 */ - -#define GPIO_USART6_TX 0 /* USART6 is RX-only */ -#define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC7 */ - -#define GPIO_UART7_TX GPIO_UART7_TX_3 /* PE8 */ -#define GPIO_UART7_RX GPIO_UART7_RX_3 /* PE7 */ - -#define GPIO_UART8_TX GPIO_UART8_TX_1 /* PE1 */ -#define GPIO_UART8_RX GPIO_UART8_RX_1 /* PE0 */ - - -/* CAN */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 /* PD0 */ -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 /* PD1 */ - -#define GPIO_CAN2_RX GPIO_CAN2_RX_1 /* PB12 */ -#define GPIO_CAN2_TX GPIO_CAN2_TX_1 /* PB13 */ - - -/* SPI */ -#define ADJ_SLEW_RATE(p) (((p) & ~GPIO_SPEED_MASK) | (GPIO_SPEED_2MHz)) - -#define GPIO_SPI1_SCK ADJ_SLEW_RATE(GPIO_SPI1_SCK_1) /* PA5 */ -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 /* PA7 */ - -#define GPIO_SPI2_SCK ADJ_SLEW_RATE(GPIO_SPI2_SCK_3) /* PB10 */ -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 /* PB14 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 /* PB15 */ - -#define GPIO_SPI5_SCK ADJ_SLEW_RATE(GPIO_SPI5_SCK_1) /* PF7 */ -#define GPIO_SPI5_MISO GPIO_SPI5_MISO_1 /* PF8 */ -#define GPIO_SPI5_MOSI GPIO_SPI5_MOSI_2 /* PF9 */ - - -/* I2C */ -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 /* PB8 */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 /* PB9 */ - -#define GPIO_I2C3_SCL GPIO_I2C3_SCL_2 /* PH7 */ -#define GPIO_I2C3_SDA GPIO_I2C3_SDA_2 /* PH8 */ - -#define GPIO_I2C4_SCL GPIO_I2C4_SCL_4 /* PB6 */ -#define GPIO_I2C4_SDA GPIO_I2C4_SDA_4 /* PB7 */ diff --git a/boards/mro/ctrl-zero-h7-oem/nuttx-config/include/board_dma_map.h b/boards/mro/ctrl-zero-h7-oem/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 10011ed..0000000 --- a/boards/mro/ctrl-zero-h7-oem/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -#pragma once - -// DMAMUX1 -#define DMAMAP_SPI1_RX DMAMAP_DMA12_SPI1RX_0 /* DMA1:37 */ -#define DMAMAP_SPI1_TX DMAMAP_DMA12_SPI1TX_0 /* DMA1:38 */ - -#define DMAMAP_USART6_RX DMAMAP_DMA12_USART6RX_1 /* DMA1:71 */ -#define DMAMAP_USART6_TX DMAMAP_DMA12_USART6TX_1 /* DMA1:72 */ - -#define DMAMAP_SPI5_RX DMAMAP_DMA12_SPI5RX_0 /* DMA1:83 */ -#define DMAMAP_SPI5_TX DMAMAP_DMA12_SPI5TX_0 /* DMA1:84 */ diff --git a/boards/mro/ctrl-zero-h7-oem/nuttx-config/nsh/defconfig b/boards/mro/ctrl-zero-h7-oem/nuttx-config/nsh/defconfig deleted file mode 100644 index a79a19a..0000000 --- a/boards/mro/ctrl-zero-h7-oem/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,257 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/mro/ctrl-zero-h7-oem/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743II=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=95150 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x1024 -CONFIG_CDCACM_PRODUCTSTR="mRoControlZeroH7 OEM" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="mRo" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_MEMFAULT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXPERIMENTAL=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=4 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_PROGMEM=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32H7_ADC1=y -CONFIG_STM32H7_ADC3=y -CONFIG_STM32H7_BBSRAM=y -CONFIG_STM32H7_BBSRAM_FILES=5 -CONFIG_STM32H7_BDMA=y -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_DMA2=y -CONFIG_STM32H7_DMACAPABLE=y -CONFIG_STM32H7_FLOWCONTROL_BROKEN=y -CONFIG_STM32H7_I2C1=y -CONFIG_STM32H7_I2C3=y -CONFIG_STM32H7_I2C4=y -CONFIG_STM32H7_I2C_DYNTIMEO=y -CONFIG_STM32H7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_RTC=y -CONFIG_STM32H7_RTC_HSECLOCK=y -CONFIG_STM32H7_RTC_MAGIC_REG=1 -CONFIG_STM32H7_SAVE_CRASHDUMP=y -CONFIG_STM32H7_SDMMC1=y -CONFIG_STM32H7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_SPI1=y -CONFIG_STM32H7_SPI1_DMA=y -CONFIG_STM32H7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32H7_SPI2=y -CONFIG_STM32H7_SPI5=y -CONFIG_STM32H7_SPI5_DMA=y -CONFIG_STM32H7_SPI5_DMA_BUFFER=1024 -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_TIM2=y -CONFIG_STM32H7_TIM3=y -CONFIG_STM32H7_TIM4=y -CONFIG_STM32H7_TIM8=y -CONFIG_STM32H7_UART4=y -CONFIG_STM32H7_UART7=y -CONFIG_STM32H7_UART8=y -CONFIG_STM32H7_USART2=y -CONFIG_STM32H7_USART3=y -CONFIG_STM32H7_USART6=y -CONFIG_STM32H7_USART_BREAKS=y -CONFIG_STM32H7_USART_INVERT=y -CONFIG_STM32H7_USART_SINGLEWIRE=y -CONFIG_STM32H7_USART_SWAP=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGTSTP=y -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_SERIAL_CONSOLE=y -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_TXBUFSIZE=3000 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/mro/ctrl-zero-h7-oem/nuttx-config/scripts/bootloader_script.ld b/boards/mro/ctrl-zero-h7-oem/nuttx-config/scripts/bootloader_script.ld deleted file mode 100644 index 3fb4cc1..0000000 --- a/boards/mro/ctrl-zero-h7-oem/nuttx-config/scripts/bootloader_script.ld +++ /dev/null @@ -1,221 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2020 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The board uses an STM32H743II has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * There's a switch on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the switch is - * drepresed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743ZI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 128K - DTCM1_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - DTCM2_RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */ - SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */ - SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */ - BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > AXI_SRAM AT > FLASH - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > AXI_SRAM - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } - - .ramfunc : { - _sramfuncs = .; - *(.ramfunc .ramfunc.*) - . = ALIGN(4); - _eramfuncs = .; - } > ITCM_RAM AT > FLASH - - _framfuncs = LOADADDR(.ramfunc); -} diff --git a/boards/mro/ctrl-zero-h7-oem/nuttx-config/scripts/script.ld b/boards/mro/ctrl-zero-h7-oem/nuttx-config/scripts/script.ld deleted file mode 100644 index 02e763a..0000000 --- a/boards/mro/ctrl-zero-h7-oem/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,228 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2021 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The board uses an STM32H743XIH6 and has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * There's a switch on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the switch is - * drepresed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743ZI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - FLASH (rx) : ORIGIN = 0x08020000, LENGTH = 1920K - - DTCM1_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - DTCM2_RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */ - SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */ - SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */ - BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH - - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - - /* Pad out last section as the STM32H7 Flash write size is 256 bits. 32 bytes */ - . = ALIGN(16); - FILL(0xffff) - . += 16; - } > AXI_SRAM AT > FLASH = 0xffff - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > AXI_SRAM - - /* Emit the the D3 power domain section for locating BDMA data */ - - .sram4_reserve (NOLOAD) : - { - *(.sram4) - . = ALIGN(4); - _sram4_heap_start = ABSOLUTE(.); - } > SRAM4 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/mro/ctrl-zero-h7-oem/src/CMakeLists.txt b/boards/mro/ctrl-zero-h7-oem/src/CMakeLists.txt deleted file mode 100644 index 6a7d2ce..0000000 --- a/boards/mro/ctrl-zero-h7-oem/src/CMakeLists.txt +++ /dev/null @@ -1,65 +0,0 @@ -############################################################################ -# -# Copyright (c) 2021 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. -# -############################################################################ -if("${PX4_BOARD_LABEL}" STREQUAL "bootloader") - add_library(drivers_board - bootloader_main.c - usb.c - ) - target_link_libraries(drivers_board - PRIVATE - nuttx_arch - nuttx_drivers - bootloader - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/bootloader/common) - -else() - add_library(drivers_board - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - usb.c - ) - - target_link_libraries(drivers_board - PRIVATE - arch_io_pins - arch_spi - drivers__led - nuttx_arch - nuttx_drivers - px4_layer - ) -endif() diff --git a/boards/mro/ctrl-zero-h7-oem/src/board_config.h b/boards/mro/ctrl-zero-h7-oem/src/board_config.h deleted file mode 100644 index c573b65..0000000 --- a/boards/mro/ctrl-zero-h7-oem/src/board_config.h +++ /dev/null @@ -1,185 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * Board internal definitions - */ - -#pragma once - -#include -#include -#include -#include - -/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */ -#define GPIO_nLED_RED /* PB11 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN11) -#define GPIO_nLED_GREEN /* PB1 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN1) -#define GPIO_nLED_BLUE /* PB3 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN3) - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_OVERLOAD_LED LED_RED -#define BOARD_ARMED_STATE_LED LED_BLUE - -/* ADC channels */ -#define PX4_ADC_GPIO \ - /* PA2 */ GPIO_ADC12_INP14, \ - /* PA3 */ GPIO_ADC12_INP15, \ - /* PA4 */ GPIO_ADC12_INP18, \ - /* PC1 */ GPIO_ADC123_INP11 - -/* Define Channel numbers must match above GPIO pins */ -#define ADC_BATTERY_VOLTAGE_CHANNEL 14 /* PA2 BATT_VOLT_SENS */ -#define ADC_BATTERY_CURRENT_CHANNEL 15 /* PA3 BATT_CURRENT_SENS */ -#define ADC_SCALED_V5_CHANNEL 18 /* PA4 VDD_5V_SENS */ -#define ADC_RC_RSSI_CHANNEL 11 /* PC1 */ - -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY_CURRENT_CHANNEL) | \ - (1 << ADC_SCALED_V5_CHANNEL) | \ - (1 << ADC_RC_RSSI_CHANNEL)) - -/* HW has to large of R termination on ADC todo:change when HW value is chosen */ -#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f) - -/* CAN Silence: Silent mode control */ -#define GPIO_CAN1_SILENT_S0 /* PF5 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTF|GPIO_PIN5) - -/* PWM */ -#define DIRECT_PWM_OUTPUT_CHANNELS 8 - -/* Power supply control and monitoring GPIOs */ -#define GPIO_nPOWER_IN_A /* PB5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5) - -#define GPIO_VDD_BRICK1_VALID GPIO_nPOWER_IN_A /* Brick 1 Is Chosen */ -#define BOARD_NUMBER_BRICKS 1 - -#define GPIO_VDD_3V3_SPEKTRUM_POWER_EN /* PE4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN4) - -/* Define True logic Power Control in arch agnostic form */ -#define VDD_3V3_SPEKTRUM_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SPEKTRUM_POWER_EN, (!on_true)) -#define READ_VDD_3V3_SPEKTRUM_POWER_EN() (px4_arch_gpioread(GPIO_VDD_3V3_SPEKTRUM_POWER_EN) == 0) - -/* Tone alarm output */ -#define TONE_ALARM_TIMER 2 /* timer 2 */ -#define TONE_ALARM_CHANNEL 1 /* PA15 TIM2_CH1 */ - -#define GPIO_BUZZER_1 /* PA15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) - -#define GPIO_TONE_ALARM_IDLE GPIO_BUZZER_1 -#define GPIO_TONE_ALARM GPIO_TIM2_CH1OUT_2 - -/* USB OTG FS */ -#define GPIO_OTGFS_VBUS /* PA9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 3 /* use timer3 for the HRT */ -#define HRT_TIMER_CHANNEL 1 /* use capture/compare channel 1 */ - -#define HRT_PPM_CHANNEL /* T3C3 */ 3 /* use capture/compare channel 3 */ -#define GPIO_PPM_IN /* PB0 T3C3 */ GPIO_TIM3_CH3IN_1 - -/* RC Serial port */ -#define RC_SERIAL_PORT "/dev/ttyS3" - -#define GPIO_RSSI_IN /* PC1 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN1) - -/* Safety Switch: Enable the FMU to control it if there is no px4io fixme:This should be BOARD_SAFETY_LED(__ontrue) */ -#define GPIO_SAFETY_SWITCH_IN /* PC4 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN4) -/* Enable the FMU to use the switch it if there is no px4io fixme:This should be BOARD_SAFTY_BUTTON() */ -#define GPIO_BTN_SAFETY GPIO_SAFETY_SWITCH_IN /* Enable the FMU to control it if there is no px4io */ - -/* Power switch controls ******************************************************/ -#define SPEKTRUM_POWER(_on_true) VDD_3V3_SPEKTRUM_POWER_EN(_on_true) - -/* - * Board has a separate RC_IN - * - * GPIO PPM_IN on PB0 T3CH3 - * SPEKTRUM_RX (it's TX or RX in Bind) on UART6 PC7 - * Inversion is possible in the UART and can drive GPIO_PPM_IN as an output - */ -#define GPIO_PPM_IN_AS_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN0) -#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_PPM_IN_AS_OUT) -#define SPEKTRUM_RX_AS_UART() /* Can be left as uart */ -#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true)) - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_USB_VALID BOARD_ADC_USB_CONNECTED -#define BOARD_ADC_SERVO_VALID (1) /* never powers off the Servo rail */ -#define BOARD_ADC_BRICK_VALID (px4_arch_gpioread(GPIO_VDD_BRICK1_VALID)) - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ -#define BOARD_HAS_ON_RESET 1 - -#define BOARD_HAS_STATIC_MANIFEST 1 - - -#define BOARD_NUM_IO_TIMERS 3 - - -#define BOARD_ENABLE_CONSOLE_BUFFER - -#define PX4_GPIO_INIT_LIST { \ - PX4_ADC_GPIO, \ - GPIO_CAN1_TX, \ - GPIO_CAN1_RX, \ - GPIO_CAN2_TX, \ - GPIO_CAN2_RX, \ - GPIO_CAN1_SILENT_S0, \ - GPIO_nPOWER_IN_A, \ - GPIO_VDD_3V3_SPEKTRUM_POWER_EN, \ - GPIO_TONE_ALARM_IDLE, \ - GPIO_SAFETY_SWITCH_IN, \ - GPIO_OTGFS_VBUS, \ - } - -__BEGIN_DECLS -#ifndef __ASSEMBLY__ - -extern void stm32_spiinitialize(void); -extern void board_peripheral_reset(int ms); - -#include -#endif /* __ASSEMBLY__ */ -__END_DECLS diff --git a/boards/mro/ctrl-zero-h7-oem/src/bootloader_main.c b/boards/mro/ctrl-zero-h7-oem/src/bootloader_main.c deleted file mode 100644 index 3a0e1a1..0000000 --- a/boards/mro/ctrl-zero-h7-oem/src/bootloader_main.c +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020-2021 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. - * - ****************************************************************************/ - -/** - * @file bootloader_main.c - * - * FMU-specific early startup code for bootloader -*/ - -#include "board_config.h" -#include "bl.h" - -#include -#include -#include -#include -#include -#include "arm_internal.h" -#include - -extern int sercon_main(int c, char **argv); - -__EXPORT void board_on_reset(int status) {} - -__EXPORT void stm32_boardinitialize(void) -{ - /* configure USB interfaces */ - stm32_configgpio(GPIO_OTGFS_VBUS); -} - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - return 0; -} - -void board_late_initialize(void) -{ - sercon_main(0, NULL); -} - -extern void sys_tick_handler(void); -void board_timerhook(void) -{ - sys_tick_handler(); -} diff --git a/boards/mro/ctrl-zero-h7-oem/src/hw_config.h b/boards/mro/ctrl-zero-h7-oem/src/hw_config.h deleted file mode 100644 index 8fdaec9..0000000 --- a/boards/mro/ctrl-zero-h7-oem/src/hw_config.h +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/**************************************************************************** - * 10-8--2016: - * To simplify the ripple effect on the tools, we will be using - * /dev/serial/by-id/PX4 to locate PX4 devices. Therefore - * moving forward all Bootloaders must contain the prefix "PX4 BL " - * in the USBDEVICESTRING - * This Change will be made in an upcoming BL release - ****************************************************************************/ -/* - * Define usage to configure a bootloader - * - * - * Constant example Usage - * APP_LOAD_ADDRESS 0x08004000 - The address in Linker Script, where the app fw is org-ed - * BOOTLOADER_DELAY 5000 - Ms to wait while under USB pwr or bootloader request - * BOARD_FMUV2 - * INTERFACE_USB 1 - (Optional) Scan and use the USB interface for bootloading - * INTERFACE_USART 1 - (Optional) Scan and use the Serial interface for bootloading - * USBDEVICESTRING "PX4 BL FMU v2.x" - USB id string - * USBPRODUCTID 0x0011 - PID Should match defconfig - * BOOT_DELAY_ADDRESS 0x000001a0 - (Optional) From the linker script from Linker Script to get a custom - * delay provided by an APP FW - * BOARD_TYPE 9 - Must match .prototype boad_id - * _FLASH_KBYTES (*(uint16_t *)0x1fff7a22) - Run time flash size detection - * BOARD_FLASH_SECTORS ((_FLASH_KBYTES == 0x400) ? 11 : 23) - Run time determine the physical last sector - * BOARD_FLASH_SECTORS 11 - Hard coded zero based last sector - * BOARD_FLASH_SIZE (_FLASH_KBYTES*1024)- Total Flash size of device, determined at run time. - * (1024 * 1024) - Hard coded Total Flash of device - The bootloader and app reserved will be deducted - * programmatically - * - * BOARD_FIRST_FLASH_SECTOR_TO_ERASE 2 - Optional sectors index in the flash_sectors table (F4 only), to begin erasing. - * This is to allow sectors to be reserved for app fw usage. That will NOT be erased - * during a FW upgrade. - * The default is 0, and selects the first sector to be erased, as the 0th entry in the - * flash_sectors table. Which is the second physical sector of FLASH in the device. - * The first physical sector of FLASH is used by the bootloader, and is not defined - * in the table. - * - * APP_RESERVATION_SIZE (BOARD_FIRST_FLASH_SECTOR_TO_ERASE * 16 * 1024) - Number of bytes reserved by the APP FW. This number plus - * BOOTLOADER_RESERVATION_SIZE will be deducted from - * BOARD_FLASH_SIZE to determine the size of the App FW - * and hence the address space of FLASH to erase and program. - * USBMFGSTRING "PX4 AP" - Optional USB MFG string (default is '3D Robotics' if not defined.) - * SERIAL_BREAK_DETECT_DISABLED - Optional prevent break selection on Serial port from entering or staying in BL - * - * * Other defines are somewhat self explanatory. - */ - -/* Boot device selection list*/ -#define USB0_DEV 0x01 -#define SERIAL0_DEV 0x02 -#define SERIAL1_DEV 0x04 - -#define APP_LOAD_ADDRESS 0x08020000 -#define BOOTLOADER_DELAY 5000 -#define INTERFACE_USB 1 -#define INTERFACE_USB_CONFIG "/dev/ttyACM0" -#define BOARD_VBUS MK_GPIO_INPUT(GPIO_OTGFS_VBUS) - -//#define USE_VBUS_PULL_DOWN -#define INTERFACE_USART 1 -#define INTERFACE_USART_CONFIG "/dev/ttyS0,115200" -#define BOOT_DELAY_ADDRESS 0x000001a0 -#define BOARD_TYPE 1024 -#define _FLASH_KBYTES (*(uint32_t *)0x1FF1E880) -#define BOARD_FLASH_SECTORS (15) -#define BOARD_FLASH_SIZE (_FLASH_KBYTES * 1024) - -#define OSC_FREQ 24 - -#define BOARD_PIN_LED_ACTIVITY GPIO_nLED_RED -#define BOARD_PIN_LED_BOOTLOADER GPIO_nLED_RED -#define BOARD_LED_ON 0 -#define BOARD_LED_OFF 1 - -#define SERIAL_BREAK_DETECT_DISABLED 1 - -#if !defined(ARCH_SN_MAX_LENGTH) -# define ARCH_SN_MAX_LENGTH 12 -#endif - -#if !defined(APP_RESERVATION_SIZE) -# define APP_RESERVATION_SIZE 0 -#endif - -#if !defined(BOARD_FIRST_FLASH_SECTOR_TO_ERASE) -# define BOARD_FIRST_FLASH_SECTOR_TO_ERASE 1 -#endif - -#if !defined(USB_DATA_ALIGN) -# define USB_DATA_ALIGN -#endif - -#ifndef BOOT_DEVICES_SELECTION -# define BOOT_DEVICES_SELECTION USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif - -#ifndef BOOT_DEVICES_FILTER_ONUSB -# define BOOT_DEVICES_FILTER_ONUSB USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif diff --git a/boards/mro/ctrl-zero-h7-oem/src/i2c.cpp b/boards/mro/ctrl-zero-h7-oem/src/i2c.cpp deleted file mode 100644 index 1b8927c..0000000 --- a/boards/mro/ctrl-zero-h7-oem/src/i2c.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), - initI2CBusExternal(3), - initI2CBusExternal(4), -}; diff --git a/boards/mro/ctrl-zero-h7-oem/src/init.c b/boards/mro/ctrl-zero-h7-oem/src/init.c deleted file mode 100644 index daaace4..0000000 --- a/boards/mro/ctrl-zero-h7-oem/src/init.c +++ /dev/null @@ -1,204 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * board-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. - */ - -#include "board_config.h" - -#include - -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include - -#include - -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - bool last = READ_VDD_3V3_SPEKTRUM_POWER_EN(); - /* Keep Spektum on to discharge rail*/ - VDD_3V3_SPEKTRUM_POWER_EN(false); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ - VDD_3V3_SPEKTRUM_POWER_EN(last); -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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 - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Power on Interfaces */ - board_control_spi_sensors_power(true, 0xffff); - VDD_3V3_SPEKTRUM_POWER_EN(true); - - px4_platform_init(); - - stm32_spiinitialize(); - - /* configure the DMA allocator */ - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_on(LED_GREEN); // Indicate Power. - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - -#ifdef CONFIG_MMCSD - /* Mount the SDIO-based MMC/SD block driver */ - /* First, get an instance of the SDIO interface */ - struct sdio_dev_s *sdio_dev = sdio_initialize(0); // SDIO_SLOTNO 0 Only one slot - - if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", 0); - } - - if (mmcsd_slotinitialize(0, sdio_dev) != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver\n"); - } - - /* Assume that the SD card is inserted. What choice do we have? */ - sdio_mediachange(sdio_dev, true); -#endif /* CONFIG_MMCSD */ - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/mro/ctrl-zero-h7-oem/src/led.c b/boards/mro/ctrl-zero-h7-oem/src/led.c deleted file mode 100644 index 0e7beb3..0000000 --- a/boards/mro/ctrl-zero-h7-oem/src/led.c +++ /dev/null @@ -1,111 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -static uint32_t g_ledmap[] = { - GPIO_nLED_BLUE, // Indexed by LED_BLUE - GPIO_nLED_RED, // Indexed by LED_RED - GPIO_nLED_GREEN, // Indexed by LED_GREEN -}; - -__EXPORT void led_init(void) -{ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - if (g_ledmap[l] != 0) { - stm32_configgpio(g_ledmap[l]); - } - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - if (g_ledmap[led] != 0) { - stm32_gpiowrite(g_ledmap[led], !state); - } -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - if (g_ledmap[led] != 0) { - return !stm32_gpioread(g_ledmap[led]); - } - - return false; -} - -__EXPORT void led_on(int led) -{ - phy_set_led(led, true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(led, false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(led, !phy_get_led(led)); -} diff --git a/boards/mro/ctrl-zero-h7-oem/src/spi.cpp b/boards/mro/ctrl-zero-h7-oem/src/spi.cpp deleted file mode 100644 index 4a4c350..0000000 --- a/boards/mro/ctrl-zero-h7-oem/src/spi.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20948, SPI::CS{GPIO::PortE, GPIO::Pin15}, SPI::DRDY{GPIO::PortE, GPIO::Pin12}), - }, {GPIO::PortE, GPIO::Pin3}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10}), - initSPIDevice(DRV_BARO_DEVTYPE_DPS310, SPI::CS{GPIO::PortD, GPIO::Pin7}), - }), - initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(DRV_GYR_DEVTYPE_BMI088, SPI::CS{GPIO::PortF, GPIO::Pin10}, SPI::DRDY{GPIO::PortF, GPIO::Pin3}), - initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::PortF, GPIO::Pin6}, SPI::DRDY{GPIO::PortF, GPIO::Pin1}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/mro/ctrl-zero-h7-oem/src/timer_config.cpp b/boards/mro/ctrl-zero-h7-oem/src/timer_config.cpp deleted file mode 100644 index e238804..0000000 --- a/boards/mro/ctrl-zero-h7-oem/src/timer_config.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1, DMA{DMA::Index1}), - initIOTimer(Timer::Timer4, DMA{DMA::Index1}), - initIOTimer(Timer::Timer8, DMA{DMA::Index1}), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortE, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer8, Timer::Channel1}, {GPIO::PortI, GPIO::Pin5}), - initIOTimerChannel(io_timers, {Timer::Timer8, Timer::Channel2}, {GPIO::PortI, GPIO::Pin6}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/mro/ctrl-zero-h7-oem/src/usb.c b/boards/mro/ctrl-zero-h7-oem/src/usb.c deleted file mode 100644 index fe32ce7..0000000 --- a/boards/mro/ctrl-zero-h7-oem/src/usb.c +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include "board_config.h" - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ -__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_STM32H7_OTGFS - stm32_configgpio(GPIO_OTGFS_VBUS); -#endif -} - - - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/mro/ctrl-zero-h7/bootloader.px4board b/boards/mro/ctrl-zero-h7/bootloader.px4board deleted file mode 100644 index 19b6e66..0000000 --- a/boards/mro/ctrl-zero-h7/bootloader.px4board +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_ROMFSROOT="" diff --git a/boards/mro/ctrl-zero-h7/default.px4board b/boards/mro/ctrl-zero-h7/default.px4board deleted file mode 100644 index c32ae10..0000000 --- a/boards/mro/ctrl-zero-h7/default.px4board +++ /dev/null @@ -1,97 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS2" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS0" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL3="/dev/ttyS4" -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_BAROMETER_DPS310=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_BOSCH_BMI088=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_BOARD_UAVCAN_INTERFACES=1 -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UUV_ATT_CONTROL=y -CONFIG_MODULES_UUV_POS_CONTROL=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SERIAL_TEST=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/mro/ctrl-zero-h7/extras/mro_ctrl-zero-h7_bootloader.bin b/boards/mro/ctrl-zero-h7/extras/mro_ctrl-zero-h7_bootloader.bin deleted file mode 100755 index ac3050b..0000000 Binary files a/boards/mro/ctrl-zero-h7/extras/mro_ctrl-zero-h7_bootloader.bin and /dev/null differ diff --git a/boards/mro/ctrl-zero-h7/firmware.prototype b/boards/mro/ctrl-zero-h7/firmware.prototype deleted file mode 100644 index 41d94b3..0000000 --- a/boards/mro/ctrl-zero-h7/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 1023, - "magic": "mRo-ctrl-zero-h7", - "description": "Firmware for the mRo-ctrl-zero-h7 board", - "image": "", - "build_time": 0, - "summary": "mRo-ctrl-zero-h7", - "version": "0.1", - "image_size": 0, - "image_maxsize": 1966080, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/mro/ctrl-zero-h7/init/rc.board_defaults b/boards/mro/ctrl-zero-h7/init/rc.board_defaults deleted file mode 100644 index 32117f4..0000000 --- a/boards/mro/ctrl-zero-h7/init/rc.board_defaults +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 10.1 -param set-default BAT1_A_PER_V 17 - -safety_button start diff --git a/boards/mro/ctrl-zero-h7/init/rc.board_sensors b/boards/mro/ctrl-zero-h7/init/rc.board_sensors deleted file mode 100644 index 111e3eb..0000000 --- a/boards/mro/ctrl-zero-h7/init/rc.board_sensors +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# -# board specific sensors init -#------------------------------------------------------------------------------ -board_adc start - -# Internal ICM-20602 -icm20602 -s -b 1 -R 8 start - -# Internal SPI bus BMI088 accel & gyro -bmi088 -A -s -b 5 -R 8 start -bmi088 -G -s -b 5 -R 8 start - -# Internal ICM-20948 (with magnetometer) -icm20948 -s -b 1 -R 8 -M start - -# Interal DPS310 (barometer) -dps310 -s -b 2 start diff --git a/boards/mro/ctrl-zero-h7/nuttx-config/bootloader/defconfig b/boards/mro/ctrl-zero-h7/nuttx-config/bootloader/defconfig deleted file mode 100644 index 8ce4ddd..0000000 --- a/boards/mro/ctrl-zero-h7/nuttx-config/bootloader/defconfig +++ /dev/null @@ -1,90 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_CONSOLE is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_SPI_EXCHANGE is not set -# CONFIG_STM32H7_SYSCFG is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/mro/ctrl-zero-h7/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743II=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_INITTHREAD_PRIORITY=254 -CONFIG_BOARD_LATE_INITIALIZE=y -CONFIG_BOARD_LOOPSPERMSEC=95150 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x1023 -CONFIG_CDCACM_PRODUCTSTR="PX4 BL mRo ControlZeroH7" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="mRo" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_EXPERIMENTAL=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="bootloader_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SPI=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_USART3=y -CONFIG_SYSTEMTICK_HOOK=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGINT_CHAR=0x03 -CONFIG_TTY_SIGTSTP=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/mro/ctrl-zero-h7/nuttx-config/include/board.h b/boards/mro/ctrl-zero-h7/nuttx-config/include/board.h deleted file mode 100644 index 78a0048..0000000 --- a/boards/mro/ctrl-zero-h7/nuttx-config/include/board.h +++ /dev/null @@ -1,270 +0,0 @@ -/************************************************************************************ - * nuttx-config/include/board.h - * - * Copyright (C) 2020 Gregory Nutt. All rights reserved. - * Authors: David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ -#pragma once - -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/* Clocking *************************************************************************/ -/* The board provides the following clock sources: - * - * X1: 24 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 16 MHz RC factory-trimmed internal oscillator - * HSE: 24 MHz crystal for HSE - */ -#define STM32_BOARD_XTAL 24000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 0 - -/* Main PLL Configuration. - * - * PLL source is HSE = 24,000,000 - * - * PLL_VCOx = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 1 <= PLLM <= 63 - * 4 <= PLLN <= 512 - * 150 MHz <= PLL_VCOL <= 420MHz - * 192 MHz <= PLL_VCOH <= 836MHz - * - * SYSCLK = PLL_VCO / PLLP - * CPUCLK = SYSCLK / D1CPRE - * Subject to - * - * PLLP1 = {2, 4, 6, 8, ..., 128} - * PLLP2,3 = {2, 3, 4, ..., 128} - * CPUCLK <= 480 MHz - */ -#define STM32_PLLCFG_PLLSRC RCC_PLLCKSELR_PLLSRC_HSE - -/* PLL1, wide 4 - 8 MHz input, enable DIVP, DIVQ, DIVR - * - * PLL1_VCO = (24,000,000 / 2) * 80 = 960 MHz - * - * PLL1P = PLL1_VCO/2 = 960 MHz / 2 = 480 MHz - * PLL1Q = PLL1_VCO/4 = 960 MHz / 4 = 240 MHz - * PLL1R = PLL1_VCO/8 = 960 MHz / 8 = 120 MHz - */ -#define STM32_PLLCFG_PLL1CFG (RCC_PLLCFGR_PLL1VCOSEL_WIDE|RCC_PLLCFGR_PLL1RGE_4_8_MHZ|RCC_PLLCFGR_DIVP1EN|RCC_PLLCFGR_DIVQ1EN|RCC_PLLCFGR_DIVR1EN) -#define STM32_PLLCFG_PLL1M RCC_PLLCKSELR_DIVM1(2) -#define STM32_PLLCFG_PLL1N RCC_PLL1DIVR_N1(80) -#define STM32_PLLCFG_PLL1P RCC_PLL1DIVR_P1(2) -#define STM32_PLLCFG_PLL1Q RCC_PLL1DIVR_Q1(4) -#define STM32_PLLCFG_PLL1R RCC_PLL1DIVR_R1(8) - -#define STM32_VCO1_FREQUENCY ((STM32_HSE_FREQUENCY / 2) * 80) -#define STM32_PLL1P_FREQUENCY (STM32_VCO1_FREQUENCY / 2) -#define STM32_PLL1Q_FREQUENCY (STM32_VCO1_FREQUENCY / 4) -#define STM32_PLL1R_FREQUENCY (STM32_VCO1_FREQUENCY / 8) - -/* PLL2 */ -#define STM32_PLLCFG_PLL2CFG (RCC_PLLCFGR_PLL2VCOSEL_WIDE|RCC_PLLCFGR_PLL2RGE_4_8_MHZ|RCC_PLLCFGR_DIVP2EN|RCC_PLLCFGR_DIVQ2EN|RCC_PLLCFGR_DIVR2EN) -#define STM32_PLLCFG_PLL2M RCC_PLLCKSELR_DIVM2(4) -#define STM32_PLLCFG_PLL2N RCC_PLL2DIVR_N2(32) -#define STM32_PLLCFG_PLL2P RCC_PLL2DIVR_P2(2) -#define STM32_PLLCFG_PLL2Q RCC_PLL2DIVR_Q2(2) -#define STM32_PLLCFG_PLL2R RCC_PLL2DIVR_R2(2) - -#define STM32_VCO2_FREQUENCY ((STM32_HSE_FREQUENCY / 4) * 32) -#define STM32_PLL2P_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2Q_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2R_FREQUENCY (STM32_VCO2_FREQUENCY / 2) - -/* PLL3 */ -#define STM32_PLLCFG_PLL3CFG (RCC_PLLCFGR_PLL3VCOSEL_WIDE|RCC_PLLCFGR_PLL3RGE_4_8_MHZ|RCC_PLLCFGR_DIVQ3EN) -#define STM32_PLLCFG_PLL3M RCC_PLLCKSELR_DIVM3(4) -#define STM32_PLLCFG_PLL3N RCC_PLL3DIVR_N3(32) -#define STM32_PLLCFG_PLL3P RCC_PLL3DIVR_P3(2) -#define STM32_PLLCFG_PLL3Q RCC_PLL3DIVR_Q3(4) -#define STM32_PLLCFG_PLL3R RCC_PLL3DIVR_R3(2) - -#define STM32_VCO3_FREQUENCY ((STM32_HSE_FREQUENCY / 4) * 32) -#define STM32_PLL3P_FREQUENCY (STM32_VCO3_FREQUENCY / 2) -#define STM32_PLL3Q_FREQUENCY (STM32_VCO3_FREQUENCY / 4) -#define STM32_PLL3R_FREQUENCY (STM32_VCO3_FREQUENCY / 2) - -/* SYSCLK = PLL1P = 480MHz - * CPUCLK = SYSCLK / 1 = 480 MHz - */ -#define STM32_RCC_D1CFGR_D1CPRE (RCC_D1CFGR_D1CPRE_SYSCLK) -#define STM32_SYSCLK_FREQUENCY (STM32_PLL1P_FREQUENCY) -#define STM32_CPUCLK_FREQUENCY (STM32_SYSCLK_FREQUENCY / 1) - -/* Configure Clock Assignments */ - -/* AHB clock (HCLK) is SYSCLK/2 (240 MHz max) - * HCLK1 = HCLK2 = HCLK3 = HCLK4 = 240 - */ -#define STM32_RCC_D1CFGR_HPRE RCC_D1CFGR_HPRE_SYSCLKd2 /* HCLK = SYSCLK / 2 */ -#define STM32_ACLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* ACLK in D1, HCLK3 in D1 */ -#define STM32_HCLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* HCLK in D2, HCLK4 in D3 */ -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/2 (120 MHz) */ -#define STM32_RCC_D2CFGR_D2PPRE1 RCC_D2CFGR_D2PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB2 clock (PCLK2) is HCLK/2 (120 MHz) */ -#define STM32_RCC_D2CFGR_D2PPRE2 RCC_D2CFGR_D2PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB3 clock (PCLK3) is HCLK/2 (120 MHz) */ -#define STM32_RCC_D1CFGR_D1PPRE RCC_D1CFGR_D1PPRE_HCLKd2 /* PCLK3 = HCLK / 2 */ -#define STM32_PCLK3_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB4 clock (PCLK4) is HCLK/4 (120 MHz) */ -#define STM32_RCC_D3CFGR_D3PPRE RCC_D3CFGR_D3PPRE_HCLKd2 /* PCLK4 = HCLK / 2 */ -#define STM32_PCLK4_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timer clock frequencies */ - -/* Timers driven from APB1 will be twice PCLK1 */ -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* Timers driven from APB2 will be twice PCLK2 */ -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM15_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM16_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM17_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Kernel Clock Configuration - * Note: look at Table 54 in ST Manual - */ -#define STM32_RCC_D2CCIP2R_I2C123SRC RCC_D2CCIP2R_I2C123SEL_HSI /* I2C123 clock source */ -#define STM32_RCC_D2CCIP1R_SPI123SRC RCC_D2CCIP1R_SPI123SEL_PLL2 /* SPI123 clock source */ -#define STM32_RCC_D2CCIP1R_SPI45SRC RCC_D2CCIP1R_SPI45SEL_PLL2 /* SPI45 clock source */ -#define STM32_RCC_D3CCIPR_SPI6SRC RCC_D3CCIPR_SPI6SEL_PLL2 /* SPI6 clock source */ -#define STM32_RCC_D2CCIP2R_USBSRC RCC_D2CCIP2R_USBSEL_PLL3 /* USB 1 and 2 clock source */ -#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2 /* ADC 1 2 3 clock source */ -#define STM32_RCC_D2CCIP1R_FDCANSEL RCC_D2CCIP1R_FDCANSEL_HSE /* FDCAN 1 2 clock source */ - -#define STM32_FDCANCLK STM32_HSE_FREQUENCY - -/* FLASH wait states */ -#define BOARD_FLASH_WAITSTATES 2 - -/* SDMMC definitions ********************************************************/ -/* Init 400kHz, freq = PLL1Q/(2*div) div = PLL1Q/(2*freq) */ -#define STM32_SDMMC_INIT_CLKDIV (300 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* 25 MHz Max for now, 25 mHZ = PLL1Q/(2*div), div = PLL1Q/(2*freq) - * div = 4.8 = 240 / 50, So round up to 5 for default speed 24 MB/s - */ -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_MMCXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_SDXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - - -/* UART/USART */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ -#define GPIO_USART2_RX GPIO_USART2_RX_2 /* PD6 */ -#define GPIO_USART2_CTS GPIO_USART2_CTS_NSS_2 /* PD3 */ -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 /* PD4 */ - -#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ -#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ -#define GPIO_USART3_CTS GPIO_USART3_CTS_NSS_2 /* PD11 */ -#define GPIO_USART3_RTS GPIO_USART3_RTS_2 /* PD12 */ - -#define GPIO_UART4_TX GPIO_UART4_TX_2 /* PA0 */ -#define GPIO_UART4_RX GPIO_UART4_RX_2 /* PA1 */ - -#define GPIO_USART6_TX 0 /* USART6 is RX-only */ -#define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC7 */ - -#define GPIO_UART7_TX GPIO_UART7_TX_3 /* PE8 */ -#define GPIO_UART7_RX GPIO_UART7_RX_3 /* PE7 */ - -#define GPIO_UART8_TX GPIO_UART8_TX_1 /* PE1 */ -#define GPIO_UART8_RX GPIO_UART8_RX_1 /* PE0 */ - - -/* CAN */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 /* PD0 */ -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 /* PD1 */ - - -/* SPI */ -#define ADJ_SLEW_RATE(p) (((p) & ~GPIO_SPEED_MASK) | (GPIO_SPEED_2MHz)) - -#define GPIO_SPI1_SCK ADJ_SLEW_RATE(GPIO_SPI1_SCK_1) /* PA5 */ -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 /* PA7 */ - -#define GPIO_SPI2_SCK ADJ_SLEW_RATE(GPIO_SPI2_SCK_3) /* PB10 */ -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 /* PB14 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 /* PB15 */ - -#define GPIO_SPI5_SCK ADJ_SLEW_RATE(GPIO_SPI5_SCK_1) /* PF7 */ -#define GPIO_SPI5_MISO GPIO_SPI5_MISO_1 /* PF8 */ -#define GPIO_SPI5_MOSI GPIO_SPI5_MOSI_2 /* PF9 */ - - -/* I2C */ -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 /* PB8 */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 /* PB9 */ diff --git a/boards/mro/ctrl-zero-h7/nuttx-config/include/board_dma_map.h b/boards/mro/ctrl-zero-h7/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 10011ed..0000000 --- a/boards/mro/ctrl-zero-h7/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -#pragma once - -// DMAMUX1 -#define DMAMAP_SPI1_RX DMAMAP_DMA12_SPI1RX_0 /* DMA1:37 */ -#define DMAMAP_SPI1_TX DMAMAP_DMA12_SPI1TX_0 /* DMA1:38 */ - -#define DMAMAP_USART6_RX DMAMAP_DMA12_USART6RX_1 /* DMA1:71 */ -#define DMAMAP_USART6_TX DMAMAP_DMA12_USART6TX_1 /* DMA1:72 */ - -#define DMAMAP_SPI5_RX DMAMAP_DMA12_SPI5RX_0 /* DMA1:83 */ -#define DMAMAP_SPI5_TX DMAMAP_DMA12_SPI5TX_0 /* DMA1:84 */ diff --git a/boards/mro/ctrl-zero-h7/nuttx-config/nsh/defconfig b/boards/mro/ctrl-zero-h7/nuttx-config/nsh/defconfig deleted file mode 100644 index a0f0414..0000000 --- a/boards/mro/ctrl-zero-h7/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,254 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/mro/ctrl-zero-h7/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743II=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=95150 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x1023 -CONFIG_CDCACM_PRODUCTSTR="mRoControlZeroH7" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="mRo" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_MEMFAULT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXPERIMENTAL=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=4 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_PROGMEM=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32H7_ADC1=y -CONFIG_STM32H7_ADC3=y -CONFIG_STM32H7_BBSRAM=y -CONFIG_STM32H7_BBSRAM_FILES=5 -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_DMA2=y -CONFIG_STM32H7_DMACAPABLE=y -CONFIG_STM32H7_FLOWCONTROL_BROKEN=y -CONFIG_STM32H7_I2C1=y -CONFIG_STM32H7_I2C_DYNTIMEO=y -CONFIG_STM32H7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_RTC=y -CONFIG_STM32H7_RTC_HSECLOCK=y -CONFIG_STM32H7_RTC_MAGIC_REG=1 -CONFIG_STM32H7_SAVE_CRASHDUMP=y -CONFIG_STM32H7_SDMMC1=y -CONFIG_STM32H7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_SPI1=y -CONFIG_STM32H7_SPI1_DMA=y -CONFIG_STM32H7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32H7_SPI2=y -CONFIG_STM32H7_SPI5=y -CONFIG_STM32H7_SPI5_DMA=y -CONFIG_STM32H7_SPI5_DMA_BUFFER=1024 -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_TIM2=y -CONFIG_STM32H7_TIM3=y -CONFIG_STM32H7_TIM4=y -CONFIG_STM32H7_TIM8=y -CONFIG_STM32H7_UART4=y -CONFIG_STM32H7_UART7=y -CONFIG_STM32H7_UART8=y -CONFIG_STM32H7_USART2=y -CONFIG_STM32H7_USART3=y -CONFIG_STM32H7_USART6=y -CONFIG_STM32H7_USART_BREAKS=y -CONFIG_STM32H7_USART_INVERT=y -CONFIG_STM32H7_USART_SINGLEWIRE=y -CONFIG_STM32H7_USART_SWAP=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGTSTP=y -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_SERIAL_CONSOLE=y -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_TXBUFSIZE=3000 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/mro/ctrl-zero-h7/nuttx-config/scripts/bootloader_script.ld b/boards/mro/ctrl-zero-h7/nuttx-config/scripts/bootloader_script.ld deleted file mode 100644 index 3fb4cc1..0000000 --- a/boards/mro/ctrl-zero-h7/nuttx-config/scripts/bootloader_script.ld +++ /dev/null @@ -1,221 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2020 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The board uses an STM32H743II has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * There's a switch on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the switch is - * drepresed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743ZI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 128K - DTCM1_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - DTCM2_RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */ - SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */ - SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */ - BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > AXI_SRAM AT > FLASH - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > AXI_SRAM - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } - - .ramfunc : { - _sramfuncs = .; - *(.ramfunc .ramfunc.*) - . = ALIGN(4); - _eramfuncs = .; - } > ITCM_RAM AT > FLASH - - _framfuncs = LOADADDR(.ramfunc); -} diff --git a/boards/mro/ctrl-zero-h7/nuttx-config/scripts/script.ld b/boards/mro/ctrl-zero-h7/nuttx-config/scripts/script.ld deleted file mode 100644 index 02e763a..0000000 --- a/boards/mro/ctrl-zero-h7/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,228 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2021 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The board uses an STM32H743XIH6 and has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * There's a switch on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the switch is - * drepresed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743ZI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - FLASH (rx) : ORIGIN = 0x08020000, LENGTH = 1920K - - DTCM1_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - DTCM2_RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */ - SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */ - SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */ - BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH - - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - - /* Pad out last section as the STM32H7 Flash write size is 256 bits. 32 bytes */ - . = ALIGN(16); - FILL(0xffff) - . += 16; - } > AXI_SRAM AT > FLASH = 0xffff - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > AXI_SRAM - - /* Emit the the D3 power domain section for locating BDMA data */ - - .sram4_reserve (NOLOAD) : - { - *(.sram4) - . = ALIGN(4); - _sram4_heap_start = ABSOLUTE(.); - } > SRAM4 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/mro/ctrl-zero-h7/src/CMakeLists.txt b/boards/mro/ctrl-zero-h7/src/CMakeLists.txt deleted file mode 100644 index 6a7d2ce..0000000 --- a/boards/mro/ctrl-zero-h7/src/CMakeLists.txt +++ /dev/null @@ -1,65 +0,0 @@ -############################################################################ -# -# Copyright (c) 2021 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. -# -############################################################################ -if("${PX4_BOARD_LABEL}" STREQUAL "bootloader") - add_library(drivers_board - bootloader_main.c - usb.c - ) - target_link_libraries(drivers_board - PRIVATE - nuttx_arch - nuttx_drivers - bootloader - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/bootloader/common) - -else() - add_library(drivers_board - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - usb.c - ) - - target_link_libraries(drivers_board - PRIVATE - arch_io_pins - arch_spi - drivers__led - nuttx_arch - nuttx_drivers - px4_layer - ) -endif() diff --git a/boards/mro/ctrl-zero-h7/src/board_config.h b/boards/mro/ctrl-zero-h7/src/board_config.h deleted file mode 100644 index cd8f592..0000000 --- a/boards/mro/ctrl-zero-h7/src/board_config.h +++ /dev/null @@ -1,183 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * Board internal definitions - */ - -#pragma once - -#include -#include -#include -#include - -/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */ -#define GPIO_nLED_RED /* PB11 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN11) -#define GPIO_nLED_GREEN /* PB1 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN1) -#define GPIO_nLED_BLUE /* PB3 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN3) - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_OVERLOAD_LED LED_RED -#define BOARD_ARMED_STATE_LED LED_BLUE - -/* ADC channels */ -#define PX4_ADC_GPIO \ - /* PA2 */ GPIO_ADC12_INP14, \ - /* PA3 */ GPIO_ADC12_INP15, \ - /* PA4 */ GPIO_ADC12_INP18, \ - /* PC1 */ GPIO_ADC123_INP11 - -/* Define Channel numbers must match above GPIO pins */ -#define ADC_BATTERY_VOLTAGE_CHANNEL 14 /* PA2 BATT_VOLT_SENS */ -#define ADC_BATTERY_CURRENT_CHANNEL 15 /* PA3 BATT_CURRENT_SENS */ -#define ADC_SCALED_V5_CHANNEL 18 /* PA4 VDD_5V_SENS */ -#define ADC_RC_RSSI_CHANNEL 11 /* PC1 */ - -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY_CURRENT_CHANNEL) | \ - (1 << ADC_SCALED_V5_CHANNEL) | \ - (1 << ADC_RC_RSSI_CHANNEL)) - -/* HW has to large of R termination on ADC todo:change when HW value is chosen */ -#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f) - -/* CAN Silence: Silent mode control */ -#define GPIO_CAN1_SILENT_S0 /* PF5 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTF|GPIO_PIN5) - -/* PWM */ -#define DIRECT_PWM_OUTPUT_CHANNELS 8 - -/* Power supply control and monitoring GPIOs */ -#define GPIO_nPOWER_IN_A /* PB5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5) - -#define GPIO_VDD_BRICK1_VALID GPIO_nPOWER_IN_A /* Brick 1 Is Chosen */ -#define BOARD_NUMBER_BRICKS 1 - -#define GPIO_VDD_3V3_SPEKTRUM_POWER_EN /* PE4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN4) - -/* Define True logic Power Control in arch agnostic form */ -#define VDD_3V3_SPEKTRUM_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SPEKTRUM_POWER_EN, (!on_true)) -#define READ_VDD_3V3_SPEKTRUM_POWER_EN() (px4_arch_gpioread(GPIO_VDD_3V3_SPEKTRUM_POWER_EN) == 0) - -/* Tone alarm output */ -#define TONE_ALARM_TIMER 2 /* timer 2 */ -#define TONE_ALARM_CHANNEL 1 /* PA15 TIM2_CH1 */ - -#define GPIO_BUZZER_1 /* PA15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) - -#define GPIO_TONE_ALARM_IDLE GPIO_BUZZER_1 -#define GPIO_TONE_ALARM GPIO_TIM2_CH1OUT_2 - -/* USB OTG FS */ -#define GPIO_OTGFS_VBUS /* PA9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 3 /* use timer3 for the HRT */ -#define HRT_TIMER_CHANNEL 1 /* use capture/compare channel 1 */ - -#define HRT_PPM_CHANNEL /* T3C3 */ 3 /* use capture/compare channel 3 */ -#define GPIO_PPM_IN /* PB0 T3C3 */ GPIO_TIM3_CH3IN_1 - -/* RC Serial port */ -#define RC_SERIAL_PORT "/dev/ttyS3" - -#define GPIO_RSSI_IN /* PC1 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN1) - -/* Safety Switch: Enable the FMU to control it if there is no px4io fixme:This should be BOARD_SAFETY_LED(__ontrue) */ -#define GPIO_SAFETY_SWITCH_IN /* PC4 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN4) -/* Enable the FMU to use the switch it if there is no px4io fixme:This should be BOARD_SAFTY_BUTTON() */ -#define GPIO_BTN_SAFETY GPIO_SAFETY_SWITCH_IN /* Enable the FMU to control it if there is no px4io */ - -/* Power switch controls ******************************************************/ -#define SPEKTRUM_POWER(_on_true) VDD_3V3_SPEKTRUM_POWER_EN(_on_true) - -/* - * Board has a separate RC_IN - * - * GPIO PPM_IN on PB0 T3CH3 - * SPEKTRUM_RX (it's TX or RX in Bind) on UART6 PC7 - * Inversion is possible in the UART and can drive GPIO_PPM_IN as an output - */ -#define GPIO_PPM_IN_AS_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN0) -#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_PPM_IN_AS_OUT) -#define SPEKTRUM_RX_AS_UART() /* Can be left as uart */ -#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true)) - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_USB_VALID BOARD_ADC_USB_CONNECTED -#define BOARD_ADC_SERVO_VALID (1) /* never powers off the Servo rail */ -#define BOARD_ADC_BRICK_VALID (px4_arch_gpioread(GPIO_VDD_BRICK1_VALID)) - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ -#define BOARD_HAS_ON_RESET 1 - -#define BOARD_HAS_STATIC_MANIFEST 1 - - -#define BOARD_NUM_IO_TIMERS 3 - - -#define BOARD_ENABLE_CONSOLE_BUFFER - -#define PX4_GPIO_INIT_LIST { \ - PX4_ADC_GPIO, \ - GPIO_CAN1_TX, \ - GPIO_CAN1_RX, \ - GPIO_CAN1_SILENT_S0, \ - GPIO_nPOWER_IN_A, \ - GPIO_VDD_3V3_SPEKTRUM_POWER_EN, \ - GPIO_TONE_ALARM_IDLE, \ - GPIO_SAFETY_SWITCH_IN, \ - GPIO_OTGFS_VBUS, \ - } - -__BEGIN_DECLS -#ifndef __ASSEMBLY__ - -extern void stm32_spiinitialize(void); -extern void board_peripheral_reset(int ms); - -#include -#endif /* __ASSEMBLY__ */ -__END_DECLS diff --git a/boards/mro/ctrl-zero-h7/src/bootloader_main.c b/boards/mro/ctrl-zero-h7/src/bootloader_main.c deleted file mode 100644 index 3a0e1a1..0000000 --- a/boards/mro/ctrl-zero-h7/src/bootloader_main.c +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020-2021 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. - * - ****************************************************************************/ - -/** - * @file bootloader_main.c - * - * FMU-specific early startup code for bootloader -*/ - -#include "board_config.h" -#include "bl.h" - -#include -#include -#include -#include -#include -#include "arm_internal.h" -#include - -extern int sercon_main(int c, char **argv); - -__EXPORT void board_on_reset(int status) {} - -__EXPORT void stm32_boardinitialize(void) -{ - /* configure USB interfaces */ - stm32_configgpio(GPIO_OTGFS_VBUS); -} - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - return 0; -} - -void board_late_initialize(void) -{ - sercon_main(0, NULL); -} - -extern void sys_tick_handler(void); -void board_timerhook(void) -{ - sys_tick_handler(); -} diff --git a/boards/mro/ctrl-zero-h7/src/hw_config.h b/boards/mro/ctrl-zero-h7/src/hw_config.h deleted file mode 100644 index 8fdaec9..0000000 --- a/boards/mro/ctrl-zero-h7/src/hw_config.h +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/**************************************************************************** - * 10-8--2016: - * To simplify the ripple effect on the tools, we will be using - * /dev/serial/by-id/PX4 to locate PX4 devices. Therefore - * moving forward all Bootloaders must contain the prefix "PX4 BL " - * in the USBDEVICESTRING - * This Change will be made in an upcoming BL release - ****************************************************************************/ -/* - * Define usage to configure a bootloader - * - * - * Constant example Usage - * APP_LOAD_ADDRESS 0x08004000 - The address in Linker Script, where the app fw is org-ed - * BOOTLOADER_DELAY 5000 - Ms to wait while under USB pwr or bootloader request - * BOARD_FMUV2 - * INTERFACE_USB 1 - (Optional) Scan and use the USB interface for bootloading - * INTERFACE_USART 1 - (Optional) Scan and use the Serial interface for bootloading - * USBDEVICESTRING "PX4 BL FMU v2.x" - USB id string - * USBPRODUCTID 0x0011 - PID Should match defconfig - * BOOT_DELAY_ADDRESS 0x000001a0 - (Optional) From the linker script from Linker Script to get a custom - * delay provided by an APP FW - * BOARD_TYPE 9 - Must match .prototype boad_id - * _FLASH_KBYTES (*(uint16_t *)0x1fff7a22) - Run time flash size detection - * BOARD_FLASH_SECTORS ((_FLASH_KBYTES == 0x400) ? 11 : 23) - Run time determine the physical last sector - * BOARD_FLASH_SECTORS 11 - Hard coded zero based last sector - * BOARD_FLASH_SIZE (_FLASH_KBYTES*1024)- Total Flash size of device, determined at run time. - * (1024 * 1024) - Hard coded Total Flash of device - The bootloader and app reserved will be deducted - * programmatically - * - * BOARD_FIRST_FLASH_SECTOR_TO_ERASE 2 - Optional sectors index in the flash_sectors table (F4 only), to begin erasing. - * This is to allow sectors to be reserved for app fw usage. That will NOT be erased - * during a FW upgrade. - * The default is 0, and selects the first sector to be erased, as the 0th entry in the - * flash_sectors table. Which is the second physical sector of FLASH in the device. - * The first physical sector of FLASH is used by the bootloader, and is not defined - * in the table. - * - * APP_RESERVATION_SIZE (BOARD_FIRST_FLASH_SECTOR_TO_ERASE * 16 * 1024) - Number of bytes reserved by the APP FW. This number plus - * BOOTLOADER_RESERVATION_SIZE will be deducted from - * BOARD_FLASH_SIZE to determine the size of the App FW - * and hence the address space of FLASH to erase and program. - * USBMFGSTRING "PX4 AP" - Optional USB MFG string (default is '3D Robotics' if not defined.) - * SERIAL_BREAK_DETECT_DISABLED - Optional prevent break selection on Serial port from entering or staying in BL - * - * * Other defines are somewhat self explanatory. - */ - -/* Boot device selection list*/ -#define USB0_DEV 0x01 -#define SERIAL0_DEV 0x02 -#define SERIAL1_DEV 0x04 - -#define APP_LOAD_ADDRESS 0x08020000 -#define BOOTLOADER_DELAY 5000 -#define INTERFACE_USB 1 -#define INTERFACE_USB_CONFIG "/dev/ttyACM0" -#define BOARD_VBUS MK_GPIO_INPUT(GPIO_OTGFS_VBUS) - -//#define USE_VBUS_PULL_DOWN -#define INTERFACE_USART 1 -#define INTERFACE_USART_CONFIG "/dev/ttyS0,115200" -#define BOOT_DELAY_ADDRESS 0x000001a0 -#define BOARD_TYPE 1024 -#define _FLASH_KBYTES (*(uint32_t *)0x1FF1E880) -#define BOARD_FLASH_SECTORS (15) -#define BOARD_FLASH_SIZE (_FLASH_KBYTES * 1024) - -#define OSC_FREQ 24 - -#define BOARD_PIN_LED_ACTIVITY GPIO_nLED_RED -#define BOARD_PIN_LED_BOOTLOADER GPIO_nLED_RED -#define BOARD_LED_ON 0 -#define BOARD_LED_OFF 1 - -#define SERIAL_BREAK_DETECT_DISABLED 1 - -#if !defined(ARCH_SN_MAX_LENGTH) -# define ARCH_SN_MAX_LENGTH 12 -#endif - -#if !defined(APP_RESERVATION_SIZE) -# define APP_RESERVATION_SIZE 0 -#endif - -#if !defined(BOARD_FIRST_FLASH_SECTOR_TO_ERASE) -# define BOARD_FIRST_FLASH_SECTOR_TO_ERASE 1 -#endif - -#if !defined(USB_DATA_ALIGN) -# define USB_DATA_ALIGN -#endif - -#ifndef BOOT_DEVICES_SELECTION -# define BOOT_DEVICES_SELECTION USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif - -#ifndef BOOT_DEVICES_FILTER_ONUSB -# define BOOT_DEVICES_FILTER_ONUSB USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif diff --git a/boards/mro/ctrl-zero-h7/src/i2c.cpp b/boards/mro/ctrl-zero-h7/src/i2c.cpp deleted file mode 100644 index e9f26f9..0000000 --- a/boards/mro/ctrl-zero-h7/src/i2c.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), -}; diff --git a/boards/mro/ctrl-zero-h7/src/init.c b/boards/mro/ctrl-zero-h7/src/init.c deleted file mode 100644 index daaace4..0000000 --- a/boards/mro/ctrl-zero-h7/src/init.c +++ /dev/null @@ -1,204 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * board-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. - */ - -#include "board_config.h" - -#include - -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include - -#include - -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - bool last = READ_VDD_3V3_SPEKTRUM_POWER_EN(); - /* Keep Spektum on to discharge rail*/ - VDD_3V3_SPEKTRUM_POWER_EN(false); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ - VDD_3V3_SPEKTRUM_POWER_EN(last); -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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 - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Power on Interfaces */ - board_control_spi_sensors_power(true, 0xffff); - VDD_3V3_SPEKTRUM_POWER_EN(true); - - px4_platform_init(); - - stm32_spiinitialize(); - - /* configure the DMA allocator */ - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_on(LED_GREEN); // Indicate Power. - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - -#ifdef CONFIG_MMCSD - /* Mount the SDIO-based MMC/SD block driver */ - /* First, get an instance of the SDIO interface */ - struct sdio_dev_s *sdio_dev = sdio_initialize(0); // SDIO_SLOTNO 0 Only one slot - - if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", 0); - } - - if (mmcsd_slotinitialize(0, sdio_dev) != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver\n"); - } - - /* Assume that the SD card is inserted. What choice do we have? */ - sdio_mediachange(sdio_dev, true); -#endif /* CONFIG_MMCSD */ - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/mro/ctrl-zero-h7/src/led.c b/boards/mro/ctrl-zero-h7/src/led.c deleted file mode 100644 index 0e7beb3..0000000 --- a/boards/mro/ctrl-zero-h7/src/led.c +++ /dev/null @@ -1,111 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -static uint32_t g_ledmap[] = { - GPIO_nLED_BLUE, // Indexed by LED_BLUE - GPIO_nLED_RED, // Indexed by LED_RED - GPIO_nLED_GREEN, // Indexed by LED_GREEN -}; - -__EXPORT void led_init(void) -{ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - if (g_ledmap[l] != 0) { - stm32_configgpio(g_ledmap[l]); - } - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - if (g_ledmap[led] != 0) { - stm32_gpiowrite(g_ledmap[led], !state); - } -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - if (g_ledmap[led] != 0) { - return !stm32_gpioread(g_ledmap[led]); - } - - return false; -} - -__EXPORT void led_on(int led) -{ - phy_set_led(led, true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(led, false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(led, !phy_get_led(led)); -} diff --git a/boards/mro/ctrl-zero-h7/src/spi.cpp b/boards/mro/ctrl-zero-h7/src/spi.cpp deleted file mode 100644 index 4a4c350..0000000 --- a/boards/mro/ctrl-zero-h7/src/spi.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20948, SPI::CS{GPIO::PortE, GPIO::Pin15}, SPI::DRDY{GPIO::PortE, GPIO::Pin12}), - }, {GPIO::PortE, GPIO::Pin3}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10}), - initSPIDevice(DRV_BARO_DEVTYPE_DPS310, SPI::CS{GPIO::PortD, GPIO::Pin7}), - }), - initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(DRV_GYR_DEVTYPE_BMI088, SPI::CS{GPIO::PortF, GPIO::Pin10}, SPI::DRDY{GPIO::PortF, GPIO::Pin3}), - initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::PortF, GPIO::Pin6}, SPI::DRDY{GPIO::PortF, GPIO::Pin1}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/mro/ctrl-zero-h7/src/timer_config.cpp b/boards/mro/ctrl-zero-h7/src/timer_config.cpp deleted file mode 100644 index e238804..0000000 --- a/boards/mro/ctrl-zero-h7/src/timer_config.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1, DMA{DMA::Index1}), - initIOTimer(Timer::Timer4, DMA{DMA::Index1}), - initIOTimer(Timer::Timer8, DMA{DMA::Index1}), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortE, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer8, Timer::Channel1}, {GPIO::PortI, GPIO::Pin5}), - initIOTimerChannel(io_timers, {Timer::Timer8, Timer::Channel2}, {GPIO::PortI, GPIO::Pin6}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/mro/ctrl-zero-h7/src/usb.c b/boards/mro/ctrl-zero-h7/src/usb.c deleted file mode 100644 index fe32ce7..0000000 --- a/boards/mro/ctrl-zero-h7/src/usb.c +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include "board_config.h" - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ -__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_STM32H7_OTGFS - stm32_configgpio(GPIO_OTGFS_VBUS); -#endif -} - - - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/mro/pixracerpro/bootloader.px4board b/boards/mro/pixracerpro/bootloader.px4board deleted file mode 100644 index 19b6e66..0000000 --- a/boards/mro/pixracerpro/bootloader.px4board +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_ROMFSROOT="" diff --git a/boards/mro/pixracerpro/default.px4board b/boards/mro/pixracerpro/default.px4board deleted file mode 100644 index d4b1d29..0000000 --- a/boards/mro/pixracerpro/default.px4board +++ /dev/null @@ -1,96 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS3" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS2" -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_BAROMETER_DPS310=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_BOSCH_BMI085=y -CONFIG_DRIVERS_IMU_BOSCH_BMI088=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UUV_ATT_CONTROL=y -CONFIG_MODULES_UUV_POS_CONTROL=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SERIAL_TEST=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/mro/pixracerpro/extras/mro_pixracerpro_bootloader.bin b/boards/mro/pixracerpro/extras/mro_pixracerpro_bootloader.bin deleted file mode 100755 index 5882bee..0000000 Binary files a/boards/mro/pixracerpro/extras/mro_pixracerpro_bootloader.bin and /dev/null differ diff --git a/boards/mro/pixracerpro/firmware.prototype b/boards/mro/pixracerpro/firmware.prototype deleted file mode 100644 index 853d81f..0000000 --- a/boards/mro/pixracerpro/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 1017, - "magic": "PX4FWv1", - "description": "Firmware for the mRo Pixracer Pro board", - "image": "", - "build_time": 0, - "summary": "PixracerPro", - "version": "0.1", - "image_size": 0, - "image_maxsize": 1966080, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/mro/pixracerpro/init/rc.board_defaults b/boards/mro/pixracerpro/init/rc.board_defaults deleted file mode 100644 index 9c0d8e4..0000000 --- a/boards/mro/pixracerpro/init/rc.board_defaults +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 10.1 -param set-default BAT1_A_PER_V 17 diff --git a/boards/mro/pixracerpro/init/rc.board_extras b/boards/mro/pixracerpro/init/rc.board_extras deleted file mode 100644 index ccf9223..0000000 --- a/boards/mro/pixracerpro/init/rc.board_extras +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# -# board specific extras init -#------------------------------------------------------------------------------ - -# Run FrSky Telemetry on Pixracer on the FrSky port if not enabled already -if param compare TEL_FRSKY_CONFIG 0 -then - frsky_telemetry start -d /dev/ttyS6 -t 15 -fi diff --git a/boards/mro/pixracerpro/init/rc.board_sensors b/boards/mro/pixracerpro/init/rc.board_sensors deleted file mode 100644 index a73708e..0000000 --- a/boards/mro/pixracerpro/init/rc.board_sensors +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# board specific sensors init -#------------------------------------------------------------------------------ -board_adc start - -# Internal ICM-20602 -icm20602 -s -b 1 -R 8 start - -# Internal SPI bus BMI088 accel & gyro -if bmi088 -A -s -b 5 -R 8 start -then - bmi088 -G -s -b 5 -R 8 start -else - # otherwise try BMI085 - bmi085 -A -s -b 5 -R 8 start - bmi085 -G -s -b 5 -R 8 start -fi - -# Internal ICM-20948 (with magnetometer) -icm20948 -s -b 1 -R 8 -M start - -# Interal DPS310 (barometer) -dps310 -s -b 2 start diff --git a/boards/mro/pixracerpro/nuttx-config/bootloader/defconfig b/boards/mro/pixracerpro/nuttx-config/bootloader/defconfig deleted file mode 100644 index d34cea0..0000000 --- a/boards/mro/pixracerpro/nuttx-config/bootloader/defconfig +++ /dev/null @@ -1,90 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_CONSOLE is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_SPI_EXCHANGE is not set -# CONFIG_STM32H7_SYSCFG is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/mro/pixracerpro/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743II=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_INITTHREAD_PRIORITY=254 -CONFIG_BOARD_LATE_INITIALIZE=y -CONFIG_BOARD_LOOPSPERMSEC=95150 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x1017 -CONFIG_CDCACM_PRODUCTSTR="PX4 BL mRo Pixracer Pro" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="mRo" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_EXPERIMENTAL=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="bootloader_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SPI=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_USART3=y -CONFIG_SYSTEMTICK_HOOK=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGINT_CHAR=0x03 -CONFIG_TTY_SIGTSTP=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/mro/pixracerpro/nuttx-config/include/board.h b/boards/mro/pixracerpro/nuttx-config/include/board.h deleted file mode 100644 index 2377d52..0000000 --- a/boards/mro/pixracerpro/nuttx-config/include/board.h +++ /dev/null @@ -1,280 +0,0 @@ -/************************************************************************************ - * nuttx-config/include/board.h - * - * Copyright (C) 2020 Gregory Nutt. All rights reserved. - * Authors: David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ -#pragma once - -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/* Clocking *************************************************************************/ -/* The board provides the following clock sources: - * - * X1: 24 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 16 MHz RC factory-trimmed internal oscillator - * HSE: 24 MHz crystal for HSE - */ -#define STM32_BOARD_XTAL 24000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 0 - -/* Main PLL Configuration. - * - * PLL source is HSE = 24,000,000 - * - * PLL_VCOx = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 1 <= PLLM <= 63 - * 4 <= PLLN <= 512 - * 150 MHz <= PLL_VCOL <= 420MHz - * 192 MHz <= PLL_VCOH <= 836MHz - * - * SYSCLK = PLL_VCO / PLLP - * CPUCLK = SYSCLK / D1CPRE - * Subject to - * - * PLLP1 = {2, 4, 6, 8, ..., 128} - * PLLP2,3 = {2, 3, 4, ..., 128} - * CPUCLK <= 480 MHz - */ -#define STM32_PLLCFG_PLLSRC RCC_PLLCKSELR_PLLSRC_HSE - -/* PLL1, wide 4 - 8 MHz input, enable DIVP, DIVQ, DIVR - * - * PLL1_VCO = (24,000,000 / 2) * 80 = 960 MHz - * - * PLL1P = PLL1_VCO/2 = 960 MHz / 2 = 480 MHz - * PLL1Q = PLL1_VCO/4 = 960 MHz / 4 = 240 MHz - * PLL1R = PLL1_VCO/8 = 960 MHz / 8 = 120 MHz - */ -#define STM32_PLLCFG_PLL1CFG (RCC_PLLCFGR_PLL1VCOSEL_WIDE|RCC_PLLCFGR_PLL1RGE_4_8_MHZ|RCC_PLLCFGR_DIVP1EN|RCC_PLLCFGR_DIVQ1EN|RCC_PLLCFGR_DIVR1EN) -#define STM32_PLLCFG_PLL1M RCC_PLLCKSELR_DIVM1(2) -#define STM32_PLLCFG_PLL1N RCC_PLL1DIVR_N1(80) -#define STM32_PLLCFG_PLL1P RCC_PLL1DIVR_P1(2) -#define STM32_PLLCFG_PLL1Q RCC_PLL1DIVR_Q1(4) -#define STM32_PLLCFG_PLL1R RCC_PLL1DIVR_R1(8) - -#define STM32_VCO1_FREQUENCY ((STM32_HSE_FREQUENCY / 2) * 80) -#define STM32_PLL1P_FREQUENCY (STM32_VCO1_FREQUENCY / 2) -#define STM32_PLL1Q_FREQUENCY (STM32_VCO1_FREQUENCY / 4) -#define STM32_PLL1R_FREQUENCY (STM32_VCO1_FREQUENCY / 8) - -/* PLL2 */ -#define STM32_PLLCFG_PLL2CFG (RCC_PLLCFGR_PLL2VCOSEL_WIDE|RCC_PLLCFGR_PLL2RGE_4_8_MHZ|RCC_PLLCFGR_DIVP2EN|RCC_PLLCFGR_DIVQ2EN|RCC_PLLCFGR_DIVR2EN) -#define STM32_PLLCFG_PLL2M RCC_PLLCKSELR_DIVM2(4) -#define STM32_PLLCFG_PLL2N RCC_PLL2DIVR_N2(32) -#define STM32_PLLCFG_PLL2P RCC_PLL2DIVR_P2(2) -#define STM32_PLLCFG_PLL2Q RCC_PLL2DIVR_Q2(2) -#define STM32_PLLCFG_PLL2R RCC_PLL2DIVR_R2(2) - -#define STM32_VCO2_FREQUENCY ((STM32_HSE_FREQUENCY / 4) * 32) -#define STM32_PLL2P_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2Q_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2R_FREQUENCY (STM32_VCO2_FREQUENCY / 2) - -/* PLL3 */ -#define STM32_PLLCFG_PLL3CFG (RCC_PLLCFGR_PLL3VCOSEL_WIDE|RCC_PLLCFGR_PLL3RGE_4_8_MHZ|RCC_PLLCFGR_DIVQ3EN) -#define STM32_PLLCFG_PLL3M RCC_PLLCKSELR_DIVM3(4) -#define STM32_PLLCFG_PLL3N RCC_PLL3DIVR_N3(32) -#define STM32_PLLCFG_PLL3P RCC_PLL3DIVR_P3(2) -#define STM32_PLLCFG_PLL3Q RCC_PLL3DIVR_Q3(4) -#define STM32_PLLCFG_PLL3R RCC_PLL3DIVR_R3(2) - -#define STM32_VCO3_FREQUENCY ((STM32_HSE_FREQUENCY / 4) * 32) -#define STM32_PLL3P_FREQUENCY (STM32_VCO3_FREQUENCY / 2) -#define STM32_PLL3Q_FREQUENCY (STM32_VCO3_FREQUENCY / 4) -#define STM32_PLL3R_FREQUENCY (STM32_VCO3_FREQUENCY / 2) - -/* SYSCLK = PLL1P = 480MHz - * CPUCLK = SYSCLK / 1 = 480 MHz - */ -#define STM32_RCC_D1CFGR_D1CPRE (RCC_D1CFGR_D1CPRE_SYSCLK) -#define STM32_SYSCLK_FREQUENCY (STM32_PLL1P_FREQUENCY) -#define STM32_CPUCLK_FREQUENCY (STM32_SYSCLK_FREQUENCY / 1) - -/* Configure Clock Assignments */ - -/* AHB clock (HCLK) is SYSCLK/2 (240 MHz max) - * HCLK1 = HCLK2 = HCLK3 = HCLK4 = 240 - */ -#define STM32_RCC_D1CFGR_HPRE RCC_D1CFGR_HPRE_SYSCLKd2 /* HCLK = SYSCLK / 2 */ -#define STM32_ACLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* ACLK in D1, HCLK3 in D1 */ -#define STM32_HCLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* HCLK in D2, HCLK4 in D3 */ -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/2 (120 MHz) */ -#define STM32_RCC_D2CFGR_D2PPRE1 RCC_D2CFGR_D2PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB2 clock (PCLK2) is HCLK/2 (120 MHz) */ -#define STM32_RCC_D2CFGR_D2PPRE2 RCC_D2CFGR_D2PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB3 clock (PCLK3) is HCLK/2 (120 MHz) */ -#define STM32_RCC_D1CFGR_D1PPRE RCC_D1CFGR_D1PPRE_HCLKd2 /* PCLK3 = HCLK / 2 */ -#define STM32_PCLK3_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB4 clock (PCLK4) is HCLK/4 (120 MHz) */ -#define STM32_RCC_D3CFGR_D3PPRE RCC_D3CFGR_D3PPRE_HCLKd2 /* PCLK4 = HCLK / 2 */ -#define STM32_PCLK4_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timer clock frequencies */ - -/* Timers driven from APB1 will be twice PCLK1 */ -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* Timers driven from APB2 will be twice PCLK2 */ -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM15_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM16_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM17_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Kernel Clock Configuration - * Note: look at Table 54 in ST Manual - */ -#define STM32_RCC_D2CCIP2R_I2C123SRC RCC_D2CCIP2R_I2C123SEL_HSI /* I2C123 clock source */ -#define STM32_RCC_D2CCIP1R_SPI123SRC RCC_D2CCIP1R_SPI123SEL_PLL2 /* SPI123 clock source */ -#define STM32_RCC_D2CCIP1R_SPI45SRC RCC_D2CCIP1R_SPI45SEL_PLL2 /* SPI45 clock source */ -#define STM32_RCC_D3CCIPR_SPI6SRC RCC_D3CCIPR_SPI6SEL_PLL2 /* SPI6 clock source */ -#define STM32_RCC_D2CCIP2R_USBSRC RCC_D2CCIP2R_USBSEL_PLL3 /* USB 1 and 2 clock source */ -#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2 /* ADC 1 2 3 clock source */ -#define STM32_RCC_D2CCIP1R_FDCANSEL RCC_D2CCIP1R_FDCANSEL_HSE /* FDCAN 1 2 clock source */ - -#define STM32_FDCANCLK STM32_HSE_FREQUENCY - -/* FLASH wait states */ -#define BOARD_FLASH_WAITSTATES 2 - -/* SDMMC definitions ********************************************************/ -/* Init 400kHz, freq = PLL1Q/(2*div) div = PLL1Q/(2*freq) */ -#define STM32_SDMMC_INIT_CLKDIV (300 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* 25 MHz Max for now, 25 mHZ = PLL1Q/(2*div), div = PLL1Q/(2*freq) - * div = 4.8 = 240 / 50, So round up to 5 for default speed 24 MB/s - */ -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_MMCXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_SDXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - - -/* UART/USART */ -#define GPIO_USART1_TX GPIO_USART1_TX_3 /* PB6 */ -#define GPIO_USART1_RX GPIO_USART1_RX_3 /* PB7 */ - -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ -#define GPIO_USART2_RX GPIO_USART2_RX_2 /* PD6 */ -#define GPIO_USART2_CTS GPIO_USART2_CTS_NSS_2 /* PD3 */ -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 /* PD4 */ - -#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ -#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ -#define GPIO_USART3_CTS GPIO_USART3_CTS_NSS_2 /* PD11 */ -#define GPIO_USART3_RTS GPIO_USART3_RTS_2 /* PD12 */ - -#define GPIO_UART4_TX GPIO_UART4_TX_2 /* PA0 */ -#define GPIO_UART4_RX GPIO_UART4_RX_2 /* PA1 */ - -#define GPIO_USART6_TX 0 /* USART6 is RX-only */ -#define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC7 */ - -#define GPIO_UART7_TX GPIO_UART7_TX_3 /* PE8 */ -#define GPIO_UART7_RX GPIO_UART7_RX_3 /* PE7 */ - -#define GPIO_UART8_TX GPIO_UART8_TX_1 /* PE1 */ -#define GPIO_UART8_RX GPIO_UART8_RX_1 /* PE0 */ - - -/* CAN */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 /* PD0 */ -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 /* PD1 */ - -#define GPIO_CAN2_RX GPIO_CAN2_RX_1 /* PB12 */ -#define GPIO_CAN2_TX GPIO_CAN2_TX_1 /* PB13 */ - - -/* SPI */ -#define ADJ_SLEW_RATE(p) (((p) & ~GPIO_SPEED_MASK) | (GPIO_SPEED_2MHz)) - -#define GPIO_SPI1_SCK ADJ_SLEW_RATE(GPIO_SPI1_SCK_1) /* PA5 */ -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 /* PA7 */ - -#define GPIO_SPI2_SCK ADJ_SLEW_RATE(GPIO_SPI2_SCK_3) /* PB10 */ -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 /* PB14 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 /* PB15 */ - -#define GPIO_SPI5_SCK ADJ_SLEW_RATE(GPIO_SPI5_SCK_1) /* PF7 */ -#define GPIO_SPI5_MISO GPIO_SPI5_MISO_1 /* PF8 */ -#define GPIO_SPI5_MOSI GPIO_SPI5_MOSI_2 /* PF9 */ - -#define GPIO_SPI6_SCK ADJ_SLEW_RATE(GPIO_SPI6_SCK_1) /* PG13 */ -#define GPIO_SPI6_MISO GPIO_SPI6_MISO_1 /* PG12 */ -#define GPIO_SPI6_MOSI GPIO_SPI6_MOSI_1 /* PG14 */ - - -/* I2C */ -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 /* PB8 */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 /* PB9 */ diff --git a/boards/mro/pixracerpro/nuttx-config/include/board_dma_map.h b/boards/mro/pixracerpro/nuttx-config/include/board_dma_map.h deleted file mode 100644 index ebbf689..0000000 --- a/boards/mro/pixracerpro/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -// DMAMUX1 -#define DMAMAP_SPI1_RX DMAMAP_DMA12_SPI1RX_0 /* DMA1:37 */ -#define DMAMAP_SPI1_TX DMAMAP_DMA12_SPI1TX_0 /* DMA1:38 */ - -#define DMAMAP_SPI2_RX DMAMAP_DMA12_SPI2RX_0 /* DMA1:39 */ -#define DMAMAP_SPI2_TX DMAMAP_DMA12_SPI2TX_0 /* DMA1:40 */ - -#define DMAMAP_SPI5_RX DMAMAP_DMA12_SPI5RX_0 /* DMA1:85 */ -#define DMAMAP_SPI5_TX DMAMAP_DMA12_SPI5TX_0 /* DMA1:86 */ - -// BDMA -#define DMAMAP_SPI6_RX DMAMAP_BDMA_SPI6_RX /* BDMA:11 */ -#define DMAMAP_SPI6_TX DMAMAP_BDMA_SPI6_TX /* BDMA:12 */ diff --git a/boards/mro/pixracerpro/nuttx-config/nsh/defconfig b/boards/mro/pixracerpro/nuttx-config/nsh/defconfig deleted file mode 100644 index 1044613..0000000 --- a/boards/mro/pixracerpro/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,258 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/mro/pixracerpro/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743II=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=95150 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x1017 -CONFIG_CDCACM_PRODUCTSTR="mRoPixracerPro" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="mRo" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXPERIMENTAL=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=4 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_PROGMEM=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32H7_ADC1=y -CONFIG_STM32H7_ADC3=y -CONFIG_STM32H7_BBSRAM=y -CONFIG_STM32H7_BBSRAM_FILES=5 -CONFIG_STM32H7_BDMA=y -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_DMA2=y -CONFIG_STM32H7_DMACAPABLE=y -CONFIG_STM32H7_FLOWCONTROL_BROKEN=y -CONFIG_STM32H7_I2C1=y -CONFIG_STM32H7_I2C_DYNTIMEO=y -CONFIG_STM32H7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_RTC=y -CONFIG_STM32H7_RTC_HSECLOCK=y -CONFIG_STM32H7_RTC_MAGIC_REG=1 -CONFIG_STM32H7_SAVE_CRASHDUMP=y -CONFIG_STM32H7_SDMMC1=y -CONFIG_STM32H7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_SPI1=y -CONFIG_STM32H7_SPI1_DMA=y -CONFIG_STM32H7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32H7_SPI2=y -CONFIG_STM32H7_SPI5=y -CONFIG_STM32H7_SPI5_DMA=y -CONFIG_STM32H7_SPI5_DMA_BUFFER=1024 -CONFIG_STM32H7_SPI6=y -CONFIG_STM32H7_SPI6_DMA=y -CONFIG_STM32H7_SPI6_DMA_BUFFER=1024 -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_TIM3=y -CONFIG_STM32H7_TIM4=y -CONFIG_STM32H7_UART4=y -CONFIG_STM32H7_UART7=y -CONFIG_STM32H7_UART8=y -CONFIG_STM32H7_USART1=y -CONFIG_STM32H7_USART2=y -CONFIG_STM32H7_USART3=y -CONFIG_STM32H7_USART6=y -CONFIG_STM32H7_USART_BREAKS=y -CONFIG_STM32H7_USART_INVERT=y -CONFIG_STM32H7_USART_SINGLEWIRE=y -CONFIG_STM32H7_USART_SWAP=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGTSTP=y -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_TXBUFSIZE=3000 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 -CONFIG_WATCHDOG=y diff --git a/boards/mro/pixracerpro/nuttx-config/scripts/bootloader_script.ld b/boards/mro/pixracerpro/nuttx-config/scripts/bootloader_script.ld deleted file mode 100644 index 0b9772c..0000000 --- a/boards/mro/pixracerpro/nuttx-config/scripts/bootloader_script.ld +++ /dev/null @@ -1,212 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2020 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The board uses an STM32H743II has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * There's a switch on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the switch is - * drepresed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743ZI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 128K - DTCM1_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - DTCM2_RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */ - SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */ - SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */ - BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > AXI_SRAM AT > FLASH - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > AXI_SRAM - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/mro/pixracerpro/nuttx-config/scripts/script.ld b/boards/mro/pixracerpro/nuttx-config/scripts/script.ld deleted file mode 100644 index 5102235..0000000 --- a/boards/mro/pixracerpro/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,228 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2020 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The board uses an STM32H743II has 2048Kb of main FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * There's a switch on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the switch is - * drepresed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743ZI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - FLASH (rx) : ORIGIN = 0x08020000, LENGTH = 1920K - - DTCM1_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - DTCM2_RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 64K - AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */ - SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */ - SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */ - SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */ - BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH - - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - - /* Pad out last section as the STM32H7 Flash write size is 256 bits. 32 bytes */ - . = ALIGN(16); - FILL(0xffff) - . += 16; - } > AXI_SRAM AT > FLASH = 0xffff - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > AXI_SRAM - - /* Emit the the D3 power domain section for locating BDMA data */ - - .sram4_reserve (NOLOAD) : - { - *(.sram4) - . = ALIGN(4); - _sram4_heap_start = ABSOLUTE(.); - } > SRAM4 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/mro/pixracerpro/src/CMakeLists.txt b/boards/mro/pixracerpro/src/CMakeLists.txt deleted file mode 100644 index c8e7699..0000000 --- a/boards/mro/pixracerpro/src/CMakeLists.txt +++ /dev/null @@ -1,65 +0,0 @@ -############################################################################ -# -# Copyright (c) 2020 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. -# -############################################################################ -if("${PX4_BOARD_LABEL}" STREQUAL "bootloader") - add_library(drivers_board - bootloader_main.c - usb.c - ) - target_link_libraries(drivers_board - PRIVATE - nuttx_arch - nuttx_drivers - bootloader - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/bootloader/common) - -else() - add_library(drivers_board - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - usb.c - ) - - target_link_libraries(drivers_board - PRIVATE - arch_io_pins - arch_spi - drivers__led - nuttx_arch - nuttx_drivers - px4_layer - ) -endif() diff --git a/boards/mro/pixracerpro/src/board_config.h b/boards/mro/pixracerpro/src/board_config.h deleted file mode 100644 index 0d067bb..0000000 --- a/boards/mro/pixracerpro/src/board_config.h +++ /dev/null @@ -1,182 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020-2021 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * Board internal definitions - */ - -#pragma once - -#include -#include -#include -#include - -/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */ -#define GPIO_nLED_RED /* PB11 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN11) -#define GPIO_nLED_GREEN /* PB1 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN1) -#define GPIO_nLED_BLUE /* PB3 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN3) - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_OVERLOAD_LED LED_RED -#define BOARD_ARMED_STATE_LED LED_BLUE - -/* ADC channels */ -#define PX4_ADC_GPIO \ - /* PA2 */ GPIO_ADC12_INP14, \ - /* PA3 */ GPIO_ADC12_INP15, \ - /* PA4 */ GPIO_ADC12_INP18, \ - /* PC1 */ GPIO_ADC123_INP11 - -/* Define Channel numbers must match above GPIO pins */ -#define ADC_BATTERY_VOLTAGE_CHANNEL 14 /* PA2 BATT_VOLT_SENS */ -#define ADC_BATTERY_CURRENT_CHANNEL 15 /* PA3 BATT_CURRENT_SENS */ -#define ADC_SCALED_V5_CHANNEL 18 /* PA4 VDD_5V_SENS */ -#define ADC_RC_RSSI_CHANNEL 11 /* PC1 */ - -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY_CURRENT_CHANNEL) | \ - (1 << ADC_SCALED_V5_CHANNEL) | \ - (1 << ADC_RC_RSSI_CHANNEL)) - -/* HW has to large of R termination on ADC todo:change when HW value is chosen */ -#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f) - -/* CAN Silence: Silent mode control */ -#define GPIO_CAN1_SILENT_S0 /* PF11 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTF|GPIO_PIN11) -#define GPIO_CAN2_SILENT_S0 /* PF14 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTF|GPIO_PIN14) - -#define GPIO_LEVEL_SHIFTER_OE /* PI3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTI|GPIO_PIN3) -#define GPIO_PWM_VOLT_SEL /* PG6 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN6) - -/* PWM */ -#define DIRECT_PWM_OUTPUT_CHANNELS 8 - -/* Power supply control and monitoring GPIOs */ -#define GPIO_POWER_IN_A /* PB5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5) - -#define GPIO_VDD_BRICK1_VALID GPIO_POWER_IN_A /* Brick 1 Is Chosen */ -#define BOARD_NUMBER_BRICKS 1 - -#define GPIO_VDD_3V3_SPEKTRUM_POWER_EN /* PE4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN4) - -/* Define True logic Power Control in arch agnostic form */ -#define VDD_3V3_SPEKTRUM_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SPEKTRUM_POWER_EN, (!on_true)) -#define READ_VDD_3V3_SPEKTRUM_POWER_EN() (px4_arch_gpioread(GPIO_VDD_3V3_SPEKTRUM_POWER_EN) == 0) - -/* Tone alarm output */ -#define TONE_ALARM_TIMER 2 /* timer 2 */ -#define TONE_ALARM_CHANNEL 1 /* PA15 TIM2_CH1 */ - -#define GPIO_BUZZER_1 /* PA15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) // ALARM - -#define GPIO_TONE_ALARM_IDLE GPIO_BUZZER_1 -#define GPIO_TONE_ALARM GPIO_TIM2_CH1OUT_2 - -/* USB OTG FS */ -#define GPIO_OTGFS_VBUS /* PA9 */ (GPIO_INPUT|GPIO_OPENDRAIN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 3 /* use timer3 for the HRT */ -#define HRT_TIMER_CHANNEL 2 /* use capture/compare channel 2 */ - -#define HRT_PPM_CHANNEL /* T3C3 */ 3 /* use capture/compare channel 3 */ -#define GPIO_PPM_IN /* PB0 T3C3 */ GPIO_TIM3_CH3IN_1 - -/* RC Serial port */ -#define RC_SERIAL_PORT "/dev/ttyS4" -#define BOARD_SUPPORTS_RC_SERIAL_PORT_OUTPUT - -#define GPIO_RSSI_IN /* PC1 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN1) - -/* Power switch controls ******************************************************/ -#define SPEKTRUM_POWER(_on_true) VDD_3V3_SPEKTRUM_POWER_EN(_on_true) - -/* - * Board has a separate RC_IN - * - * GPIO PPM_IN on PB0 T3CH3 - * SPEKTRUM_RX (it's TX or RX in Bind) on UART6 PC7 - * Inversion is possible in the UART and can drive GPIO_PPM_IN as an output - */ -#define GPIO_PPM_IN_AS_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN0) -#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_PPM_IN_AS_OUT) -#define SPEKTRUM_RX_AS_UART() /* Can be left as uart */ -#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true)) - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_USB_VALID BOARD_ADC_USB_CONNECTED -#define BOARD_ADC_BRICK_VALID (px4_arch_gpioread(GPIO_VDD_BRICK1_VALID)) - -#define BOARD_NUM_IO_TIMERS 3 -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 /* This board provides a DMA pool and APIs */ -#define BOARD_HAS_ON_RESET 1 /* This board provides the board_on_reset interface */ -#define BOARD_ENABLE_CONSOLE_BUFFER - -#define PX4_GPIO_INIT_LIST { \ - PX4_ADC_GPIO, \ - GPIO_CAN1_TX, \ - GPIO_CAN1_RX, \ - GPIO_CAN2_TX, \ - GPIO_CAN2_RX, \ - GPIO_CAN1_SILENT_S0, \ - GPIO_CAN2_SILENT_S0, \ - GPIO_LEVEL_SHIFTER_OE, \ - GPIO_PWM_VOLT_SEL, \ - GPIO_POWER_IN_A, \ - GPIO_VDD_3V3_SPEKTRUM_POWER_EN, \ - PX4_GPIO_PIN_OFF(GPIO_SDMMC1_D0), \ - PX4_GPIO_PIN_OFF(GPIO_SDMMC1_D1), \ - PX4_GPIO_PIN_OFF(GPIO_SDMMC1_D2), \ - PX4_GPIO_PIN_OFF(GPIO_SDMMC1_D3), \ - PX4_GPIO_PIN_OFF(GPIO_SDMMC1_CMD),\ - GPIO_TONE_ALARM_IDLE, \ - GPIO_OTGFS_VBUS, \ - } - -__BEGIN_DECLS -#ifndef __ASSEMBLY__ - -extern void stm32_spiinitialize(void); -extern void board_peripheral_reset(int ms); - -#include -#endif /* __ASSEMBLY__ */ -__END_DECLS diff --git a/boards/mro/pixracerpro/src/bootloader_main.c b/boards/mro/pixracerpro/src/bootloader_main.c deleted file mode 100644 index 3a0e1a1..0000000 --- a/boards/mro/pixracerpro/src/bootloader_main.c +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020-2021 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. - * - ****************************************************************************/ - -/** - * @file bootloader_main.c - * - * FMU-specific early startup code for bootloader -*/ - -#include "board_config.h" -#include "bl.h" - -#include -#include -#include -#include -#include -#include "arm_internal.h" -#include - -extern int sercon_main(int c, char **argv); - -__EXPORT void board_on_reset(int status) {} - -__EXPORT void stm32_boardinitialize(void) -{ - /* configure USB interfaces */ - stm32_configgpio(GPIO_OTGFS_VBUS); -} - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - return 0; -} - -void board_late_initialize(void) -{ - sercon_main(0, NULL); -} - -extern void sys_tick_handler(void); -void board_timerhook(void) -{ - sys_tick_handler(); -} diff --git a/boards/mro/pixracerpro/src/hw_config.h b/boards/mro/pixracerpro/src/hw_config.h deleted file mode 100644 index bb07469..0000000 --- a/boards/mro/pixracerpro/src/hw_config.h +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/**************************************************************************** - * 10-8--2016: - * To simplify the ripple effect on the tools, we will be using - * /dev/serial/by-id/PX4 to locate PX4 devices. Therefore - * moving forward all Bootloaders must contain the prefix "PX4 BL " - * in the USBDEVICESTRING - * This Change will be made in an upcoming BL release - ****************************************************************************/ -/* - * Define usage to configure a bootloader - * - * - * Constant example Usage - * APP_LOAD_ADDRESS 0x08004000 - The address in Linker Script, where the app fw is org-ed - * BOOTLOADER_DELAY 5000 - Ms to wait while under USB pwr or bootloader request - * BOARD_FMUV2 - * INTERFACE_USB 1 - (Optional) Scan and use the USB interface for bootloading - * INTERFACE_USART 1 - (Optional) Scan and use the Serial interface for bootloading - * USBDEVICESTRING "PX4 BL FMU v2.x" - USB id string - * USBPRODUCTID 0x0011 - PID Should match defconfig - * BOOT_DELAY_ADDRESS 0x000001a0 - (Optional) From the linker script from Linker Script to get a custom - * delay provided by an APP FW - * BOARD_TYPE 9 - Must match .prototype boad_id - * _FLASH_KBYTES (*(uint16_t *)0x1fff7a22) - Run time flash size detection - * BOARD_FLASH_SECTORS ((_FLASH_KBYTES == 0x400) ? 11 : 23) - Run time determine the physical last sector - * BOARD_FLASH_SECTORS 11 - Hard coded zero based last sector - * BOARD_FLASH_SIZE (_FLASH_KBYTES*1024)- Total Flash size of device, determined at run time. - * (1024 * 1024) - Hard coded Total Flash of device - The bootloader and app reserved will be deducted - * programmatically - * - * BOARD_FIRST_FLASH_SECTOR_TO_ERASE 2 - Optional sectors index in the flash_sectors table (F4 only), to begin erasing. - * This is to allow sectors to be reserved for app fw usage. That will NOT be erased - * during a FW upgrade. - * The default is 0, and selects the first sector to be erased, as the 0th entry in the - * flash_sectors table. Which is the second physical sector of FLASH in the device. - * The first physical sector of FLASH is used by the bootloader, and is not defined - * in the table. - * - * APP_RESERVATION_SIZE (BOARD_FIRST_FLASH_SECTOR_TO_ERASE * 16 * 1024) - Number of bytes reserved by the APP FW. This number plus - * BOOTLOADER_RESERVATION_SIZE will be deducted from - * BOARD_FLASH_SIZE to determine the size of the App FW - * and hence the address space of FLASH to erase and program. - * USBMFGSTRING "PX4 AP" - Optional USB MFG string (default is '3D Robotics' if not defined.) - * SERIAL_BREAK_DETECT_DISABLED - Optional prevent break selection on Serial port from entering or staying in BL - * - * * Other defines are somewhat self explanatory. - */ - -/* Boot device selection list*/ -#define USB0_DEV 0x01 -#define SERIAL0_DEV 0x02 -#define SERIAL1_DEV 0x04 - -#define APP_LOAD_ADDRESS 0x08020000 -#define BOOTLOADER_DELAY 5000 -#define INTERFACE_USB 1 -#define INTERFACE_USB_CONFIG "/dev/ttyACM0" -#define BOARD_VBUS MK_GPIO_INPUT(GPIO_OTGFS_VBUS) - -//#define USE_VBUS_PULL_DOWN -#define INTERFACE_USART 1 -#define INTERFACE_USART_CONFIG "/dev/ttyS0,115200" -#define BOOT_DELAY_ADDRESS 0x000001a0 -#define BOARD_TYPE 1017 -#define _FLASH_KBYTES (*(uint32_t *)0x1FF1E880) -#define BOARD_FLASH_SECTORS (15) -#define BOARD_FLASH_SIZE (_FLASH_KBYTES * 1024) - -#define OSC_FREQ 24 - -#define BOARD_PIN_LED_ACTIVITY GPIO_nLED_RED -#define BOARD_PIN_LED_BOOTLOADER GPIO_nLED_RED -#define BOARD_LED_ON 0 -#define BOARD_LED_OFF 1 - -#define SERIAL_BREAK_DETECT_DISABLED 1 - -#if !defined(ARCH_SN_MAX_LENGTH) -# define ARCH_SN_MAX_LENGTH 12 -#endif - -#if !defined(APP_RESERVATION_SIZE) -# define APP_RESERVATION_SIZE 0 -#endif - -#if !defined(BOARD_FIRST_FLASH_SECTOR_TO_ERASE) -# define BOARD_FIRST_FLASH_SECTOR_TO_ERASE 1 -#endif - -#if !defined(USB_DATA_ALIGN) -# define USB_DATA_ALIGN -#endif - -#ifndef BOOT_DEVICES_SELECTION -# define BOOT_DEVICES_SELECTION USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif - -#ifndef BOOT_DEVICES_FILTER_ONUSB -# define BOOT_DEVICES_FILTER_ONUSB USB0_DEV|SERIAL0_DEV|SERIAL1_DEV -#endif diff --git a/boards/mro/pixracerpro/src/i2c.cpp b/boards/mro/pixracerpro/src/i2c.cpp deleted file mode 100644 index e9f26f9..0000000 --- a/boards/mro/pixracerpro/src/i2c.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), -}; diff --git a/boards/mro/pixracerpro/src/init.c b/boards/mro/pixracerpro/src/init.c deleted file mode 100644 index 481c35c..0000000 --- a/boards/mro/pixracerpro/src/init.c +++ /dev/null @@ -1,201 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * board-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. - */ - -#include "board_config.h" - -#include - -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include - -#include - -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - bool last = READ_VDD_3V3_SPEKTRUM_POWER_EN(); - /* Keep Spektum on to discharge rail*/ - VDD_3V3_SPEKTRUM_POWER_EN(false); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ - VDD_3V3_SPEKTRUM_POWER_EN(last); -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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 - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Power on Interfaces */ - board_control_spi_sensors_power(true, 0xffff); - VDD_3V3_SPEKTRUM_POWER_EN(true); - - px4_platform_init(); - - stm32_spiinitialize(); - - /* configure the DMA allocator */ - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_on(LED_GREEN); // Indicate Power. - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - -#ifdef CONFIG_MMCSD - /* Mount the SDIO-based MMC/SD block driver */ - /* First, get an instance of the SDIO interface */ - struct sdio_dev_s *sdio_dev = sdio_initialize(0); // SDIO_SLOTNO 0 Only one slot - - if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", 0); - } - - if (mmcsd_slotinitialize(0, sdio_dev) != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver\n"); - } - - /* Assume that the SD card is inserted. What choice do we have? */ - sdio_mediachange(sdio_dev, true); -#endif /* CONFIG_MMCSD */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/mro/pixracerpro/src/led.c b/boards/mro/pixracerpro/src/led.c deleted file mode 100644 index df66abe..0000000 --- a/boards/mro/pixracerpro/src/led.c +++ /dev/null @@ -1,111 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -static uint32_t g_ledmap[] = { - GPIO_nLED_BLUE, // Indexed by LED_BLUE - GPIO_nLED_RED, // Indexed by LED_RED - GPIO_nLED_GREEN, // Indexed by LED_GREEN -}; - -__EXPORT void led_init(void) -{ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - if (g_ledmap[l] != 0) { - stm32_configgpio(g_ledmap[l]); - } - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - if (g_ledmap[led] != 0) { - stm32_gpiowrite(g_ledmap[led], !state); - } -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - if (g_ledmap[led] != 0) { - return !stm32_gpioread(g_ledmap[led]); - } - - return false; -} - -__EXPORT void led_on(int led) -{ - phy_set_led(led, true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(led, false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(led, !phy_get_led(led)); -} diff --git a/boards/mro/pixracerpro/src/spi.cpp b/boards/mro/pixracerpro/src/spi.cpp deleted file mode 100644 index 51ba3a5..0000000 --- a/boards/mro/pixracerpro/src/spi.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20948, SPI::CS{GPIO::PortE, GPIO::Pin15}, SPI::DRDY{GPIO::PortE, GPIO::Pin12}), - }, {GPIO::PortE, GPIO::Pin3}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10}), - initSPIDevice(DRV_BARO_DEVTYPE_DPS310, SPI::CS{GPIO::PortD, GPIO::Pin7}), - }), - initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(DRV_GYR_DEVTYPE_BMI088, SPI::CS{GPIO::PortF, GPIO::Pin10}, SPI::DRDY{GPIO::PortF, GPIO::Pin3}), - initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::PortF, GPIO::Pin6}, SPI::DRDY{GPIO::PortF, GPIO::Pin1}), - initSPIDevice(DRV_GYR_DEVTYPE_BMI085, SPI::CS{GPIO::PortF, GPIO::Pin10}, SPI::DRDY{GPIO::PortF, GPIO::Pin3}), - initSPIDevice(DRV_ACC_DEVTYPE_BMI085, SPI::CS{GPIO::PortF, GPIO::Pin6}, SPI::DRDY{GPIO::PortF, GPIO::Pin1}), - }), - initSPIBusExternal(SPI::Bus::SPI6, { - initSPIConfigExternal(SPI::CS{GPIO::PortG, GPIO::Pin9}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/mro/pixracerpro/src/timer_config.cpp b/boards/mro/pixracerpro/src/timer_config.cpp deleted file mode 100644 index 7aecf98..0000000 --- a/boards/mro/pixracerpro/src/timer_config.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1, DMA{DMA::Index1}), - initIOTimer(Timer::Timer4, DMA{DMA::Index1}), - initIOTimer(Timer::Timer8, DMA{DMA::Index1}), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortE, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer8, Timer::Channel1}, {GPIO::PortI, GPIO::Pin5}), - initIOTimerChannel(io_timers, {Timer::Timer8, Timer::Channel2}, {GPIO::PortI, GPIO::Pin6}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/mro/pixracerpro/src/usb.c b/boards/mro/pixracerpro/src/usb.c deleted file mode 100644 index 3d86aca..0000000 --- a/boards/mro/pixracerpro/src/usb.c +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -#include "board_config.h" -#include -#include -#include -#include - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/mro/x21-777/default.px4board b/boards/mro/x21-777/default.px4board deleted file mode 100644 index 5a51a77..0000000 --- a/boards/mro/x21-777/default.px4board +++ /dev/null @@ -1,101 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS3" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS2" -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_COMMON_BAROMETERS=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20608G=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU9250=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_PWM_INPUT=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_PX4IO=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_BOARD_UAVCAN_INTERFACES=1 -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UUV_ATT_CONTROL=y -CONFIG_MODULES_UUV_POS_CONTROL=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BL_UPDATE=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SERIAL_TEST=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_FAKE_GPS=y diff --git a/boards/mro/x21-777/extras/px4_io-v2_default.bin b/boards/mro/x21-777/extras/px4_io-v2_default.bin deleted file mode 100755 index 957f0f1..0000000 Binary files a/boards/mro/x21-777/extras/px4_io-v2_default.bin and /dev/null differ diff --git a/boards/mro/x21-777/firmware.prototype b/boards/mro/x21-777/firmware.prototype deleted file mode 100644 index 72026ff..0000000 --- a/boards/mro/x21-777/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 136, - "magic": "MROX21777", - "description": "Firmware for the mRO X2.1-777 board", - "image": "", - "build_time": 0, - "summary": "mRO x2.1-777", - "version": "0.1", - "image_size": 0, - "image_maxsize": 2080768, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/mro/x21-777/init/rc.board_defaults b/boards/mro/x21-777/init/rc.board_defaults deleted file mode 100644 index e9fecd7..0000000 --- a/boards/mro/x21-777/init/rc.board_defaults +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 10.177939394 -param set-default BAT1_A_PER_V 15.391030303 - -param set-default SYS_USE_IO 1 diff --git a/boards/mro/x21-777/init/rc.board_sensors b/boards/mro/x21-777/init/rc.board_sensors deleted file mode 100644 index 402b847..0000000 --- a/boards/mro/x21-777/init/rc.board_sensors +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# -# Board specific sensors init -#------------------------------------------------------------------------------ -board_adc start - -# SPI1 -ms5611 -s -b 1 start -icm20608g -s -b 1 -R 8 start -icm20602 -s -b 1 -R 8 start -mpu9250 -s -b 1 -R 8 -M start diff --git a/boards/mro/x21-777/nuttx-config/include/board.h b/boards/mro/x21-777/nuttx-config/include/board.h deleted file mode 100644 index 04cc6c1..0000000 --- a/boards/mro/x21-777/nuttx-config/include/board.h +++ /dev/null @@ -1,285 +0,0 @@ -/************************************************************************************ - * board.h - * - * Copyright (C) 2016-2018 Gregory Nutt. All rights reserved. - * Authors: David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ -#pragma once - -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/* Clocking *************************************************************************/ -/* The board provides the following clock sources: - * - * X1: 24 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 16 MHz RC factory-trimmed internal oscillator - * HSE: 24 MHz crystal for HSE - */ -#define STM32_BOARD_XTAL 24000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 0 - -/* Main PLL Configuration. - * - * PLL source is HSE = 24,000,000 - * - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 2 <= PLLM <= 63 - * 192 <= PLLN <= 432 - * 192 MHz <= PLL_VCO <= 432MHz - * - * SYSCLK = PLL_VCO / PLLP - * Subject to - * - * PLLP = {2, 4, 6, 8} - * SYSCLK <= 216 MHz - * - * USB OTG FS, SDMMC and RNG Clock = PLL_VCO / PLLQ - * Subject to - * The USB OTG FS requires a 48 MHz clock to work correctly. The SDMMC - * and the random number generator need a frequency lower than or equal - * to 48 MHz to work correctly. - * - * 2 <= PLLQ <= 15 - */ - -/* Highest SYSCLK with USB OTG FS clock = 48 MHz - * - * PLL_VCO = (24,000,000 / 12) * 216 = 432 MHz - * SYSCLK = 432 MHz / 2 = 216 MHz - * USB OTG FS, SDMMC and RNG Clock = 432 MHz / 9 = 48 MHz - */ - -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(12) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(216) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(9) - -#define STM32_VCO_FREQUENCY ((STM32_HSE_FREQUENCY / 12) * 216) -#define STM32_SYSCLK_FREQUENCY (STM32_VCO_FREQUENCY / 2) -#define STM32_OTGFS_FREQUENCY (STM32_VCO_FREQUENCY / 9) - -/* Configure factors for PLLSAI clock */ -#define CONFIG_STM32F7_PLLSAI 1 -#define STM32_RCC_PLLSAICFGR_PLLSAIN RCC_PLLSAICFGR_PLLSAIN(192) -#define STM32_RCC_PLLSAICFGR_PLLSAIP RCC_PLLSAICFGR_PLLSAIP(8) -#define STM32_RCC_PLLSAICFGR_PLLSAIQ RCC_PLLSAICFGR_PLLSAIQ(4) -#define STM32_RCC_PLLSAICFGR_PLLSAIR RCC_PLLSAICFGR_PLLSAIR(2) - -/* Configure Dedicated Clock Configuration Register */ -#define STM32_RCC_DCKCFGR1_PLLI2SDIVQ RCC_DCKCFGR1_PLLI2SDIVQ(1) -#define STM32_RCC_DCKCFGR1_PLLSAIDIVQ RCC_DCKCFGR1_PLLSAIDIVQ(1) -#define STM32_RCC_DCKCFGR1_PLLSAIDIVR RCC_DCKCFGR1_PLLSAIDIVR(0) -#define STM32_RCC_DCKCFGR1_SAI1SRC RCC_DCKCFGR1_SAI1SEL(0) -#define STM32_RCC_DCKCFGR1_SAI2SRC RCC_DCKCFGR1_SAI2SEL(0) -#define STM32_RCC_DCKCFGR1_TIMPRESRC 0 -#define STM32_RCC_DCKCFGR1_DFSDM1SRC 0 -#define STM32_RCC_DCKCFGR1_ADFSDM1SRC 0 - -/* Configure factors for PLLI2S clock */ -#define CONFIG_STM32F7_PLLI2S 1 -#define STM32_RCC_PLLI2SCFGR_PLLI2SN RCC_PLLI2SCFGR_PLLI2SN(192) -#define STM32_RCC_PLLI2SCFGR_PLLI2SP RCC_PLLI2SCFGR_PLLI2SP(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SQ RCC_PLLI2SCFGR_PLLI2SQ(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SR RCC_PLLI2SCFGR_PLLI2SR(2) - -/* Configure Dedicated Clock Configuration Register 2 */ -#define STM32_RCC_DCKCFGR2_USART1SRC RCC_DCKCFGR2_USART1SEL_APB -#define STM32_RCC_DCKCFGR2_USART2SRC RCC_DCKCFGR2_USART2SEL_APB -#define STM32_RCC_DCKCFGR2_UART4SRC RCC_DCKCFGR2_UART4SEL_APB -#define STM32_RCC_DCKCFGR2_UART5SRC RCC_DCKCFGR2_UART5SEL_APB -#define STM32_RCC_DCKCFGR2_USART6SRC RCC_DCKCFGR2_USART6SEL_APB -#define STM32_RCC_DCKCFGR2_UART7SRC RCC_DCKCFGR2_UART7SEL_APB -#define STM32_RCC_DCKCFGR2_UART8SRC RCC_DCKCFGR2_UART8SEL_APB -#define STM32_RCC_DCKCFGR2_I2C1SRC RCC_DCKCFGR2_I2C1SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C2SRC RCC_DCKCFGR2_I2C2SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C3SRC RCC_DCKCFGR2_I2C3SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C4SRC RCC_DCKCFGR2_I2C4SEL_HSI -#define STM32_RCC_DCKCFGR2_LPTIM1SRC RCC_DCKCFGR2_LPTIM1SEL_APB -#define STM32_RCC_DCKCFGR2_CECSRC RCC_DCKCFGR2_CECSEL_HSI -#define STM32_RCC_DCKCFGR2_CK48MSRC RCC_DCKCFGR2_CK48MSEL_PLL -#define STM32_RCC_DCKCFGR2_SDMMCSRC RCC_DCKCFGR2_SDMMCSEL_48MHZ -#define STM32_RCC_DCKCFGR2_SDMMC2SRC RCC_DCKCFGR2_SDMMC2SEL_48MHZ -#define STM32_RCC_DCKCFGR2_DSISRC RCC_DCKCFGR2_DSISEL_PHY - - -/* Several prescalers allow the configuration of the two AHB buses, the - * high-speed APB (APB2) and the low-speed APB (APB1) domains. The maximum - * frequency of the two AHB buses is 216 MHz while the maximum frequency of - * the high-speed APB domains is 108 MHz. The maximum allowed frequency of - * the low-speed APB domain is 54 MHz. - */ - -/* AHB clock (HCLK) is SYSCLK (216 MHz) */ -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (54 MHz) */ -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (108MHz) */ -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* SDMMC dividers. Note that slower clocking is required when DMA is disabled - * in order to avoid RX overrun/TX underrun errors due to delayed responses - * to service FIFOs in interrupt driven mode. These values have not been - * tuned!!! - * - * SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(118+2)=400 KHz - */ - -/* Use the Falling edge of the SDIO_CLK clock to change the edge the - * data and commands are change on - */ - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - -#define STM32_SDMMC_INIT_CLKDIV (118 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* DMA ON: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(1+2)=16 MHz - * DMA OFF: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32F7_SDMMC_DMA -# define STM32_SDMMC_MMCXFR_CLKDIV (1 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (2 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -/* DMA ON: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(1+2)=16 MHz - * DMA OFF: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(2+2)=12 MHz - */ -//TODO #warning "Check Freq for 24mHz" - -#ifdef CONFIG_STM32F7_SDMMC_DMA -# define STM32_SDMMC_SDXFR_CLKDIV (1 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (2 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -/* FLASH wait states - * - * --------- ---------- ----------- - * VDD MAX SYSCLK WAIT STATES - * --------- ---------- ----------- - * 1.7-2.1 V 180 MHz 8 - * 2.1-2.4 V 216 MHz 9 - * 2.4-2.7 V 216 MHz 8 - * 2.7-3.6 V 216 MHz 7 - * --------- ---------- ----------- - */ - -#define BOARD_FLASH_WAITSTATES 7 - -/* Alternate function pin selections ************************************************/ - -#define GPIO_USART1_RX GPIO_USART1_RX_1 /* Console in from IO */ -#define GPIO_USART1_TX 0 /* USART1 is RX-only */ - -#define GPIO_USART2_RX GPIO_USART2_RX_2 -#define GPIO_USART2_TX GPIO_USART2_TX_2 -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 -#define GPIO_USART2_CTS GPIO_USART2_CTS_2 - -#define GPIO_USART3_RX GPIO_USART3_RX_3 -#define GPIO_USART3_TX GPIO_USART3_TX_3 -#define GPIO_USART3_RTS GPIO_USART3_RTS_2 -#define GPIO_USART3_CTS GPIO_USART3_CTS_2 - -#define GPIO_UART4_RX GPIO_UART4_RX_1 -#define GPIO_UART4_TX GPIO_UART4_TX_1 - -#define GPIO_USART6_RX GPIO_USART6_RX_1 -#define GPIO_USART6_TX GPIO_USART6_TX_1 - -#define GPIO_UART7_RX GPIO_UART7_RX_1 -#define GPIO_UART7_TX GPIO_UART7_TX_1 - -/* UART8 has no alternate pin config */ - - -/* CAN */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 - - -/* I2C */ -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 - - -/* SPI */ -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 - -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_3 - diff --git a/boards/mro/x21-777/nuttx-config/include/board_dma_map.h b/boards/mro/x21-777/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 5a81da5..0000000 --- a/boards/mro/x21-777/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/* -| DMA1 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | SPI3_RX_1 | SPDIFRX_DT | SPI3_RX_2 | SPI2_RX | SPI2_TX | SPI3_TX_1 | SPDIFRX_CS | SPI3_TX_2 | -| Channel 1 | I2C1_RX | I2C3_RX | TIM7_UP_1 | - | TIM7_UP_2 | I2C1_RX_1 | I2C1_TX | I2C1_TX_1 | -| Channel 2 | TIM4_CH1 | - | I2C4_RX | TIM4_CH2 | - | I2C4_RX | TIM4_UP | TIM4_CH3 | -| Channel 3 | - | TIM2_UP_1 | I2C3_RX_1 | - | I2C3_TX | TIM2_CH1 | TIM2_CH2 | TIM2_UP_2 | -| | | TIM2_CH3 | | | | | TIM2_CH4_1 | TIM2_CH4_2 | -| Channel 4 | UART5_RX | USART3_RX | UART4_RX | USART3_TX_1 | UART4_TX | USART2_RX | USART2_TX | UART5_TX | -| Channel 5 | UART8_TX | UART7_TX | TIM3_CH4 | UART7_RX | TIM3_CH1 | TIM3_CH2 | UART8_RX | TIM3_CH3 | -| | | | TIM3_UP | | TIM3_TRIG | | | | -| Channel 6 | TIM5_CH3 | TIM5_CH4_1 | TIM5_CH1 | TIM5_CH4_2 | TIM5_CH2 | - | TIM5_UP_2 | - | -| | TIM5_UP_1 | TIM5_TRIG_1 | | TIM5_TRIG_2 | | | | | -| Channel 7 | - | TIM6_UP | I2C2_RX | I2C2_RX_1 | USART3_TX_2 | DAC1 | DAC2 | I2C2_TX | -| Channel 8 | I2C3_TX | I2C4_RX | - | - | I2C2_TX | - | I2C4_TX | - | -| Channel 9 | - | SPI2_RX | - | - | - | - | SPI2_TX | - | -| | | | | | | | | | -| Usage | UART8_TX | USART3_RX | UART4_RX | USART3_TX_1 | | USART2_RX | UART8_RX | | - - -| DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | ADC1_1 | SAI1_A | TIM8_CH1_1 | SAI1_A_1 | ADC1_2 | SAI1_B_1 | TIM1_CH1_1 | SAI2_B_2 | -| | | | TIM8_CH2_1 | | | | TIM1_CH2_1 | | -| | | | TIM8_CH3_1 | | | | TIM1_CH3_1 | | -| Channel 1 | - | DCMI_1 | ADC2_1 | ADC2_2 | SAI1_B | SPI6_TX | SPI6_RX | DCMI_2 | -| Channel 2 | ADC3_1 | ADC3_2 | - | SPI5_RX_1 | SPI5_TX_1 | CRYP_OUT | CRYP_IN | HASH_IN | -| Channel 3 | SPI1_RX_1 | - | SPI1_RX_2 | SPI1_TX_1 | SAI2_A | SPI1_TX_2 | SAI2_B | QUADSPI | -| Channel 4 | SPI4_RX_1 | SPI4_TX_1 | USART1_RX_1 | SDMMC1_1 | - | USART1_RX_2 | SDMMC1_2 | USART1_TX | -| Channel 5 | - | USART6_RX_1 | USART6_RX_2 | SPI4_RX_2 | SPI4_TX_2 | - | USART6_TX_1 | USART6_TX_2 | -| Channel 6 | TIM1_TRIG_1 | TIM1_CH1_2 | TIM1_CH2_2 | TIM1_CH1 | TIM1_CH4 | TIM1_UP | TIM1_CH3_2 | - | -| | | | | | TIM1_TRIG_2 | | | | -| | | | | | TIM1_COM | | | | -| Channel 7 | - | TIM8_UP | TIM8_CH1_2 | TIM8_CH2_2 | TIM8_CH3_2 | SPI5_RX_2 | SPI5_TX_2 | TIM8_CH4 | -| | | | | | | | | TIM8_TRIG | -| | | | | | | | | TIM8_COM | -| Channel 8 | DSFDM1_FLT0 | DSFDM1_FLT1 | DSFDM1_FLT2 | DSFDM1_FLT3 | DSFDM1_FLT0 | DSFDM1_FLT1 | DSFDM1_FLT2 | DSFDM1_FLT3 | -| Channel 9 | JPEG_IN | JPEG_OUT | SPI4_TX | JPEG_IN | JPEG_OUT | SPI5_RX | - | - | -| Channel 10 | SAI1_B | SAI2_B | SAI2_A | - | - | - | SAI1_A | - | -| Channel 11 | SDMMC2 | - | QUADSPI | - | - | SDMMC2 | - | - | -| | | | | | | | | | -| Usage | SPI1_RX_1 | | USART6_RX_2 | SPI1_TX_1 | | TIM1_UP | SDMMC1_2 | USART6_TX_2 | - */ - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// DMAMAP_UART8_TX // DMA1, Stream 0, Channel 5 (PX4IO TX) -// DMAMAP_USART3_RX // DMA1, Stream 1, Channel 4 (TELEM2 RX) -// DMAMAP_UART4_RX // DMA1, Stream 2, Channel 4 (TELEM4 RX) -#define DMAMAP_USART3_TX DMAMAP_USART3_TX_1 // DMA1, Stream 3, Channel 4 (TELEM2 TX) -// DMAMAP_USART2_RX // DMA1, Stream 5, Channel 4 (TELEM1 RX) -// DMAMAP_UART8_RX // DMA1, Stream 6, Channel 5 (PX4IO RX) - - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMAMAP_SPI1_RX DMAMAP_SPI1_RX_1 // DMA2, Stream 0, Channel 3 (SPI sensors RX) -// AVAILABLE // DMA2, Stream 1 -#define DMAMAP_USART6_RX DMAMAP_USART6_RX_2 // DMA2, Stream 2, Channel 5 (PX4_IO RX) -// AVAILABLE // DMA2, Stream 3, Channel 3 -// AVAILABLE // DMA2, Stream 4 -#define DMAMAP_SPI1_TX DMAMAP_SPI1_TX_2 // DMA2, Stream 5, Channel 3 (SPI sensors TX) -#define DMAMAP_SDMMC1 DMAMAP_SDMMC1_2 // DMA2, Stream 6, Channel 4 (SDMMC) -#define DMAMAP_USART6_TX DMAMAP_USART6_TX_2 // DMA2, Stream 7, Channel 5 (PX4_IO TX) diff --git a/boards/mro/x21-777/nuttx-config/nsh/defconfig b/boards/mro/x21-777/nuttx-config/nsh/defconfig deleted file mode 100644 index 6d15b6c..0000000 --- a/boards/mro/x21-777/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,257 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/mro/x21-777/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32f7" -CONFIG_ARCH_CHIP_STM32F777NI=y -CONFIG_ARCH_CHIP_STM32F7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0088 -CONFIG_CDCACM_PRODUCTSTR="mRo x2.1-777" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="mRo" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=3 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_MODE=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32F7_ADC1=y -CONFIG_STM32F7_BBSRAM=y -CONFIG_STM32F7_BBSRAM_FILES=5 -CONFIG_STM32F7_BKPSRAM=y -CONFIG_STM32F7_DMA1=y -CONFIG_STM32F7_DMA2=y -CONFIG_STM32F7_DMACAPABLE=y -CONFIG_STM32F7_FLOWCONTROL_BROKEN=y -CONFIG_STM32F7_I2C1=y -CONFIG_STM32F7_I2C_DYNTIMEO=y -CONFIG_STM32F7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32F7_OTGFS=y -CONFIG_STM32F7_PROGMEM=y -CONFIG_STM32F7_PWR=y -CONFIG_STM32F7_RTC=y -CONFIG_STM32F7_RTC_HSECLOCK=y -CONFIG_STM32F7_RTC_MAGIC_REG=1 -CONFIG_STM32F7_SAVE_CRASHDUMP=y -CONFIG_STM32F7_SDMMC1=y -CONFIG_STM32F7_SDMMC_DMA=y -CONFIG_STM32F7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32F7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32F7_SPI1=y -CONFIG_STM32F7_SPI1_DMA=y -CONFIG_STM32F7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI2=y -CONFIG_STM32F7_SPI_DMATHRESHOLD=8 -CONFIG_STM32F7_TIM10=y -CONFIG_STM32F7_TIM3=y -CONFIG_STM32F7_TIM9=y -CONFIG_STM32F7_UART4=y -CONFIG_STM32F7_UART7=y -CONFIG_STM32F7_UART8=y -CONFIG_STM32F7_USART1=y -CONFIG_STM32F7_USART2=y -CONFIG_STM32F7_USART3=y -CONFIG_STM32F7_USART6=y -CONFIG_STM32F7_USART_BREAKS=y -CONFIG_STM32F7_USART_INVERT=y -CONFIG_STM32F7_USART_SINGLEWIRE=y -CONFIG_STM32F7_USART_SWAP=y -CONFIG_STM32F7_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=1200 -CONFIG_UART4_TXBUFSIZE=1200 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_RXDMA=y -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=3000 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=1200 -CONFIG_USART6_TXBUFSIZE=1200 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/mro/x21-777/nuttx-config/scripts/script.ld b/boards/mro/x21-777/nuttx-config/scripts/script.ld deleted file mode 100644 index 70f4ecc..0000000 --- a/boards/mro/x21-777/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,181 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F765IIT6 has 2048 KiB of main FLASH memory. This FLASH memory - * can be accessed from either the AXIM interface at address 0x0800:0000 or - * from the ITCM interface at address 0x0020:0000. - * - * Additional information, including the option bytes, is available at at - * FLASH at address 0x1ff0:0000 (AXIM) or 0x0010:0000 (ITCM). - * - * In the STM32F765IIT6, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash on ITCM at 0x0020:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x0010:0000 - * - * NuttX does not modify these option byes. On the unmodified NUCLEO-144 - * board, the BOOT0 pin is at ground so by default, the STM32F765IIT6 will - * boot from address 0x0020:0000 in ITCM FLASH. - * - * The STM32F765IIT6 also has 512 KiB of data SRAM (in addition to ITCM SRAM). - * SRAM is split up into three blocks: - * - * 1) 128 KiB of DTCM SRM beginning at address 0x2000:0000 - * 2) 368 KiB of SRAM1 beginning at address 0x2002:0000 - * 3) 16 KiB of SRAM2 beginning at address 0x2007:c000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * Bootloader reserves three 32K banks (2 Mbytes Flash memory single bank) - * organization (256 bits read width) - */ - -MEMORY -{ - FLASH_ITCM (rx) : ORIGIN = 0x00218000, LENGTH = 1952K - FLASH_AXIM (rx) : ORIGIN = 0x08018000, LENGTH = 1952K - - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 16K - DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - SRAM1 (rwx) : ORIGIN = 0x20020000, LENGTH = 368K - SRAM2 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH_AXIM - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH_AXIM - - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH_AXIM - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH_AXIM - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > SRAM1 AT > FLASH_AXIM - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > SRAM1 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } - - .ramfunc : { - _sramfuncs = .; - *(.ramfunc .ramfunc.*) - . = ALIGN(4); - _eramfuncs = .; - } > ITCM_RAM AT > FLASH_AXIM - - _framfuncs = LOADADDR(.ramfunc); -} diff --git a/boards/mro/x21-777/src/CMakeLists.txt b/boards/mro/x21-777/src/CMakeLists.txt deleted file mode 100644 index b1ce032..0000000 --- a/boards/mro/x21-777/src/CMakeLists.txt +++ /dev/null @@ -1,51 +0,0 @@ -############################################################################ -# -# Copyright (c) 2019 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. -# -############################################################################ - -add_library(drivers_board - i2c.cpp - init.c - led.c - sdio.c - spi.cpp - timer_config.cpp - usb.c -) - -target_link_libraries(drivers_board - PRIVATE - arch_spi - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer -) diff --git a/boards/mro/x21-777/src/board_config.h b/boards/mro/x21-777/src/board_config.h deleted file mode 100644 index 30abf1e..0000000 --- a/boards/mro/x21-777/src/board_config.h +++ /dev/null @@ -1,158 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * Board internal definitions - */ - -#pragma once - -#include -#include -#include -#include - -/* PX4IO connection configuration */ -#define BOARD_USES_PX4IO_VERSION 2 -#define PX4IO_SERIAL_DEVICE "/dev/ttyS4" -#define PX4IO_SERIAL_TX_GPIO GPIO_USART6_TX -#define PX4IO_SERIAL_RX_GPIO GPIO_USART6_RX -#define PX4IO_SERIAL_BASE STM32_USART6_BASE -#define PX4IO_SERIAL_VECTOR STM32_IRQ_USART6 -#define PX4IO_SERIAL_TX_DMAMAP DMAMAP_USART6_TX -#define PX4IO_SERIAL_RX_DMAMAP DMAMAP_USART6_RX -#define PX4IO_SERIAL_RCC_REG STM32_RCC_APB2ENR -#define PX4IO_SERIAL_RCC_EN RCC_APB2ENR_USART6EN -#define PX4IO_SERIAL_CLOCK STM32_PCLK2_FREQUENCY -#define PX4IO_SERIAL_BITRATE 1500000 /* 1.5Mbps -> max rate for IO */ - -/* LEDs */ - -#define GPIO_LED1 (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN12) -#define BOARD_OVERLOAD_LED LED_RED - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that can be used by the Px4 Firmware in the adc driver - */ -#define ADC_CHANNELS (1 << 2) | (1 << 3) | (1 << 4) | (1 << 13) | (1 << 14) | (1 << 15) - -// ADC defines to be used in sensors.cpp to read from a particular channel -#define ADC_BATTERY_VOLTAGE_CHANNEL 2 -#define ADC_BATTERY_CURRENT_CHANNEL 3 -#define ADC_5V_RAIL_SENSE 4 -#define ADC_AIRSPEED_VOLTAGE_CHANNEL 15 - -/* Power supply control and monitoring GPIOs */ -// Signal is not connected -#define GPIO_nVDD_5V_PERIPH_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN8) -#define GPIO_VDD_BRICK_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5) -#define GPIO_VDD_3V3_SENSORS_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN3) -#define GPIO_VDD_5V_PERIPH_OC (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN15) - -/* Tone alarm output */ -#define TONE_ALARM_TIMER 2 /* timer 2 */ -#define TONE_ALARM_CHANNEL 1 /* channel 1 */ -#define GPIO_TONE_ALARM_IDLE (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) -#define GPIO_TONE_ALARM (GPIO_ALT|GPIO_AF1|GPIO_SPEED_2MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN15) - -/* PWM */ -#define DIRECT_PWM_OUTPUT_CHANNELS 6 - -/* USB OTG FS - * - * PA9 OTG_FS_VBUS VBUS sensing (also connected to the green LED) - */ -#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 8 /* use timer8 for the HRT */ -#define HRT_TIMER_CHANNEL 3 /* use capture/compare channel 3 */ - -/* PWM input driver. Use FMU AUX5 pins attached to timer4 channel 2 */ -#define PWMIN_TIMER 4 -#define PWMIN_TIMER_CHANNEL 2 -#define GPIO_PWM_IN GPIO_TIM4_CH2IN_2 - -/* By Providing BOARD_ADC_USB_CONNECTED this board support the ADC - * system_power interface, and therefore provides the true logic - * GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_BRICK_VALID (!px4_arch_gpioread(GPIO_VDD_BRICK_VALID)) -#define BOARD_ADC_SERVO_VALID (1) -#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_VDD_5V_PERIPH_OC)) -#define BOARD_ADC_HIPOWER_5V_OC (0) - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ -#define BOARD_HAS_ON_RESET 1 - -#define BOARD_HAS_STATIC_MANIFEST 1 - -#define SDIO_SLOTNO 0 /* Only one slot */ -#define SDIO_MINOR 0 - -#define BOARD_ENABLE_CONSOLE_BUFFER - -#define BOARD_NUM_IO_TIMERS 3 - -__BEGIN_DECLS -#ifndef __ASSEMBLY__ - - -/**************************************************************************** - * Name: stm32_sdio_initialize - * - * Description: - * Initialize SDIO-based MMC/SD card support - * - ****************************************************************************/ - -int stm32_sdio_initialize(void); - -extern void stm32_spiinitialize(void); - -extern void stm32_usbinitialize(void); - -extern void board_peripheral_reset(int ms); - -#include -#endif /* __ASSEMBLY__ */ -__END_DECLS diff --git a/boards/mro/x21-777/src/i2c.cpp b/boards/mro/x21-777/src/i2c.cpp deleted file mode 100644 index e9f26f9..0000000 --- a/boards/mro/x21-777/src/i2c.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), -}; diff --git a/boards/mro/x21-777/src/init.c b/boards/mro/x21-777/src/init.c deleted file mode 100644 index 3f5f00e..0000000 --- a/boards/mro/x21-777/src/init.c +++ /dev/null @@ -1,225 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * board-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. - */ - -#include "board_config.h" - -#include - -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include - -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - /* set the peripheral rails off */ - stm32_configgpio(GPIO_nVDD_5V_PERIPH_EN); - stm32_gpiowrite(GPIO_nVDD_5V_PERIPH_EN, 1); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ - stm32_gpiowrite(GPIO_nVDD_5V_PERIPH_EN, 0); -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - // Configure the GPIO pins to outputs and keep them low. - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(io_timer_channel_get_gpio_output(i)); - } - - /** - * On resets invoked from system (not boot) insure we establish a low - * output state (discharge the pins) on PWM pins before they become inputs. - */ - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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 LEDs */ - board_autoled_initialize(); - - /* configure pins */ - - /* configure ADC pins */ - px4_arch_configgpio(GPIO_ADC1_IN2); /* BATT_VOLTAGE_SENS */ - px4_arch_configgpio(GPIO_ADC1_IN3); /* BATT_CURRENT_SENS */ - px4_arch_configgpio(GPIO_ADC1_IN4); /* VDD_5V_SENS */ - px4_arch_configgpio(GPIO_ADC1_IN13); /* FMU_AUX_ADC_1 */ - px4_arch_configgpio(GPIO_ADC1_IN14); /* FMU_AUX_ADC_2 */ - px4_arch_configgpio(GPIO_ADC1_IN15); /* PRESSURE_SENS */ - - /* configure power supply control/sense pins */ - px4_arch_configgpio(GPIO_nVDD_5V_PERIPH_EN); - px4_arch_configgpio(GPIO_VDD_3V3_SENSORS_EN); - px4_arch_configgpio(GPIO_VDD_BRICK_VALID); - px4_arch_configgpio(GPIO_VDD_5V_PERIPH_OC); - - /* configure CAN interface */ - px4_arch_configgpio(GPIO_CAN1_RX); - px4_arch_configgpio(GPIO_CAN1_TX); - - /* configure SPI interfaces */ - stm32_spiinitialize(); - - /* configure USB interfaces */ - stm32_usbinitialize(); -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Power on Interfaces */ - stm32_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, true); - stm32_gpiowrite(GPIO_nVDD_5V_PERIPH_EN, false); - board_control_spi_sensors_power(true, 0xffff); - - px4_platform_init(); - - stm32_spiinitialize(); - - /* configure the DMA allocator */ - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_AMBER); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_AMBER); - } - -#ifdef CONFIG_MMCSD - int ret = stm32_sdio_initialize(); - - if (ret != OK) { - led_on(LED_RED); - } - -#endif /* CONFIG_MMCSD */ - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/mro/x21-777/src/led.c b/boards/mro/x21-777/src/led.c deleted file mode 100644 index 15210b0..0000000 --- a/boards/mro/x21-777/src/led.c +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -__EXPORT void led_init() -{ - /* Configure LED1 GPIO for output */ - - px4_arch_configgpio(GPIO_LED1); -} - -__EXPORT void led_on(int led) -{ - if (led == 1) { - /* Pull down to switch on */ - px4_arch_gpiowrite(GPIO_LED1, false); - } -} - -__EXPORT void led_off(int led) -{ - if (led == 1) { - /* Pull up to switch off */ - px4_arch_gpiowrite(GPIO_LED1, true); - } -} - -__EXPORT void led_toggle(int led) -{ - if (led == 1) { - if (px4_arch_gpioread(GPIO_LED1)) { - px4_arch_gpiowrite(GPIO_LED1, false); - - } else { - px4_arch_gpiowrite(GPIO_LED1, true); - } - } -} diff --git a/boards/mro/x21-777/src/sdio.c b/boards/mro/x21-777/src/sdio.c deleted file mode 100644 index bb56cc8..0000000 --- a/boards/mro/x21-777/src/sdio.c +++ /dev/null @@ -1,171 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include "chip.h" -#include "board_config.h" -#include "stm32_gpio.h" -#include "stm32_sdmmc.h" - -#ifdef CONFIG_MMCSD - - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Card detections requires card support and a card detection GPIO */ - -#define HAVE_NCD 1 -#if !defined(GPIO_SDMMC1_NCD) -# undef HAVE_NCD -#endif - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -static FAR struct sdio_dev_s *sdio_dev; -#ifdef HAVE_NCD -static bool g_sd_inserted = 0xff; /* Impossible value */ -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_ncd_interrupt - * - * Description: - * Card detect interrupt handler. - * - ****************************************************************************/ - -#ifdef HAVE_NCD -static int stm32_ncd_interrupt(int irq, FAR void *context) -{ - bool present = !stm32_gpioread(GPIO_SDMMC1_NCD); - - if (sdio_dev && present != g_sd_inserted) { - sdio_mediachange(sdio_dev, present); - g_sd_inserted = present; - } - - return OK; -} -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_sdio_initialize - * - * Description: - * Initialize SDIO-based MMC/SD card support - * - ****************************************************************************/ - -int stm32_sdio_initialize(void) -{ - int ret; - -#ifdef HAVE_NCD - /* Card detect */ - bool cd_status; - - /* Configure the card detect GPIO */ - stm32_configgpio(GPIO_SDMMC1_NCD); - - /* Register an interrupt handler for the card detect pin */ - stm32_gpiosetevent(GPIO_SDMMC1_NCD, true, true, true, stm32_ncd_interrupt); -#endif - - /* Mount the SDIO-based MMC/SD block driver */ - /* First, get an instance of the SDIO interface */ - finfo("Initializing SDIO slot %d\n", SDIO_SLOTNO); - - sdio_dev = sdio_initialize(SDIO_SLOTNO); - - if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", SDIO_SLOTNO); - return -ENODEV; - } - - /* Now bind the SDIO interface to the MMC/SD driver */ - - finfo("Bind SDIO to the MMC/SD driver, minor=%d\n", SDIO_MINOR); - - ret = mmcsd_slotinitialize(SDIO_MINOR, sdio_dev); - - if (ret != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); - return ret; - } - - finfo("Successfully bound SDIO to the MMC/SD driver\n"); - -#ifdef HAVE_NCD - /* Use SD card detect pin to check if a card is g_sd_inserted */ - - cd_status = !stm32_gpioread(GPIO_SDMMC1_NCD); - finfo("Card detect : %d\n", cd_status); - - sdio_mediachange(sdio_dev, cd_status); -#else - /* Assume that the SD card is inserted. What choice do we have? */ - - sdio_mediachange(sdio_dev, true); -#endif - - return OK; -} - -#endif /* CONFIG_MMCSD */ diff --git a/boards/mro/x21-777/src/spi.cpp b/boards/mro/x21-777/src/spi.cpp deleted file mode 100644 index f20c857..0000000 --- a/boards/mro/x21-777/src/spi.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortC, GPIO::Pin15}, SPI::DRDY{GPIO::PortC, GPIO::Pin14}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20608G, SPI::CS{GPIO::PortC, GPIO::Pin15}, SPI::DRDY{GPIO::PortC, GPIO::Pin14}), - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortD, GPIO::Pin7}), - initSPIDevice(DRV_IMU_DEVTYPE_MPU9250, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), - }), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/mro/x21-777/src/timer_config.cpp b/boards/mro/x21-777/src/timer_config.cpp deleted file mode 100644 index f1dde6a..0000000 --- a/boards/mro/x21-777/src/timer_config.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2019 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1, DMA{DMA::Index2, DMA::Stream5, DMA::Channel6}), - initIOTimer(Timer::Timer4), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortE, GPIO::Pin13}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/mro/x21-777/src/usb.c b/boards/mro/x21-777/src/usb.c deleted file mode 100644 index 4ac9829..0000000 --- a/boards/mro/x21-777/src/usb.c +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2019 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#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 - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/mro/x21/default.px4board b/boards/mro/x21/default.px4board deleted file mode 100644 index 7c20626..0000000 --- a/boards/mro/x21/default.px4board +++ /dev/null @@ -1,101 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS3" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS2" -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_COMMON_BAROMETERS=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20608G=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU9250=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_PWM_INPUT=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_PX4IO=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_BOARD_UAVCAN_INTERFACES=1 -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UUV_ATT_CONTROL=y -CONFIG_MODULES_UUV_POS_CONTROL=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BL_UPDATE=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SERIAL_TEST=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_FAKE_GPS=y diff --git a/boards/mro/x21/extras/mro_x21_bootloader.bin b/boards/mro/x21/extras/mro_x21_bootloader.bin deleted file mode 100644 index d21a048..0000000 Binary files a/boards/mro/x21/extras/mro_x21_bootloader.bin and /dev/null differ diff --git a/boards/mro/x21/extras/px4_io-v2_default.bin b/boards/mro/x21/extras/px4_io-v2_default.bin deleted file mode 100755 index 957f0f1..0000000 Binary files a/boards/mro/x21/extras/px4_io-v2_default.bin and /dev/null differ diff --git a/boards/mro/x21/firmware.prototype b/boards/mro/x21/firmware.prototype deleted file mode 100644 index 99f0af4..0000000 --- a/boards/mro/x21/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 33, - "magic": "PX4FWv1", - "description": "Firmware for the mRo X2.1 board", - "image": "", - "build_time": 0, - "summary": "mRo X2.1", - "version": "0.1", - "image_size": 0, - "image_maxsize": 2080768, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/mro/x21/init/rc.board_defaults b/boards/mro/x21/init/rc.board_defaults deleted file mode 100644 index e9fecd7..0000000 --- a/boards/mro/x21/init/rc.board_defaults +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 10.177939394 -param set-default BAT1_A_PER_V 15.391030303 - -param set-default SYS_USE_IO 1 diff --git a/boards/mro/x21/init/rc.board_sensors b/boards/mro/x21/init/rc.board_sensors deleted file mode 100644 index 402b847..0000000 --- a/boards/mro/x21/init/rc.board_sensors +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# -# Board specific sensors init -#------------------------------------------------------------------------------ -board_adc start - -# SPI1 -ms5611 -s -b 1 start -icm20608g -s -b 1 -R 8 start -icm20602 -s -b 1 -R 8 start -mpu9250 -s -b 1 -R 8 -M start diff --git a/boards/mro/x21/nuttx-config/include/board.h b/boards/mro/x21/nuttx-config/include/board.h deleted file mode 100644 index 21f4926..0000000 --- a/boards/mro/x21/nuttx-config/include/board.h +++ /dev/null @@ -1,266 +0,0 @@ -/************************************************************************************ - * board.h - * include/arch/board/board.h - * - * Copyright (C) 2009, 2016 Gregory Nutt. All rights reserved. - * Authors: Gregory Nutt - * David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ - -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ -#include "board_dma_map.h" - -#include -#ifndef __ASSEMBLY__ -# include -#endif - -#include - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The PX4FMUV2 uses a 24MHz crystal connected to the HSE. - * - * This is the "standard" configuration as set up by arch/arm/src/stm32f40xx_rcc.c: - * System Clock source : PLL (HSE) - * SYSCLK(Hz) : 168000000 Determined by PLL configuration - * HCLK(Hz) : 168000000 (STM32_RCC_CFGR_HPRE) - * AHB Prescaler : 1 (STM32_RCC_CFGR_HPRE) - * APB1 Prescaler : 4 (STM32_RCC_CFGR_PPRE1) - * APB2 Prescaler : 2 (STM32_RCC_CFGR_PPRE2) - * HSE Frequency(Hz) : 24000000 (STM32_BOARD_XTAL) - * PLLM : 24 (STM32_PLLCFG_PLLM) - * PLLN : 336 (STM32_PLLCFG_PLLN) - * PLLP : 2 (STM32_PLLCFG_PLLP) - * PLLQ : 7 (STM32_PLLCFG_PPQ) - * Main regulator output voltage : Scale1 mode Needed for high speed SYSCLK - * Flash Latency(WS) : 5 - * Prefetch Buffer : OFF - * Instruction cache : ON - * Data cache : ON - * Require 48MHz for USB OTG FS, : Enabled - * SDIO and RNG clock - */ - -/* HSI - 16 MHz RC factory-trimmed - * LSI - 32 KHz RC - * HSE - On-board crystal frequency is 24MHz - * LSE - not installed - */ - -#define STM32_BOARD_XTAL 24000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -//#define STM32_LSE_FREQUENCY 32768 - -/* Main PLL Configuration. - * - * PLL source is HSE - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * = (25,000,000 / 25) * 336 - * = 336,000,000 - * SYSCLK = PLL_VCO / PLLP - * = 336,000,000 / 2 = 168,000,000 - * USB OTG FS, SDIO and RNG Clock - * = PLL_VCO / PLLQ - * = 48,000,000 - */ - -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(24) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(336) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(7) - -#define STM32_SYSCLK_FREQUENCY 168000000ul - -/* AHB clock (HCLK) is SYSCLK (168MHz) */ - -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (42MHz) */ - -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (84MHz) */ - -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx - * otherwise frequency is 2xAPBx. - * Note: TIM1,8-11 are on APB2, others on APB1 - */ - -#define BOARD_TIM1_FREQUENCY STM32_APB2_TIM1_CLKIN -#define BOARD_TIM2_FREQUENCY STM32_APB1_TIM2_CLKIN -#define BOARD_TIM3_FREQUENCY STM32_APB1_TIM3_CLKIN -#define BOARD_TIM4_FREQUENCY STM32_APB1_TIM4_CLKIN -#define BOARD_TIM5_FREQUENCY STM32_APB1_TIM5_CLKIN -#define BOARD_TIM6_FREQUENCY STM32_APB1_TIM6_CLKIN -#define BOARD_TIM7_FREQUENCY STM32_APB1_TIM7_CLKIN -#define BOARD_TIM8_FREQUENCY STM32_APB2_TIM8_CLKIN -#define BOARD_TIM9_FREQUENCY STM32_APB2_TIM9_CLKIN -#define BOARD_TIM10_FREQUENCY STM32_APB2_TIM10_CLKIN -#define BOARD_TIM11_FREQUENCY STM32_APB2_TIM11_CLKIN -#define BOARD_TIM12_FREQUENCY STM32_APB1_TIM12_CLKIN -#define BOARD_TIM13_FREQUENCY STM32_APB1_TIM13_CLKIN -#define BOARD_TIM14_FREQUENCY STM32_APB1_TIM14_CLKIN - -/* SDIO dividers. Note that slower clocking is required when DMA is disabled - * in order to avoid RX overrun/TX underrun errors due to delayed responses - * to service FIFOs in interrupt driven mode. These values have not been - * tuned!!! - * - * SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(118+2)=400 KHz - */ - -#define SDIO_INIT_CLKDIV (118 << SDIO_CLKCR_CLKDIV_SHIFT) - -/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz - * DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32_SDIO_DMA -# define SDIO_MMCXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) -#else -# define SDIO_MMCXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) -#endif - -/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz - * DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32_SDIO_DMA -# define SDIO_SDXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) -#else -# define SDIO_SDXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) -#endif - -/* Alternate function pin selections ************************************************/ - -/* UARTs */ - -#define GPIO_USART1_RX GPIO_USART1_RX_1 /* Console in from IO */ -#define GPIO_USART1_TX 0 /* USART1 is RX-only */ - -#define GPIO_USART2_RX GPIO_USART2_RX_2 -#define GPIO_USART2_TX GPIO_USART2_TX_2 -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 -#define GPIO_USART2_CTS GPIO_USART2_CTS_2 - -#define GPIO_USART3_RX GPIO_USART3_RX_3 -#define GPIO_USART3_TX GPIO_USART3_TX_3 -#define GPIO_USART3_RTS GPIO_USART3_RTS_2 -#define GPIO_USART3_CTS GPIO_USART3_CTS_2 - -#define GPIO_UART4_RX GPIO_UART4_RX_1 -#define GPIO_UART4_TX GPIO_UART4_TX_1 - -#define GPIO_USART6_RX GPIO_USART6_RX_1 -#define GPIO_USART6_TX GPIO_USART6_TX_1 - -#define GPIO_UART7_RX GPIO_UART7_RX_1 -#define GPIO_UART7_TX GPIO_UART7_TX_1 - -/* UART8 has no alternate pin config */ - -/* CAN - * - * CAN1 is routed to the onboard transceiver. - */ - -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 - -/* I2C - * - * The optional _GPIO configurations allow the I2C driver to manually - * reset the bus to clear stuck slaves. They match the pin configuration, - * but are normally-high GPIOs. - */ - -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN8) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN9) - -/* SPI - * - * There are sensors on SPI1, and SPI2 is connected to the FRAM. - */ - -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 - -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_2 - -#define GPIO_SPI4_MISO GPIO_SPI4_MISO_1 -#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_1 -#define GPIO_SPI4_SCK GPIO_SPI4_SCK_1 - - -#endif /* __ARCH_BOARD_BOARD_H */ diff --git a/boards/mro/x21/nuttx-config/include/board_dma_map.h b/boards/mro/x21/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 96a4c81..0000000 --- a/boards/mro/x21/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/* -| DMA1 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | SPI3_RX_1 | - | SPI3_RX_2 | SPI2_RX | SPI2_TX | SPI3_TX_1 | - | SPI3_TX_2 | -| Channel 1 | I2C1_RX | - | TIM7_UP_1 | - | TIM7_UP_2 | I2C1_RX_1 | I2C1_TX | I2C1_TX_1 | -| Channel 2 | TIM4_CH1 | - | I2C4_RX | TIM4_CH2 | - | I2C4_RX | TIM4_UP | TIM4_CH3 | -| Channel 3 | - | TIM2_UP_1 | I2C3_RX_1 | I2C2_EXT_RX | I2C3_TX | TIM2_CH1 | TIM2_CH2 | TIM2_UP_2 | -| | | TIM2_CH3 | | | | | TIM2_CH4_1 | TIM2_CH4_2 | -| Channel 4 | UART5_RX | USART3_RX | UART4_RX | USART3_TX_1 | UART4_TX | USART2_RX | USART2_TX | UART5_TX | -| Channel 5 | UART8_TX | UART7_TX | TIM3_CH4 | UART7_RX | TIM3_CH1 | TIM3_CH2 | UART8_RX | TIM3_CH3 | -| | | | TIM3_UP | | TIM3_TRIG | | | | -| Channel 6 | TIM5_CH3 | TIM5_CH4_1 | TIM5_CH1 | TIM5_CH4_2 | TIM5_CH2 | - | TIM5_UP_2 | - | -| | TIM5_UP_1 | TIM5_TRIG_1 | | TIM5_TRIG_2 | | | | | -| Channel 7 | - | TIM6_UP | I2C2_RX | I2C2_RX_1 | USART3_TX_2 | DAC1 | DAC2 | I2C2_TX | -| | | | | | | | | | -| Usage | | USART3_RX | UART4_RX | UART7_RX | | USART2_RX | TIM4_UP | | - - -| DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | ADC1_1 | SAI1_A | TIM8_CH1_1 | SAI1_A_1 | ADC1_2 | SAI1_B_1 | TIM1_CH1_1 | - | -| | | | TIM8_CH2_1 | | | | TIM1_CH2_1 | | -| | | | TIM8_CH3_1 | | | | TIM1_CH3_1 | | -| Channel 1 | - | DCMI_1 | ADC2_1 | ADC2_2 | SAI1_B | SPI6_TX | SPI6_RX | DCMI_2 | -| Channel 2 | ADC3_1 | ADC3_2 | - | SPI5_RX_1 | SPI5_TX_1 | CRYP_OUT | CRYP_IN | HASH_IN | -| Channel 3 | SPI1_RX_1 | - | SPI1_RX_2 | SPI1_TX_1 | - | SPI1_TX_2 | - | QUADSPI | -| Channel 4 | SPI4_RX_1 | SPI4_TX_1 | USART1_RX_1 | SDIO | - | USART1_RX_2 | SDIO | USART1_TX | -| Channel 5 | - | USART6_RX_1 | USART6_RX_2 | SPI4_RX_2 | SPI4_TX_2 | - | USART6_TX_1 | USART6_TX_2 | -| Channel 6 | TIM1_TRIG_1 | TIM1_CH1_2 | TIM1_CH2_2 | TIM1_CH1 | TIM1_CH4 | TIM1_UP | TIM1_CH3_2 | - | -| | | | | | TIM1_TRIG_2 | | | | -| | | | | | TIM1_COM | | | | -| Channel 7 | - | TIM8_UP | TIM8_CH1_2 | TIM8_CH2_2 | TIM8_CH3_2 | SPI5_RX_2 | SPI5_TX_2 | TIM8_CH4 | -| | | | | | | | | TIM8_TRIG | -| | | | | | | | | TIM8_COM | -| | | | | | | | | | -| Usage | | USART6_RX_1 | SPI1_RX_2 | SPI1_TX_1 | | TIM1_UP | SDIO | USART6_TX_2 | - */ - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// DMAMAP_USART3_RX // DMA1, Stream 1, Channel 4 -// DMAMAP_UART4_RX // DMA1, Stream 2, Channel 4 -// DMAMAP_UART7_RX // DMA1, Stream 3, Channel 5 -// AVAILABLE // DMA1, Stream 4 -// DMAMAP_USART2_RX // DMA1, Stream 5, Channel 4 -// DMAMAP_TIM4_UP // DMA1, Stream 6, Channel 2 (DSHOT) - - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// AVAILABLE // DMA2, Stream 0 -#define DMAMAP_USART6_RX DMAMAP_USART6_RX_1 // DMA2, Stream 1, Channel 4 (PX4IO RX) -#define DMACHAN_SPI1_RX DMAMAP_SPI1_RX_2 // DMA2, Stream 2, Channel 3 (SPI1 sensors RX) -#define DMACHAN_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 3, Channel 3 (SPI1 sensors TX) -// AVAILABLE // DMA2, Stream 4 -// DMAMAP_TIM1_UP // DMA2, Stream 5, Channel 6 (DSHOT) -#define DMAMAP_SDIO DMAMAP_SDIO_2 // DMA2, Stream 6, Channel 4 -#define DMAMAP_USART6_TX DMAMAP_USART6_TX_2 // DMA2, Stream 7, Channel 5 (PX4IO TX) diff --git a/boards/mro/x21/nuttx-config/nsh/defconfig b/boards/mro/x21/nuttx-config/nsh/defconfig deleted file mode 100644 index 9d891cd..0000000 --- a/boards/mro/x21/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,253 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_STM32_CCMEXCLUDE is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/mro/x21/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F427V=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0021 -CONFIG_CDCACM_PRODUCTSTR="PX4 AUAV X2.1" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=2000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="AUAV" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=2 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDIO_BLOCKSETUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32_ADC1=y -CONFIG_STM32_BBSRAM=y -CONFIG_STM32_BBSRAM_FILES=5 -CONFIG_STM32_BKPSRAM=y -CONFIG_STM32_CCMDATARAM=y -CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y -CONFIG_STM32_DMA1=y -CONFIG_STM32_DMA2=y -CONFIG_STM32_FLASH_CONFIG_I=y -CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_STM32_I2C1=y -CONFIG_STM32_I2CTIMEOMS=10 -CONFIG_STM32_I2CTIMEOTICKS=10 -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_OTGFS=y -CONFIG_STM32_PWR=y -CONFIG_STM32_RTC=y -CONFIG_STM32_RTC_HSECLOCK=y -CONFIG_STM32_RTC_MAGIC=0xfacefeee -CONFIG_STM32_RTC_MAGIC_REG=1 -CONFIG_STM32_RTC_MAGIC_TIME_SET=0xfacefeef -CONFIG_STM32_SAVE_CRASHDUMP=y -CONFIG_STM32_SDIO=y -CONFIG_STM32_SDIO_CARD=y -CONFIG_STM32_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32_SPI1=y -CONFIG_STM32_SPI1_DMA=y -CONFIG_STM32_SPI1_DMA_BUFFER=512 -CONFIG_STM32_SPI2=y -CONFIG_STM32_SPI_DMATHRESHOLD=8 -CONFIG_STM32_TIM10=y -CONFIG_STM32_TIM11=y -CONFIG_STM32_TIM3=y -CONFIG_STM32_TIM9=y -CONFIG_STM32_UART4=y -CONFIG_STM32_UART7=y -CONFIG_STM32_UART8=y -CONFIG_STM32_USART1=y -CONFIG_STM32_USART2=y -CONFIG_STM32_USART3=y -CONFIG_STM32_USART6=y -CONFIG_STM32_USART_BREAKS=y -CONFIG_STM32_USART_SINGLEWIRE=y -CONFIG_STM32_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=300 -CONFIG_UART4_RXDMA=y -CONFIG_UART4_TXBUFSIZE=300 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=300 -CONFIG_UART7_RXDMA=y -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=300 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=300 -CONFIG_UART8_TXBUFSIZE=300 -CONFIG_USART1_RXBUFSIZE=128 -CONFIG_USART1_TXBUFSIZE=32 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=1100 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=300 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=600 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=300 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/mro/x21/nuttx-config/scripts/script.ld b/boards/mro/x21/nuttx-config/scripts/script.ld deleted file mode 100644 index 6d92733..0000000 --- a/boards/mro/x21/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************************** - * scripts/ld.script - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F427 has 2048Kb of FLASH beginning at address 0x0800:0000 and - * 256Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of SRAM beginning at address 0x2002:0000 - * 4) 64Kb of TCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 0x4000 of flash is reserved for the bootloader. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08004000, LENGTH = 2032K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 192K - ccsram (rwx) : ORIGIN = 0x10000000, LENGTH = 64K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/mro/x21/src/CMakeLists.txt b/boards/mro/x21/src/CMakeLists.txt deleted file mode 100644 index a7db459..0000000 --- a/boards/mro/x21/src/CMakeLists.txt +++ /dev/null @@ -1,50 +0,0 @@ -############################################################################ -# -# Copyright (c) 2015 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. -# -############################################################################ - -add_library(drivers_board - can.c - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - usb.c -) -target_link_libraries(drivers_board - PRIVATE - arch_spi - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer -) diff --git a/boards/mro/x21/src/board_config.h b/boards/mro/x21/src/board_config.h deleted file mode 100644 index be6da1a..0000000 --- a/boards/mro/x21/src/board_config.h +++ /dev/null @@ -1,182 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013-2016 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * mRo X2.1 internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ -/* Configuration ************************************************************************************/ - -/* PX4IO connection configuration */ -#define BOARD_USES_PX4IO_VERSION 2 -#define PX4IO_SERIAL_DEVICE "/dev/ttyS4" -#define PX4IO_SERIAL_TX_GPIO GPIO_USART6_TX -#define PX4IO_SERIAL_RX_GPIO GPIO_USART6_RX -#define PX4IO_SERIAL_BASE STM32_USART6_BASE /* hardwired on the board */ -#define PX4IO_SERIAL_VECTOR STM32_IRQ_USART6 -#define PX4IO_SERIAL_TX_DMAMAP DMAMAP_USART6_TX -#define PX4IO_SERIAL_RX_DMAMAP DMAMAP_USART6_RX -#define PX4IO_SERIAL_RCC_REG STM32_RCC_APB2ENR -#define PX4IO_SERIAL_RCC_EN RCC_APB2ENR_USART6EN -#define PX4IO_SERIAL_CLOCK STM32_PCLK2_FREQUENCY -#define PX4IO_SERIAL_BITRATE 1500000 /* 1.5Mbps -> max rate for IO */ - - -/* PX4FMU GPIOs ***********************************************************************************/ -/* LEDs */ - -#define GPIO_LED1 (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN12) -#define BOARD_OVERLOAD_LED LED_RED - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that can be used by the Px4 Firmware in the adc driver - */ -#define ADC_CHANNELS (1 << 2) | (1 << 3) | (1 << 4) | (1 << 13) | (1 << 14) | (1 << 15) - -// ADC defines to be used in sensors.cpp to read from a particular channel -#define ADC_BATTERY_VOLTAGE_CHANNEL 2 -#define ADC_BATTERY_CURRENT_CHANNEL 3 -#define ADC_5V_RAIL_SENSE 4 -#define ADC_AIRSPEED_VOLTAGE_CHANNEL 15 - -/* Power supply control and monitoring GPIOs */ -// Signal is not connected -#define GPIO_VDD_5V_PERIPH_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN8) -#define GPIO_VDD_BRICK_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5) -#define GPIO_VDD_3V3_SENSORS_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN3) -#define GPIO_VDD_5V_PERIPH_OC (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN15) - -/* Tone alarm output */ -#define TONE_ALARM_TIMER 2 /* timer 2 */ -#define TONE_ALARM_CHANNEL 1 /* channel 1 */ -#define GPIO_TONE_ALARM_IDLE (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) -#define GPIO_TONE_ALARM (GPIO_ALT|GPIO_AF1|GPIO_SPEED_2MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN15) - -/* PWM - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 6 - -/* USB OTG FS - * - * PA9 OTG_FS_VBUS VBUS sensing (also connected to the green LED) - */ -#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 8 /* use timer8 for the HRT */ -#define HRT_TIMER_CHANNEL 1 /* use capture/compare channel */ - -/* PWM input driver. Use FMU AUX5 pins attached to timer4 channel 2 */ -#define PWMIN_TIMER 4 -#define PWMIN_TIMER_CHANNEL 2 -#define GPIO_PWM_IN GPIO_TIM4_CH2IN_2 - -/* By Providing BOARD_ADC_USB_CONNECTED this board support the ADC - * system_power interface, and therefore provides the true logic - * GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_BRICK_VALID (!px4_arch_gpioread(GPIO_VDD_BRICK_VALID)) -#define BOARD_ADC_SERVO_VALID (1) -#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_VDD_5V_PERIPH_OC)) -#define BOARD_ADC_HIPOWER_5V_OC (0) - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ - -#define BOARD_HAS_ON_RESET 1 - -#define BOARD_HAS_STATIC_MANIFEST 1 - -__BEGIN_DECLS - -/**************************************************************************************************** - * Public Types - ****************************************************************************************************/ - -/**************************************************************************************************** - * Public data - ****************************************************************************************************/ - -#ifndef __ASSEMBLY__ - -/**************************************************************************************************** - * Public Functions - ****************************************************************************************************/ - -extern void board_peripheral_reset(int ms); - -/**************************************************************************************************** - * Name: stm32_usbinitialize - * - * Description: - * Called to configure USB IO. - * - ****************************************************************************************************/ - -extern void stm32_usbinitialize(void); - -/**************************************************************************************************** - * Name: stm32_spiinitialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the PX4FMU board. - * - ****************************************************************************************************/ - -extern void stm32_spiinitialize(void); - -#include - -#endif /* __ASSEMBLY__ */ -__END_DECLS diff --git a/boards/mro/x21/src/can.c b/boards/mro/x21/src/can.c deleted file mode 100644 index 89b8ba2..0000000 --- a/boards/mro/x21/src/can.c +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file can.c - * - * Board-specific CAN functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include - -#include -#include - -#include "chip.h" -#include "arm_internal.h" - -#include "stm32.h" -#include "stm32_can.h" -#include "board_config.h" - -#ifdef CONFIG_CAN - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) -# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." -# undef CONFIG_STM32_CAN2 -#endif - -#ifdef CONFIG_STM32_CAN1 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); - -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} - -#endif diff --git a/boards/mro/x21/src/i2c.cpp b/boards/mro/x21/src/i2c.cpp deleted file mode 100644 index e9f26f9..0000000 --- a/boards/mro/x21/src/i2c.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), -}; diff --git a/boards/mro/x21/src/init.c b/boards/mro/x21/src/init.c deleted file mode 100644 index 1073128..0000000 --- a/boards/mro/x21/src/init.c +++ /dev/null @@ -1,318 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * PX4FMU-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include "board_config.h" -#include - -#include - -#include -#include - -#include - -#include -#include -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/**************************************************************************** - * Protected Functions - ****************************************************************************/ -/**************************************************************************** - * Public Functions - ****************************************************************************/ -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(io_timer_channel_get_gpio_output(i)); - } - - /** - * On resets invoked from system (not boot) insure we establish a low - * output state (discharge the pins) on PWM pins before they become inputs. - */ - - if (status >= 0) { - up_mdelay(400); - } -} - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - /* set the peripheral rails off */ - stm32_configgpio(GPIO_VDD_5V_PERIPH_EN); - stm32_gpiowrite(GPIO_VDD_5V_PERIPH_EN, 1); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ - stm32_gpiowrite(GPIO_VDD_5V_PERIPH_EN, 0); -} - -/************************************************************************************ - * Name: stm32_boardinitialize - * - * Description: - * All STM32 architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. - * - ************************************************************************************/ - -__EXPORT void -stm32_boardinitialize(void) -{ - // Reset all PWM to Low outputs. - - board_on_reset(-1); - - /* configure LEDs */ - - board_autoled_initialize(); - - /* configure ADC pins */ - - px4_arch_configgpio(GPIO_ADC1_IN2); /* BATT_VOLTAGE_SENS */ - px4_arch_configgpio(GPIO_ADC1_IN3); /* BATT_CURRENT_SENS */ - px4_arch_configgpio(GPIO_ADC1_IN4); /* VDD_5V_SENS */ - px4_arch_configgpio(GPIO_ADC1_IN13); /* FMU_AUX_ADC_1 */ - px4_arch_configgpio(GPIO_ADC1_IN14); /* FMU_AUX_ADC_2 */ - px4_arch_configgpio(GPIO_ADC1_IN15); /* PRESSURE_SENS */ - - /* configure power supply control/sense pins */ - px4_arch_configgpio(GPIO_VDD_5V_PERIPH_EN); - px4_arch_configgpio(GPIO_VDD_3V3_SENSORS_EN); - px4_arch_configgpio(GPIO_VDD_BRICK_VALID); - px4_arch_configgpio(GPIO_VDD_5V_PERIPH_OC); - - /* configure CAN interface */ - - stm32_configgpio(GPIO_CAN1_RX); - stm32_configgpio(GPIO_CAN1_TX); - - /* configure SPI interfaces */ - - stm32_spiinitialize(); - - /* configure USB interface */ - - stm32_usbinitialize(); - -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - - -static struct spi_dev_s *spi1; -static struct spi_dev_s *spi2; -static struct sdio_dev_s *sdio; - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - - px4_platform_init(); - - /* configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_AMBER); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_AMBER); - } - - /* Configure SPI-based devices */ - - spi1 = px4_spibus_initialize(1); - - if (!spi1) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 1\n"); - led_on(LED_AMBER); - } - - /* Default SPI1 to 1MHz and de-assert the known chip selects. */ - SPI_SETFREQUENCY(spi1, 10000000); - SPI_SETBITS(spi1, 8); - SPI_SETMODE(spi1, SPIDEV_MODE3); - up_udelay(20); - - /* Get the SPI port for the FRAM */ - - spi2 = px4_spibus_initialize(2); - - if (!spi2) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 2\n"); - led_on(LED_AMBER); - } - - /* Default SPI2 to 37.5 MHz (40 MHz rounded to nearest valid divider, F4 max) - * and de-assert the known chip selects. */ - - // XXX start with 10.4 MHz in FRAM usage and go up to 37.5 once validated - SPI_SETFREQUENCY(spi2, 12 * 1000 * 1000); - SPI_SETBITS(spi2, 8); - SPI_SETMODE(spi2, SPIDEV_MODE3); - SPI_SELECT(spi2, SPIDEV_FLASH(0), false); - - -#ifdef CONFIG_MMCSD - /* First, get an instance of the SDIO interface */ - sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO); - - if (!sdio) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", CONFIG_NSH_MMCSDSLOTNO); - led_on(LED_AMBER); - } - - /* Now bind the SDIO interface to the MMC/SD driver */ - int ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio); - - if (ret != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); - led_on(LED_AMBER); - } - - /* Then let's guess and say that there is a card in the slot. There is no card detect GPIO. */ - sdio_mediachange(sdio, true); - -#endif - - /* Configure the HW based on the manifest */ - px4_platform_configure(); - - return OK; -} diff --git a/boards/mro/x21/src/led.c b/boards/mro/x21/src/led.c deleted file mode 100644 index 8a70a4c..0000000 --- a/boards/mro/x21/src/led.c +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * LED backend. - */ - -#include - -#include - -#include "stm32.h" -#include - -#include "board_config.h" - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -__EXPORT void led_init() -{ - /* Configure LED1 GPIO for output */ - - px4_arch_configgpio(GPIO_LED1); -} - -__EXPORT void led_on(int led) -{ - if (led == 1) { - /* Pull down to switch on */ - px4_arch_gpiowrite(GPIO_LED1, false); - } -} - -__EXPORT void led_off(int led) -{ - if (led == 1) { - /* Pull up to switch off */ - px4_arch_gpiowrite(GPIO_LED1, true); - } -} - -__EXPORT void led_toggle(int led) -{ - if (led == 1) { - if (px4_arch_gpioread(GPIO_LED1)) { - px4_arch_gpiowrite(GPIO_LED1, false); - - } else { - px4_arch_gpiowrite(GPIO_LED1, true); - } - } -} diff --git a/boards/mro/x21/src/spi.cpp b/boards/mro/x21/src/spi.cpp deleted file mode 100644 index f20c857..0000000 --- a/boards/mro/x21/src/spi.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortC, GPIO::Pin15}, SPI::DRDY{GPIO::PortC, GPIO::Pin14}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20608G, SPI::CS{GPIO::PortC, GPIO::Pin15}, SPI::DRDY{GPIO::PortC, GPIO::Pin14}), - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortD, GPIO::Pin7}), - initSPIDevice(DRV_IMU_DEVTYPE_MPU9250, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), - }), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/mro/x21/src/timer_config.cpp b/boards/mro/x21/src/timer_config.cpp deleted file mode 100644 index 7bf538a..0000000 --- a/boards/mro/x21/src/timer_config.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1), - initIOTimer(Timer::Timer4), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortE, GPIO::Pin13}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/mro/x21/src/usb.c b/boards/mro/x21/src/usb.c deleted file mode 100644 index eed7869..0000000 --- a/boards/mro/x21/src/usb.c +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include - -#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_STM32_OTGFS - px4_arch_configgpio(GPIO_OTGFS_VBUS); - /* XXX We only support device mode - px4_arch_configgpio(GPIO_OTGFS_PWRON); - px4_arch_configgpio(GPIO_OTGFS_OVER); - */ -#endif -} - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - //ulldbg("resume: %d\n", resume); -} diff --git a/boards/nxp/fmuk66-e/default.px4board b/boards/nxp/fmuk66-e/default.px4board deleted file mode 100644 index 64e18c2..0000000 --- a/boards/nxp/fmuk66-e/default.px4board +++ /dev/null @@ -1,97 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS3" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS4" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS1" -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_COMMON_BAROMETERS=y -CONFIG_DRIVERS_BAROMETER_MPL3115A2=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DISTANCE_SENSOR_SRF05=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_BOSCH_BMI088=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_DRIVERS_UWB_UWB_SR150=y -CONFIG_COMMON_LIGHT=y -CONFIG_DRIVERS_LIGHTS_RGBLED_PWM=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SAFETY_BUTTON=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SERIAL_TEST=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_FAKE_GPS=y diff --git a/boards/nxp/fmuk66-e/extras/nxp_fmuk66-e_bootloader.bin b/boards/nxp/fmuk66-e/extras/nxp_fmuk66-e_bootloader.bin deleted file mode 100644 index 9193278..0000000 Binary files a/boards/nxp/fmuk66-e/extras/nxp_fmuk66-e_bootloader.bin and /dev/null differ diff --git a/boards/nxp/fmuk66-e/firmware.prototype b/boards/nxp/fmuk66-e/firmware.prototype deleted file mode 100644 index 0def290..0000000 --- a/boards/nxp/fmuk66-e/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 30, - "magic": "PX4FWv1", - "description": "Firmware for the NXPFMUK66E board", - "image": "", - "build_time": 0, - "summary": "NXPFMUK66E", - "version": "0.1", - "image_size": 0, - "image_maxsize": 2096112, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/nxp/fmuk66-e/init/rc.board_defaults b/boards/nxp/fmuk66-e/init/rc.board_defaults deleted file mode 100644 index eed00b7..0000000 --- a/boards/nxp/fmuk66-e/init/rc.board_defaults +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 10.177939394 -param set-default BAT1_A_PER_V 15.391030303 - -rgbled_pwm start -safety_button start diff --git a/boards/nxp/fmuk66-e/init/rc.board_sensors b/boards/nxp/fmuk66-e/init/rc.board_sensors deleted file mode 100644 index d47d01c..0000000 --- a/boards/nxp/fmuk66-e/init/rc.board_sensors +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# -# NXP fmuk66-e specific board defaults -#------------------------------------------------------------------------------ - -board_adc start - -# Internal Mag I2C bus roll 180, yaw 90 -bmm150 -I -R 10 start - -# Onboard I2C baros -bmp280 -I start - -# Internal SPI (accel + mag) -bmi088 -A -R 8 -s start -bmi088 -G -R 8 -s start - -# Internal SPI bus ICM-42688 -icm42688p -R 12 -s start diff --git a/boards/nxp/fmuk66-e/nuttx-config/Kconfig b/boards/nxp/fmuk66-e/nuttx-config/Kconfig deleted file mode 100644 index df8b0f6..0000000 --- a/boards/nxp/fmuk66-e/nuttx-config/Kconfig +++ /dev/null @@ -1,47 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see misc/tools/kconfig-language.txt. -# - -config FMUK66_SDHC_AUTOMOUNT - bool "SDHC automounter" - default n - depends on FS_AUTOMOUNTER && KINETIS_SDHC - -if FMUK66_SDHC_AUTOMOUNT - -config FMUK66_SDHC_AUTOMOUNT_FSTYPE - string "SDHC file system type" - default "vfat" - -config FMUK66_SDHC_AUTOMOUNT_BLKDEV - string "SDHC block device" - default "/dev/mmcsd0" - -config FMUK66_SDHC_AUTOMOUNT_MOUNTPOINT - string "SDHC mount point" - default "/fs/microsd" - -config FMUK66_SDHC_AUTOMOUNT_DDELAY - int "SDHC debounce delay (milliseconds)" - default 1000 - -config FMUK66_SDHC_AUTOMOUNT_UDELAY - int "SDHC unmount retry delay (milliseconds)" - default 2000 - -endif # FMUK66_SDHC_AUTOMOUNT - -config BOARD_HAS_PROBES - bool "Board provides GPIO or other Hardware for signaling to timing analyze." - default y - ---help--- - This board provides GPIO FMU-CH1-6 as PROBE_1-6 to provide timing signals from selected drivers. - -config BOARD_USE_PROBES - bool "Enable the use the board provided GPIO FMU-CH1-6 as PROBE_1-6 to provide timing signals from selected drivers" - default n - depends on BOARD_HAS_PROBES - - ---help--- - Select to use GPIO FMU-CH1-6 to provide timing signals from selected drivers. diff --git a/boards/nxp/fmuk66-e/nuttx-config/include/board.h b/boards/nxp/fmuk66-e/nuttx-config/include/board.h deleted file mode 100644 index c398222..0000000 --- a/boards/nxp/fmuk66-e/nuttx-config/include/board.h +++ /dev/null @@ -1,533 +0,0 @@ -/************************************************************************************ - * configs/nxp/fmuk66-e/include/board.h - * - * Copyright (C) 2016-2018 Gregory Nutt. All rights reserved. - * Authors: Gregory Nutt - * Jordan MacIntyre - * David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ - -#ifndef __CONFIG_NXP_FMUK66_V3_INCLUDE_BOARD_H -#define __CONFIG_NXP_FMUK66_V3_INCLUDE_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* - * The FMUK66-v3 is populated with a MK66FN2M0VLQ18 has 2 MiB of FLASH and - * 256 KiB of SRAM. - */ -/* Clocking *************************************************************************/ -/* The NXP FMUK66-E uses a 16MHz external powered Oscillator. The Kinetis MCU startup - * from an internal digitally-controlled oscillator (DCO). Nuttx will enable the main - * external oscillator EXTAL0. The external oscillator can range from - * 32.768 KHz up to 50 MHz. The default external source for the MCG oscillator inputs - * EXTAL. - * - * Y1 a High-frequency, Oscillator - */ -#define BOARD_EXTAL_LP 1 -#define BOARD_EXTAL_FREQ 16000000 /* 16MHz Oscillator Y1 */ -#define BOARD_XTAL32_FREQ 32768 /* 32KHz RTC Oscillator */ - -#define BOARD_OSC_CR OSC_CR_ERCLKEN /* Enable the OSCERCLK */ -#define BOARD_OSC_DIV OSC_DIV_ERPS_DIV1 /* No OSCERCLK Divide */ - -/* FLL Configuration. - * BOARD_EXTAL_FREQ / BOARD_FRDIV has to be in the range 31.25 kHz to 39.0625 - * 16 Mhz / MCG_C1_FRDIV_DIV512 = 31.25 kHz * 640 the default for MCG_C4 - * FLL is 20Mhz - */ -#define BOARD_FRDIV MCG_C1_FRDIV_DIV512 - -/* PLL Configuration. Either the external clock or crystal frequency is used to - * select the PRDIV value. Only reference clock frequencies are supported that will - * produce a KINETIS_MCG_PLL_REF_MIN=8MHz >= PLLIN <=KINETIS_MCG_PLL_REF_MAX=16Mhz - * reference clock to the PLL. - * - * PLL Input frequency: PLLIN = REFCLK / PRDIV = 16 MHz / 2 = 8Mhz MHz - * PLL Output frequency: PLLOUT = PLLIN * VDIV = 8 MHz * 42 = 336 MHz - * MCG Frequency: PLLOUT = 168 Mhz = 336 MHz / KINETIS_MCG_PLL_INTERNAL_DIVBY=2 - * - * PRDIV register value is the divider minus KINETIS_MCG_C5_PRDIV_BASE. - * VDIV register value is offset by KINETIS_MCG_C6_VDIV_BASE. - */ - -#define BOARD_PRDIV 2 /* PLL External Reference Divider */ -#define BOARD_VDIV 42 /* PLL VCO Divider (frequency multiplier) */ - -/* Define additional MCG_C2 Setting */ - -#define BOARD_MCG_C2_FCFTRIM 0 /* Do not enable FCFTRIM */ -#define BOARD_MCG_C2_LOCRE0 MCG_C2_LOCRE0 /* Enable reset on loss of clock */ - -#define BOARD_PLLIN_FREQ (BOARD_EXTAL_FREQ / BOARD_PRDIV) -#define BOARD_PLLOUT_FREQ (BOARD_PLLIN_FREQ * BOARD_VDIV) -#define BOARD_MCG_FREQ (BOARD_PLLOUT_FREQ/KINETIS_MCG_PLL_INTERNAL_DIVBY) - -/* SIM CLKDIV1 dividers */ - -#define BOARD_OUTDIV1 1 /* Core = MCG, 168 MHz */ -#define BOARD_OUTDIV2 3 /* Bus = MCG / 3, 56 MHz */ -#define BOARD_OUTDIV3 3 /* FlexBus = MCG / 3, 56 MHz */ -#define BOARD_OUTDIV4 6 /* Flash clock = MCG / 6, 28 MHz */ - -#define BOARD_CORECLK_FREQ (BOARD_MCG_FREQ / BOARD_OUTDIV1) -#define BOARD_BUS_FREQ (BOARD_MCG_FREQ / BOARD_OUTDIV2) -#define BOARD_FLEXBUS_FREQ (BOARD_MCG_FREQ / BOARD_OUTDIV3) -#define BOARD_FLASHCLK_FREQ (BOARD_MCG_FREQ / BOARD_OUTDIV4) - -/* Use BOARD_MCG_FREQ as the output SIM_SOPT2 MUX selected by - * SIM_SOPT2[PLLFLLSEL] - */ - -#define BOARD_SOPT2_PLLFLLSEL SIM_SOPT2_PLLFLLSEL_MCGPLLCLK -#define BOARD_SOPT2_FREQ BOARD_MCG_FREQ - -/* Divider output clock = Divider input clock × [ (USBFRAC+1) / (USBDIV+1) ] - * SIM_CLKDIV2_FREQ = BOARD_SOPT2_FREQ × [ (USBFRAC+1) / (USBDIV+1) ] - * 48Mhz = 168Mhz X [(1 + 1) / (6 + 1)] - * 48Mhz = 168Mhz / (6 + 1) * (1 + 1) - */ - -#define BOARD_SIM_CLKDIV2_USBFRAC 2 -#define BOARD_SIM_CLKDIV2_USBDIV 7 -#define BOARD_SIM_CLKDIV2_FREQ (BOARD_SOPT2_FREQ / BOARD_SIM_CLKDIV2_USBDIV * BOARD_SIM_CLKDIV2_USBFRAC) -#define BOARD_USB_CLKSRC SIM_SOPT2_USBSRC -#define BOARD_USB_FREQ BOARD_SIM_CLKDIV2_FREQ - - -/* Divider output clock = Divider input clock * ((PLLFLLFRAC+1)/(PLLFLLDIV+1)) - * SIM_CLKDIV3_FREQ = BOARD_SOPT2_FREQ × [ (PLLFLLFRAC+1) / (PLLFLLDIV+1)] - * 84 Mhz = 168 Mhz X [(0 + 1) / (1 + 1)] - * 84 Mhz = 168 Mhz / (1 + 1) * (0 + 1) - */ - -#define BOARD_SIM_CLKDIV3_PLLFLLFRAC 1 -#define BOARD_SIM_CLKDIV3_PLLFLLDIV 2 -#define BOARD_SIM_CLKDIV3_FREQ (BOARD_SOPT2_FREQ / BOARD_SIM_CLKDIV3_PLLFLLDIV * BOARD_SIM_CLKDIV3_PLLFLLFRAC) - -#define BOARD_LPUART0_CLKSRC SIM_SOPT2_LPUARTSRC_MCGCLK -#define BOARD_LPUART0_FREQ BOARD_SIM_CLKDIV3_FREQ - -#define BOARD_TPM_CLKSRC SIM_SOPT2_TPMSRC_OCSERCLK -#define BOARD_TPM_FREQ BOARD_EXTAL_FREQ - -/* SDHC clocking ********************************************************************/ - -/* SDCLK configurations corresponding to various modes of operation. Formula is: - * - * SDCLK frequency = (base clock) / (prescaler * divisor) - * - * The SDHC module is always configure configured so that the core clock is the base - * clock. Possible values for prescaler and divisor are: - * - * SDCLKFS: {2, 4, 8, 16, 32, 63, 128, 256} - * DVS: {1..16} - */ - -/* SDHC pull-up resistors **********************************************************/ - -/* There are external pull-ups on the NXP fmuk66-e - * So enable we do not them. - */ - -#undef BOARD_SDHC_ENABLE_PULLUPS - -/* Identification mode: Optimal 400KHz, Actual 168Mhz / (32 * 14) = 375 KHz */ - -#define BOARD_SDHC_IDMODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV32 -#define BOARD_SDHC_IDMODE_DIVISOR SDHC_SYSCTL_DVS_DIV(14) - -/* MMC normal mode: Optimal 20MHz, Actual 168Mhz / (2 * 5) = 16.8 MHz */ - -#define BOARD_SDHC_MMCMODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2 -#define BOARD_SDHC_MMCMODE_DIVISOR SDHC_SYSCTL_DVS_DIV(5) - -/* SD normal mode (1-bit): Optimal 20MHz, Actual 168Mhz / (2 * 5) = 16.8 MHz */ - -#define BOARD_SDHC_SD1MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2 -#define BOARD_SDHC_SD1MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(5) - -/* SD normal mode (4-bit): Optimal 25MHz, Actual Actual 168Mhz / (2 * 4) = 21 MHz (with DMA) - * SD normal mode (4-bit): Optimal 20MHz, Actual 168Mhz / (2 * 5) = 16.8 MHz (no DMA) - */ - -#ifdef CONFIG_KINETIS_SDHC_DMA -# define BOARD_SDHC_SD4MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2 -# define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(4) -#else -# define BOARD_SDHC_SD4MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2 -# define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(5) -#endif - - -/* LED definitions ******************************************************************/ -/* The NXP FMUK66-E has a separate Red, Green and Blue LEDs driven by the K66 as - * follows: - * - * LED K66 - * ------ ------------------------------------------------------- - * RED FB_CS0_b/ UART2_CTS_b / ADC0_SE5b / SPI0_SCK / FTM3_CH1/ PTD1 - * GREEN FTM2_FLT0/ CMP0_IN3/ FB_AD6 / I2S0_RX_BCLK/ FTM3_CH5/ ADC1_SE5b/ PTC9 - * BLUE CMP0_IN2/ FB_AD7 / I2S0_MCLK/ FTM3_CH4/ ADC1_SE4b/ PTC8 - * - * If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any - * way. The following definitions are used to access individual LEDs. - */ - -/* LED index values for use with board_userled() */ - -#define BOARD_LED_R 0 -#define BOARD_LED_G 1 -#define BOARD_LED_B 2 -#define BOARD_NLEDS 3 - -/* LED bits for use with board_userled_all() */ - -#define BOARD_LED_R_BIT (1 << BOARD_LED_R) -#define BOARD_LED_G_BIT (1 << BOARD_LED_G) -#define BOARD_LED_B_BIT (1 << BOARD_LED_B) - -/* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board - * the NXP FMUK66-E. The following definitions describe how NuttX controls - * the LEDs: - * - * SYMBOL Meaning LED state - * RED GREEN BLUE - * ------------------- ---------------------------- ----------------- */ -#define LED_STARTED 1 /* NuttX has been started OFF OFF OFF */ -#define LED_HEAPALLOCATE 2 /* Heap has been allocated OFF OFF ON */ -#define LED_IRQSENABLED 0 /* Interrupts enabled OFF OFF ON */ -#define LED_STACKCREATED 3 /* Idle stack created OFF ON OFF */ -#define LED_INIRQ 0 /* In an interrupt (no change) */ -#define LED_SIGNAL 0 /* In a signal handler (no change) */ -#define LED_ASSERTION 0 /* An assertion failed (no change) */ -#define LED_PANIC 4 /* The system has crashed FLASH OFF OFF */ -#undef LED_IDLE /* K66 is in sleep mode (Not used) */ - -/* Alternative pin resolution *******************************************************/ -/* If there are alternative configurations for various pins in the - * kinetis_k66pinmux.h header file, those alternative pins will be labeled with a - * suffix like _1, _2, etc. The logic in this file must select the correct pin - * configuration for the board by defining a pin configuration (with no suffix) that - * maps to the correct alternative. - */ - -/* CAN - * Signal Conn Port Pin Name - * ------- -------- ----- ----- -------- - * CAN0TX P8-2(H) PTB18 97 CAN0_TX - * CAN0RX P8-3(L) PTB19 98 CAN0_RX - * CAN1TX P19-2(H) PTC16 123 CAN1_TX - * CAN1RX P19-3(L) PTC17 124 CAN1_RX - * - */ -#define PIN_CAN0_RX PIN_CAN0_RX_2 -#define PIN_CAN0_TX PIN_CAN0_TX_2 -#define PIN_CAN1_RX PIN_CAN1_RX_2 -#define PIN_CAN1_TX PIN_CAN1_TX_2 - -/* 12C - * - */ - -/* I2C0 - * - * This device can be pinned out to be either or - - * Bit Pin Device Signal Usage Conn - * ----- --- ------- --------------------------- ------ - * PTB2 83 I2C0_SCL U_ECH Ultrasonic P13-3 - * PTB3 84 I2C0_SDA U_TRI Ultrasonic P13-2 - * ----- --- ------- --------------------------- ------ - * - * Bit Pin Device Signal Usage Conn - * ----- --- ------- --------------------------- ------ - * PTE24 45 I2C0_SCL IIC_SCL NFC Connector, IIC P2-2 - * PTE25 46 I2C0_SDA IIC_SDA NFC Connector, IIC P2-3 - * ----- --- ------- --------------------------- ------ - */ - -#define PIN_I2C0_SCL PIN_I2C0_SCL_4 /* PTE24 IIC_SCL */ -#define PIN_I2C0_SDA PIN_I2C0_SDA_4 /* PTE25 IIC_SDA */ - -/* I2C1 - * - * Bit Pin Device Signal Usage Conn - * ----- --- ------- -------------- ------------- ------ - * PTC10 115 I2C1_SCL P_SCL, GPS_SCL Pressure, GPS P3-4 - * PTC11 116 I2C1_SDA P_SDA, GPS_SDA Pressure, GPS P3-5 - * ----- --- ------- -------------- ------------- ------ - */ - -#define PIN_I2C1_SCL PIN_I2C1_SCL_1 /* PTC10 GPS / Pressure Sensor*/ -#define PIN_I2C1_SDA PIN_I2C1_SDA_1 /* PTC11 GPS / Pressure Sensor */ - - -/* SPI - * - */ - -/* SPI0 FRAM */ - -#define PIN_SPI0_PCS0 PIN_SPI0_PCS2_1 /* PTC2 SPI_CS FRAM_CS */ -#define PIN_SPI0_SCK PIN_SPI0_SCK_2 /* PTC5 SPI_CLK FRAM_SCK */ -#define PIN_SPI0_OUT PIN_SPI0_SOUT_2 /* PTC6 SPI_OUT FRAM_MOSI */ -#define PIN_SPI0_SIN PIN_SPI0_SIN_2 /* PTC7 SPI_IN FRAM_MISO */ - -/* SPI1 - * FXOS8700CQ Accelerometer - * FXAS21002CQ Gyroscope - */ - -#define PIN_SPI1_PCS0 PIN_SPI1_PCS0_1 /* PTB10 A_CS */ -#define PIN_SPI1_PCS1 PIN_SPI1_PCS1_1 /* PTB9 GM_CS */ -#define PIN_SPI1_SCK PIN_SPI1_SCK_1 /* PTB11 A_SCLK */ -#define PIN_SPI1_OUT PIN_SPI1_SOUT_1 /* PTB16 A_MOSI */ -#define PIN_SPI1_SIN PIN_SPI1_SIN_1 /* PTB17 A_MISO */ - -/* SPI2 - * Bit Pin Device Signal Conn - * ----- --- ------- --------- ------ - * PTB20 99 SPI2_PCS0 SPI2_CS P18-5 - * PTB21 100 SPI2_SCK SPI2_CLK P18-2 - * PTB22 101 SPI2_SOUT SPI2_OUT P18-3 - * PTB23 102 SPI2_SIN SPI2_IN P18-4 - * - */ - -#define PIN_SPI2_PCS0 PIN_SPI2_PCS0_1 /* PTB20 SPI2_CS */ -#define PIN_SPI2_SCK PIN_SPI2_SCK_1 /* PTB21 SPI2_CLK */ -#define PIN_SPI2_OUT PIN_SPI2_SOUT_1 /* PTB22 SPI2_OUT */ -#define PIN_SPI2_SIN PIN_SPI2_SIN_1 /* PTB23 SPI2_IN */ - -/* UART - * - * NuttX Will use LPUART0 as the Console - * - * LPUAR0 - * P16 Pin Name K66 Name - * -------- ------------ ------ --------- - * 2 UART_TX PTD9 LPUART0_TX - * 3 UART_RX PTD8 LPUART0_RX - * -------- ----- ------ --------- - */ - -#define PIN_LPUART0_RX (PIN_LPUART0_RX_3 | GPIO_PULLUP) -#define PIN_LPUART0_TX PIN_LPUART0_TX_3 - -/* UART0 - * - * J7 Pin Name K66 Name - * -------- ------------ ------- --------- - * 2 PTA2 UART0_TX - * 3 PTA1 UART0_RX - * 4 PTB3 UART0_CTS - * 5 PTB2 UART0_RTS - * -------- ------------ ------- --------- - */ - -#define PIN_UART0_RX PIN_UART0_RX_1 -#define PIN_UART0_TX PIN_UART0_TX_1 -#define PIN_UART0_CTS PIN_UART0_CTS_3 -#define PIN_UART0_RTS PIN_UART0_RTS_3 - -/* UART1 - * - * Pin Name K66 Name - * ------------- -------------- ----- --------- - * P14-3,P15-2 FrSky_IN_RC_IN PTC3 UART1_RX - * P14-2 FrSky_OUT PTC4 UART1_TX - * ------------- ------------ ----- --------- - */ - -#define PIN_UART1_RX PIN_UART1_RX_1 -#define PIN_UART1_TX PIN_UART1_TX_1 - -/* UART2 - * No Alternative pins for UART2 - * - * P7 Pin Name K66 Name - * -------- ------------ ------- --------- - * 2 GPS_TX PTD3 UART2_TX - * 3 GPS_RX PTD2 UART2_RX - * -------- ------------ ------- --------- - */ - -/* UART4 - * - * P10 Pin Name K66 Name - * -------- ------------ ------- --------- - * 2 UART4_TX PTC15 UART4_TX - * 3 UART4_RX PTC14 UART4_RX - * 4 UART4_CTS PTC13 UART4_CTS - * 5 UART4_RTS PTE27 UART4_RTS - * -------- ------------ ------- --------- - */ - -#define PIN_UART4_RX PIN_UART4_RX_1 -#define PIN_UART4_TX PIN_UART4_TX_1 -#define PIN_UART4_RTS PIN_UART4_RTS_2 -#define PIN_UART4_CTS PIN_UART4_CTS_1 - -/* - * Ethernet TJA1100 OPEN Alliance BroadR-Reach PHY for Automotive Ethernet - * ----------------------------------------------------------------------- - * - * -------------- ----------------- ----------------------------------------- - * TJA1100 Board Signal(s) K66F Pin - * Pin Signal Function pinmux Name - * --- ---------- ----------------- ------------------------------------------ - * 1 MDC RMII0_MDC PTB1/RMII0_MDC PIN_RMII0_MDC - * 2 INT RMII0_INT_B, PTA27 PTA27 - * 3 nRST ENET_RST PTA28 PTA28 - * 4 VDDA(1V8) Cap to GND --- --- - * 5 XO 25Mhz OSC --- --- - * 6 XI 25Mhz OSC --- --- - * 7 VDDA(3V3) E_3V3 --- --- - * 8 LED (LED_ENABLE = 1) WAKE (LED_ENABLE = 0) --- - * 8 VBAT E_3V3 --- --- - * 10 nINH ENET_INH PTA8 PTA8 - * 11 VDDA(TX) E_3V3 --- --- - * 12 TRX_P ENET_P --- --- - * 13 TRX_M ENET_P --- --- - * 14 VDDD(3V3) E_3V3 --- --- - * 15 GND --- --- --- - * 16 VDDD(1V8) Cap to GND --- --- - * 17 RXER RMII0_RXER PTA5/RMII0_RXER PIN_RMII0_RXER - * 18 CRS_DIV RMII_CRSDV PTA14/RMII0_CRS_DV PIN_RMII0_CRS_DV - * 19 TXEN RMII0_TXEN PTA15/RMII0_TXEN PIN_RMII0_TXEN - * 20 GND --- --- --- - * 21 CONFIG1 ENET_CON1 THIS PIN IS A NO CONNECT - * 22 CONFIG0 ENET_CONFIG0 PTA24 PTA24 - * 23 RXD1 RMII0_RXD_1 PTA12/RMII0_RXD1 PIN_RMII0_RXD1 - * 24 RXD0 RMII0_RXD_0 PTA13/RMII0_RXD0 PIN_RMII0_RXD0 - * 25 REF_CLK E_REF_CLK PTE26/ENET_1588_CLKIN PIN_ENET_1588_CLKIN - * 26 GND2 --- --- --- - * 27 VDD(IO) E_3V3 --- --- - * 28 TXC --- --- --- - * 29 TXEN RMII_TXEN PTA15/RMII0_TXEN PIN_RMII0_TXEN - * 30 TXD3 - * 31 TXD2 - * 32 TXD1 RMII0_TXD_1 PTA17/RMII0_TXD1 PIN_RMII0_TXD1 - * 33 TXD0 RMII0_TXD_0 PTA16/RMII0_TXD0 PIN_RMII0_TXD0 - * 34 TXER - * 35 EN ENET_EN PTA29 PTA29 - * 36 MDIO RMII0_MDIO PTB0/RMII0_MDIO PIN_RMII0_MDIO - * --- ---------- ----------------- ------------------------------------ - * - */ - -#define PIN_RMII0_MDIO PIN_RMII0_MDIO_1 -#define PIN_RMII0_MDC PIN_RMII0_MDC_1 -#define PIN_ENET_PHY_RST (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTA | PIN28) -#define PIN_ENET_PHY_EN (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTA | PIN29) - -/* Board provides GPIO or other Hardware for signaling to timing analyzer */ - -#if defined(CONFIG_BOARD_USE_PROBES) -# define PROBE_N(n) (1<<((n)-1)) -# define PROBE_1 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZER0 | PIN_PORTC | PIN1) -# define PROBE_2 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZER0 | PIN_PORTA | PIN6) -# define PROBE_3 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZER0 | PIN_PORTD | PIN4) -# define PROBE_4 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZER0 | PIN_PORTD | PIN5) -# define PROBE_5 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZER0 | PIN_PORTE | PIN11) -# define PROBE_6 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZER0 | PIN_PORTE | PIN12) - -# define PROBE_INIT(mask) \ - do { \ - if ((mask)& PROBE_N(1)) { kinetis_pinconfig(PROBE_1); } \ - if ((mask)& PROBE_N(2)) { kinetis_pinconfig(PROBE_2); } \ - if ((mask)& PROBE_N(3)) { kinetis_pinconfig(PROBE_3); } \ - if ((mask)& PROBE_N(4)) { kinetis_pinconfig(PROBE_4); } \ - if ((mask)& PROBE_N(5)) { kinetis_pinconfig(PROBE_5); } \ - if ((mask)& PROBE_N(6)) { kinetis_pinconfig(PROBE_6); } \ - } while(0) - -# define PROBE(n,s) do {kinetis_gpiowrite(PROBE_##n,(s));}while(0) -# define PROBE_MARK(n) PROBE(n,false);PROBE(n,true) -#else -# define PROBE_INIT(mask) -# define PROBE(n,s) -# define PROBE_MARK(n) -#endif - -/************************************************************************************ - * Public Data - ************************************************************************************/ - -#ifndef __ASSEMBLY__ - -#undef EXTERN -#if defined(__cplusplus) -#define EXTERN extern "C" -extern "C" -{ -#else -#define EXTERN extern -#endif - -/************************************************************************************ - * Public Function Prototypes - ************************************************************************************/ - -/************************************************************************************ - * Name: kinetis_boardinitialize - * - * Description: - * All kinetis architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. - * - ************************************************************************************/ - -void kinetis_boardinitialize(void); - -#undef EXTERN -#if defined(__cplusplus) -} -#endif - -#endif /* __ASSEMBLY__ */ -#endif /* __CONFIG_NXP_FMUK66_V3_INCLUDE_BOARD_H */ diff --git a/boards/nxp/fmuk66-e/nuttx-config/nsh/defconfig b/boards/nxp/fmuk66-e/nuttx-config/nsh/defconfig deleted file mode 100644 index 6b9fa1a..0000000 --- a/boards/nxp/fmuk66-e/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,217 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_OS_API is not set -# CONFIG_KINETIS_EDMA_HOE is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/nxp/fmuk66-e/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="kinetis" -CONFIG_ARCH_CHIP_KINETIS=y -CONFIG_ARCH_CHIP_MK66FN2M0VMD18=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_LOOPSPERMSEC=15175 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_BULKIN_REQLEN=96 -CONFIG_CDCACM_PRODUCTID=0x001c -CONFIG_CDCACM_PRODUCTSTR="PX4 FMUK66 E" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=8000 -CONFIG_CDCACM_VENDORID=0x1FC9 -CONFIG_CDCACM_VENDORSTR="NXP SEMICONDUCTORS" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_ETH0_PHY_TJA1100=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_AUTOMOUNTER=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_IOB_NBUFFERS=24 -CONFIG_IOB_THROTTLE=0 -CONFIG_KINETIS_ADC0=y -CONFIG_KINETIS_ADC1=y -CONFIG_KINETIS_CRC=y -CONFIG_KINETIS_EDMA=y -CONFIG_KINETIS_EDMA_ELINK=y -CONFIG_KINETIS_EDMA_ERCA=y -CONFIG_KINETIS_EDMA_ERGA=y -CONFIG_KINETIS_EDMA_NTCD=16 -CONFIG_KINETIS_EMAC_RMIICLK1588CLKIN=y -CONFIG_KINETIS_ENET=y -CONFIG_KINETIS_FLEXCAN0=y -CONFIG_KINETIS_FLEXCAN1=y -CONFIG_KINETIS_GPIOIRQ=y -CONFIG_KINETIS_I2C0=y -CONFIG_KINETIS_I2C1=y -CONFIG_KINETIS_LPTMR0=y -CONFIG_KINETIS_LPUART0=y -CONFIG_KINETIS_LPUART0_RXDMA=y -CONFIG_KINETIS_MERGE_TTY=y -CONFIG_KINETIS_PDB=y -CONFIG_KINETIS_PIT=y -CONFIG_KINETIS_PORTAINTS=y -CONFIG_KINETIS_PORTBINTS=y -CONFIG_KINETIS_PORTCINTS=y -CONFIG_KINETIS_PORTDINTS=y -CONFIG_KINETIS_PORTEINTS=y -CONFIG_KINETIS_RTC=y -CONFIG_KINETIS_SDHC=y -CONFIG_KINETIS_SERIALBRK_BSDCOMPAT=y -CONFIG_KINETIS_SPI0=y -CONFIG_KINETIS_SPI1=y -CONFIG_KINETIS_SPI1_DMA=y -CONFIG_KINETIS_SPI2=y -CONFIG_KINETIS_SPI_DMA=y -CONFIG_KINETIS_UART0=y -CONFIG_KINETIS_UART0_RXDMA=y -CONFIG_KINETIS_UART1=y -CONFIG_KINETIS_UART1_RXDMA=y -CONFIG_KINETIS_UART2=y -CONFIG_KINETIS_UART2_RXDMA=y -CONFIG_KINETIS_UART4=y -CONFIG_KINETIS_UART4_RXDMA=y -CONFIG_KINETIS_UARTFIFOS=y -CONFIG_KINETIS_UART_BREAKS=y -CONFIG_KINETIS_UART_EXTEDED_BREAK=y -CONFIG_KINETIS_UART_INVERT=y -CONFIG_KINETIS_USBDCD=y -CONFIG_KINETS_LPUART_LOWEST=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_LPUART0_BAUD=57600 -CONFIG_LPUART0_SERIAL_CONSOLE=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_MULTIBLOCK_LIMIT=1 -CONFIG_MMCSD_SDIO=y -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NETDEV_PHY_IOCTL=y -CONFIG_NETINIT_THREAD=y -CONFIG_NETINIT_THREAD_PRIORITY=49 -CONFIG_NET_ARP_IPIN=y -CONFIG_NET_ARP_SEND=y -CONFIG_NET_BROADCAST=y -CONFIG_NET_ICMP=y -CONFIG_NET_ICMP_SOCKET=y -CONFIG_NET_SOCKOPTS=y -CONFIG_NET_SOLINGER=y -CONFIG_NET_TCP=y -CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_WRITE_BUFFERS=y -CONFIG_NET_UDP=y -CONFIG_NET_UDP_CHECKSUMS=y -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_DISABLE_BASENAME=y -CONFIG_NSH_DISABLE_DIRNAME=y -CONFIG_NSH_DISABLE_HEXDUMP=y -CONFIG_NSH_DISABLE_LOSETUP=y -CONFIG_NSH_DISABLE_MKFIFO=y -CONFIG_NSH_DISABLE_MKRD=y -CONFIG_NSH_DISABLE_PRINTF=y -CONFIG_NSH_DISABLE_PUT=y -CONFIG_NSH_DISABLE_REBOOT=y -CONFIG_NSH_DISABLE_UNAME=y -CONFIG_NSH_DISABLE_WGET=y -CONFIG_NSH_DISABLE_XD=y -CONFIG_NSH_FILEIOSIZE=512 -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_READLINE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x1fff0000 -CONFIG_RAW_BINARY=y -CONFIG_RTC=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_CUTERM=y -CONFIG_SYSTEM_CUTERM_DEFAULT_BAUD=57600 -CONFIG_SYSTEM_NSH=y -CONFIG_SYSTEM_PING=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART0_IFLOWCONTROL=y -CONFIG_UART0_OFLOWCONTROL=y -CONFIG_UART1_RXBUFSIZE=600 -CONFIG_UART1_TXBUFSIZE=1100 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_IFLOWCONTROL=y -CONFIG_UART4_OFLOWCONTROL=y -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1100 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_DUALSPEED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 -CONFIG_WATCHDOG=y diff --git a/boards/nxp/fmuk66-e/nuttx-config/scripts/script.ld b/boards/nxp/fmuk66-e/nuttx-config/scripts/script.ld deleted file mode 100644 index 1d88883..0000000 --- a/boards/nxp/fmuk66-e/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,162 +0,0 @@ -/**************************************************************************** - * configs/nxp_fmuk66-e/scripts/flash.ld - * - * Copyright (C) 2016, 2017 Gregory Nutt. All rights reserved. - * Authors: Gregory Nutt - * David Sidrane - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The MK66FN2M0VLQ18 has 2 MiB of FLASH beginning at address 0x0000:0000 and - * 256 KiB of SRAM beginning at address 0x1fff:0000- (SRAM_L) (64Kib) and - * 0x2000:0000 196 Kib (SRAM_U). - * - * NOTE: that the first part of the K66 FLASH region is reserved for - * interrupt vectflash and, following that, is a region from 0x0000:0400 - * to 0x0000:040f that is reserved for the FLASH control fields (FCF). - * - * NOTE: The on-chip RAM is split evenly among SRAM_L and SRAM_U. The RAM is - * also implemented such that the SRAM_L and SRAM_U ranges form a - * contiguous block in the memory map. - */ - -MEMORY -{ - vectflash (rx) : ORIGIN = 0x00006000, LENGTH = 1K - cfmprotect (rx) : ORIGIN = 0x00006400, LENGTH = 16 - progflash (rx) : ORIGIN = 0x00006410, LENGTH = 2M - ((6*4K) + 1K + 16) - datasram (rwx) : ORIGIN = 0x1fff0000, LENGTH = 256K -} - -OUTPUT_ARCH(arm) -ENTRY(__start) -EXTERN(__flashconfigbytes) -SECTIONS -{ - .vectors : { - _svectors = ABSOLUTE(.); - KEEP(*(.vectors)) - _evectors = ABSOLUTE(.); - } > vectflash - - .cfmprotect : { - KEEP(*(.cfmconfig)) - } > cfmprotect - - .text : { - _stext = ABSOLUTE(.); - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - . = ALIGN(8); - FILL(0xff) - . += 8; - } > progflash =0xff - - /* - * Init functions (static constructors and the like) - */ - - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - . = ALIGN(8); - FILL(0xff) - . += 8; - } > progflash - - .ARM.extab : { - *(.ARM.extab*) - . = ALIGN(8); - FILL(0xff) - . += 8; - } > progflash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > progflash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - . = ALIGN(8); - FILL(0xff) - . += 8; - } > datasram AT > progflash - - .ramfunc ALIGN(4): { - _sramfuncs = ABSOLUTE(.); - *(.ramfunc .ramfunc.*) - _eramfuncs = ABSOLUTE(.); - . = ALIGN(8); - FILL(0xff) - . += 8; - } > datasram AT > progflash =0xff - - _framfuncs = LOADADDR(.ramfunc); - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > datasram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/nxp/fmuk66-e/nuttx-config/socketcan/defconfig b/boards/nxp/fmuk66-e/nuttx-config/socketcan/defconfig deleted file mode 100644 index 2d05953..0000000 --- a/boards/nxp/fmuk66-e/nuttx-config/socketcan/defconfig +++ /dev/null @@ -1,224 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_OS_API is not set -# CONFIG_KINETIS_EDMA_HOE is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/nxp/fmuk66-e/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="kinetis" -CONFIG_ARCH_CHIP_KINETIS=y -CONFIG_ARCH_CHIP_MK66FN2M0VMD18=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_LOOPSPERMSEC=15175 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CAN_CONNS=1 -CONFIG_CDCACM=y -CONFIG_CDCACM_BULKIN_REQLEN=96 -CONFIG_CDCACM_PRODUCTID=0x001c -CONFIG_CDCACM_PRODUCTSTR="PX4 FMUK66 v3.x" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=8000 -CONFIG_CDCACM_VENDORID=0x1FC9 -CONFIG_CDCACM_VENDORSTR="NXP SEMICONDUCTORS" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_ETH0_PHY_TJA1100=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_AUTOMOUNTER=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_IOB_NBUFFERS=48 -CONFIG_IOB_NCHAINS=18 -CONFIG_KINETIS_ADC0=y -CONFIG_KINETIS_ADC1=y -CONFIG_KINETIS_CRC=y -CONFIG_KINETIS_EDMA=y -CONFIG_KINETIS_EDMA_ELINK=y -CONFIG_KINETIS_EDMA_ERCA=y -CONFIG_KINETIS_EDMA_ERGA=y -CONFIG_KINETIS_EDMA_NTCD=16 -CONFIG_KINETIS_EMAC_RMIICLK1588CLKIN=y -CONFIG_KINETIS_ENET=y -CONFIG_KINETIS_FLEXCAN0=y -CONFIG_KINETIS_FLEXCAN1=y -CONFIG_KINETIS_GPIOIRQ=y -CONFIG_KINETIS_I2C0=y -CONFIG_KINETIS_I2C1=y -CONFIG_KINETIS_LPTMR0=y -CONFIG_KINETIS_LPUART0=y -CONFIG_KINETIS_LPUART0_RXDMA=y -CONFIG_KINETIS_MERGE_TTY=y -CONFIG_KINETIS_PDB=y -CONFIG_KINETIS_PIT=y -CONFIG_KINETIS_PORTAINTS=y -CONFIG_KINETIS_PORTBINTS=y -CONFIG_KINETIS_PORTCINTS=y -CONFIG_KINETIS_PORTDINTS=y -CONFIG_KINETIS_PORTEINTS=y -CONFIG_KINETIS_RTC=y -CONFIG_KINETIS_SDHC=y -CONFIG_KINETIS_SERIALBRK_BSDCOMPAT=y -CONFIG_KINETIS_SPI0=y -CONFIG_KINETIS_SPI1=y -CONFIG_KINETIS_SPI1_DMA=y -CONFIG_KINETIS_SPI2=y -CONFIG_KINETIS_SPI_DMA=y -CONFIG_KINETIS_UART0=y -CONFIG_KINETIS_UART0_RXDMA=y -CONFIG_KINETIS_UART1=y -CONFIG_KINETIS_UART1_RXDMA=y -CONFIG_KINETIS_UART2=y -CONFIG_KINETIS_UART2_RXDMA=y -CONFIG_KINETIS_UART4=y -CONFIG_KINETIS_UART4_RXDMA=y -CONFIG_KINETIS_UARTFIFOS=y -CONFIG_KINETIS_UART_BREAKS=y -CONFIG_KINETIS_UART_EXTEDED_BREAK=y -CONFIG_KINETIS_UART_INVERT=y -CONFIG_KINETIS_USBDCD=y -CONFIG_KINETS_LPUART_LOWEST=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_LPUART0_BAUD=57600 -CONFIG_LPUART0_SERIAL_CONSOLE=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_MULTIBLOCK_LIMIT=1 -CONFIG_MMCSD_SDIO=y -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NETDEV_IFINDEX=y -CONFIG_NETDEV_LATEINIT=y -CONFIG_NETUTILS_TELNETD=y -CONFIG_NET_BROADCAST=y -CONFIG_NET_CAN=y -CONFIG_NET_CAN_NOTIFIER=y -CONFIG_NET_CAN_RAW_FILTER_MAX=0 -CONFIG_NET_CAN_RAW_TX_DEADLINE=y -CONFIG_NET_CAN_SOCK_OPTS=y -CONFIG_NET_ICMP=y -CONFIG_NET_ICMP_SOCKET=y -CONFIG_NET_TCP=y -CONFIG_NET_TIMESTAMP=y -CONFIG_NET_UDP=y -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_DISABLE_BASENAME=y -CONFIG_NSH_DISABLE_DD=y -CONFIG_NSH_DISABLE_DIRNAME=y -CONFIG_NSH_DISABLE_HEXDUMP=y -CONFIG_NSH_DISABLE_LOSETUP=y -CONFIG_NSH_DISABLE_MKFIFO=y -CONFIG_NSH_DISABLE_MKRD=y -CONFIG_NSH_DISABLE_PUT=y -CONFIG_NSH_DISABLE_REBOOT=y -CONFIG_NSH_DISABLE_UNAME=y -CONFIG_NSH_DISABLE_WGET=y -CONFIG_NSH_DISABLE_XD=y -CONFIG_NSH_FILEIOSIZE=512 -CONFIG_NSH_IOBUFFER_SIZE=256 -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_READLINE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_TELNETD_CLIENTSTACKSIZE=1280 -CONFIG_NSH_TELNETD_DAEMONSTACKSIZE=1024 -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x1fff0000 -CONFIG_RAW_BINARY=y -CONFIG_RTC=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_CUTERM=y -CONFIG_SYSTEM_CUTERM_DEFAULT_BAUD=57600 -CONFIG_SYSTEM_NSH=y -CONFIG_SYSTEM_PING=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TELNET_IOTHREAD_STACKSIZE=512 -CONFIG_TELNET_MAXLCLIENTS=1 -CONFIG_TELNET_RXBUFFER_SIZE=128 -CONFIG_TELNET_TXBUFFER_SIZE=128 -CONFIG_UART0_IFLOWCONTROL=y -CONFIG_UART0_OFLOWCONTROL=y -CONFIG_UART1_RXBUFSIZE=600 -CONFIG_UART1_TXBUFSIZE=1100 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_IFLOWCONTROL=y -CONFIG_UART4_OFLOWCONTROL=y -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1100 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_DUALSPEED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 -CONFIG_WATCHDOG=y diff --git a/boards/nxp/fmuk66-e/socketcan.px4board b/boards/nxp/fmuk66-e/socketcan.px4board deleted file mode 100644 index 874c6d5..0000000 --- a/boards/nxp/fmuk66-e/socketcan.px4board +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG_DRIVERS_UAVCAN=n -CONFIG_CYPHAL_BMS_SUBSCRIBER=y -CONFIG_CYPHAL_UORB_SENSOR_GPS_SUBSCRIBER=y -CONFIG_DRIVERS_CYPHAL=y diff --git a/boards/nxp/fmuk66-e/src/CMakeLists.txt b/boards/nxp/fmuk66-e/src/CMakeLists.txt deleted file mode 100644 index 090e216..0000000 --- a/boards/nxp/fmuk66-e/src/CMakeLists.txt +++ /dev/null @@ -1,54 +0,0 @@ -############################################################################ -# -# Copyright (c) 2016, 2018 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. -# -############################################################################ - -add_library(drivers_board - autoleds.c - automount.c - can.c - i2c.cpp - init.c - led.c - sdhc.c - spi.cpp - timer_config.cpp - usb.c -) - -target_link_libraries(drivers_board - PRIVATE - arch_io_pins - nuttx_arch # sdio - nuttx_drivers # sdio - drivers__led # drv_led_start - px4_layer - ) diff --git a/boards/nxp/fmuk66-e/src/autoleds.c b/boards/nxp/fmuk66-e/src/autoleds.c deleted file mode 100644 index 79efd95..0000000 --- a/boards/nxp/fmuk66-e/src/autoleds.c +++ /dev/null @@ -1,164 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016-2018 Gregory Nutt. All rights reserved. - * Authors: Gregory Nutt - * David Sidrane - * - * - * 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 NuttX 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. - * - ****************************************************************************/ -/* - * This module shall be used during board bring up of Nuttx. - * - * The NXP FMUK66-E has a separate Red, Green and Blue LEDs driven by the K66 - * as follows: - * - * LED K66 - * ------ ------------------------------------------------------- - * RED FB_CS0_b/ UART2_CTS_b / ADC0_SE5b / SPI0_SCK / FTM3_CH1/ PTD1 - * GREEN FTM2_FLT0/ CMP0_IN3/ FB_AD6 / I2S0_RX_BCLK/ FTM3_CH5/ ADC1_SE5b/ PTC9 - * BLUE CMP0_IN2/ FB_AD7 / I2S0_MCLK/ FTM3_CH4/ ADC1_SE4b/ PTC8 - * - * If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board - * the NXP fmuk66-e. The following definitions describe how NuttX controls - * the LEDs: - * - * SYMBOL Meaning LED state - * RED GREEN BLUE - * ------------------- ----------------------- ----------------- - * LED_STARTED NuttX has been started OFF OFF OFF - * LED_HEAPALLOCATE Heap has been allocated OFF OFF ON - * LED_IRQSENABLED Interrupts enabled OFF OFF ON - * LED_STACKCREATED Idle stack created OFF ON OFF - * LED_INIRQ In an interrupt (no change) - * LED_SIGNAL In a signal handler (no change) - * LED_ASSERTION An assertion failed (no change) - * LED_PANIC The system has crashed FLASH OFF OFF - * LED_IDLE K66 is in sleep mode (Optional, not used) - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include - -#include -#include - -#include "chip.h" -#include "kinetis.h" -#include "board_config.h" - -#ifdef CONFIG_ARCH_LEDS - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Summary of all possible settings */ - -#define LED_NOCHANGE 0 /* LED_IRQSENABLED, LED_INIRQ, LED_SIGNAL, LED_ASSERTION */ -#define LED_OFF_OFF_OFF 1 /* LED_STARTED */ -#define LED_OFF_OFF_ON 2 /* LED_HEAPALLOCATE */ -#define LED_OFF_ON_OFF 3 /* LED_STACKCREATED */ -#define LED_ON_OFF_OFF 4 /* LED_PANIC */ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_autoled_initialize - * - * Description: - * Initialize the on-board LED - * - ****************************************************************************/ - -void board_autoled_initialize(void) -{ - kinetis_pinconfig(GPIO_LED_R); - kinetis_pinconfig(GPIO_LED_G); - kinetis_pinconfig(GPIO_LED_B); -} - -/**************************************************************************** - * Name: board_autoled_on - ****************************************************************************/ - -void board_autoled_on(int led) -{ - if (led != LED_NOCHANGE) { - bool redoff = true; - bool greenoff = true; - bool blueoff = true; - - switch (led) { - default: - case LED_OFF_OFF_OFF: - break; - - case LED_OFF_OFF_ON: - blueoff = false; - break; - - case LED_OFF_ON_OFF: - greenoff = false; - break; - - case LED_ON_OFF_OFF: - redoff = false; - break; - } - - kinetis_gpiowrite(GPIO_LED_R, redoff); - kinetis_gpiowrite(GPIO_LED_G, greenoff); - kinetis_gpiowrite(GPIO_LED_B, blueoff); - } -} - -/**************************************************************************** - * Name: board_autoled_off - ****************************************************************************/ - -void board_autoled_off(int led) -{ - if (led == LED_ON_OFF_OFF) { - kinetis_gpiowrite(GPIO_LED_R, true); - kinetis_gpiowrite(GPIO_LED_G, true); - kinetis_gpiowrite(GPIO_LED_B, true); - } -} - -#endif /* CONFIG_ARCH_LEDS */ diff --git a/boards/nxp/fmuk66-e/src/automount.c b/boards/nxp/fmuk66-e/src/automount.c deleted file mode 100644 index f69f7fc..0000000 --- a/boards/nxp/fmuk66-e/src/automount.c +++ /dev/null @@ -1,304 +0,0 @@ -/************************************************************************************ - * - * Copyright (C) 2016-2018 Gregory Nutt. All rights reserved. - * Authors: Gregory Nutt - * David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#if defined(CONFIG_FS_AUTOMOUNTER_DEBUG) && !defined(CONFIG_DEBUG_FS) -# define CONFIG_DEBUG_FS 1 -#endif - -#include -#include - -#include -#include -#include - -#include "board_config.h" -#ifdef HAVE_AUTOMOUNTER - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Types - ************************************************************************************/ -/* This structure represents the changeable state of the automounter */ - -struct fmuk66_automount_state_s { - volatile automount_handler_t handler; /* Upper half handler */ - FAR void *arg; /* Handler argument */ - bool enable; /* Fake interrupt enable */ - bool pending; /* Set if there an event while disabled */ -}; - -/* This structure represents the static configuration of an automounter */ - -struct fmuk66_automount_config_s { - /* This must be first thing in structure so that we can simply cast from struct - * automount_lower_s to struct fmuk66_automount_config_s - */ - - struct automount_lower_s lower; /* Publicly visible part */ - FAR struct fmuk66_automount_state_s *state; /* Changeable state */ -}; - -/************************************************************************************ - * Private Function Prototypes - ************************************************************************************/ - -static int fmuk66_attach(FAR const struct automount_lower_s *lower, automount_handler_t isr, FAR void *arg); -static void fmuk66_enable(FAR const struct automount_lower_s *lower, bool enable); -static bool fmuk66_inserted(FAR const struct automount_lower_s *lower); - -/************************************************************************************ - * Private Data - ************************************************************************************/ - -static struct fmuk66_automount_state_s g_sdhc_state; -static const struct fmuk66_automount_config_s g_sdhc_config = { - .lower = - { - .fstype = CONFIG_FMUK66_SDHC_AUTOMOUNT_FSTYPE, - .blockdev = CONFIG_FMUK66_SDHC_AUTOMOUNT_BLKDEV, - .mountpoint = CONFIG_FMUK66_SDHC_AUTOMOUNT_MOUNTPOINT, - .ddelay = MSEC2TICK(CONFIG_FMUK66_SDHC_AUTOMOUNT_DDELAY), - .udelay = MSEC2TICK(CONFIG_FMUK66_SDHC_AUTOMOUNT_UDELAY), - .attach = fmuk66_attach, - .enable = fmuk66_enable, - .inserted = fmuk66_inserted - }, - .state = &g_sdhc_state -}; - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Name: fmuk66_attach - * - * Description: - * Attach a new SDHC event handler - * - * Input Parameters: - * lower - An instance of the auto-mounter lower half state structure - * isr - The new event handler to be attach - * arg - Client data to be provided when the event handler is invoked. - * - * Returned Value: - * Always returns OK - * - ************************************************************************************/ - -static int fmuk66_attach(FAR const struct automount_lower_s *lower, automount_handler_t isr, FAR void *arg) -{ - FAR const struct fmuk66_automount_config_s *config; - FAR struct fmuk66_automount_state_s *state; - - /* Recover references to our structure */ - - config = (FAR struct fmuk66_automount_config_s *)lower; - DEBUGASSERT(config != NULL && config->state != NULL); - - state = config->state; - - /* Save the new handler info (clearing the handler first to eliminate race - * conditions). - */ - - state->handler = NULL; - state->pending = false; - state->arg = arg; - state->handler = isr; - return OK; -} - -/************************************************************************************ - * Name: fmuk66_enable - * - * Description: - * Enable card insertion/removal event detection - * - * Input Parameters: - * lower - An instance of the auto-mounter lower half state structure - * enable - True: enable event detection; False: disable - * - * Returned Value: - * None - * - ************************************************************************************/ - -static void fmuk66_enable(FAR const struct automount_lower_s *lower, bool enable) -{ - FAR const struct fmuk66_automount_config_s *config; - FAR struct fmuk66_automount_state_s *state; - irqstate_t flags; - - /* Recover references to our structure */ - - config = (FAR struct fmuk66_automount_config_s *)lower; - DEBUGASSERT(config != NULL && config->state != NULL); - - state = config->state; - - /* Save the fake enable setting */ - - flags = enter_critical_section(); - state->enable = enable; - - /* Did an interrupt occur while interrupts were disabled? */ - - if (enable && state->pending) { - /* Yes.. perform the fake interrupt if the interrutp is attached */ - - if (state->handler) { - bool inserted = fmuk66_cardinserted(); - (void)state->handler(&config->lower, state->arg, inserted); - } - - state->pending = false; - } - - leave_critical_section(flags); -} - -/************************************************************************************ - * Name: fmuk66_inserted - * - * Description: - * Check if a card is inserted into the slot. - * - * Input Parameters: - * lower - An instance of the auto-mounter lower half state structure - * - * Returned Value: - * True if the card is inserted; False otherwise - * - ************************************************************************************/ - -static bool fmuk66_inserted(FAR const struct automount_lower_s *lower) -{ - return fmuk66_cardinserted(); -} - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -/************************************************************************************ - * Name: fmuk66_automount_initialize - * - * Description: - * Configure auto-mounters for each enable and so configured SDHC - * - * Input Parameters: - * None - * - * Returned Value: - * None - * - ************************************************************************************/ - -void fmuk66_automount_initialize(void) -{ - FAR void *handle; - - finfo("Initializing automounter(s)\n"); - - /* Initialize the SDHC0 auto-mounter */ - - handle = automount_initialize(&g_sdhc_config.lower); - - if (!handle) { - ferr("ERROR: Failed to initialize auto-mounter for SDHC0\n"); - } -} - -/************************************************************************************ - * Name: fmuk66_automount_event - * - * Description: - * The SDHC card detection logic has detected an insertion or removal event. It - * has already scheduled the MMC/SD block driver operations. Now we need to - * schedule the auto-mount event which will occur with a substantial delay to make - * sure that everything has settle down. - * - * Input Parameters: - * slotno - Identifies the SDHC0 slot: SDHC0_SLOTNO or SDHC1_SLOTNO. There is a - * terminology problem here: Each SDHC supports two slots, slot A and slot B. - * Only slot A is used. So this is not a really a slot, but an HSCMI peripheral - * number. - * inserted - True if the card is inserted in the slot. False otherwise. - * - * Returned Value: - * None - * - * Assumptions: - * Interrupts are disabled. - * - ************************************************************************************/ - -void fmuk66_automount_event(bool inserted) -{ - FAR const struct fmuk66_automount_config_s *config = &g_sdhc_config; - FAR struct fmuk66_automount_state_s *state = &g_sdhc_state; - - /* Is the auto-mounter interrupt attached? */ - - if (state->handler) { - /* Yes.. Have we been asked to hold off interrupts? */ - - if (!state->enable) { - /* Yes.. just remember the there is a pending interrupt. We will - * deliver the interrupt when interrupts are "re-enabled." - */ - - state->pending = true; - - } else { - /* No.. forward the event to the handler */ - - (void)state->handler(&config->lower, state->arg, inserted); - } - } -} - -#endif /* HAVE_AUTOMOUNTER */ diff --git a/boards/nxp/fmuk66-e/src/board_config.h b/boards/nxp/fmuk66-e/src/board_config.h deleted file mode 100644 index af6c56a..0000000 --- a/boards/nxp/fmuk66-e/src/board_config.h +++ /dev/null @@ -1,557 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013-2018 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * NXP fmuk66-e internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ -#include -#include -#include - -__BEGIN_DECLS - -/* these headers are not C++ safe */ -#include -#include -#include - -__END_DECLS - -/* FMUK66 GPIOs ***********************************************************************************/ -/* LEDs */ -/* An RGB LED is connected through GPIO as shown below: - * TBD (no makring on schematic) - * LED K66 - * ------ ------------------------------------------------------- - * RED FB_CS0_b/ UART2_CTS_b / ADC0_SE5b / SPI0_SCK / FTM3_CH1/ PTD1 - * GREEN FTM2_FLT0/ CMP0_IN3/ FB_AD6 / I2S0_RX_BCLK/ FTM3_CH5/ ADC1_SE5b/ PTC9 - * BLUE CMP0_IN2/ FB_AD7 / I2S0_MCLK/ FTM3_CH4/ ADC1_SE4b/ PTC8 - */ - -#define GPIO_LED_R (GPIO_HIGHDRIVE | GPIO_OUTPUT_ONE | PIN_PORTD | PIN1) -#define GPIO_LED_G (GPIO_HIGHDRIVE | GPIO_OUTPUT_ONE | PIN_PORTC | PIN9) -#define GPIO_LED_B (GPIO_HIGHDRIVE | GPIO_OUTPUT_ONE | PIN_PORTC | PIN8) - - -#define GPIO_LED_1 (GPIO_HIGHDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTD | PIN13) -#define GPIO_LED_2 (GPIO_HIGHDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTD | PIN14) - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 // Use D9 and D10 -#define BOARD_OVERLOAD_LED LED_AMBER -#define BOARD_ARMED_STATE_LED LED_GREEN - -#define GPIO_NFC_IO (GPIO_HIGHDRIVE | GPIO_OUTPUT_ONE | PIN_PORTA | PIN26) -#define GPIO_SENSOR_P_EN (GPIO_HIGHDRIVE | GPIO_OUTPUT_ONE | PIN_PORTB | PIN8) - - -/* UART tty Mapping - * Device tty alt Connector Name - * ------- ---------- -------------- --------- ------------------------- - * LPUART0 /dev/tty0 /dev/console J16 DCD-Mini - * UART0 /dev/tty1 --- J7 SERIAL 2 / TELEMETRY 2 / IRDA - * UART1 /dev/tty2 --- J15 SERIAL4/FrSky, RC_IN - * UART2 /dev/tty3 --- J3 GPS connector - * UART4 /dev/tty4 --- J10 SERIAL 1 / TELEMETRY 1 - */ - -/* High-resolution timer */ -#define HRT_TIMER 1 /* TPM1 timer for the HRT */ -#define HRT_TIMER_CHANNEL 0 /* Use capture/compare channel 0 */ - -/* PPM IN - */ - -#define HRT_PPM_CHANNEL 1 /* Use TPM1 capture/compare channel 1 */ -#define GPIO_PPM_IN PIN_TPM1_CH1_1 /* PTC3 USART1 RX and PTA9 and PIN_TPM1_CH1 AKA FrSky_IN_RC_IN */ - - -/* - * - * NXP fmuk66-e has separate RC_IN - * - * GPIO PPM_IN on PTA9 PIN_TPM1_CH1 and PCT3 USART1 RX - * SPEKTRUM_RX (it's TX or RX in Bind) on PCT3 USART1 RX - * Inversion is possible the UART - * The FMU can drive GPIO PPM_IN as an output - */ - -/* Spektrum controls ******************************************************/ - -/* Power is a p-Channel FET */ - -#define GPIO_SPEKTRUM_P_EN (GPIO_HIGHDRIVE | GPIO_OUTPUT_ONE | PIN_PORTA | PIN7) - -/* For binding the Spektrum 3-pin interfaces is used with it TX (output) - * as an input Therefore we drive are UARTx_RX (normaly an input) as an - * output - */ - -#define GPIO_PPM_IN_AS_OUT (GPIO_HIGHDRIVE | GPIO_OUTPUT_ONE | PIN_PORTC | PIN3) - -#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_PPM_IN_AS_OUT) -#define SPEKTRUM_RX_AS_UART() px4_arch_configgpio(PIN_UART1_RX) -#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true)) - -/* RC input */ - -#define RC_SERIAL_PORT "/dev/ttyS2" /* UART1 */ -#define GPIO_RSSI_IN PIN_ADC1_SE13 - -/* Ethernet Control - * - * Uninitialized to Reset Disabled and Inhibited - * All pins driven low to not back feed when power is off - */ - -#define nGPIO_ETHERNET_P_EN (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTE | PIN10) -#define GPIO_ENET_RST (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTA | PIN28) -#define GPIO_ENET_EN (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTA | PIN29) -#define GPIO_ENET_INH (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTA | PIN8) - -/* CAN Control - * Control pin S allows two operating modes to be selected: - * high-speed mode (Low) or silent mode (high) - */ - -#define GPIO_CAN0_STB (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTC | PIN19) -#define GPIO_CAN1_STB (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTC | PIN18) - - -/* Safety Switch - * TBD - */ -#define GPIO_LED_SAFETY (GPIO_HIGHDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTC | PIN0) -#define GPIO_BTN_SAFETY (GPIO_PULLUP | PIN_PORTE | PIN28) - -/* NXP FMUK66-E GPIOs ****************************************************************/ - -/* SDHC - * - * A micro Secure Digital (SD) card slot is available on the board connected to - * the SD Host Controller (SDHC) signals of the MCU. This slot will accept micro - * format SD memory cards. The SD card detect pin (PTE6) is an open switch that - * shorts with VDD when card is inserted. - * - * ------------ ------------- -------- - * SD Card Slot Board Signal K66 Pin - * ------------ ------------- -------- - * DAT0 SDHC0_D0 PTE1 - * DAT1 SDHC0_D1 PTE0 - * DAT2 SDHC0_D2 PTE5 - * CD/DAT3 SDHC0_D3 PTE4 - * CMD SDHC0_CMD PTE3 - * CLK SDHC0_DCLK PTE2 - * SWITCH D_CARD_DETECT PTD10 - * CAED_P_EN PTD6 - * ------------ ------------- -------- - * - * There is no Write Protect pin available to the K66 - */ -#define nVDD_3V3_SD_CARD_EN (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTA | PIN25) - - -/* SE050 Secure Element */ -#define SE050_ENA (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTA | PIN24) -#define SE050_RST_N (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTD | PIN11) - -//#define GPIO_SD_CARDDETECT (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTD | PIN10) - -/* SPI device reset signals - * In Active state - */ - -/* Sensor interrupts */ - -#define GPIO_nSPI1_DRDY1_BMI1088_ACCEL_INT1 (GPIO_PULLUP | PIN_INT_FALLING | PIN_PORTD | PIN12) -#define GPIO_nSPI1_DRDY2_BMI1088_GYRO_INT2 (GPIO_PULLUP | PIN_INT_FALLING | PIN_PORTE | PIN7) -#define GPIO_nSPI1_DRDY3_ICM42688_INT1 (GPIO_PULLUP | PIN_INT_FALLING | PIN_PORTE | PIN9) - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that can be used by the Px4 - * Firmware in the adc driver. ADC1 has 32 channels, with some a/b selection overlap - * in the AD4-AD7 range on the same ADC. - * - * Only ADC1 is used - * Bits 31:0 are ADC1 channels 31:0 - */ - -#define ADC1_CH(c) (((c) & 0x1f)) /* Define ADC number Channel number */ -#define ADC1_GPIO(n) PIN_ADC1_SE##n - -/* ADC defines to be used in sensors.cpp to read from a particular channel */ - -#define ADC_USB_VBUS_VALID ADC1_CH(0) /* USB_VBUS_VALID 29 - ADC1_DP0 */ -#define ADC_BATTERY_VOLTAGE_CHANNEL ADC1_CH(10) /* BAT_VSENS 85 PTB4 ADC1_SE10 */ -#define ADC_BATTERY_CURRENT_CHANNEL ADC1_CH(11) /* BAT_ISENS 86 PTB5 ADC1_SE11 */ -#define ADC_5V_RAIL_SENSE ADC1_CH(12) /* 5V_VSENS 87 PTB6 ADC1_SE12 */ -#define ADC_RSSI_IN ADC1_CH(13) /* RSSI_IN 88 PTB7 ADC1_SE13 */ -#define ADC_AD1 ADC1_CH(16) /* AD1 35 - ADC1_SE16 */ -#define ADC_AD2 ADC1_CH(18) /* AD2 37 - ADC1_SE18 */ -#define ADC_AD3 ADC1_CH(23) /* AD3 39 - ADC1_SE23 */ - -/* Mask use to initialize the ADC driver */ - -#define ADC_CHANNELS ((1 << ADC_USB_VBUS_VALID) | \ - (1 << ADC_BATTERY_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY_CURRENT_CHANNEL) | \ - (1 << ADC_5V_RAIL_SENSE) | \ - (1 << ADC_RSSI_IN) | \ - (1 << ADC_AD1) | \ - (1 << ADC_AD2) | \ - (1 << ADC_AD3)) - - -/* GPIO that require Configuration */ - -#define PX4_ADC_GPIO \ - /* PTB4 ADC1_SE10 */ ADC1_GPIO(10), \ - /* PTB5 ADC1_SE11 */ ADC1_GPIO(11), \ - /* PTB6 ADC1_SE12 */ ADC1_GPIO(12), \ - /* PTB7 ADC1_SE13 */ ADC1_GPIO(13) - -/* User GPIOs - * - */ - -/* Timer I/O PWM and capture - * - * 14 PWM outputs are configured. - * 14 Timer inputs are configured. - * - * Pins: - * Defined in board.h - */ -// todo:Design this! - -#define DIRECT_PWM_OUTPUT_CHANNELS 8 - -#define GPIO_ULTRASOUND_TRIGGER /* PTD0 */ (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTD | PIN0) -#define GPIO_ULTRASOUND_ECHO /* PTA10 */ (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTA | PIN10) - -/* Power supply control and monitoring GPIOs */ -// None - -#define GPIO_PERIPH_3V3_EN 0 - - -/* Tone alarm output PTA11 - TMP 2_CH1 is On +P12-4, -P12-5 - * It is driving a NPN - */ -#define TONE_ALARM_TIMER 2 /* timer */ -#define TONE_ALARM_CHANNEL 1 /* channel */ -#define GPIO_TONE_ALARM_IDLE (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTA | PIN11) -#define GPIO_TONE_ALARM (PIN_TPM2_CH1_1) - -/* USB - * - * VBUS detection is on 29 ADC_DPM0 and PTE8 - */ -#define GPIO_USB_VBUS_VALID /* PTE8 */ (GPIO_PULLUP | PIN_PORTE | PIN8) - -/* PWM input driver. Use FMU PWM14 pin - * todo:desing this - */ -#define PWMIN_TIMER 0 -#define PWMIN_TIMER_CHANNEL 2 -#define GPIO_PWM_IN GPIO_FTM0_CH2IN - -/* Define True logic Power Control in arch agnostic form */ - -#define VDD_ETH_EN(on_true) px4_arch_gpiowrite(nGPIO_ETHERNET_P_EN, !(on_true)) -// Do not have #define VDD_5V_PERIPH_EN(on_true) px4_arch_gpiowrite(GPIO_nVDD_5V_PERIPH_EN, !(on_true)) -// Do not have #define VDD_5V_HIPOWER_EN(on_true) px4_arch_gpiowrite(GPIO_nVDD_5V_HIPOWER_EN, !(on_true)) -#define VDD_3V3_SENSORS_EN(on_true) px4_arch_gpiowrite(GPIO_SENSOR_P_EN, (on_true)) -#define VDD_3V3_SPEKTRUM_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_SPEKTRUM_P_EN, !(on_true)) -#define READ_VDD_3V3_SPEKTRUM_POWER_EN() px4_arch_gpioread(GPIO_SPEKTRUM_P_EN) -// Do not have #define VDD_5V_RC_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_RC_EN, (on_true)) -// Do not have #define VDD_5V_WIFI_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_WIFI_EN, (on_true)) -#define VDD_3V3_SD_CARD_EN(on_true) px4_arch_gpiowrite(nVDD_3V3_SD_CARD_EN, !(on_true)) - -/* Map to control term used in RC lib */ -#define SPEKTRUM_POWER(on_true) VDD_3V3_SPEKTRUM_POWER_EN((on_true)) - - -/* - * By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ - -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_USB_VBUS_VALID)) -#define BOARD_ADC_BRICK_VALID (1) -#define BOARD_ADC_SERVO_VALID (1) -#define BOARD_ADC_PERIPH_5V_OC (0) -#define BOARD_ADC_HIPOWER_5V_OC (0) - - -#define BOARD_HAS_LED_PWM 1 - -#define LED_TIM3_CH1OUT /* PTD1 RGB_R */ PIN_FTM3_CH1_1 -#define LED_TIM3_CH5OUT /* PTC9 RGB_G */ PIN_FTM3_CH5_1 -#define LED_TIM3_CH4OUT /* PTC8 RGB_B */ PIN_FTM3_CH4_1 - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 2048 - -/* This board provides the board_on_reset interface */ - -#define BOARD_HAS_ON_RESET 1 - -#define PX4_GPIO_INIT_LIST { \ - GPIO_LED_R, \ - GPIO_LED_G, \ - GPIO_LED_B, \ - GPIO_SENSOR_P_EN, \ - nVDD_3V3_SD_CARD_EN, \ - nGPIO_ETHERNET_P_EN, \ - GPIO_SPEKTRUM_P_EN, \ - SE050_ENA, \ - SE050_RST_N, \ - PX4_ADC_GPIO, \ - GPIO_USB_VBUS_VALID, \ - GPIO_ENET_RST, \ - GPIO_ENET_EN, \ - GPIO_ENET_INH, \ - PIN_CAN0_RX, \ - PIN_CAN0_TX, \ - PIN_CAN1_RX, \ - PIN_CAN1_TX, \ - GPIO_CAN0_STB, \ - GPIO_CAN1_STB, \ - GPIO_BTN_SAFETY, \ - GPIO_TONE_ALARM_IDLE, \ - GPIO_NFC_IO, \ - GPIO_LED_1, \ - GPIO_LED_2 \ - } - -/* Automounter */ - -#define HAVE_MMCSD 1 -#define HAVE_AUTOMOUNTER 1 -#if !defined(CONFIG_FS_AUTOMOUNTER) || !defined(HAVE_MMCSD) -# undef HAVE_AUTOMOUNTER -# undef CONFIG_FMUK66_SDHC_AUTOMOUNT -#endif - -#ifndef CONFIG_FMUK66_SDHC_AUTOMOUNT -# undef HAVE_AUTOMOUNTER -#endif - -/* Automounter defaults */ - -#ifdef HAVE_AUTOMOUNTER - -# ifndef CONFIG_FMUK66_SDHC_AUTOMOUNT_FSTYPE -# define CONFIG_FMUK66_SDHC_AUTOMOUNT_FSTYPE "vfat" -# endif - -# ifndef CONFIG_FMUK66_SDHC_AUTOMOUNT_BLKDEV -# define CONFIG_FMUK66_SDHC_AUTOMOUNT_BLKDEV "/dev/mmcds0" -# endif - -# ifndef CONFIG_FMUK66_SDHC_AUTOMOUNT_MOUNTPOINT -# define CONFIG_FMUK66_SDHC_AUTOMOUNT_MOUNTPOINT "/mnt/sdcard" -# endif - -# ifndef CONFIG_FMUK66_SDHC_AUTOMOUNT_DDELAY -# define CONFIG_FMUK66_SDHC_AUTOMOUNT_DDELAY 1000 -# endif - -# ifndef CONFIG_FMUK66_SDHC_AUTOMOUNT_UDELAY -# define CONFIG_FMUK66_SDHC_AUTOMOUNT_UDELAY 2000 -# endif -#endif /* HAVE_AUTOMOUNTER */ - -#define BOARD_HAS_NOISY_FXOS8700_MAG 1 // Disable internal MAG - -#define BOARD_NUM_IO_TIMERS 3 - -/************************************************************************************ - * Public data - ************************************************************************************/ - -__BEGIN_DECLS - -#ifndef __ASSEMBLY__ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -/************************************************************************************ - * Name: fmuk66_spidev_initialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the NXP FMUK66-E board. - * - ************************************************************************************/ - -void fmuk66_spidev_initialize(void); - -/************************************************************************************ - * Name: fmuk66_spi_bus_initialize - * - * Description: - * Called to configure SPI Buses. - * - ************************************************************************************/ - -int fmuk66_spi_bus_initialize(void); - -/**************************************************************************************************** - * Name: board_spi_reset board_peripheral_reset - * - * Description: - * Called to reset SPI and the perferal bus - * - ****************************************************************************************************/ -void board_peripheral_reset(int ms); - -/************************************************************************************ - * Name: fmuk66_bringup - * - * Description: - * Bring up board features - * - ************************************************************************************/ - -#if defined(CONFIG_BOARDCTL) || defined(CONFIG_BOARD_INITIALIZE) -int fmuk66_bringup(void); -#endif - -/**************************************************************************** - * Name: fmuk66_sdhc_initialize - * - * Description: - * Inititialize the SDHC SD card slot - * - ****************************************************************************/ - -int fmuk66_sdhc_initialize(void); - -/************************************************************************************ - * Name: fmuk66_cardinserted - * - * Description: - * Check if a card is inserted into the SDHC slot - * - ************************************************************************************/ - -#ifdef HAVE_AUTOMOUNTER -bool fmuk66_cardinserted(void); -#else -# define fmuk66_cardinserted() (false) -#endif - -/************************************************************************************ - * Name: fmuk66_writeprotected - * - * Description: - * Check if the card in the MMC/SD slot is write protected - * - ************************************************************************************/ - -#ifdef HAVE_AUTOMOUNTER -bool fmuk66_writeprotected(void); -#else -# define fmuk66_writeprotected() (false) -#endif - -/************************************************************************************ - * Name: fmuk66_automount_initialize - * - * Description: - * Configure auto-mounter for the configured SDHC slot - * - * Input Parameters: - * None - * - * Returned Value: - * None - * - ************************************************************************************/ - -#ifdef HAVE_AUTOMOUNTER -void fmuk66_automount_initialize(void); -#endif - -/************************************************************************************ - * Name: fmuk66_automount_event - * - * Description: - * The SDHC card detection logic has detected an insertion or removal event. It - * has already scheduled the MMC/SD block driver operations. Now we need to - * schedule the auto-mount event which will occur with a substantial delay to make - * sure that everything has settle down. - * - * Input Parameters: - * inserted - True if the card is inserted in the slot. False otherwise. - * - * Returned Value: - * None - * - * Assumptions: - * Interrupts are disabled. - * - ************************************************************************************/ - -#ifdef HAVE_AUTOMOUNTER -void fmuk66_automount_event(bool inserted); -#endif - -/************************************************************************************ - * Name: fmuk66_timer_initialize - * - * Description: - * Called to configure the FTM to provide 1 Mhz - * - ************************************************************************************/ - -void fmuk66_timer_initialize(void); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/nxp/fmuk66-e/src/can.c b/boards/nxp/fmuk66-e/src/can.c deleted file mode 100644 index 934e3f4..0000000 --- a/boards/nxp/fmuk66-e/src/can.c +++ /dev/null @@ -1,129 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016, 2018 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. - * - ****************************************************************************/ - -/** - * @file can.c - * - * Board-specific CAN functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include - -#include -#include - -#include -#include -#include "arm_internal.h" - -#include "board_config.h" - -#ifdef CONFIG_CAN - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(KINETIS_FLEXCAN0) && defined(KINETIS_FLEXCAN1) -# warning "Both CAN0 and CAN1 are enabled. Assuming only CAN0." -# undef KINETIS_FLEXCAN0 -#endif - -#ifdef KINETIS_FLEXCAN0 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); - -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - /* Call kinetis_caninitialize() to get an instance of the CAN interface */ - - can = kinetis_caninitialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} - -#endif diff --git a/boards/nxp/fmuk66-e/src/i2c.cpp b/boards/nxp/fmuk66-e/src/i2c.cpp deleted file mode 100644 index 75b583b..0000000 --- a/boards/nxp/fmuk66-e/src/i2c.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusInternal(PX4_BUS_NUMBER_TO_PX4(1)), - initI2CBusExternal(PX4_BUS_NUMBER_TO_PX4(0)), -}; diff --git a/boards/nxp/fmuk66-e/src/init.c b/boards/nxp/fmuk66-e/src/init.c deleted file mode 100644 index affa944..0000000 --- a/boards/nxp/fmuk66-e/src/init.c +++ /dev/null @@ -1,313 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2016, 2018 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * NXP fmuk66-e specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include "board_config.h" - -#include "arm_internal.h" -#include - -#include -#include - -#include - -#include -#include -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/**************************************************************************** - * Protected Functions - ****************************************************************************/ -/**************************************************************************** - * Public Functions - ****************************************************************************/ -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ - -void board_on_reset(int status) -{ - for (int i = 0; i < 6; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * Name: board_read_VBUS_state - * - * Description: - * All boards must provide a way to read the state of VBUS, this my be simple - * digital input on a GPIO. Or something more complicated like a Analong input - * or reading a bit from a USB controller register. - * - * Returns - 0 if connected. - * - ************************************************************************************/ - -int board_read_VBUS_state(void) -{ - return BOARD_ADC_USB_CONNECTED ? 0 : 1; -} - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - /* set the peripheral rails off */ - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ -} - -/************************************************************************************ - * Name: kinetis_boardinitialize - * - * Description: - * All Kinetis architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. - * - ************************************************************************************/ - -__EXPORT void -kinetis_boardinitialize(void) -{ - board_on_reset(-1); /* Reset PWM first thing */ - - /* configure LEDs */ - board_autoled_initialize(); - - const uint32_t gpio[] = PX4_GPIO_INIT_LIST; - px4_gpio_init(gpio, arraySize(gpio)); - - fmuk66_timer_initialize(); - - /* Power on Spektrum */ - - VDD_3V3_SPEKTRUM_POWER_EN(true); -} -/**************************************************************************** - * Name: kinetis_serial_dma_poll_all - * - * Description: - * Checks receive DMA buffers for received bytes that have not accumulated - * to the point where the DMA half/full interrupt has triggered. - * - * This function should be called from a timer or other periodic context. - * - ****************************************************************************/ - -void kinetis_lpserial_dma_poll_all(void) -{ -#if defined(LPSERIAL_HAVE_DMA) - kinetis_lpserial_dma_poll(); -#endif -#if defined(SERIAL_HAVE_DMA) - kinetis_serial_dma_poll(); -#endif -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - - VDD_3V3_SD_CARD_EN(true); - VDD_3V3_SENSORS_EN(true); - - /* configure SPI interfaces */ - - fmuk66_spidev_initialize(); - - VDD_ETH_EN(true); - - px4_platform_init(); - - /* configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_DMA) || defined(LPSERIAL_HAVE_DMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)kinetis_lpserial_dma_poll_all, NULL); -#endif /* SERIAL_HAVE_DMA || LPSERIAL_HAVE_DMA */ - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_off(LED_GREEN); - led_off(LED_BLUE); - - int ret = fmuk66_sdhc_initialize(); - - if (ret != OK) { - board_autoled_on(LED_RED); - } - -#ifdef HAVE_AUTOMOUNTER - /* Initialize the auto-mounter */ - - fmuk66_automount_initialize(); -#endif - - /* Configure SPI-based devices */ - -#ifdef CONFIG_SPI - ret = fmuk66_spi_bus_initialize(); - - if (ret != OK) { - board_autoled_on(LED_RED); - } - -#endif - -#ifdef CONFIG_NETDEV_LATEINIT - -# ifdef CONFIG_KINETIS_ENET - kinetis_netinitialize(0); -# endif - -# ifdef CONFIG_KINETIS_FLEXCAN0 - kinetis_caninitialize(0); -# endif - -# ifdef CONFIG_KINETIS_FLEXCAN1 - kinetis_caninitialize(1); -# endif - -#endif - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/nxp/fmuk66-e/src/led.c b/boards/nxp/fmuk66-e/src/led.c deleted file mode 100644 index b317665..0000000 --- a/boards/nxp/fmuk66-e/src/led.c +++ /dev/null @@ -1,115 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2016, 2018 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * NXP fmuk66-e LED backend. - */ - -#include - -#include - -#include "kinetis.h" -#include "chip.h" -#include "board_config.h" - -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - - -static uint32_t g_ledmap[] = { - 0, // Indexed by LED_BLUE - GPIO_LED_1, // Indexed by LED_RED, LED_AMBER - GPIO_LED_SAFETY, // Indexed by LED_SAFETY - GPIO_LED_2, // Indexed by LED_GREEN -}; - -__EXPORT void led_init(void) -{ - /* Configure LED GPIOs for output */ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - if (g_ledmap[l] != 0) { - kinetis_pinconfig(g_ledmap[l]); - } - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive High to switch on */ - - if (g_ledmap[led] != 0) { - kinetis_gpiowrite(g_ledmap[led], state); - } -} - -static bool phy_get_led(int led) -{ - - if (g_ledmap[led] != 0) { - return kinetis_gpioread(g_ledmap[led]); - } - - return false; -} - -__EXPORT void led_on(int led) -{ - phy_set_led(led, true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(led, false); -} - -__EXPORT void led_toggle(int led) -{ - - phy_set_led(led, !phy_get_led(led)); -} diff --git a/boards/nxp/fmuk66-e/src/sdhc.c b/boards/nxp/fmuk66-e/src/sdhc.c deleted file mode 100644 index 2236104..0000000 --- a/boards/nxp/fmuk66-e/src/sdhc.c +++ /dev/null @@ -1,270 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016-2018 Gregory Nutt. All rights reserved. - * Authors: Gregory Nutt - * David Sidrane - * - * 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 NuttX 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. - * - ****************************************************************************/ -/* A micro Secure Digital (SD) card slot is available on the board connected to - * the SD Host Controller (SDHC) signals of the MCU. This slot will accept micro - * format SD memory cards. The SD card detect pin (PTE6) is an open switch that - * shorts with VDD when card is inserted. - * - * ------------ ------------- -------- - * SD Card Slot Board Signal K66 Pin - * ------------ ------------- -------- - * DAT0 SDHC0_D0 PTE1 - * DAT1 SDHC0_D1 PTE0 - * DAT2 SDHC0_D2 PTE5 - * CD/DAT3 SDHC0_D3 PTE4 - * CMD SDHC0_CMD PTE3 - * CLK SDHC0_DCLK PTE2 - * SWITCH D_CARD_DETECT PTE6 - * ------------ ------------- -------- - * - * There is no Write Protect pin available to the K66. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include -#include -#include - -#include -#include - -#include "kinetis.h" - -#include "board_config.h" - -#ifdef CONFIG_KINETIS_SDHC - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ -/* This structure holds static information unique to one SDHC peripheral */ - -struct fmuk66_sdhc_state_s { - struct sdio_dev_s *sdhc; /* R/W device handle */ - bool inserted; /* TRUE: card is inserted */ -}; - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/* HSCMI device state */ - -static struct fmuk66_sdhc_state_s g_sdhc; - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -#if defined(GPIO_SD_CARDDETECT) -/**************************************************************************** - * Name: fmuk66_mediachange - ****************************************************************************/ - -static void fmuk66_mediachange(struct fmuk66_sdhc_state_s *sdhc) -{ - bool inserted; - - /* Get the current value of the card detect pin. This pin is pulled up on - * board. So low means that a card is present. - */ - - inserted = !kinetis_gpioread(GPIO_SD_CARDDETECT); - mcinfo("inserted: %s\n", inserted ? "Yes" : "No"); - - /* Has the pin changed state? */ - - if (inserted != sdhc->inserted) { - mcinfo("Media change: %d->%d\n", sdhc->inserted, inserted); - - /* Yes.. perform the appropriate action (this might need some debounce). */ - - sdhc->inserted = inserted; - sdhc_mediachange(sdhc->sdhc, inserted); - -#ifdef CONFIG_FMUK66_SDHC_AUTOMOUNT - /* Let the automounter know about the insertion event */ - - fmuk66_automount_event(fmuk66_cardinserted()); -#endif - } -} - -/**************************************************************************** - * Name: fmuk66_cdinterrupt - ****************************************************************************/ - -static int fmuk66_cdinterrupt(int irq, FAR void *context, FAR void *args) -{ - /* All of the work is done by fmuk66_mediachange() */ - - fmuk66_mediachange((struct fmuk66_sdhc_state_s *) args); - return OK; -} -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: fmuk66_sdhc_initialize - * - * Description: - * Inititialize the SDHC SD card slot - * - ****************************************************************************/ - -int fmuk66_sdhc_initialize(void) -{ - int ret; - struct fmuk66_sdhc_state_s *sdhc = &g_sdhc; - /* Configure GPIO pins */ - - VDD_3V3_SD_CARD_EN(true); - -#if defined(GPIO_SD_CARDDETECT) - kinetis_pinconfig(GPIO_SD_CARDDETECT); - - /* Attached the card detect interrupt (but don't enable it yet) */ - - kinetis_pinirqattach(GPIO_SD_CARDDETECT, fmuk66_cdinterrupt, sdhc); -#endif - /* Configure the write protect GPIO -- None */ - - /* Mount the SDHC-based MMC/SD block driver */ - /* First, get an instance of the SDHC interface */ - - mcinfo("Initializing SDHC slot %d\n", CONFIG_NSH_MMCSDSLOTNO); - - sdhc->sdhc = sdhc_initialize(CONFIG_NSH_MMCSDSLOTNO); - - if (!sdhc->sdhc) { - mcerr("ERROR: Failed to initialize SDHC slot %d\n", CONFIG_NSH_MMCSDSLOTNO); - return -ENODEV; - } - -// Testing done on SanDISK HC all failed sd_bench with Drive/Slew other than default and _PIN_OUTPUT_FAST|_PIN_OUTPUT_HIGHDRIVE -// _PIN_OUTPUT_FAST|_PIN_OUTPUT_HIGHDRIVE Square noisy, pass SanDISK HC -// _PIN_OUTPUT_FAST|_PIN_OUTPUT_LOWDRIVE Square noisy, pass SanDISK HC -// _PIN_OUTPUT_HIGHDRIVE|_PIN_OUTPUT_SLOW sinusoidal fail SanDISK HC pass SanDISK HC1 -// _PIN_OUTPUT_LOWDRIVE|_PIN_OUTPUT_SLOW sinusoidal fail SanDISK HC pass SanDISK HC1 -// _PIN_OUTPUT_SLOW sinusoidal fail SanDISK HC pass SanDISK HC1 - - // This up dating of the driver setting is for EMI issue with GPS and FCC - // With this setting the clock is sinusoidal N.B. sd_bench fails on SanDISK HC, but - // Passes SanDISK **HC1** - use HC1 or Kingston cards! - - kinetis_pinconfig(PIN_SDHC0_DCLK | _PIN_OUTPUT_HIGHDRIVE | _PIN_OUTPUT_SLOW); - - /* Now bind the SDHC interface to the MMC/SD driver */ - - mcinfo("Bind SDHC to the MMC/SD driver, minor=%d\n", CONFIG_NSH_MMCSDMINOR); - - ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdhc->sdhc); - - if (ret != OK) { - syslog(LOG_ERR, "ERROR: Failed to bind SDHC to the MMC/SD driver: %d\n", ret); - return ret; - } - - syslog(LOG_ERR, "Successfully bound SDHC to the MMC/SD driver\n"); - -#if defined(GPIO_SD_CARDDETECT) - /* Handle the initial card state */ - - fmuk66_mediachange(sdhc); - - /* Enable CD interrupts to handle subsequent media changes */ - - kinetis_pinirqenable(GPIO_SD_CARDDETECT); -#else - sdhc_mediachange(sdhc->sdhc, true); -#endif - return OK; -} - -/**************************************************************************** - * Name: fmuk66_cardinserted - * - * Description: - * Check if a card is inserted into the SDHC slot - * - ****************************************************************************/ - -#ifdef HAVE_AUTOMOUNTER -bool fmuk66_cardinserted(void) -{ - bool inserted; - - /* Get the current value of the card detect pin. This pin is pulled up on - * board. So low means that a card is present. - */ - - inserted = !kinetis_gpioread(GPIO_SD_CARDDETECT); - mcinfo("inserted: %s\n", inserted ? "Yes" : "No"); - return inserted; -} -#endif - -/**************************************************************************** - * Name: fmuk66_writeprotected - * - * Description: - * Check if a card is inserted into the SDHC slot - * - ****************************************************************************/ - -#ifdef HAVE_AUTOMOUNTER -bool fmuk66_writeprotected(void) -{ - /* There are no write protect pins */ - - return false; -} -#endif - -#endif /* HAVE_MMCSD */ diff --git a/boards/nxp/fmuk66-e/src/spi.cpp b/boards/nxp/fmuk66-e/src/spi.cpp deleted file mode 100644 index 78d1a57..0000000 --- a/boards/nxp/fmuk66-e/src/spi.cpp +++ /dev/null @@ -1,313 +0,0 @@ -/************************************************************************************ - * - * Copyright (C) 2016, 2018 Gregory Nutt. All rights reserved. - * Authors: Gregory Nutt - * David Sidrane - * - * 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 NuttX 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 -#include -#include - -#include - -#include -#include -#include -//#include - -#include -#include - -#include "arm_internal.h" -#include "chip.h" -#include -#include "board_config.h" -#include - -#if defined(CONFIG_KINETIS_SPI0) || defined(CONFIG_KINETIS_SPI1) || defined(CONFIG_KINETIS_SPI2) - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI0, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortC, GPIO::Pin2}) - }), - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortB, GPIO::Pin10}, SPI::DRDY{GPIO::PortE, GPIO::Pin9}), - initSPIDevice(DRV_GYR_DEVTYPE_BMI088, SPI::CS{GPIO::PortB, GPIO::Pin9}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}), - initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::PortE, GPIO::Pin6}), - initSPIDevice(DRV_DEVTYPE_UNUSED, SPI::CS{GPIO::PortA, GPIO::Pin19}), // CAL Memory - }, {GPIO::PortB, GPIO::Pin8}), - initSPIBusExternal(SPI::Bus::SPI2, { - initSPIConfigExternal(SPI::CS{GPIO::PortB, GPIO::Pin20}), - initSPIConfigExternal(SPI::CS{GPIO::PortD, GPIO::Pin15}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); - - -#define PX4_MK_GPIO(pin_ftmx, io) ((((uint32_t)(pin_ftmx)) & ~(_PIN_MODE_MASK | _PIN_OPTIONS_MASK)) |(io)) - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -__EXPORT void board_spi_reset(int ms, int bus_mask) -{ - /* Goal not to back feed the chips on the bus via IO lines */ - - /* Next Change CS to inputs with pull downs */ - for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) { - if (px4_spi_buses[bus].bus == PX4_BUS_NUMBER_TO_PX4(1)) { - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (px4_spi_buses[bus].devices[i].cs_gpio != 0) { - kinetis_pinconfig(PX4_MK_GPIO(px4_spi_buses[bus].devices[i].cs_gpio, GPIO_PULLDOWN)); - } - } - } - } - - /* Turn all the int inputs to inputs with pull down */ - - kinetis_pinconfig(PX4_MK_GPIO(GPIO_nSPI1_DRDY1_BMI1088_ACCEL_INT1, GPIO_PULLDOWN)); - kinetis_pinconfig(PX4_MK_GPIO(GPIO_nSPI1_DRDY2_BMI1088_GYRO_INT2, GPIO_PULLDOWN)); - kinetis_pinconfig(PX4_MK_GPIO(GPIO_nSPI1_DRDY3_ICM42688_INT1, GPIO_PULLDOWN)); - - /* Power Down The Sensors */ - - VDD_3V3_SENSORS_EN(false); - up_mdelay(ms); - - /* Power Up The Sensors */ - VDD_3V3_SENSORS_EN(true); - up_mdelay(2); - - /* Restore all the CS to outputs inactive */ - - for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) { - if (px4_spi_buses[bus].bus == PX4_BUS_NUMBER_TO_PX4(1)) { - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (px4_spi_buses[bus].devices[i].cs_gpio != 0) { - kinetis_pinconfig(px4_spi_buses[bus].devices[i].cs_gpio); - } - } - } - } - - /* Restore all the int inputs to inputs */ - - kinetis_pinconfig(GPIO_nSPI1_DRDY1_BMI1088_ACCEL_INT1); - kinetis_pinconfig(GPIO_nSPI1_DRDY2_BMI1088_GYRO_INT2); - kinetis_pinconfig(GPIO_nSPI1_DRDY3_ICM42688_INT1); -} - -/************************************************************************************ - * Name: fmuk66_spidev_initialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the NXP FMUK66-E board. - * - ************************************************************************************/ - -void fmuk66_spidev_initialize(void) -{ - board_spi_reset(10, 0xffff); - - for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) { - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (px4_spi_buses[bus].devices[i].cs_gpio != 0) { - kinetis_pinconfig(px4_spi_buses[bus].devices[i].cs_gpio); - } - } - } -} - -/************************************************************************************ - * Name: kinetis_spi_bus_initialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the NXP FMUK66 v3 board. - * - ************************************************************************************/ -static const px4_spi_bus_t *_spi_bus0; -static const px4_spi_bus_t *_spi_bus1; -static const px4_spi_bus_t *_spi_bus2; - -__EXPORT int fmuk66_spi_bus_initialize(void) -{ - for (int i = 0; i < SPI_BUS_MAX_BUS_ITEMS; ++i) { - switch (px4_spi_buses[i].bus) { - case PX4_BUS_NUMBER_TO_PX4(0): _spi_bus0 = &px4_spi_buses[i]; break; - - case PX4_BUS_NUMBER_TO_PX4(1): _spi_bus1 = &px4_spi_buses[i]; break; - - case PX4_BUS_NUMBER_TO_PX4(2): _spi_bus2 = &px4_spi_buses[i]; break; - } - } - - /* Configure SPI-based devices */ - - struct spi_dev_s *spi_sensors = px4_spibus_initialize(PX4_BUS_NUMBER_TO_PX4(1)); - - if (!spi_sensors) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 1); - return -ENODEV; - } - - /* Default bus 1 to 1MHz and de-assert the known chip selects. - */ - - SPI_SETFREQUENCY(spi_sensors, 1 * 1000 * 1000); - SPI_SETBITS(spi_sensors, 8); - SPI_SETMODE(spi_sensors, SPIDEV_MODE0); - - /* Get the SPI port for the Memory */ - - struct spi_dev_s *spi_memory = px4_spibus_initialize(PX4_BUS_NUMBER_TO_PX4(0)); - - if (!spi_memory) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 0); - return -ENODEV; - } - - /* Default bus 0 to 12MHz and de-assert the known chip selects. - */ - - SPI_SETFREQUENCY(spi_memory, 12 * 1000 * 1000); - SPI_SETBITS(spi_memory, 8); - SPI_SETMODE(spi_memory, SPIDEV_MODE3); - - /* Configure EXTERNAL SPI-based devices */ - - struct spi_dev_s *spi_ext = px4_spibus_initialize(PX4_BUS_NUMBER_TO_PX4(2)); - - if (!spi_ext) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 2); - return -ENODEV; - } - - /* Default external bus to 1MHz and de-assert the known chip selects. - */ - - SPI_SETFREQUENCY(spi_ext, 8 * 1000 * 1000); - SPI_SETBITS(spi_ext, 8); - SPI_SETMODE(spi_ext, SPIDEV_MODE3); - - /* deselect all */ - for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) { - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (px4_spi_buses[bus].devices[i].cs_gpio != 0) { - SPI_SELECT(spi_ext, px4_spi_buses[bus].devices[i].devid, false); - } - } - } - - return OK; - -} - -/************************************************************************************ - * Name: kinetis_spi[n]select, kinetis_spi[n]status, and kinetis_spi[n]cmddata - * - * Description: - * These external functions must be provided by board-specific logic. They are - * implementations of the select, status, and cmddata methods of the SPI interface - * defined by struct spi_ops_s (see include/nuttx/spi/spi.h). All other methods - * including kinetis_spibus_initialize()) are provided by common Kinetis logic. - * To use this common SPI logic on your board: - * - * 1. Provide logic in kinetis_boardinitialize() to configure SPI chip select - * pins. - * 2. Provide kinetis_spi[n]select() and kinetis_spi[n]status() functions - * in your board-specific logic. These functions will perform chip selection - * and status operations using GPIOs in the way your board is configured. - * 2. If CONFIG_SPI_CMDDATA is defined in the NuttX configuration, provide - * kinetis_spi[n]cmddata() functions in your board-specific logic. These - * functions will perform cmd/data selection operations using GPIOs in the way - * your board is configured. - * 3. Add a call to kinetis_spibus_initialize() in your low level application - * initialization logic - * 4. The handle returned by kinetis_spibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling - * mmcsd_spislotinitialize(), for example, will bind the SPI driver to - * the SPI MMC/SD driver). - * - ************************************************************************************/ - -static inline void kinetis_spixselect(const px4_spi_bus_t *bus, struct spi_dev_s *dev, uint32_t devid, bool selected) -{ - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (bus->devices[i].cs_gpio == 0) { - break; - } - - if (devid == bus->devices[i].devid) { - // SPI select is active low, so write !selected to select the device - kinetis_gpiowrite(bus->devices[i].cs_gpio, !selected); - } - } -} - -void kinetis_spi0select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) -{ - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); - kinetis_spixselect(_spi_bus0, dev, devid, selected); -} - -uint8_t kinetis_spi0status(FAR struct spi_dev_s *dev, uint32_t devid) -{ - return SPI_STATUS_PRESENT; -} - -void kinetis_spi1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) -{ - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); - kinetis_spixselect(_spi_bus1, dev, devid, selected); -} - -uint8_t kinetis_spi1status(FAR struct spi_dev_s *dev, uint32_t devid) -{ - return SPI_STATUS_PRESENT; -} - -void kinetis_spi2select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) -{ - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); - kinetis_spixselect(_spi_bus2, dev, devid, selected); -} - -uint8_t kinetis_spi2status(FAR struct spi_dev_s *dev, uint32_t devid) -{ - return SPI_STATUS_PRESENT; -} - - -#endif /* CONFIG_KINETIS_SPI0 || CONFIG_KINETIS_SPI1 || CONFIG_KINETIS_SPI2 */ diff --git a/boards/nxp/fmuk66-e/src/timer_config.cpp b/boards/nxp/fmuk66-e/src/timer_config.cpp deleted file mode 100644 index 99c0ddb..0000000 --- a/boards/nxp/fmuk66-e/src/timer_config.cpp +++ /dev/null @@ -1,188 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016, 2018 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. - * - ****************************************************************************/ - -/* - * @file timer_config.c - * - * Configuration data for the kinetis pwm_servo, input capture and pwm input driver. - * - * Note that these arrays must always be fully-sized. - */ - -// TODO:Stubbed out for now -#include - -#include -#include "hardware/kinetis_sim.h" -#include "hardware/kinetis_ftm.h" - -#include -#include - -#include "board_config.h" - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::FTM0), - initIOTimer(Timer::FTM3), - initIOTimer(Timer::FTM2), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::FTM0, Timer::Channel0}, {GPIO::PortC, GPIO::Pin1}), - initIOTimerChannel(io_timers, {Timer::FTM0, Timer::Channel3}, {GPIO::PortA, GPIO::Pin6}), - initIOTimerChannel(io_timers, {Timer::FTM0, Timer::Channel4}, {GPIO::PortD, GPIO::Pin4}), - initIOTimerChannel(io_timers, {Timer::FTM0, Timer::Channel5}, {GPIO::PortD, GPIO::Pin5}), - initIOTimerChannel(io_timers, {Timer::FTM0, Timer::Channel6}, {GPIO::PortD, GPIO::Pin6}), - initIOTimerChannel(io_timers, {Timer::FTM0, Timer::Channel7}, {GPIO::PortD, GPIO::Pin7}), - initIOTimerChannel(io_timers, {Timer::FTM3, Timer::Channel6}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::FTM3, Timer::Channel7}, {GPIO::PortE, GPIO::Pin12}), -// initIOTimerChannel(io_timers, {Timer::FTM3, Timer::Channel0}, {GPIO::PortD, GPIO::Pin0}), -// initIOTimerChannel(io_timers, {Timer::FTM2, Timer::Channel0}, {GPIO::PortA, GPIO::Pin10}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); - -const struct io_timers_t led_pwm_timers[MAX_LED_TIMERS] = { - { - .base = KINETIS_FTM3_BASE, - .clock_register = KINETIS_SIM_SCGC3, - .clock_bit = SIM_SCGC3_FTM3, - .vectorno = 0, - }, -}; - -const struct timer_io_channels_t led_pwm_channels[MAX_TIMER_LED_CHANNELS] = { - { - .gpio_out = LED_TIM3_CH1OUT, // RGB_R - .gpio_in = 0, - .timer_index = 0, - .timer_channel = 2, - }, - { - .gpio_out = LED_TIM3_CH5OUT, // RGB_G - .gpio_in = 0, - .timer_index = 0, - .timer_channel = 6, - }, - { - .gpio_out = LED_TIM3_CH4OUT, // RGB_B - .gpio_in = 0, - .timer_index = 0, - .timer_channel = 5, - }, -}; - -#define _REG(_addr) (*(volatile uint32_t *)(_addr)) - -/* Timer register accessors */ - -#define REG(t, _reg) _REG(KINETIS_FTM##t##_BASE + (_reg)) - -#define rSC(t) REG(t,KINETIS_FTM_SC_OFFSET) -#define rCNT(t) REG(t,KINETIS_FTM_CNT_OFFSET) -#define rMOD(t) REG(t,KINETIS_FTM_MOD_OFFSET) -#define rC0SC(t) REG(t,KINETIS_FTM_C0SC_OFFSET) -#define rC0V(t) REG(t,KINETIS_FTM_C0V_OFFSET) -#define rC1SC(t) REG(t,KINETIS_FTM_C1SC_OFFSET) -#define rC1V(t) REG(t,KINETIS_FTM_C1V_OFFSET) -#define rC2SC(t) REG(t,KINETIS_FTM_C2SC_OFFSET) -#define rC2V(t) REG(t,KINETIS_FTM_C2V_OFFSET) -#define rC3SC(t) REG(t,KINETIS_FTM_C3SC_OFFSET) -#define rC3V(t) REG(t,KINETIS_FTM_C3V_OFFSET) -#define rC4SC(t) REG(t,KINETIS_FTM_C4SC_OFFSET) -#define rC4V(t) REG(t,KINETIS_FTM_C4V_OFFSET) -#define rC5SC(t) REG(t,KINETIS_FTM_C5SC_OFFSET) -#define rC5V(t) REG(t,KINETIS_FTM_C5V_OFFSET) -#define rC6SC(t) REG(t,KINETIS_FTM_C6SC_OFFSET) -#define rC6V(t) REG(t,KINETIS_FTM_C6V_OFFSET) -#define rC7SC(t) REG(t,KINETIS_FTM_C7SC_OFFSET) -#define rC7V(t) REG(t,KINETIS_FTM_C7V_OFFSET) - -#define rCNTIN(t) REG(t,KINETIS_FTM_CNTIN_OFFSET) -#define rSTATUS(t) REG(t,KINETIS_FTM_STATUS_OFFSET) -#define rMODE(t) REG(t,KINETIS_FTM_MODE_OFFSET) -#define rSYNC(t) REG(t,KINETIS_FTM_SYNC_OFFSET) -#define rOUTINIT(t) REG(t,KINETIS_FTM_OUTINIT_OFFSET) -#define rOUTMASK(t) REG(t,KINETIS_FTM_OUTMASK_OFFSET) -#define rCOMBINE(t) REG(t,KINETIS_FTM_COMBINE_OFFSET) -#define rDEADTIME(t) REG(t,KINETIS_FTM_DEADTIME_OFFSET) -#define rEXTTRIG(t) REG(t,KINETIS_FTM_EXTTRIG_OFFSET) -#define rPOL(t) REG(t,KINETIS_FTM_POL_OFFSET) -#define rFMS(t) REG(t,KINETIS_FTM_FMS_OFFSET) -#define rFILTER(t) REG(t,KINETIS_FTM_FILTER_OFFSET) -#define rFLTCTRL(t) REG(t,KINETIS_FTM_FLTCTRL_OFFSET) -#define rQDCTRL(t) REG(t,KINETIS_FTM_QDCTRL_OFFSET) -#define rCONF(t) REG(t,KINETIS_FTM_CONF_OFFSET) -#define rFLTPOL(t) REG(t,KINETIS_FTM_FLTPOL_OFFSET) -#define rSYNCONF(t) REG(t,KINETIS_FTM_SYNCONF_OFFSET) -#define rINVCTRL(t) REG(t,KINETIS_FTM_INVCTRL_OFFSET) -#define rSWOCTRL(t) REG(t,KINETIS_FTM_SWOCTRL_OFFSET) -#define rPWMLOAD(t) REG(t,KINETIS_FTM_PWMLOAD_OFFSET) - -#if !defined(BOARD_PWM_SRC_CLOCK_FREQ) -#define BOARD_PWM_SRC_CLOCK_FREQ 16000000 -#endif - - -void fmuk66_timer_initialize(void) -{ - - - /* Y1 is 16 Mhz used to driver the FTM_CLKIN0 (PCT12) */ - - - /* Enable PCT12 as FTM_CLKIN0 */ - - kinetis_pinconfig(PIN_FTM_CLKIN0_3); - - /* Select FTM_CLKIN0 as source for FTM0, FTM2, and FTM3 */ - - uint32_t regval = _REG(KINETIS_SIM_SOPT4); - regval &= ~(SIM_SOPT4_FTM0CLKSEL | SIM_SOPT4_FTM2CLKSEL | SIM_SOPT4_FTM3CLKSEL); - _REG(KINETIS_SIM_SOPT4) = regval; - - - /* Enabled System Clock Gating Control for FTM 0 and 2*/ - - regval = _REG(KINETIS_SIM_SCGC6); - regval |= SIM_SCGC6_FTM0 | SIM_SCGC6_FTM2; - _REG(KINETIS_SIM_SCGC6) = regval; - - /* Enabled System Clock Gating Control for FTM 2 and 3 */ - - regval = _REG(KINETIS_SIM_SCGC3); - regval |= SIM_SCGC3_FTM2 | SIM_SCGC3_FTM3; - _REG(KINETIS_SIM_SCGC3) = regval; - -} diff --git a/boards/nxp/fmuk66-e/src/usb.c b/boards/nxp/fmuk66-e/src/usb.c deleted file mode 100644 index 20dd7e7..0000000 --- a/boards/nxp/fmuk66-e/src/usb.c +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016, 2018 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include "board_config.h" - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -/************************************************************************************ - * Name: kinetis_usbpullup - * - * Description: - * If USB is supported and the board supports a pullup via GPIO (for USB software - * connect and disconnect), then the board software must provide kinetis_usbpullup. - * See include/nuttx/usb/usbdev.h for additional description of this method. - * Alternatively, if no pull-up GPIO the following EXTERN can be redefined to be - * NULL. - * - ************************************************************************************/ - -__EXPORT -int kinetis_usbpullup(FAR struct usbdev_s *dev, bool enable) -{ - usbtrace(TRACE_DEVPULLUP, (uint16_t)enable); - - if (enable) { - putreg8(USB_CONTROL_DPPULLUPNONOTG, KINETIS_USB0_CONTROL); - - } else { - putreg8(0, KINETIS_USB0_CONTROL); - } - - return OK; -} - -/************************************************************************************ - * Name: kinetis_usbsuspend - * - * Description: - * Board logic must provide the kinetis_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT -void kinetis_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/nxp/fmuk66-v3/default.px4board b/boards/nxp/fmuk66-v3/default.px4board deleted file mode 100644 index 6de1cda..0000000 --- a/boards/nxp/fmuk66-v3/default.px4board +++ /dev/null @@ -1,98 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS3" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS4" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS1" -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_COMMON_BAROMETERS=y -CONFIG_DRIVERS_BAROMETER_MPL3115A2=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DISTANCE_SENSOR_SRF05=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_FXAS21002C=y -CONFIG_DRIVERS_IMU_FXOS8701CQ=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_DRIVERS_LIGHTS_RGBLED=y -CONFIG_DRIVERS_LIGHTS_RGBLED_NCP5623C=y -CONFIG_DRIVERS_LIGHTS_RGBLED_PWM=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SAFETY_BUTTON=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_DRIVERS_UWB_UWB_SR150=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SERIAL_TEST=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_FAKE_GPS=y diff --git a/boards/nxp/fmuk66-v3/extras/nxp_fmuk66-v3_bootloader.bin b/boards/nxp/fmuk66-v3/extras/nxp_fmuk66-v3_bootloader.bin deleted file mode 100644 index e97ecce..0000000 Binary files a/boards/nxp/fmuk66-v3/extras/nxp_fmuk66-v3_bootloader.bin and /dev/null differ diff --git a/boards/nxp/fmuk66-v3/firmware.prototype b/boards/nxp/fmuk66-v3/firmware.prototype deleted file mode 100644 index db28efd..0000000 --- a/boards/nxp/fmuk66-v3/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 28, - "magic": "PX4FWv1", - "description": "Firmware for the NXPFMUK66v3 board", - "image": "", - "build_time": 0, - "summary": "NXPFMUK66v3", - "version": "0.1", - "image_size": 0, - "image_maxsize": 2096112, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/nxp/fmuk66-v3/init/rc.board_defaults b/boards/nxp/fmuk66-v3/init/rc.board_defaults deleted file mode 100644 index df700b4..0000000 --- a/boards/nxp/fmuk66-v3/init/rc.board_defaults +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 10.177939394 -param set-default BAT1_A_PER_V 15.391030303 - -rgbled_pwm start -safety_button start - diff --git a/boards/nxp/fmuk66-v3/init/rc.board_sensors b/boards/nxp/fmuk66-v3/init/rc.board_sensors deleted file mode 100644 index c6ca931..0000000 --- a/boards/nxp/fmuk66-v3/init/rc.board_sensors +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# -# NXP fmuk66-v3 specific board defaults -#------------------------------------------------------------------------------ - -board_adc start - -# Internal Mag I2C bus roll 180, yaw 90 -bmm150 -I -R 10 start - -# Onboard I2C baros -bmp280 -I start -mpl3115a2 -I start - -# Internal SPI (accel + mag) -fxos8701cq -s start - -# Internal SPI (gyro) -fxas21002c -s start diff --git a/boards/nxp/fmuk66-v3/nuttx-config/Kconfig b/boards/nxp/fmuk66-v3/nuttx-config/Kconfig deleted file mode 100644 index df8b0f6..0000000 --- a/boards/nxp/fmuk66-v3/nuttx-config/Kconfig +++ /dev/null @@ -1,47 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see misc/tools/kconfig-language.txt. -# - -config FMUK66_SDHC_AUTOMOUNT - bool "SDHC automounter" - default n - depends on FS_AUTOMOUNTER && KINETIS_SDHC - -if FMUK66_SDHC_AUTOMOUNT - -config FMUK66_SDHC_AUTOMOUNT_FSTYPE - string "SDHC file system type" - default "vfat" - -config FMUK66_SDHC_AUTOMOUNT_BLKDEV - string "SDHC block device" - default "/dev/mmcsd0" - -config FMUK66_SDHC_AUTOMOUNT_MOUNTPOINT - string "SDHC mount point" - default "/fs/microsd" - -config FMUK66_SDHC_AUTOMOUNT_DDELAY - int "SDHC debounce delay (milliseconds)" - default 1000 - -config FMUK66_SDHC_AUTOMOUNT_UDELAY - int "SDHC unmount retry delay (milliseconds)" - default 2000 - -endif # FMUK66_SDHC_AUTOMOUNT - -config BOARD_HAS_PROBES - bool "Board provides GPIO or other Hardware for signaling to timing analyze." - default y - ---help--- - This board provides GPIO FMU-CH1-6 as PROBE_1-6 to provide timing signals from selected drivers. - -config BOARD_USE_PROBES - bool "Enable the use the board provided GPIO FMU-CH1-6 as PROBE_1-6 to provide timing signals from selected drivers" - default n - depends on BOARD_HAS_PROBES - - ---help--- - Select to use GPIO FMU-CH1-6 to provide timing signals from selected drivers. diff --git a/boards/nxp/fmuk66-v3/nuttx-config/include/board.h b/boards/nxp/fmuk66-v3/nuttx-config/include/board.h deleted file mode 100644 index 8c85d2a..0000000 --- a/boards/nxp/fmuk66-v3/nuttx-config/include/board.h +++ /dev/null @@ -1,529 +0,0 @@ -/************************************************************************************ - * configs/nxp/fmuk66-v3/include/board.h - * - * Copyright (C) 2016-2018 Gregory Nutt. All rights reserved. - * Authors: Gregory Nutt - * Jordan MacIntyre - * David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ - -#ifndef __CONFIG_NXP_FMUK66_V3_INCLUDE_BOARD_H -#define __CONFIG_NXP_FMUK66_V3_INCLUDE_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* - * The FMUK66-v3 is populated with a MK66FN2M0VLQ18 has 2 MiB of FLASH and - * 256 KiB of SRAM. - */ -/* Clocking *************************************************************************/ -/* The NXP FMUK66-V3 uses a 16MHz external powered Oscillator. The Kinetis MCU startup - * from an internal digitally-controlled oscillator (DCO). Nuttx will enable the main - * external oscillator EXTAL0. The external oscillator can range from - * 32.768 KHz up to 50 MHz. The default external source for the MCG oscillator inputs - * EXTAL. - * - * Y1 a High-frequency, Oscillator - */ -#define BOARD_EXTAL_LP 1 -#define BOARD_EXTAL_FREQ 16000000 /* 16MHz Oscillator Y1 */ -#define BOARD_XTAL32_FREQ 32768 /* 32KHz RTC Oscillator */ - -#define BOARD_OSC_CR OSC_CR_ERCLKEN /* Enable the OSCERCLK */ -#define BOARD_OSC_DIV OSC_DIV_ERPS_DIV1 /* No OSCERCLK Divide */ - -/* FLL Configuration. - * BOARD_EXTAL_FREQ / BOARD_FRDIV has to be in the range 31.25 kHz to 39.0625 - * 16 Mhz / MCG_C1_FRDIV_DIV512 = 31.25 kHz * 640 the default for MCG_C4 - * FLL is 20Mhz - */ -#define BOARD_FRDIV MCG_C1_FRDIV_DIV512 - -/* PLL Configuration. Either the external clock or crystal frequency is used to - * select the PRDIV value. Only reference clock frequencies are supported that will - * produce a KINETIS_MCG_PLL_REF_MIN=8MHz >= PLLIN <=KINETIS_MCG_PLL_REF_MAX=16Mhz - * reference clock to the PLL. - * - * PLL Input frequency: PLLIN = REFCLK / PRDIV = 16 MHz / 2 = 8Mhz MHz - * PLL Output frequency: PLLOUT = PLLIN * VDIV = 8 MHz * 42 = 336 MHz - * MCG Frequency: PLLOUT = 168 Mhz = 336 MHz / KINETIS_MCG_PLL_INTERNAL_DIVBY=2 - * - * PRDIV register value is the divider minus KINETIS_MCG_C5_PRDIV_BASE. - * VDIV register value is offset by KINETIS_MCG_C6_VDIV_BASE. - */ - -#define BOARD_PRDIV 2 /* PLL External Reference Divider */ -#define BOARD_VDIV 42 /* PLL VCO Divider (frequency multiplier) */ - -/* Define additional MCG_C2 Setting */ - -#define BOARD_MCG_C2_FCFTRIM 0 /* Do not enable FCFTRIM */ -#define BOARD_MCG_C2_LOCRE0 MCG_C2_LOCRE0 /* Enable reset on loss of clock */ - -#define BOARD_PLLIN_FREQ (BOARD_EXTAL_FREQ / BOARD_PRDIV) -#define BOARD_PLLOUT_FREQ (BOARD_PLLIN_FREQ * BOARD_VDIV) -#define BOARD_MCG_FREQ (BOARD_PLLOUT_FREQ/KINETIS_MCG_PLL_INTERNAL_DIVBY) - -/* SIM CLKDIV1 dividers */ - -#define BOARD_OUTDIV1 1 /* Core = MCG, 168 MHz */ -#define BOARD_OUTDIV2 3 /* Bus = MCG / 3, 56 MHz */ -#define BOARD_OUTDIV3 3 /* FlexBus = MCG / 3, 56 MHz */ -#define BOARD_OUTDIV4 6 /* Flash clock = MCG / 6, 28 MHz */ - -#define BOARD_CORECLK_FREQ (BOARD_MCG_FREQ / BOARD_OUTDIV1) -#define BOARD_BUS_FREQ (BOARD_MCG_FREQ / BOARD_OUTDIV2) -#define BOARD_FLEXBUS_FREQ (BOARD_MCG_FREQ / BOARD_OUTDIV3) -#define BOARD_FLASHCLK_FREQ (BOARD_MCG_FREQ / BOARD_OUTDIV4) - -/* Use BOARD_MCG_FREQ as the output SIM_SOPT2 MUX selected by - * SIM_SOPT2[PLLFLLSEL] - */ - -#define BOARD_SOPT2_PLLFLLSEL SIM_SOPT2_PLLFLLSEL_MCGPLLCLK -#define BOARD_SOPT2_FREQ BOARD_MCG_FREQ - -/* Divider output clock = Divider input clock × [ (USBFRAC+1) / (USBDIV+1) ] - * SIM_CLKDIV2_FREQ = BOARD_SOPT2_FREQ × [ (USBFRAC+1) / (USBDIV+1) ] - * 48Mhz = 168Mhz X [(1 + 1) / (6 + 1)] - * 48Mhz = 168Mhz / (6 + 1) * (1 + 1) - */ - -#define BOARD_SIM_CLKDIV2_USBFRAC 2 -#define BOARD_SIM_CLKDIV2_USBDIV 7 -#define BOARD_SIM_CLKDIV2_FREQ (BOARD_SOPT2_FREQ / BOARD_SIM_CLKDIV2_USBDIV * BOARD_SIM_CLKDIV2_USBFRAC) -#define BOARD_USB_CLKSRC SIM_SOPT2_USBSRC -#define BOARD_USB_FREQ BOARD_SIM_CLKDIV2_FREQ - - -/* Divider output clock = Divider input clock * ((PLLFLLFRAC+1)/(PLLFLLDIV+1)) - * SIM_CLKDIV3_FREQ = BOARD_SOPT2_FREQ × [ (PLLFLLFRAC+1) / (PLLFLLDIV+1)] - * 84 Mhz = 168 Mhz X [(0 + 1) / (1 + 1)] - * 84 Mhz = 168 Mhz / (1 + 1) * (0 + 1) - */ - -#define BOARD_SIM_CLKDIV3_PLLFLLFRAC 1 -#define BOARD_SIM_CLKDIV3_PLLFLLDIV 2 -#define BOARD_SIM_CLKDIV3_FREQ (BOARD_SOPT2_FREQ / BOARD_SIM_CLKDIV3_PLLFLLDIV * BOARD_SIM_CLKDIV3_PLLFLLFRAC) - -#define BOARD_LPUART0_CLKSRC SIM_SOPT2_LPUARTSRC_MCGCLK -#define BOARD_LPUART0_FREQ BOARD_SIM_CLKDIV3_FREQ - -#define BOARD_TPM_CLKSRC SIM_SOPT2_TPMSRC_OCSERCLK -#define BOARD_TPM_FREQ BOARD_EXTAL_FREQ - -/* SDHC clocking ********************************************************************/ - -/* SDCLK configurations corresponding to various modes of operation. Formula is: - * - * SDCLK frequency = (base clock) / (prescaler * divisor) - * - * The SDHC module is always configure configured so that the core clock is the base - * clock. Possible values for prescaler and divisor are: - * - * SDCLKFS: {2, 4, 8, 16, 32, 63, 128, 256} - * DVS: {1..16} - */ - -/* SDHC pull-up resistors **********************************************************/ - -/* There are external pull-ups on the NXP fmuk66-v3 - * So enable we do not them. - */ - -#undef BOARD_SDHC_ENABLE_PULLUPS - -/* Identification mode: Optimal 400KHz, Actual 168Mhz / (32 * 14) = 375 KHz */ - -#define BOARD_SDHC_IDMODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV32 -#define BOARD_SDHC_IDMODE_DIVISOR SDHC_SYSCTL_DVS_DIV(14) - -/* MMC normal mode: Optimal 20MHz, Actual 168Mhz / (2 * 5) = 16.8 MHz */ - -#define BOARD_SDHC_MMCMODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2 -#define BOARD_SDHC_MMCMODE_DIVISOR SDHC_SYSCTL_DVS_DIV(5) - -/* SD normal mode (1-bit): Optimal 20MHz, Actual 168Mhz / (2 * 5) = 16.8 MHz */ - -#define BOARD_SDHC_SD1MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2 -#define BOARD_SDHC_SD1MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(5) - -/* SD normal mode (4-bit): Optimal 25MHz, Actual Actual 168Mhz / (2 * 4) = 21 MHz (with DMA) - * SD normal mode (4-bit): Optimal 20MHz, Actual 168Mhz / (2 * 5) = 16.8 MHz (no DMA) - */ - -#ifdef CONFIG_KINETIS_SDHC_DMA -# define BOARD_SDHC_SD4MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2 -# define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(4) -#else -# define BOARD_SDHC_SD4MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2 -# define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(5) -#endif - - -/* LED definitions ******************************************************************/ -/* The NXP FMUK66-V3 has a separate Red, Green and Blue LEDs driven by the K66 as - * follows: - * - * LED K66 - * ------ ------------------------------------------------------- - * RED FB_CS0_b/ UART2_CTS_b / ADC0_SE5b / SPI0_SCK / FTM3_CH1/ PTD1 - * GREEN FTM2_FLT0/ CMP0_IN3/ FB_AD6 / I2S0_RX_BCLK/ FTM3_CH5/ ADC1_SE5b/ PTC9 - * BLUE CMP0_IN2/ FB_AD7 / I2S0_MCLK/ FTM3_CH4/ ADC1_SE4b/ PTC8 - * - * If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any - * way. The following definitions are used to access individual LEDs. - */ - -/* LED index values for use with board_userled() */ - -#define BOARD_LED_R 0 -#define BOARD_LED_G 1 -#define BOARD_LED_B 2 -#define BOARD_NLEDS 3 - -/* LED bits for use with board_userled_all() */ - -#define BOARD_LED_R_BIT (1 << BOARD_LED_R) -#define BOARD_LED_G_BIT (1 << BOARD_LED_G) -#define BOARD_LED_B_BIT (1 << BOARD_LED_B) - -/* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board - * the NXP FMUK66-V3. The following definitions describe how NuttX controls - * the LEDs: - * - * SYMBOL Meaning LED state - * RED GREEN BLUE - * ------------------- ---------------------------- ----------------- */ -#define LED_STARTED 1 /* NuttX has been started OFF OFF OFF */ -#define LED_HEAPALLOCATE 2 /* Heap has been allocated OFF OFF ON */ -#define LED_IRQSENABLED 0 /* Interrupts enabled OFF OFF ON */ -#define LED_STACKCREATED 3 /* Idle stack created OFF ON OFF */ -#define LED_INIRQ 0 /* In an interrupt (no change) */ -#define LED_SIGNAL 0 /* In a signal handler (no change) */ -#define LED_ASSERTION 0 /* An assertion failed (no change) */ -#define LED_PANIC 4 /* The system has crashed FLASH OFF OFF */ -#undef LED_IDLE /* K66 is in sleep mode (Not used) */ - -/* Alternative pin resolution *******************************************************/ -/* If there are alternative configurations for various pins in the - * kinetis_k66pinmux.h header file, those alternative pins will be labeled with a - * suffix like _1, _2, etc. The logic in this file must select the correct pin - * configuration for the board by defining a pin configuration (with no suffix) that - * maps to the correct alternative. - */ - -/* CAN - * Signal Conn Port Pin Name - * ------- -------- ----- ----- -------- - * CAN0TX P8-2(H) PTB18 97 CAN0_TX - * CAN0RX P8-3(L) PTB19 98 CAN0_RX - * CAN1TX P19-2(H) PTC16 123 CAN1_TX - * CAN1RX P19-3(L) PTC17 124 CAN1_RX - * - */ -#define PIN_CAN0_RX PIN_CAN0_RX_2 -#define PIN_CAN0_TX PIN_CAN0_TX_2 -#define PIN_CAN1_RX PIN_CAN1_RX_2 -#define PIN_CAN1_TX PIN_CAN1_TX_2 - -/* 12C - * - */ - -/* I2C0 - * - * This device can be pinned out to be either or - - * Bit Pin Device Signal Usage Conn - * ----- --- ------- --------------------------- ------ - * PTB2 83 I2C0_SCL U_ECH Ultrasonic P13-3 - * PTB3 84 I2C0_SDA U_TRI Ultrasonic P13-2 - * ----- --- ------- --------------------------- ------ - * - * Bit Pin Device Signal Usage Conn - * ----- --- ------- --------------------------- ------ - * PTE24 45 I2C0_SCL IIC_SCL NFC Connector, IIC P2-2 - * PTE25 46 I2C0_SDA IIC_SDA NFC Connector, IIC P2-3 - * ----- --- ------- --------------------------- ------ - */ - -#define PIN_I2C0_SCL PIN_I2C0_SCL_4 /* PTE24 IIC_SCL */ -#define PIN_I2C0_SDA PIN_I2C0_SDA_4 /* PTE25 IIC_SDA */ - -/* I2C1 - * - * Bit Pin Device Signal Usage Conn - * ----- --- ------- -------------- ------------- ------ - * PTC10 115 I2C1_SCL P_SCL, GPS_SCL Pressure, GPS P3-4 - * PTC11 116 I2C1_SDA P_SDA, GPS_SDA Pressure, GPS P3-5 - * ----- --- ------- -------------- ------------- ------ - */ - -#define PIN_I2C1_SCL PIN_I2C1_SCL_1 /* PTC10 GPS / Pressure Sensor*/ -#define PIN_I2C1_SDA PIN_I2C1_SDA_1 /* PTC11 GPS / Pressure Sensor */ - - -/* SPI - * - */ - -/* SPI0 FRAM */ - -#define PIN_SPI0_PCS0 PIN_SPI0_PCS2_1 /* PTC2 SPI_CS FRAM_CS */ -#define PIN_SPI0_SCK PIN_SPI0_SCK_2 /* PTC5 SPI_CLK FRAM_SCK */ -#define PIN_SPI0_OUT PIN_SPI0_SOUT_2 /* PTC6 SPI_OUT FRAM_MOSI */ -#define PIN_SPI0_SIN PIN_SPI0_SIN_2 /* PTC7 SPI_IN FRAM_MISO */ - -/* SPI1 - * FXOS8700CQ Accelerometer - * FXAS21002CQ Gyroscope - */ - -#define PIN_SPI1_PCS0 PIN_SPI1_PCS0_1 /* PTB10 A_CS */ -#define PIN_SPI1_PCS1 PIN_SPI1_PCS1_1 /* PTB9 GM_CS */ -#define PIN_SPI1_SCK PIN_SPI1_SCK_1 /* PTB11 A_SCLK */ -#define PIN_SPI1_OUT PIN_SPI1_SOUT_1 /* PTB16 A_MOSI */ -#define PIN_SPI1_SIN PIN_SPI1_SIN_1 /* PTB17 A_MISO */ - -/* SPI2 - * Bit Pin Device Signal Conn - * ----- --- ------- --------- ------ - * PTB20 99 SPI2_PCS0 SPI2_CS P18-5 - * PTB21 100 SPI2_SCK SPI2_CLK P18-2 - * PTB22 101 SPI2_SOUT SPI2_OUT P18-3 - * PTB23 102 SPI2_SIN SPI2_IN P18-4 - * - */ - -#define PIN_SPI2_PCS0 PIN_SPI2_PCS0_1 /* PTB20 SPI2_CS */ -#define PIN_SPI2_SCK PIN_SPI2_SCK_1 /* PTB21 SPI2_CLK */ -#define PIN_SPI2_OUT PIN_SPI2_SOUT_1 /* PTB22 SPI2_OUT */ -#define PIN_SPI2_SIN PIN_SPI2_SIN_1 /* PTB23 SPI2_IN */ - -/* UART - * - * NuttX Will use LPUART0 as the Console - * - * LPUAR0 - * P16 Pin Name K66 Name - * -------- ------------ ------ --------- - * 2 UART_TX PTD9 LPUART0_TX - * 3 UART_RX PTD8 LPUART0_RX - * -------- ----- ------ --------- - */ - -#define PIN_LPUART0_RX (PIN_LPUART0_RX_3 | GPIO_PULLUP) -#define PIN_LPUART0_TX PIN_LPUART0_TX_3 - -/* UART0 - * - * P7 Pin Name K66 Name - * -------- ------------ ------- --------- - * 2 IR_Transmitter PTA2 UART0_TX - * 4 IR_Receiver PTA1 UART0_RX - * -------- ------------ ------- --------- - */ - -#define PIN_UART0_RX PIN_UART0_RX_1 -#define PIN_UART0_TX PIN_UART0_TX_1 - -/* UART1 - * - * Pin Name K66 Name - * ------------- -------------- ----- --------- - * P14-3,P15-2 FrSky_IN_RC_IN PTC3 UART1_RX - * P14-2 FrSky_OUT PTC4 UART1_TX - * ------------- ------------ ----- --------- - */ - -#define PIN_UART1_RX PIN_UART1_RX_1 -#define PIN_UART1_TX PIN_UART1_TX_1 - -/* UART2 - * No Alternative pins for UART2 - * - * P7 Pin Name K66 Name - * -------- ------------ ------- --------- - * 2 GPS_TX PTD3 UART2_TX - * 3 GPS_RX PTD2 UART2_RX - * -------- ------------ ------- --------- - */ - -/* UART4 - * - * P10 Pin Name K66 Name - * -------- ------------ ------- --------- - * 2 UART4_TX PTC15 UART4_TX - * 3 UART4_RX PTC14 UART4_RX - * 4 UART4_CTS PTC13 UART4_CTS - * 5 UART4_RTS PTE27 UART4_RTS - * -------- ------------ ------- --------- - */ - -#define PIN_UART4_RX PIN_UART4_RX_1 -#define PIN_UART4_TX PIN_UART4_TX_1 -#define PIN_UART4_RTS PIN_UART4_RTS_2 -#define PIN_UART4_CTS PIN_UART4_CTS_1 - -/* - * Ethernet TJA1100 OPEN Alliance BroadR-Reach PHY for Automotive Ethernet - * ----------------------------------------------------------------------- - * - * -------------- ----------------- ----------------------------------------- - * TJA1100 Board Signal(s) K66F Pin - * Pin Signal Function pinmux Name - * --- ---------- ----------------- ------------------------------------------ - * 1 MDC RMII0_MDC PTB1/RMII0_MDC PIN_RMII0_MDC - * 2 INT RMII0_INT_B, PTA27 PTA27 - * 3 nRST ENET_RST PTA28 PTA28 - * 4 VDDA(1V8) Cap to GND --- --- - * 5 XO 25Mhz OSC --- --- - * 6 XI 25Mhz OSC --- --- - * 7 VDDA(3V3) E_3V3 --- --- - * 8 LED (LED_ENABLE = 1) WAKE (LED_ENABLE = 0) --- - * 8 VBAT E_3V3 --- --- - * 10 nINH ENET_INH PTA8 PTA8 - * 11 VDDA(TX) E_3V3 --- --- - * 12 TRX_P ENET_P --- --- - * 13 TRX_M ENET_P --- --- - * 14 VDDD(3V3) E_3V3 --- --- - * 15 GND --- --- --- - * 16 VDDD(1V8) Cap to GND --- --- - * 17 RXER RMII0_RXER PTA5/RMII0_RXER PIN_RMII0_RXER - * 18 CRS_DIV RMII_CRSDV PTA14/RMII0_CRS_DV PIN_RMII0_CRS_DV - * 19 TXEN RMII0_TXEN PTA15/RMII0_TXEN PIN_RMII0_TXEN - * 20 GND --- --- --- - * 21 CONFIG1 ENET_CON1 THIS PIN IS A NO CONNECT - * 22 CONFIG0 ENET_CONFIG0 PTA24 PTA24 - * 23 RXD1 RMII0_RXD_1 PTA12/RMII0_RXD1 PIN_RMII0_RXD1 - * 24 RXD0 RMII0_RXD_0 PTA13/RMII0_RXD0 PIN_RMII0_RXD0 - * 25 REF_CLK E_REF_CLK PTE26/ENET_1588_CLKIN PIN_ENET_1588_CLKIN - * 26 GND2 --- --- --- - * 27 VDD(IO) E_3V3 --- --- - * 28 TXC --- --- --- - * 29 TXEN RMII_TXEN PTA15/RMII0_TXEN PIN_RMII0_TXEN - * 30 TXD3 - * 31 TXD2 - * 32 TXD1 RMII0_TXD_1 PTA17/RMII0_TXD1 PIN_RMII0_TXD1 - * 33 TXD0 RMII0_TXD_0 PTA16/RMII0_TXD0 PIN_RMII0_TXD0 - * 34 TXER - * 35 EN ENET_EN PTA29 PTA29 - * 36 MDIO RMII0_MDIO PTB0/RMII0_MDIO PIN_RMII0_MDIO - * --- ---------- ----------------- ------------------------------------ - * - */ - -#define PIN_RMII0_MDIO PIN_RMII0_MDIO_1 -#define PIN_RMII0_MDC PIN_RMII0_MDC_1 -#define PIN_ENET_PHY_RST (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTA | PIN28) -#define PIN_ENET_PHY_EN (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTA | PIN29) - -/* Board provides GPIO or other Hardware for signaling to timing analyzer */ - -#if defined(CONFIG_BOARD_USE_PROBES) -# define PROBE_N(n) (1<<((n)-1)) -# define PROBE_1 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZER0 | PIN_PORTC | PIN1) -# define PROBE_2 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZER0 | PIN_PORTA | PIN6) -# define PROBE_3 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZER0 | PIN_PORTD | PIN4) -# define PROBE_4 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZER0 | PIN_PORTD | PIN5) -# define PROBE_5 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZER0 | PIN_PORTE | PIN11) -# define PROBE_6 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZER0 | PIN_PORTE | PIN12) - -# define PROBE_INIT(mask) \ - do { \ - if ((mask)& PROBE_N(1)) { kinetis_pinconfig(PROBE_1); } \ - if ((mask)& PROBE_N(2)) { kinetis_pinconfig(PROBE_2); } \ - if ((mask)& PROBE_N(3)) { kinetis_pinconfig(PROBE_3); } \ - if ((mask)& PROBE_N(4)) { kinetis_pinconfig(PROBE_4); } \ - if ((mask)& PROBE_N(5)) { kinetis_pinconfig(PROBE_5); } \ - if ((mask)& PROBE_N(6)) { kinetis_pinconfig(PROBE_6); } \ - } while(0) - -# define PROBE(n,s) do {kinetis_gpiowrite(PROBE_##n,(s));}while(0) -# define PROBE_MARK(n) PROBE(n,false);PROBE(n,true) -#else -# define PROBE_INIT(mask) -# define PROBE(n,s) -# define PROBE_MARK(n) -#endif - -/************************************************************************************ - * Public Data - ************************************************************************************/ - -#ifndef __ASSEMBLY__ - -#undef EXTERN -#if defined(__cplusplus) -#define EXTERN extern "C" -extern "C" -{ -#else -#define EXTERN extern -#endif - -/************************************************************************************ - * Public Function Prototypes - ************************************************************************************/ - -/************************************************************************************ - * Name: kinetis_boardinitialize - * - * Description: - * All kinetis architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. - * - ************************************************************************************/ - -void kinetis_boardinitialize(void); - -#undef EXTERN -#if defined(__cplusplus) -} -#endif - -#endif /* __ASSEMBLY__ */ -#endif /* __CONFIG_NXP_FMUK66_V3_INCLUDE_BOARD_H */ diff --git a/boards/nxp/fmuk66-v3/nuttx-config/nsh/defconfig b/boards/nxp/fmuk66-v3/nuttx-config/nsh/defconfig deleted file mode 100644 index 23a497e..0000000 --- a/boards/nxp/fmuk66-v3/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,218 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_KINETIS_EDMA_HOE is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NDEBUG is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/nxp/fmuk66-v3/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="kinetis" -CONFIG_ARCH_CHIP_KINETIS=y -CONFIG_ARCH_CHIP_MK66FN2M0VMD18=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_LOOPSPERMSEC=15175 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_BULKIN_REQLEN=96 -CONFIG_CDCACM_PRODUCTID=0x001c -CONFIG_CDCACM_PRODUCTSTR="PX4 FMUK66 v3.x" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=8000 -CONFIG_CDCACM_VENDORID=0x1FC9 -CONFIG_CDCACM_VENDORSTR="NXP SEMICONDUCTORS" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_DISABLE_MQUEUE=y -CONFIG_DISABLE_POSIX_TIMERS=y -CONFIG_ETH0_PHY_TJA1100=y -CONFIG_EXAMPLES_CALIB_UDELAY=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_AUTOMOUNTER=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_IOB_NBUFFERS=24 -CONFIG_KINETIS_ADC0=y -CONFIG_KINETIS_ADC1=y -CONFIG_KINETIS_CRC=y -CONFIG_KINETIS_EDMA=y -CONFIG_KINETIS_EDMA_ELINK=y -CONFIG_KINETIS_EDMA_ERCA=y -CONFIG_KINETIS_EDMA_ERGA=y -CONFIG_KINETIS_EDMA_NTCD=16 -CONFIG_KINETIS_EMAC_RMIICLK1588CLKIN=y -CONFIG_KINETIS_ENET=y -CONFIG_KINETIS_FLEXCAN0=y -CONFIG_KINETIS_FLEXCAN1=y -CONFIG_KINETIS_GPIOIRQ=y -CONFIG_KINETIS_I2C0=y -CONFIG_KINETIS_I2C1=y -CONFIG_KINETIS_LPTMR0=y -CONFIG_KINETIS_LPUART0=y -CONFIG_KINETIS_LPUART0_RXDMA=y -CONFIG_KINETIS_MERGE_TTY=y -CONFIG_KINETIS_PDB=y -CONFIG_KINETIS_PIT=y -CONFIG_KINETIS_PORTAINTS=y -CONFIG_KINETIS_PORTBINTS=y -CONFIG_KINETIS_PORTCINTS=y -CONFIG_KINETIS_PORTDINTS=y -CONFIG_KINETIS_PORTEINTS=y -CONFIG_KINETIS_RTC=y -CONFIG_KINETIS_SDHC=y -CONFIG_KINETIS_SERIALBRK_BSDCOMPAT=y -CONFIG_KINETIS_SPI0=y -CONFIG_KINETIS_SPI1=y -CONFIG_KINETIS_SPI1_DMA=y -CONFIG_KINETIS_SPI2=y -CONFIG_KINETIS_SPI_DMA=y -CONFIG_KINETIS_UART0=y -CONFIG_KINETIS_UART0_RXDMA=y -CONFIG_KINETIS_UART1=y -CONFIG_KINETIS_UART1_RXDMA=y -CONFIG_KINETIS_UART2=y -CONFIG_KINETIS_UART2_RXDMA=y -CONFIG_KINETIS_UART4=y -CONFIG_KINETIS_UART4_RXDMA=y -CONFIG_KINETIS_UARTFIFOS=y -CONFIG_KINETIS_UART_BREAKS=y -CONFIG_KINETIS_UART_EXTEDED_BREAK=y -CONFIG_KINETIS_UART_INVERT=y -CONFIG_KINETIS_USBDCD=y -CONFIG_KINETS_LPUART_LOWEST=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_LPUART0_BAUD=57600 -CONFIG_LPUART0_SERIAL_CONSOLE=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_MULTIBLOCK_LIMIT=1 -CONFIG_MMCSD_SDIO=y -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NETDEV_PHY_IOCTL=y -CONFIG_NETINIT_THREAD=y -CONFIG_NETINIT_THREAD_PRIORITY=49 -CONFIG_NET_ARP_IPIN=y -CONFIG_NET_ARP_SEND=y -CONFIG_NET_BROADCAST=y -CONFIG_NET_ICMP=y -CONFIG_NET_ICMP_SOCKET=y -CONFIG_NET_SOCKOPTS=y -CONFIG_NET_SOLINGER=y -CONFIG_NET_TCP=y -CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_WRITE_BUFFERS=y -CONFIG_NET_UDP=y -CONFIG_NET_UDP_CHECKSUMS=y -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_DISABLE_BASENAME=y -CONFIG_NSH_DISABLE_DIRNAME=y -CONFIG_NSH_DISABLE_HEXDUMP=y -CONFIG_NSH_DISABLE_LOSETUP=y -CONFIG_NSH_DISABLE_MKFIFO=y -CONFIG_NSH_DISABLE_MKRD=y -CONFIG_NSH_DISABLE_PRINTF=y -CONFIG_NSH_DISABLE_PUT=y -CONFIG_NSH_DISABLE_REBOOT=y -CONFIG_NSH_DISABLE_UNAME=y -CONFIG_NSH_DISABLE_WGET=y -CONFIG_NSH_DISABLE_XD=y -CONFIG_NSH_FILEIOSIZE=512 -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_READLINE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x1fff0000 -CONFIG_RAW_BINARY=y -CONFIG_RTC=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_CUTERM=y -CONFIG_SYSTEM_CUTERM_DEFAULT_BAUD=57600 -CONFIG_SYSTEM_NSH=y -CONFIG_SYSTEM_PING=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART1_RXBUFSIZE=600 -CONFIG_UART1_TXBUFSIZE=1100 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_IFLOWCONTROL=y -CONFIG_UART4_OFLOWCONTROL=y -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1100 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_DUALSPEED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 -CONFIG_WATCHDOG=y diff --git a/boards/nxp/fmuk66-v3/nuttx-config/scripts/script.ld b/boards/nxp/fmuk66-v3/nuttx-config/scripts/script.ld deleted file mode 100644 index ff80e96..0000000 --- a/boards/nxp/fmuk66-v3/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,162 +0,0 @@ -/**************************************************************************** - * configs/nxp_fmuk66-v3/scripts/flash.ld - * - * Copyright (C) 2016, 2017 Gregory Nutt. All rights reserved. - * Authors: Gregory Nutt - * David Sidrane - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The MK66FN2M0VLQ18 has 2 MiB of FLASH beginning at address 0x0000:0000 and - * 256 KiB of SRAM beginning at address 0x1fff:0000- (SRAM_L) (64Kib) and - * 0x2000:0000 196 Kib (SRAM_U). - * - * NOTE: that the first part of the K66 FLASH region is reserved for - * interrupt vectflash and, following that, is a region from 0x0000:0400 - * to 0x0000:040f that is reserved for the FLASH control fields (FCF). - * - * NOTE: The on-chip RAM is split evenly among SRAM_L and SRAM_U. The RAM is - * also implemented such that the SRAM_L and SRAM_U ranges form a - * contiguous block in the memory map. - */ - -MEMORY -{ - vectflash (rx) : ORIGIN = 0x00006000, LENGTH = 1K - cfmprotect (rx) : ORIGIN = 0x00006400, LENGTH = 16 - progflash (rx) : ORIGIN = 0x00006410, LENGTH = 2M - ((6*4K) + 1K + 16) - datasram (rwx) : ORIGIN = 0x1fff0000, LENGTH = 256K -} - -OUTPUT_ARCH(arm) -ENTRY(__start) -EXTERN(__flashconfigbytes) -SECTIONS -{ - .vectors : { - _svectors = ABSOLUTE(.); - KEEP(*(.vectors)) - _evectors = ABSOLUTE(.); - } > vectflash - - .cfmprotect : { - KEEP(*(.cfmconfig)) - } > cfmprotect - - .text : { - _stext = ABSOLUTE(.); - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - . = ALIGN(8); - FILL(0xff) - . += 8; - } > progflash =0xff - - /* - * Init functions (static constructors and the like) - */ - - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - . = ALIGN(8); - FILL(0xff) - . += 8; - } > progflash - - .ARM.extab : { - *(.ARM.extab*) - . = ALIGN(8); - FILL(0xff) - . += 8; - } > progflash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > progflash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - . = ALIGN(8); - FILL(0xff) - . += 8; - } > datasram AT > progflash - - .ramfunc ALIGN(4): { - _sramfuncs = ABSOLUTE(.); - *(.ramfunc .ramfunc.*) - _eramfuncs = ABSOLUTE(.); - . = ALIGN(8); - FILL(0xff) - . += 8; - } > datasram AT > progflash =0xff - - _framfuncs = LOADADDR(.ramfunc); - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > datasram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/nxp/fmuk66-v3/nuttx-config/socketcan/defconfig b/boards/nxp/fmuk66-v3/nuttx-config/socketcan/defconfig deleted file mode 100644 index 4638f1e..0000000 --- a/boards/nxp/fmuk66-v3/nuttx-config/socketcan/defconfig +++ /dev/null @@ -1,221 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_KINETIS_EDMA_HOE is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/nxp/fmuk66-v3/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="kinetis" -CONFIG_ARCH_CHIP_KINETIS=y -CONFIG_ARCH_CHIP_MK66FN2M0VMD18=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_LOOPSPERMSEC=15175 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CAN_CONNS=1 -CONFIG_CDCACM=y -CONFIG_CDCACM_BULKIN_REQLEN=96 -CONFIG_CDCACM_PRODUCTID=0x001c -CONFIG_CDCACM_PRODUCTSTR="PX4 FMUK66 v3.x" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=8000 -CONFIG_CDCACM_VENDORID=0x1FC9 -CONFIG_CDCACM_VENDORSTR="NXP SEMICONDUCTORS" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_DISABLE_MQUEUE=y -CONFIG_DISABLE_POSIX_TIMERS=y -CONFIG_ETH0_PHY_TJA1100=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_AUTOMOUNTER=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_IOB_NBUFFERS=48 -CONFIG_IOB_NCHAINS=18 -CONFIG_KINETIS_ADC0=y -CONFIG_KINETIS_ADC1=y -CONFIG_KINETIS_CRC=y -CONFIG_KINETIS_EDMA=y -CONFIG_KINETIS_EDMA_ELINK=y -CONFIG_KINETIS_EDMA_ERCA=y -CONFIG_KINETIS_EDMA_ERGA=y -CONFIG_KINETIS_EDMA_NTCD=16 -CONFIG_KINETIS_EMAC_RMIICLK1588CLKIN=y -CONFIG_KINETIS_ENET=y -CONFIG_KINETIS_FLEXCAN0=y -CONFIG_KINETIS_FLEXCAN1=y -CONFIG_KINETIS_GPIOIRQ=y -CONFIG_KINETIS_I2C0=y -CONFIG_KINETIS_I2C1=y -CONFIG_KINETIS_LPTMR0=y -CONFIG_KINETIS_LPUART0=y -CONFIG_KINETIS_LPUART0_RXDMA=y -CONFIG_KINETIS_MERGE_TTY=y -CONFIG_KINETIS_PDB=y -CONFIG_KINETIS_PIT=y -CONFIG_KINETIS_PORTAINTS=y -CONFIG_KINETIS_PORTBINTS=y -CONFIG_KINETIS_PORTCINTS=y -CONFIG_KINETIS_PORTDINTS=y -CONFIG_KINETIS_PORTEINTS=y -CONFIG_KINETIS_RTC=y -CONFIG_KINETIS_SDHC=y -CONFIG_KINETIS_SERIALBRK_BSDCOMPAT=y -CONFIG_KINETIS_SPI0=y -CONFIG_KINETIS_SPI1=y -CONFIG_KINETIS_SPI2=y -CONFIG_KINETIS_UART0=y -CONFIG_KINETIS_UART0_RXDMA=y -CONFIG_KINETIS_UART1=y -CONFIG_KINETIS_UART1_RXDMA=y -CONFIG_KINETIS_UART2=y -CONFIG_KINETIS_UART2_RXDMA=y -CONFIG_KINETIS_UART4=y -CONFIG_KINETIS_UART4_RXDMA=y -CONFIG_KINETIS_UARTFIFOS=y -CONFIG_KINETIS_UART_BREAKS=y -CONFIG_KINETIS_UART_EXTEDED_BREAK=y -CONFIG_KINETIS_UART_INVERT=y -CONFIG_KINETIS_USBDCD=y -CONFIG_KINETS_LPUART_LOWEST=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_LPUART0_BAUD=57600 -CONFIG_LPUART0_SERIAL_CONSOLE=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_MULTIBLOCK_LIMIT=1 -CONFIG_MMCSD_SDIO=y -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NETDEV_IFINDEX=y -CONFIG_NETDEV_LATEINIT=y -CONFIG_NETUTILS_TELNETD=y -CONFIG_NET_BROADCAST=y -CONFIG_NET_CAN=y -CONFIG_NET_CAN_NOTIFIER=y -CONFIG_NET_CAN_RAW_FILTER_MAX=0 -CONFIG_NET_CAN_RAW_TX_DEADLINE=y -CONFIG_NET_CAN_SOCK_OPTS=y -CONFIG_NET_ICMP=y -CONFIG_NET_ICMP_SOCKET=y -CONFIG_NET_TCP=y -CONFIG_NET_TIMESTAMP=y -CONFIG_NET_UDP=y -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_DISABLE_BASENAME=y -CONFIG_NSH_DISABLE_DD=y -CONFIG_NSH_DISABLE_DIRNAME=y -CONFIG_NSH_DISABLE_HEXDUMP=y -CONFIG_NSH_DISABLE_LOSETUP=y -CONFIG_NSH_DISABLE_MKFIFO=y -CONFIG_NSH_DISABLE_MKRD=y -CONFIG_NSH_DISABLE_PUT=y -CONFIG_NSH_DISABLE_REBOOT=y -CONFIG_NSH_DISABLE_UNAME=y -CONFIG_NSH_DISABLE_WGET=y -CONFIG_NSH_DISABLE_XD=y -CONFIG_NSH_FILEIOSIZE=512 -CONFIG_NSH_IOBUFFER_SIZE=256 -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_READLINE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_TELNETD_CLIENTSTACKSIZE=1280 -CONFIG_NSH_TELNETD_DAEMONSTACKSIZE=1024 -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x1fff0000 -CONFIG_RAW_BINARY=y -CONFIG_RTC=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_CUTERM=y -CONFIG_SYSTEM_CUTERM_DEFAULT_BAUD=57600 -CONFIG_SYSTEM_NSH=y -CONFIG_SYSTEM_PING=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TELNET_IOTHREAD_STACKSIZE=512 -CONFIG_TELNET_MAXLCLIENTS=1 -CONFIG_TELNET_RXBUFFER_SIZE=128 -CONFIG_TELNET_TXBUFFER_SIZE=128 -CONFIG_UART1_RXBUFSIZE=600 -CONFIG_UART1_TXBUFSIZE=1100 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_IFLOWCONTROL=y -CONFIG_UART4_OFLOWCONTROL=y -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1100 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_DUALSPEED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 -CONFIG_WATCHDOG=y diff --git a/boards/nxp/fmuk66-v3/nuttx-config/test/defconfig b/boards/nxp/fmuk66-v3/nuttx-config/test/defconfig deleted file mode 100644 index c428852..0000000 --- a/boards/nxp/fmuk66-v3/nuttx-config/test/defconfig +++ /dev/null @@ -1,225 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_KINETIS_EDMA_HOE is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/nxp/fmuk66-v3/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="kinetis" -CONFIG_ARCH_CHIP_KINETIS=y -CONFIG_ARCH_CHIP_MK66FN2M0VMD18=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_LOOPSPERMSEC=15175 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_BULKIN_REQLEN=96 -CONFIG_CDCACM_PRODUCTID=0x001c -CONFIG_CDCACM_PRODUCTSTR="PX4 FMUK66 v3.x" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=8000 -CONFIG_CDCACM_VENDORID=0x1FC9 -CONFIG_CDCACM_VENDORSTR="NXP SEMICONDUCTORS" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_DISABLE_MQUEUE=y -CONFIG_DISABLE_POSIX_TIMERS=y -CONFIG_ETH0_PHY_TJA1100=y -CONFIG_EXAMPLES_CALIB_UDELAY=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_AUTOMOUNTER=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_IOB_NBUFFERS=24 -CONFIG_IOB_THROTTLE=0 -CONFIG_KINETIS_ADC0=y -CONFIG_KINETIS_ADC1=y -CONFIG_KINETIS_CRC=y -CONFIG_KINETIS_EDMA=y -CONFIG_KINETIS_EDMA_ELINK=y -CONFIG_KINETIS_EDMA_ERCA=y -CONFIG_KINETIS_EDMA_ERGA=y -CONFIG_KINETIS_EDMA_NTCD=16 -CONFIG_KINETIS_EMAC_RMIICLK1588CLKIN=y -CONFIG_KINETIS_ENET=y -CONFIG_KINETIS_FLEXCAN0=y -CONFIG_KINETIS_FLEXCAN1=y -CONFIG_KINETIS_GPIOIRQ=y -CONFIG_KINETIS_I2C0=y -CONFIG_KINETIS_I2C1=y -CONFIG_KINETIS_LPTMR0=y -CONFIG_KINETIS_LPUART0=y -CONFIG_KINETIS_LPUART0_RXDMA=y -CONFIG_KINETIS_MERGE_TTY=y -CONFIG_KINETIS_PDB=y -CONFIG_KINETIS_PIT=y -CONFIG_KINETIS_PORTAINTS=y -CONFIG_KINETIS_PORTBINTS=y -CONFIG_KINETIS_PORTCINTS=y -CONFIG_KINETIS_PORTDINTS=y -CONFIG_KINETIS_PORTEINTS=y -CONFIG_KINETIS_RTC=y -CONFIG_KINETIS_SDHC=y -CONFIG_KINETIS_SERIALBRK_BSDCOMPAT=y -CONFIG_KINETIS_SPI0=y -CONFIG_KINETIS_SPI1=y -CONFIG_KINETIS_SPI2=y -CONFIG_KINETIS_UART0=y -CONFIG_KINETIS_UART0_RXDMA=y -CONFIG_KINETIS_UART1=y -CONFIG_KINETIS_UART1_RXDMA=y -CONFIG_KINETIS_UART2=y -CONFIG_KINETIS_UART2_RXDMA=y -CONFIG_KINETIS_UART4=y -CONFIG_KINETIS_UART4_RXDMA=y -CONFIG_KINETIS_UARTFIFOS=y -CONFIG_KINETIS_UART_BREAKS=y -CONFIG_KINETIS_UART_EXTEDED_BREAK=y -CONFIG_KINETIS_UART_INVERT=y -CONFIG_KINETIS_USBDCD=y -CONFIG_KINETS_LPUART_LOWEST=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_LPUART0_BAUD=57600 -CONFIG_LPUART0_SERIAL_CONSOLE=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_MULTIBLOCK_LIMIT=1 -CONFIG_MMCSD_SDIO=y -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NETDEV_PHY_IOCTL=y -CONFIG_NETINIT_THREAD=y -CONFIG_NETINIT_THREAD_PRIORITY=49 -CONFIG_NETUTILS_TELNETD=y -CONFIG_NET_ARP_IPIN=y -CONFIG_NET_ARP_SEND=y -CONFIG_NET_BROADCAST=y -CONFIG_NET_ICMP=y -CONFIG_NET_ICMP_SOCKET=y -CONFIG_NET_SOCKOPTS=y -CONFIG_NET_SOLINGER=y -CONFIG_NET_TCP=y -CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_WRITE_BUFFERS=y -CONFIG_NET_UDP=y -CONFIG_NET_UDP_CHECKSUMS=y -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_DISABLE_BASENAME=y -CONFIG_NSH_DISABLE_DIRNAME=y -CONFIG_NSH_DISABLE_HEXDUMP=y -CONFIG_NSH_DISABLE_LOSETUP=y -CONFIG_NSH_DISABLE_MKFIFO=y -CONFIG_NSH_DISABLE_MKRD=y -CONFIG_NSH_DISABLE_PUT=y -CONFIG_NSH_DISABLE_REBOOT=y -CONFIG_NSH_DISABLE_UNAME=y -CONFIG_NSH_DISABLE_WGET=y -CONFIG_NSH_DISABLE_XD=y -CONFIG_NSH_FILEIOSIZE=512 -CONFIG_NSH_IOBUFFER_SIZE=256 -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_READLINE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_TELNETD_CLIENTSTACKSIZE=1280 -CONFIG_NSH_TELNETD_DAEMONSTACKSIZE=1024 -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x1fff0000 -CONFIG_RAW_BINARY=y -CONFIG_RTC=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_CUTERM=y -CONFIG_SYSTEM_CUTERM_DEFAULT_BAUD=57600 -CONFIG_SYSTEM_NSH=y -CONFIG_SYSTEM_PING=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TELNET_IOTHREAD_STACKSIZE=512 -CONFIG_TELNET_MAXLCLIENTS=1 -CONFIG_TELNET_RXBUFFER_SIZE=128 -CONFIG_TELNET_TXBUFFER_SIZE=128 -CONFIG_TESTING_OSTEST=y -CONFIG_TESTING_OSTEST_FPUTESTDISABLE=y -CONFIG_TESTING_OSTEST_STACKSIZE=10240 -CONFIG_UART1_RXBUFSIZE=600 -CONFIG_UART1_TXBUFSIZE=1100 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_IFLOWCONTROL=y -CONFIG_UART4_OFLOWCONTROL=y -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1100 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_DUALSPEED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 -CONFIG_WATCHDOG=y diff --git a/boards/nxp/fmuk66-v3/socketcan.px4board b/boards/nxp/fmuk66-v3/socketcan.px4board deleted file mode 100644 index 02bef73..0000000 --- a/boards/nxp/fmuk66-v3/socketcan.px4board +++ /dev/null @@ -1,9 +0,0 @@ -CONFIG_DRIVERS_UAVCAN=n -CONFIG_CYPHAL_BMS_SUBSCRIBER=y -CONFIG_CYPHAL_ESC_SUBSCRIBER=y -CONFIG_CYPHAL_GNSS_SUBSCRIBER_0=y -CONFIG_CYPHAL_GNSS_SUBSCRIBER_1=y -CONFIG_CYPHAL_READINESS_PUBLISHER=y -CONFIG_CYPHAL_UORB_ACTUATOR_OUTPUTS_PUBLISHER=y -CONFIG_CYPHAL_UORB_SENSOR_GPS_SUBSCRIBER=y -CONFIG_DRIVERS_CYPHAL=y diff --git a/boards/nxp/fmuk66-v3/src/CMakeLists.txt b/boards/nxp/fmuk66-v3/src/CMakeLists.txt deleted file mode 100644 index 06864f0..0000000 --- a/boards/nxp/fmuk66-v3/src/CMakeLists.txt +++ /dev/null @@ -1,53 +0,0 @@ -############################################################################ -# -# Copyright (c) 2016, 2018 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. -# -############################################################################ - -add_library(drivers_board - autoleds.c - automount.c - i2c.cpp - init.c - led.c - sdhc.c - spi.cpp - timer_config.cpp - usb.c -) - -target_link_libraries(drivers_board - PRIVATE - arch_io_pins - nuttx_arch # sdio - nuttx_drivers # sdio - drivers__led # drv_led_start - px4_layer - ) diff --git a/boards/nxp/fmuk66-v3/src/autoleds.c b/boards/nxp/fmuk66-v3/src/autoleds.c deleted file mode 100644 index 0a7b499..0000000 --- a/boards/nxp/fmuk66-v3/src/autoleds.c +++ /dev/null @@ -1,164 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016-2018 Gregory Nutt. All rights reserved. - * Authors: Gregory Nutt - * David Sidrane - * - * - * 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 NuttX 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. - * - ****************************************************************************/ -/* - * This module shall be used during board bring up of Nuttx. - * - * The NXP FMUK66-V3 has a separate Red, Green and Blue LEDs driven by the K66 - * as follows: - * - * LED K66 - * ------ ------------------------------------------------------- - * RED FB_CS0_b/ UART2_CTS_b / ADC0_SE5b / SPI0_SCK / FTM3_CH1/ PTD1 - * GREEN FTM2_FLT0/ CMP0_IN3/ FB_AD6 / I2S0_RX_BCLK/ FTM3_CH5/ ADC1_SE5b/ PTC9 - * BLUE CMP0_IN2/ FB_AD7 / I2S0_MCLK/ FTM3_CH4/ ADC1_SE4b/ PTC8 - * - * If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board - * the NXP fmuk66-v3. The following definitions describe how NuttX controls - * the LEDs: - * - * SYMBOL Meaning LED state - * RED GREEN BLUE - * ------------------- ----------------------- ----------------- - * LED_STARTED NuttX has been started OFF OFF OFF - * LED_HEAPALLOCATE Heap has been allocated OFF OFF ON - * LED_IRQSENABLED Interrupts enabled OFF OFF ON - * LED_STACKCREATED Idle stack created OFF ON OFF - * LED_INIRQ In an interrupt (no change) - * LED_SIGNAL In a signal handler (no change) - * LED_ASSERTION An assertion failed (no change) - * LED_PANIC The system has crashed FLASH OFF OFF - * LED_IDLE K66 is in sleep mode (Optional, not used) - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include - -#include -#include - -#include "chip.h" -#include "kinetis.h" -#include "board_config.h" - -#ifdef CONFIG_ARCH_LEDS - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Summary of all possible settings */ - -#define LED_NOCHANGE 0 /* LED_IRQSENABLED, LED_INIRQ, LED_SIGNAL, LED_ASSERTION */ -#define LED_OFF_OFF_OFF 1 /* LED_STARTED */ -#define LED_OFF_OFF_ON 2 /* LED_HEAPALLOCATE */ -#define LED_OFF_ON_OFF 3 /* LED_STACKCREATED */ -#define LED_ON_OFF_OFF 4 /* LED_PANIC */ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_autoled_initialize - * - * Description: - * Initialize the on-board LED - * - ****************************************************************************/ - -void board_autoled_initialize(void) -{ - kinetis_pinconfig(GPIO_LED_R); - kinetis_pinconfig(GPIO_LED_G); - kinetis_pinconfig(GPIO_LED_B); -} - -/**************************************************************************** - * Name: board_autoled_on - ****************************************************************************/ - -void board_autoled_on(int led) -{ - if (led != LED_NOCHANGE) { - bool redoff = true; - bool greenoff = true; - bool blueoff = true; - - switch (led) { - default: - case LED_OFF_OFF_OFF: - break; - - case LED_OFF_OFF_ON: - blueoff = false; - break; - - case LED_OFF_ON_OFF: - greenoff = false; - break; - - case LED_ON_OFF_OFF: - redoff = false; - break; - } - - kinetis_gpiowrite(GPIO_LED_R, redoff); - kinetis_gpiowrite(GPIO_LED_G, greenoff); - kinetis_gpiowrite(GPIO_LED_B, blueoff); - } -} - -/**************************************************************************** - * Name: board_autoled_off - ****************************************************************************/ - -void board_autoled_off(int led) -{ - if (led == LED_ON_OFF_OFF) { - kinetis_gpiowrite(GPIO_LED_R, true); - kinetis_gpiowrite(GPIO_LED_G, true); - kinetis_gpiowrite(GPIO_LED_B, true); - } -} - -#endif /* CONFIG_ARCH_LEDS */ diff --git a/boards/nxp/fmuk66-v3/src/automount.c b/boards/nxp/fmuk66-v3/src/automount.c deleted file mode 100644 index f69f7fc..0000000 --- a/boards/nxp/fmuk66-v3/src/automount.c +++ /dev/null @@ -1,304 +0,0 @@ -/************************************************************************************ - * - * Copyright (C) 2016-2018 Gregory Nutt. All rights reserved. - * Authors: Gregory Nutt - * David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#if defined(CONFIG_FS_AUTOMOUNTER_DEBUG) && !defined(CONFIG_DEBUG_FS) -# define CONFIG_DEBUG_FS 1 -#endif - -#include -#include - -#include -#include -#include - -#include "board_config.h" -#ifdef HAVE_AUTOMOUNTER - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Types - ************************************************************************************/ -/* This structure represents the changeable state of the automounter */ - -struct fmuk66_automount_state_s { - volatile automount_handler_t handler; /* Upper half handler */ - FAR void *arg; /* Handler argument */ - bool enable; /* Fake interrupt enable */ - bool pending; /* Set if there an event while disabled */ -}; - -/* This structure represents the static configuration of an automounter */ - -struct fmuk66_automount_config_s { - /* This must be first thing in structure so that we can simply cast from struct - * automount_lower_s to struct fmuk66_automount_config_s - */ - - struct automount_lower_s lower; /* Publicly visible part */ - FAR struct fmuk66_automount_state_s *state; /* Changeable state */ -}; - -/************************************************************************************ - * Private Function Prototypes - ************************************************************************************/ - -static int fmuk66_attach(FAR const struct automount_lower_s *lower, automount_handler_t isr, FAR void *arg); -static void fmuk66_enable(FAR const struct automount_lower_s *lower, bool enable); -static bool fmuk66_inserted(FAR const struct automount_lower_s *lower); - -/************************************************************************************ - * Private Data - ************************************************************************************/ - -static struct fmuk66_automount_state_s g_sdhc_state; -static const struct fmuk66_automount_config_s g_sdhc_config = { - .lower = - { - .fstype = CONFIG_FMUK66_SDHC_AUTOMOUNT_FSTYPE, - .blockdev = CONFIG_FMUK66_SDHC_AUTOMOUNT_BLKDEV, - .mountpoint = CONFIG_FMUK66_SDHC_AUTOMOUNT_MOUNTPOINT, - .ddelay = MSEC2TICK(CONFIG_FMUK66_SDHC_AUTOMOUNT_DDELAY), - .udelay = MSEC2TICK(CONFIG_FMUK66_SDHC_AUTOMOUNT_UDELAY), - .attach = fmuk66_attach, - .enable = fmuk66_enable, - .inserted = fmuk66_inserted - }, - .state = &g_sdhc_state -}; - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Name: fmuk66_attach - * - * Description: - * Attach a new SDHC event handler - * - * Input Parameters: - * lower - An instance of the auto-mounter lower half state structure - * isr - The new event handler to be attach - * arg - Client data to be provided when the event handler is invoked. - * - * Returned Value: - * Always returns OK - * - ************************************************************************************/ - -static int fmuk66_attach(FAR const struct automount_lower_s *lower, automount_handler_t isr, FAR void *arg) -{ - FAR const struct fmuk66_automount_config_s *config; - FAR struct fmuk66_automount_state_s *state; - - /* Recover references to our structure */ - - config = (FAR struct fmuk66_automount_config_s *)lower; - DEBUGASSERT(config != NULL && config->state != NULL); - - state = config->state; - - /* Save the new handler info (clearing the handler first to eliminate race - * conditions). - */ - - state->handler = NULL; - state->pending = false; - state->arg = arg; - state->handler = isr; - return OK; -} - -/************************************************************************************ - * Name: fmuk66_enable - * - * Description: - * Enable card insertion/removal event detection - * - * Input Parameters: - * lower - An instance of the auto-mounter lower half state structure - * enable - True: enable event detection; False: disable - * - * Returned Value: - * None - * - ************************************************************************************/ - -static void fmuk66_enable(FAR const struct automount_lower_s *lower, bool enable) -{ - FAR const struct fmuk66_automount_config_s *config; - FAR struct fmuk66_automount_state_s *state; - irqstate_t flags; - - /* Recover references to our structure */ - - config = (FAR struct fmuk66_automount_config_s *)lower; - DEBUGASSERT(config != NULL && config->state != NULL); - - state = config->state; - - /* Save the fake enable setting */ - - flags = enter_critical_section(); - state->enable = enable; - - /* Did an interrupt occur while interrupts were disabled? */ - - if (enable && state->pending) { - /* Yes.. perform the fake interrupt if the interrutp is attached */ - - if (state->handler) { - bool inserted = fmuk66_cardinserted(); - (void)state->handler(&config->lower, state->arg, inserted); - } - - state->pending = false; - } - - leave_critical_section(flags); -} - -/************************************************************************************ - * Name: fmuk66_inserted - * - * Description: - * Check if a card is inserted into the slot. - * - * Input Parameters: - * lower - An instance of the auto-mounter lower half state structure - * - * Returned Value: - * True if the card is inserted; False otherwise - * - ************************************************************************************/ - -static bool fmuk66_inserted(FAR const struct automount_lower_s *lower) -{ - return fmuk66_cardinserted(); -} - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -/************************************************************************************ - * Name: fmuk66_automount_initialize - * - * Description: - * Configure auto-mounters for each enable and so configured SDHC - * - * Input Parameters: - * None - * - * Returned Value: - * None - * - ************************************************************************************/ - -void fmuk66_automount_initialize(void) -{ - FAR void *handle; - - finfo("Initializing automounter(s)\n"); - - /* Initialize the SDHC0 auto-mounter */ - - handle = automount_initialize(&g_sdhc_config.lower); - - if (!handle) { - ferr("ERROR: Failed to initialize auto-mounter for SDHC0\n"); - } -} - -/************************************************************************************ - * Name: fmuk66_automount_event - * - * Description: - * The SDHC card detection logic has detected an insertion or removal event. It - * has already scheduled the MMC/SD block driver operations. Now we need to - * schedule the auto-mount event which will occur with a substantial delay to make - * sure that everything has settle down. - * - * Input Parameters: - * slotno - Identifies the SDHC0 slot: SDHC0_SLOTNO or SDHC1_SLOTNO. There is a - * terminology problem here: Each SDHC supports two slots, slot A and slot B. - * Only slot A is used. So this is not a really a slot, but an HSCMI peripheral - * number. - * inserted - True if the card is inserted in the slot. False otherwise. - * - * Returned Value: - * None - * - * Assumptions: - * Interrupts are disabled. - * - ************************************************************************************/ - -void fmuk66_automount_event(bool inserted) -{ - FAR const struct fmuk66_automount_config_s *config = &g_sdhc_config; - FAR struct fmuk66_automount_state_s *state = &g_sdhc_state; - - /* Is the auto-mounter interrupt attached? */ - - if (state->handler) { - /* Yes.. Have we been asked to hold off interrupts? */ - - if (!state->enable) { - /* Yes.. just remember the there is a pending interrupt. We will - * deliver the interrupt when interrupts are "re-enabled." - */ - - state->pending = true; - - } else { - /* No.. forward the event to the handler */ - - (void)state->handler(&config->lower, state->arg, inserted); - } - } -} - -#endif /* HAVE_AUTOMOUNTER */ diff --git a/boards/nxp/fmuk66-v3/src/board_config.h b/boards/nxp/fmuk66-v3/src/board_config.h deleted file mode 100644 index 56a5c0c..0000000 --- a/boards/nxp/fmuk66-v3/src/board_config.h +++ /dev/null @@ -1,563 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013-2018 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * NXP fmuk66-v3 internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ -#include -#include -#include - -__BEGIN_DECLS - -/* these headers are not C++ safe */ -#include -#include -#include - -__END_DECLS - -/* FMUK66 GPIOs ***********************************************************************************/ -/* LEDs */ -/* An RGB LED is connected through GPIO as shown below: - * TBD (no makring on schematic) - * LED K66 - * ------ ------------------------------------------------------- - * RED FB_CS0_b/ UART2_CTS_b / ADC0_SE5b / SPI0_SCK / FTM3_CH1/ PTD1 - * GREEN FTM2_FLT0/ CMP0_IN3/ FB_AD6 / I2S0_RX_BCLK/ FTM3_CH5/ ADC1_SE5b/ PTC9 - * BLUE CMP0_IN2/ FB_AD7 / I2S0_MCLK/ FTM3_CH4/ ADC1_SE4b/ PTC8 - */ - -#define GPIO_LED_R (GPIO_HIGHDRIVE | GPIO_OUTPUT_ONE | PIN_PORTD | PIN1) -#define GPIO_LED_G (GPIO_HIGHDRIVE | GPIO_OUTPUT_ONE | PIN_PORTC | PIN9) -#define GPIO_LED_B (GPIO_HIGHDRIVE | GPIO_OUTPUT_ONE | PIN_PORTC | PIN8) - - -#define GPIO_LED_1 (GPIO_HIGHDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTD | PIN13) -#define GPIO_LED_2 (GPIO_HIGHDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTD | PIN14) - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 // Use D9 and D10 -#define BOARD_OVERLOAD_LED LED_AMBER -#define BOARD_ARMED_STATE_LED LED_GREEN - -#define GPIO_NFC_IO (GPIO_HIGHDRIVE | GPIO_OUTPUT_ONE | PIN_PORTA | PIN26) -#define GPIO_SENSOR_P_EN (GPIO_HIGHDRIVE | GPIO_OUTPUT_ONE | PIN_PORTB | PIN8) - - -/* UART tty Mapping - * Device tty alt Connector Name - * ------- ---------- -------------- --------- ------------------------- - * LPUART0 /dev/tty0 /dev/console J16 DCD-Mini - * UART0 /dev/tty1 --- J7 SERIAL 2 / TELEMETRY 2 / IRDA - * UART1 /dev/tty2 --- J15 SERIAL4/FrSky, RC_IN - * UART2 /dev/tty3 --- J3 GPS connector - * UART4 /dev/tty4 --- J10 SERIAL 1 / TELEMETRY 1 - */ - -/* High-resolution timer */ -#define HRT_TIMER 1 /* TPM1 timer for the HRT */ -#define HRT_TIMER_CHANNEL 0 /* Use capture/compare channel 0 */ - -/* PPM IN - */ - -#define HRT_PPM_CHANNEL 1 /* Use TPM1 capture/compare channel 1 */ -#define GPIO_PPM_IN PIN_TPM1_CH1_1 /* PTC3 USART1 RX and PTA9 and PIN_TPM1_CH1 AKA FrSky_IN_RC_IN */ - - -/* - * - * NXP fmuk66-v3 has separate RC_IN - * - * GPIO PPM_IN on PTA9 PIN_TPM1_CH1 and PCT3 USART1 RX - * SPEKTRUM_RX (it's TX or RX in Bind) on PCT3 USART1 RX - * Inversion is possible the UART - * The FMU can drive GPIO PPM_IN as an output - */ - -/* Spektrum controls ******************************************************/ - -/* Power is a p-Channel FET */ - -#define GPIO_SPEKTRUM_P_EN (GPIO_HIGHDRIVE | GPIO_OUTPUT_ONE | PIN_PORTA | PIN7) - -/* For binding the Spektrum 3-pin interfaces is used with it TX (output) - * as an input Therefore we drive are UARTx_RX (normaly an input) as an - * output - */ - -#define GPIO_PPM_IN_AS_OUT (GPIO_HIGHDRIVE | GPIO_OUTPUT_ONE | PIN_PORTC | PIN3) - -#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_PPM_IN_AS_OUT) -#define SPEKTRUM_RX_AS_UART() px4_arch_configgpio(PIN_UART1_RX) -#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true)) - -/* RC input */ - -#define RC_SERIAL_PORT "/dev/ttyS2" /* UART1 */ -#define GPIO_RSSI_IN PIN_ADC1_SE13 - -/* Ethernet Control - * - * Uninitialized to Reset Disabled and Inhibited - * All pins driven low to not back feed when power is off - */ - -#define nGPIO_ETHERNET_P_EN (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTB | PIN3) -#define GPIO_ENET_RST (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTA | PIN28) -#define GPIO_ENET_EN (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTA | PIN29) -#define GPIO_ENET_INH (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTA | PIN8) -#define GPIO_ENET_CONFIG0 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTA | PIN24) -#define GPIO_ENET_CONFIG1 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTB | PIN2) - -/* CAN Control - * Control pin S allows two operating modes to be selected: - * high-speed mode (Low) or silent mode (high) - */ - -#define GPIO_CAN0_STB (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTC | PIN19) -#define GPIO_CAN1_STB (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTC | PIN18) - - -/* Safety Switch - * TBD - */ -#define GPIO_LED_SAFETY (GPIO_HIGHDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTC | PIN0) -#define GPIO_BTN_SAFETY (GPIO_PULLUP | PIN_PORTE | PIN28) - -/* NXP FMUK66-V3 GPIOs ****************************************************************/ - -/* SDHC - * - * A micro Secure Digital (SD) card slot is available on the board connected to - * the SD Host Controller (SDHC) signals of the MCU. This slot will accept micro - * format SD memory cards. The SD card detect pin (PTE6) is an open switch that - * shorts with VDD when card is inserted. - * - * ------------ ------------- -------- - * SD Card Slot Board Signal K66 Pin - * ------------ ------------- -------- - * DAT0 SDHC0_D0 PTE1 - * DAT1 SDHC0_D1 PTE0 - * DAT2 SDHC0_D2 PTE5 - * CD/DAT3 SDHC0_D3 PTE4 - * CMD SDHC0_CMD PTE3 - * CLK SDHC0_DCLK PTE2 - * SWITCH D_CARD_DETECT PTD10 - * CAED_P_EN PTD6 - * ------------ ------------- -------- - * - * There is no Write Protect pin available to the K66 - */ -#define SD_CAED_P_EN (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTD | PIN6) - -//#define GPIO_SD_CARDDETECT (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTD | PIN10) - -/* SPI device reset signals - * In Active state - */ - -/* Init in reset */ -#define GPIO_GM_nRST (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTD | PIN12) -#define GPIO_A_RST (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTA | PIN25) - -/* Sensor interrupts */ - -#define GPIO_EXTI_GYRO_INT1 (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTE | PIN7) -#define GPIO_EXTI_GYRO_INT2 (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTE | PIN6) -#define GPIO_EXTI_ACCEL_MAG_INT1 (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTE | PIN9) -#define GPIO_EXTI_ACCEL_MAG_INT2 (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTE | PIN10) -#define GPIO_EXTI_BARO_INT1 (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTD | PIN11) -#define GPIO_EXTI_BARO_INT2 (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTD | PIN7) - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that can be used by the Px4 - * Firmware in the adc driver. ADC1 has 32 channels, with some a/b selection overlap - * in the AD4-AD7 range on the same ADC. - * - * Only ADC1 is used - * Bits 31:0 are ADC1 channels 31:0 - */ - -#define ADC1_CH(c) (((c) & 0x1f)) /* Define ADC number Channel number */ -#define ADC1_GPIO(n) PIN_ADC1_SE##n - -/* ADC defines to be used in sensors.cpp to read from a particular channel */ - -#define ADC_USB_VBUS_VALID ADC1_CH(0) /* USB_VBUS_VALID 29 - ADC1_DP0 */ -#define ADC_BATTERY_VOLTAGE_CHANNEL ADC1_CH(10) /* BAT_VSENS 85 PTB4 ADC1_SE10 */ -#define ADC_BATTERY_CURRENT_CHANNEL ADC1_CH(11) /* BAT_ISENS 86 PTB5 ADC1_SE11 */ -#define ADC_5V_RAIL_SENSE ADC1_CH(12) /* 5V_VSENS 87 PTB6 ADC1_SE12 */ -#define ADC_RSSI_IN ADC1_CH(13) /* RSSI_IN 88 PTB7 ADC1_SE13 */ -#define ADC_AD1 ADC1_CH(16) /* AD1 35 - ADC1_SE16 */ -#define ADC_AD2 ADC1_CH(18) /* AD2 37 - ADC1_SE18 */ -#define ADC_AD3 ADC1_CH(23) /* AD3 39 - ADC1_SE23 */ - -/* Mask use to initialize the ADC driver */ - -#define ADC_CHANNELS ((1 << ADC_USB_VBUS_VALID) | \ - (1 << ADC_BATTERY_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY_CURRENT_CHANNEL) | \ - (1 << ADC_5V_RAIL_SENSE) | \ - (1 << ADC_RSSI_IN) | \ - (1 << ADC_AD1) | \ - (1 << ADC_AD2) | \ - (1 << ADC_AD3)) - - -/* GPIO that require Configuration */ - -#define PX4_ADC_GPIO \ - /* PTB4 ADC1_SE10 */ ADC1_GPIO(10), \ - /* PTB5 ADC1_SE11 */ ADC1_GPIO(11), \ - /* PTB6 ADC1_SE12 */ ADC1_GPIO(12), \ - /* PTB7 ADC1_SE13 */ ADC1_GPIO(13) - -/* User GPIOs - * - */ - -/* Timer I/O PWM and capture - * - * 14 PWM outputs are configured. - * 14 Timer inputs are configured. - * - * Pins: - * Defined in board.h - */ -// todo:Design this! - -#define DIRECT_PWM_OUTPUT_CHANNELS 6 - -#define GPIO_ULTRASOUND_TRIGGER /* PTD0 */ (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTD | PIN0) -#define GPIO_ULTRASOUND_ECHO /* PTA10 */ (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTA | PIN10) - -/* Power supply control and monitoring GPIOs */ -// None - -#define GPIO_PERIPH_3V3_EN 0 - - -/* Tone alarm output PTA11 - TMP 2_CH1 is On +P12-4, -P12-5 - * It is driving a NPN - */ -#define TONE_ALARM_TIMER 2 /* timer */ -#define TONE_ALARM_CHANNEL 1 /* channel */ -#define GPIO_TONE_ALARM_IDLE (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTA | PIN11) -#define GPIO_TONE_ALARM (PIN_TPM2_CH1_1) - -/* USB - * - * VBUS detection is on 29 ADC_DPM0 and PTE8 - */ -#define GPIO_USB_VBUS_VALID /* PTE8 */ (GPIO_PULLUP | PIN_PORTE | PIN8) - -/* PWM input driver. Use FMU PWM14 pin - * todo:desing this - */ -#define PWMIN_TIMER 0 -#define PWMIN_TIMER_CHANNEL 2 -#define GPIO_PWM_IN GPIO_FTM0_CH2IN - -/* Define True logic Power Control in arch agnostic form */ - -#define VDD_ETH_EN(on_true) px4_arch_gpiowrite(nGPIO_ETHERNET_P_EN, !(on_true)) -// Do not have #define VDD_5V_PERIPH_EN(on_true) px4_arch_gpiowrite(GPIO_nVDD_5V_PERIPH_EN, !(on_true)) -// Do not have #define VDD_5V_HIPOWER_EN(on_true) px4_arch_gpiowrite(GPIO_nVDD_5V_HIPOWER_EN, !(on_true)) -#define VDD_3V3_SENSORS_EN(on_true) px4_arch_gpiowrite(GPIO_SENSOR_P_EN, (on_true)) -#define VDD_3V3_SPEKTRUM_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_SPEKTRUM_P_EN, !(on_true)) -#define READ_VDD_3V3_SPEKTRUM_POWER_EN() px4_arch_gpioread(GPIO_SPEKTRUM_P_EN) -// Do not have #define VDD_5V_RC_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_RC_EN, (on_true)) -// Do not have #define VDD_5V_WIFI_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_WIFI_EN, (on_true)) -#define VDD_3V3_SD_CARD_EN(on_true) px4_arch_gpiowrite(SD_CAED_P_EN, !(on_true)) - -/* Map to control term used in RC lib */ -#define SPEKTRUM_POWER(on_true) VDD_3V3_SPEKTRUM_POWER_EN((on_true)) - - -/* - * By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ - -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_USB_VBUS_VALID)) -#define BOARD_ADC_BRICK_VALID (1) -#define BOARD_ADC_SERVO_VALID (1) -#define BOARD_ADC_PERIPH_5V_OC (0) -#define BOARD_ADC_HIPOWER_5V_OC (0) - - -#define BOARD_HAS_LED_PWM 1 - -#define LED_TIM3_CH1OUT /* PTD1 RGB_R */ PIN_FTM3_CH1_1 -#define LED_TIM3_CH5OUT /* PTC9 RGB_G */ PIN_FTM3_CH5_1 -#define LED_TIM3_CH4OUT /* PTC8 RGB_B */ PIN_FTM3_CH4_1 - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 2048 - -/* This board provides the board_on_reset interface */ - -#define BOARD_HAS_ON_RESET 1 - -#define PX4_GPIO_INIT_LIST { \ - GPIO_LED_R, \ - GPIO_LED_G, \ - GPIO_LED_B, \ - GPIO_SENSOR_P_EN, \ - SD_CAED_P_EN, \ - nGPIO_ETHERNET_P_EN, \ - GPIO_SPEKTRUM_P_EN, \ - PX4_ADC_GPIO, \ - GPIO_GM_nRST, \ - GPIO_A_RST, \ - GPIO_USB_VBUS_VALID, \ - GPIO_ENET_RST, \ - GPIO_ENET_EN, \ - GPIO_ENET_INH, \ - GPIO_ENET_CONFIG0, \ - GPIO_ENET_CONFIG1, \ - PIN_CAN0_RX, \ - PIN_CAN0_TX, \ - PIN_CAN1_RX, \ - PIN_CAN1_TX, \ - GPIO_CAN0_STB, \ - GPIO_CAN1_STB, \ - GPIO_BTN_SAFETY, \ - GPIO_TONE_ALARM_IDLE, \ - GPIO_NFC_IO, \ - GPIO_LED_1, \ - GPIO_LED_2 \ - } - -/* Automounter */ - -#define HAVE_MMCSD 1 -#define HAVE_AUTOMOUNTER 1 -#if !defined(CONFIG_FS_AUTOMOUNTER) || !defined(HAVE_MMCSD) -# undef HAVE_AUTOMOUNTER -# undef CONFIG_FMUK66_SDHC_AUTOMOUNT -#endif - -#ifndef CONFIG_FMUK66_SDHC_AUTOMOUNT -# undef HAVE_AUTOMOUNTER -#endif - -/* Automounter defaults */ - -#ifdef HAVE_AUTOMOUNTER - -# ifndef CONFIG_FMUK66_SDHC_AUTOMOUNT_FSTYPE -# define CONFIG_FMUK66_SDHC_AUTOMOUNT_FSTYPE "vfat" -# endif - -# ifndef CONFIG_FMUK66_SDHC_AUTOMOUNT_BLKDEV -# define CONFIG_FMUK66_SDHC_AUTOMOUNT_BLKDEV "/dev/mmcds0" -# endif - -# ifndef CONFIG_FMUK66_SDHC_AUTOMOUNT_MOUNTPOINT -# define CONFIG_FMUK66_SDHC_AUTOMOUNT_MOUNTPOINT "/mnt/sdcard" -# endif - -# ifndef CONFIG_FMUK66_SDHC_AUTOMOUNT_DDELAY -# define CONFIG_FMUK66_SDHC_AUTOMOUNT_DDELAY 1000 -# endif - -# ifndef CONFIG_FMUK66_SDHC_AUTOMOUNT_UDELAY -# define CONFIG_FMUK66_SDHC_AUTOMOUNT_UDELAY 2000 -# endif -#endif /* HAVE_AUTOMOUNTER */ - -#define BOARD_HAS_NOISY_FXOS8700_MAG 1 // Disable internal MAG - -#define BOARD_NUM_IO_TIMERS 3 - -/************************************************************************************ - * Public data - ************************************************************************************/ - -__BEGIN_DECLS - -#ifndef __ASSEMBLY__ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -/************************************************************************************ - * Name: fmuk66_spidev_initialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the NXP FMUK66-V3 board. - * - ************************************************************************************/ - -void fmuk66_spidev_initialize(void); - -/************************************************************************************ - * Name: fmuk66_spi_bus_initialize - * - * Description: - * Called to configure SPI Buses. - * - ************************************************************************************/ - -int fmuk66_spi_bus_initialize(void); - -/**************************************************************************************************** - * Name: board_spi_reset board_peripheral_reset - * - * Description: - * Called to reset SPI and the perferal bus - * - ****************************************************************************************************/ -void board_peripheral_reset(int ms); - -/************************************************************************************ - * Name: fmuk66_bringup - * - * Description: - * Bring up board features - * - ************************************************************************************/ - -#if defined(CONFIG_BOARDCTL) || defined(CONFIG_BOARD_INITIALIZE) -int fmuk66_bringup(void); -#endif - -/**************************************************************************** - * Name: fmuk66_sdhc_initialize - * - * Description: - * Inititialize the SDHC SD card slot - * - ****************************************************************************/ - -int fmuk66_sdhc_initialize(void); - -/************************************************************************************ - * Name: fmuk66_cardinserted - * - * Description: - * Check if a card is inserted into the SDHC slot - * - ************************************************************************************/ - -#ifdef HAVE_AUTOMOUNTER -bool fmuk66_cardinserted(void); -#else -# define fmuk66_cardinserted() (false) -#endif - -/************************************************************************************ - * Name: fmuk66_writeprotected - * - * Description: - * Check if the card in the MMC/SD slot is write protected - * - ************************************************************************************/ - -#ifdef HAVE_AUTOMOUNTER -bool fmuk66_writeprotected(void); -#else -# define fmuk66_writeprotected() (false) -#endif - -/************************************************************************************ - * Name: fmuk66_automount_initialize - * - * Description: - * Configure auto-mounter for the configured SDHC slot - * - * Input Parameters: - * None - * - * Returned Value: - * None - * - ************************************************************************************/ - -#ifdef HAVE_AUTOMOUNTER -void fmuk66_automount_initialize(void); -#endif - -/************************************************************************************ - * Name: fmuk66_automount_event - * - * Description: - * The SDHC card detection logic has detected an insertion or removal event. It - * has already scheduled the MMC/SD block driver operations. Now we need to - * schedule the auto-mount event which will occur with a substantial delay to make - * sure that everything has settle down. - * - * Input Parameters: - * inserted - True if the card is inserted in the slot. False otherwise. - * - * Returned Value: - * None - * - * Assumptions: - * Interrupts are disabled. - * - ************************************************************************************/ - -#ifdef HAVE_AUTOMOUNTER -void fmuk66_automount_event(bool inserted); -#endif - -/************************************************************************************ - * Name: fmuk66_timer_initialize - * - * Description: - * Called to configure the FTM to provide 1 Mhz - * - ************************************************************************************/ - -void fmuk66_timer_initialize(void); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/nxp/fmuk66-v3/src/i2c.cpp b/boards/nxp/fmuk66-v3/src/i2c.cpp deleted file mode 100644 index 75b583b..0000000 --- a/boards/nxp/fmuk66-v3/src/i2c.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusInternal(PX4_BUS_NUMBER_TO_PX4(1)), - initI2CBusExternal(PX4_BUS_NUMBER_TO_PX4(0)), -}; diff --git a/boards/nxp/fmuk66-v3/src/init.c b/boards/nxp/fmuk66-v3/src/init.c deleted file mode 100644 index 57e8633..0000000 --- a/boards/nxp/fmuk66-v3/src/init.c +++ /dev/null @@ -1,313 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2016, 2018 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * NXP fmuk66-v3 specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include "board_config.h" - -#include "arm_internal.h" -#include - -#include -#include - -#include - -#include -#include -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/**************************************************************************** - * Protected Functions - ****************************************************************************/ -/**************************************************************************** - * Public Functions - ****************************************************************************/ -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ - -void board_on_reset(int status) -{ - for (int i = 0; i < 6; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * Name: board_read_VBUS_state - * - * Description: - * All boards must provide a way to read the state of VBUS, this my be simple - * digital input on a GPIO. Or something more complicated like a Analong input - * or reading a bit from a USB controller register. - * - * Returns - 0 if connected. - * - ************************************************************************************/ - -int board_read_VBUS_state(void) -{ - return BOARD_ADC_USB_CONNECTED ? 0 : 1; -} - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - /* set the peripheral rails off */ - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ -} - -/************************************************************************************ - * Name: kinetis_boardinitialize - * - * Description: - * All Kinetis architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. - * - ************************************************************************************/ - -__EXPORT void -kinetis_boardinitialize(void) -{ - board_on_reset(-1); /* Reset PWM first thing */ - - /* configure LEDs */ - board_autoled_initialize(); - - const uint32_t gpio[] = PX4_GPIO_INIT_LIST; - px4_gpio_init(gpio, arraySize(gpio)); - - fmuk66_timer_initialize(); - - /* Power on Spektrum */ - - VDD_3V3_SPEKTRUM_POWER_EN(true); -} -/**************************************************************************** - * Name: kinetis_serial_dma_poll_all - * - * Description: - * Checks receive DMA buffers for received bytes that have not accumulated - * to the point where the DMA half/full interrupt has triggered. - * - * This function should be called from a timer or other periodic context. - * - ****************************************************************************/ - -void kinetis_lpserial_dma_poll_all(void) -{ -#if defined(LPSERIAL_HAVE_DMA) - kinetis_lpserial_dma_poll(); -#endif -#if defined(SERIAL_HAVE_DMA) - kinetis_serial_dma_poll(); -#endif -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - - VDD_3V3_SD_CARD_EN(true); - VDD_3V3_SENSORS_EN(true); - - /* configure SPI interfaces */ - - fmuk66_spidev_initialize(); - - VDD_ETH_EN(true); - - px4_platform_init(); - - /* configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_DMA) || defined(LPSERIAL_HAVE_DMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)kinetis_lpserial_dma_poll_all, NULL); -#endif /* SERIAL_HAVE_DMA || LPSERIAL_HAVE_DMA */ - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_off(LED_GREEN); - led_off(LED_BLUE); - - int ret = fmuk66_sdhc_initialize(); - - if (ret != OK) { - board_autoled_on(LED_RED); - } - -#ifdef HAVE_AUTOMOUNTER - /* Initialize the auto-mounter */ - - fmuk66_automount_initialize(); -#endif - - /* Configure SPI-based devices */ - -#ifdef CONFIG_SPI - ret = fmuk66_spi_bus_initialize(); - - if (ret != OK) { - board_autoled_on(LED_RED); - } - -#endif - -#ifdef CONFIG_NETDEV_LATEINIT - -# ifdef CONFIG_KINETIS_ENET - kinetis_netinitialize(0); -# endif - -# ifdef CONFIG_KINETIS_FLEXCAN0 - kinetis_caninitialize(0); -# endif - -# ifdef CONFIG_KINETIS_FLEXCAN1 - kinetis_caninitialize(1); -# endif - -#endif - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/nxp/fmuk66-v3/src/led.c b/boards/nxp/fmuk66-v3/src/led.c deleted file mode 100644 index dca4e56..0000000 --- a/boards/nxp/fmuk66-v3/src/led.c +++ /dev/null @@ -1,115 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2016, 2018 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * NXP fmuk66-v3 LED backend. - */ - -#include - -#include - -#include "kinetis.h" -#include "chip.h" -#include "board_config.h" - -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - - -static uint32_t g_ledmap[] = { - 0, // Indexed by LED_BLUE - GPIO_LED_1, // Indexed by LED_RED, LED_AMBER - GPIO_LED_SAFETY, // Indexed by LED_SAFETY - GPIO_LED_2, // Indexed by LED_GREEN -}; - -__EXPORT void led_init(void) -{ - /* Configure LED GPIOs for output */ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - if (g_ledmap[l] != 0) { - kinetis_pinconfig(g_ledmap[l]); - } - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive High to switch on */ - - if (g_ledmap[led] != 0) { - kinetis_gpiowrite(g_ledmap[led], state); - } -} - -static bool phy_get_led(int led) -{ - - if (g_ledmap[led] != 0) { - return kinetis_gpioread(g_ledmap[led]); - } - - return false; -} - -__EXPORT void led_on(int led) -{ - phy_set_led(led, true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(led, false); -} - -__EXPORT void led_toggle(int led) -{ - - phy_set_led(led, !phy_get_led(led)); -} diff --git a/boards/nxp/fmuk66-v3/src/sdhc.c b/boards/nxp/fmuk66-v3/src/sdhc.c deleted file mode 100644 index 2236104..0000000 --- a/boards/nxp/fmuk66-v3/src/sdhc.c +++ /dev/null @@ -1,270 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016-2018 Gregory Nutt. All rights reserved. - * Authors: Gregory Nutt - * David Sidrane - * - * 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 NuttX 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. - * - ****************************************************************************/ -/* A micro Secure Digital (SD) card slot is available on the board connected to - * the SD Host Controller (SDHC) signals of the MCU. This slot will accept micro - * format SD memory cards. The SD card detect pin (PTE6) is an open switch that - * shorts with VDD when card is inserted. - * - * ------------ ------------- -------- - * SD Card Slot Board Signal K66 Pin - * ------------ ------------- -------- - * DAT0 SDHC0_D0 PTE1 - * DAT1 SDHC0_D1 PTE0 - * DAT2 SDHC0_D2 PTE5 - * CD/DAT3 SDHC0_D3 PTE4 - * CMD SDHC0_CMD PTE3 - * CLK SDHC0_DCLK PTE2 - * SWITCH D_CARD_DETECT PTE6 - * ------------ ------------- -------- - * - * There is no Write Protect pin available to the K66. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include -#include -#include - -#include -#include - -#include "kinetis.h" - -#include "board_config.h" - -#ifdef CONFIG_KINETIS_SDHC - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ -/* This structure holds static information unique to one SDHC peripheral */ - -struct fmuk66_sdhc_state_s { - struct sdio_dev_s *sdhc; /* R/W device handle */ - bool inserted; /* TRUE: card is inserted */ -}; - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/* HSCMI device state */ - -static struct fmuk66_sdhc_state_s g_sdhc; - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -#if defined(GPIO_SD_CARDDETECT) -/**************************************************************************** - * Name: fmuk66_mediachange - ****************************************************************************/ - -static void fmuk66_mediachange(struct fmuk66_sdhc_state_s *sdhc) -{ - bool inserted; - - /* Get the current value of the card detect pin. This pin is pulled up on - * board. So low means that a card is present. - */ - - inserted = !kinetis_gpioread(GPIO_SD_CARDDETECT); - mcinfo("inserted: %s\n", inserted ? "Yes" : "No"); - - /* Has the pin changed state? */ - - if (inserted != sdhc->inserted) { - mcinfo("Media change: %d->%d\n", sdhc->inserted, inserted); - - /* Yes.. perform the appropriate action (this might need some debounce). */ - - sdhc->inserted = inserted; - sdhc_mediachange(sdhc->sdhc, inserted); - -#ifdef CONFIG_FMUK66_SDHC_AUTOMOUNT - /* Let the automounter know about the insertion event */ - - fmuk66_automount_event(fmuk66_cardinserted()); -#endif - } -} - -/**************************************************************************** - * Name: fmuk66_cdinterrupt - ****************************************************************************/ - -static int fmuk66_cdinterrupt(int irq, FAR void *context, FAR void *args) -{ - /* All of the work is done by fmuk66_mediachange() */ - - fmuk66_mediachange((struct fmuk66_sdhc_state_s *) args); - return OK; -} -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: fmuk66_sdhc_initialize - * - * Description: - * Inititialize the SDHC SD card slot - * - ****************************************************************************/ - -int fmuk66_sdhc_initialize(void) -{ - int ret; - struct fmuk66_sdhc_state_s *sdhc = &g_sdhc; - /* Configure GPIO pins */ - - VDD_3V3_SD_CARD_EN(true); - -#if defined(GPIO_SD_CARDDETECT) - kinetis_pinconfig(GPIO_SD_CARDDETECT); - - /* Attached the card detect interrupt (but don't enable it yet) */ - - kinetis_pinirqattach(GPIO_SD_CARDDETECT, fmuk66_cdinterrupt, sdhc); -#endif - /* Configure the write protect GPIO -- None */ - - /* Mount the SDHC-based MMC/SD block driver */ - /* First, get an instance of the SDHC interface */ - - mcinfo("Initializing SDHC slot %d\n", CONFIG_NSH_MMCSDSLOTNO); - - sdhc->sdhc = sdhc_initialize(CONFIG_NSH_MMCSDSLOTNO); - - if (!sdhc->sdhc) { - mcerr("ERROR: Failed to initialize SDHC slot %d\n", CONFIG_NSH_MMCSDSLOTNO); - return -ENODEV; - } - -// Testing done on SanDISK HC all failed sd_bench with Drive/Slew other than default and _PIN_OUTPUT_FAST|_PIN_OUTPUT_HIGHDRIVE -// _PIN_OUTPUT_FAST|_PIN_OUTPUT_HIGHDRIVE Square noisy, pass SanDISK HC -// _PIN_OUTPUT_FAST|_PIN_OUTPUT_LOWDRIVE Square noisy, pass SanDISK HC -// _PIN_OUTPUT_HIGHDRIVE|_PIN_OUTPUT_SLOW sinusoidal fail SanDISK HC pass SanDISK HC1 -// _PIN_OUTPUT_LOWDRIVE|_PIN_OUTPUT_SLOW sinusoidal fail SanDISK HC pass SanDISK HC1 -// _PIN_OUTPUT_SLOW sinusoidal fail SanDISK HC pass SanDISK HC1 - - // This up dating of the driver setting is for EMI issue with GPS and FCC - // With this setting the clock is sinusoidal N.B. sd_bench fails on SanDISK HC, but - // Passes SanDISK **HC1** - use HC1 or Kingston cards! - - kinetis_pinconfig(PIN_SDHC0_DCLK | _PIN_OUTPUT_HIGHDRIVE | _PIN_OUTPUT_SLOW); - - /* Now bind the SDHC interface to the MMC/SD driver */ - - mcinfo("Bind SDHC to the MMC/SD driver, minor=%d\n", CONFIG_NSH_MMCSDMINOR); - - ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdhc->sdhc); - - if (ret != OK) { - syslog(LOG_ERR, "ERROR: Failed to bind SDHC to the MMC/SD driver: %d\n", ret); - return ret; - } - - syslog(LOG_ERR, "Successfully bound SDHC to the MMC/SD driver\n"); - -#if defined(GPIO_SD_CARDDETECT) - /* Handle the initial card state */ - - fmuk66_mediachange(sdhc); - - /* Enable CD interrupts to handle subsequent media changes */ - - kinetis_pinirqenable(GPIO_SD_CARDDETECT); -#else - sdhc_mediachange(sdhc->sdhc, true); -#endif - return OK; -} - -/**************************************************************************** - * Name: fmuk66_cardinserted - * - * Description: - * Check if a card is inserted into the SDHC slot - * - ****************************************************************************/ - -#ifdef HAVE_AUTOMOUNTER -bool fmuk66_cardinserted(void) -{ - bool inserted; - - /* Get the current value of the card detect pin. This pin is pulled up on - * board. So low means that a card is present. - */ - - inserted = !kinetis_gpioread(GPIO_SD_CARDDETECT); - mcinfo("inserted: %s\n", inserted ? "Yes" : "No"); - return inserted; -} -#endif - -/**************************************************************************** - * Name: fmuk66_writeprotected - * - * Description: - * Check if a card is inserted into the SDHC slot - * - ****************************************************************************/ - -#ifdef HAVE_AUTOMOUNTER -bool fmuk66_writeprotected(void) -{ - /* There are no write protect pins */ - - return false; -} -#endif - -#endif /* HAVE_MMCSD */ diff --git a/boards/nxp/fmuk66-v3/src/spi.cpp b/boards/nxp/fmuk66-v3/src/spi.cpp deleted file mode 100644 index 5231e4c..0000000 --- a/boards/nxp/fmuk66-v3/src/spi.cpp +++ /dev/null @@ -1,349 +0,0 @@ -/************************************************************************************ - * - * Copyright (C) 2016, 2018 Gregory Nutt. All rights reserved. - * Authors: Gregory Nutt - * David Sidrane - * - * 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 NuttX 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 -#include -#include - -#include - -#include -#include -#include -//#include - -#include -#include - -#include "arm_internal.h" -#include "chip.h" -#include -#include "board_config.h" -#include - -#if defined(CONFIG_KINETIS_SPI0) || defined(CONFIG_KINETIS_SPI1) || defined(CONFIG_KINETIS_SPI2) - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI0, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortC, GPIO::Pin2}) - }), - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_ACC_DEVTYPE_FXOS8701C, SPI::CS{GPIO::PortB, GPIO::Pin10}), - initSPIDevice(DRV_GYR_DEVTYPE_FXAS2100C, SPI::CS{GPIO::PortB, GPIO::Pin9}), - initSPIDevice(DRV_DEVTYPE_UNUSED, SPI::CS{GPIO::PortA, GPIO::Pin19}), - }, {GPIO::PortB, GPIO::Pin8}), - initSPIBusExternal(SPI::Bus::SPI2, { - initSPIConfigExternal(SPI::CS{GPIO::PortB, GPIO::Pin20}), - initSPIConfigExternal(SPI::CS{GPIO::PortD, GPIO::Pin15}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); - - -#define PX4_MK_GPIO(pin_ftmx, io) ((((uint32_t)(pin_ftmx)) & ~(_PIN_MODE_MASK | _PIN_OPTIONS_MASK)) |(io)) - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -__EXPORT void board_spi_reset(int ms, int bus_mask) -{ - /* Goal not to back feed the chips on the bus via IO lines */ - - /* First float the A_MISO line tied to SA0 to ensure SPI Auto selection*/ - - kinetis_pinconfig(PX4_MK_GPIO(PIN_SPI1_SIN, GPIO_OPENDRAIN)); - kinetis_gpiowrite(PIN_SPI1_SIN, 1); - - /* Next Change CS to inputs with pull downs */ - for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) { - if (px4_spi_buses[bus].bus == PX4_BUS_NUMBER_TO_PX4(1)) { - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (px4_spi_buses[bus].devices[i].cs_gpio != 0) { - kinetis_pinconfig(PX4_MK_GPIO(px4_spi_buses[bus].devices[i].cs_gpio, GPIO_PULLDOWN)); - } - } - } - } - - /* Turn all the int inputs to inputs with pull down */ - - kinetis_pinconfig(PX4_MK_GPIO(GPIO_EXTI_GYRO_INT1, GPIO_PULLDOWN)); - kinetis_pinconfig(PX4_MK_GPIO(GPIO_EXTI_GYRO_INT2, GPIO_PULLDOWN)); - kinetis_pinconfig(PX4_MK_GPIO(GPIO_EXTI_ACCEL_MAG_INT1, GPIO_PULLDOWN)); - kinetis_pinconfig(PX4_MK_GPIO(GPIO_EXTI_ACCEL_MAG_INT2, GPIO_PULLDOWN)); - kinetis_pinconfig(PX4_MK_GPIO(GPIO_EXTI_BARO_INT1, GPIO_PULLDOWN)); - kinetis_pinconfig(PX4_MK_GPIO(GPIO_EXTI_BARO_INT2, GPIO_PULLDOWN)); - - /* Drive the Reset Pins LOW - * For the Gyro FXAS21002C this is RESET - * for the Accel FXOS8700CQ this is not RESET */ - - kinetis_gpiowrite(GPIO_GM_nRST, false); - kinetis_gpiowrite(GPIO_A_RST, false); - - /* Power Down The Sensors */ - - VDD_3V3_SENSORS_EN(false); - up_mdelay(ms); - - /* Power Up The Sensors */ - VDD_3V3_SENSORS_EN(true); - up_mdelay(2); - - /* Restore all the CS to outputs inactive */ - - for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) { - if (px4_spi_buses[bus].bus == PX4_BUS_NUMBER_TO_PX4(1)) { - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (px4_spi_buses[bus].devices[i].cs_gpio != 0) { - kinetis_pinconfig(px4_spi_buses[bus].devices[i].cs_gpio); - } - } - } - } - - /* Restore all the int inputs to inputs */ - - kinetis_pinconfig(GPIO_EXTI_GYRO_INT1); - kinetis_pinconfig(GPIO_EXTI_GYRO_INT2); - kinetis_pinconfig(GPIO_EXTI_ACCEL_MAG_INT1); - kinetis_pinconfig(GPIO_EXTI_ACCEL_MAG_INT2); - kinetis_pinconfig(GPIO_EXTI_BARO_INT1); - kinetis_pinconfig(GPIO_EXTI_BARO_INT2); - - /* Set Rests Active */ - - /* Accel Assert Reset to reset the FXOS8700CQ */ - /* The Gyro was reset above */ - - kinetis_gpiowrite(GPIO_A_RST, true); - up_mdelay(ms); - - /* Accel & Gyro release Reset */ - - kinetis_gpiowrite(GPIO_A_RST, false); - kinetis_gpiowrite(GPIO_GM_nRST, true); - - /* Allow the Accel time to see PIN_SPI1_SIN as a float */ - - up_mdelay(2); - - kinetis_pinconfig(PIN_SPI1_SIN); -} - -/************************************************************************************ - * Name: fmuk66_spidev_initialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the NXP FMUK66-V3 board. - * - ************************************************************************************/ - -void fmuk66_spidev_initialize(void) -{ - board_spi_reset(10, 0xffff); - - for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) { - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (px4_spi_buses[bus].devices[i].cs_gpio != 0) { - kinetis_pinconfig(px4_spi_buses[bus].devices[i].cs_gpio); - } - } - } -} - -/************************************************************************************ - * Name: kinetis_spi_bus_initialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the NXP FMUK66 v3 board. - * - ************************************************************************************/ -static const px4_spi_bus_t *_spi_bus0; -static const px4_spi_bus_t *_spi_bus1; -static const px4_spi_bus_t *_spi_bus2; - -__EXPORT int fmuk66_spi_bus_initialize(void) -{ - for (int i = 0; i < SPI_BUS_MAX_BUS_ITEMS; ++i) { - switch (px4_spi_buses[i].bus) { - case PX4_BUS_NUMBER_TO_PX4(0): _spi_bus0 = &px4_spi_buses[i]; break; - - case PX4_BUS_NUMBER_TO_PX4(1): _spi_bus1 = &px4_spi_buses[i]; break; - - case PX4_BUS_NUMBER_TO_PX4(2): _spi_bus2 = &px4_spi_buses[i]; break; - } - } - - /* Configure SPI-based devices */ - - struct spi_dev_s *spi_sensors = px4_spibus_initialize(PX4_BUS_NUMBER_TO_PX4(1)); - - if (!spi_sensors) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 1); - return -ENODEV; - } - - /* Default bus 1 to 1MHz and de-assert the known chip selects. - */ - - SPI_SETFREQUENCY(spi_sensors, 1 * 1000 * 1000); - SPI_SETBITS(spi_sensors, 8); - SPI_SETMODE(spi_sensors, SPIDEV_MODE0); - - /* Get the SPI port for the Memory */ - - struct spi_dev_s *spi_memory = px4_spibus_initialize(PX4_BUS_NUMBER_TO_PX4(0)); - - if (!spi_memory) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 0); - return -ENODEV; - } - - /* Default bus 0 to 12MHz and de-assert the known chip selects. - */ - - SPI_SETFREQUENCY(spi_memory, 12 * 1000 * 1000); - SPI_SETBITS(spi_memory, 8); - SPI_SETMODE(spi_memory, SPIDEV_MODE3); - - /* Configure EXTERNAL SPI-based devices */ - - struct spi_dev_s *spi_ext = px4_spibus_initialize(PX4_BUS_NUMBER_TO_PX4(2)); - - if (!spi_ext) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 2); - return -ENODEV; - } - - /* Default external bus to 1MHz and de-assert the known chip selects. - */ - - SPI_SETFREQUENCY(spi_ext, 8 * 1000 * 1000); - SPI_SETBITS(spi_ext, 8); - SPI_SETMODE(spi_ext, SPIDEV_MODE3); - - /* deselect all */ - for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) { - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (px4_spi_buses[bus].devices[i].cs_gpio != 0) { - SPI_SELECT(spi_ext, px4_spi_buses[bus].devices[i].devid, false); - } - } - } - - return OK; - -} - -/************************************************************************************ - * Name: kinetis_spi[n]select, kinetis_spi[n]status, and kinetis_spi[n]cmddata - * - * Description: - * These external functions must be provided by board-specific logic. They are - * implementations of the select, status, and cmddata methods of the SPI interface - * defined by struct spi_ops_s (see include/nuttx/spi/spi.h). All other methods - * including kinetis_spibus_initialize()) are provided by common Kinetis logic. - * To use this common SPI logic on your board: - * - * 1. Provide logic in kinetis_boardinitialize() to configure SPI chip select - * pins. - * 2. Provide kinetis_spi[n]select() and kinetis_spi[n]status() functions - * in your board-specific logic. These functions will perform chip selection - * and status operations using GPIOs in the way your board is configured. - * 2. If CONFIG_SPI_CMDDATA is defined in the NuttX configuration, provide - * kinetis_spi[n]cmddata() functions in your board-specific logic. These - * functions will perform cmd/data selection operations using GPIOs in the way - * your board is configured. - * 3. Add a call to kinetis_spibus_initialize() in your low level application - * initialization logic - * 4. The handle returned by kinetis_spibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling - * mmcsd_spislotinitialize(), for example, will bind the SPI driver to - * the SPI MMC/SD driver). - * - ************************************************************************************/ - -static inline void kinetis_spixselect(const px4_spi_bus_t *bus, struct spi_dev_s *dev, uint32_t devid, bool selected) -{ - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (bus->devices[i].cs_gpio == 0) { - break; - } - - if (devid == bus->devices[i].devid) { - // SPI select is active low, so write !selected to select the device - kinetis_gpiowrite(bus->devices[i].cs_gpio, !selected); - } - } -} - -void kinetis_spi0select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) -{ - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); - kinetis_spixselect(_spi_bus0, dev, devid, selected); -} - -uint8_t kinetis_spi0status(FAR struct spi_dev_s *dev, uint32_t devid) -{ - return SPI_STATUS_PRESENT; -} - -void kinetis_spi1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) -{ - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); - kinetis_spixselect(_spi_bus1, dev, devid, selected); -} - -uint8_t kinetis_spi1status(FAR struct spi_dev_s *dev, uint32_t devid) -{ - return SPI_STATUS_PRESENT; -} - -void kinetis_spi2select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) -{ - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); - kinetis_spixselect(_spi_bus2, dev, devid, selected); -} - -uint8_t kinetis_spi2status(FAR struct spi_dev_s *dev, uint32_t devid) -{ - return SPI_STATUS_PRESENT; -} - - -#endif /* CONFIG_KINETIS_SPI0 || CONFIG_KINETIS_SPI1 || CONFIG_KINETIS_SPI2 */ diff --git a/boards/nxp/fmuk66-v3/src/timer_config.cpp b/boards/nxp/fmuk66-v3/src/timer_config.cpp deleted file mode 100644 index c22044a..0000000 --- a/boards/nxp/fmuk66-v3/src/timer_config.cpp +++ /dev/null @@ -1,186 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016, 2018 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. - * - ****************************************************************************/ - -/* - * @file timer_config.c - * - * Configuration data for the kinetis pwm_servo, input capture and pwm input driver. - * - * Note that these arrays must always be fully-sized. - */ - -// TODO:Stubbed out for now -#include - -#include -#include "hardware/kinetis_sim.h" -#include "hardware/kinetis_ftm.h" - -#include -#include - -#include "board_config.h" - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::FTM0), - initIOTimer(Timer::FTM3), - initIOTimer(Timer::FTM2), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::FTM0, Timer::Channel0}, {GPIO::PortC, GPIO::Pin1}), - initIOTimerChannel(io_timers, {Timer::FTM0, Timer::Channel3}, {GPIO::PortA, GPIO::Pin6}), - initIOTimerChannel(io_timers, {Timer::FTM0, Timer::Channel4}, {GPIO::PortD, GPIO::Pin4}), - initIOTimerChannel(io_timers, {Timer::FTM0, Timer::Channel5}, {GPIO::PortD, GPIO::Pin5}), - initIOTimerChannel(io_timers, {Timer::FTM3, Timer::Channel6}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::FTM3, Timer::Channel7}, {GPIO::PortE, GPIO::Pin12}), -// initIOTimerChannel(io_timers, {Timer::FTM3, Timer::Channel0}, {GPIO::PortD, GPIO::Pin0}), -// initIOTimerChannel(io_timers, {Timer::FTM2, Timer::Channel0}, {GPIO::PortA, GPIO::Pin10}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); - -const struct io_timers_t led_pwm_timers[MAX_LED_TIMERS] = { - { - .base = KINETIS_FTM3_BASE, - .clock_register = KINETIS_SIM_SCGC3, - .clock_bit = SIM_SCGC3_FTM3, - .vectorno = 0, - }, -}; - -const struct timer_io_channels_t led_pwm_channels[MAX_TIMER_LED_CHANNELS] = { - { - .gpio_out = LED_TIM3_CH1OUT, // RGB_R - .gpio_in = 0, - .timer_index = 0, - .timer_channel = 2, - }, - { - .gpio_out = LED_TIM3_CH5OUT, // RGB_G - .gpio_in = 0, - .timer_index = 0, - .timer_channel = 6, - }, - { - .gpio_out = LED_TIM3_CH4OUT, // RGB_B - .gpio_in = 0, - .timer_index = 0, - .timer_channel = 5, - }, -}; - -#define _REG(_addr) (*(volatile uint32_t *)(_addr)) - -/* Timer register accessors */ - -#define REG(t, _reg) _REG(KINETIS_FTM##t##_BASE + (_reg)) - -#define rSC(t) REG(t,KINETIS_FTM_SC_OFFSET) -#define rCNT(t) REG(t,KINETIS_FTM_CNT_OFFSET) -#define rMOD(t) REG(t,KINETIS_FTM_MOD_OFFSET) -#define rC0SC(t) REG(t,KINETIS_FTM_C0SC_OFFSET) -#define rC0V(t) REG(t,KINETIS_FTM_C0V_OFFSET) -#define rC1SC(t) REG(t,KINETIS_FTM_C1SC_OFFSET) -#define rC1V(t) REG(t,KINETIS_FTM_C1V_OFFSET) -#define rC2SC(t) REG(t,KINETIS_FTM_C2SC_OFFSET) -#define rC2V(t) REG(t,KINETIS_FTM_C2V_OFFSET) -#define rC3SC(t) REG(t,KINETIS_FTM_C3SC_OFFSET) -#define rC3V(t) REG(t,KINETIS_FTM_C3V_OFFSET) -#define rC4SC(t) REG(t,KINETIS_FTM_C4SC_OFFSET) -#define rC4V(t) REG(t,KINETIS_FTM_C4V_OFFSET) -#define rC5SC(t) REG(t,KINETIS_FTM_C5SC_OFFSET) -#define rC5V(t) REG(t,KINETIS_FTM_C5V_OFFSET) -#define rC6SC(t) REG(t,KINETIS_FTM_C6SC_OFFSET) -#define rC6V(t) REG(t,KINETIS_FTM_C6V_OFFSET) -#define rC7SC(t) REG(t,KINETIS_FTM_C7SC_OFFSET) -#define rC7V(t) REG(t,KINETIS_FTM_C7V_OFFSET) - -#define rCNTIN(t) REG(t,KINETIS_FTM_CNTIN_OFFSET) -#define rSTATUS(t) REG(t,KINETIS_FTM_STATUS_OFFSET) -#define rMODE(t) REG(t,KINETIS_FTM_MODE_OFFSET) -#define rSYNC(t) REG(t,KINETIS_FTM_SYNC_OFFSET) -#define rOUTINIT(t) REG(t,KINETIS_FTM_OUTINIT_OFFSET) -#define rOUTMASK(t) REG(t,KINETIS_FTM_OUTMASK_OFFSET) -#define rCOMBINE(t) REG(t,KINETIS_FTM_COMBINE_OFFSET) -#define rDEADTIME(t) REG(t,KINETIS_FTM_DEADTIME_OFFSET) -#define rEXTTRIG(t) REG(t,KINETIS_FTM_EXTTRIG_OFFSET) -#define rPOL(t) REG(t,KINETIS_FTM_POL_OFFSET) -#define rFMS(t) REG(t,KINETIS_FTM_FMS_OFFSET) -#define rFILTER(t) REG(t,KINETIS_FTM_FILTER_OFFSET) -#define rFLTCTRL(t) REG(t,KINETIS_FTM_FLTCTRL_OFFSET) -#define rQDCTRL(t) REG(t,KINETIS_FTM_QDCTRL_OFFSET) -#define rCONF(t) REG(t,KINETIS_FTM_CONF_OFFSET) -#define rFLTPOL(t) REG(t,KINETIS_FTM_FLTPOL_OFFSET) -#define rSYNCONF(t) REG(t,KINETIS_FTM_SYNCONF_OFFSET) -#define rINVCTRL(t) REG(t,KINETIS_FTM_INVCTRL_OFFSET) -#define rSWOCTRL(t) REG(t,KINETIS_FTM_SWOCTRL_OFFSET) -#define rPWMLOAD(t) REG(t,KINETIS_FTM_PWMLOAD_OFFSET) - -#if !defined(BOARD_PWM_SRC_CLOCK_FREQ) -#define BOARD_PWM_SRC_CLOCK_FREQ 16000000 -#endif - - -void fmuk66_timer_initialize(void) -{ - - - /* Y1 is 16 Mhz used to driver the FTM_CLKIN0 (PCT12) */ - - - /* Enable PCT12 as FTM_CLKIN0 */ - - kinetis_pinconfig(PIN_FTM_CLKIN0_3); - - /* Select FTM_CLKIN0 as source for FTM0, FTM2, and FTM3 */ - - uint32_t regval = _REG(KINETIS_SIM_SOPT4); - regval &= ~(SIM_SOPT4_FTM0CLKSEL | SIM_SOPT4_FTM2CLKSEL | SIM_SOPT4_FTM3CLKSEL); - _REG(KINETIS_SIM_SOPT4) = regval; - - - /* Enabled System Clock Gating Control for FTM 0 and 2*/ - - regval = _REG(KINETIS_SIM_SCGC6); - regval |= SIM_SCGC6_FTM0 | SIM_SCGC6_FTM2; - _REG(KINETIS_SIM_SCGC6) = regval; - - /* Enabled System Clock Gating Control for FTM 2 and 3 */ - - regval = _REG(KINETIS_SIM_SCGC3); - regval |= SIM_SCGC3_FTM2 | SIM_SCGC3_FTM3; - _REG(KINETIS_SIM_SCGC3) = regval; - -} diff --git a/boards/nxp/fmuk66-v3/src/usb.c b/boards/nxp/fmuk66-v3/src/usb.c deleted file mode 100644 index 20dd7e7..0000000 --- a/boards/nxp/fmuk66-v3/src/usb.c +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016, 2018 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include "board_config.h" - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -/************************************************************************************ - * Name: kinetis_usbpullup - * - * Description: - * If USB is supported and the board supports a pullup via GPIO (for USB software - * connect and disconnect), then the board software must provide kinetis_usbpullup. - * See include/nuttx/usb/usbdev.h for additional description of this method. - * Alternatively, if no pull-up GPIO the following EXTERN can be redefined to be - * NULL. - * - ************************************************************************************/ - -__EXPORT -int kinetis_usbpullup(FAR struct usbdev_s *dev, bool enable) -{ - usbtrace(TRACE_DEVPULLUP, (uint16_t)enable); - - if (enable) { - putreg8(USB_CONTROL_DPPULLUPNONOTG, KINETIS_USB0_CONTROL); - - } else { - putreg8(0, KINETIS_USB0_CONTROL); - } - - return OK; -} - -/************************************************************************************ - * Name: kinetis_usbsuspend - * - * Description: - * Board logic must provide the kinetis_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT -void kinetis_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/nxp/fmuk66-v3/test.px4board b/boards/nxp/fmuk66-v3/test.px4board deleted file mode 100644 index 2bc8628..0000000 --- a/boards/nxp/fmuk66-v3/test.px4board +++ /dev/null @@ -1,8 +0,0 @@ -CONFIG_DRIVERS_ADC_ADS1115=n -CONFIG_DRIVERS_IRLOCK=n -CONFIG_DRIVERS_PCA9685_PWM_OUT=n -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=n -CONFIG_MODULES_GYRO_FFT=n -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=n -CONFIG_BOARD_TESTING=y -CONFIG_SYSTEMCMDS_MICROBENCH=y diff --git a/boards/nxp/fmurt1062-v1/default.px4board b/boards/nxp/fmurt1062-v1/default.px4board deleted file mode 100644 index 331b6d3..0000000 --- a/boards/nxp/fmurt1062-v1/default.px4board +++ /dev/null @@ -1,72 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_LINKER_PREFIX="ocram" -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS1" -CONFIG_BOARD_SERIAL_GPS2="/dev/ttyS4" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS2" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS3" -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_BAROMETER_MS5611=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_DRIVERS_DISTANCE_SENSOR_LIGHTWARE_LASER_I2C=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_BOSCH_BMI055=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20689=y -CONFIG_COMMON_LIGHT=y -CONFIG_DRIVERS_LIGHTS_RGBLED_PWM=y -CONFIG_DRIVERS_MAGNETOMETER_HMC5883=y -CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8310=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SAFETY_BUTTON=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UWB_UWB_SR150=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/nxp/fmurt1062-v1/firmware.prototype b/boards/nxp/fmurt1062-v1/firmware.prototype deleted file mode 100644 index 666444d..0000000 --- a/boards/nxp/fmurt1062-v1/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 31, - "magic": "PX4FWv1", - "description": "Firmware for the NXPFMURT1062v1 board", - "image": "", - "build_time": 0, - "summary": "NXPFMURT1062v1", - "version": "0.1", - "image_size": 0, - "image_maxsize": 7340032, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/nxp/fmurt1062-v1/init/rc.board_defaults b/boards/nxp/fmurt1062-v1/init/rc.board_defaults deleted file mode 100644 index 9e96817..0000000 --- a/boards/nxp/fmurt1062-v1/init/rc.board_defaults +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 10.1097 -param set-default BAT1_A_PER_V 15.391030303 - -rgbled_pwm start -safety_button start diff --git a/boards/nxp/fmurt1062-v1/init/rc.board_sensors b/boards/nxp/fmurt1062-v1/init/rc.board_sensors deleted file mode 100644 index 8d2b0d7..0000000 --- a/boards/nxp/fmurt1062-v1/init/rc.board_sensors +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# -# PX4 FMUv5 specific board sensors init -#------------------------------------------------------------------------------ -# -# UART mapping on NXP FMURT1062: -# -# LPUART7 /dev/ttyS0 CONSOLE -# LPUART2 /dev/ttyS1 GPS -# LPUART3 /dev/ttyS2 TELEM2 (GPIO flow control) -# LPUART4 /dev/ttyS3 TELEM1 (UART flow control) -# LPUART5 /dev/ttyS4 TELEM4 GPS2 -# LPUART6 /dev/ttyS5 TELEM3 (RC_INPUT) -# LPUART8 /dev/ttyS6 PX4IO -# -#------------------------------------------------------------------------------ - -board_adc start - -# Internal SPI bus ICM-20602 -icm20602 -R 2 -s start - -# Internal SPI bus ICM-20689 -icm20689 -R 2 -s start - -# Internal SPI bus BMI055 accel/gyro -bmi055 -A -R 2 -s start -bmi055 -G -R 2 -s start - -# internal compass -ist8310 -I -R 10 start - -# Baro on internal SPI -ms5611 -s start diff --git a/boards/nxp/fmurt1062-v1/nuttx-config/Kconfig b/boards/nxp/fmurt1062-v1/nuttx-config/Kconfig deleted file mode 100644 index 40f0d9d..0000000 --- a/boards/nxp/fmurt1062-v1/nuttx-config/Kconfig +++ /dev/null @@ -1,41 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see the file kconfig-language.txt in the NuttX tools repository. -# - -choice - prompt "Boot Flash" - default NXP_FMURT1062_V3_QSPI_FLASH - -config NXP_FMURT1062_V3_HYPER_FLASH - bool "HYPER Flash" - -config NXP_FMURT1062_V3_QSPI_FLASH - bool "QSPI Flash" - -endchoice # Boot Flash - -config BOARD_HAS_PROBES - bool "Board provides GPIO or other Hardware for signaling to timing analyze." - default y - ---help--- - This board provides GPIO FMU-CH1-8, as PROBE_1-8 to provide timing signals - from selected drivers. - -config BOARD_USE_PROBES - bool "Enable the use the board provided FMU-CH1-8 as PROBE_1-8" - default n - depends on BOARD_HAS_PROBES - - ---help--- - Select to use GPIO FMU-CH1-8, as PROBE_1-8 to provide timing signals - from selected drivers. - -config BOARD_FORCE_ALIGNMENT - bool "Forces all acesses to be Aligned" - default n - - ---help--- - Adds -mno-unaligned-access to build flags. to force alignment. - This can be needed if data is stored in a region of memory, that - is Strongly ordered and dcache is off. diff --git a/boards/nxp/fmurt1062-v1/nuttx-config/include/board.h b/boards/nxp/fmurt1062-v1/nuttx-config/include/board.h deleted file mode 100644 index 16ec568..0000000 --- a/boards/nxp/fmurt1062-v1/nuttx-config/include/board.h +++ /dev/null @@ -1,400 +0,0 @@ -/************************************************************************************ - * nuttx-configs/nxp_fmurt1062-v1/include/board.h - * - * Copyright (C) 2018 Gregory Nutt. All rights reserved. - * Authors: Gregory Nutt - * David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ - -#ifndef __NUTTX_CONFIG_NXP_FMURT1062_V1_INCLUDE_BOARD_H -#define __NUTTX_CONFIG_NXP_FMURT1062_V1_INCLUDE_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ - -/* Set VDD_SOC to 1.3V */ - -#define IMXRT_VDD_SOC (0x14) - -/* Set Arm PLL (PLL1) to fOut = (24Mhz * ARM_PLL_DIV_SELECT/2) / ARM_PODF_DIVISOR - * 576Mhz = (24Mhz * ARM_PLL_DIV_SELECT/2) / ARM_PODF_DIVISOR - * ARM_PLL_DIV_SELECT = 96 - * ARM_PODF_DIVISOR = 2 - * 576Mhz = (24Mhz * 96/2) / 2 - * - * AHB_CLOCK_ROOT = PLL1fOut / IMXRT_AHB_PODF_DIVIDER - * 1Hz to 600 Mhz = 576Mhz / IMXRT_ARM_CLOCK_DIVIDER - * IMXRT_ARM_CLOCK_DIVIDER = 1 - * 576Mhz = 576Mhz / 1 - * - * PRE_PERIPH_CLK_SEL = PRE_PERIPH_CLK_SEL_PLL1 - * PERIPH_CLK_SEL = 1 (0 select PERIPH_CLK2_PODF, 1 select PRE_PERIPH_CLK_SEL_PLL1) - * PERIPH_CLK = 576Mhz - * - * IPG_CLOCK_ROOT = AHB_CLOCK_ROOT / IMXRT_IPG_PODF_DIVIDER - * IMXRT_IPG_PODF_DIVIDER = 4 - * 144Mhz = 576Mhz / 4 - * - * PRECLK_CLOCK_ROOT = IPG_CLOCK_ROOT / IMXRT_PERCLK_PODF_DIVIDER - * IMXRT_PERCLK_PODF_DIVIDER = 1 - * 16Mhz = 144Mhz / 9 - * - * SEMC_CLK_ROOT = 576Mhz / IMXRT_SEMC_PODF_DIVIDER (labeled AIX_PODF in 18.2) - * IMXRT_SEMC_PODF_DIVIDER = 8 - * 72Mhz = 576Mhz / 8 - * - * Set Sys PLL (PLL2) to fOut = (24Mhz * (20+(2*(DIV_SELECT))) - * 528Mhz = (24Mhz * (20+(2*(1))) - * - * Set USB1 PLL (PLL3) to fOut = (24Mhz * 20) - * 480Mhz = (24Mhz * 20) - * - * Set LPSPI PLL3 PFD0 to fOut = (480Mhz / 12 * 18) - * 720Mhz = (480Mhz / 12 * 18) - * 90Mhz = (720Mhz / LSPI_PODF_DIVIDER) - * - * Set LPI2C PLL3 / 8 to fOut = (480Mhz / 8) - * 60Mhz = (480Mhz / 8) - * 12Mhz = (60Mhz / LSPI_PODF_DIVIDER) - * - * Set USDHC1 PLL2 PFD2 to fOut = (528Mhz / 24 * 18) - * 396Mhz = (528Mhz / 24 * 18) - * 198Mhz = (396Mhz / IMXRT_USDHC1_PODF_DIVIDER) - */ - -#define BOARD_XTAL_FREQUENCY 24000000 -#define IMXRT_PRE_PERIPH_CLK_SEL CCM_CBCMR_PRE_PERIPH_CLK_SEL_PLL1 -#define IMXRT_PERIPH_CLK_SEL CCM_CBCDR_PERIPH_CLK_SEL_PRE_PERIPH -#define IMXRT_ARM_PLL_DIV_SELECT 96 -#define IMXRT_ARM_PODF_DIVIDER 2 -#define IMXRT_AHB_PODF_DIVIDER 1 -#define IMXRT_IPG_PODF_DIVIDER 4 -#define IMXRT_PERCLK_CLK_SEL CCM_CSCMR1_PERCLK_CLK_SEL_IPG_CLK_ROOT -#define IMXRT_PERCLK_PODF_DIVIDER 9 -#define IMXRT_SEMC_PODF_DIVIDER 8 - -#define IMXRT_LPSPI_CLK_SELECT CCM_CBCMR_LPSPI_CLK_SEL_PLL3_PFD0 -#define IMXRT_LSPI_PODF_DIVIDER 8 - -#define IMXRT_LPI2C_CLK_SELECT CCM_CSCDR2_LPI2C_CLK_SEL_PLL3_60M -#define IMXRT_LSI2C_PODF_DIVIDER 5 - -#define IMXRT_USDHC1_CLK_SELECT CCM_CSCMR1_USDHC1_CLK_SEL_PLL2_PFD0 -#define IMXRT_USDHC1_PODF_DIVIDER 2 - -#define IMXRT_USB1_PLL_DIV_SELECT CCM_ANALOG_PLL_USB1_DIV_SELECT_20 - -#define IMXRT_SYS_PLL_SELECT CCM_ANALOG_PLL_SYS_DIV_SELECT_22 - -#define IMXRT_USB1_PLL_DIV_SELECT CCM_ANALOG_PLL_USB1_DIV_SELECT_20 - -#define BOARD_CPU_FREQUENCY \ - (BOARD_XTAL_FREQUENCY * (IMXRT_ARM_PLL_DIV_SELECT / 2)) / IMXRT_ARM_PODF_DIVIDER - -#define BOARD_GPT_FREQUENCY \ - (BOARD_CPU_FREQUENCY / IMXRT_IPG_PODF_DIVIDER) / IMXRT_PERCLK_PODF_DIVIDER - -/* Define this to enable tracing */ -#if CONFIG_USE_TRACE -# define IMXRT_TRACE_PODF_DIVIDER 1 -# define IMXRT_TRACE_CLK_SELECT CCM_CBCMR_TRACE_CLK_SEL_PLL2_PFD0 -#endif - -/* SDIO *****************************************************************************/ - -/* Pin drive characteristics */ - -#define USDHC1_DATAX_IOMUX (IOMUX_SLEW_FAST | IOMUX_DRIVE_130OHM | IOMUX_PULL_UP_47K | IOMUX_SCHMITT_TRIGGER) -#define USDHC1_CMD_IOMUX (IOMUX_SLEW_FAST | IOMUX_DRIVE_130OHM | IOMUX_PULL_UP_47K | IOMUX_SCHMITT_TRIGGER) -#define USDHC1_CLK_IOMUX (IOMUX_SLEW_FAST | IOMUX_DRIVE_130OHM | IOMUX_SPEED_MAX) -#define USDHC1_CD_IOMUX (IOMUX_PULL_UP_47K | IOMUX_SCHMITT_TRIGGER) - -#define PIN_USDHC1_D0 (GPIO_USDHC1_DATA0_1 | USDHC1_DATAX_IOMUX) /* GPIO_SD_B0_02 */ -#define PIN_USDHC1_D1 (GPIO_USDHC1_DATA1_1 | USDHC1_DATAX_IOMUX) /* GPIO_SD_B0_03 */ -#define PIN_USDHC1_D2 (GPIO_USDHC1_DATA2_1 | USDHC1_DATAX_IOMUX) /* GPIO_SD_B0_04 */ -#define PIN_USDHC1_D3 (GPIO_USDHC1_DATA3_1 | USDHC1_DATAX_IOMUX) /* GPIO_SD_B0_05 */ -#define PIN_USDHC1_DCLK (GPIO_USDHC1_CLK_1 | USDHC1_CLK_IOMUX) /* GPIO_SD_B0_01 */ -#define PIN_USDHC1_CMD (GPIO_USDHC1_CMD_1 | USDHC1_CMD_IOMUX) /* GPIO_SD_B0_00 */ -#define PIN_USDHC1_CD (GPIO_USDHC1_CD_2 | USDHC1_CD_IOMUX) /* GPIO_B1_12 */ - -/* Ideal 400Khz for initial inquiry. - * Given input clock 198 Mhz. - * 386.71875 KHz = 198 Mhz / (256 * 2) - */ - -#define BOARD_USDHC_IDMODE_PRESCALER USDHC_SYSCTL_SDCLKFS_DIV256 -#define BOARD_USDHC_IDMODE_DIVISOR USDHC_SYSCTL_DVS_DIV(2) - -/* Ideal 25 Mhz for other modes - * Given input clock 198 Mhz. - * 24.75 MHz = 198 Mhz / (8 * 1) - */ - -#define BOARD_USDHC_MMCMODE_PRESCALER USDHC_SYSCTL_SDCLKFS_DIV8 -#define BOARD_USDHC_MMCMODE_DIVISOR USDHC_SYSCTL_DVS_DIV(1) - -#define BOARD_USDHC_SD1MODE_PRESCALER USDHC_SYSCTL_SDCLKFS_DIV8 -#define BOARD_USDHC_SD1MODE_DIVISOR USDHC_SYSCTL_DVS_DIV(1) - -#define BOARD_USDHC_SD4MODE_PRESCALER USDHC_SYSCTL_SDCLKFS_DIV8 -#define BOARD_USDHC_SD4MODE_DIVISOR USDHC_SYSCTL_DVS_DIV(1) - -/* LED definitions ******************************************************************/ -/* The nxp fmutr1062 board has numerous LEDs but only three, LED_GREEN a Green LED, - * LED_BLUE a Blue LED and LED_RED a Red LED, that can be controlled by software. - * - * If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any way. - * The following definitions are used to access individual LEDs. - */ - -/* LED index values for use with board_userled() */ - -#define BOARD_LED1 0 -#define BOARD_LED2 1 -#define BOARD_LED3 2 -#define BOARD_NLEDS 3 - -#define BOARD_LED_RED BOARD_LED1 -#define BOARD_LED_GREEN BOARD_LED2 -#define BOARD_LED_BLUE BOARD_LED3 - -/* LED bits for use with board_userled_all() */ - -#define BOARD_LED1_BIT (1 << BOARD_LED1) -#define BOARD_LED2_BIT (1 << BOARD_LED2) -#define BOARD_LED3_BIT (1 << BOARD_LED3) - -/* If CONFIG_ARCH_LEDS is defined, the usage by the board port is defined in - * include/board.h and src/stm32_leds.c. The LEDs are used to encode OS-related - * events as follows: - * - * - * SYMBOL Meaning LED state - * Red Green Blue - * ---------------------- -------------------------- ------ ------ ----*/ - -#define LED_STARTED 0 /* NuttX has been started OFF OFF OFF */ -#define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF OFF ON */ -#define LED_IRQSENABLED 2 /* Interrupts enabled OFF ON OFF */ -#define LED_STACKCREATED 3 /* Idle stack created OFF ON ON */ -#define LED_INIRQ 4 /* In an interrupt N/C N/C GLOW */ -#define LED_SIGNAL 5 /* In a signal handler N/C GLOW N/C */ -#define LED_ASSERTION 6 /* An assertion failed GLOW N/C GLOW */ -#define LED_PANIC 7 /* The system has crashed Blink OFF N/C */ -#define LED_IDLE 8 /* MCU is is sleep mode ON OFF OFF */ - -/* Thus if the Green LED is statically on, NuttX has successfully booted and - * is, apparently, running normally. If the Red LED is flashing at - * approximately 2Hz, then a fatal error has been detected and the system - * has halted. - */ - -/* PIO Disambiguation ***************************************************************/ -/* LPUARTs - */ -#define LPUART_IOMUX (IOMUX_PULL_UP_22K | IOMUX_DRIVE_40OHM | IOMUX_SLEW_SLOW | IOMUX_SPEED_LOW | IOMUX_SCHMITT_TRIGGER) - -/* GPS 1 */ - -#define GPIO_LPUART2_RX (GPIO_LPUART2_RX_1 | LPUART_IOMUX) /* EVK J22-8 */ /* GPIO_AD_B1_03 */ -#define GPIO_LPUART2_TX (GPIO_LPUART2_TX_1 | LPUART_IOMUX) /* EVK J22-7 */ /* GPIO_AD_B1_02 */ - -/* N.B. Rev B schematic did not change the names of the nets. Just the silk screen renamed the ports - * Such that Telem 2 had the real HW HS signals. The imx driver to dated does not support GOIO controlled - * HS lines - */ - -/* Telem 1 */ - -#define HS_INPUT_IOMUX (IOMUX_CMOS_INPUT | IOMUX_SLEW_SLOW | IOMUX_DRIVE_HIZ | IOMUX_SPEED_MEDIUM | IOMUX_PULL_UP_47K) -#define HS_OUTPUT_IOMUX (IOMUX_CMOS_OUTPUT | IOMUX_SLEW_FAST | IOMUX_DRIVE_33OHM | IOMUX_SPEED_MEDIUM | IOMUX_PULL_KEEP) - -#define GPIO_LPUART3_RX (GPIO_LPUART3_RX_3 | LPUART_IOMUX) /* GPIO_B0_09 */ -#define GPIO_LPUART3_TX (GPIO_LPUART3_TX_3 | LPUART_IOMUX) /* GPIO_B0_08 */ -#define GPIO_LPUART3_CTS (GPIO_PORT3 | GPIO_PIN4 | GPIO_INPUT | HS_INPUT_IOMUX) /* GPIO_SD_B1_04 GPIO3_IO04 (GPIO only, no HW Flow control) */ -#define GPIO_LPUART3_RTS (GPIO_PORT4 | GPIO_PIN24 | GPIO_OUTPUT | GPIO_OUTPUT_ZERO | HS_OUTPUT_IOMUX) /* GPIO_EMC_24 GPIO4_IO24 (GPIO only, no HW Flow control) */ - -/* Telem 2 */ - -#define GPIO_LPUART4_RX (GPIO_LPUART4_RX_2 | LPUART_IOMUX) /* GPIO_EMC_20 */ -#define GPIO_LPUART4_TX (GPIO_LPUART4_TX_2 | LPUART_IOMUX) /* GPIO_EMC_19 */ -#define GPIO_LPUART4_CTS (GPIO_LPUART4_CTS_1 | LPUART_IOMUX) /* GPIO_EMC_17 */ -#define GPIO_LPUART4_RTS (GPIO_LPUART4_RTS_1 | LPUART_IOMUX) /* GPIO_EMC_18 */ - -/* GPS2 */ - -#define GPIO_LPUART5_RX (GPIO_LPUART5_RX_1 | LPUART_IOMUX) /* GPIO_B1_13 */ -#define GPIO_LPUART5_TX (GPIO_LPUART5_TX_2 | LPUART_IOMUX) /* GPIO_EMC_23 */ - -/* RC INPUT single wire mode on TX, RX is not used */ - -#define GPIO_LPUART6_RX (GPIO_LPUART6_RX_2 | LPUART_IOMUX) /* GPIO_EMC_26 */ -#define GPIO_LPUART6_TX (GPIO_LPUART6_TX_2 | LPUART_IOMUX) /* GPIO_EMC_25 */ - -#define GPIO_LPUART7_RX (GPIO_LPUART7_RX_1 | LPUART_IOMUX) /* GPIO_EMC_32 */ -#define GPIO_LPUART7_TX (GPIO_LPUART7_TX_1 | LPUART_IOMUX) /* GPIO_EMC_31 */ - -#define GPIO_LPUART8_RX (GPIO_LPUART8_RX_2 | LPUART_IOMUX) /* GPIO_EMC_39 */ -#define GPIO_LPUART8_TX (GPIO_LPUART8_TX_2 | LPUART_IOMUX) /* GPIO_EMC_38 */ - -/* CAN - * - * CAN1 is routed to transceiver. - * CAN2 is routed to transceiver. - * CAN3 is routed to transceiver. - */ -#define FLEXCAN_IOMUX (IOMUX_PULL_UP_100K | IOMUX_DRIVE_40OHM | IOMUX_SLEW_FAST | IOMUX_SPEED_MEDIUM) - -#define GPIO_FLEXCAN1_RX (GPIO_FLEXCAN1_RX_2 | FLEXCAN_IOMUX) /* GPIO_B0_03 */ -#define GPIO_FLEXCAN1_TX (GPIO_FLEXCAN1_TX_4 | FLEXCAN_IOMUX) /* GPIO_SD_B1_02 */ -#define GPIO_FLEXCAN2_RX (GPIO_FLEXCAN2_RX_1 | FLEXCAN_IOMUX) /* GPIO_AD_B0_03 */ -#define GPIO_FLEXCAN2_TX (GPIO_FLEXCAN2_TX_1 | FLEXCAN_IOMUX) /* GPIO_AD_B0_02 */ -#define GPIO_FLEXCAN3_RX (GPIO_FLEXCAN3_RX_1 | FLEXCAN_IOMUX) /* GPIO_AD_B0_11 */ -#define GPIO_FLEXCAN3_TX (GPIO_FLEXCAN3_TX_3 | FLEXCAN_IOMUX) /* GPIO_EMC_36 */ - -/* LPSPI */ -#define LPSPI_IOMUX (IOMUX_PULL_UP_100K | IOMUX_DRIVE_33OHM | IOMUX_SLEW_FAST | IOMUX_SPEED_MAX) - -#define GPIO_LPSPI1_SCK (GPIO_LPSPI1_SCK_1 | LPSPI_IOMUX) /* GPIO_EMC_27 */ -#define GPIO_LPSPI1_MISO (GPIO_LPSPI1_SDI_1 | LPSPI_IOMUX) /* GPIO_EMC_29 */ -#define GPIO_LPSPI1_MOSI (GPIO_LPSPI1_SDO_1 | LPSPI_IOMUX) /* GPIO_EMC_28 */ - -#define GPIO_LPSPI2_SCK (GPIO_LPSPI2_SCK_1 | LPSPI_IOMUX) /* GPIO_EMC_00 */ -#define GPIO_LPSPI2_MISO (GPIO_LPSPI2_SDI_1 | LPSPI_IOMUX) /* GPIO_EMC_03 */ -#define GPIO_LPSPI2_MOSI (GPIO_LPSPI2_SDO_1 | LPSPI_IOMUX) /* GPIO_EMC_02 */ - -#define GPIO_LPSPI3_SCK (GPIO_LPSPI3_SCK_1 | LPSPI_IOMUX) /* GPIO_AD_B1_15 */ -#define GPIO_LPSPI3_MISO (GPIO_LPSPI3_SDI_1 | LPSPI_IOMUX) /* GPIO_AD_B1_13 */ -#define GPIO_LPSPI3_MOSI (GPIO_LPSPI3_SDO_1 | LPSPI_IOMUX) /* GPIO_AD_B1_14 */ - -#define GPIO_LPSPI4_SCK (GPIO_LPSPI4_SCK_1 | LPSPI_IOMUX) /* GPIO_B1_07 */ -#define GPIO_LPSPI4_MISO (GPIO_LPSPI4_SDI_1 | LPSPI_IOMUX) /* GPIO_B1_05 */ -#define GPIO_LPSPI4_MOSI (GPIO_LPSPI4_SDO_2 | LPSPI_IOMUX) /* GPIO_B0_02 */ - -/* LPI2Cs */ - -#define LPI2C_IOMUX (IOMUX_SPEED_MEDIUM | IOMUX_DRIVE_33OHM | IOMUX_OPENDRAIN | GPIO_SION_ENABLE) -#define LPI2C_IO_IOMUX (IOMUX_SPEED_MAX | IOMUX_SLEW_FAST | IOMUX_DRIVE_33OHM | IOMUX_OPENDRAIN | IOMUX_PULL_NONE) - -#define GPIO_LPI2C1_SDA (GPIO_LPI2C1_SDA_2 | LPI2C_IOMUX) /* EVK J24-9 R276 */ /* GPIO_AD_B1_01 */ -#define GPIO_LPI2C1_SCL (GPIO_LPI2C1_SCL_2 | LPI2C_IOMUX) /* EVK J24-10 R277 */ /* GPIO_AD_B1_00 */ - -#define GPIO_LPI2C1_SDA_RESET (GPIO_PORT1 | GPIO_PIN17 | GPIO_OUTPUT | GPIO_OUTPUT_ONE | LPI2C_IO_IOMUX) /* GPIO_AD_B1_01 GPIO1_IO17 */ -#define GPIO_LPI2C1_SCL_RESET (GPIO_PORT1 | GPIO_PIN16 | GPIO_OUTPUT | GPIO_OUTPUT_ONE | LPI2C_IO_IOMUX) /* GPIO_AD_B1_00 GPIO1_IO16 */ - -#define GPIO_LPI2C2_SDA (GPIO_LPI2C2_SDA_1 | LPI2C_IOMUX) /* EVK J8-A25 */ /* GPIO_B0_05 */ -#define GPIO_LPI2C2_SCL (GPIO_LPI2C2_SCL_1 | LPI2C_IOMUX) /* EVK J8-A24 */ /* GPIO_B0_04 */ - -#define GPIO_LPI2C2_SDA_RESET (GPIO_PORT2 | GPIO_PIN5 | GPIO_OUTPUT | GPIO_OUTPUT_ONE | LPI2C_IO_IOMUX) /* GPIO_B0_05 GPIO2_IO5 */ -#define GPIO_LPI2C2_SCL_RESET (GPIO_PORT2 | GPIO_PIN4 | GPIO_OUTPUT | GPIO_OUTPUT_ONE | LPI2C_IO_IOMUX) /* GPIO_B0_04 GPIO2_IO4 */ - -#define GPIO_LPI2C3_SDA (GPIO_LPI2C3_SDA_2 | LPI2C_IOMUX) /* GPIO_EMC_21 */ -#define GPIO_LPI2C3_SCL (GPIO_LPI2C3_SCL_2 | LPI2C_IOMUX) /* GPIO_EMC_22 */ - -#define GPIO_LPI2C3_SDA_RESET (GPIO_PORT4 | GPIO_PIN21 | GPIO_OUTPUT | GPIO_OUTPUT_ONE | LPI2C_IO_IOMUX) /* GPIO_EMC_21 GPIO4_IO21 */ -#define GPIO_LPI2C3_SCL_RESET (GPIO_PORT4 | GPIO_PIN22 | GPIO_OUTPUT | GPIO_OUTPUT_ONE | LPI2C_IO_IOMUX) /* GPIO_EMC_22 GPIO4_IO22 */ - -/* Board provides GPIO or other Hardware for signaling to timing analyzer */ - -#if defined(CONFIG_BOARD_USE_PROBES) -#include -#include -// add -I build/nxp_fmurt1062-v1_default/NuttX/nuttx/arch/arm/src/chip \ to NuttX Makedefs.in -#define PROBE_IOMUX (IOMUX_SPEED_MAX | IOMUX_SLEW_FAST | IOMUX_DRIVE_33OHM | IOMUX_CMOS_OUTPUT | IOMUX_PULL_NONE) -# define PROBE_N(n) (1<<((n)-1)) -# define PROBE_1 /* GPIO_B0_06 */ (GPIO_PORT2 | GPIO_PIN6 | GPIO_OUTPUT | GPIO_OUTPUT_ONE | PROBE_IOMUX) -# define PROBE_2 /* GPIO_EMC_08 */ (GPIO_PORT4 | GPIO_PIN8 | GPIO_OUTPUT | GPIO_OUTPUT_ONE | PROBE_IOMUX) -# define PROBE_3 /* GPIO_EMC_10 */ (GPIO_PORT4 | GPIO_PIN10 | GPIO_OUTPUT | GPIO_OUTPUT_ONE | PROBE_IOMUX) -# define PROBE_4 /* GPIO_AD_B0_09 */ (GPIO_PORT1 | GPIO_PIN9 | GPIO_OUTPUT | GPIO_OUTPUT_ONE | PROBE_IOMUX) -# define PROBE_5 /* GPIO_EMC_33 */ (GPIO_PORT3 | GPIO_PIN19 | GPIO_OUTPUT | GPIO_OUTPUT_ONE | PROBE_IOMUX) -# define PROBE_6 /* GPIO_EMC_30 */ (GPIO_PORT4 | GPIO_PIN30 | GPIO_OUTPUT | GPIO_OUTPUT_ONE | PROBE_IOMUX) -# define PROBE_7 /* GPIO_EMC_04 */ (GPIO_PORT4 | GPIO_PIN4 | GPIO_OUTPUT | GPIO_OUTPUT_ONE | PROBE_IOMUX) -# define PROBE_8 /* GPIO_EMC_01 */ (GPIO_PORT4 | GPIO_PIN1 | GPIO_OUTPUT | GPIO_OUTPUT_ONE | PROBE_IOMUX) - -# define PROBE_INIT(mask) \ - do { \ - if ((mask)& PROBE_N(1)) { imxrt_config_gpio(PROBE_1); } \ - if ((mask)& PROBE_N(2)) { imxrt_config_gpio(PROBE_2); } \ - if ((mask)& PROBE_N(3)) { imxrt_config_gpio(PROBE_3); } \ - if ((mask)& PROBE_N(4)) { imxrt_config_gpio(PROBE_4); } \ - if ((mask)& PROBE_N(5)) { imxrt_config_gpio(PROBE_5); } \ - if ((mask)& PROBE_N(6)) { imxrt_config_gpio(PROBE_6); } \ - if ((mask)& PROBE_N(7)) { imxrt_config_gpio(PROBE_7); } \ - if ((mask)& PROBE_N(8)) { imxrt_config_gpio(PROBE_8); } \ - } while(0) - -# define PROBE(n,s) do {imxrt_gpio_write(PROBE_##n,(s));}while(0) -# define PROBE_MARK(n) PROBE(n,false);PROBE(n,true) -#else -# define PROBE_INIT(mask) -# define PROBE(n,s) -# define PROBE_MARK(n) -#endif - -/************************************************************************************ - * Public Types - ************************************************************************************/ - -/************************************************************************************ - * Public Data - ************************************************************************************/ - -#ifndef __ASSEMBLY__ - -#undef EXTERN -#if defined(__cplusplus) -#define EXTERN extern "C" -extern "C" -{ -#else -#define EXTERN extern -#endif - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -#undef EXTERN -#if defined(__cplusplus) -} -#endif - -#endif /* __ASSEMBLY__ */ -#endif /* __NUTTX_CONFIG_NXP_FMURT1062_V1_INCLUDE_BOARD_H */ diff --git a/boards/nxp/fmurt1062-v1/nuttx-config/nsh/defconfig b/boards/nxp/fmurt1062-v1/nuttx-config/nsh/defconfig deleted file mode 100644 index 106dc07..0000000 --- a/boards/nxp/fmurt1062-v1/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,226 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/nxp/fmurt1062-v1/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="imxrt" -CONFIG_ARCH_CHIP_IMXRT=y -CONFIG_ARCH_CHIP_MIMXRT1062DVL6A=y -CONFIG_ARCH_INTERRUPTSTACK=750 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_ITCM=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CUSTOM_LEDS=y -CONFIG_BOARD_FORCE_ALIGNMENT=y -CONFIG_BOARD_LOOPSPERMSEC=104926 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BOOT_RUNFROMISRAM=y -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_BULKIN_REQLEN=96 -CONFIG_CDCACM_PRODUCTID=0x001d -CONFIG_CDCACM_PRODUCTSTR="PX4 FMURT1062 v1.x" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x1FC9 -CONFIG_CDCACM_VENDORSTR="NXP SEMICONDUCTORS" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_DISABLE_MQUEUE=y -CONFIG_DISABLE_POSIX_TIMERS=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_IMXRT_BOOTLOADER_HEAP=y -CONFIG_IMXRT_DTCM_HEAP=y -CONFIG_IMXRT_GPIO1_0_15_IRQ=y -CONFIG_IMXRT_GPIO1_16_31_IRQ=y -CONFIG_IMXRT_GPIO2_0_15_IRQ=y -CONFIG_IMXRT_GPIO2_16_31_IRQ=y -CONFIG_IMXRT_GPIO3_0_15_IRQ=y -CONFIG_IMXRT_GPIO3_16_31_IRQ=y -CONFIG_IMXRT_GPIO4_0_15_IRQ=y -CONFIG_IMXRT_GPIO4_16_31_IRQ=y -CONFIG_IMXRT_GPIO5_0_15_IRQ=y -CONFIG_IMXRT_GPIO5_16_31_IRQ=y -CONFIG_IMXRT_GPIO6_0_15_IRQ=y -CONFIG_IMXRT_GPIO6_16_31_IRQ=y -CONFIG_IMXRT_GPIO7_0_15_IRQ=y -CONFIG_IMXRT_GPIO7_16_31_IRQ=y -CONFIG_IMXRT_GPIO8_0_15_IRQ=y -CONFIG_IMXRT_GPIO8_16_31_IRQ=y -CONFIG_IMXRT_GPIO9_0_15_IRQ=y -CONFIG_IMXRT_GPIO9_16_31_IRQ=y -CONFIG_IMXRT_GPIO_IRQ=y -CONFIG_IMXRT_ITCM=0 -CONFIG_IMXRT_LPI2C1=y -CONFIG_IMXRT_LPI2C2=y -CONFIG_IMXRT_LPI2C3=y -CONFIG_IMXRT_LPI2C_DYNTIMEO=y -CONFIG_IMXRT_LPI2C_DYNTIMEO_STARTSTOP=10 -CONFIG_IMXRT_LPSPI1=y -CONFIG_IMXRT_LPSPI2=y -CONFIG_IMXRT_LPSPI3=y -CONFIG_IMXRT_LPSPI4=y -CONFIG_IMXRT_LPUART2=y -CONFIG_IMXRT_LPUART3=y -CONFIG_IMXRT_LPUART4=y -CONFIG_IMXRT_LPUART5=y -CONFIG_IMXRT_LPUART6=y -CONFIG_IMXRT_LPUART7=y -CONFIG_IMXRT_LPUART8=y -CONFIG_IMXRT_LPUART_INVERT=y -CONFIG_IMXRT_LPUART_SINGLEWIRE=y -CONFIG_IMXRT_RTC_MAGIC_REG=1 -CONFIG_IMXRT_SNVS_LPSRTC=y -CONFIG_IMXRT_USBDEV=y -CONFIG_IMXRT_USDHC1=y -CONFIG_IMXRT_USDHC1_INVERT_CD=y -CONFIG_IMXRT_USDHC1_WIDTH_D1_D4=y -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_LPUART2_BAUD=57600 -CONFIG_LPUART2_RXBUFSIZE=600 -CONFIG_LPUART2_TXBUFSIZE=1500 -CONFIG_LPUART3_BAUD=57600 -CONFIG_LPUART3_IFLOWCONTROL=y -CONFIG_LPUART3_OFLOWCONTROL=y -CONFIG_LPUART3_RXBUFSIZE=600 -CONFIG_LPUART3_TXBUFSIZE=3000 -CONFIG_LPUART4_BAUD=57600 -CONFIG_LPUART4_IFLOWCONTROL=y -CONFIG_LPUART4_OFLOWCONTROL=y -CONFIG_LPUART4_RXBUFSIZE=600 -CONFIG_LPUART4_TXBUFSIZE=1500 -CONFIG_LPUART5_BAUD=57600 -CONFIG_LPUART5_RXBUFSIZE=600 -CONFIG_LPUART5_TXBUFSIZE=1500 -CONFIG_LPUART6_BAUD=57600 -CONFIG_LPUART6_RXBUFSIZE=600 -CONFIG_LPUART6_TXBUFSIZE=1500 -CONFIG_LPUART7_BAUD=57600 -CONFIG_LPUART7_RXBUFSIZE=120 -CONFIG_LPUART7_SERIAL_CONSOLE=y -CONFIG_LPUART7_TXBUFSIZE=1500 -CONFIG_LPUART8_BAUD=57600 -CONFIG_LPUART8_RXBUFSIZE=600 -CONFIG_LPUART8_TXBUFSIZE=1500 -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MM_REGIONS=3 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_DISABLE_BASENAME=y -CONFIG_NSH_DISABLE_CMP=y -CONFIG_NSH_DISABLE_DD=y -CONFIG_NSH_DISABLE_DIRNAME=y -CONFIG_NSH_DISABLE_HEXDUMP=y -CONFIG_NSH_DISABLE_LOSETUP=y -CONFIG_NSH_DISABLE_MKFIFO=y -CONFIG_NSH_DISABLE_MKRD=y -CONFIG_NSH_DISABLE_PRINTF=y -CONFIG_NSH_DISABLE_PUT=y -CONFIG_NSH_DISABLE_REBOOT=y -CONFIG_NSH_DISABLE_UNAME=y -CONFIG_NSH_DISABLE_WGET=y -CONFIG_NSH_DISABLE_XD=y -CONFIG_NSH_FILEIOSIZE=512 -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_READLINE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=1048576 -CONFIG_RAM_START=0x20200000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1800 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDIO_BLOCKSETUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_DMA=y -CONFIG_USBDEV_DUALSPEED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 -CONFIG_WATCHDOG=y diff --git a/boards/nxp/fmurt1062-v1/nuttx-config/scripts/ocram-script.ld b/boards/nxp/fmurt1062-v1/nuttx-config/scripts/ocram-script.ld deleted file mode 100644 index 274071f..0000000 --- a/boards/nxp/fmurt1062-v1/nuttx-config/scripts/ocram-script.ld +++ /dev/null @@ -1,299 +0,0 @@ -/**************************************************************************** - * boards/arm/imxrt/imxrt1060-evk/scripts/flash-ocram.ld - * - * Copyright (C) 2018, 2020 Gregory Nutt. All rights reserved. - * Authors: Ivan Ucherdzhiev - * David Sidrane - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The FMURT1062 has 8MiB of QSPI FLASH beginning at address, - * 0x0060:0000, Up to 512Kb of DTCM RAM beginning at 0x2000:0000, and 1MiB OCRAM - * beginning at 0x2020:0000. Neither DTCM or SDRAM are used in this - * configuration. - * - * The default flexram setting on the iMXRT 1062 is - * 256Kib to OCRRAM, 128Kib ITCM and 128Kib DTCM. - * This can be changed by using a dcd by minipulating - * IOMUX GPR16 and GPR17. - * The configuration we will use is 384Kib to OCRRAM, 0Kib ITCM and - * 128Kib DTCM. - * - * This is the OCRAM inker script. - * The NXP ROM bootloader will move the FLASH image to OCRAM. - * We must reserve 32K for the bootloader' OCRAM usage from the OCRAM Size - * and an additinal 8K for the ivt_s which is IVT_SIZE(8K) This 40K can be - * reused once the application is running. - * - * 0x2020:A000 to 0x202d:ffff - The application Image's vector table - * 0x2020:8000 to 0x2020:A000 - IVT - * 0x2020:0000 to 0x2020:7fff - NXP ROM bootloader. - * - * We artificially split the FLASH to allow locating sections that we do not - * want loaded inoto OCRAM. This is to save on OCRAM where the speen of the - * code does not matter. - * - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x60000000, LENGTH = 7M - flashxip (rx) : ORIGIN = 0x60700000, LENGTH = 1M - /* Vectors @ boot+ivt OCRAM2 Flex RAM Boot IVT */ - sram (rwx) : ORIGIN = 0x2020A000, LENGTH = 512K + 256K + 128K - (32K + 8K) - itcm (rwx) : ORIGIN = 0x00000000, LENGTH = 0K - dtcm (rwx) : ORIGIN = 0x20000000, LENGTH = 128K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -EXTERN(g_flash_config) -EXTERN(g_image_vector_table) -EXTERN(g_boot_data) -EXTERN(g_dcd_data) - -ENTRY(_stext) - -SECTIONS -{ - /* Image Vector Table and Boot Data for booting from external flash */ - - .boot_hdr : ALIGN(4) - { - FILL(0xff) - __boot_hdr_start__ = ABSOLUTE(.) ; - KEEP(*(.boot_hdr.conf)) - . = 0x1000 ; - KEEP(*(.boot_hdr.ivt)) - . = 0x1020 ; - KEEP(*(.boot_hdr.boot_data)) - . = 0x1030 ; - KEEP(*(.boot_hdr.dcd_data)) - __boot_hdr_end__ = ABSOLUTE(.) ; - . = 0x2000 ; - } > flash - - /* Catch all the section we want not in OCRAM so that the *(.text .text.*) in flash does not */ - /* Sift and sort with arm-none-eabi-nm -C -S -n build/nxp_fmurt1062-v1_default/nxp_fmurt1062-v1_default.elf > list.txt */ - - .flashxip : ALIGN(4) - { - FILL(0xff) - /* Order matters */ - *(.text.__start) - *(.text.imxrt_ocram_initialize) - *(.slow_memory) - *(.text.romfs*) - *(.text.cromfs*) - *(.text.mpu*) - *(.text.arm_memfault*) - *(.text.arm_hardfault*) - *(.text.up_assert*) - *(.text.up_stackdump*) - *(.text.up_taskdump*) - *(.text.up_mdelay*) - *(.text.up_udelay*) - *(.text.board_on_reset*) - *(.text.board_spi_reset*) - *(.text.board_query_manifest*) - *(.text.board_reset*) - *(.text.board_get*) - *(.text.board_mcu*) - *(.text.imxrt_xbar_connect*) - *(.text.bson*) - *(.text.*print_load*) - *(.text.*px4_mft*) - *(.text.*px4_mtd*) - *(.text.syslog*) - *(.text.register_driver*) - *(.text.nx_start*) - *(.text.nx_bringup*) - *(.text.irq_unexpected_isr*) - *(.text.group*) - *(.text.*setenv*) - *(.text.*env*) - *(.text.cmd*) - *(.text.readline*) - *(.text.mkfatfs*) - *(.text.builtin*) - *(.text.basename*) - *(.text.dirname*) - *(.text.gmtime_r*) - *(.text.chdir*) - *(.text.devnull*) - *(.text.ramdisk*) - *(.text.files*) - *(.text.unregister_driver*) - *(.text.register_blockdriver*) - *(.text.bchdev_register*) - *(.text.part*) - *(.text.ftl*) - *(.text.*I2CBusIterator*) - *(.text.*SPIBusIterator*) - *(.text.*BusCLIArguments*) - *(.text.*WorkQueueManager*) - *(.text.*param_export*) - *(.text.*param_import*) - *(.text.*param_load*) - *(.text.*BusInstanceIterator*) - *(.text.*PRINT_MODULE_USAGE*) - *(.text.*px4_getopt*) - *(.text.*main*) - *(.text.*instantiate*) - *(.text.*ADC*) - *(.text.*MS5611*) - *(.text.*I2CSPIDriver*) - *(.text.*CameraCapture*) - *(.text.*i2cdetect*) - *(.text.*usage*) -/* *(.text.*Bosch*) 2% CPU .5% RAM */ - *(.text.*Tunes*) - *(.text.*printStatistics*) - *(.text.*init*) - *(.text.*test*) - *(.text.*task_spawn*) - *(.text.*custom_command*) - *(.text.*print_usage*) - *(.text.*print_status*) - *(.text.*status*) - *(.text.*CameraInterface*) - *(.text.*CameraTrigger*) - *(.text.*ModuleBase*) - *(.text.*print_message*) - *(.text._ZN4Ekf2C2Eb) - *(.text._ZN9CommanderC2Ev) - *(.text.*PreFlightCheck*) - *(.text.*calibrat*) - *(.text.*initEv) - *(.text.*probe*) - *(.text.*thread_main*); - *(.text.*listener*) - *(.text.*BlockLocalPositionEstimator*) - *(.text.nsh_*) - *(.text.lib_vscanf) - *(.text.lib_vsprintf) - *(.text.*configure_streams_to_default*) - *(.text.*_main) - *(.text.*GPSDriverAshtech*) - *(.text.*GPSDriver*) - *(.text.*Mavlink*) - *(.rodata .rodata.*) - *(.fixup) - *(.gnu.warning) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - - } > flashxip - - /* Sections that will go to OCRAM */ - - .text : - { - _stext = ABSOLUTE(.); - *(.vectors) - *(.text .text.*) - _etext = ABSOLUTE(.); - - } > sram AT> flash - - /* - * Init functions (static constructors and the like) - */ - - .init_section : - { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - .ARM.extab : - { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - - .ARM.exidx : - { - *(.ARM.exidx*) - __exidx_end = ABSOLUTE(.); - } > flash - - _eronly = ABSOLUTE(.); - - .data : - { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - . = ALIGN(4); - _edata = ABSOLUTE(.); - } > sram AT > flash - - .ramfunc ALIGN(4): - { - _sramfuncs = ABSOLUTE(.); - *(.ramfunc .ramfunc.*) - _eramfuncs = ABSOLUTE(.); - } > sram AT > flash - - _framfuncs = LOADADDR(.ramfunc); - - .bss : - { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/nxp/fmurt1062-v1/nuttx-config/scripts/script.ld b/boards/nxp/fmurt1062-v1/nuttx-config/scripts/script.ld deleted file mode 100644 index eac08ed..0000000 --- a/boards/nxp/fmurt1062-v1/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,163 +0,0 @@ -/**************************************************************************** - * configs/nxp_fmurt1062-v1/scripts/flash.ld - * - * Copyright (C) 2018 Gregory Nutt. All rights reserved. - * Authors: Gregory Nutt - * David Sidrane - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The FMURT1062 has 8MiB of QSPI FLASH beginning at address, - * 0x0060:0000, Up to 512Kb of DTCM RAM beginning at 0x2000:0000, and 1MiB OCRAM - * beginning at 0x2020:0000. Neither DTCM or SDRAM are used in this - * configuratin. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x60000000, LENGTH = 8M - sram (rwx) : ORIGIN = 0x20200000, LENGTH = 768K - itcm (rwx) : ORIGIN = 0x00000000, LENGTH = 128K - dtcm (rwx) : ORIGIN = 0x20000000, LENGTH = 128K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -EXTERN(g_flash_config) -EXTERN(g_image_vector_table) -EXTERN(g_boot_data) - -ENTRY(_stext) - -SECTIONS -{ - /* Image Vector Table and Boot Data for booting from external flash */ - - .boot_hdr : ALIGN(4) - { - FILL(0xff) - __boot_hdr_start__ = ABSOLUTE(.) ; - KEEP(*(.boot_hdr.conf)) - . = 0x1000 ; - KEEP(*(.boot_hdr.ivt)) - . = 0x1020 ; - KEEP(*(.boot_hdr.boot_data)) - . = 0x1030 ; - KEEP(*(.boot_hdr.dcd_data)) - __boot_hdr_end__ = ABSOLUTE(.) ; - . = 0x2000 ; - } >flash - - .text : - { - _stext = ABSOLUTE(.); - *(.vectors) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - - .init_section : - { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - .ARM.extab : - { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - - .ARM.exidx : - { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : - { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .ramfunc ALIGN(4): - { - _sramfuncs = ABSOLUTE(.); - *(.ramfunc .ramfunc.*) - _eramfuncs = ABSOLUTE(.); - } > sram AT > flash - - _framfuncs = LOADADDR(.ramfunc); - - .bss : - { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/nxp/fmurt1062-v1/src/CMakeLists.txt b/boards/nxp/fmurt1062-v1/src/CMakeLists.txt deleted file mode 100644 index c9976a9..0000000 --- a/boards/nxp/fmurt1062-v1/src/CMakeLists.txt +++ /dev/null @@ -1,57 +0,0 @@ -############################################################################ -# -# Copyright (c) 2016, 2019 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. -# -############################################################################ - -px4_add_library(drivers_board - autoleds.c - automount.c - can.c - i2c.cpp - init.c - led.c - sdhc.c - spi.cpp - timer_config.cpp - usb.c - manifest.c - imxrt_flexspi_nor_boot.c - imxrt_flexspi_nor_flash.c -) - -target_link_libraries(drivers_board - PRIVATE - arch_board_hw_info - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer -) diff --git a/boards/nxp/fmurt1062-v1/src/autoleds.c b/boards/nxp/fmurt1062-v1/src/autoleds.c deleted file mode 100644 index 8106e9f..0000000 --- a/boards/nxp/fmurt1062-v1/src/autoleds.c +++ /dev/null @@ -1,191 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016-2018 Gregory Nutt. All rights reserved. - * Authors: Gregory Nutt - * David Sidrane - * - * - * 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 NuttX 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. - * - ****************************************************************************/ -/* - * This module shall be used during board bring up of Nuttx. - * - * The NXP FMUK66-V3 has a separate Red, Green and Blue LEDs driven by the K66 - * as follows: - * - * LED K66 - * ------ ------------------------------------------------------- - * RED FB_CS0_b/ UART2_CTS_b / ADC0_SE5b / SPI0_SCK / FTM3_CH1/ PTD1 - * GREEN FTM2_FLT0/ CMP0_IN3/ FB_AD6 / I2S0_RX_BCLK/ FTM3_CH5/ ADC1_SE5b/ PTC9 - * BLUE CMP0_IN2/ FB_AD7 / I2S0_MCLK/ FTM3_CH4/ ADC1_SE4b/ PTC8 - * - * If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board - * the NXP fmurt1062-v1. The following definitions describe how NuttX controls - * the LEDs: - * - * SYMBOL Meaning LED state - * RED GREEN BLUE - * ------------------- ----------------------- ----------------- - * LED_STARTED NuttX has been started OFF OFF OFF - * LED_HEAPALLOCATE Heap has been allocated OFF OFF ON - * LED_IRQSENABLED Interrupts enabled OFF OFF ON - * LED_STACKCREATED Idle stack created OFF ON OFF - * LED_INIRQ In an interrupt (no change) - * LED_SIGNAL In a signal handler (no change) - * LED_ASSERTION An assertion failed (no change) - * LED_PANIC The system has crashed FLASH OFF OFF - * LED_IDLE K66 is in sleep mode (Optional, not used) - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include - -#include -#include - -#include "chip.h" -#include "imxrt_gpio.h" -#include "board_config.h" -#ifdef CONFIG_ARCH_LEDS -__BEGIN_DECLS -extern void led_init(void); -__END_DECLS - -/**************************************************************************** - * Public Functions - ****************************************************************************/ -bool nuttx_owns_leds = true; -/**************************************************************************** - * Name: board_autoled_initialize - ****************************************************************************/ - -void board_autoled_initialize(void) -{ - led_init(); -} - -/**************************************************************************** - * Name: board_autoled_on - ****************************************************************************/ -void phy_set_led(int l, bool s) -{ - -} -void board_autoled_on(int led) -{ - if (!nuttx_owns_leds) { - return; - } - - switch (led) { - default: - break; - - case LED_HEAPALLOCATE: - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_IRQSENABLED: - phy_set_led(BOARD_LED_BLUE, false); - phy_set_led(BOARD_LED_GREEN, true); - break; - - case LED_STACKCREATED: - phy_set_led(BOARD_LED_GREEN, true); - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_INIRQ: - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_SIGNAL: - phy_set_led(BOARD_LED_GREEN, true); - break; - - case LED_ASSERTION: - phy_set_led(BOARD_LED_RED, true); - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_PANIC: - phy_set_led(BOARD_LED_RED, true); - break; - - case LED_IDLE : /* IDLE */ - phy_set_led(BOARD_LED_RED, true); - break; - } -} - -/**************************************************************************** - * Name: board_autoled_off - ****************************************************************************/ - -void board_autoled_off(int led) -{ - if (!nuttx_owns_leds) { - return; - } - - switch (led) { - default: - break; - - case LED_SIGNAL: - phy_set_led(BOARD_LED_GREEN, false); - break; - - case LED_INIRQ: - phy_set_led(BOARD_LED_BLUE, false); - break; - - case LED_ASSERTION: - phy_set_led(BOARD_LED_RED, false); - phy_set_led(BOARD_LED_BLUE, false); - break; - - case LED_PANIC: - phy_set_led(BOARD_LED_RED, false); - break; - - case LED_IDLE : /* IDLE */ - phy_set_led(BOARD_LED_RED, false); - break; - } -} - -#endif /* CONFIG_ARCH_LEDS */ diff --git a/boards/nxp/fmurt1062-v1/src/automount.c b/boards/nxp/fmurt1062-v1/src/automount.c deleted file mode 100644 index f69f7fc..0000000 --- a/boards/nxp/fmurt1062-v1/src/automount.c +++ /dev/null @@ -1,304 +0,0 @@ -/************************************************************************************ - * - * Copyright (C) 2016-2018 Gregory Nutt. All rights reserved. - * Authors: Gregory Nutt - * David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#if defined(CONFIG_FS_AUTOMOUNTER_DEBUG) && !defined(CONFIG_DEBUG_FS) -# define CONFIG_DEBUG_FS 1 -#endif - -#include -#include - -#include -#include -#include - -#include "board_config.h" -#ifdef HAVE_AUTOMOUNTER - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Types - ************************************************************************************/ -/* This structure represents the changeable state of the automounter */ - -struct fmuk66_automount_state_s { - volatile automount_handler_t handler; /* Upper half handler */ - FAR void *arg; /* Handler argument */ - bool enable; /* Fake interrupt enable */ - bool pending; /* Set if there an event while disabled */ -}; - -/* This structure represents the static configuration of an automounter */ - -struct fmuk66_automount_config_s { - /* This must be first thing in structure so that we can simply cast from struct - * automount_lower_s to struct fmuk66_automount_config_s - */ - - struct automount_lower_s lower; /* Publicly visible part */ - FAR struct fmuk66_automount_state_s *state; /* Changeable state */ -}; - -/************************************************************************************ - * Private Function Prototypes - ************************************************************************************/ - -static int fmuk66_attach(FAR const struct automount_lower_s *lower, automount_handler_t isr, FAR void *arg); -static void fmuk66_enable(FAR const struct automount_lower_s *lower, bool enable); -static bool fmuk66_inserted(FAR const struct automount_lower_s *lower); - -/************************************************************************************ - * Private Data - ************************************************************************************/ - -static struct fmuk66_automount_state_s g_sdhc_state; -static const struct fmuk66_automount_config_s g_sdhc_config = { - .lower = - { - .fstype = CONFIG_FMUK66_SDHC_AUTOMOUNT_FSTYPE, - .blockdev = CONFIG_FMUK66_SDHC_AUTOMOUNT_BLKDEV, - .mountpoint = CONFIG_FMUK66_SDHC_AUTOMOUNT_MOUNTPOINT, - .ddelay = MSEC2TICK(CONFIG_FMUK66_SDHC_AUTOMOUNT_DDELAY), - .udelay = MSEC2TICK(CONFIG_FMUK66_SDHC_AUTOMOUNT_UDELAY), - .attach = fmuk66_attach, - .enable = fmuk66_enable, - .inserted = fmuk66_inserted - }, - .state = &g_sdhc_state -}; - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Name: fmuk66_attach - * - * Description: - * Attach a new SDHC event handler - * - * Input Parameters: - * lower - An instance of the auto-mounter lower half state structure - * isr - The new event handler to be attach - * arg - Client data to be provided when the event handler is invoked. - * - * Returned Value: - * Always returns OK - * - ************************************************************************************/ - -static int fmuk66_attach(FAR const struct automount_lower_s *lower, automount_handler_t isr, FAR void *arg) -{ - FAR const struct fmuk66_automount_config_s *config; - FAR struct fmuk66_automount_state_s *state; - - /* Recover references to our structure */ - - config = (FAR struct fmuk66_automount_config_s *)lower; - DEBUGASSERT(config != NULL && config->state != NULL); - - state = config->state; - - /* Save the new handler info (clearing the handler first to eliminate race - * conditions). - */ - - state->handler = NULL; - state->pending = false; - state->arg = arg; - state->handler = isr; - return OK; -} - -/************************************************************************************ - * Name: fmuk66_enable - * - * Description: - * Enable card insertion/removal event detection - * - * Input Parameters: - * lower - An instance of the auto-mounter lower half state structure - * enable - True: enable event detection; False: disable - * - * Returned Value: - * None - * - ************************************************************************************/ - -static void fmuk66_enable(FAR const struct automount_lower_s *lower, bool enable) -{ - FAR const struct fmuk66_automount_config_s *config; - FAR struct fmuk66_automount_state_s *state; - irqstate_t flags; - - /* Recover references to our structure */ - - config = (FAR struct fmuk66_automount_config_s *)lower; - DEBUGASSERT(config != NULL && config->state != NULL); - - state = config->state; - - /* Save the fake enable setting */ - - flags = enter_critical_section(); - state->enable = enable; - - /* Did an interrupt occur while interrupts were disabled? */ - - if (enable && state->pending) { - /* Yes.. perform the fake interrupt if the interrutp is attached */ - - if (state->handler) { - bool inserted = fmuk66_cardinserted(); - (void)state->handler(&config->lower, state->arg, inserted); - } - - state->pending = false; - } - - leave_critical_section(flags); -} - -/************************************************************************************ - * Name: fmuk66_inserted - * - * Description: - * Check if a card is inserted into the slot. - * - * Input Parameters: - * lower - An instance of the auto-mounter lower half state structure - * - * Returned Value: - * True if the card is inserted; False otherwise - * - ************************************************************************************/ - -static bool fmuk66_inserted(FAR const struct automount_lower_s *lower) -{ - return fmuk66_cardinserted(); -} - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -/************************************************************************************ - * Name: fmuk66_automount_initialize - * - * Description: - * Configure auto-mounters for each enable and so configured SDHC - * - * Input Parameters: - * None - * - * Returned Value: - * None - * - ************************************************************************************/ - -void fmuk66_automount_initialize(void) -{ - FAR void *handle; - - finfo("Initializing automounter(s)\n"); - - /* Initialize the SDHC0 auto-mounter */ - - handle = automount_initialize(&g_sdhc_config.lower); - - if (!handle) { - ferr("ERROR: Failed to initialize auto-mounter for SDHC0\n"); - } -} - -/************************************************************************************ - * Name: fmuk66_automount_event - * - * Description: - * The SDHC card detection logic has detected an insertion or removal event. It - * has already scheduled the MMC/SD block driver operations. Now we need to - * schedule the auto-mount event which will occur with a substantial delay to make - * sure that everything has settle down. - * - * Input Parameters: - * slotno - Identifies the SDHC0 slot: SDHC0_SLOTNO or SDHC1_SLOTNO. There is a - * terminology problem here: Each SDHC supports two slots, slot A and slot B. - * Only slot A is used. So this is not a really a slot, but an HSCMI peripheral - * number. - * inserted - True if the card is inserted in the slot. False otherwise. - * - * Returned Value: - * None - * - * Assumptions: - * Interrupts are disabled. - * - ************************************************************************************/ - -void fmuk66_automount_event(bool inserted) -{ - FAR const struct fmuk66_automount_config_s *config = &g_sdhc_config; - FAR struct fmuk66_automount_state_s *state = &g_sdhc_state; - - /* Is the auto-mounter interrupt attached? */ - - if (state->handler) { - /* Yes.. Have we been asked to hold off interrupts? */ - - if (!state->enable) { - /* Yes.. just remember the there is a pending interrupt. We will - * deliver the interrupt when interrupts are "re-enabled." - */ - - state->pending = true; - - } else { - /* No.. forward the event to the handler */ - - (void)state->handler(&config->lower, state->arg, inserted); - } - } -} - -#endif /* HAVE_AUTOMOUNTER */ diff --git a/boards/nxp/fmurt1062-v1/src/board_config.h b/boards/nxp/fmurt1062-v1/src/board_config.h deleted file mode 100644 index 091b400..0000000 --- a/boards/nxp/fmurt1062-v1/src/board_config.h +++ /dev/null @@ -1,502 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2018-2019 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * NXP fmukrt1062-v1 internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -#include "imxrt_gpio.h" -#include "imxrt_iomuxc.h" -#include "hardware/imxrt_pinmux.h" - -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ - -/* PX4IO connection configuration */ - -#if 0 // There is no PX4IO Support on first out -// This requires serial DMA driver -#define BOARD_USES_PX4IO_VERSION 2 -#define PX4IO_SERIAL_DEVICE "/dev/ttyS6" -#define PX4IO_SERIAL_TX_GPIO GPIO_LPUART8_TX_2 -#define PX4IO_SERIAL_RX_GPIO GPIO_LPUART8_RX_2 -#define PX4IO_SERIAL_BASE IMXRT_LPUART8_BASE -#define PX4IO_SERIAL_VECTOR IMXRT_IRQ_LPUART8 -#define PX4IO_SERIAL_TX_DMAMAP -#define PX4IO_SERIAL_RX_DMAMAP -#define PX4IO_SERIAL_RCC_REG -#define PX4IO_SERIAL_RCC_EN -#define PX4IO_SERIAL_CLOCK -#define PX4IO_SERIAL_BITRATE 1500000 /* 1.5Mbps -> max rate for IO */ -#endif - -/* Configuration ************************************************************************************/ - -/* FMURT1062 GPIOs ***********************************************************************************/ -/* LEDs */ -/* An RGB LED is connected through GPIO as shown below: - */ -#define LED_IOMUX (IOMUX_OPENDRAIN | IOMUX_PULL_NONE | IOMUX_DRIVE_33OHM | IOMUX_SPEED_MEDIUM | IOMUX_SLEW_SLOW) -#define GPIO_nLED_RED /* GPIO_B0_00 QTIMER1_TIMER0 GPIO2_IO0 */ (GPIO_PORT2 | GPIO_PIN0 | GPIO_OUTPUT | GPIO_OUTPUT_ZERO | LED_IOMUX) -#define GPIO_nLED_GREEN /* GPIO_B0_01 QTIMER1_TIMER1 GPIO2_IO1 */ (GPIO_PORT2 | GPIO_PIN1 | GPIO_OUTPUT | GPIO_OUTPUT_ZERO | LED_IOMUX) -#define GPIO_nLED_BLUE /* GPIO_B1_08 QTIMER1_TIMER3 GPIO2_IO24 */ (GPIO_PORT2 | GPIO_PIN24 | GPIO_OUTPUT | GPIO_OUTPUT_ZERO | LED_IOMUX) - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_OVERLOAD_LED LED_RED -#define BOARD_ARMED_STATE_LED LED_BLUE - -/* - * Define the ability to shut off off the sensor signals - * by changing the signals to inputs - */ - -#define _PIN_OFF(def) (((def) & (GPIO_PORT_MASK | GPIO_PIN_MASK)) | (GPIO_INPUT | IOMUX_PULL_DOWN_100K | IOMUX_CMOS_INPUT)) - -/* Define the Chip Selects, Data Ready and Control signals per SPI bus */ - -#define CS_IOMUX (IOMUX_CMOS_OUTPUT | IOMUX_PULL_UP_100K | IOMUX_DRIVE_33OHM | IOMUX_SPEED_LOW | IOMUX_SLEW_FAST) -#define OUT_IOMUX (IOMUX_CMOS_OUTPUT | IOMUX_PULL_UP_100K | IOMUX_DRIVE_50OHM | IOMUX_SPEED_MEDIUM | IOMUX_SLEW_FAST) - - -/* SPI1 off */ - -#define _GPIO_LPSPI1_SCK /* GPIO_EMC_27 GPIO4_IO27 */ (GPIO_PORT4 | GPIO_PIN27 | CS_IOMUX) -#define _GPIO_LPSPI1_MISO /* GPIO_EMC_29 GPIO4_IO29 */ (GPIO_PORT4 | GPIO_PIN29 | CS_IOMUX) -#define _GPIO_LPSPI1_MOSI /* GPIO_EMC_28 GPIO4_IO28 */ (GPIO_PORT4 | GPIO_PIN28 | CS_IOMUX) - -#define GPIO_SPI1_SCK_OFF _PIN_OFF(_GPIO_LPSPI1_SCK) -#define GPIO_SPI1_MISO_OFF _PIN_OFF(_GPIO_LPSPI1_MISO) -#define GPIO_SPI1_MOSI_OFF _PIN_OFF(_GPIO_LPSPI1_MOSI) - -#define _GPIO_LPSPI3_SCK /* GPIO_AD_B1_15 GPIO1_IO27 */ (GPIO_PORT1 | GPIO_PIN31 | CS_IOMUX) -#define _GPIO_LPSPI3_MISO /* GPIO_AD_B1_13 GPIO1_IO27 */ (GPIO_PORT1 | GPIO_PIN29 | CS_IOMUX) -#define _GPIO_LPSPI3_MOSI /* GPIO_AD_B1_14 GPIO1_IO27 */ (GPIO_PORT1 | GPIO_PIN30 | CS_IOMUX) - -#define GPIO_SPI3_SCK_OFF _PIN_OFF(_GPIO_LPSPI3_SCK) -#define GPIO_SPI3_MISO_OFF _PIN_OFF(_GPIO_LPSPI3_MISO) -#define GPIO_SPI3_MOSI_OFF _PIN_OFF(_GPIO_LPSPI3_MOSI) - -/* Define the SPI4 Data Ready and Control signals */ - -#define GPIO_SPI4_DRDY7_EXTERNAL1 /* GPIO_EMC_35 GPIO3_IO21*/ (GPIO_PORT3 | GPIO_PIN21 | GPIO_INPUT | DRDY_IOMUX) -#define GPIO_nSPI4_RESET_EXTERNAL1 /* GPIO_B1_00 GPIO2_IO16 */ (GPIO_PORT2 | GPIO_PIN16 | GPIO_OUTPUT | GPIO_OUTPUT_ONE | OUT_IOMUX) -#define GPIO_SPI4_SYNC_EXTERNAL1 /* GPIO_EMC_05 GPIO4_IO5 */(GPIO_PORT4 | GPIO_PIN5 | GPIO_OUTPUT | GPIO_OUTPUT_ONE | OUT_IOMUX) - -#define GPIO_DRDY_OFF_SPI4_DRDY7_EXTERNAL1 _PIN_OFF(GPIO_SPI4_DRDY7_EXTERNAL1) -#define GPIO_nSPI4_RESET_EXTERNAL1_OFF _PIN_OFF(GPIO_nSPI4_RESET_EXTERNAL1) -#define GPIO_SPI4_SYNC_EXTERNAL1_OFF _PIN_OFF(GPIO_SPI4_SYNC_EXTERNAL1) - - -#define ADC_IOMUX (IOMUX_CMOS_INPUT | IOMUX_PULL_NONE | IOMUX_DRIVE_HIZ) - -#define ADC1_CH(n) (n) -#define ADC1_GPIO(n, p) (GPIO_PORT1 | GPIO_PIN##p | ADC_IOMUX) // - -/* Define GPIO pins used as ADC N.B. Channel numbers are for reference, */ - -#define PX4_ADC_GPIO \ - /* BATTERY1_VOLTAGE GPIO_AD_B1_11 GPIO1 Pin 27 */ ADC1_GPIO(0, 27), \ - /* BATTERY1_CURRENT GPIO_AD_B0_12 GPIO1 Pin 12 */ ADC1_GPIO(1, 12), \ - /* BATTERY2_VOLTAGE GPIO_AD_B0_13 GPIO1 Pin 13 */ ADC1_GPIO(2, 13), \ - /* BATTERY2_CURRENT GPIO_AD_B0_14 GPIO1 Pin 14 */ ADC1_GPIO(3, 14), \ - /* SPARE_2_CHANNEL GPIO_AD_B0_15 GPIO1 Pin 15 */ ADC1_GPIO(4, 15), \ - /* HW_VER_SENSE GPIO_AD_B1_04 GPIO1 Pin 20 */ ADC1_GPIO(9, 20), \ - /* SCALED_V5 GPIO_AD_B1_05 GPIO1 Pin 21 */ ADC1_GPIO(10, 21), \ - /* SCALED_VDD_3V3_SENSORS GPIO_AD_B1_06 GPIO1 Pin 22 */ ADC1_GPIO(11, 22), \ - /* HW_REV_SENSE GPIO_AD_B1_08 GPIO1 Pin 24 */ ADC1_GPIO(13, 24), \ - /* SPARE_1 GPIO_AD_B1_09 GPIO1 Pin 25 */ ADC1_GPIO(14, 25), \ - /* RSSI_IN GPIO_AD_B1_10 GPIO1 Pin 26 */ ADC1_GPIO(15, 26) - -/* Define Channel numbers must match above GPIO pin IN(n)*/ - -#define ADC_BATTERY1_VOLTAGE_CHANNEL /* GPIO_AD_B1_11 GPIO1 Pin 27 */ ADC1_CH(0) -#define ADC_BATTERY1_CURRENT_CHANNEL /* GPIO_AD_B0_12 GPIO1 Pin 12 */ ADC1_CH(1) -#define ADC_BATTERY2_VOLTAGE_CHANNEL /* GPIO_AD_B0_13 GPIO1 Pin 13 */ ADC1_CH(2) -#define ADC_BATTERY2_CURRENT_CHANNEL /* GPIO_AD_B0_14 GPIO1 Pin 14 */ ADC1_CH(3) -#define ADC1_SPARE_2_CHANNEL /* GPIO_AD_B0_15 GPIO1 Pin 15 */ ADC1_CH(4) -#define ADC_HW_VER_SENSE_CHANNEL /* GPIO_AD_B1_04 GPIO1 Pin 20 */ ADC1_CH(9) -#define ADC_SCALED_V5_CHANNEL /* GPIO_AD_B1_05 GPIO1 Pin 21 */ ADC1_CH(10) -#define ADC_SCALED_VDD_3V3_SENSORS_CHANNEL /* GPIO_AD_B1_06 GPIO1 Pin 22 */ ADC1_CH(11) -#define ADC_HW_REV_SENSE_CHANNEL /* GPIO_AD_B1_08 GPIO1 Pin 24 */ ADC1_CH(13) -#define ADC1_SPARE_1_CHANNEL /* GPIO_AD_B1_09 GPIO1 Pin 25 */ ADC1_CH(14) -#define ADC_RSSI_IN_CHANNEL /* GPIO_AD_B1_10 GPIO1 Pin 26 */ ADC1_CH(15) - -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY1_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY1_CURRENT_CHANNEL) | \ - (1 << ADC_BATTERY2_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY2_CURRENT_CHANNEL) | \ - (1 << ADC1_SPARE_2_CHANNEL) | \ - (1 << ADC_RSSI_IN_CHANNEL) | \ - (1 << ADC_SCALED_V5_CHANNEL) | \ - (1 << ADC_SCALED_VDD_3V3_SENSORS_CHANNEL) | \ - (1 << ADC_HW_VER_SENSE_CHANNEL) | \ - (1 << ADC_HW_REV_SENSE_CHANNEL) | \ - (1 << ADC1_SPARE_1_CHANNEL)) - -/* HW has to large of R termination on ADC todo:change when HW value is chosen */ - -#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f) - -/* HW Version and Revision drive signals Default to 1 to detect */ - -#define BOARD_HAS_HW_VERSIONING - -#define HW_IOMUX (IOMUX_CMOS_OUTPUT | IOMUX_PULL_NONE | IOMUX_DRIVE_33OHM | IOMUX_SPEED_MAX | IOMUX_SLEW_FAST) - -#define GPIO_HW_VER_REV_DRIVE /* GPIO_AD_B0_01 GPIO1_IO01 */ (GPIO_PORT1 | GPIO_PIN1 | GPIO_OUTPUT | GPIO_OUTPUT_ONE | HW_IOMUX) -#define GPIO_HW_REV_SENSE /* GPIO_AD_B1_08 GPIO1 Pin 24 */ ADC1_GPIO(13, 24) -#define GPIO_HW_VER_SENSE /* GPIO_AD_B1_04 GPIO1 Pin 20 */ ADC1_GPIO(9, 20) -#define HW_INFO_INIT_PREFIX "V5" -#define V500 HW_VER_REV(0x0,0x0) // FMUV5, Rev 0 -#define V540 HW_VER_REV(0x4,0x0) // mini no can 2,3, Rev 0 - -/* CAN Silence - * - * Silent mode control \ ESC Mux select - */ - -#define SILENT_IOMUX (IOMUX_CMOS_OUTPUT | IOMUX_PULL_NONE | IOMUX_DRIVE_33OHM | IOMUX_SPEED_MAX | IOMUX_SLEW_FAST) -#define GPIO_CAN1_SILENT_S0 /* GPIO_AD_B0_10 GPIO1_IO10 */ (GPIO_PORT1 | GPIO_PIN10 | GPIO_OUTPUT | GPIO_OUTPUT_ZERO | SILENT_IOMUX) -#define GPIO_CAN2_SILENT_S1 /* GPIO_EMC_06 GPIO4_IO06 */ (GPIO_PORT4 | GPIO_PIN6 | GPIO_OUTPUT | GPIO_OUTPUT_ZERO | SILENT_IOMUX) -#define GPIO_CAN3_SILENT_S2 /* GPIO_EMC_09 GPIO4_IO09 */ (GPIO_PORT4 | GPIO_PIN9 | GPIO_OUTPUT | GPIO_OUTPUT_ZERO | SILENT_IOMUX) - -/* HEATER - * PWM in future - */ -#define HEATER_IOMUX (IOMUX_CMOS_OUTPUT | IOMUX_PULL_NONE | IOMUX_DRIVE_50OHM | IOMUX_SPEED_MEDIUM | IOMUX_SLEW_FAST) -#define GPIO_HEATER_OUTPUT /* GPIO_B1_09 QTIMER2_TIMER3 GPIO2_IO25 */ (GPIO_QTIMER2_TIMER3_1 | HEATER_IOMUX) -#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true)) - -/* PWM Capture - * - * 2 PWM Capture inputs are supported - */ -#define DIRECT_PWM_CAPTURE_CHANNELS 2 -#define CAP_IOMUX (IOMUX_CMOS_OUTPUT | IOMUX_PULL_NONE | IOMUX_DRIVE_50OHM | IOMUX_SPEED_MEDIUM | IOMUX_SLEW_FAST) -#define PIN_FLEXPWM2_PWMB0 /* P2:7 PWM2 B0 FMU_CAP1 */ (CAP_IOMUX | GPIO_FLEXPWM2_PWMB00_2) -#define PIN_FLEXPWM2_PWMB3 /* P3:3 PWM2 A1 FMU_CAP2 */ (CAP_IOMUX | GPIO_FLEXPWM2_PWMB03_3) - -#define nARMED_INPUT_IOMUX (IOMUX_CMOS_INPUT | IOMUX_PULL_UP_22K | IOMUX_DRIVE_HIZ) -#define nARMED_OUTPUT_IOMUX (IOMUX_CMOS_OUTPUT | IOMUX_PULL_KEEP | IOMUX_DRIVE_33OHM | IOMUX_SPEED_MEDIUM | IOMUX_SLEW_FAST) - -#define GPIO_nARMED_INIT /* GPIO_SD_B1_01 GPIO3_IO1 */ (GPIO_PORT3 | GPIO_PIN1 | GPIO_INPUT | nARMED_INPUT_IOMUX) -#define GPIO_nARMED /* GPIO_SD_B1_01 GPIO3_IO1 */ (GPIO_PORT3 | GPIO_PIN1 | GPIO_OUTPUT | GPIO_OUTPUT_ZERO | nARMED_OUTPUT_IOMUX) - -#define BOARD_INDICATE_EXTERNAL_LOCKOUT_STATE(enabled) px4_arch_configgpio((enabled) ? GPIO_nARMED : GPIO_nARMED_INIT) -#define BOARD_GET_EXTERNAL_LOCKOUT_STATE() px4_arch_gpioread(GPIO_nARMED) - - -/* PWM - */ - -#define DIRECT_PWM_OUTPUT_CHANNELS 8 -#define BOARD_NUM_IO_TIMERS 8 - -// Input Capture not supported on MVP - -#define BOARD_HAS_NO_CAPTURE - -//#define BOARD_HAS_UI_LED_PWM 1 Not ported yet (Still Kinetis driver) -#define BOARD_HAS_LED_PWM 1 -#define BOARD_LED_PWM_DRIVE_ACTIVE_LOW 1 - -/* UI LEDs are driven by timer 4 the pins have no alternates - * - * nUI_LED_RED GPIO_B0_10 GPIO2_IO10 QTIMER4_TIMER1 - * nUI_LED_GREEN GPIO_B0_11 GPIO2_IO11 QTIMER4_TIMER2 - * nUI_LED_BLUE GPIO_B1_11 GPIO2_IO27 QTIMER4_TIMER3 - */ - - -/* Power supply control and monitoring GPIOs */ - -#define GENERAL_INPUT_IOMUX (IOMUX_CMOS_INPUT | IOMUX_PULL_UP_47K | IOMUX_DRIVE_HIZ) -#define GENERAL_OUTPUT_IOMUX (IOMUX_CMOS_OUTPUT | IOMUX_PULL_KEEP | IOMUX_DRIVE_33OHM | IOMUX_SPEED_MEDIUM | IOMUX_SLEW_FAST) - -#define GPIO_nPOWER_IN_A /* GPIO_B0_12 GPIO2_IO12 */ (GPIO_PORT2 | GPIO_PIN12 | GPIO_INPUT | GENERAL_INPUT_IOMUX) -#define GPIO_nPOWER_IN_B /* GPIO_B0_13 GPIO2_IO13 */ (GPIO_PORT2 | GPIO_PIN13 | GPIO_INPUT | GENERAL_INPUT_IOMUX) -#define GPIO_nPOWER_IN_C /* GPIO_B0_14 GPIO2_IO14 */ (GPIO_PORT2 | GPIO_PIN14 | GPIO_INPUT | GENERAL_INPUT_IOMUX) - -#define GPIO_nVDD_BRICK1_VALID GPIO_nPOWER_IN_A /* Brick 1 Is Chosen */ -#define GPIO_nVDD_BRICK2_VALID GPIO_nPOWER_IN_B /* Brick 2 Is Chosen */ -#define BOARD_NUMBER_BRICKS 2 -#define GPIO_nVDD_USB_VALID GPIO_nPOWER_IN_C /* USB Is Chosen */ - -#define OC_INPUT_IOMUX (IOMUX_CMOS_INPUT | IOMUX_PULL_NONE | IOMUX_DRIVE_HIZ) - -#define GPIO_nVDD_5V_PERIPH_EN /* GPIO_B1_03 GPIO2_IO19 */ (GPIO_PORT2 | GPIO_PIN19 | GPIO_OUTPUT | GPIO_OUTPUT_ONE | GENERAL_OUTPUT_IOMUX) -#define GPIO_nVDD_5V_PERIPH_OC /* GPIO_B1_04 GPIO2_IO20 */ (GPIO_PORT2 | GPIO_PIN20 | GPIO_INPUT | OC_INPUT_IOMUX) -#define GPIO_nVDD_5V_HIPOWER_EN /* GPIO_B1_01 GPIO2_IO17 */ (GPIO_PORT2 | GPIO_PIN17 | GPIO_OUTPUT | GPIO_OUTPUT_ONE | GENERAL_OUTPUT_IOMUX) -#define GPIO_nVDD_5V_HIPOWER_OC /* GPIO_B1_02 GPIO2_IO18 */ (GPIO_PORT2 | GPIO_PIN18 | GPIO_INPUT | OC_INPUT_IOMUX) -#define GPIO_VDD_3V3_SENSORS_EN /* GPIO_EMC_41 GPIO3_IO27 */ (GPIO_PORT3 | GPIO_PIN27 | GPIO_OUTPUT | GPIO_OUTPUT_ZERO | GENERAL_OUTPUT_IOMUX) -#define GPIO_VDD_3V3_SPEKTRUM_POWER_EN /* GPIO_AD_B0_00 GPIO1_IO00 */ (GPIO_PORT1 | GPIO_PIN0 | GPIO_OUTPUT | GPIO_OUTPUT_ZERO | GENERAL_OUTPUT_IOMUX) -#define GPIO_VDD_5V_RC_EN /* GPIO_AD_B0_08 GPIO1_IO08 */ (GPIO_PORT1 | GPIO_PIN8 | GPIO_OUTPUT | GPIO_OUTPUT_ZERO | GENERAL_OUTPUT_IOMUX) -#define GPIO_VDD_5V_WIFI_EN /* PMIC_STBY_REQ GPIO5_IO02 */ (GPIO_PORT5 | GPIO_PIN2 | GPIO_OUTPUT | GPIO_OUTPUT_ZERO | GENERAL_OUTPUT_IOMUX) -#define GPIO_VDD_3V3_SD_CARD_EN /* GPIO_EMC_13 GPIO4_IO13 */ (GPIO_PORT4 | GPIO_PIN13 | GPIO_OUTPUT | GPIO_OUTPUT_ZERO |GENERAL_OUTPUT_IOMUX) - -/* Define True logic Power Control in arch agnostic form */ - -#define VDD_5V_PERIPH_EN(on_true) px4_arch_gpiowrite(GPIO_nVDD_5V_PERIPH_EN, !(on_true)) -#define VDD_5V_HIPOWER_EN(on_true) px4_arch_gpiowrite(GPIO_nVDD_5V_HIPOWER_EN, !(on_true)) -#define VDD_3V3_SENSORS_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, (on_true)) -#define VDD_3V3_SPEKTRUM_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SPEKTRUM_POWER_EN, (on_true)) -#define READ_VDD_3V3_SPEKTRUM_POWER_EN() px4_arch_gpioread(GPIO_VDD_3V3_SPEKTRUM_POWER_EN) -#define VDD_5V_RC_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_RC_EN, (on_true)) -#define VDD_5V_WIFI_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_WIFI_EN, (on_true)) -#define VDD_3V3_SD_CARD_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SD_CARD_EN, (on_true)) - -/* Tone alarm output */ - -#define TONE_ALARM_TIMER 2 /* GPT 2 */ -#define TONE_ALARM_CHANNEL 3 /* GPIO_AD_B1_07 GPT2_COMPARE3 */ - -#define GPIO_BUZZER_1 /* GPIO_AD_B1_07 GPIO1_IO23 */ (GPIO_PORT1 | GPIO_PIN23 | GPIO_OUTPUT | GPIO_OUTPUT_ZERO | GENERAL_OUTPUT_IOMUX) - -#define GPIO_TONE_ALARM_IDLE GPIO_BUZZER_1 -#define GPIO_TONE_ALARM (GPIO_GPT2_COMPARE3_2 | GENERAL_OUTPUT_IOMUX) - -/* USB OTG FS - * - * VBUS_VALID is detected in USB_ANALOG_USB1_VBUS_DETECT_STAT - */ - -/* High-resolution timer */ -#define HRT_TIMER 1 /* use GPT1 for the HRT */ -#define HRT_TIMER_CHANNEL 1 /* use capture/compare channel 1 */ - -#define HRT_PPM_CHANNEL /* GPIO_B1_06 GPT1_CAPTURE2 */ 2 /* use capture/compare channel 2 */ -#define GPIO_PPM_IN /* GPIO_B1_06 GPT1_CAPTURE2 */ (GPIO_GPT1_CAPTURE2_2 | GENERAL_INPUT_IOMUX) - -#define RC_SERIAL_PORT "/dev/ttyS5" -#define RC_SERIAL_SINGLEWIRE - -/* PWM input driver. Use FMU AUX5 pins attached to GPIO_EMC_33 GPIO3_IO19 FLEXPWM3_PWMA2 */ - -#define PWMIN_TIMER /* FLEXPWM3_PWMA2 */ 3 -#define PWMIN_TIMER_CHANNEL /* FLEXPWM3_PWMA2 */ 2 -#define GPIO_PWM_IN /* GPIO_EMC_33 GPIO3_IO19 */ (GPIO_FLEXPWM3_PWMA02_1 | GENERAL_INPUT_IOMUX) - -/* Shared pins Both FMU and PX4IO control/monitor - * FMU Initializes these pins to passive input until it is known - * if we have and PX4IO on board - */ - -#define GPIO_RSSI_IN /* GPIO_AD_B1_10 GPIO1_IO26 */ (GPIO_PORT1 | GPIO_PIN26 | GPIO_INPUT | ADC_IOMUX) -#define GPIO_RSSI_IN_INIT /* GPIO_AD_B1_10 GPIO1_IO26 */ 0 /* Using 0 will Leave as ADC RSSI_IN */ - -/* Safety Switch is HW version dependent on having an PX4IO - * So we init to a benign state with the _INIT definition - * and provide the the non _INIT one for the driver to make a run time - * decision to use it. - */ -#define SAFETY_INIT_IOMUX (IOMUX_CMOS_INPUT | IOMUX_PULL_NONE | IOMUX_DRIVE_HIZ) -#define SAFETY_IOMUX (IOMUX_CMOS_OUTPUT | IOMUX_PULL_NONE | IOMUX_DRIVE_33OHM | IOMUX_SPEED_MEDIUM | IOMUX_SLEW_SLOW) -#define SAFETY_SW_IOMUX (IOMUX_CMOS_INPUT | IOMUX_PULL_UP_22K | IOMUX_DRIVE_HIZ) - -#define GPIO_nSAFETY_SWITCH_LED_OUT_INIT /* GPIO_B0_15 GPIO2_IO15 */ (GPIO_PORT2 | GPIO_PIN15 | GPIO_INPUT | SAFETY_INIT_IOMUX) -#define GPIO_nSAFETY_SWITCH_LED_OUT /* GPIO_B0_15 GPIO2_IO15 */ (GPIO_PORT2 | GPIO_PIN15 | GPIO_OUTPUT | GPIO_OUTPUT_ONE | SAFETY_IOMUX) - -/* Enable the FMU to control it if there is no px4io fixme:This should be BOARD_SAFETY_LED(__ontrue) */ -#define GPIO_LED_SAFETY GPIO_nSAFETY_SWITCH_LED_OUT -#define GPIO_SAFETY_SWITCH_IN /* GPIO_AD_B1_12 GPIO1_IO28 */ (GPIO_PORT1 | GPIO_PIN28 | GPIO_INPUT | SAFETY_SW_IOMUX) -/* Enable the FMU to use the switch it if there is no px4io fixme:This should be BOARD_SAFTY_BUTTON() */ -#define GPIO_BTN_SAFETY GPIO_SAFETY_SWITCH_IN /* Enable the FMU to control it if there is no px4io */ - -/* - * FMUv5 has a separate RC_IN - * - * GPIO PPM_IN on GPIO_EMC_23 GPIO4 Pin 23 GPT1_CAPTURE2 - * Inversion is possible in the UART and can drive GPIO PPM_IN as an output - */ - -#define GPIO_PPM_IN_AS_OUT /* GPIO_B1_06 GPIO2_IO23 GPT1_CAPTURE2 GPT1_CAPTURE2 */ (GPIO_PORT2 | GPIO_PIN23 | GPIO_OUTPUT | GPIO_OUTPUT_ONE | GENERAL_OUTPUT_IOMUX) - -#define SDIO_SLOTNO 0 /* Only one slot */ -#define SDIO_MINOR 0 - -/* SD card bringup does not work if performed on the IDLE thread because it - * will cause waiting. Use either: - * - * CONFIG_BOARDCTL=y, OR - * CONFIG_BOARD_INITIALIZE=y && CONFIG_BOARD_INITTHREAD=y - */ - -#if defined(CONFIG_BOARD_INITIALIZE) && !defined(CONFIG_BOARDCTL) && \ - !defined(CONFIG_BOARD_INITTHREAD) -# warning SDIO initialization cannot be perfomed on the IDLE thread -#endif - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ - -#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID)) -#define BOARD_ADC_USB_CONNECTED (board_read_VBUS_state() == 0) - -/* FMUv5 never powers odd the Servo rail */ - -#define BOARD_ADC_SERVO_VALID (1) - -#define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -#define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID)) - -#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_nVDD_5V_PERIPH_OC)) -#define BOARD_ADC_HIPOWER_5V_OC (!px4_arch_gpioread(GPIO_nVDD_5V_HIPOWER_OC)) - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ - -#define BOARD_HAS_ON_RESET 1 - -#define PX4_GPIO_INIT_LIST { \ - GPIO_nARMED_INIT, \ - PX4_ADC_GPIO, \ - GPIO_HW_VER_REV_DRIVE, \ - GPIO_FLEXCAN1_TX, \ - GPIO_FLEXCAN1_RX, \ - GPIO_FLEXCAN2_TX, \ - GPIO_FLEXCAN2_RX, \ - GPIO_FLEXCAN3_TX, \ - GPIO_FLEXCAN3_RX, \ - GPIO_CAN1_SILENT_S0, \ - GPIO_CAN2_SILENT_S1, \ - GPIO_CAN3_SILENT_S2, \ - GPIO_HEATER_OUTPUT, \ - GPIO_nPOWER_IN_A, \ - GPIO_nPOWER_IN_B, \ - GPIO_nPOWER_IN_C, \ - GPIO_nVDD_5V_PERIPH_EN, \ - GPIO_nVDD_5V_PERIPH_OC, \ - GPIO_nVDD_5V_HIPOWER_EN, \ - GPIO_nVDD_5V_HIPOWER_OC, \ - GPIO_VDD_3V3_SENSORS_EN, \ - GPIO_VDD_3V3_SD_CARD_EN, \ - GPIO_VDD_3V3_SPEKTRUM_POWER_EN, \ - GPIO_VDD_5V_RC_EN, \ - GPIO_VDD_5V_WIFI_EN, \ - GPIO_TONE_ALARM_IDLE, \ - GPIO_RSSI_IN_INIT, \ - GPIO_nSAFETY_SWITCH_LED_OUT_INIT, \ - GPIO_nSPI4_RESET_EXTERNAL1, \ - GPIO_SPI4_SYNC_EXTERNAL1, \ - GPIO_SAFETY_SWITCH_IN \ - } - -#define BOARD_ENABLE_CONSOLE_BUFFER -__BEGIN_DECLS - -/**************************************************************************************************** - * Public Types - ****************************************************************************************************/ - -/**************************************************************************************************** - * Public data - ****************************************************************************************************/ - -#ifndef __ASSEMBLY__ - -/**************************************************************************************************** - * Public Functions - ****************************************************************************************************/ - -/**************************************************************************** - * Name: fmurt1062_usdhc_initialize - * - * Description: - * Initialize SDIO-based MMC/SD card support - * - ****************************************************************************/ - -int fmurt1062_usdhc_initialize(void); - -/**************************************************************************************************** - * Name: imxrt_spidev_initialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the PX4FMU board. - * - ****************************************************************************************************/ - -extern void imxrt_spidev_initialize(void); - -/************************************************************************************ - * Name: imxrt_spi_bus_initialize - * - * Description: - * Called to configure SPI Buses. - * - ************************************************************************************/ - -extern int imxrt1062_spi_bus_initialize(void); - -/************************************************************************************ - * Name: imxrt_usb_initialize - * - * Description: - * Called to configure USB. - * - ************************************************************************************/ - -extern int imxrt_usb_initialize(void); - -extern void imxrt_usbinitialize(void); - -extern void board_peripheral_reset(int ms); - -extern void fmurt1062_timer_initialize(void); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/nxp/fmurt1062-v1/src/can.c b/boards/nxp/fmurt1062-v1/src/can.c deleted file mode 100644 index f5d9a22..0000000 --- a/boards/nxp/fmurt1062-v1/src/can.c +++ /dev/null @@ -1,129 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016, 2018 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. - * - ****************************************************************************/ - -/** - * @file can.c - * - * Board-specific CAN functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include - -#include -#include - -#include -#include "arm_internal.h" - -#include "board_config.h" - -#ifdef CONFIG_CAN - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(CONFIG_IMXRT_FLEXCAN1) && defined(CONFIG_IMXRT_FLEXCAN2) \ - && defined(CONFIG_IMXRT_FLEXCAN3) -# warning "CAN1 and CAN2 and CAN2 are enabled. Assuming only CAN1." -#endif - -#ifdef CONFIG_IMXRT_FLEXCAN1 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); - -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - - /* Call imxrt_caninitialize() to get an instance of the CAN interface */ - - can = imxrt_can_initialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} - -#endif diff --git a/boards/nxp/fmurt1062-v1/src/i2c.cpp b/boards/nxp/fmurt1062-v1/src/i2c.cpp deleted file mode 100644 index a79588d..0000000 --- a/boards/nxp/fmurt1062-v1/src/i2c.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), - initI2CBusExternal(2), - initI2CBusInternal(3), -}; diff --git a/boards/nxp/fmurt1062-v1/src/imxrt_flexspi_nor_boot.c b/boards/nxp/fmurt1062-v1/src/imxrt_flexspi_nor_boot.c deleted file mode 100644 index f69b385..0000000 --- a/boards/nxp/fmurt1062-v1/src/imxrt_flexspi_nor_boot.c +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** - * config/imxrt1060-evk/src/imxrt_flexspi_nor_boot.c - * - * Copyright (C) 2018 Gregory Nutt. All rights reserved. - * Author: Ivan Ucherdzhiev - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include "imxrt_flexspi_nor_boot.h" - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -__attribute__((section(".boot_hdr.ivt"))) -const struct ivt_s g_image_vector_table = { - IVT_HEADER, /* IVT Header */ - IMAGE_ENTRY_ADDRESS, /* Image Entry Function */ - IVT_RSVD, /* Reserved = 0 */ - (uint32_t)DCD_ADDRESS, /* Address where DCD information is stored */ - (uint32_t)BOOT_DATA_ADDRESS, /* Address where BOOT Data Structure is stored */ - (uint32_t)IMAG_VECTOR_TABLE, /* Pointer to IVT Self (absolute address */ - (uint32_t)CSF_ADDRESS, /* Address where CSF file is stored */ - IVT_RSVD /* Reserved = 0 */ -}; - -__attribute__((section(".boot_hdr.boot_data"))) -const struct boot_data_s g_boot_data = { - IMAGE_DEST, /* boot start location */ - (IMAGE_DEST_END - IMAGE_DEST), /* size */ - PLUGIN_FLAG, /* Plugin flag */ - 0xffffffff /* empty - extra data word */ -}; diff --git a/boards/nxp/fmurt1062-v1/src/imxrt_flexspi_nor_boot.h b/boards/nxp/fmurt1062-v1/src/imxrt_flexspi_nor_boot.h deleted file mode 100644 index db6df9b..0000000 --- a/boards/nxp/fmurt1062-v1/src/imxrt_flexspi_nor_boot.h +++ /dev/null @@ -1,175 +0,0 @@ -/**************************************************************************** - * boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_boot.h - * - * Copyright (C) 2018 Gregory Nutt. All rights reserved. - * Authors: Ivan Ucherdzhiev - * David Sidrane - * - * 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 NuttX 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. - * - ****************************************************************************/ - -#ifndef __BOARDS_ARM_IMXRT_IMXRT1060_EVK_SRC_IMXRT_FLEXSPI_NOR_BOOT_H -#define __BOARDS_ARM_IMXRT_IMXRT1060_EVK_SRC_IMXRT_FLEXSPI_NOR_BOOT_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* IVT Data */ - -#define IVT_MAJOR_VERSION 0x4 -#define IVT_MAJOR_VERSION_SHIFT 0x4 -#define IVT_MAJOR_VERSION_MASK 0xf -#define IVT_MINOR_VERSION 0x1 -#define IVT_MINOR_VERSION_SHIFT 0x0 -#define IVT_MINOR_VERSION_MASK 0xf - -#define IVT_VERSION(major, minor) \ - ((((major) & IVT_MAJOR_VERSION_MASK) << IVT_MAJOR_VERSION_SHIFT) | \ - (((minor) & IVT_MINOR_VERSION_MASK) << IVT_MINOR_VERSION_SHIFT)) - -#define IVT_TAG_HEADER (0xd1) /* Image Vector Table */ -#define IVT_SIZE 0x2000 -#define IVT_PAR IVT_VERSION(IVT_MAJOR_VERSION, IVT_MINOR_VERSION) - -#define IVT_HEADER (IVT_TAG_HEADER | (IVT_SIZE << 8) | (IVT_PAR << 24)) -#define IVT_RSVD (uint32_t)(0x00000000) - -/* DCD Data */ - -#define DCD_TAG_HEADER (0xd2) -#define DCD_TAG_HEADER_SHIFT (24) -#define DCD_VERSION (0x40) -#define DCD_ARRAY_SIZE 1 - -#define FLASH_BASE 0x60000000 -#define FLASH_END 0x7f7fffff - -/* This needs to take into account the memory configuration at boot bootloader */ - -#define ROM_BOOTLOADER_OCRAM_RES 0x8000 -#define OCRAM_BASE (0x20200000 + ROM_BOOTLOADER_OCRAM_RES) -#define OCRAM_END (OCRAM_BASE + (512 * 1024) + (256 * 1024) - ROM_BOOTLOADER_OCRAM_RES) - - -#define SCLK 1 -#if defined(CONFIG_BOOT_RUNFROMFLASH) -# define IMAGE_DEST FLASH_BASE -# define IMAGE_DEST_END FLASH_END -# define IMAGE_DEST_OFFSET 0 -#else -# define IMAGE_DEST OCRAM_BASE -# define IMAGE_DEST_END OCRAM_END -# define IMAGE_DEST_OFFSET IVT_SIZE -#endif - -#define LOCATE_IN_DEST(x) (((uint32_t)(x)) - FLASH_BASE + IMAGE_DEST) -#define LOCATE_IN_SRC(x) (((uint32_t)(x)) - IMAGE_DEST + FLASH_BASE) - -#define DCD_ADDRESS 0 -#define BOOT_DATA_ADDRESS LOCATE_IN_DEST(&g_boot_data) -#define CSF_ADDRESS 0 -#define PLUGIN_FLAG (uint32_t)0 - -/* Located in Destination Memory */ - -#define IMAGE_ENTRY_ADDRESS ((uint32_t)&_vectors) -#define IMAG_VECTOR_TABLE LOCATE_IN_DEST(&g_image_vector_table) - -/**************************************************************************** - * Public Types - ****************************************************************************/ - -/* IVT Data */ - -struct ivt_s { - /* Header with tag #HAB_TAG_IVT, length and HAB version fields - * (see data) - */ - - uint32_t hdr; - - /* Absolute address of the first instruction to execute from the - * image - */ - - uint32_t entry; - - /* Reserved in this version of HAB: should be NULL. */ - - uint32_t reserved1; - - /* Absolute address of the image DCD: may be NULL. */ - - uint32_t dcd; - - /* Absolute address of the Boot Data: may be NULL, but not interpreted - * any further by HAB - */ - - uint32_t boot_data; - - /* Absolute address of the IVT. */ - - uint32_t self; - - /* Absolute address of the image CSF. */ - - uint32_t csf; - - /* Reserved in this version of HAB: should be zero. */ - - uint32_t reserved2; -}; - -/* Boot Data */ - -struct boot_data_s { - uint32_t start; /* boot start location */ - uint32_t size; /* size */ - uint32_t plugin; /* plugin flag - 1 if downloaded application is plugin */ - uint32_t placeholder; /* placehoder to make even 0x10 size */ -}; - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -extern const struct boot_data_s g_boot_data; -extern const uint8_t g_dcd_data[]; -extern const uint32_t _vectors[]; - - -#endif /* __BOARDS_ARM_IMXRT_IMXRT1060_EVK_SRC_IMXRT_FLEXSPI_NOR_BOOT_H */ diff --git a/boards/nxp/fmurt1062-v1/src/imxrt_flexspi_nor_flash.c b/boards/nxp/fmurt1062-v1/src/imxrt_flexspi_nor_flash.c deleted file mode 100644 index b783145..0000000 --- a/boards/nxp/fmurt1062-v1/src/imxrt_flexspi_nor_flash.c +++ /dev/null @@ -1,198 +0,0 @@ -/**************************************************************************** - * config/imxrt1060-evk/src/imxrt_flexspi_nor_flash.c - * - * Copyright (C) 2018 Gregory Nutt. All rights reserved. - * Authors: Ivan Ucherdzhiev - * David Sidrane - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/******************************************************************************* - * Included Files - ******************************************************************************/ - - -#include "imxrt_flexspi_nor_flash.h" - -/******************************************************************************* - * Public Data - ******************************************************************************/ - -#if defined (CONFIG_NXP_FMURT1062_V3_HYPER_FLASH) -__attribute__((section(".boot_hdr.conf"))) -const struct flexspi_nor_config_s g_flash_config = { - .mem_config = - { - .tag = FLEXSPI_CFG_BLK_TAG, - .version = FLEXSPI_CFG_BLK_VERSION, - .read_sample_clksrc = FLASH_READ_SAMPLE_CLK_EXTERNALINPUT_FROM_DQSPAD, - .cs_hold_time = 3u, - .cs_setup_time = 3u, - .column_address_width = 3u, - - /* Enable DDR mode, Word addassable, Safe configuration, Differential clock */ - - .controller_misc_option = (1u << FLEXSPIMISC_OFFSET_DDR_MODE_EN) | - (1u << FLEXSPIMISC_OFFSET_WORD_ADDRESSABLE_EN) | - (1u << FLEXSPIMISC_OFFSET_SAFECONFIG_FREQ_EN) | - (1u << FLEXSPIMISC_OFFSET_DIFFCLKEN), - .sflash_pad_type = SERIAL_FLASH_8PADS, - .serial_clk_freq = FLEXSPI_SERIAL_CLKFREQ_133MHz, - .sflash_a1size = 64u * 1024u * 1024u, - .data_valid_time = {16u, 16u}, - .lookup_table = - { - /* Read LUTs */ - - FLEXSPI_LUT_SEQ(CMD_DDR, FLEXSPI_8PAD, 0xA0, RADDR_DDR, FLEXSPI_8PAD, 0x18), - FLEXSPI_LUT_SEQ(CADDR_DDR, FLEXSPI_8PAD, 0x10, DUMMY_DDR, FLEXSPI_8PAD, 0x06), - FLEXSPI_LUT_SEQ(READ_DDR, FLEXSPI_8PAD, 0x04, STOP, FLEXSPI_1PAD, 0x0), - }, - }, - .page_size = 512u, - .sector_size = 256u * 1024u, - .blocksize = 256u * 1024u, - .is_uniform_blocksize = 1, -}; - -#elif defined (CONFIG_NXP_FMURT1062_V3_QSPI_FLASH) -__attribute__((section(".boot_hdr.conf"))) -const struct flexspi_nor_config_s g_flash_config = { - .mem_config = - { - .tag = FLEXSPI_CFG_BLK_TAG, - .version = FLEXSPI_CFG_BLK_VERSION, - .read_sample_clksrc = FLASH_READ_SAMPLE_CLK_LOOPBACK_FROM_SCKPAD, - .cs_hold_time = 3u, - .cs_setup_time = 3u, - .column_address_width = 0u, - .device_type = FLEXSPI_DEVICE_TYPE_SERIAL_NOR, - .sflash_pad_type = SERIAL_FLASH_4PADS, - .serial_clk_freq = FLEXSPI_SERIAL_CLKFREQ_60MHz, - .sflash_a1size = 8u * 1024u * 1024u, - .data_valid_time = {16u, 16u}, - .lookup_table = - { - /* LUTs */ - /* 0 Fast read Quad IO DTR Mode Operation in SPI Mode (normal read)*/ - - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xED, RADDR_DDR, FLEXSPI_4PAD, 0x18), - FLEXSPI_LUT_SEQ(DUMMY_DDR, FLEXSPI_4PAD, 0x0C, READ_DDR, FLEXSPI_4PAD, 0x08), - FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), - FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), - - /* 1 Read Status */ - - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05, READ_SDR, FLEXSPI_1PAD, 0x1), - FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), - FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), - FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), - - /* 2 */ - - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - - /* 3 */ - - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06, STOP, FLEXSPI_1PAD, 0x0), - FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), - FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), - FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), - - /* 4 */ - - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - - /* 5 Erase Sector */ - - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD7, RADDR_SDR, FLEXSPI_1PAD, 0x18), - FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), - FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), - FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), - - /* 6 */ - - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - - /* 7 */ - - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - - /* 8 */ - - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - - /* 9 Page Program */ - - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02, RADDR_SDR, FLEXSPI_1PAD, 0x18), - FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x8, STOP, FLEXSPI_1PAD, 0x0), - FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), - FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), - - /* 10 */ - - 0x00000000, - 0x00000000, - 0x00000000, - 0x00000000, - - /* 11 Chip Erase */ - - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xC7, STOP, FLEXSPI_1PAD, 0x0), - FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), - FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), - FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), - - }, - }, - - .page_size = 256u, - .sector_size = 4u * 1024u, - .blocksize = 32u * 1024u, - .is_uniform_blocksize = false, -}; -#else -# error Boot Flash type not chosen! -#endif diff --git a/boards/nxp/fmurt1062-v1/src/imxrt_flexspi_nor_flash.h b/boards/nxp/fmurt1062-v1/src/imxrt_flexspi_nor_flash.h deleted file mode 100644 index b99c135..0000000 --- a/boards/nxp/fmurt1062-v1/src/imxrt_flexspi_nor_flash.h +++ /dev/null @@ -1,349 +0,0 @@ -/**************************************************************************** - * config/imxrt1060-evk/src/imxrt_flexspi_nor_flash.h - * - * Copyright (C) 2018 Gregory Nutt. All rights reserved. - * Authors: Ivan Ucherdzhiev - * David Sidrane - * - * 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 NuttX 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. - * - ****************************************************************************/ - -#ifndef __CONFIGS_IMXRT1060_EVK_SRC_IMXRT_FLEXSPI_NOR_FLASH_H -#define __CONFIGS_IMXRT1060_EVK_SRC_IMXRT_FLEXSPI_NOR_FLASH_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* FLEXSPI memory config block related defintions */ - -#define FLEXSPI_CFG_BLK_TAG (0x42464346ul) -#define FLEXSPI_CFG_BLK_VERSION (0x56010400ul) -#define FLEXSPI_CFG_BLK_SIZE (512) - -/* FLEXSPI Feature related definitions */ - -#define FLEXSPI_FEATURE_HAS_PARALLEL_MODE 1 - -/* Lookup table related defintions */ - -#define CMD_INDEX_READ 0 -#define CMD_INDEX_READSTATUS 1 -#define CMD_INDEX_WRITEENABLE 2 -#define CMD_INDEX_WRITE 4 - -#define CMD_LUT_SEQ_IDX_READ 0 -#define CMD_LUT_SEQ_IDX_READSTATUS 1 -#define CMD_LUT_SEQ_IDX_WRITEENABLE 3 -#define CMD_LUT_SEQ_IDX_WRITE 9 - -#define CMD_SDR 0x01 -#define CMD_DDR 0x21 -#define RADDR_SDR 0x02 -#define RADDR_DDR 0x22 -#define CADDR_SDR 0x03 -#define CADDR_DDR 0x23 -#define MODE1_SDR 0x04 -#define MODE1_DDR 0x24 -#define MODE2_SDR 0x05 -#define MODE2_DDR 0x25 -#define MODE4_SDR 0x06 -#define MODE4_DDR 0x26 -#define MODE8_SDR 0x07 -#define MODE8_DDR 0x27 -#define WRITE_SDR 0x08 -#define WRITE_DDR 0x28 -#define READ_SDR 0x09 -#define READ_DDR 0x29 -#define LEARN_SDR 0x0a -#define LEARN_DDR 0x2a -#define DATSZ_SDR 0x0b -#define DATSZ_DDR 0x2b -#define DUMMY_SDR 0x0c -#define DUMMY_DDR 0x2c -#define DUMMY_RWDS_SDR 0x0d -#define DUMMY_RWDS_DDR 0x2d -#define JMP_ON_CS 0x1f -#define STOP 0 - -#define FLEXSPI_1PAD 0 -#define FLEXSPI_2PAD 1 -#define FLEXSPI_4PAD 2 -#define FLEXSPI_8PAD 3 - -#define FLEXSPI_LUT_OPERAND0_MASK (0xffu) -#define FLEXSPI_LUT_OPERAND0_SHIFT (0U) -#define FLEXSPI_LUT_OPERAND0(x) (((uint32_t) \ - (((uint32_t)(x)) << FLEXSPI_LUT_OPERAND0_SHIFT)) & \ - FLEXSPI_LUT_OPERAND0_MASK) -#define FLEXSPI_LUT_NUM_PADS0_MASK (0x300u) -#define FLEXSPI_LUT_NUM_PADS0_SHIFT (8u) -#define FLEXSPI_LUT_NUM_PADS0(x) (((uint32_t) \ - (((uint32_t)(x)) << FLEXSPI_LUT_NUM_PADS0_SHIFT)) & \ - FLEXSPI_LUT_NUM_PADS0_MASK) -#define FLEXSPI_LUT_OPCODE0_MASK (0xfc00u) -#define FLEXSPI_LUT_OPCODE0_SHIFT (10u) -#define FLEXSPI_LUT_OPCODE0(x) (((uint32_t) \ - (((uint32_t)(x)) << FLEXSPI_LUT_OPCODE0_SHIFT)) & \ - FLEXSPI_LUT_OPCODE0_MASK) -#define FLEXSPI_LUT_OPERAND1_MASK (0xff0000u) -#define FLEXSPI_LUT_OPERAND1_SHIFT (16U) -#define FLEXSPI_LUT_OPERAND1(x) (((uint32_t) \ - (((uint32_t)(x)) << FLEXSPI_LUT_OPERAND1_SHIFT)) & \ - FLEXSPI_LUT_OPERAND1_MASK) -#define FLEXSPI_LUT_NUM_PADS1_MASK (0x3000000u) -#define FLEXSPI_LUT_NUM_PADS1_SHIFT (24u) -#define FLEXSPI_LUT_NUM_PADS1(x) (((uint32_t) \ - (((uint32_t)(x)) << FLEXSPI_LUT_NUM_PADS1_SHIFT)) & \ - FLEXSPI_LUT_NUM_PADS1_MASK) -#define FLEXSPI_LUT_OPCODE1_MASK (0xfc000000u) -#define FLEXSPI_LUT_OPCODE1_SHIFT (26u) -#define FLEXSPI_LUT_OPCODE1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_LUT_OPCODE1_SHIFT)) & \ - FLEXSPI_LUT_OPCODE1_MASK) - -#define FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) \ - (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | \ - FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | \ - FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1)) - -/* */ - -#define NOR_CMD_INDEX_READ CMD_INDEX_READ -#define NOR_CMD_INDEX_READSTATUS CMD_INDEX_READSTATUS -#define NOR_CMD_INDEX_WRITEENABLE CMD_INDEX_WRITEENABLE -#define NOR_CMD_INDEX_ERASESECTOR 3 -#define NOR_CMD_INDEX_PAGEPROGRAM CMD_INDEX_WRITE -#define NOR_CMD_INDEX_CHIPERASE 5 -#define NOR_CMD_INDEX_DUMMY 6 -#define NOR_CMD_INDEX_ERASEBLOCK 7 - -/* READ LUT sequence id in lookupTable stored in config block */ - -#define NOR_CMD_LUT_SEQ_IDX_READ CMD_LUT_SEQ_IDX_READ - -/* Read Status LUT sequence id in lookupTable stored in config block */ - -#define NOR_CMD_LUT_SEQ_IDX_READSTATUS CMD_LUT_SEQ_IDX_READSTATUS - -/* 2 Read status DPI/QPI/OPI sequence id in lookupTable stored in config block */ - -#define NOR_CMD_LUT_SEQ_IDX_READSTATUS_XPI 2 - -/* 3 Write Enable sequence id in lookupTable stored in config block */ - -#define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE CMD_LUT_SEQ_IDX_WRITEENABLE - -/* 4 Write Enable DPI/QPI/OPI sequence id in lookupTable stored in config block */ - -#define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE_XPI 4 - -/* 5 Erase Sector sequence id in lookupTable stored in config block */ - -#define NOR_CMD_LUT_SEQ_IDX_ERASESECTOR 5 - -/* 8 Erase Block sequence id in lookupTable stored in config block */ - -#define NOR_CMD_LUT_SEQ_IDX_ERASEBLOCK 8 - -/* 9 Program sequence id in lookupTable stored in config block */ - -#define NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM CMD_LUT_SEQ_IDX_WRITE - -/* 11 Chip Erase sequence in lookupTable id stored in config block */ - -#define NOR_CMD_LUT_SEQ_IDX_CHIPERASE 11 - -/* 13 Read SFDP sequence in lookupTable id stored in config block */ - -#define NOR_CMD_LUT_SEQ_IDX_READ_SFDP 13 - -/* 14 Restore 0-4-4/0-8-8 mode sequence id in lookupTable stored in config block */ - -#define NOR_CMD_LUT_SEQ_IDX_RESTORE_NOCMD 14 - -/* 15 Exit 0-4-4/0-8-8 mode sequence id in lookupTable stored in config blobk */ - -#define NOR_CMD_LUT_SEQ_IDX_EXIT_NOCMD 15 - -/**************************************************************************** - * Public Types - ****************************************************************************/ - -/* Definitions for FlexSPI Serial Clock Frequency */ - -enum flexspi_serial_clkfreq_e { - FLEXSPI_SERIAL_CLKFREQ_30MHz = 1, - FLEXSPI_SERIAL_CLKFREQ_50MHz = 2, - FLEXSPI_SERIAL_CLKFREQ_60MHz = 3, - FLEXSPI_SERIAL_CLKFREQ_75MHz = 4, - FLEXSPI_SERIAL_CLKFREQ_80MHz = 5, - FLEXSPI_SERIAL_CLKFREQ_100MHz = 6, - FLEXSPI_SERIAL_CLKFREQ_133MHz = 7, - FLEXSPI_SERIAL_CLKFREQ_166MHz = 8, - FLEXSPI_SERIAL_CLKFREQ_200MHz = 9, -}; - -/* FlexSPI clock configuration type*/ - -enum flexspi_serial_clockmode_e { - FLEXSPI_CLKMODE_SDR, - FLEXSPI_CLKMODE_DDR, -}; - -/* FlexSPI Read Sample Clock Source definition */ - -enum flash_read_sample_clk_e { - FLASH_READ_SAMPLE_CLK_LOOPBACK_INTERNELLY = 0, - FLASH_READ_SAMPLE_CLK_LOOPBACK_FROM_DQSPAD = 1, - FLASH_READ_SAMPLE_CLK_LOOPBACK_FROM_SCKPAD = 2, - FLASH_READ_SAMPLE_CLK_EXTERNALINPUT_FROM_DQSPAD = 3, -}; - -/* Misc feature bit definitions */ - -enum flash_misc_feature_e { - FLEXSPIMISC_OFFSET_DIFFCLKEN = 0, /* Bit for Differential clock enable */ - FLEXSPIMISC_OFFSET_CK2EN = 1, /* Bit for CK2 enable */ - FLEXSPIMISC_OFFSET_PARALLELEN = 2, /* Bit for Parallel mode enable */ - FLEXSPIMISC_OFFSET_WORD_ADDRESSABLE_EN = 3, /* Bit for Word Addressable enable */ - FLEXSPIMISC_OFFSET_SAFECONFIG_FREQ_EN = 4, /* Bit for Safe Configuration Frequency enable */ - FLEXSPIMISC_OFFSET_PAD_SETTING_OVERRIDE_EN = 5, /* Bit for Pad setting override enable */ - FLEXSPIMISC_OFFSET_DDR_MODE_EN = 6, /* Bit for DDR clock confiuration indication. */ -}; - -/* Flash Type Definition */ - -enum flash_flash_type_e { - FLEXSPI_DEVICE_TYPE_SERIAL_NOR = 1, /* Flash devices are Serial NOR */ - FLEXSPI_DEVICE_TYPE_SERIAL_NAND = 2, /* Flash devices are Serial NAND */ - FLEXSPI_DEVICE_TYPE_SERIAL_RAM = 3, /* Flash devices are Serial RAM/HyperFLASH */ - FLEXSPI_DEVICE_TYPE_MCP_NOR_NAND = 0x12, /* Flash device is MCP device, A1 is Serial NOR, A2 is Serial NAND */ - FLEXSPI_DEVICE_TYPE_MCP_NOR_RAM = 0x13, /* Flash deivce is MCP device, A1 is Serial NOR, A2 is Serial RAMs */ -}; - -/* Flash Pad Definitions */ - -enum flash_flash_pad_e { - SERIAL_FLASH_1PAD = 1, - SERIAL_FLASH_2PADS = 2, - SERIAL_FLASH_4PADS = 4, - SERIAL_FLASH_8PADS = 8, -}; - -/* Flash Configuration Command Type */ - -enum flash_config_cmd_e { - DEVICE_CONFIG_CMD_TYPE_GENERIC, /* Generic command, for example: configure dummy cycles, drive strength, etc */ - DEVICE_CONFIG_CMD_TYPE_QUADENABLE, /* Quad Enable command */ - DEVICE_CONFIG_CMD_TYPE_SPI2XPI, /* Switch from SPI to DPI/QPI/OPI mode */ - DEVICE_CONFIG_CMD_TYPE_XPI2SPI, /* Switch from DPI/QPI/OPI to SPI mode */ - DEVICE_CONFIG_CMD_TYPE_SPI2NO_CMD, /* Switch to 0-4-4/0-8-8 mode */ - DEVICE_CONFIG_CMD_TYPE_RESET, /* Reset device command */ -}; - -/* FlexSPI LUT Sequence structure */ - -struct flexspi_lut_seq_s { - uint8_t seq_num; /* Sequence Number, valid number: 1-16 */ - uint8_t seq_id; /* Sequence Index, valid number: 0-15 */ - uint16_t reserved; -}; - -/* FlexSPI Memory Configuration Block */ - -struct flexspi_mem_config_s { - uint32_t tag; - uint32_t version; - uint32_t reserved0; - uint8_t read_sample_clksrc; - uint8_t cs_hold_time; - uint8_t cs_setup_time; - uint8_t column_address_width; /* [0x00f-0x00f] Column Address with, for - * HyperBus protocol, it is fixed to 3, For - * Serial NAND, need to refer to datasheet */ - uint8_t device_mode_cfg_enable; - uint8_t device_mode_type; - uint16_t wait_time_cfg_commands; - struct flexspi_lut_seq_s device_mode_seq; - uint32_t device_mode_arg; - uint8_t config_cmd_enable; - uint8_t config_mode_type[3]; - struct flexspi_lut_seq_s config_cmd_seqs[3]; - uint32_t reserved1; - uint32_t config_cmd_args[3]; - uint32_t reserved2; - uint32_t controller_misc_option; - uint8_t device_type; - uint8_t sflash_pad_type; - uint8_t serial_clk_freq; - uint8_t lut_custom_seq_enable; - uint32_t reserved3[2]; - uint32_t sflash_a1size; - uint32_t sflash_a2size; - uint32_t sflash_b1size; - uint32_t sflash_b2size; - uint32_t cspad_setting_override; - uint32_t sclkpad_setting_override; - uint32_t datapad_setting_override; - uint32_t dqspad_setting_override; - uint32_t timeout_in_ms; - uint32_t command_interval; - uint16_t data_valid_time[2]; - uint16_t busy_offset; - uint16_t busybit_polarity; - uint32_t lookup_table[64]; - struct flexspi_lut_seq_s lut_customseq[12]; - uint32_t reserved4[4]; -}; - -/* Serial NOR configuration block */ - -struct flexspi_nor_config_s { - struct flexspi_mem_config_s mem_config; /* Common memory configuration info via FlexSPI */ - uint32_t page_size; /* Page size of Serial NOR */ - uint32_t sector_size; /* Sector size of Serial NOR */ - uint8_t ipcmd_serial_clkfreq; /* Clock frequency for IP command */ - uint8_t is_uniform_blocksize; /* Sector/Block size is the same */ - uint8_t reserved0[2]; /* Reserved for future use */ - uint8_t serial_nor_type; /* Serial NOR Flash type: 0/1/2/3 */ - uint8_t need_exit_nocmdmode; /* Need to exit NoCmd mode before other IP command */ - uint8_t halfclk_for_nonreadcmd; /* Half the Serial Clock for non-read command: true/false */ - uint8_t need_restore_nocmdmode; /* Need to Restore NoCmd mode after IP commmand execution */ - uint32_t blocksize; /* Block size */ - uint32_t reserve2[11]; /* Reserved for future use */ -}; - -#endif /* __CONFIGS_IMXRT1060_EVK_SRC_IMXRT_FLEXSPI_NOR_FLASH_H */ diff --git a/boards/nxp/fmurt1062-v1/src/init.c b/boards/nxp/fmurt1062-v1/src/init.c deleted file mode 100644 index 1b6feae..0000000 --- a/boards/nxp/fmurt1062-v1/src/init.c +++ /dev/null @@ -1,315 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2018-2019 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * NXP imxrt1062-v1 specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include "board_config.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "arm_internal.h" -#include "arm_internal.h" -#include "imxrt_flexspi_nor_boot.h" -#include "imxrt_iomuxc.h" -#include -#include "board_config.h" - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* Configuration ************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - /* set the peripheral rails off */ - - VDD_5V_PERIPH_EN(false); - VDD_5V_HIPOWER_EN(false); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ - VDD_5V_HIPOWER_EN(true); - VDD_5V_PERIPH_EN(true); - -} -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ - -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_gpio_output(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - - -/**************************************************************************** - * Name: imxrt_ocram_initialize - * - * Description: - * Called off reset vector to reconfigure the flexRAM - * and finish the FLASH to RAM Copy. - * - ****************************************************************************/ - -__EXPORT void imxrt_ocram_initialize(void) -{ - const uint32_t *src; - uint32_t *dest; - uint32_t regval; - - /* Reallocate 128K of Flex RAM from ITCM to OCRAM - * Final Configuration is - * 128 DTCM - * - * 128 FlexRAM OCRAM (202C:0000-202D:ffff) - * 256 FlexRAM OCRAM (2028:0000-202B:ffff) - * 512 System OCRAM2 (2020:0000-2027:ffff) - * */ - - putreg32(0xaa555555, IMXRT_IOMUXC_GPR_GPR17); - regval = getreg32(IMXRT_IOMUXC_GPR_GPR16); - putreg32(regval | GPR_GPR16_FLEXRAM_BANK_CFG_SELF, IMXRT_IOMUXC_GPR_GPR16); - - for (src = (uint32_t *)(LOCATE_IN_SRC(g_boot_data.start) + g_boot_data.size), - dest = (uint32_t *)(g_boot_data.start + g_boot_data.size); - dest < (uint32_t *) &_etext;) { - *dest++ = *src++; - } -} - -/**************************************************************************** - * Name: imxrt_boardinitialize - * - * Description: - * All i.MX RT architectures must provide the following entry point. This - * entry point is called early in the initialization -- after clocking and - * memory have been configured but before caches have been enabled and - * before any devices have been initialized. - * - ****************************************************************************/ - -__EXPORT void imxrt_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 */ - - imxrt_spidev_initialize(); - - imxrt_usb_initialize(); - - fmurt1062_timer_initialize(); -} - - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - - /* Power on Interfaces */ - - - VDD_3V3_SD_CARD_EN(true); - VDD_5V_PERIPH_EN(true); - VDD_5V_HIPOWER_EN(true); - VDD_3V3_SENSORS_EN(true); - VDD_3V3_SPEKTRUM_POWER_EN(true); - - board_spi_reset(10, 0xffff); - - if (OK == board_determine_hw_info()) { - syslog(LOG_INFO, "[boot] Rev 0x%1x : Ver 0x%1x %s\n", board_get_hw_revision(), board_get_hw_version(), - board_get_hw_type_name()); - - } else { - syslog(LOG_ERR, "[boot] Failed to read HW revision and version\n"); - } - - - px4_platform_init(); - - /* configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)imxrt_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - - led_off(LED_RED); - led_off(LED_GREEN); - led_off(LED_BLUE); - - int ret = OK; -#if defined(CONFIG_IMXRT_USDHC) - ret = fmurt1062_usdhc_initialize(); - - if (ret != OK) { - led_on(LED_RED); - } - -#endif - - /* Configure SPI-based devices */ - - ret = imxrt1062_spi_bus_initialize(); - - if (ret != OK) { - led_on(LED_RED); - } - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return ret; -} diff --git a/boards/nxp/fmurt1062-v1/src/led.c b/boards/nxp/fmurt1062-v1/src/led.c deleted file mode 100644 index 0d9236a..0000000 --- a/boards/nxp/fmurt1062-v1/src/led.c +++ /dev/null @@ -1,115 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2016, 2018 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * NXP fmurt1062-v1 LED backend. - */ - -#include - -#include - -#include "chip.h" -#include -#include "board_config.h" - -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - - -static uint32_t g_ledmap[] = { - GPIO_nLED_BLUE, // Indexed by LED_BLUE - GPIO_nLED_RED, // Indexed by LED_RED, LED_AMBER - GPIO_LED_SAFETY, // Indexed by LED_SAFETY - GPIO_nLED_GREEN, // Indexed by LED_GREEN -}; - -__EXPORT void led_init(void) -{ - /* Configure LED GPIOs for output */ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - if (g_ledmap[l] != 0) { - imxrt_config_gpio(g_ledmap[l]); - } - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - - if (g_ledmap[led] != 0) { - imxrt_gpio_write(g_ledmap[led], !state); - } -} - -static bool phy_get_led(int led) -{ - - if (g_ledmap[led] != 0) { - return imxrt_gpio_read(!g_ledmap[led]); - } - - return false; -} - -__EXPORT void led_on(int led) -{ - phy_set_led(led, true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(led, false); -} - -__EXPORT void led_toggle(int led) -{ - - phy_set_led(led, !phy_get_led(led)); -} diff --git a/boards/nxp/fmurt1062-v1/src/manifest.c b/boards/nxp/fmurt1062-v1/src/manifest.c deleted file mode 100644 index f37359a..0000000 --- a/boards/nxp/fmurt1062-v1/src/manifest.c +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2018-2021 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. - * - ****************************************************************************/ - -/** - * @file manifest.c - * - * This module supplies the interface to the manifest of hardware that is - * optional and dependent on the HW REV and HW VER IDs - * - * The manifest allows the system to know whether a hardware option - * say for example the PX4IO is an no-pop option vs it is broken. - * - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include - -#include "systemlib/px4_macros.h" -#include "px4_log.h" - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -typedef struct { - uint32_t hw_ver_rev; /* the version and revision */ - const px4_hw_mft_item_t *mft; /* The first entry */ - uint32_t entries; /* the lenght of the list */ -} px4_hw_mft_list_entry_t; - -typedef px4_hw_mft_list_entry_t *px4_hw_mft_list_entry; -#define px4_hw_mft_list_uninitialized (px4_hw_mft_list_entry) -1 - -static const px4_hw_mft_item_t device_unsupported = {0, 0, 0}; - -// List of components on a specific board configuration -// The index of those components is given by the enum (px4_hw_mft_item_id_t) -// declared in board_common.h -static const px4_hw_mft_item_t hw_mft_list_v0500[] = { - { - .present = 0, - .mandatory = 0, - .connection = px4_hw_con_onboard, - }, -}; - -static const px4_hw_mft_item_t hw_mft_list_v0540[] = { - { - .present = 0, - .mandatory = 0, - .connection = px4_hw_con_unknown, - }, -}; - -static px4_hw_mft_list_entry_t mft_lists[] = { - {V500, hw_mft_list_v0500, arraySize(hw_mft_list_v0500)}, - {V540, hw_mft_list_v0540, arraySize(hw_mft_list_v0540)}, -}; - -/************************************************************************************ - * Name: board_query_manifest - * - * Description: - * Optional returns manifest item. - * - * Input Parameters: - * manifest_id - the ID for the manifest item to retrieve - * - * Returned Value: - * 0 - item is not in manifest => assume legacy operations - * pointer to a manifest item - * - ************************************************************************************/ - -__EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) -{ - static px4_hw_mft_list_entry boards_manifest = px4_hw_mft_list_uninitialized; - - if (boards_manifest == px4_hw_mft_list_uninitialized) { - uint32_t ver_rev = board_get_hw_version() << 8; - ver_rev |= board_get_hw_revision(); - - for (unsigned i = 0; i < arraySize(mft_lists); i++) { - if (mft_lists[i].hw_ver_rev == ver_rev) { - boards_manifest = &mft_lists[i]; - break; - } - } - - if (boards_manifest == px4_hw_mft_list_uninitialized) { - PX4_ERR("Board %4" PRIx32 " is not supported!", ver_rev); - } - } - - px4_hw_mft_item rv = &device_unsupported; - - if (boards_manifest != px4_hw_mft_list_uninitialized && - id < boards_manifest->entries) { - rv = &boards_manifest->mft[id]; - } - - return rv; -} diff --git a/boards/nxp/fmurt1062-v1/src/sdhc.c b/boards/nxp/fmurt1062-v1/src/sdhc.c deleted file mode 100644 index df2f92c..0000000 --- a/boards/nxp/fmurt1062-v1/src/sdhc.c +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016-2018 Gregory Nutt. All rights reserved. - * Authors: Gregory Nutt - * David Sidrane - * - * 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 NuttX 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. - * - ****************************************************************************/ -/* A micro Secure Digital (SD) card slot is available on the board connected to - * the SD Host Controller (USDHC1) signals of the MCU. This slot will accept - * micro format SD memory cards. - * - * ------------ ------------- -------- - * SD Card Slot Board Signal IMXRT Pin - * ------------ ------------- -------- - * DAT0 USDHC1_DATA0 GPIO_SD_B0_02 - * DAT1 USDHC1_DATA1 GPIO_SD_B0_03 - * DAT2 USDHC1_DATA2 GPIO_SD_B0_04 - * CD/DAT3 USDHC1_DATA3 GPIO_SD_B0_05 - * CMD USDHC1_CMD GPIO_SD_B0_00 - * CLK USDHC1_CLK GPIO_SD_B0_01 - * CD USDHC1_CD GPIO_B1_12 - * ------------ ------------- -------- - * - * There are no Write Protect available to the IMXRT. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -#include "chip.h" -#include "imxrt_usdhc.h" - -#include "board_config.h" - -#ifdef CONFIG_IMXRT_USDHC -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ -/**************************************************************************** - * Private Data - ****************************************************************************/ -/**************************************************************************** - * Private Functions - ****************************************************************************/ -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: fmurt1062_usdhc_initialize - * - * Description: - * Inititialize the SDHC SD card slot - * - ****************************************************************************/ - -int fmurt1062_usdhc_initialize(void) -{ - int ret; - - /* Mount the SDHC-based MMC/SD block driver */ - /* First, get an instance of the SDHC interface */ - - struct sdio_dev_s *sdhc = imxrt_usdhc_initialize(CONFIG_NSH_MMCSDSLOTNO); - - if (!sdhc) { - PX4_ERR("ERROR: Failed to initialize SDHC slot %d\n", CONFIG_NSH_MMCSDSLOTNO); - return -ENODEV; - } - - /* Now bind the SDHC interface to the MMC/SD driver */ - - ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdhc); - - if (ret != OK) { - PX4_ERR("ERROR: Failed to bind SDHC to the MMC/SD driver: %d\n", ret); - return ret; - } - - syslog(LOG_INFO, "Successfully bound SDHC to the MMC/SD driver\n"); - - return OK; -} -#endif /* CONFIG_IMXRT_USDHC */ diff --git a/boards/nxp/fmurt1062-v1/src/spi.cpp b/boards/nxp/fmurt1062-v1/src/spi.cpp deleted file mode 100644 index 0427412..0000000 --- a/boards/nxp/fmurt1062-v1/src/spi.cpp +++ /dev/null @@ -1,388 +0,0 @@ -/************************************************************************************ - * - * Copyright (C) 2016, 2018 Gregory Nutt. All rights reserved. - * Authors: Gregory Nutt - * David Sidrane - * - * 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. - * - ************************************************************************************/ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include -#include -#include - -#include -#include - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include "imxrt_lpspi.h" -#include "imxrt_gpio.h" -#include "board_config.h" -#include - -#if defined(CONFIG_IMXRT_LPSPI1) || defined(CONFIG_IMXRT_LPSPI2) || \ - defined(CONFIG_IMXRT_LPSPI3) || defined(CONFIG_IMXRT_LPSPI4) - - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::LPSPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20689, SPI::CS{GPIO::Port3, GPIO::Pin26}, SPI::DRDY{GPIO::Port4, GPIO::Pin15}), /* GPIO_EMC_40 GPIO3_IO26 */ - initSPIDevice(DRV_GYR_DEVTYPE_BMI055, SPI::CS{GPIO::Port2, GPIO::Pin26}, SPI::DRDY{GPIO::Port4, GPIO::Pin16}), /* GPIO_B1_10 GPIO2_IO26 */ - initSPIDevice(DRV_ACC_DEVTYPE_BMI055, SPI::CS{GPIO::Port2, GPIO::Pin31}, SPI::DRDY{GPIO::Port3, GPIO::Pin23}), /* GPIO_B1_15 GPIO2_IO31 */ - initSPIDevice(DRV_DEVTYPE_UNUSED, SPI::CS{GPIO::Port3, GPIO::Pin0}), /* GPIO_SD_B1_00 GPIO3_IO00, AUX_MEM */ - }, {GPIO::Port3, GPIO::Pin27}), - initSPIBus(SPI::Bus::LPSPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::Port3, GPIO::Pin20}) /* GPIO_EMC_34 G GPIO3_IO20 */ - }), - initSPIBus(SPI::Bus::LPSPI3, { - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::Port4, GPIO::Pin14}), /* GPIO_EMC_14 GPIO4_IO14 */ - }), - initSPIBusExternal(SPI::Bus::LPSPI4, { - initSPIConfigExternal(SPI::CS{GPIO::Port4, GPIO::Pin7}), /* GPIO_EMC_07 GPIO4_IO07 */ - initSPIConfigExternal(SPI::CS{GPIO::Port2, GPIO::Pin30}), /* GPIO_B1_14 GPIO2_IO30 */ - initSPIConfigExternal(SPI::CS{GPIO::Port4, GPIO::Pin11}), /* GPIO_EMC_11 GPIO4_IO011 */ - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); - -#define _PIN_OFF(def) (((def) & (GPIO_PORT_MASK | GPIO_PIN_MASK)) | (GPIO_INPUT | IOMUX_PULL_DOWN_100K | IOMUX_CMOS_INPUT)) - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -/************************************************************************************ - * Name: fmurt1062_spidev_initialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the NXP FMUKRT1062-V1 board. - * - ************************************************************************************/ - -void imxrt_spidev_initialize(void) -{ - for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) { - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (px4_spi_buses[bus].devices[i].cs_gpio != 0) { - px4_arch_configgpio(px4_spi_buses[bus].devices[i].cs_gpio); - } - } - } -} - -/************************************************************************************ - * Name: imxrt_spi_bus_initialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the NXP FMUKRT1062-V1 board. - * - ************************************************************************************/ - -static const px4_spi_bus_t *_spi_bus1; -static const px4_spi_bus_t *_spi_bus2; -static const px4_spi_bus_t *_spi_bus3; -static const px4_spi_bus_t *_spi_bus4; - -__EXPORT int imxrt1062_spi_bus_initialize(void) -{ - for (int i = 0; i < SPI_BUS_MAX_BUS_ITEMS; ++i) { - switch (px4_spi_buses[i].bus) { - case 1: _spi_bus1 = &px4_spi_buses[i]; break; - - case 2: _spi_bus2 = &px4_spi_buses[i]; break; - - case 3: _spi_bus3 = &px4_spi_buses[i]; break; - - case 4: _spi_bus4 = &px4_spi_buses[i]; break; - } - } - - /* Configure SPI-based devices */ - - struct spi_dev_s *spi_sensors = px4_spibus_initialize(1); - - if (!spi_sensors) { - PX4_ERR("[boot] FAILED to initialize SPI port %d\n", 1); - return -ENODEV; - } - - /* Default bus 1 to 1MHz and de-assert the known chip selects. - */ - - SPI_SETFREQUENCY(spi_sensors, 1 * 1000 * 1000); - SPI_SETBITS(spi_sensors, 8); - SPI_SETMODE(spi_sensors, SPIDEV_MODE3); - - /* Get the SPI port for the Memory */ - - struct spi_dev_s *spi_memory = px4_spibus_initialize(2); - - if (!spi_memory) { - PX4_ERR("[boot] FAILED to initialize SPI port %d\n", 2); - return -ENODEV; - } - - /* Default PX4_SPI_BUS_MEMORY to 12MHz and de-assert the known chip selects. - */ - - SPI_SETFREQUENCY(spi_memory, 12 * 1000 * 1000); - SPI_SETBITS(spi_memory, 8); - SPI_SETMODE(spi_memory, SPIDEV_MODE3); - - /* Get the SPI port for the BARO */ - - struct spi_dev_s *spi_baro = px4_spibus_initialize(3); - - if (!spi_baro) { - PX4_ERR("[boot] FAILED to initialize SPI port %d\n", 3); - return -ENODEV; - } - - /* MS5611 has max SPI clock speed of 20MHz - */ - - SPI_SETFREQUENCY(spi_baro, 20 * 1000 * 1000); - SPI_SETBITS(spi_baro, 8); - SPI_SETMODE(spi_baro, SPIDEV_MODE3); - - /* Get the SPI port for the PX4_SPI_EXTERNAL1 */ - - struct spi_dev_s *spi_ext = px4_spibus_initialize(4); - - if (!spi_ext) { - PX4_ERR("[boot] FAILED to initialize SPI port %d\n", 4); - return -ENODEV; - } - - /* Default ext bus to 1MHz and de-assert the known chip selects. - */ - - SPI_SETFREQUENCY(spi_ext, 8 * 1000 * 1000); - SPI_SETBITS(spi_ext, 8); - SPI_SETMODE(spi_ext, SPIDEV_MODE3); - - /* deselect all */ - for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) { - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (px4_spi_buses[bus].devices[i].cs_gpio != 0) { - SPI_SELECT(spi_ext, px4_spi_buses[bus].devices[i].devid, false); - } - } - } - - return OK; - -} - -/**************************************************************************** - * Name: imxrt_lpspi1/2/3select and imxrt_lpspi1/2/3status - * - * Description: - * The external functions, imxrt_lpspi1/2/3select and imxrt_lpspi1/2/3status must be - * provided by board-specific logic. They are implementations of the select - * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including imxrt_lpspibus_initialize()) - * are provided by common STM32 logic. To use this common SPI logic on your - * board: - * - * 1. Provide logic in imxrt_boardinitialize() to configure SPI chip select - * pins. - * 2. Provide imxrt_lpspi1/2/3select() and imxrt_lpspi1/2/3status() functions in your - * board-specific logic. These functions will perform chip selection and - * status operations using GPIOs in the way your board is configured. - * 3. Add a calls to imxrt_lpspibus_initialize() in your low level application - * initialization logic - * 4. The handle returned by imxrt_lpspibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling - * mmcsd_spislotinitialize(), for example, will bind the SPI driver to - * the SPI MMC/SD driver). - * - ****************************************************************************/ - -static inline void imxrt_spixselect(const px4_spi_bus_t *bus, struct spi_dev_s *dev, uint32_t devid, bool selected) -{ - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (bus->devices[i].cs_gpio == 0) { - break; - } - - if (devid == bus->devices[i].devid) { - // SPI select is active low, so write !selected to select the device - imxrt_gpio_write(bus->devices[i].cs_gpio, !selected); - } - } -} - -#if defined(CONFIG_IMXRT_LPSPI1) -__EXPORT void imxrt_lpspi1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) -{ - imxrt_spixselect(_spi_bus1, dev, devid, selected); -} - -__EXPORT uint8_t imxrt_lpspi1status(FAR struct spi_dev_s *dev, uint32_t devid) -{ - return SPI_STATUS_PRESENT; -} -#endif - -#if defined(CONFIG_IMXRT_LPSPI2) -__EXPORT void imxrt_lpspi2select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) -{ - imxrt_spixselect(_spi_bus2, dev, devid, selected); -} - -__EXPORT uint8_t imxrt_lpspi2status(FAR struct spi_dev_s *dev, uint32_t devid) -{ - return SPI_STATUS_PRESENT; -} -#endif - -#if defined(CONFIG_IMXRT_LPSPI3) -__EXPORT void imxrt_lpspi3select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) -{ - imxrt_spixselect(_spi_bus3, dev, devid, selected); -} - -__EXPORT uint8_t imxrt_lpspi3status(FAR struct spi_dev_s *dev, uint32_t devid) -{ - return SPI_STATUS_PRESENT; -} -#endif - -#if defined(CONFIG_IMXRT_LPSPI4) -__EXPORT void imxrt_lpspi4select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) -{ - imxrt_spixselect(_spi_bus4, dev, devid, selected); -} - -__EXPORT uint8_t imxrt_lpspi4status(FAR struct spi_dev_s *dev, uint32_t devid) -{ - return SPI_STATUS_PRESENT; -} -#endif - -/************************************************************************************ - * Name: board_spi_reset - * - * Description: - * - * - ************************************************************************************/ - -__EXPORT void board_spi_reset(int ms, int bus_mask) -{ -#ifdef CONFIG_IMXRT_LPSPI1 - - /* Goal not to back feed the chips on the bus via IO lines */ - for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) { - if (px4_spi_buses[bus].bus == 1 || px4_spi_buses[bus].bus == 3) { - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (px4_spi_buses[bus].devices[i].cs_gpio != 0) { - imxrt_config_gpio(_PIN_OFF(px4_spi_buses[bus].devices[i].cs_gpio)); - } - - if (px4_spi_buses[bus].devices[i].drdy_gpio != 0) { - imxrt_config_gpio(_PIN_OFF(px4_spi_buses[bus].devices[i].drdy_gpio)); - } - } - } - } - - imxrt_config_gpio(GPIO_SPI1_SCK_OFF); - imxrt_config_gpio(GPIO_SPI1_MISO_OFF); - imxrt_config_gpio(GPIO_SPI1_MOSI_OFF); - - imxrt_config_gpio(GPIO_SPI3_SCK_OFF); - imxrt_config_gpio(GPIO_SPI3_MISO_OFF); - imxrt_config_gpio(GPIO_SPI3_MOSI_OFF); - - - imxrt_config_gpio(_PIN_OFF(GPIO_LPI2C3_SDA_RESET)); - imxrt_config_gpio(_PIN_OFF(GPIO_LPI2C3_SCL_RESET)); - - /* set the sensor rail off */ - imxrt_gpio_write(GPIO_VDD_3V3_SENSORS_EN, 0); - - /* wait for the sensor rail to reach GND */ - usleep(ms * 1000); - warnx("reset done, %d ms", ms); - - /* re-enable power */ - - /* switch the sensor rail back on */ - imxrt_gpio_write(GPIO_VDD_3V3_SENSORS_EN, 1); - - /* wait a bit before starting SPI, different times didn't influence results */ - usleep(100); - - /* reconfigure the SPI pins */ - for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) { - if (px4_spi_buses[bus].bus == 1 || px4_spi_buses[bus].bus == 3) { - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (px4_spi_buses[bus].devices[i].cs_gpio != 0) { - imxrt_config_gpio(px4_spi_buses[bus].devices[i].cs_gpio); - } - - if (px4_spi_buses[bus].devices[i].drdy_gpio != 0) { - imxrt_config_gpio(px4_spi_buses[bus].devices[i].drdy_gpio); - } - } - } - } - - imxrt_config_gpio(GPIO_LPSPI1_SCK); - imxrt_config_gpio(GPIO_LPSPI1_MISO); - imxrt_config_gpio(GPIO_LPSPI1_MOSI); - - imxrt_config_gpio(GPIO_LPSPI3_SCK); - imxrt_config_gpio(GPIO_LPSPI3_MISO); - imxrt_config_gpio(GPIO_LPSPI3_MOSI); - - imxrt_config_gpio(GPIO_LPI2C3_SDA); - imxrt_config_gpio(GPIO_LPI2C3_SCL); - -#endif /* CONFIG_IMXRT_LPSPI1 */ - -} - -#endif /* CONFIG_IMXRT_LPSPI1 || CONFIG_IMXRT_LPSPI2 || CONFIG_IMXRT_LPSPI3 || CONFIG_IMXRT_LPSPI4 */ diff --git a/boards/nxp/fmurt1062-v1/src/timer_config.cpp b/boards/nxp/fmurt1062-v1/src/timer_config.cpp deleted file mode 100644 index 328fc31..0000000 --- a/boards/nxp/fmurt1062-v1/src/timer_config.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016, 2018-2019 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. - * - ****************************************************************************/ - -// TODO:Stubbed out for now -#include - -#include -#include "hardware/imxrt_tmr.h" -#include "hardware/imxrt_flexpwm.h" -#include "imxrt_gpio.h" -#include "imxrt_iomuxc.h" -#include "hardware/imxrt_pinmux.h" -#include "imxrt_xbar.h" -#include "imxrt_periphclks.h" - -#include -#include - -#include "board_config.h" - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ - -/* Register accessors */ - -#define _REG(_addr) (*(volatile uint16_t *)(_addr)) - -/* QTimer3 register accessors */ - -#define REG(_reg) _REG(IMXRT_QTIMER3_BASE + IMXRT_TMR_OFFSET(IMXRT_TMR_CH0,(_reg))) - -#define rCOMP1 REG(IMXRT_TMR_COMP1_OFFSET) -#define rCOMP2 REG(IMXRT_TMR_COMP2_OFFSET) -#define rCAPT REG(IMXRT_TMR_CAPT_OFFSET) -#define rLOAD REG(IMXRT_TMR_LOAD_OFFSET) -#define rHOLD REG(IMXRT_TMR_HOLD_OFFSET) -#define rCNTR REG(IMXRT_TMR_CNTR_OFFSET) -#define rCTRL REG(IMXRT_TMR_CTRL_OFFSET) -#define rSCTRL REG(IMXRT_TMR_SCTRL_OFFSET) -#define rCMPLD1 REG(IMXRT_TMR_CMPLD1_OFFSET) -#define rCMPLD2 REG(IMXRT_TMR_CMPLD2_OFFSET) -#define rCSCTRL REG(IMXRT_TMR_CSCTRL_OFFSET) -#define rFILT REG(IMXRT_TMR_FILT_OFFSET) -#define rDMA REG(IMXRT_TMR_DMA_OFFSET) -#define rENBL REG(IMXRT_TMR_ENBL_OFFSET) - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOPWM(PWM::FlexPWM2, PWM::Submodule0), - initIOPWM(PWM::FlexPWM2, PWM::Submodule1), - initIOPWM(PWM::FlexPWM2, PWM::Submodule2), - initIOPWM(PWM::FlexPWM2, PWM::Submodule3), - initIOPWM(PWM::FlexPWM3, PWM::Submodule2), - initIOPWM(PWM::FlexPWM3, PWM::Submodule0), - initIOPWM(PWM::FlexPWM4, PWM::Submodule2), - initIOPWM(PWM::FlexPWM4, PWM::Submodule0), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {PWM::PWM2_PWM_A, PWM::Submodule0}, IOMUX::Pad::GPIO_B0_06), - initIOTimerChannel(io_timers, {PWM::PWM2_PWM_A, PWM::Submodule1}, IOMUX::Pad::GPIO_EMC_08), - initIOTimerChannel(io_timers, {PWM::PWM2_PWM_A, PWM::Submodule2}, IOMUX::Pad::GPIO_EMC_10), - initIOTimerChannel(io_timers, {PWM::PWM2_PWM_A, PWM::Submodule3}, IOMUX::Pad::GPIO_AD_B0_09), - initIOTimerChannel(io_timers, {PWM::PWM3_PWM_A, PWM::Submodule2}, IOMUX::Pad::GPIO_EMC_33), - initIOTimerChannel(io_timers, {PWM::PWM3_PWM_B, PWM::Submodule0}, IOMUX::Pad::GPIO_EMC_30), - initIOTimerChannel(io_timers, {PWM::PWM4_PWM_A, PWM::Submodule2}, IOMUX::Pad::GPIO_EMC_04), - initIOTimerChannel(io_timers, {PWM::PWM4_PWM_B, PWM::Submodule0}, IOMUX::Pad::GPIO_EMC_01), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); - -constexpr io_timers_t led_pwm_timers[MAX_LED_TIMERS] = { -}; - -constexpr timer_io_channels_t led_pwm_channels[MAX_TIMER_LED_CHANNELS] = { -}; - - -void fmurt1062_timer_initialize(void) -{ - /* We must configure Qtimer 3 as the IPG divide by to yield 16 Mhz - * and deliver that clock to the eFlexPWM234 via XBAR - * - * IPG = 144 Mhz - * 16Mhz = 144 / 9 - * COMP 1 = 5, COMP2 = 4 - * - * */ - - /* Enable Block Clocks for Qtimer and XBAR1 */ - - imxrt_clockall_timer3(); - imxrt_clockall_xbar1(); - - /* Disable Timer */ - - rCTRL = 0; - rCOMP1 = 5 - 1; // N - 1 - rCOMP2 = 4 - 1; - - rCAPT = 0; - rLOAD = 0; - rCNTR = 0; - - rSCTRL = TMR_SCTRL_OEN; - - rCMPLD1 = 0; - rCMPLD2 = 0; - rCSCTRL = 0; - rFILT = 0; - rDMA = 0; - - /* Count rising edges of primary source, - * Prescaler is /1 - * Count UP until compare, then re-initialize. a successful compare occurs when the counter reaches a COMP1 value. - * Toggle OFLAG output using alternating compare registers - */ - rCTRL = (TMR_CTRL_CM_MODE1 | TMR_CTRL_PCS_DIV1 | TMR_CTRL_LENGTH | TMR_CTRL_OUTMODE_TOG_ALT); - - /* QTIMER3_TIMER0 -> Flexpwm234ExtClk */ - - imxrt_xbar_connect(IMXRT_XBARA1_OUT_FLEXPWM234_EXT_CLK_SEL_OFFSET, IMXRT_XBARA1_IN_QTIMER3_TMR0_OUT); -} diff --git a/boards/nxp/fmurt1062-v1/src/usb.c b/boards/nxp/fmurt1062-v1/src/usb.c deleted file mode 100644 index 0d3c713..0000000 --- a/boards/nxp/fmurt1062-v1/src/usb.c +++ /dev/null @@ -1,129 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016, 2018 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include "board_config.h" -#include "imxrt_periphclks.h" - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int imxrt_usb_initialize(void) -{ - imxrt_clockall_usboh3(); - return 0; -} -/************************************************************************************ - * Name: imxrt_usbpullup - * - * Description: - * If USB is supported and the board supports a pullup via GPIO (for USB software - * connect and disconnect), then the board software must provide imxrt_usbpullup. - * See include/nuttx/usb/usbdev.h for additional description of this method. - * Alternatively, if no pull-up GPIO the following EXTERN can be redefined to be - * NULL. - * - ************************************************************************************/ - -__EXPORT -int imxrt_usbpullup(FAR struct usbdev_s *dev, bool enable) -{ - usbtrace(TRACE_DEVPULLUP, (uint16_t)enable); - - return OK; -} - -/************************************************************************************ - * Name: imxrt_usbsuspend - * - * Description: - * Board logic must provide the imxrt_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT -void imxrt_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} - -/************************************************************************************ - * Name: board_read_VBUS_state - * - * Description: - * All boards must provide a way to read the state of VBUS, this my be simple - * digital input on a GPIO. Or something more complicated like a Analong input - * or reading a bit from a USB controller register. - * - * Returns - 0 if connected. - * - ************************************************************************************/ - -int board_read_VBUS_state(void) -{ - - return (getreg32(IMXRT_USB_ANALOG_USB1_VBUS_DETECT_STAT) & USB_ANALOG_USB_VBUS_DETECT_STAT_VBUS_VALID) ? 0 : 1; -} diff --git a/boards/nxp/mr-canhubk3/Kconfig b/boards/nxp/mr-canhubk3/Kconfig deleted file mode 100644 index f72f3c0..0000000 --- a/boards/nxp/mr-canhubk3/Kconfig +++ /dev/null @@ -1,4 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see the file kconfig-language.txt in the NuttX tools repository. -# diff --git a/boards/nxp/mr-canhubk3/default.px4board b/boards/nxp/mr-canhubk3/default.px4board deleted file mode 100644 index 277c62d..0000000 --- a/boards/nxp/mr-canhubk3/default.px4board +++ /dev/null @@ -1,28 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_ROMFSROOT="cannode" -CONFIG_BOARD_ETHERNET=y -CONFIG_DRIVERS_BAROMETER_BMP388=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20649=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y -CONFIG_DRIVERS_MAGNETOMETER_BOSCH_BMM150=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_SENSORS=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/nxp/mr-canhubk3/firmware.prototype b/boards/nxp/mr-canhubk3/firmware.prototype deleted file mode 100644 index cda441c..0000000 --- a/boards/nxp/mr-canhubk3/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 34, - "magic": "PX4FWv1", - "description": "Firmware for the ucans32k146 board", - "image": "", - "build_time": 0, - "summary": "UCANS32K146", - "version": "0.1", - "image_size": 0, - "image_maxsize": 0, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/nxp/mr-canhubk3/fmu.px4board b/boards/nxp/mr-canhubk3/fmu.px4board deleted file mode 100644 index 9505bb7..0000000 --- a/boards/nxp/mr-canhubk3/fmu.px4board +++ /dev/null @@ -1,60 +0,0 @@ -# CONFIG_BOARD_ROMFSROOT is not set -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS1" -CONFIG_BOARD_SERIAL_GPS2="/dev/ttyS4" -CONFIG_BOARD_SERIAL_RC="/dev/ttyS5" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS2" -CONFIG_BOARD_SERIAL_TEL4="/dev/ttyS3" -CONFIG_BOARD_UAVCAN_INTERFACES=1 -CONFIG_COMMON_LIGHT=y -CONFIG_CYPHAL_BMS_SUBSCRIBER=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_CYPHAL=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8310=y -CONFIG_DRIVERS_MAGNETOMETER_LIS3MDL=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SAFETY_BUTTON=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_EXAMPLES_FAKE_GPS=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_NETMAN=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SERIAL_TEST=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y diff --git a/boards/nxp/mr-canhubk3/init/rc.board_defaults b/boards/nxp/mr-canhubk3/init/rc.board_defaults deleted file mode 100644 index 7ef22a0..0000000 --- a/boards/nxp/mr-canhubk3/init/rc.board_defaults +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -# FIXME TELEM - -# Mavlink ethernet (CFG 1000) -param set-default MAV_1_CONFIG 1000 -param set-default MAV_1_BROADCAST 1 -param set-default MAV_1_MODE 0 -param set-default MAV_1_RADIO_CTL 0 -param set-default MAV_1_RATE 100000 -param set-default MAV_1_REMOTE_PRT 14550 -param set-default MAV_1_UDP_PRT 14550 - -param set-default SENS_EXT_I2C_PRB 0 -param set-default CYPHAL_ENABLE 0 - -if ver hwtypecmp MR-CANHUBK3-ADAP -then - param set-default GPS_1_CONFIG 202 - param set-default RC_PORT_CONFIG 104 - param set-default SENS_INT_BARO_EN 0 - param set-default SYS_HAS_BARO 0 - # MR-CANHUBK3-ADAP voltage divider - param set-default BAT1_V_DIV 13.158 - safety_button start -fi - -if param greater -s UAVCAN_ENABLE 0 -then - ifup can0 - ifup can1 - ifup can2 - ifup can3 -fi -if param greater -s CYPHAL_ENABLE 0 -then - ifup can0 - ifup can1 - ifup can2 - ifup can3 -fi diff --git a/boards/nxp/mr-canhubk3/init/rc.board_mavlink b/boards/nxp/mr-canhubk3/init/rc.board_mavlink deleted file mode 100644 index 71c59dd..0000000 --- a/boards/nxp/mr-canhubk3/init/rc.board_mavlink +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# -# board specific MAVLink startup script. -#------------------------------------------------------------------------------ diff --git a/boards/nxp/mr-canhubk3/init/rc.board_sensors b/boards/nxp/mr-canhubk3/init/rc.board_sensors deleted file mode 100644 index 642a254..0000000 --- a/boards/nxp/mr-canhubk3/init/rc.board_sensors +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh -# -# NXP MR-CANHUBK3 specific board sensors init -#------------------------------------------------------------------------------ -if ver hwtypecmp MR-CANHUBK3-ADAP -then - icm42688p -c 2 -b 3 -R 0 -S -f 15000 start - # Internal magnetometer on I2c on ADAP - bmm150 -X -a 18 start - ist8310 -X -b 1 -R 10 start - # ADC for voltage input sensing - board_adc start - - # External SPI bus ICM20649 - icm20649 -b 4 -S -R 10 start - - # External SPI bus ICM42688p - icm42688p -c 1 -b 3 -R 10 -S -f 15000 start -else - bmm150 -X start - # External compass on GPS1/I2C1 (the 3rd external bus): standard Holybro Pixhawk 4 or CUAV V5 GPS/compass puck (with lights, safety button, and buzzer) - ist8310 -X -b 2 -R 10 start - - # External SPI bus ICM20649 - icm20649 -b 4 -S -R 6 start - - # External SPI bus ICM42688p - icm42688p -c 1 -b 3 -R 6 -S -f 15000 start -fi - -# External compass on GPS1/I2C1 (the 3rd external bus): Drotek RTK GPS with LIS3MDL Compass -lis3mdl -X -b 2 -R 2 start - -# Disable startup of internal baros if param is set to false -if param compare SENS_INT_BARO_EN 1 -then - bmp388 -X -a 0x77 start -fi diff --git a/boards/nxp/mr-canhubk3/nuttx-config/Kconfig b/boards/nxp/mr-canhubk3/nuttx-config/Kconfig deleted file mode 100644 index 8dd38dc..0000000 --- a/boards/nxp/mr-canhubk3/nuttx-config/Kconfig +++ /dev/null @@ -1,18 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see the file kconfig-language.txt in the NuttX tools repository. -# - -config BOARD_HAS_PROBES - bool "Board provides GPIO or other Hardware for signaling to timing analyze." - default y - ---help--- - This board provides GPIO PWM-CH0-7 as PROBE_1-8 to provide timing signals from selected drivers. - -config BOARD_USE_PROBES - bool "Enable the use the board provided PWM-CH0-7 as PROBE_1-8" - default n - depends on BOARD_HAS_PROBES - - ---help--- - Select to use GPIO PWM-CH0-7 to provide timing signals from selected drivers. diff --git a/boards/nxp/mr-canhubk3/nuttx-config/include/board.h b/boards/nxp/mr-canhubk3/nuttx-config/include/board.h deleted file mode 100644 index 457f63c..0000000 --- a/boards/nxp/mr-canhubk3/nuttx-config/include/board.h +++ /dev/null @@ -1,374 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k3xx/mr-canhubk3/include/board.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/* Copyright 2022 NXP */ - -#ifndef __BOARDS_ARM_S32K3XX_MR_CANHUBK3_INCLUDE_BOARD_H -#define __BOARDS_ARM_S32K3XX_MR_CANHUBK3_INCLUDE_BOARD_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Clocking *****************************************************************/ - -/* The MR-CANHUBK3 is fitted with a 16 MHz crystal */ - -#define BOARD_XTAL_FREQUENCY 16000000 - -/* The S32K344 will run at 160 MHz */ - -#define MR_CANHUBK3_SYSCLK_FREQUENCY 160000000 - -/* MX25L QuadSPI Flash ******************************************************/ - -#ifdef CONFIG_S32K3XX_QSPI -# ifdef CONFIG_MTD_MX25RXX -# define HAVE_MX25L -# ifdef CONFIG_FS_LITTLEFS -# define HAVE_MX25L_LITTLEFS -# else -# ifdef CONFIG_FS_NXFFS -# define HAVE_MX25L_NXFFS -# else -# define HAVE_MX25L_CHARDEV -# endif -# endif -# endif -#endif - -#define MX25L_MTD_MINOR 0 -#define MX25L_SMART_MINOR 0 - -/* LED definitions **********************************************************/ - -/* The MR-CANHUBK3 has one RGB LED: - * - * RedLED PTE14 (FXIO D7 / EMIOS0 CH19) - * GreenLED PTA27 (FXIO D5 / EMIOS1 CH10 / EMIOS2 CH10) - * BlueLED PTE12 (FXIO D8 / EMIOS1 CH5) - * - * If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in - * any way. The following definitions are used to access individual RGB - * components. - * - * The RGB components could, alternatively be controlled through PWM using - * the common RGB LED driver. - */ - -/* LED index values for use with board_userled() */ - -#define BOARD_LED_R 0 -#define BOARD_LED_G 1 -#define BOARD_LED_B 2 -#define BOARD_NLEDS 3 - -/* LED bits for use with board_userled_all() */ - -#define BOARD_LED_R_BIT (1 << BOARD_LED_R) -#define BOARD_LED_G_BIT (1 << BOARD_LED_G) -#define BOARD_LED_B_BIT (1 << BOARD_LED_B) - -/* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LEDs on board - * the MR-CANHUBK3. The following definitions describe how NuttX controls - * the LEDs: - * - * SYMBOL Meaning LED state - * RED GREEN BLUE - * ---------------- ----------------------------- ------------------- - */ - -#define LED_STARTED 1 /* NuttX has been started OFF OFF OFF */ -#define LED_HEAPALLOCATE 2 /* Heap has been allocated OFF OFF ON */ -#define LED_IRQSENABLED 0 /* Interrupts enabled OFF OFF ON */ -#define LED_STACKCREATED 3 /* Idle stack created OFF ON OFF */ -#define LED_INIRQ 0 /* In an interrupt (No change) */ -#define LED_SIGNAL 0 /* In a signal handler (No change) */ -#define LED_ASSERTION 0 /* An assertion failed (No change) */ -#define LED_PANIC 4 /* The system has crashed FLASH OFF OFF */ -#undef LED_IDLE /* S32K344 is in sleep mode (Not used) */ - -/* Button definitions *******************************************************/ - -/* The MR-CANHUBK3 supports two buttons: - * - * SW1 PTD15 (EIRQ31) - * SW2 PTA25 (EIRQ5 / WKPU34) - */ - -#define BUTTON_SW1 0 -#define BUTTON_SW2 1 -#define NUM_BUTTONS 2 - -#define BUTTON_SW1_BIT (1 << BUTTON_SW1) -#define BUTTON_SW2_BIT (1 << BUTTON_SW2) - -/* UART selections **********************************************************/ - -/* By default, the serial console will be provided on the DCD-LZ UART - * (available on the 7-pin DCD-LZ debug connector P6): - * - * DCD-LZ UART RX PTA8 (LPUART2_RX) - * DCD-LZ UART TX PTA9 (LPUART2_TX) - */ - -#define PIN_LPUART2_RX (PIN_LPUART2_RX_1 | PIN_INPUT_PULLUP) /* PTA8 */ -#define PIN_LPUART2_TX PIN_LPUART2_TX_1 /* PTA9 */ - -/* LPUART0 P2 UART (with flow control) connector */ - -#define PIN_LPUART0_CTS PIN_LPUART0_CTS_1 /* PTA0 */ -#define PIN_LPUART0_RTS (PIN_PTA1 | GPIO_OUTPUT) /* PIN_LPUART0_RTS_1 PTA1 */ -#define PIN_LPUART0_RX (PIN_LPUART0_RX_1 | PIN_INPUT_PULLUP) /* PTA2 */ -#define PIN_LPUART0_TX PIN_LPUART0_TX_1 /* PTA3 */ - -/* LPUART1 P5 UART (with flow control) connector */ - -#define PIN_LPUART1_CTS PIN_LPUART1_CTS_2 /* PTE2 */ -#define PIN_LPUART1_RTS PIN_LPUART1_RTS_2 /* PTE6 */ -#define PIN_LPUART1_RX (PIN_LPUART1_RX_3 | PIN_INPUT_PULLUP) /* PTC6 */ -#define PIN_LPUART1_TX PIN_LPUART1_TX_3 /* PTC7 */ - - -/* LPUART4 /dev/ttyS3 P8B 3X7 Pin 3 Single wire RC UART */ - -#define PIN_LPUART4_RX PIN_LPUART4_TX_3 /* Dummy since it's Single Wire TX-only */ -#define PIN_LPUART4_TX PIN_LPUART4_TX_3 /* PTE11 */ - - -/* LPUART7 /dev/ttyS4 P8B 3X7 Pin 3 and Pin 8 */ - -#define PIN_LPUART7_RX (PIN_LPUART7_RX_3 | PIN_INPUT_PULLUP) /* PTE0 */ -#define PIN_LPUART7_TX PIN_LPUART7_TX_3 /* PTE1 */ - -/* LPUART9 P24 UART connector */ - -#define PIN_LPUART9_RX (PIN_LPUART9_RX_1 | PIN_INPUT_PULLUP) /* PTB2 */ -#define PIN_LPUART9_TX PIN_LPUART9_TX_1 /* PTB3 */ - -/* LPUART10 P24 UART connector */ - -#define PIN_LPUART10_RX (PIN_LPUART10_RX_1 | PIN_INPUT_PULLUP) /* PTC12 */ -#define PIN_LPUART10_TX PIN_LPUART10_TX_1 /* PTC13 */ - -/* LPUART13 P25 UART connector */ - -#define PIN_LPUART13_RX (PIN_LPUART13_RX_1 | PIN_INPUT_PULLUP) /* PTB19 */ -#define PIN_LPUART13_TX PIN_LPUART13_TX_1 /* PTB18 */ - -/* LPUART14 P25 UART connector */ - -#define PIN_LPUART14_RX (PIN_LPUART14_RX_1 | PIN_INPUT_PULLUP) /* PTB21 */ -#define PIN_LPUART14_TX PIN_LPUART14_TX_1 /* PTB20 */ - -/* SPI selections ***********************************************************/ - -/* LPSPI1 P1A external SPI connector */ - -#define PIN_LPSPI1_SCK PIN_LPSPI1_SCK_3 /* PTA28 */ -#define PIN_LPSPI1_MISO PIN_LPSPI1_SOUT_2 /* PTA30 */ -#define PIN_LPSPI1_MOSI PIN_LPSPI1_SIN_3 /* PTA29 */ -#define PIN_LPSPI1_PCS0 PIN_LPSPI1_PCS0_2 /* PTA21 */ -#define PIN_LPSPI1_PCS1 PIN_LPSPI1_PCS1_6 /* PTE4 */ - -#define PIN_LPSPI1_PCS (PIN_PTA21 | GPIO_LOWDRIVE | GPIO_OUTPUT_ONE) /* PTA21 */ - -/* LPSPI2 P1B external SPI connector */ - -#define PIN_LPSPI2_SCK PIN_LPSPI2_SCK_1 /* PTB29 */ -#define PIN_LPSPI2_MISO PIN_LPSPI2_SOUT_3 /* PTB27 */ -#define PIN_LPSPI2_MOSI PIN_LPSPI2_SIN_2 /* PTB28 */ -#define PIN_LPSPI2_PCS0 PIN_LPSPI2_PCS0_2 /* PTB25 */ -#define PIN_LPSPI2_PCS1 PIN_LPSPI2_PCS1_3 /* PTC19 */ - -#define PIN_LPSPI2_PCS (PIN_PTB25 | GPIO_LOWDRIVE | GPIO_OUTPUT_ONE) /* PTB25 */ - -/* LPSPI3 FS26 Safety SBC */ - -#define PIN_LPSPI3_SCK PIN_LPSPI3_SCK_2 /* PTD1 */ -#define PIN_LPSPI3_MISO PIN_LPSPI3_SOUT_2 /* PTD0 */ -#define PIN_LPSPI3_MOSI PIN_LPSPI3_SIN_3 /* PTE10 */ -#define PIN_LPSPI3_PCS (PIN_PTD17 | GPIO_LOWDRIVE | GPIO_OUTPUT_ONE) /* PTD17 */ - -/* LPSPI4 P8B I/O connector / P26 external IMU connector */ - -#define PIN_LPSPI4_SCK PIN_LPSPI4_SCK_1 /* PTB10 */ -#define PIN_LPSPI4_MISO PIN_LPSPI4_SOUT_1 /* PTB9 */ -#define PIN_LPSPI4_MOSI PIN_LPSPI4_SIN_1 /* PTB11 */ -#define PIN_LPSPI4_PCS0 PIN_LPSPI4_PCS0_1 /* PTB8 */ -#define PIN_LPSPI4_PCS3 PIN_LPSPI4_PCS3_1 /* PTA16 */ - -#define PIN_LPSPI4_CS_P26 (PIN_PTA16 | GPIO_LOWDRIVE | GPIO_OUTPUT_ONE) /* PTA16 */ -#define PIN_LPSPI4_CS_P8B (PIN_PTB8 | GPIO_LOWDRIVE | GPIO_OUTPUT_ONE) /* PTB8 */ - -/* LPSPI5 P26 external IMU connector */ - -#define PIN_LPSPI5_SCK PIN_LPSPI5_SCK_3 /* PTD26 */ -#define PIN_LPSPI5_MISO PIN_LPSPI5_SOUT_2 /* PTD27 */ -#define PIN_LPSPI5_MOSI PIN_LPSPI5_SIN_3 /* PTD28 */ -#define PIN_LPSPI5_PCS1 PIN_LPSPI5_PCS1_1 /* PTA14 */ - -#define PIN_LPSPI5_PCS (PIN_PTA14 | GPIO_LOWDRIVE | GPIO_OUTPUT_ONE) /* PTA14 */ - -/* PIN_LPSPI5_PCS2 PTD29 */ - -/* I2C selections ***********************************************************/ - -/* LPI2C0 P4 LCD header / P26 external IMU connector */ - -#define PIN_LPI2C0_SCL PIN_LPI2C0_SCL_2 /* PTD14 */ -#define PIN_LPI2C0_SDA PIN_LPI2C0_SDA_2 /* PTD13 */ - -/* LPI2C1 P3 external I2C connector / SE050 EdgeLock Secure Element */ - -#define PIN_LPI2C1_SCL PIN_LPI2C1_SCL_4 /* PTD9 */ -#define PIN_LPI2C1_SDA PIN_LPI2C1_SDA_4 /* PTD8 */ - -/* CAN selections ***********************************************************/ - -/* CAN0 TJA1443 CAN transceiver */ - -#define PIN_CAN0_RX PIN_CAN0_RX_1 /* PTA6 */ -#define PIN_CAN0_TX PIN_CAN0_TX_1 /* PTA7 */ -#define PIN_CAN0_STB (PIN_PTC21 | GPIO_OUTPUT) -#define CAN0_STB_OUT 1 -#define PIN_CAN0_ENABLE (PIN_PTC24 | GPIO_OUTPUT) -#define CAN0_ENABLE_OUT 1 -#define PIN_CAN0_LED (PIN_PTC18 | GPIO_OUTPUT) -#define CAN0_LED_OUT 0 -#define PIN_CAN0_ERRN (PIN_PTC20 | GPIO_INPUT) - -/* CAN1 TJA1443 CAN transceiver */ - -#define PIN_CAN1_RX PIN_CAN1_RX_4 /* PTC9 */ -#define PIN_CAN1_TX PIN_CAN1_TX_4 /* PTC8 */ -#define PIN_CAN1_STB (PIN_PTD2 | GPIO_OUTPUT) -#define CAN1_STB_OUT 1 -#define PIN_CAN1_ENABLE (PIN_PTD23 | GPIO_OUTPUT) -#define CAN1_ENABLE_OUT 1 -#define PIN_CAN1_LED (PIN_PTE5 | GPIO_OUTPUT) -#define CAN1_LED_OUT 0 -#define PIN_CAN1_ERRN (PIN_PTD3 | GPIO_INPUT) - -/* CAN2 TJA1463 CAN transceiver */ - -#define PIN_CAN2_RX PIN_CAN2_RX_5 /* PTE25 */ -#define PIN_CAN2_TX PIN_CAN2_TX_5 /* PTE24 */ -#define PIN_CAN2_STB (PIN_PTD22 | GPIO_OUTPUT) -#define CAN2_STB_OUT 1 -#define PIN_CAN2_ENABLE (PIN_PTD4 | GPIO_OUTPUT) -#define CAN2_ENABLE_OUT 1 -#define PIN_CAN2_LED (PIN_PTD20 | GPIO_OUTPUT) -#define CAN2_LED_OUT 0 -#define PIN_CAN2_ERRN (PIN_PTD21 | GPIO_INPUT) - -/* CAN3 TJA1463 CAN transceiver */ - -#define PIN_CAN3_RX PIN_CAN3_RX_2 /* PTC29 */ -#define PIN_CAN3_TX PIN_CAN3_TX_2 /* PTC28 */ -#define PIN_CAN3_STB (PIN_PTB1 | GPIO_OUTPUT) -#define CAN3_STB_OUT 1 -#define PIN_CAN3_ENABLE (PIN_PTB0 | GPIO_OUTPUT) -#define CAN3_ENABLE_OUT 1 -#define PIN_CAN3_LED (PIN_PTB24 | GPIO_OUTPUT) -#define CAN3_LED_OUT 0 -#define PIN_CAN3_ERRN (PIN_PTC27 | GPIO_INPUT) - -/* CAN4 TJA1153 CAN transceiver */ - -#define PIN_CAN4_RX PIN_CAN4_RX_2 /* PTC31 */ -#define PIN_CAN4_TX PIN_CAN4_TX_2 /* PTC30 */ -#define PIN_CAN4_STB (PIN_PTC25 | GPIO_OUTPUT) -#define CAN4_STB_OUT 0 -#define PIN_CAN4_ENABLE (PIN_PTC26 | GPIO_OUTPUT) -#define CAN4_ENABLE_OUT 1 -#define PIN_CAN4_LED (PIN_PTB26 | GPIO_OUTPUT) -#define CAN4_LED_OUT 0 -#define PIN_CAN4_ERRN (PIN_PTC23 | GPIO_INPUT) - -/* CAN5 TJA1153 CAN transceiver */ - -#define PIN_CAN5_RX PIN_CAN5_RX_1 /* PTC11 */ -#define PIN_CAN5_TX PIN_CAN5_TX_1 /* PTC10 */ -#define PIN_CAN5_STB (PIN_PTE17 | GPIO_OUTPUT) -#define CAN5_STB_OUT 0 -#define PIN_CAN5_ENABLE (PIN_PTD30 | GPIO_OUTPUT) -#define CAN5_ENABLE_OUT 1 -#define PIN_CAN5_LED (PIN_PTD31 | GPIO_OUTPUT) -#define CAN5_LED_OUT 0 -#define PIN_CAN5_ERRN (PIN_PTD24 | GPIO_INPUT) - -/* ENET selections **********************************************************/ - -#define PIN_EMAC_MII_RMII_TXD0 PIN_EMAC_MII_RMII_TXD0_1 /* PTB5 */ -#define PIN_EMAC_MII_RMII_TXD1 PIN_EMAC_MII_RMII_TXD1_1 /* PTB4 */ -#define PIN_EMAC_MII_RMII_TX_EN PIN_EMAC_MII_RMII_TX_EN_3 /* PTE9 */ -#define PIN_EMAC_MII_RMII_RXD0 PIN_EMAC_MII_RMII_RXD0_1 /* PTC0 */ -#define PIN_EMAC_MII_RMII_RXD1 PIN_EMAC_MII_RMII_RXD1_2 /* PTC1 */ -#define PIN_EMAC_MII_RMII_RX_DV PIN_EMAC_MII_RMII_RX_DV_1 /* PTC15 */ -#define PIN_EMAC_MII_RMII_RX_ER PIN_EMAC_MII_RMII_RX_ER_1 /* PTC14 */ -#define PIN_EMAC_MII_RMII_MDC PIN_EMAC_MII_RMII_MDC_3 /* PTC8 */ -#define PIN_EMAC_MII_RMII_MDIO PIN_EMAC_MII_RMII_MDIO_2 /* PTD16 */ -#define PIN_EMAC_MII_RMII_TX_CLK PIN_EMAC_MII_RMII_TX_CLK_2 /* PTD6 */ - - -/* Board provides GPIO or other Hardware for signaling to timing analyzer */ - -#if defined(CONFIG_BOARD_USE_PROBES) -# include "s32k3xx_pin.h" -# include "hardware/s32k3xx_pinmux.h" -# define PROBE_N(n) (1<<((n)-1)) -# define PROBE_1 (PIN_PTB12 | GPIO_OUTPUT) /* PWM-0 */ -# define PROBE_2 (PIN_PTB13 | GPIO_OUTPUT) /* PWM-1 */ -# define PROBE_3 (PIN_PTB14 | GPIO_OUTPUT) /* PWM-2 */ -# define PROBE_4 (PIN_PTB15 | GPIO_OUTPUT) /* PWM-3 */ -# define PROBE_5 (PIN_PTB16 | GPIO_OUTPUT) /* PWM-4 */ -# define PROBE_6 (PIN_PTB17 | GPIO_OUTPUT) /* PWM-5 */ -# define PROBE_7 (PIN_PTA17 | GPIO_OUTPUT) /* PWM-6 */ -# define PROBE_8 (PIN_PTE7 | GPIO_OUTPUT) /* PWM-7 */ - -# define PROBE_INIT(mask) \ - do { \ - if ((mask)& PROBE_N(1)) { s32k3xx_pinconfig(PROBE_1); } \ - if ((mask)& PROBE_N(2)) { s32k3xx_pinconfig(PROBE_2); } \ - if ((mask)& PROBE_N(3)) { s32k3xx_pinconfig(PROBE_3); } \ - if ((mask)& PROBE_N(4)) { s32k3xx_pinconfig(PROBE_4); } \ - if ((mask)& PROBE_N(5)) { s32k3xx_pinconfig(PROBE_5); } \ - if ((mask)& PROBE_N(6)) { s32k3xx_pinconfig(PROBE_6); } \ - if ((mask)& PROBE_N(7)) { s32k3xx_pinconfig(PROBE_7); } \ - if ((mask)& PROBE_N(8)) { s32k3xx_pinconfig(PROBE_8); } \ - } while(0) - -# define PROBE(n,s) do {s32k3xx_gpiowrite(PROBE_##n,(s));}while(0) -# define PROBE_MARK(n) PROBE(n,false);PROBE(n,true) -#else -# define PROBE_INIT(mask) -# define PROBE(n,s) -# define PROBE_MARK(n) -#endif - - -#endif /* __BOARDS_ARM_S32K3XX_MR_CANHUBK3_INCLUDE_BOARD_H */ diff --git a/boards/nxp/mr-canhubk3/nuttx-config/nsh/defconfig b/boards/nxp/mr-canhubk3/nuttx-config/nsh/defconfig deleted file mode 100644 index b583703..0000000 --- a/boards/nxp/mr-canhubk3/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,282 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_ARP is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_IFCONFIG is not set -# CONFIG_NSH_DISABLE_IFUPDOWN is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_NSLOOKUP is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TELNETD is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_SPI_CALLBACK is not set -CONFIG_ALLOW_GPL_COMPONENTS=y -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/nxp/mr-canhubk3/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="s32k3xx" -CONFIG_ARCH_CHIP_S32K344=y -CONFIG_ARCH_CHIP_S32K3XX=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DCACHE_WRITETHROUGH=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=14539 -CONFIG_BUILTIN=y -CONFIG_DEBUG_BUSFAULT=y -CONFIG_DEBUG_ERROR=y -CONFIG_DEBUG_FEATURES=y -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_ETH0_PHY_TJA1103=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS26_SPI_FREQUENCY=5000000 -CONFIG_FSUTILS_IPCFG=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_LITTLEFS=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=900 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_IOB_NBUFFERS=24 -CONFIG_IOB_THROTTLE=0 -CONFIG_IPCFG_BINARY=y -CONFIG_IPCFG_CHARDEV=y -CONFIG_IPCFG_PATH="/mnt/qspi/mtd_net" -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_LPI2C0_DMA=y -CONFIG_LPI2C1_DMA=y -CONFIG_LPUART0_IFLOWCONTROL=y -CONFIG_LPUART0_OFLOWCONTROL=y -CONFIG_LPUART0_RXBUFSIZE=640 -CONFIG_LPUART0_RXDMA=y -CONFIG_LPUART0_TXDMA=y -CONFIG_LPUART13_RXDMA=y -CONFIG_LPUART13_TXDMA=y -CONFIG_LPUART14_RXDMA=y -CONFIG_LPUART14_TXDMA=y -CONFIG_LPUART1_RXDMA=y -CONFIG_LPUART1_TXDMA=y -CONFIG_LPUART2_RXDMA=y -CONFIG_LPUART2_SERIAL_CONSOLE=y -CONFIG_LPUART2_TXDMA=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SPICLOCK=7500000 -CONFIG_MM_REGIONS=2 -CONFIG_MTD=y -CONFIG_MTD_MX25RXX=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_PARTITION_NAMES=y -CONFIG_MTD_PROGMEM=y -CONFIG_MX25RXX_LXX=y -CONFIG_MX25RXX_PAGE128=y -CONFIG_MX25RXX_QSPI_FREQUENCY=80000000 -CONFIG_NET=y -CONFIG_NETDB_DNSCLIENT=y -CONFIG_NETDB_DNSCLIENT_ENTRIES=8 -CONFIG_NETDB_DNSSERVER_NOADDR=y -CONFIG_NETDEV_CAN_BITRATE_IOCTL=y -CONFIG_NETDEV_LATEINIT=y -CONFIG_NETDEV_PHY_IOCTL=y -CONFIG_NETINIT_DHCPC=y -CONFIG_NETINIT_DNS=y -CONFIG_NETINIT_DNSIPADDR=0XC0A800FE -CONFIG_NETINIT_DRIPADDR=0XC0A800FE -CONFIG_NETINIT_MONITOR=y -CONFIG_NETINIT_THREAD=y -CONFIG_NETINIT_THREAD_PRIORITY=49 -CONFIG_NETUTILS_TELNETD=y -CONFIG_NET_ARP_IPIN=y -CONFIG_NET_ARP_SEND=y -CONFIG_NET_BROADCAST=y -CONFIG_NET_CAN=y -CONFIG_NET_CAN_EXTID=y -CONFIG_NET_CAN_NOTIFIER=y -CONFIG_NET_CAN_RAW_FILTER_MAX=1 -CONFIG_NET_CAN_RAW_TX_DEADLINE=y -CONFIG_NET_CAN_SOCK_OPTS=y -CONFIG_NET_ETH_PKTSIZE=1518 -CONFIG_NET_ICMP=y -CONFIG_NET_ICMP_SOCKET=y -CONFIG_NET_NACTIVESOCKETS=16 -CONFIG_NET_SOLINGER=y -CONFIG_NET_TCP=y -CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_DELAYED_ACK=y -CONFIG_NET_TCP_WRITE_BUFFERS=y -CONFIG_NET_TIMESTAMP=y -CONFIG_NET_UDP=y -CONFIG_NET_UDP_CHECKSUMS=y -CONFIG_NET_UDP_WRITE_BUFFERS=y -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_MMCSDSPIPORTNO=1 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_TELNET=y -CONFIG_NSH_TELNET_LOGIN=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=272000 -CONFIG_RAM_START=0x20400000 -CONFIG_RAW_BINARY=y -CONFIG_S32K3XX_DTCM_HEAP=y -CONFIG_S32K3XX_EDMA=y -CONFIG_S32K3XX_EDMA_EDBG=y -CONFIG_S32K3XX_EDMA_NTCD=64 -CONFIG_S32K3XX_EIRQINTS=y -CONFIG_S32K3XX_ENET=y -CONFIG_S32K3XX_ENET_NTXBUFFERS=4 -CONFIG_S32K3XX_FLEXCAN0=y -CONFIG_S32K3XX_FLEXCAN1=y -CONFIG_S32K3XX_FLEXCAN2=y -CONFIG_S32K3XX_FLEXCAN3=y -CONFIG_S32K3XX_FS26=y -CONFIG_S32K3XX_GPIOIRQ=y -CONFIG_S32K3XX_LPI2C0=y -CONFIG_S32K3XX_LPI2C1=y -CONFIG_S32K3XX_LPI2C_DMA=y -CONFIG_S32K3XX_LPSPI1=y -CONFIG_S32K3XX_LPSPI1_PINCFG=3 -CONFIG_S32K3XX_LPSPI2=y -CONFIG_S32K3XX_LPSPI2_DMA=y -CONFIG_S32K3XX_LPSPI2_PINCFG=3 -CONFIG_S32K3XX_LPSPI3=y -CONFIG_S32K3XX_LPSPI3_PINCFG=3 -CONFIG_S32K3XX_LPSPI4=y -CONFIG_S32K3XX_LPSPI4_DMA=y -CONFIG_S32K3XX_LPSPI4_PINCFG=3 -CONFIG_S32K3XX_LPSPI5=y -CONFIG_S32K3XX_LPSPI5_DMA=y -CONFIG_S32K3XX_LPSPI5_PINCFG=3 -CONFIG_S32K3XX_LPSPI_DMA=y -CONFIG_S32K3XX_LPUART0=y -CONFIG_S32K3XX_LPUART10=y -CONFIG_S32K3XX_LPUART13=y -CONFIG_S32K3XX_LPUART14=y -CONFIG_S32K3XX_LPUART1=y -CONFIG_S32K3XX_LPUART2=y -CONFIG_S32K3XX_LPUART4=y -CONFIG_S32K3XX_LPUART7=y -CONFIG_S32K3XX_LPUART9=y -CONFIG_S32K3XX_LPUART_INVERT=y -CONFIG_S32K3XX_LPUART_SINGLEWIRE=y -CONFIG_S32K3XX_PROGMEM=y -CONFIG_S32K3XX_PROGMEM_SIZE=120 -CONFIG_S32K3XX_QSPI=y -CONFIG_S32K3XX_WKPUINTS=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1768 -CONFIG_SCHED_WAITPID=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_SYSTEM_DHCPC_RENEW=y -CONFIG_SYSTEM_NSH=y -CONFIG_SYSTEM_PING=y -CONFIG_TASK_NAME_SIZE=24 diff --git a/boards/nxp/mr-canhubk3/nuttx-config/scripts/script.ld b/boards/nxp/mr-canhubk3/nuttx-config/scripts/script.ld deleted file mode 100644 index 79a40f6..0000000 --- a/boards/nxp/mr-canhubk3/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,162 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k3xx/mr-canhubk3/scripts/flash.ld - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/* Copyright 2022 NXP */ - -/* TO DO: ADD DESCRIPTION - * - * 0x00400000 - 0x007fffff 4194304 Program Flash (last 64K sBAF) - * 0x10000000 - 0x1003ffff 262144 Data Flash (last 32K HSE_NVM) - * 0x20400000 - 0x20408000 32768 Standby RAM_0 (32K) - * 0x20400000 - 0x20427fff 163840 SRAM_0 - * 0x20428000 - 0x2044ffff 163840 SRAM_1 - * - * Last 48 KB of SRAM_1 reserved by HSE Firmware - * Last 128 KB of CODE_FLASH_3 reserved by HSE Firmware - * Last 128 KB of DATA_FLASH reserved by HSE Firmware (not supported in this linker file) - * - * Note Standby RAM and SRAM overlaps in NuttX since we dont use the Standby functionality - * - */ - -MEMORY -{ - BOOT_HEADER (R) : ORIGIN = 0x00400000, LENGTH = 0x00001000 /* 0x00400000 - 0x00400fff */ - flash (rx) : ORIGIN = 0x00401000, LENGTH = 0x003cffff /* 0x00401000 - (0x007fffff - 0x20000 (128 KB) = 0x007dffff) */ - sram0_stdby (rwx) : ORIGIN = 0x20400000, LENGTH = 32K - sram (rwx) : ORIGIN = 0x20400000, LENGTH = 272K - itcm (rwx) : ORIGIN = 0x00000000, LENGTH = 64K - dtcm (rwx) : ORIGIN = 0x20000000, LENGTH = 128K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -EXTERN(boot_header) -ENTRY(_stext) - -SECTIONS -{ - - .boot_header : - { - KEEP(*(.boot_header)) - } > BOOT_HEADER - - .text : - { - _stext = ABSOLUTE(.); - *(.vectors) - *(.text.__start) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - } > flash - - .init_section : - { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - .ARM.extab : - { - *(.ARM.extab*) - } >flash - - .ARM.exidx : - { - __exidx_start = ABSOLUTE(.); - *(.ARM.exidx*) - __exidx_end = ABSOLUTE(.); - } >flash - - /* Due ECC initialization sequence __data_start__ and __data_end__ should be aligned on 8 bytes */ - .data : - { - . = ALIGN(8); - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - . = ALIGN(8); - _edata = ABSOLUTE(.); - } > sram AT > flash - - _eronly = LOADADDR(.data); - - .ramfunc ALIGN(8): - { - _sramfuncs = ABSOLUTE(.); - *(.ramfunc .ramfunc.*) - _eramfuncs = ABSOLUTE(.); - } > sram AT > flash - - _framfuncs = LOADADDR(.ramfunc); - - /* Due ECC initialization sequence __bss_start__ and __bss_end__ should be aligned on 8 bytes */ - .bss : - { - . = ALIGN(8); - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(8); - _ebss = ABSOLUTE(.); - } > sram - - CM7_0_START_ADDRESS = ORIGIN(flash); - - /* Stabs debugging sections. */ - - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } - - SRAM_BASE_ADDR = ORIGIN(sram); - SRAM_END_ADDR = ORIGIN(sram) + LENGTH(sram); - SRAM_STDBY_BASE_ADDR = ORIGIN(sram0_stdby); - SRAM_STDBY_END_ADDR = ORIGIN(sram0_stdby) + LENGTH(sram0_stdby); - SRAM_INIT_END_ADDR = ORIGIN(sram) + 320K; - ITCM_BASE_ADDR = ORIGIN(itcm); - ITCM_END_ADDR = ORIGIN(itcm) + LENGTH(itcm); - DTCM_BASE_ADDR = ORIGIN(dtcm); - DTCM_END_ADDR = ORIGIN(dtcm) + LENGTH(dtcm); - FLASH_BASE_ADDR = ORIGIN(BOOT_HEADER); - FLASH_END_ADDR = ORIGIN(flash) + LENGTH(flash); -} diff --git a/boards/nxp/mr-canhubk3/nuttx-config/sysview/defconfig b/boards/nxp/mr-canhubk3/nuttx-config/sysview/defconfig deleted file mode 100644 index 32169a8..0000000 --- a/boards/nxp/mr-canhubk3/nuttx-config/sysview/defconfig +++ /dev/null @@ -1,287 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_ARP is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_IFCONFIG is not set -# CONFIG_NSH_DISABLE_IFUPDOWN is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_NSLOOKUP is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TELNETD is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_SPI_CALLBACK is not set -CONFIG_ALLOW_GPL_COMPONENTS=y -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/nxp/mr-canhubk3/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="s32k3xx" -CONFIG_ARCH_CHIP_S32K344=y -CONFIG_ARCH_CHIP_S32K3XX=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DCACHE_WRITETHROUGH=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=14539 -CONFIG_BUILTIN=y -CONFIG_DEBUG_BUSFAULT=y -CONFIG_DEBUG_ERROR=y -CONFIG_DEBUG_FEATURES=y -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_DRIVER_NOTE=y -CONFIG_ETH0_PHY_TJA1103=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS26_SPI_FREQUENCY=5000000 -CONFIG_FSUTILS_IPCFG=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_LITTLEFS=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=900 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_IOB_NBUFFERS=24 -CONFIG_IOB_THROTTLE=0 -CONFIG_IPCFG_BINARY=y -CONFIG_IPCFG_CHARDEV=y -CONFIG_IPCFG_PATH="/mnt/qspi/mtd_net" -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_LPI2C0_DMA=y -CONFIG_LPI2C1_DMA=y -CONFIG_LPUART0_IFLOWCONTROL=y -CONFIG_LPUART0_OFLOWCONTROL=y -CONFIG_LPUART0_RXBUFSIZE=640 -CONFIG_LPUART0_RXDMA=y -CONFIG_LPUART0_TXDMA=y -CONFIG_LPUART13_RXDMA=y -CONFIG_LPUART13_TXDMA=y -CONFIG_LPUART14_RXDMA=y -CONFIG_LPUART14_TXDMA=y -CONFIG_LPUART1_RXDMA=y -CONFIG_LPUART1_TXDMA=y -CONFIG_LPUART2_RXDMA=y -CONFIG_LPUART2_SERIAL_CONSOLE=y -CONFIG_LPUART2_TXDMA=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SPICLOCK=7500000 -CONFIG_MM_REGIONS=2 -CONFIG_MTD=y -CONFIG_MTD_MX25RXX=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_PARTITION_NAMES=y -CONFIG_MTD_PROGMEM=y -CONFIG_MX25RXX_LXX=y -CONFIG_MX25RXX_PAGE128=y -CONFIG_MX25RXX_QSPI_FREQUENCY=80000000 -CONFIG_NET=y -CONFIG_NETDB_DNSCLIENT=y -CONFIG_NETDB_DNSCLIENT_ENTRIES=8 -CONFIG_NETDB_DNSSERVER_NOADDR=y -CONFIG_NETDEV_CAN_BITRATE_IOCTL=y -CONFIG_NETDEV_LATEINIT=y -CONFIG_NETDEV_PHY_IOCTL=y -CONFIG_NETINIT_DHCPC=y -CONFIG_NETINIT_DNS=y -CONFIG_NETINIT_DNSIPADDR=0XC0A800FE -CONFIG_NETINIT_DRIPADDR=0XC0A800FE -CONFIG_NETINIT_MONITOR=y -CONFIG_NETINIT_THREAD=y -CONFIG_NETINIT_THREAD_PRIORITY=49 -CONFIG_NETUTILS_TELNETD=y -CONFIG_NET_ARP_IPIN=y -CONFIG_NET_ARP_SEND=y -CONFIG_NET_BROADCAST=y -CONFIG_NET_CAN=y -CONFIG_NET_CAN_EXTID=y -CONFIG_NET_CAN_NOTIFIER=y -CONFIG_NET_CAN_RAW_FILTER_MAX=1 -CONFIG_NET_CAN_RAW_TX_DEADLINE=y -CONFIG_NET_CAN_SOCK_OPTS=y -CONFIG_NET_ETH_PKTSIZE=1518 -CONFIG_NET_ICMP=y -CONFIG_NET_ICMP_SOCKET=y -CONFIG_NET_NACTIVESOCKETS=16 -CONFIG_NET_SOLINGER=y -CONFIG_NET_TCP=y -CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_DELAYED_ACK=y -CONFIG_NET_TCP_WRITE_BUFFERS=y -CONFIG_NET_TIMESTAMP=y -CONFIG_NET_UDP=y -CONFIG_NET_UDP_CHECKSUMS=y -CONFIG_NET_UDP_WRITE_BUFFERS=y -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_MMCSDSPIPORTNO=1 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_TELNET=y -CONFIG_NSH_TELNET_LOGIN=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=272000 -CONFIG_RAM_START=0x20400000 -CONFIG_RAW_BINARY=y -CONFIG_S32K3XX_DTCM_HEAP=y -CONFIG_S32K3XX_EDMA=y -CONFIG_S32K3XX_EDMA_EDBG=y -CONFIG_S32K3XX_EDMA_NTCD=64 -CONFIG_S32K3XX_EIRQINTS=y -CONFIG_S32K3XX_ENET=y -CONFIG_S32K3XX_ENET_NTXBUFFERS=4 -CONFIG_S32K3XX_FLEXCAN0=y -CONFIG_S32K3XX_FLEXCAN1=y -CONFIG_S32K3XX_FLEXCAN2=y -CONFIG_S32K3XX_FLEXCAN3=y -CONFIG_S32K3XX_FS26=y -CONFIG_S32K3XX_GPIOIRQ=y -CONFIG_S32K3XX_LPI2C0=y -CONFIG_S32K3XX_LPI2C1=y -CONFIG_S32K3XX_LPI2C_DMA=y -CONFIG_S32K3XX_LPSPI1=y -CONFIG_S32K3XX_LPSPI1_PINCFG=3 -CONFIG_S32K3XX_LPSPI2=y -CONFIG_S32K3XX_LPSPI2_DMA=y -CONFIG_S32K3XX_LPSPI2_PINCFG=3 -CONFIG_S32K3XX_LPSPI3=y -CONFIG_S32K3XX_LPSPI3_PINCFG=3 -CONFIG_S32K3XX_LPSPI4=y -CONFIG_S32K3XX_LPSPI4_DMA=y -CONFIG_S32K3XX_LPSPI4_PINCFG=3 -CONFIG_S32K3XX_LPSPI5=y -CONFIG_S32K3XX_LPSPI5_DMA=y -CONFIG_S32K3XX_LPSPI5_PINCFG=3 -CONFIG_S32K3XX_LPSPI_DMA=y -CONFIG_S32K3XX_LPUART0=y -CONFIG_S32K3XX_LPUART10=y -CONFIG_S32K3XX_LPUART13=y -CONFIG_S32K3XX_LPUART14=y -CONFIG_S32K3XX_LPUART1=y -CONFIG_S32K3XX_LPUART2=y -CONFIG_S32K3XX_LPUART9=y -CONFIG_S32K3XX_LPUART_INVERT=y -CONFIG_S32K3XX_LPUART_SINGLEWIRE=y -CONFIG_S32K3XX_PROGMEM=y -CONFIG_S32K3XX_PROGMEM_SIZE=120 -CONFIG_S32K3XX_QSPI=y -CONFIG_S32K3XX_WKPUINTS=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_FILTER=y -CONFIG_SCHED_INSTRUMENTATION_FILTER_DEFAULT_MODE=0x0B -CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1768 -CONFIG_SCHED_WAITPID=y -CONFIG_SEGGER_RTT_MAX_NUM_UP_BUFFERS=12 -CONFIG_SEGGER_SYSVIEW=y -CONFIG_SEGGER_SYSVIEW_PREFIX=y -CONFIG_SEGGER_SYSVIEW_RTT_BUFFER_SIZE=4096 -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_SYSTEM_DHCPC_RENEW=y -CONFIG_SYSTEM_NSH=y -CONFIG_SYSTEM_PING=y -CONFIG_TASK_NAME_SIZE=24 diff --git a/boards/nxp/mr-canhubk3/src/CMakeLists.txt b/boards/nxp/mr-canhubk3/src/CMakeLists.txt deleted file mode 100644 index 26a1327..0000000 --- a/boards/nxp/mr-canhubk3/src/CMakeLists.txt +++ /dev/null @@ -1,81 +0,0 @@ -############################################################################ -# -# Copyright (c) 2016, 2018 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. -# -############################################################################ -if("${PX4_BOARD_LABEL}" STREQUAL "canbootloader") - - add_library(drivers_board - can_boot.c - led.cpp - clockconfig.c - periphclocks.c - timer_config.cpp - hw_rev_ver_canhubk3.c - ) - - target_link_libraries(drivers_board - PRIVATE - nuttx_arch - nuttx_drivers - canbootloader - arch_io_pins - arch_led_pwm - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/canbootloader) - -else() - - add_library(drivers_board - s32k3xx_autoleds.c - s32k3xx_boot.c - s32k3xx_bringup.c - s32k3xx_buttons.c - s32k3xx_clockconfig.c - i2c.cpp - init.c - mtd.cpp - s32k3xx_periphclocks.c - spi.cpp - timer_config.cpp - s32k3xx_userleds.c - hw_rev_ver_canhubk3.c - manifest.c - ) - - target_link_libraries(drivers_board - PRIVATE - nuttx_arch # sdio - nuttx_drivers # sdio - drivers__led # drv_led_start - px4_layer - arch_io_pins - ) -endif() diff --git a/boards/nxp/mr-canhubk3/src/board_config.h b/boards/nxp/mr-canhubk3/src/board_config.h deleted file mode 100644 index 7ea2a91..0000000 --- a/boards/nxp/mr-canhubk3/src/board_config.h +++ /dev/null @@ -1,248 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k3xx/mr-canhubk3/src/board_config.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/* Copyright 2022 NXP */ - -#pragma once - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include - -#include - -__BEGIN_DECLS - -#include "hardware/s32k344_pinmux.h" -#include "s32k3xx_periphclocks.h" -#include "s32k3xx_pin.h" -#include "s32k3xx_progmem.h" -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Configuration ************************************************************/ - -#define HRT_TIMER 1 /* FIXME */ - -/* MR-CANHUBK3 GPIOs ********************************************************/ - -/* LEDs. The MR-CANHUBK3 has one RGB LED: - * - * RedLED PTE14 (FXIO D7 / EMIOS0 CH19) - * GreenLED PTA27 (FXIO D5 / EMIOS1 CH10 / EMIOS2 CH10) - * BlueLED PTE12 (FXIO D8 / EMIOS1 CH5) - * - * An output of '0' illuminates the LED. - */ - -#define GPIO_LED_R (PIN_EMIOS0_CH19_4) -#define GPIO_LED_G (PIN_EMIOS1_CH10_1) -#define GPIO_LED_B (PIN_EMIOS1_CH5_3) - -/* Buttons. The MR-CANHUBK3 supports two buttons: - * - * SW1 PTD15 (EIRQ31) - * SW2 PTA25 (EIRQ5 / WKPU34) - */ - -#define GPIO_SW1 (PIN_EIRQ31_2 | PIN_INT_BOTH) /* PTD15 */ -#define GPIO_SW2 (PIN_EIRQ5_2 | PIN_INT_BOTH) /* PTA25 */ - -/* - * I2C busses - */ -#define PX4_I2C_BUS_ONBOARD_HZ 400000 -#define PX4_I2C_BUS_EXPANSION_HZ 400000 - -#define PX4_I2C_BUS_MTD 1 - -#define BOARD_NUMBER_I2C_BUSES 2 - -/* Timer I/O PWM and capture */ - -#define DIRECT_PWM_OUTPUT_CHANNELS 8 - -#define RC_SERIAL_PORT "/dev/ttyS5" -#define RC_SERIAL_SINGLEWIRE_FORCE -#define RC_SERIAL_INVERT_RX_ONLY - -#define BOARD_ENABLE_CONSOLE_BUFFER - -/* - * Hardfault log to progmem - */ -#define PROGMEM_CRASHDUMP 1 -#define SAVE_CRASHDUMP 1 -#define PROGMEM_DUMP_BASE ((CONFIG_S32K3XX_PROGMEM_SIZE * 1024) + S32K3XX_PROGMEM_START_ADDR) -#define PROGMEM_DUMP_SIZE ((DFLASH_SIZE - CONFIG_S32K3XX_PROGMEM_SIZE) * 1024) -#define PROGMEM_DUMP_ALIGNMENT (S32K3XX_PROGMEM_WRITE_SIZE) -#define PROGMEM_DUMP_UNIT_SIZE (S32K3XX_PROGMEM_DFLASH_WRITE_UNIT_SIZE) -#define PROGMEM_DUMP_HEADER_PAD (108) -#define PROGMEM_DUMP_ERASE_VALUE (0xFF) -#define PROGMEM_DUMP_STACK_SIZE (6656) -#define BOARD_CRASHDUMP_BSS 1 - -/* Reboot and ulog we store on a wear-level filesystem */ -#define HARDFAULT_REBOOT_PATH "/mnt/progmem/reboot" - -/* To detect MR-CANHUBK3-ADAP board */ -#define BOARD_HAS_HW_VERSIONING 1 -#define CANHUBK3_ADAP_DETECT (PIN_PTA12 | GPIO_INPUT | GPIO_PULLUP) - - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that can be used by the Px4 - * Firmware in the adc driver. ADC1 has 32 channels, with some a/b selection overlap - * in the AD4-AD7 range on the same ADC. - * - * Only ADC1 is used - * Bits 31:0 are ADC1 channels 31:0 - */ - -#define ADC1_CH(c) (((c) & 0x1f)) /* Define ADC number Channel number */ - -/* ADC defines to be used in sensors.cpp to read from a particular channel */ - -#define ADC_BATTERY_VOLTAGE_CHANNEL ADC1_CH(0) /* BAT_VSENS 85 PTB4 ADC1_SE10 */ -#define ADC_BATTERY_CURRENT_CHANNEL ADC1_CH(1) /* Non-existant but needed for compilation */ - - -/* Mask use to initialize the ADC driver */ - -#define ADC_CHANNELS ((1 << ADC_BATTERY_VOLTAGE_CHANNEL)) - -/* Safety Switch - * TBD - */ -#define GPIO_LED_SAFETY (PIN_PTE26 | GPIO_OUTPUT | GPIO_OUTPUT_ZERO) -#define GPIO_BTN_SAFETY (PIN_PTA11 | GPIO_INPUT | GPIO_PULLDOWN) - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -#ifndef __ASSEMBLY__ - -/* User peripheral configuration structure 0 */ - -extern const struct peripheral_clock_config_s g_peripheral_clockconfig0[]; - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - - -/************************************************************************************ - * Name: s32k3xx_spidev_initialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the NXP MR-CANHUB board. - * - ************************************************************************************/ - -void s32k3xx_spidev_initialize(void); - -/************************************************************************************ - * Name: s32k3xx_spi_bus_initialize - * - * Description: - * Called to configure SPI Buses. - * - ************************************************************************************/ - -int s32k3xx_spi_bus_initialize(void); - - -/**************************************************************************** - * Name: s32k3xx_bringup - * - * Description: - * Perform architecture-specific initialization - * - * CONFIG_BOARD_LATE_INITIALIZE=y : - * Called from board_late_initialize(). - * - * CONFIG_BOARD_LATE_INITIALIZE=y && CONFIG_BOARDCTL=y : - * Called from the NSH library - * - ****************************************************************************/ - -int s32k3xx_bringup(void); - -/**************************************************************************** - * Name: s32k3xx_i2cdev_initialize - * - * Description: - * Initialize I2C driver and register /dev/i2cN devices. - * - ****************************************************************************/ - -int s32k3xx_i2cdev_initialize(void); - -/**************************************************************************** - * Name: s32k3xx_spidev_initialize - * - * Description: - * Configure chip select pins, initialize the SPI driver and register - * /dev/spiN devices. - * - ****************************************************************************/ - -void s32k3xx_spidev_initialize(void); - -/**************************************************************************** - * Name: s32k3xx_tja1153_initialize - * - * Description: - * Initialize a TJA1153 CAN PHY connected to a FlexCAN peripheral (0-5) - * - ****************************************************************************/ - -int s32k3xx_tja1153_initialize(int bus); - -/**************************************************************************** - * Name: s32k3xx_selftest - * - * Description: - * Runs basic routines to verify that all board components are up and - * running. Results are send to the syslog, it is recommended to - * enable all output levels (error, warning and info). - * - ****************************************************************************/ - -void s32k3xx_selftest(void); - -extern void board_peripheral_reset(int ms); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/nxp/mr-canhubk3/src/hw_rev_ver_canhubk3.c b/boards/nxp/mr-canhubk3/src/hw_rev_ver_canhubk3.c deleted file mode 100644 index 990c174..0000000 --- a/boards/nxp/mr-canhubk3/src/hw_rev_ver_canhubk3.c +++ /dev/null @@ -1,142 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2023 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. - * - ****************************************************************************/ - -/** - * @file hw_rev_ver_canhubk3.c - * CANHUBK3 Hardware Revision and Version ID API - */ -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(BOARD_HAS_HW_VERSIONING) - - -#define HW_INFO_SIZE HW_INFO_VER_DIGITS + HW_INFO_REV_DIGITS - - -/**************************************************************************** - * Private Data - ****************************************************************************/ -static int is_adap_connected = 0; - -/**************************************************************************** - * Public Functions - ****************************************************************************/ -/************************************************************************************ - * Name: board_get_hw_type - * - * Description: - * Optional returns a 0 terminated string defining the HW type. - * - * Input Parameters: - * None - * - * Returned Value: - * a 0 terminated string defining the HW type. This my be a 0 length string "" - * - ************************************************************************************/ - -__EXPORT const char *board_get_hw_type_name() -{ - if (is_adap_connected) { - return (const char *)"MR-CANHUBK3-ADAP"; - - } else { - return (const char *)"MR-CANHUBK344"; - } -} - -/************************************************************************************ - * Name: board_get_hw_version - * - * Description: - * Optional returns a integer HW version - * - * Input Parameters: - * None - * - * Returned Value: - * An integer value of this boards hardware version. - * A value of -1 is the default for boards not supporting the BOARD_HAS_VERSIONING API. - * A value of 0 is the default for boards supporting the API but not having version. - * - ************************************************************************************/ - -__EXPORT int board_get_hw_version() -{ - return 0; -} - -/************************************************************************************ - * Name: board_get_hw_revision - * - * Description: - * Optional returns a integer HW revision - * - * Input Parameters: - * None - * - * Returned Value: - * An integer value of this boards hardware revision. - * A value of -1 is the default for boards not supporting the BOARD_HAS_VERSIONING API. - * A value of 0 is the default for boards supporting the API but not having revision. - * - ************************************************************************************/ - -__EXPORT int board_get_hw_revision() -{ - return 0; -} - -/************************************************************************************ - * Name: board_determine_hw_info - * - * Description: - * Uses GPIO to detect MR-CANHUBK3-ADAP - * - ************************************************************************************/ - -int board_determine_hw_info() -{ - s32k3xx_pinconfig(CANHUBK3_ADAP_DETECT); - is_adap_connected = !s32k3xx_gpioread(CANHUBK3_ADAP_DETECT); - return 0; -} -#endif diff --git a/boards/nxp/mr-canhubk3/src/i2c.cpp b/boards/nxp/mr-canhubk3/src/i2c.cpp deleted file mode 100644 index c99547d..0000000 --- a/boards/nxp/mr-canhubk3/src/i2c.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(PX4_BUS_NUMBER_TO_PX4(0)), - initI2CBusInternal(PX4_BUS_NUMBER_TO_PX4(1)), -}; diff --git a/boards/nxp/mr-canhubk3/src/init.c b/boards/nxp/mr-canhubk3/src/init.c deleted file mode 100644 index 97a41f8..0000000 --- a/boards/nxp/mr-canhubk3/src/init.c +++ /dev/null @@ -1,166 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k1xx/ucans32k146/src/s32k1xx_appinit.c - * - * Copyright (C) 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include - -#include "board_config.h" - -#include -#include - -#if defined(CONFIG_S32K3XX_LPSPI1) && defined(CONFIG_MMCSD) -#include -#endif - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef OK -# define OK 0 -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initialization logic and the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -__EXPORT int board_app_initialize(uintptr_t arg) -{ -#ifdef CONFIG_BOARD_LATE_INITIALIZE - /* Board initialization already performed by board_late_initialize() */ - - return OK; -#else - - int rv; - - board_determine_hw_info(); - - -#if defined(CONFIG_S32K3XX_LPSPI1) && defined(CONFIG_MMCSD) - /* LPSPI1 *****************************************************************/ - - /* Configure LPSPI1 peripheral chip select */ - - s32k3xx_pinconfig(PIN_LPSPI2_PCS); - - /* Initialize the SPI driver for LPSPI1 */ - - struct spi_dev_s *g_lpspi2 = s32k3xx_lpspibus_initialize(2); - - if (g_lpspi2 == NULL) { - spierr("ERROR: FAILED to initialize LPSPI2\n"); - return -ENODEV; - } - - rv = mmcsd_spislotinitialize(0, 0, g_lpspi2); - - if (rv < 0) { - mcerr("ERROR: Failed to bind SPI port %d to SD slot %d\n", - 1, 0); - return rv; - } - -#endif - - px4_platform_init(); - - /* Perform board-specific initialization */ - - rv = s32k3xx_bringup(); - - /* Configure SPI-based devices */ - -#ifdef CONFIG_SPI - s32k3xx_spi_bus_initialize(); -#endif - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return rv; -#endif -} - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - /* set the peripheral rails off */ - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ -} diff --git a/boards/nxp/mr-canhubk3/src/manifest.c b/boards/nxp/mr-canhubk3/src/manifest.c deleted file mode 100644 index afd3de5..0000000 --- a/boards/nxp/mr-canhubk3/src/manifest.c +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2023 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. - * - ****************************************************************************/ - -/** - * @file manifest.c - * - * This module supplies the interface to the manifest of hardware that is - * optional and dependent on the HW REV and HW VER IDs - * - * The manifest allows the system to know whether a hardware option - * say for example the PX4IO is an no-pop option vs it is broken. - * - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include - -#include "systemlib/px4_macros.h" -#include "px4_log.h" - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - - -/************************************************************************************ - * Name: board_query_manifest - * - * Description: - * Optional returns manifest item. - * - * Input Parameters: - * manifest_id - the ID for the manifest item to retrieve - * - * Returned Value: - * 0 - item is not in manifest => assume legacy operations - * pointer to a manifest item - * - ************************************************************************************/ - -__EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) -{ - return px4_hw_mft_unsupported; -} diff --git a/boards/nxp/mr-canhubk3/src/mtd.cpp b/boards/nxp/mr-canhubk3/src/mtd.cpp deleted file mode 100644 index 588a882..0000000 --- a/boards/nxp/mr-canhubk3/src/mtd.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 -#include -// KiB BS nB -static const px4_mft_device_t qspi_flash = { // 8MB QSPI flash with NXFFS - .bus_type = px4_mft_device_t::ONCHIP, -}; - -static const px4_mft_device_t i2c0 = { // 24LC64T on IMU 8K 32 X 256 - .bus_type = px4_mft_device_t::I2C, - .devid = PX4_MK_I2C_DEVID(1, 0x50) -}; - - -static const px4_mtd_entry_t fmum_qspi_flash = { - .device = &qspi_flash, - .npart = 1, - .partd = { - { - .type = MTD_PARAMETERS, - .path = "/mnt/qspi/params", - .nblocks = 1 - } - }, -}; - -static const px4_mtd_entry_t imu_eeprom = { - .device = &i2c0, - .npart = 2, - .partd = { - { - .type = MTD_CALDATA, - .path = "/fs/mtd_caldata", - .nblocks = 248 - }, - { - .type = MTD_ID, - .path = "/fs/mtd_id", - .nblocks = 8 // 256 = 32 * 8 - } - }, -}; - - -static const px4_mtd_manifest_t board_mtd_config = { - .nconfigs = 2, - .entries = { - &imu_eeprom, - &fmum_qspi_flash - } -}; - -static const px4_mft_entry_s mtd_mft = { - .type = MTD, - .pmft = (void *) &board_mtd_config, -}; - -static const px4_mft_s mft = { - .nmft = 1, - .mfts = { - &mtd_mft - } -}; - -const px4_mft_s *board_get_manifest(void) -{ - return &mft; -} diff --git a/boards/nxp/mr-canhubk3/src/s32k3xx_appinit.c b/boards/nxp/mr-canhubk3/src/s32k3xx_appinit.c deleted file mode 100644 index 7fb3f67..0000000 --- a/boards/nxp/mr-canhubk3/src/s32k3xx_appinit.c +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k3xx/mr-canhubk3/src/s32k3xx_appinit.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/* Copyright 2022 NXP */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include - -#include "board_config.h" - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no meaning - * to NuttX; the meaning of the argument is a contract between the - * board-specific initialization logic and the matching application - * logic. The value could be such things as a mode enumeration - * value, a set of DIP switch settings, a pointer to configuration - * data read from a file or serial FLASH, or whatever you would like - * to do with it. Every implementation should accept zero/NULL as a - * default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -int board_app_initialize(uintptr_t arg) -{ -#ifdef CONFIG_BOARD_LATE_INITIALIZE - /* Board initialization already performed by board_late_initialize() */ - - return OK; -#else - /* Perform board-specific initialization */ - - return s32k3xx_bringup(); -#endif -} diff --git a/boards/nxp/mr-canhubk3/src/s32k3xx_autoleds.c b/boards/nxp/mr-canhubk3/src/s32k3xx_autoleds.c deleted file mode 100644 index 4c96fd2..0000000 --- a/boards/nxp/mr-canhubk3/src/s32k3xx_autoleds.c +++ /dev/null @@ -1,147 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k3xx/mr-canhubk3/src/s32k3xx_autoleds.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/* Copyright 2022 NXP */ - -/* The MR-CANHUBK3 has one RGB LED: - * - * RedLED PTE14 (FXIO D7 / EMIOS0 CH19) - * GreenLED PTA27 (FXIO D5 / EMIOS1 CH10 / EMIOS2 CH10) - * BlueLED PTE12 (FXIO D8 / EMIOS1 CH5) - * - * An output of '0' illuminates the LED. - * - * If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board - * the MR-CANHUBK3. The following definitions describe how NuttX controls - * the LEDs: - * - * SYMBOL Meaning LED state - * RED GREEN BLUE - * ---------------- ------------------------ -------------------- - * LED_STARTED NuttX has been started OFF OFF OFF - * LED_HEAPALLOCATE Heap has been allocated OFF OFF ON - * LED_IRQSENABLED Interrupts enabled OFF OFF ON - * LED_STACKCREATED Idle stack created OFF ON OFF - * LED_INIRQ In an interrupt (No change) - * LED_SIGNAL In a signal handler (No change) - * LED_ASSERTION An assertion failed (No change) - * LED_PANIC The system has crashed FLASH OFF OFF - * LED_IDLE S32K344 is in sleep mode (Optional, not used) - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include - -#include - -#include "s32k3xx_pin.h" - -#include "board_config.h" - -#ifdef CONFIG_ARCH_LEDS - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Summary of all possible settings */ - -#define LED_NOCHANGE 0 /* LED_IRQSENABLED, LED_INIRQ, LED_SIGNAL, LED_ASSERTION */ -#define LED_OFF_OFF_OFF 1 /* LED_STARTED */ -#define LED_OFF_OFF_ON 2 /* LED_HEAPALLOCATE */ -#define LED_OFF_ON_OFF 3 /* LED_STACKCREATED */ -#define LED_ON_OFF_OFF 4 /* LED_PANIC */ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_autoled_initialize - ****************************************************************************/ - -void board_autoled_initialize(void) -{ - /* Configure LED GPIOs for output */ - - s32k3xx_pinconfig(GPIO_LED_R); - s32k3xx_pinconfig(GPIO_LED_G); - s32k3xx_pinconfig(GPIO_LED_B); -} - -/**************************************************************************** - * Name: board_autoled_on - ****************************************************************************/ - -void board_autoled_on(int led) -{ - if (led != LED_NOCHANGE) { - bool redon = false; - bool greenon = false; - bool blueon = false; - - switch (led) { - default: - case LED_OFF_OFF_OFF: - break; - - case LED_OFF_OFF_ON: - blueon = true; - break; - - case LED_OFF_ON_OFF: - greenon = true; - break; - - case LED_ON_OFF_OFF: - redon = true; - break; - } - - /* Invert output, an output of '0' illuminates the LED */ - - s32k3xx_gpiowrite(GPIO_LED_R, !redon); - s32k3xx_gpiowrite(GPIO_LED_G, !greenon); - s32k3xx_gpiowrite(GPIO_LED_B, !blueon); - } -} - -/**************************************************************************** - * Name: board_autoled_off - ****************************************************************************/ - -void board_autoled_off(int led) -{ - if (led == LED_ON_OFF_OFF) { - /* Invert outputs, an output of '0' illuminates the LED */ - - s32k3xx_gpiowrite(GPIO_LED_R, !true); - s32k3xx_gpiowrite(GPIO_LED_G, !false); - s32k3xx_gpiowrite(GPIO_LED_B, !false); - } -} - -#endif /* CONFIG_ARCH_LEDS */ diff --git a/boards/nxp/mr-canhubk3/src/s32k3xx_boot.c b/boards/nxp/mr-canhubk3/src/s32k3xx_boot.c deleted file mode 100644 index 11dfa24..0000000 --- a/boards/nxp/mr-canhubk3/src/s32k3xx_boot.c +++ /dev/null @@ -1,102 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k3xx/mr-canhubk3/src/s32k3xx_boot.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/* Copyright 2022 NXP */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include - -#include "board_config.h" - -#ifdef CONFIG_S32K3XX_FS26 -#include "s32k3xx_fs26.h" -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: s32k3xx_board_initialize - * - * Description: - * All S32K3XX 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. - * - ****************************************************************************/ - -void s32k3xx_board_initialize(void) -{ -#ifdef CONFIG_SEGGER_SYSVIEW - up_perf_init((void *)MR_CANHUBK3_SYSCLK_FREQUENCY); -#endif - -#ifdef CONFIG_S32K3XX_FS26 - /* Configure LPSPI3 & FS26 as quick as possible to avoid watchdog reset */ - - s32k3xx_pinconfig(PIN_LPSPI3_PCS); - - /* Initialize the SPI driver for LPSPI3 */ - - struct spi_dev_s *g_lpspi3 = s32k3xx_lpspibus_initialize(3); - - if (g_lpspi3 == NULL) { - spierr("ERROR: FAILED to initialize LPSPI3\n"); - } - - fs26_initialize(g_lpspi3); -#endif - -#ifdef CONFIG_ARCH_LEDS - /* Configure on-board LEDs if LED support has been selected. */ - - board_autoled_initialize(); -#endif -} - -/**************************************************************************** - * Name: board_late_initialize - * - * Description: - * If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional - * initialization call will be performed in the boot-up sequence to a - * function called board_late_initialize(). board_late_initialize() will - * be called immediately after up_initialize() is called and just before - * the initial application is started. This additional initialization - * phase may be used, for example, to initialize board-specific device - * drivers. - * - ****************************************************************************/ - -#ifdef CONFIG_BOARD_LATE_INITIALIZE -void board_late_initialize(void) -{ - /* Perform board-specific initialization */ - - s32k3xx_bringup(); -} -#endif diff --git a/boards/nxp/mr-canhubk3/src/s32k3xx_bringup.c b/boards/nxp/mr-canhubk3/src/s32k3xx_bringup.c deleted file mode 100644 index 53eda46..0000000 --- a/boards/nxp/mr-canhubk3/src/s32k3xx_bringup.c +++ /dev/null @@ -1,318 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k3xx/mr-canhubk3/src/s32k3xx_bringup.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/* Copyright 2022 NXP */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include - -#ifdef CONFIG_INPUT_BUTTONS -# include -#endif - -#ifdef CONFIG_USERLED -# include -#endif - -#ifdef CONFIG_S32K3XX_FLEXCAN -# include "s32k3xx_flexcan.h" -#endif - -#ifdef CONFIG_S32K3XX_ENET -# include "s32k3xx_emac.h" -#endif - -#ifdef CONFIG_S32K3XX_QSPI -# include -# include -# include -# include "s32k3xx_qspi.h" -#endif - -#include -#include -#include "board_config.h" - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define MODULE_NAME "bringup" - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -#ifdef HAVE_MX25L -struct qspi_dev_s *g_qspi; -struct mtd_dev_s *g_mtd_fs; -#endif - - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: s32k3xx_bringup - * - * Description: - * Perform architecture-specific initialization - * - * CONFIG_BOARD_LATE_INITIALIZE=y : - * Called from board_late_initialize(). - * - * CONFIG_BOARD_LATE_INITIALIZE=n && CONFIG_BOARDCTL=y : - * Called from the NSH library - * - ****************************************************************************/ - -int s32k3xx_bringup(void) -{ - int ret = OK; -#if defined(CONFIG_BCH) || defined(HAVE_MX25L_LITTLEFS) - char blockdev[32]; -# if !defined(HAVE_MX25L_LITTLEFS) && !defined(HAVE_MX25L_NXFFS) - char chardev[32]; -# endif /* !HAVE_MX25L_LITTLEFS && !HAVE_MX25L_NXFFS */ -#endif /* CONFIG_BCH || HAVE_MX25L_LITTLEFS */ - -#ifdef CONFIG_S32K3XX_LPSPI - /* Initialize SPI driver */ - - s32k3xx_spidev_initialize(); -#endif - - s32k3xx_pinconfig(GPIO_LED_SAFETY); - s32k3xx_pinconfig(GPIO_BTN_SAFETY); - -#ifdef CONFIG_INPUT_BUTTONS - /* Register the BUTTON driver */ - - ret = btn_lower_initialize("/dev/buttons"); - - if (ret < 0) { - PX4_ERR("btn_lower_initialize() failed: %d", ret); - - } else { - PX4_INFO("btn_lower_initialize() succesful"); - } - -#endif - -#ifdef CONFIG_USERLED - /* Register the LED driver */ - - ret = userled_lower_initialize("/dev/userleds"); - - if (ret < 0) { - PX4_ERR("userled_lower_initialize() failed: %d", ret); - - } else { - PX4_INFO("userled_lower_initialize() succesful"); - } - -#endif - -#ifdef CONFIG_S32K3XX_PROGMEM - struct mtd_dev_s *mtd; - - mtd = progmem_initialize(); - - if (mtd == NULL) { - PX4_ERR("progmem_initialize() failed"); - } - - ret = register_mtddriver("/dev/progmem0", mtd, 0755, NULL); - - if (ret != OK) { - PX4_ERR("register_mtddriver() failed: %d", ret); - - } else { - ret = nx_mount("/dev/progmem0", "/mnt/progmem", "littlefs", 0, NULL); - - if (ret < 0) { - ret = nx_mount("/dev/progmem0", "/mnt/progmem", "littlefs", 0, - "forceformat"); - - if (ret < 0) { - PX4_ERR("progmem mount failed: %d", ret); - - } else { - PX4_INFO("progmem forceformat"); - } - } - } - -#endif - -#ifdef HAVE_MX25L - /* Create an instance of the S32K3XX QSPI device driver */ - - g_qspi = s32k3xx_qspi_initialize(0); - - if (!g_qspi) { - PX4_ERR("s32k3xx_qspi_initialize() failed"); - - } else { - /* Use the QSPI device instance to initialize the MX25 device */ - - g_mtd_fs = mx25rxx_initialize(g_qspi, true); - - if (!g_mtd_fs) { - PX4_ERR("mx25rxx_initialize() failed"); - - } else { - -# ifdef HAVE_MX25L_LITTLEFS - /* Configure the device with no partition support */ - - snprintf(blockdev, sizeof(blockdev), "/dev/mtdqspi%d", - MX25L_MTD_MINOR); - - ret = register_mtddriver(blockdev, g_mtd_fs, 0755, NULL); - - if (ret != OK) { - PX4_ERR("register_mtddriver() failed: %d", ret); - - } else { - ret = nx_mount(blockdev, "/mnt/qspi", "littlefs", 0, NULL); - - if (ret < 0) { - ret = nx_mount(blockdev, "/mnt/qspi", "littlefs", 0, - "forceformat"); - - if (ret < 0) { - PX4_ERR("MX25L mount: %d", ret); - - } else { - PX4_INFO("MX25L forceformat"); - } - } - } - -# elif defined(HAVE_MX25L_NXFFS) - /* Initialize to provide NXFFS on the N25QXXX MTD interface */ - - ret = nxffs_initialize(g_mtd_fs); - - if (ret < 0) { - PX4_ERR("nxffs_initialize() failed: %d", ret); - - } else { - PX4_INFO("nxffs_initialize() succesful"); - - /* Mount the file system at /mnt/qspi */ - - ret = nx_mount(NULL, "/mnt/qspi", "nxffs", 0, NULL); - - if (ret < 0) { - PX4_ERR("nx_mount() failed: %d", ret); - - } else { - PX4_INFO("nx_mount() succesful"); - } - } - -# else /* if defined(HAVE_MX25L_CHARDEV) */ - /* Use the FTL layer to wrap the MTD driver as a block driver */ - - ret = ftl_initialize(MX25L_MTD_MINOR, g_mtd_fs); - - if (ret < 0) { - PX4_ERR("ftl_initialize() failed: %d", ret); - } - -# ifdef CONFIG_BCH - - else { - PX4_INFO("ftl_initialize() succesful"); - - /* Use the minor number to create device paths */ - - snprintf(blockdev, sizeof(blockdev), "/dev/mtdblock%d", - MX25L_MTD_MINOR); - snprintf(chardev, sizeof(chardev), "/dev/mtd%d", - MX25L_MTD_MINOR); - - /* Now create a character device on the block device */ - - ret = bchdev_register(blockdev, chardev, false); - - if (ret < 0) { - PX4_ERR("bchdev_register %s failed: %d", chardev, ret); - - } else { - PX4_INFO("bchdev_register %s succesful", chardev); - } - } - -# endif /* CONFIG_BCH */ -# endif - } - } - -#endif - -#ifdef CONFIG_S32K3XX_SELFTEST - s32k3xx_selftest(); -#endif /* CONFIG_S32K3XX_SELFTEST */ - -#ifdef CONFIG_NETDEV_LATEINIT -# ifdef CONFIG_S32K3XX_ENET - s32k3xx_netinitialize(0); -# endif /* CONFIG_S32K3XX_ENET */ -# ifdef CONFIG_S32K3XX_FLEXCAN0 - s32k3xx_caninitialize(0); -# endif /* CONFIG_S32K3XX_FLEXCAN0 */ -# ifdef CONFIG_S32K3XX_FLEXCAN1 - s32k3xx_caninitialize(1); -# endif /* CONFIG_S32K3XX_FLEXCAN1 */ -# ifdef CONFIG_S32K3XX_FLEXCAN2 - s32k3xx_caninitialize(2); -# endif /* CONFIG_S32K3XX_FLEXCAN2 */ -# ifdef CONFIG_S32K3XX_FLEXCAN3 - s32k3xx_caninitialize(3); -# endif /* CONFIG_S32K3XX_FLEXCAN3 */ -# ifdef CONFIG_S32K3XX_FLEXCAN4 - s32k3xx_caninitialize(4); -# ifdef CONFIG_S32K3XX_TJA1153 - s32k3xx_tja1153_initialize(4); -# endif /* CONFIG_S32K3XX_TJA1153 */ -# endif /* CONFIG_S32K3XX_FLEXCAN4 */ -# ifdef CONFIG_S32K3XX_FLEXCAN5 - s32k3xx_caninitialize(5); -# ifdef CONFIG_S32K3XX_TJA1153 - s32k3xx_tja1153_initialize(5); -# endif /* CONFIG_S32K3XX_TJA1153 */ -# endif /* CONFIG_S32K3XX_FLEXCAN5 */ -#endif /* CONFIG_NETDEV_LATEINIT */ - - board_hardfault_init(2, true); - - return ret; -} diff --git a/boards/nxp/mr-canhubk3/src/s32k3xx_buttons.c b/boards/nxp/mr-canhubk3/src/s32k3xx_buttons.c deleted file mode 100644 index 6f4b9e3..0000000 --- a/boards/nxp/mr-canhubk3/src/s32k3xx_buttons.c +++ /dev/null @@ -1,149 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k3xx/mr-canhubk3/src/s32k3xx_buttons.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/* Copyright 2022 NXP */ - -/* The MR-CANHUBK3 supports two buttons: - * - * SW1 PTD15 (EIRQ31) - * SW2 PTA25 (EIRQ5 / WKPU34) - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include - -#include - -#include "s32k3xx_pin.h" - -#include - -#include "board_config.h" - -#ifdef CONFIG_ARCH_BUTTONS - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_button_initialize - * - * Description: - * board_button_initialize() must be called to initialize button resources. - * After that, board_buttons() may be called to collect the current state - * of all buttons or board_button_irq() may be called to register button - * interrupt handlers. - * - ****************************************************************************/ - -uint32_t board_button_initialize(void) -{ - /* Configure the GPIO pins as interrupting inputs */ - - s32k3xx_pinconfig(GPIO_SW1); - s32k3xx_pinconfig(GPIO_SW2); - - return NUM_BUTTONS; -} - -/**************************************************************************** - * Name: board_buttons - ****************************************************************************/ - -uint32_t board_buttons(void) -{ - uint32_t ret = 0; - - if (s32k3xx_gpioread(GPIO_SW1)) { - ret |= BUTTON_SW1_BIT; - } - - if (s32k3xx_gpioread(GPIO_SW2)) { - ret |= BUTTON_SW2_BIT; - } - - return ret; -} - -#ifdef CONFIG_ARCH_IRQBUTTONS -/**************************************************************************** - * Button support. - * - * Description: - * board_button_initialize() must be called to initialize button resources. - * After that, board_buttons() may be called to collect the current state - * of all buttons or board_button_irq() may be called to register button - * interrupt handlers. - * - * After board_button_initialize() has been called, board_buttons() may be - * called to collect the state of all buttons. board_buttons() returns a - * 32-bit bit set with each bit associated with a button. See the - * BUTTON_*_BIT definitions in board.h for the meaning of each bit. - * - * board_button_irq() may be called to register an interrupt handler that - * will be called when a button is pressed or released. The ID value is a - * button enumeration value that uniquely identifies a button resource. - * See the BUTTON_* definitions in board.h for the meaning of enumeration - * value. - * - ****************************************************************************/ - -int board_button_irq(int id, xcpt_t irqhandler, void *arg) -{ - uint32_t pinset; - int ret; - - /* Map the button id to the GPIO bit set */ - - if (id == BUTTON_SW1) { - pinset = GPIO_SW1; - - } else if (id == BUTTON_SW2) { - pinset = GPIO_SW2; - - } else { - return -EINVAL; - } - - /* The button has already been configured as an interrupting input (by - * board_button_initialize() above). - * - * Attach the new button handler. - */ - - ret = s32k3xx_pinirqattach(pinset, irqhandler, NULL); - - if (ret >= 0) { - /* Then make sure that interrupts are enabled on the pin */ - - s32k3xx_pinirqenable(pinset); - } - - return ret; -} -#endif /* CONFIG_ARCH_IRQBUTTONS */ -#endif /* CONFIG_ARCH_BUTTONS */ diff --git a/boards/nxp/mr-canhubk3/src/s32k3xx_clockconfig.c b/boards/nxp/mr-canhubk3/src/s32k3xx_clockconfig.c deleted file mode 100644 index 9e48d08..0000000 --- a/boards/nxp/mr-canhubk3/src/s32k3xx_clockconfig.c +++ /dev/null @@ -1,165 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k3xx/mr-canhubk3/src/s32k3xx_clockconfig.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/* Copyright 2022 NXP */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include - -#include "s32k3xx_clockconfig.h" -#include "s32k3xx_start.h" - -#include "board_config.h" - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/* Each S32K3XX board must provide the following initialized structure. - * This is needed to establish the initial board clocking. - */ - -const struct clock_configuration_s g_initial_clkconfig = { - .cgm = - { - .sirc = - { - .range = CGM_FIRC_RANGE_32K, /* Slow IRC is trimmed to 32 kHz */ - }, - .firc = - { - .range = CGM_FIRC_RANGE_HIGH, /* RANGE */ - .div = CGM_CLOCK_DIV_BY_1, /* FIRCDIV1 */ - }, - .scs = - { - .scs_source = CGM_SCS_SOURCE_PLL_PHI0, - .core_clk = - { - .div = CGM_MUX_DIV_BY_1, - .trigger = false, - }, - .aips_plat_clk = - { - .div = CGM_MUX_DIV_BY_2, - .trigger = false, - }, - .aips_slow_clk = - { - .div = CGM_MUX_DIV_SLOW_BY_4, - .trigger = false, - }, - .hse_clk = - { - .div = CGM_MUX_DIV_BY_1, - .trigger = false, - }, - .dcm_clk = - { - .div = CGM_MUX_DIV_BY_1, - .trigger = false, - }, - .lbist_clk = - { - .div = CGM_MUX_DIV_BY_1, - .trigger = false, - }, -#ifdef CONFIG_S32K3XX_QSPI - .qspi_mem_clk = - { - .div = CGM_MUX_DIV_BY_1, - .trigger = false, - }, -#endif - .mux_1_stm0 = - { - .source = CGM_CLK_SRC_FXOSC, - .div = CGM_MUX_DIV_BY_2, - }, - .mux_3 = - { - .source = CGM_CLK_SRC_AIPS_PLAT_CLK, - .div = CGM_MUX_DIV_BY_1, - }, - .mux_4 = - { - .source = CGM_CLK_SRC_AIPS_PLAT_CLK, - .div = CGM_MUX_DIV_BY_1, - }, -#ifdef CONFIG_S32K3XX_ENET - .mux_7_emac_rx = - { - .source = CGM_CLK_SRC_EMAC_RMII_TX_CLK, - .div = CGM_MUX_DIV_BY_2, - }, - .mux_8_emac_tx = - { - .source = CGM_CLK_SRC_EMAC_RMII_TX_CLK, - .div = CGM_MUX_DIV_BY_2, - }, - .mux_9_emac_ts = - { - .source = CGM_CLK_SRC_EMAC_RMII_TX_CLK, - .div = CGM_MUX_DIV_BY_2, /* FIXME check div value */ - }, -#endif -#ifdef CONFIG_S32K3XX_QSPI - .mux_10_qspi_sfck = - { - .source = CGM_CLK_SRC_PLL_PHI1_CLK, - .div = CGM_MUX_DIV_BY_4, - }, -#endif - }, - .pll = - { - .modul_freq = 0, - .modul_depth = 0, - .core_pll_power = true, - .modulation_type = false, - .sigma_delta = CGM_PLL_SIGMA_DELTA, - .enable_dither = false, - .mode = CGM_PLL_INTEGER_MODE, - .prediv = 2, - .mult = 120, - .postdiv = 2, - .phi0 = CGM_PLL_PHI_DIV_BY_3, - .phi1 = CGM_PLL_PHI_DIV_BY_3, - }, - .clkout = - { - .source = CGM_CLK_SRC_AIPS_SLOW_CLK, - .div = CGM_CLKOUT_DIV_BY_1, - } - }, - .pcc = - { - .pclks = g_peripheral_clockconfig0, /* Peripheral clock configurations */ - }, -}; - -/**************************************************************************** - * Public Functions - ****************************************************************************/ diff --git a/boards/nxp/mr-canhubk3/src/s32k3xx_i2c.c b/boards/nxp/mr-canhubk3/src/s32k3xx_i2c.c deleted file mode 100644 index e404a1d..0000000 --- a/boards/nxp/mr-canhubk3/src/s32k3xx_i2c.c +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k3xx/mr-canhubk3/src/s32k3xx_i2c.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/* Copyright 2022 NXP */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include - -#include - -#include "s32k3xx_lpi2c.h" - -#include "board_config.h" - -#ifdef CONFIG_S32K3XX_LPI2C - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: s32k3xx_i2cdev_initialize - * - * Description: - * Initialize I2C driver and register /dev/i2cN devices. - * - ****************************************************************************/ - -int weak_function s32k3xx_i2cdev_initialize(void) -{ - int ret = OK; - -#if defined(CONFIG_S32K3XX_LPI2C0) && defined(CONFIG_I2C_DRIVER) - /* LPI2C0 *****************************************************************/ - - /* Initialize the I2C driver for LPI2C0 */ - - struct i2c_master_s *lpi2c0 = s32k3xx_i2cbus_initialize(0); - - if (lpi2c0 == NULL) { - i2cerr("ERROR: FAILED to initialize LPI2C0\n"); - return -ENODEV; - } - - ret = i2c_register(lpi2c0, 0); - - if (ret < 0) { - i2cerr("ERROR: FAILED to register LPI2C0 driver\n"); - s32k3xx_i2cbus_uninitialize(lpi2c0); - return ret; - } - -#endif /* CONFIG_S32K3XX_LPI2C0 && CONFIG_I2C_DRIVER */ - -#if defined(CONFIG_S32K3XX_LPI2C1) && defined(CONFIG_I2C_DRIVER) - /* LPI2C1 *****************************************************************/ - - /* Initialize the I2C driver for LPI2C1 */ - - struct i2c_master_s *lpi2c1 = s32k3xx_i2cbus_initialize(1); - - if (lpi2c1 == NULL) { - i2cerr("ERROR: FAILED to initialize LPI2C1\n"); - return -ENODEV; - } - - ret = i2c_register(lpi2c1, 1); - - if (ret < 0) { - i2cerr("ERROR: FAILED to register LPI2C1 driver\n"); - s32k3xx_i2cbus_uninitialize(lpi2c1); - return ret; - } - -#endif /* CONFIG_S32K3XX_LPI2C1 && CONFIG_I2C_DRIVER */ - - return ret; -} - -#endif /* CONFIG_S32K3XX_LPI2C */ diff --git a/boards/nxp/mr-canhubk3/src/s32k3xx_periphclocks.c b/boards/nxp/mr-canhubk3/src/s32k3xx_periphclocks.c deleted file mode 100644 index 42cf924..0000000 --- a/boards/nxp/mr-canhubk3/src/s32k3xx_periphclocks.c +++ /dev/null @@ -1,289 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k3xx/mr-canhubk3/src/s32k3xx_periphclocks.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/* Copyright 2022 NXP */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include - -#include "s32k3xx_clocknames.h" -#include "s32k3xx_periphclocks.h" - -#include "board_config.h" - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/* Each S32K3XX board must provide the following initialized structure. - * This is needed to establish the initial peripheral clocking. - */ - -const struct peripheral_clock_config_s g_peripheral_clockconfig0[] = { - { - .clkname = FLEXCAN0_CLK, -#ifdef CONFIG_S32K3XX_FLEXCAN0 - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = FLEXCAN1_CLK, -#ifdef CONFIG_S32K3XX_FLEXCAN1 - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = FLEXCAN2_CLK, -#ifdef CONFIG_S32K3XX_FLEXCAN2 - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = FLEXCAN3_CLK, -#ifdef CONFIG_S32K3XX_FLEXCAN3 - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = FLEXCAN4_CLK, -#ifdef CONFIG_S32K3XX_FLEXCAN4 - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = FLEXCAN5_CLK, -#ifdef CONFIG_S32K3XX_FLEXCAN5 - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = LPI2C0_CLK, -#ifdef CONFIG_S32K3XX_LPI2C0 - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = LPI2C1_CLK, -#ifdef CONFIG_S32K3XX_LPI2C1 - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = LPSPI1_CLK, -#ifdef CONFIG_S32K3XX_LPSPI1 - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = LPSPI2_CLK, -#ifdef CONFIG_S32K3XX_LPSPI2 - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = LPSPI3_CLK, -#ifdef CONFIG_S32K3XX_LPSPI3 - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = LPSPI4_CLK, -#ifdef CONFIG_S32K3XX_LPSPI4 - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = LPSPI5_CLK, -#ifdef CONFIG_S32K3XX_LPSPI5 - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = LPUART0_CLK, -#ifdef CONFIG_S32K3XX_LPUART0 - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = LPUART1_CLK, -#ifdef CONFIG_S32K3XX_LPUART1 - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = LPUART2_CLK, -#ifdef CONFIG_S32K3XX_LPUART2 - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = LPUART4_CLK, -#ifdef CONFIG_S32K3XX_LPUART4 - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = LPUART7_CLK, -#ifdef CONFIG_S32K3XX_LPUART7 - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = LPUART9_CLK, -#ifdef CONFIG_S32K3XX_LPUART9 - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = LPUART10_CLK, -#ifdef CONFIG_S32K3XX_LPUART10 - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = LPUART13_CLK, -#ifdef CONFIG_S32K3XX_LPUART13 - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = LPUART14_CLK, -#ifdef CONFIG_S32K3XX_LPUART14 - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = WKPU_CLK, -#ifdef CONFIG_S32K3XX_WKPUINTS - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = EMAC_CLK, -#ifdef CONFIG_S32K3XX_ENET - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = QSPI_CLK, -#ifdef CONFIG_S32K3XX_QSPI - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = EDMA_CLK, -#ifdef CONFIG_S32K3XX_EDMA - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = DMAMUX0_CLK, -#ifdef CONFIG_S32K3XX_EDMA - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = DMAMUX1_CLK, -#ifdef CONFIG_S32K3XX_EDMA - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = STM0_CLK, - .clkgate = true, - }, - { - .clkname = EMIOS0_CLK, - .clkgate = true, - }, - { - .clkname = ADC2_CLK, - .clkgate = true, - } -}; - -unsigned int const num_of_peripheral_clocks_0 = - sizeof(g_peripheral_clockconfig0) / - sizeof(g_peripheral_clockconfig0[0]); - -/**************************************************************************** - * Public Functions - ****************************************************************************/ diff --git a/boards/nxp/mr-canhubk3/src/s32k3xx_selftest.c b/boards/nxp/mr-canhubk3/src/s32k3xx_selftest.c deleted file mode 100644 index 0516d9f..0000000 --- a/boards/nxp/mr-canhubk3/src/s32k3xx_selftest.c +++ /dev/null @@ -1,439 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k3xx/mr-canhubk3/src/s32k3xx_selftest.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/* Copyright 2022 NXP */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include - -#include -#include - -#include "s32k3xx_lpi2c.h" -#include "s32k3xx_pin.h" - -#include -#include "board_config.h" - -#ifdef CONFIG_S32K3XX_SELFTEST - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -#ifdef CONFIG_S32K3XX_LPI2C -static int s32k3xx_selftest_se050(void); -#endif /* CONFIG_S32K3XX_LPI2C */ -#ifdef CONFIG_S32K3XX_FLEXCAN -static int s32k3xx_selftest_can(void); -# if !defined(CONFIG_S32K3XX_TJA1153) -static int s32k3xx_selftest_sct(void); -# endif /* !CONFIG_S32K3XX_TJA1153 */ -#endif /* CONFIG_S32K3XX_FLEXCAN */ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -#ifdef CONFIG_S32K3XX_LPI2C -/**************************************************************************** - * Name: s32k3xx_selftest_se050 - * - * Description: - * Basic check to see if the SE050 is alive by having it ACK a I2C write. - * - ****************************************************************************/ - -static int s32k3xx_selftest_se050(void) -{ - struct i2c_master_s *lpi2c1; - struct i2c_msg_s se050_msg; - uint8_t buf = 0; - int ret = 0; - bool error = false; - -#if !defined(CONFIG_S32K3XX_LPI2C1) -# error CONFIG_S32K3XX_LPI2C1 needs to be enabled to perform SE050 self-test -#endif - - /* Initialize LPI2C1 to which the SE050 is connected */ - - lpi2c1 = s32k3xx_i2cbus_initialize(1); - - if (lpi2c1 != NULL) { - _info("s32k3xx_i2cbus_initialize() succesful\n"); - - } else { - error = true; - _err("s32k3xx_i2cbus_initialize() failed\n"); - - return -1; /* Return immediately, no cleanup needed */ - } - - /* Verify SE050 by checking for ACK on I2C write */ - - se050_msg.frequency = I2C_SPEED_STANDARD; - se050_msg.addr = 0x48; - se050_msg.flags = 0; - se050_msg.buffer = &buf; - se050_msg.length = 1; - - ret = I2C_TRANSFER(lpi2c1, &se050_msg, 1); - - if (ret == 0) { - _info("SE050 ACK succesful\n"); - - } else { - error = true; - _err("SE050 ACK failed: %d\n", ret); - - /* Don't return yet, we still need to cleanup */ - } - - /* Let the LPI2C driver know we won't be using it anymore */ - - ret = s32k3xx_i2cbus_uninitialize(lpi2c1); - - if (ret == 0) { - _info("s32k3xx_i2cbus_uninitialize() succesful\n"); - - /* Return error if we had any earlier, otherwise return result of - * s32k3xx_i2cbus_uninitialize() - */ - - return (error ? -1 : ret); - - } else { - error = true; - _err("s32k3xx_i2cbus_uninitialize() failed: %d\n", ret); - - return -1; - } -} -#endif /* CONFIG_S32K3XX_LPI2C */ - -#ifdef CONFIG_S32K3XX_FLEXCAN -/**************************************************************************** - * Name: s32k3xx_selftest_can - * - * Description: - * Basic check of the local failure flags of the CAN transceivers (0-3). - * - ****************************************************************************/ - -static int s32k3xx_selftest_can(void) -{ - uint32_t errn_pins[4] = { - PIN_CAN0_ERRN, - PIN_CAN1_ERRN, - PIN_CAN2_ERRN, - PIN_CAN3_ERRN - }; - - uint32_t stbn_pins[4] = { - PIN_CAN0_STB, - PIN_CAN1_STB, - PIN_CAN2_STB, - PIN_CAN3_STB - }; - - uint32_t en_pins[4] = { - PIN_CAN0_ENABLE, - PIN_CAN1_ENABLE, - PIN_CAN2_ENABLE, - PIN_CAN3_ENABLE - }; - - int i; - int ret = 0; - bool error = false; - -#if !defined(CONFIG_S32K3XX_FLEXCAN0) || !defined(CONFIG_S32K3XX_FLEXCAN1) || \ - !defined(CONFIG_S32K3XX_FLEXCAN2) || !defined(CONFIG_S32K3XX_FLEXCAN3) -# error CONFIG_S32K3XX_FLEXCAN0-3 need to be enabled to perform CAN self-test -#endif - - /* Initialize pins, go into normal mode (EN high, STB_N high) to clear Pwon - * and Wake flags. - */ - - for (i = 0; i < 4; i++) { - ret = s32k3xx_pinconfig(errn_pins[i]); - - if (ret != 0) { - error = true; - _err("CAN%d ERR_N pin configuration failed\n", i); - - return -1; /* Return immediately, no cleanup needed */ - } - - ret = s32k3xx_pinconfig(stbn_pins[i] | GPIO_OUTPUT_ONE); - - if (ret != 0) { - error = true; - _err("CAN%d STB_N pin configuration failed\n", i); - - return -1; /* Return immediately, no cleanup needed */ - } - - ret = s32k3xx_pinconfig(en_pins[i] | GPIO_OUTPUT_ONE); - - if (ret != 0) { - error = true; - _err("CAN%d EN pin configuration failed\n", i); - - return -1; /* Return immediately, no cleanup needed */ - } - } - - /* Wait for the transition to normal mode to finish and previous status - * flags to be cleared before switching modes again. This is longer - */ - - up_udelay(3000); - - /* Go into listen-only mode (EN low, STB_N still high) to read local - * failure flags. - */ - - for (i = 0; i < 4; i++) { - s32k3xx_gpiowrite(en_pins[i], 0); - } - - /* Wait for transition to listen-only mode to finish */ - - up_udelay(200); - - /* Check for local failure flags and then go back to normal mode */ - - for (i = 0; i < 4; i++) { - if (s32k3xx_gpioread(errn_pins[i])) { - _info("CAN%d flag check succesful\n", i); - - } else { - error = true; - _err("CAN%d flag check failed\n", i); - - /* Don't return yet, we still need to cleanup */ - } - - s32k3xx_gpiowrite(en_pins[i], 1); - } - - return (error ? -1 : 0); -} - -# if !defined(CONFIG_S32K3XX_TJA1153) -/**************************************************************************** - * Name: s32k3xx_selftest_sct - * - * Description: - * Basic check of the SCTs (4-5). - * - ****************************************************************************/ - -static int s32k3xx_selftest_sct(void) -{ - uint32_t stbn_pins[2] = { - PIN_CAN4_STB, - PIN_CAN5_STB - }; - - uint32_t en_pins[2] = { - PIN_CAN4_ENABLE, - PIN_CAN5_ENABLE - }; - - uint32_t txd_pins[2] = { - PIN_CAN4_TX, - PIN_CAN5_TX - }; - - uint32_t rxd_pins[2] = { - PIN_CAN4_RX, - PIN_CAN5_RX - }; - - int i; - int ret = 0; - bool error = false; - - /* Configure pins and enable CAN PHY. CAN_TXD will be temporarily changed - * to a GPIO output to be able to control its logic level. - */ - - for (i = 4; i < 6; i++) { - ret = s32k3xx_pinconfig(stbn_pins[i - 4] | GPIO_OUTPUT_ZERO); - - if (ret != 0) { - error = true; - _err("CAN%d STB_N pin configuration failed\n", i); - - return -1; /* Return immediately, no cleanup needed */ - } - - ret = s32k3xx_pinconfig(en_pins[i - 4] | GPIO_OUTPUT_ONE); - - if (ret != 0) { - error = true; - _err("CAN%d EN pin configuration failed\n", i); - - return -1; /* Return immediately, no cleanup needed */ - } - - ret = s32k3xx_pinconfig((txd_pins[i - 4] & (_PIN_PORT_MASK | - _PIN_MASK)) | GPIO_OUTPUT | GPIO_OUTPUT_ONE); - - if (ret != 0) { - error = true; - _err("CAN%d TXD pin configuration failed\n", i); - - return -1; /* Return immediately, no cleanup needed */ - } - - ret = s32k3xx_pinconfig(rxd_pins[i - 4]); - - if (ret != 0) { - error = true; - _err("CAN%d RXD pin configuration failed\n", i); - - return -1; /* Return immediately, no cleanup needed */ - } - } - - /* Wait for CAN PHY to detect change at TXD pin */ - - up_udelay(5000); - - /* Check if CAN_RXD follows the high level of CAN_TXD */ - - for (i = 4; i < 6; i++) { - if (s32k3xx_gpioread(rxd_pins[i - 4])) { - _info("CAN%d RXD high check succesful\n", i); - - } else { - error = true; - _err("CAN%d RXD high check failed\n", i); - - /* Don't return yet, we still need to cleanup */ - } - } - - for (i = 4; i < 6; i++) { - s32k3xx_gpiowrite(txd_pins[i - 4], 0); - } - - /* Wait for CAN PHY to detect change at TXD pin */ - - up_udelay(5000); - - /* Check if CAN_RXD follows the low level of CAN_TXD */ - - for (i = 4; i < 6; i++) { - if (!s32k3xx_gpioread(rxd_pins[i - 4])) { - _info("CAN%d RXD low check succesful\n", i); - - } else { - error = true; - _err("CAN%d RXD low check failed\n", i); - - /* Don't return yet, we still need to cleanup */ - } - } - - /* Restore CAN_TXD pinconfig */ - - for (i = 4; i < 6; i++) { - s32k3xx_pinconfig(txd_pins[i - 4]); - - if (ret != 0) { - error = true; - _err("CAN%d TXD restoring pin configuration failed\n", i); - - /* Don't return yet, we still need to cleanup */ - } - } - - return (error ? -1 : 0); -} -# endif /* !CONFIG_S32K3XX_TJA1153 */ -#endif /* CONFIG_S32K3XX_FLEXCAN */ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: s32k3xx_selftest - * - * Description: - * Runs basic routines to verify that all board components are up and - * running. Results are send to the syslog, it is recommended to - * enable all output levels (error, warning and info). - * - ****************************************************************************/ - -void s32k3xx_selftest(void) -{ - int ret = 0; - bool error = false; - -#ifdef CONFIG_S32K3XX_LPI2C - ret = s32k3xx_selftest_se050(); - - if (ret != 0) { - error = true; - _err("s32k3xx_selftest_se050() failed\n"); - } - -#endif - -#ifdef CONFIG_S32K3XX_FLEXCAN - ret = s32k3xx_selftest_can(); - - if (ret != 0) { - error = true; - _err("s32k3xx_selftest_can() failed\n"); - } - -# if !defined(CONFIG_S32K3XX_TJA1153) - ret = s32k3xx_selftest_sct(); - - if (ret != 0) { - error = true; - _err("s32k3xx_selftest_sct() failed\n"); - } - -# endif /* !CONFIG_S32K3XX_TJA1153 */ -#endif - - if (!error) { - _info("s32k3xx_selftest() succesful\n"); - } -} - -#endif /* CONFIG_S32K3XX_SELFTEST */ diff --git a/boards/nxp/mr-canhubk3/src/s32k3xx_tja1153.c b/boards/nxp/mr-canhubk3/src/s32k3xx_tja1153.c deleted file mode 100644 index 705dee8..0000000 --- a/boards/nxp/mr-canhubk3/src/s32k3xx_tja1153.c +++ /dev/null @@ -1,325 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k3xx/mr-canhubk3/src/s32k3xx_tja1153.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/* Copyright 2022 NXP - * - * This TJA1153 initialization routine is intended for ENGINEERING - * DEVELOPMENT OR EVALUATION PURPOSES ONLY. It is provided as an example to - * use the TJA1153. Please refer to the datasheets and application hints - * provided on NXP.com to implement full functionality. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "s32k3xx_pin.h" -#include -#include "board_config.h" - -#ifdef CONFIG_S32K3XX_TJA1153 - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Bitrate must be set to 125, 250 or 500 kbit/s for CAN 2.0 and CAN FD - * arbitration phase - */ - -#ifdef CONFIG_S32K3XX_FLEXCAN4 -# if CONFIG_NET_CAN_CANFD -# if CONFIG_FLEXCAN4_ARBI_BITRATE > 500000 -# error "FLEXCAN4_ARBI_BITRATE > 500000" -# endif -# else -# if CONFIG_FLEXCAN4_BITRATE > 500000 -# error "FLEXCAN4_BITRATE > 500000" -# endif -# endif -#endif - -#ifdef CONFIG_S32K3XX_FLEXCAN5 -# if CONFIG_NET_CAN_CANFD -# if CONFIG_FLEXCAN5_ARBI_BITRATE > 500000 -# error "FLEXCAN5_ARBI_BITRATE > 500000" -# endif -# else -# if CONFIG_FLEXCAN5_BITRATE > 500000 -# error "FLEXCAN5_BITRATE > 500000" -# endif -# endif -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: s32k3xx_tja1153_initialize - * - * Description: - * Initialize a TJA1153 CAN PHY connected to a FlexCAN peripheral (0-5) - * - ****************************************************************************/ - -int s32k3xx_tja1153_initialize(int bus) -{ - int sock; - struct sockaddr_can addr; - struct can_frame frame_config1; - struct can_frame frame_config2; - struct can_frame frame_config3; - struct can_frame frame_config4; - struct can_frame frame_config5; - struct ifreq ifr; - uint32_t pin_can_txd; - uint32_t pin_can_rxd; - uint32_t pin_can_enable; - uint32_t pin_can_stb_n; - int ret = 0; - - /* Select interface and pins */ - - switch (bus) { -#ifdef CONFIG_S32K3XX_FLEXCAN4 - - case 4: { - strlcpy(ifr.ifr_name, "can4", IFNAMSIZ); - - pin_can_txd = PIN_CAN4_TX; - pin_can_rxd = PIN_CAN4_RX; - pin_can_enable = PIN_CAN4_ENABLE; - pin_can_stb_n = PIN_CAN4_STB; - } - break; -#endif -#ifdef CONFIG_S32K3XX_FLEXCAN5 - - case 5: { - strlcpy(ifr.ifr_name, "can5", IFNAMSIZ); - - pin_can_txd = PIN_CAN5_TX; - pin_can_rxd = PIN_CAN5_RX; - pin_can_enable = PIN_CAN5_ENABLE; - pin_can_stb_n = PIN_CAN5_STB; - } - break; -#endif - - default: { - /* This FlexCAN is not supported (yet) */ - - return -1; - } - } - - /* First check if configuration is actually needed */ - - s32k3xx_pinconfig((pin_can_txd & (_PIN_PORT_MASK | _PIN_MASK)) | - GPIO_OUTPUT | GPIO_OUTPUT_ZERO); - - if (s32k3xx_gpioread(pin_can_rxd)) { - _info("CAN%d TJA1153 already configured\n", bus); - - s32k3xx_pinconfig(pin_can_txd); /* Restore CAN_TXD pinconfig */ - return 0; - } - - s32k3xx_pinconfig(pin_can_txd); /* Restore CAN_TXD pinconfig */ - - /* Find network interface */ - - ifr.ifr_ifindex = if_nametoindex(ifr.ifr_name); - - if (!ifr.ifr_ifindex) { - _err("CAN%d TJA1153: if_nametoindex failed\n", bus); - return -1; - } - - /* Configure pins */ - - s32k3xx_pinconfig(pin_can_enable); - s32k3xx_pinconfig(pin_can_stb_n); - - s32k3xx_gpiowrite(pin_can_enable, true); /* Enable TJA1153 */ - s32k3xx_gpiowrite(pin_can_stb_n, false); /* Inverted, so TJA1153 is put in STANDBY */ - - /* Init CAN frames, e.g. LEN = 0 */ - - memset(&frame_config1, 0, sizeof(frame_config1)); - memset(&frame_config2, 0, sizeof(frame_config2)); - memset(&frame_config3, 0, sizeof(frame_config3)); - memset(&frame_config4, 0, sizeof(frame_config4)); - memset(&frame_config5, 0, sizeof(frame_config5)); - - /* Prepare CAN frames. Refer to the TJA1153 datasheets and application - * hints available on NXP.com for details. - */ - - frame_config1.can_id = 0x555; - frame_config1.can_dlc = 0; - - frame_config2.can_id = 0x18da00f1 | CAN_EFF_FLAG; - frame_config2.can_dlc = 6; - frame_config2.data[0] = 0x10; - frame_config2.data[1] = 0x00; - frame_config2.data[2] = 0x50; - frame_config2.data[3] = 0x00; - frame_config2.data[4] = 0x07; - frame_config2.data[5] = 0xff; - - frame_config3.can_id = 0x18da00f1 | CAN_EFF_FLAG; - frame_config3.can_dlc = 6; - frame_config3.data[0] = 0x10; - frame_config3.data[1] = 0x01; - frame_config3.data[2] = 0x9f; - frame_config3.data[3] = 0xff; - frame_config3.data[4] = 0xff; - frame_config3.data[5] = 0xff; - - frame_config4.can_id = 0x18da00f1 | CAN_EFF_FLAG; - frame_config4.can_dlc = 6; - frame_config4.data[0] = 0x10; - frame_config4.data[1] = 0x02; - frame_config4.data[2] = 0xc0; - frame_config4.data[3] = 0x00; - frame_config4.data[4] = 0x00; - frame_config4.data[5] = 0x00; - - frame_config5.can_id = 0x18da00f1 | CAN_EFF_FLAG; - frame_config5.can_dlc = 8; - frame_config5.data[0] = 0x71; - frame_config5.data[1] = 0x02; - frame_config5.data[2] = 0x03; - frame_config5.data[3] = 0x04; - frame_config5.data[4] = 0x05; - frame_config5.data[5] = 0x06; - frame_config5.data[6] = 0x07; - frame_config5.data[7] = 0x08; - - /* Open socket */ - - if ((sock = socket(PF_CAN, SOCK_RAW, CAN_RAW)) < 0) { - _err("CAN%d TJA1153: Failed to open socket\n", bus); - return -1; - } - - /* Bring up the interface */ - - ifr.ifr_flags = IFF_UP; - ret = ioctl(sock, SIOCSIFFLAGS, (unsigned long)&ifr); - - if (ret < 0) { - _err("CAN%d TJA1153: ioctl failed (can't set interface flags)\n", bus); - close(sock); - return -1; - } - - /* Initialize sockaddr struct */ - - memset(&addr, 0, sizeof(addr)); - addr.can_family = AF_CAN; - addr.can_ifindex = ifr.ifr_ifindex; - - /* Disable default receive filter on this RAW socket - * - * This is obsolete as we do not read from the socket at all, but for this - * reason we can remove the receive list in the kernel to save a little - * (really very little!) CPU usage. - */ - - setsockopt(sock, SOL_CAN_RAW, CAN_RAW_FILTER, NULL, 0); - - /* Bind socket and send the CAN frames */ - - if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) { - _err("CAN%d TJA1153: Failed to bind socket\n", bus); - close(sock); - return -1; - } - - if (write(sock, &frame_config1, CAN_MTU) != CAN_MTU) { - _err("CAN%d TJA1153: Failed to write frame_config1\n", bus); - close(sock); - return -1; - } - - if (write(sock, &frame_config2, CAN_MTU) != CAN_MTU) { - _err("CAN%d TJA1153: Failed to write frame_config2\n", bus); - close(sock); - return -1; - } - - if (write(sock, &frame_config3, CAN_MTU) != CAN_MTU) { - _err("CAN%d TJA1153: Failed to write frame_config3\n", bus); - close(sock); - return -1; - } - - if (write(sock, &frame_config4, CAN_MTU) != CAN_MTU) { - _err("CAN%d TJA1153: Failed to write frame_config4\n", bus); - close(sock); - return -1; - } - - if (write(sock, &frame_config5, CAN_MTU) != CAN_MTU) { - _err("CAN%d TJA1153: Failed to write frame_config5\n", bus); - close(sock); - return -1; - } - - /* Sleep for 100 ms to ensure that CAN frames have been transmitted */ - - nxsig_usleep(100 * 1000); - - /* TJA1153 must be taken out of STB mode */ - - s32k3xx_gpiowrite(pin_can_stb_n, true); /* Inverted, so TJA1153 comes out of STANDBY */ - - /* Bring down the interface */ - - ifr.ifr_flags = IFF_DOWN; - ret = ioctl(sock, SIOCSIFFLAGS, (unsigned long)&ifr); - - if (ret < 0) { - _err("CAN%d TJA1153: ioctl failed (can't set interface flags)\n", bus); - close(sock); - return -1; - } - - close(sock); - _info("CAN%d TJA1153 configuration succesful\n", bus); - return 0; -} - -#endif /* CONFIG_S32K3XX_TJA1153 */ diff --git a/boards/nxp/mr-canhubk3/src/s32k3xx_userleds.c b/boards/nxp/mr-canhubk3/src/s32k3xx_userleds.c deleted file mode 100644 index 75cc791..0000000 --- a/boards/nxp/mr-canhubk3/src/s32k3xx_userleds.c +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k3xx/mr-canhubk3/src/s32k3xx_userleds.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/* Copyright 2022 NXP */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include - -#include - -#include "s32k3xx_pin.h" - -#include - -#include "board_config.h" - -#ifndef CONFIG_ARCH_LEDS - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_userled_initialize - ****************************************************************************/ - -uint32_t board_userled_initialize(void) -{ - /* Configure LED GPIOs for output */ - - s32k3xx_pinconfig(GPIO_LED_R); - s32k3xx_pinconfig(GPIO_LED_G); - s32k3xx_pinconfig(GPIO_LED_B); - return BOARD_NLEDS; -} - -/**************************************************************************** - * Name: board_userled - ****************************************************************************/ - -void board_userled(int led, bool ledon) -{ - uint32_t ledcfg; - - switch (led) { - case BOARD_LED_R: - ledcfg = GPIO_LED_R; - break; - - case BOARD_LED_G: - ledcfg = GPIO_LED_G; - break; - - case BOARD_LED_B: - ledcfg = GPIO_LED_B; - break; - - default: - return; - } - - /* Invert output, an output of '0' illuminates the LED */ - - s32k3xx_gpiowrite(ledcfg, !ledon); -} - -/**************************************************************************** - * Name: board_userled_all - ****************************************************************************/ - -void board_userled_all(uint32_t ledset) -{ - /* Invert output, an output of '0' illuminates the LED */ - - s32k3xx_gpiowrite(GPIO_LED_R, !((ledset & BOARD_LED_R_BIT) != 0)); - s32k3xx_gpiowrite(GPIO_LED_G, !((ledset & BOARD_LED_G_BIT) != 0)); - s32k3xx_gpiowrite(GPIO_LED_B, !((ledset & BOARD_LED_B_BIT) != 0)); -} - -#endif /* !CONFIG_ARCH_LEDS */ diff --git a/boards/nxp/mr-canhubk3/src/spi.cpp b/boards/nxp/mr-canhubk3/src/spi.cpp deleted file mode 100644 index 40d9e9a..0000000 --- a/boards/nxp/mr-canhubk3/src/spi.cpp +++ /dev/null @@ -1,376 +0,0 @@ -/************************************************************************************ - * - * Copyright (C) 2016, 2018, 2021 Gregory Nutt. All rights reserved. - * Authors: Gregory Nutt - * David Sidrane - * Landon Haugh - * - * 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 NuttX 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 - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -#include "arm_internal.h" -#include "chip.h" -#include - -#include "s32k3xx_config.h" -#include "s32k3xx_lpspi.h" -#include "s32k3xx_pin.h" -#include "board_config.h" - -#if defined(CONFIG_S32K3XX_LPSPI) - - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBusExternal(SPI::Bus::SPI1, { - initSPIConfigExternal(SPI::CS{GPIO::PortB, GPIO::Pin5}) - }), - initSPIBusExternal(SPI::Bus::SPI2, { // SD Card - initSPIConfigExternal(SPI::CS{GPIO::PortB, GPIO::Pin5}) - }), - initSPIBus(SPI::Bus::SPI3, { // SPI3 is ignored only used for FS26 by a NuttX driver - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin17}) - }), - initSPIBusExternal(SPI::Bus::SPI4, { - initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin16}, SPI::DRDY{PIN_WKPU20}), - initSPIConfigExternal(SPI::CS{GPIO::PortB, GPIO::Pin8}, SPI::DRDY{PIN_WKPU56}) - }), - initSPIBusExternal(SPI::Bus::SPI5, { - initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin14}, SPI::DRDY{PIN_WKPU4}) - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); - -#define PX4_MK_GPIO(pin_ftmx, io) ((((uint32_t)(pin_ftmx)) & ~(_PIN_MODE_MASK | _PIN_OPTIONS_MASK)) |(io)) - - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -__EXPORT void board_spi_reset(int ms, int bus_mask) -{ - /* Goal not to back feed the chips on the bus via IO lines */ - - /* Next Change CS to inputs with pull downs */ - for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) { - if (px4_spi_buses[bus].bus == PX4_BUS_NUMBER_TO_PX4(1)) { - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (px4_spi_buses[bus].devices[i].cs_gpio != 0) { - // s32k3xx_pinconfig is defined - // Only one argument, (uint32_t cfgset) - s32k3xx_pinconfig(PX4_MK_GPIO(px4_spi_buses[bus].devices[i].cs_gpio, GPIO_PULLDOWN)); - } - } - } - } - - /* Restore all the CS to ouputs inactive */ - for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) { - if (px4_spi_buses[bus].bus == PX4_BUS_NUMBER_TO_PX4(1)) { - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (px4_spi_buses[bus].devices[i].cs_gpio != 0) { - s32k3xx_pinconfig(px4_spi_buses[bus].devices[i].cs_gpio); - } - } - } - } -} - -/************************************************************************************ - * Name: s32k3xx_spidev_initialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the NXP UCANS32K146 board. - * - ************************************************************************************/ - -void s32k3xx_spidev_initialize(void) -{ - board_spi_reset(10, 0xffff); - - for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) { - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (px4_spi_buses[bus].devices[i].cs_gpio != 0) { - s32k3xx_pinconfig(px4_spi_buses[bus].devices[i].cs_gpio); - } - } - } -} - -/************************************************************************************ - * Name: s32k3xx_spi_bus_initialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the NXP UCANS32K146 board. - * - ************************************************************************************/ - - -__EXPORT int s32k3xx_spi_bus_initialize(void) -{ - - struct spi_dev_s *spi_ext; - - spi_ext = px4_spibus_initialize(2); - - if (!spi_ext) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 2); - return -ENODEV; - } - - /* Default external bus to 1MHz and de-assert the known chip selects. - */ - - SPI_SETFREQUENCY(spi_ext, 8 * 1000 * 1000); - SPI_SETBITS(spi_ext, 8); - SPI_SETMODE(spi_ext, SPIDEV_MODE3); - - /* deselect all */ - for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) { - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (px4_spi_buses[bus].devices[i].cs_gpio != 0) { - SPI_SELECT(spi_ext, px4_spi_buses[bus].devices[i].devid, false); - } - } - } - - spi_ext = px4_spibus_initialize(3); - - if (!spi_ext) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 2); - return -ENODEV; - } - - /* Default external bus to 1MHz and de-assert the known chip selects. - */ - - SPI_SETFREQUENCY(spi_ext, 8 * 1000 * 1000); - SPI_SETBITS(spi_ext, 8); - SPI_SETMODE(spi_ext, SPIDEV_MODE3); - - /* deselect all */ - for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) { - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (px4_spi_buses[bus].devices[i].cs_gpio != 0) { - SPI_SELECT(spi_ext, px4_spi_buses[bus].devices[i].devid, false); - } - } - } - - spi_ext = px4_spibus_initialize(5); - - if (!spi_ext) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 2); - return -ENODEV; - } - - /* Default external bus to 1MHz and de-assert the known chip selects. - */ - - SPI_SETFREQUENCY(spi_ext, 8 * 1000 * 1000); - SPI_SETBITS(spi_ext, 8); - SPI_SETMODE(spi_ext, SPIDEV_MODE3); - - /* deselect all */ - for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) { - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (px4_spi_buses[bus].devices[i].cs_gpio != 0) { - SPI_SELECT(spi_ext, px4_spi_buses[bus].devices[i].devid, false); - } - } - } - - spi_ext = px4_spibus_initialize(6); - - if (!spi_ext) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 2); - return -ENODEV; - } - - /* Default external bus to 1MHz and de-assert the known chip selects. - */ - - SPI_SETFREQUENCY(spi_ext, 8 * 1000 * 1000); - SPI_SETBITS(spi_ext, 8); - SPI_SETMODE(spi_ext, SPIDEV_MODE3); - - /* deselect all */ - for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) { - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (px4_spi_buses[bus].devices[i].cs_gpio != 0) { - SPI_SELECT(spi_ext, px4_spi_buses[bus].devices[i].devid, false); - } - } - } - - - return OK; - -} - -/**************************************************************************** - * Name: s32k3xx_lpspiNselect and s32k3xx_lpspiNstatus - * - * Description: - * The external functions, s32k3xx_lpspiNselect and s32k3xx_lpspiNstatus - * must be provided by board-specific logic. They are implementations of - * the select and status methods of the SPI interface defined by struct - * spi_ops_s (see include/nuttx/spi/spi.h). All other methods (including - * s32k3xx_lpspibus_initialize()) are provided by common logic. To use - * this common SPI logic on your board: - * - * 1. Provide logic in s32k3xx_boardinitialize() to configure SPI chip - * select pins. - * 2. Provide s32k3xx_lpspiNselect() and s32k3xx_lpspiNstatus() functions - * in your board-specific logic. These functions will perform chip - * selection and status operations using GPIOs in the way your board is - * configured. - * 3. Add a calls to s32k3xx_lpspibus_initialize() in your low level - * application initialization logic. - * 4. The handle returned by s32k3xx_lpspibus_initialize() may then be used - * to bind the SPI driver to higher level logic (e.g., calling - * mmcsd_spislotinitialize(), for example, will bind the SPI driver to - * the SPI MMC/SD driver). - * - ****************************************************************************/ - -#ifdef CONFIG_S32K3XX_LPSPI1 -/* LPSPI1 *******************************************************************/ - -void s32k3xx_lpspi1select(FAR struct spi_dev_s *dev, uint32_t devid, - bool selected) -{ - spiinfo("devid: %" PRId32 ", CS: %s\n", devid, - selected ? "assert" : "de-assert"); - - s32k3xx_gpiowrite(PIN_LPSPI1_PCS, !selected); -} - -uint8_t s32k3xx_lpspi1status(FAR struct spi_dev_s *dev, uint32_t devid) -{ - return SPI_STATUS_PRESENT; -} -#endif /* CONFIG_S32K3XX_LPSPI1 */ - -#ifdef CONFIG_S32K3XX_LPSPI2 -/* LPSPI2 *******************************************************************/ - -void s32k3xx_lpspi2select(FAR struct spi_dev_s *dev, uint32_t devid, - bool selected) -{ - spiinfo("devid: %" PRId32 ", CS: %s\n", devid, - selected ? "assert" : "de-assert"); - - s32k3xx_gpiowrite(PIN_LPSPI2_PCS, !selected); -} - -uint8_t s32k3xx_lpspi2status(FAR struct spi_dev_s *dev, uint32_t devid) -{ - return SPI_STATUS_PRESENT; -} -#endif /* CONFIG_S32K3XX_LPSPI2 */ - -#ifdef CONFIG_S32K3XX_LPSPI3 -/* LPSPI3 *******************************************************************/ - -void s32k3xx_lpspi3select(FAR struct spi_dev_s *dev, uint32_t devid, - bool selected) -{ - spiinfo("devid: %" PRId32 ", CS: %s\n", devid, - selected ? "assert" : "de-assert"); - - s32k3xx_gpiowrite(PIN_LPSPI3_PCS, !selected); -} - -uint8_t s32k3xx_lpspi3status(FAR struct spi_dev_s *dev, uint32_t devid) -{ - return SPI_STATUS_PRESENT; -} -#endif /* CONFIG_S32K3XX_LPSPI3 */ - -#ifdef CONFIG_S32K3XX_LPSPI4 -/* LPSPI4 *******************************************************************/ - -void s32k3xx_lpspi4select(FAR struct spi_dev_s *dev, uint32_t devid, - bool selected) -{ - spiinfo("devid: %" PRId32 ", CS: %s\n", devid, - selected ? "assert" : "de-assert"); - - devid = ((devid) & 0xF); - - if (devid == 0) { - s32k3xx_gpiowrite(PIN_LPSPI4_CS_P26, !selected); - - } else if (devid == 1) { - s32k3xx_gpiowrite(PIN_LPSPI4_CS_P8B, !selected); - } -} - -uint8_t s32k3xx_lpspi4status(FAR struct spi_dev_s *dev, uint32_t devid) -{ - return SPI_STATUS_PRESENT; -} -#endif /* CONFIG_S32K3XX_LPSPI4 */ - -#ifdef CONFIG_S32K3XX_LPSPI5 -/* LPSPI5 *******************************************************************/ - -void s32k3xx_lpspi5select(FAR struct spi_dev_s *dev, uint32_t devid, - bool selected) -{ - spiinfo("devid: %" PRId32 ", CS: %s\n", devid, - selected ? "assert" : "de-assert"); - - s32k3xx_gpiowrite(PIN_LPSPI5_PCS, !selected); -} - -uint8_t s32k3xx_lpspi5status(FAR struct spi_dev_s *dev, uint32_t devid) -{ - return SPI_STATUS_PRESENT; -} -#endif /* CONFIG_S32K3XX_LPSPI5 */ - - -#endif /* CONFIG_S32K3XX_LPSPI0 */ diff --git a/boards/nxp/mr-canhubk3/src/timer_config.cpp b/boards/nxp/mr-canhubk3/src/timer_config.cpp deleted file mode 100644 index bab0d95..0000000 --- a/boards/nxp/mr-canhubk3/src/timer_config.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016, 2018 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. - * - ****************************************************************************/ - -/* - * @file timer_config.c - * - * Configuration data for the kinetis pwm_servo, input capture and pwm input driver. - * - * Note that these arrays must always be fully-sized. - */ - -// TODO:Stubbed out for now -#include - -#include "hardware/s32k3xx_emios.h" - -#include "board_config.h" - -#include -#include - - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::EMIOS0) -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::EMIOS0, Timer::Channel0}, PIN_EMIOS0_CH0_1), - initIOTimerChannel(io_timers, {Timer::EMIOS0, Timer::Channel1}, PIN_EMIOS0_CH1_1), - initIOTimerChannel(io_timers, {Timer::EMIOS0, Timer::Channel2}, PIN_EMIOS0_CH2_1), - initIOTimerChannel(io_timers, {Timer::EMIOS0, Timer::Channel3}, PIN_EMIOS0_CH3_2), - initIOTimerChannel(io_timers, {Timer::EMIOS0, Timer::Channel4}, PIN_EMIOS0_CH4_2), - initIOTimerChannel(io_timers, {Timer::EMIOS0, Timer::Channel5}, PIN_EMIOS0_CH5_2), - initIOTimerChannel(io_timers, {Timer::EMIOS0, Timer::Channel6}, PIN_EMIOS0_CH6_1), - initIOTimerChannel(io_timers, {Timer::EMIOS0, Timer::Channel7}, PIN_EMIOS0_CH7_2), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); - -const struct io_timers_t led_pwm_timers[MAX_LED_TIMERS] = { - { - .base = S32K3XX_EMIOS0_BASE, - .clock_register = 0, - .clock_bit = 0, - .vectorno_0_3 = 0, - .vectorno_4_7 = 0, - .vectorno_8_11 = 0, - .vectorno_12_15 = 0, - .vectorno_16_19 = 0, - .vectorno_20_23 = 0, - }, - { - .base = S32K3XX_EMIOS1_BASE, - .clock_register = 0, - .clock_bit = 0, - .vectorno_0_3 = 0, - .vectorno_4_7 = 0, - .vectorno_8_11 = 0, - .vectorno_12_15 = 0, - .vectorno_16_19 = 0, - .vectorno_20_23 = 0, - }, -}; - -const struct timer_io_channels_t led_pwm_channels[MAX_TIMER_LED_CHANNELS] = { - { - .gpio_out = GPIO_LED_R, // RGB_R - .gpio_in = 0, - .timer_index = 0, - .timer_channel = 19, - }, - { - .gpio_out = GPIO_LED_G, // RGB_G - .gpio_in = 0, - .timer_index = 1, - .timer_channel = 10, - }, - { - .gpio_out = GPIO_LED_B, // RGB_B - .gpio_in = 0, - .timer_index = 1, - .timer_channel = 5, - }, -}; diff --git a/boards/nxp/mr-canhubk3/sysview.px4board b/boards/nxp/mr-canhubk3/sysview.px4board deleted file mode 100644 index d190234..0000000 --- a/boards/nxp/mr-canhubk3/sysview.px4board +++ /dev/null @@ -1,53 +0,0 @@ -# CONFIG_BOARD_ROMFSROOT is not set -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS1" -CONFIG_BOARD_SERIAL_RC="/dev/ttyS5" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS2" -CONFIG_BOARD_UAVCAN_INTERFACES=1 -CONFIG_COMMON_LIGHT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8310=y -CONFIG_DRIVERS_MAGNETOMETER_LIS3MDL=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_EXAMPLES_FAKE_GPS=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_NETMAN=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SERIAL_TEST=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y diff --git a/boards/nxp/ucans32k146/Kconfig b/boards/nxp/ucans32k146/Kconfig deleted file mode 100644 index f72f3c0..0000000 --- a/boards/nxp/ucans32k146/Kconfig +++ /dev/null @@ -1,4 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see the file kconfig-language.txt in the NuttX tools repository. -# diff --git a/boards/nxp/ucans32k146/canbootloader.px4board b/boards/nxp/ucans32k146/canbootloader.px4board deleted file mode 100644 index 4691728..0000000 --- a/boards/nxp/ucans32k146/canbootloader.px4board +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_ROMFSROOT="" -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_DRIVERS_BOOTLOADERS=y diff --git a/boards/nxp/ucans32k146/cyphal.px4board b/boards/nxp/ucans32k146/cyphal.px4board deleted file mode 100644 index a239d12..0000000 --- a/boards/nxp/ucans32k146/cyphal.px4board +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG_CYPHAL_APP_DESCRIPTOR=y -CONFIG_CYPHAL_CLIENT=y -CONFIG_CYPHAL_UORB_SENSOR_GPS_PUBLISHER=y -CONFIG_DRIVERS_CYPHAL=y diff --git a/boards/nxp/ucans32k146/default.px4board b/boards/nxp/ucans32k146/default.px4board deleted file mode 100644 index 3eb4d97..0000000 --- a/boards/nxp/ucans32k146/default.px4board +++ /dev/null @@ -1,46 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_ROMFSROOT="cannode" -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS1" -CONFIG_DRIVERS_BOOTLOADERS=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_LIGHTS_RGBLED=y -CONFIG_DRIVERS_LIGHTS_RGBLED_NCP5623C=y -CONFIG_DRIVERS_LIGHTS_RGBLED_PWM=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_BOARD_UAVCAN_INTERFACES=1 -CONFIG_DRIVERS_UAVCANNODE=y -CONFIG_DRIVERS_UWB_UWB_SR150=y -CONFIG_UAVCANNODE_ARMING_STATUS=y -CONFIG_UAVCANNODE_BEEP_COMMAND=y -CONFIG_UAVCANNODE_ESC_RAW_COMMAND=y -CONFIG_UAVCANNODE_ESC_STATUS=y -CONFIG_UAVCANNODE_FLOW_MEASUREMENT=y -CONFIG_UAVCANNODE_GNSS_FIX=y -CONFIG_UAVCANNODE_HYGROMETER_MEASUREMENT=y -CONFIG_UAVCANNODE_LIGHTS_COMMAND=y -CONFIG_UAVCANNODE_MAGNETIC_FIELD_STRENGTH=y -CONFIG_UAVCANNODE_RANGE_SENSOR_MEASUREMENT=y -CONFIG_UAVCANNODE_RAW_AIR_DATA=y -CONFIG_UAVCANNODE_RTK_DATA=y -CONFIG_UAVCANNODE_SERVO_ARRAY_COMMAND=y -CONFIG_UAVCANNODE_STATIC_PRESSURE=y -CONFIG_UAVCANNODE_STATIC_TEMPERATURE=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_SENSORS=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/nxp/ucans32k146/firmware.prototype b/boards/nxp/ucans32k146/firmware.prototype deleted file mode 100644 index cda441c..0000000 --- a/boards/nxp/ucans32k146/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 34, - "magic": "PX4FWv1", - "description": "Firmware for the ucans32k146 board", - "image": "", - "build_time": 0, - "summary": "UCANS32K146", - "version": "0.1", - "image_size": 0, - "image_maxsize": 0, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/nxp/ucans32k146/init/rc.board_defaults b/boards/nxp/ucans32k146/init/rc.board_defaults deleted file mode 100644 index 2e52bc7..0000000 --- a/boards/nxp/ucans32k146/init/rc.board_defaults +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -pwm_out mode_pwm1 start - -ifup can0 - -# Start Cyphal when enabled -if param compare -s CYPHAL_ENABLE 1 -then - cyphal start -fi diff --git a/boards/nxp/ucans32k146/init/rc.board_sensors b/boards/nxp/ucans32k146/init/rc.board_sensors deleted file mode 100644 index f6f8320..0000000 --- a/boards/nxp/ucans32k146/init/rc.board_sensors +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh -# -# board sensors init -#------------------------------------------------------------------------------ - -# Lidar-Lite on I2C -if param compare -s SENS_EN_LL40LS 2 -then - ll40ls start -X -fi - -# mappydot lidar sensor -if param compare -s SENS_EN_MPDT 1 -then - mappydot start -X -fi - -# mb12xx sonar sensor -if param greater -s SENS_EN_MB12XX 0 -then - mb12xx start -X -fi - -# Lightware i2c lidar sensor -if param greater -s SENS_EN_SF1XX 0 -then - lightware_laser_i2c start -X -fi - -# vl53l1x i2c distance sensor -if param compare -s SENS_EN_VL53L1X 1 -then - vl53l1x start -X -fi - -# compasses -hmc5883 -T -X -q start -ist8308 -X -q start -ist8310 -X -q start -lis2mdl -X -q start -lis3mdl -X -q start -qmc5883l -X -q start -rm3100 -X -q start diff --git a/boards/nxp/ucans32k146/nuttx-config/Kconfig b/boards/nxp/ucans32k146/nuttx-config/Kconfig deleted file mode 100644 index ba1be92..0000000 --- a/boards/nxp/ucans32k146/nuttx-config/Kconfig +++ /dev/null @@ -1,19 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see misc/tools/kconfig-language.txt. -# -config BOARD_HAS_PROBES - bool "Board provides GPIO or other Hardware for signaling to timing analyze." - default y - ---help--- - This board provides GPIO 6-wr-SPI_INT_N, 6-wr-SPI_CS_N, 6-wr-SPI_RDY_N as - PROBE_1-3 to provide timing signals from selected drivers. - -config BOARD_USE_PROBES - bool "Enable the use of the board provided GPIO Probes" - default n - depends on BOARD_HAS_PROBES - - ---help--- - Select to use GPIO GPIO 6-wr-SPI_INT_N, 6-wr-SPI_CS_N, 6-wr-SPI_RDY_N as PROBE_1-3 - to provide timing signals from selected drivers. diff --git a/boards/nxp/ucans32k146/nuttx-config/canbootloader/defconfig b/boards/nxp/ucans32k146/nuttx-config/canbootloader/defconfig deleted file mode 100644 index 743d632..0000000 --- a/boards/nxp/ucans32k146/nuttx-config/canbootloader/defconfig +++ /dev/null @@ -1,61 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_ARCH_LOWPUTC is not set -# CONFIG_DEV_CONSOLE is not set -# CONFIG_SERIAL is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/nxp/ucans32k146/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="s32k1xx" -CONFIG_ARCH_CHIP_S32K146=y -CONFIG_ARCH_CHIP_S32K14X=y -CONFIG_ARCH_CHIP_S32K1XX=y -CONFIG_ARCH_INTERRUPTSTACK=4096 -CONFIG_ARCH_SIZET_LONG=y -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BINFMT_DISABLE=y -CONFIG_BOARDCTL=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_LOOPSPERMSEC=3997 -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DISABLE_MOUNTPOINT=y -CONFIG_EXPERIMENTAL=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=4096 -CONFIG_INIT_STACKSIZE=4096 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_NAME_MAX=0 -CONFIG_NUNGET_CHARS=0 -CONFIG_PREALLOC_TIMERS=0 -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=126976 -CONFIG_RAM_START=0x1fff0000 -CONFIG_RAW_BINARY=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_DISABLE_BUFFERING=y -CONFIG_SYSLOG_DEFAULT=y -CONFIG_TASK_NAME_SIZE=0 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/nxp/ucans32k146/nuttx-config/include/board.h b/boards/nxp/ucans32k146/nuttx-config/include/board.h deleted file mode 100644 index f8990c2..0000000 --- a/boards/nxp/ucans32k146/nuttx-config/include/board.h +++ /dev/null @@ -1,195 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k1xx/ucans32k146/include/board.h - * - * Copyright (C) 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -#ifndef __BOARDS_ARM_RDDRONE_UAVCAN146_INCLUDE_BOARD_H -#define __BOARDS_ARM_RDDRONE_UAVCAN146_INCLUDE_BOARD_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#ifndef __ASSEMBLY__ -# include -# include -#endif - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Clocking *****************************************************************/ - -/* The UCANS32K146 is fitted with a 8MHz Crystal */ - -#define BOARD_XTAL_FREQUENCY 8000000 - -#define BOARD_FTM_FREQ 8000000 - -/* The S32K146 will run at 112MHz */ - -/* LED definitions **********************************************************/ - -/* The UCANS32K146 has one RGB LED: - * - * RedLED PTD15 (FTM0 CH0) - * GreenLED PTD16 (FTM0 CH1) - * BlueLED PTD0 (FTM0 CH2) - * - * If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in - * any way. The following definitions are used to access individual RGB - * components. - * - * The RGB components could, alternatively be controlled through PWM using - * the common RGB LED driver. - */ - -/* LED index values for use with board_userled() */ - -#define BOARD_LED_R 0 -#define BOARD_LED_G 1 -#define BOARD_LED_B 2 -#define BOARD_NLEDS 3 - -/* LED bits for use with board_userled_all() */ - -#define BOARD_LED_R_BIT (1 << BOARD_LED_R) -#define BOARD_LED_G_BIT (1 << BOARD_LED_G) -#define BOARD_LED_B_BIT (1 << BOARD_LED_B) - -/* Board revision detection pin - * 0 equals UCANS32K146-01 - * 1 equals UCANS32K146B - */ -#define BOARD_REVISION_DETECT_PIN (GPIO_INPUT | PIN_PORTA | PIN10 ) - -/* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LEDs on board - * the UCANS32K146. The following definitions describe how NuttX - * controls the LEDs: - * - * SYMBOL Meaning LED state - * RED GREEN BLUE - * ------------------- ---------------------------- ----------------- - */ - -#define LED_STARTED 1 /* NuttX has been started OFF OFF OFF */ -#define LED_HEAPALLOCATE 2 /* Heap has been allocated OFF OFF ON */ -#define LED_IRQSENABLED 0 /* Interrupts enabled OFF OFF ON */ -#define LED_STACKCREATED 3 /* Idle stack created OFF ON OFF */ -#define LED_INIRQ 0 /* In an interrupt (no change) */ -#define LED_SIGNAL 0 /* In a signal handler (no change) */ -#define LED_ASSERTION 0 /* An assertion failed (no change) */ -#define LED_PANIC 4 /* The system has crashed FLASH OFF OFF */ -#undef LED_IDLE /* UCANS32K146 in sleep mode (Not used) */ - -/* Button definitions *******************************************************/ - -/* The UCANS32K146 supports two buttons: - * - * SW3 PTC14 - */ - -#define BUTTON_SW3 0 -#define NUM_BUTTONS 1 - -#define BUTTON_SW3_BIT (1 << BUTTON_SW3) - -/* Alternate function pin selections ****************************************/ - -/* By default, the serial console will be provided on the OpenSDA VCOM port: - * - * OpenSDA UART TX PTC7 (LPUART1_TX) - * OpenSDA UART RX PTC6 (LPUART1_RX) - */ - -#define PIN_LPUART0_CTS PIN_LPUART0_CTS_2 /* PTC8 */ -#define PIN_LPUART0_RTS (GPIO_OUTPUT | PIN_PORTC | PIN9 ) // PIN_LPUART0_RTS_2 /* PTC9 */ -#define PIN_LPUART0_RX PIN_LPUART0_RX_1 /* PTB0 */ -#define PIN_LPUART0_TX PIN_LPUART0_TX_1 /* PTB1 */ - -#define PIN_LPUART1_RX PIN_LPUART1_RX_1 /* PTC6 */ -#define PIN_LPUART1_TX PIN_LPUART1_TX_1 /* PTC7 */ - -/* SPI selections ***********************************************************/ - -#define PIN_LPSPI0_SCK PIN_LPSPI0_SCK_3 /* PTB2 */ -#define PIN_LPSPI0_MISO PIN_LPSPI0_SIN_2 /* PTB3 */ -#define PIN_LPSPI0_MOSI PIN_LPSPI0_SOUT_3 /* PTB4 */ -#define PIN_LPSPI0_PCS PIN_LPSPI0_PCS0_2 /* PTB5 */ - -/* I2C selections ***********************************************************/ - -#define PIN_LPI2C0_SCL PIN_LPI2C0_SCL_2 /* PTA3 */ -#define PIN_LPI2C0_SDA PIN_LPI2C0_SDA_2 /* PTA2 */ - -/* CAN selections ***********************************************************/ -#define PIN_CAN0_TX PIN_CAN0_TX_4 /* PTE5 */ -#define PIN_CAN0_RX PIN_CAN0_RX_4 /* PTE4 */ -#define PIN_CAN0_STB (GPIO_OUTPUT | PIN_PORTE | PIN11 ) -#define PIN_CAN0_ERRN (GPIO_INPUT | PIN_PORTA | PIN11 ) -#define PIN_CAN0_EN (GPIO_HIGHDRIVE | PIN_PORTA | PIN10 ) -#define PIN_CAN1_TX PIN_CAN1_TX_1 /* PTA13 */ -#define PIN_CAN1_RX PIN_CAN1_RX_1 /* PTA12 */ -#define PIN_CAN1_STB (GPIO_OUTPUT | PIN_PORTE | PIN10 ) -#define PIN_CAN1_ERRN (GPIO_PULLDOWN | PIN_PORTE | PIN6 ) -#define PIN_CAN1_EN (GPIO_OUTPUT | PIN_PORTE | PIN2 ) - -/* Board provides GPIO or other Hardware for signaling to timing analyzer */ - -#if defined(CONFIG_BOARD_USE_PROBES) -# include "s32k1xx_pin.h" -# include "hardware/s32k1xx_pinmux.h" -# define PROBE_N(n) (1<<((n)-1)) -# define PROBE_1 (PIN_PTE0 | GPIO_OUTPUT) /* 6-wr-SPI_RDY_N */ -# define PROBE_2 (PIN_PTE9 | GPIO_OUTPUT) /* 6-wr-SPI_INT_N */ -# define PROBE_3 (PIN_PTB5 | GPIO_OUTPUT) /* 6-wr-SPI_CS_N */ - -# define PROBE_INIT(mask) \ - do { \ - if ((mask)& PROBE_N(1)) { s32k1xx_pinconfig(PROBE_1); } \ - if ((mask)& PROBE_N(2)) { s32k1xx_pinconfig(PROBE_2); } \ - if ((mask)& PROBE_N(3)) { s32k1xx_pinconfig(PROBE_3); } \ - } while(0) - -# define PROBE(n,s) do {s32k1xx_gpiowrite(PROBE_##n,(s));}while(0) -# define PROBE_MARK(n) PROBE(n,false);PROBE(n,true) -#else -# define PROBE_INIT(mask) -# define PROBE(n,s) -# define PROBE_MARK(n) -#endif - -#endif /* __BOARDS_ARM_RDDRONE_UAVCAN146_INCLUDE_BOARD_H */ diff --git a/boards/nxp/ucans32k146/nuttx-config/nsh/defconfig b/boards/nxp/ucans32k146/nuttx-config/nsh/defconfig deleted file mode 100644 index b66b8e0..0000000 --- a/boards/nxp/ucans32k146/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,140 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_FS_PROCFS_EXCLUDE_ENVIRON is not set -# CONFIG_NET_ETHERNET is not set -# CONFIG_NET_IPv4 is not set -# CONFIG_NSH_CMDOPT_HEXDUMP is not set -# CONFIG_S32K1XX_EDMA_HOE is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/nxp/ucans32k146/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="s32k1xx" -CONFIG_ARCH_CHIP_S32K146=y -CONFIG_ARCH_CHIP_S32K14X=y -CONFIG_ARCH_CHIP_S32K1XX=y -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BCH=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_LOOPSPERMSEC=3997 -CONFIG_BUILTIN=y -CONFIG_DEBUG_FEATURES=y -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DISABLE_MQUEUE=y -CONFIG_DISABLE_POSIX_TIMERS=y -CONFIG_EXAMPLES_HELLO=y -CONFIG_FS_CROMFS=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_MAX_TASKS=16 -CONFIG_FS_ROMFS=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2CTOOL_DEFFREQ=100000 -CONFIG_I2CTOOL_MAXADDR=0x7f -CONFIG_I2CTOOL_MAXBUS=0 -CONFIG_I2CTOOL_MINADDR=0x00 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=3500 -CONFIG_INTELHEX_BINARY=y -CONFIG_LIBC_STRERROR=y -CONFIG_LPI2C0_DMA=y -CONFIG_LPUART0_BAUD=38400 -CONFIG_LPUART0_IFLOWCONTROL=y -CONFIG_LPUART0_OFLOWCONTROL=y -CONFIG_LPUART0_RXBUFSIZE=600 -CONFIG_LPUART0_RXDMA=y -CONFIG_LPUART0_TXBUFSIZE=1100 -CONFIG_LPUART0_TXDMA=y -CONFIG_LPUART1_RXBUFSIZE=128 -CONFIG_LPUART1_RXDMA=y -CONFIG_LPUART1_SERIAL_CONSOLE=y -CONFIG_LPUART1_TXBUFSIZE=128 -CONFIG_LPUART1_TXDMA=y -CONFIG_MOTOROLA_SREC=y -CONFIG_MTD=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_PARTITION_NAMES=y -CONFIG_NET=y -CONFIG_NETDEV_IFINDEX=y -CONFIG_NET_CAN=y -CONFIG_NET_CAN_NOTIFIER=y -CONFIG_NET_CAN_RAW_TX_DEADLINE=y -CONFIG_NET_CAN_SOCK_OPTS=y -CONFIG_NET_TIMESTAMP=y -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_DISABLE_PRINTF=y -CONFIG_NSH_DISABLE_TRUNCATE=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_PREALLOC_TIMERS=4 -CONFIG_PSEUDOTERM=y -CONFIG_RAM_SIZE=126976 -CONFIG_RAM_START=0x1fff0000 -CONFIG_RAW_BINARY=y -CONFIG_RR_INTERVAL=200 -CONFIG_RTC=y -CONFIG_S32K1XX_EDMA=y -CONFIG_S32K1XX_EDMA_EDBG=y -CONFIG_S32K1XX_EDMA_ELINK=y -CONFIG_S32K1XX_EDMA_NTCD=64 -CONFIG_S32K1XX_EEEPROM=y -CONFIG_S32K1XX_FLEXCAN0=y -CONFIG_S32K1XX_FLEXCAN1=y -CONFIG_S32K1XX_GPIOIRQ=y -CONFIG_S32K1XX_LPI2C0=y -CONFIG_S32K1XX_LPI2C_DMA=y -CONFIG_S32K1XX_LPI2C_DYNTIMEO=y -CONFIG_S32K1XX_LPSPI0=y -CONFIG_S32K1XX_LPSPI0_DMA=y -CONFIG_S32K1XX_LPSPI_DMA=y -CONFIG_S32K1XX_LPUART0=y -CONFIG_S32K1XX_LPUART1=y -CONFIG_S32K1XX_PORTAINTS=y -CONFIG_S32K1XX_PORTBINTS=y -CONFIG_S32K1XX_PORTCINTS=y -CONFIG_S32K1XX_PORTDINTS=y -CONFIG_S32K1XX_PORTEINTS=y -CONFIG_S32K1XX_RTC=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SPITOOL_MAXBUS=2 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=18 -CONFIG_START_MONTH=8 -CONFIG_START_YEAR=2019 -CONFIG_STDIO_DISABLE_BUFFERING=y -CONFIG_SYMTAB_ORDEREDBYNAME=y -CONFIG_SYSTEM_I2CTOOL=y -CONFIG_SYSTEM_NSH=y -CONFIG_SYSTEM_SPITOOL=y -CONFIG_WATCHDOG=y diff --git a/boards/nxp/ucans32k146/nuttx-config/scripts/canbootloader_script.ld b/boards/nxp/ucans32k146/nuttx-config/scripts/canbootloader_script.ld deleted file mode 100644 index fa80261..0000000 --- a/boards/nxp/ucans32k146/nuttx-config/scripts/canbootloader_script.ld +++ /dev/null @@ -1,158 +0,0 @@ -/**************************************************************************** - * nuttx-config/scripts/canbootloader_script.ld - * - * Copyright (C) 2021 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The S32K146 has 1Mb of FLASH beginning at address 0x0000:0000 and - * 124Kb of SRAM beginning at address 0x1fff:0000 (plus 4Kb of FlexRAM) - * - * The on-chip RAM is split in two regions: SRAM_L and SRAM_U. The RAM is - * implemented such that the SRAM_L and SRAM_U ranges form a contiguous - * block in the memory map - * - * SRAM_L 1fff0000 - 1fffffff 64Kb - * SRAM_U 20000000 - 2000efff 60Kb - */ - -/* 6 4Kib Sectors 24 Kib for the bootloader - * paramater storace is in eeprom (dflash) - */ - -MEMORY -{ - vflash (rx) : ORIGIN = 0x00000000, LENGTH = 1K - pflash (rx) : ORIGIN = 0x00000400, LENGTH = 16 - pflash1 (rx) : ORIGIN = 0x00000410, LENGTH = 24K-(1K + 16) - dflash (rx) : ORIGIN = 0x10000000, LENGTH = 64K - sram (rwx) : ORIGIN = 0x1fff0000, LENGTH = 124K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -EXTERN(g_flashcfg) -ENTRY(_stext) - -SECTIONS -{ - .vectors : - { - _stext = ABSOLUTE(.); - *(.vectors) - } > vflash - - .flashcfg : - { - *(.flashcfg) - } > pflash - - .text : - { - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > pflash1 - - .init_section : - { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > pflash1 - - .ARM.extab : - { - *(.ARM.extab*) - } >pflash1 - - .ARM.exidx : - { - __exidx_start = ABSOLUTE(.); - *(.ARM.exidx*) - __exidx_end = ABSOLUTE(.); - } >pflash1 - - .data : - { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - . = ALIGN(4); - _edata = ABSOLUTE(.); - } > sram AT > pflash1 - - _eronly = LOADADDR(.data); - - .ramfunc ALIGN(4): - { - _sramfuncs = ABSOLUTE(.); - *(.ramfunc .ramfunc.*) - _eramfuncs = ABSOLUTE(.); - } > sram AT > pflash1 - - _framfuncs = LOADADDR(.ramfunc); - - .bss : - { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/nxp/ucans32k146/nuttx-config/scripts/s32k146.cfg b/boards/nxp/ucans32k146/nuttx-config/scripts/s32k146.cfg deleted file mode 100644 index 749facc..0000000 --- a/boards/nxp/ucans32k146/nuttx-config/scripts/s32k146.cfg +++ /dev/null @@ -1,58 +0,0 @@ -# -# NXP S32K146 - 1x ARM Cortex-M4 @ up to 180 MHz -# - -adapter_khz 4000 -transport select swd - -if { [info exists CHIPNAME] } { - set _CHIPNAME $CHIPNAME -} else { - set _CHIPNAME s32k146 -} - -# -# M4 JTAG mode TAP -# -if { [info exists M4_JTAG_TAPID] } { - set _M4_JTAG_TAPID $M4_JTAG_TAPID -} else { - set _M4_JTAG_TAPID 0x4ba00477 -} - -# -# M4 SWD mode TAP -# -if { [info exists M4_SWD_TAPID] } { - set _M4_SWD_TAPID $M4_SWD_TAPID -} else { - set _M4_SWD_TAPID 0x2ba01477 -} - -source [find target/swj-dp.tcl] - -if { [using_jtag] } { - set _M4_TAPID $_M4_JTAG_TAPID -} else { - set _M4_TAPID $_M4_SWD_TAPID -} - -swj_newdap $_CHIPNAME m4 -irlen 4 -ircapture 0x1 -irmask 0xf \ - -expected-id $_M4_TAPID - -target create $_CHIPNAME.m4 cortex_m -chain-position $_CHIPNAME.m4 - -# S32K146 has 64+60 KB contiguous SRAM -if { [info exists WORKAREASIZE] } { - set _WORKAREASIZE $WORKAREASIZE -} else { - set _WORKAREASIZE 0x1F000 -} -$_CHIPNAME.m4 configure -work-area-phys 0x1FFF0000 \ - -work-area-size $_WORKAREASIZE -work-area-backup 0 - -$_CHIPNAME.m4 configure -rtos nuttx - -if { ![using_hla] } { - cortex_m reset_config vectreset -} diff --git a/boards/nxp/ucans32k146/nuttx-config/scripts/script.ld b/boards/nxp/ucans32k146/nuttx-config/scripts/script.ld deleted file mode 100644 index b259606..0000000 --- a/boards/nxp/ucans32k146/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,177 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k1xx/ucans32k146/scripts/flash.ld - * - * Copyright (C) 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The S32K146 has 1Mb of FLASH beginning at address 0x0000:0000 and - * 124Kb of SRAM beginning at address 0x1fff:0000 (plus 4Kb of FlexRAM) - * - * The on-chip RAM is split in two regions: SRAM_L and SRAM_U. The RAM is - * implemented such that the SRAM_L and SRAM_U ranges form a contiguous - * block in the memory map - * - * SRAM_L 1fff0000 - 1fffffff 64Kb - * SRAM_U 20000000 - 2000efff 60Kb - */ - -/* 6 4Kib Sectors 24 Kib for the bootloader - * paramater storace is in eeprom (dflash) - */ - -MEMORY -{ - vflash (rx) : ORIGIN = 0x00006000, LENGTH = 1K - pflash (rx) : ORIGIN = 0x00006400, LENGTH = 16 - pflash1 (rx) : ORIGIN = 0x00006410, LENGTH = 1024K-(24K + 1K + 16) - dflash (rx) : ORIGIN = 0x10000000, LENGTH = 64K - sram (rwx) : ORIGIN = 0x1fff0000, LENGTH = 124K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -EXTERN(g_flashcfg) -EXTERN(board_get_manifest) - -ENTRY(_stext) - -SECTIONS -{ - .vectors : - { - _stext = ABSOLUTE(.); - KEEP(*(.vectors)) - } > vflash - - .flashcfg : - { - *(.flashcfg) - } > pflash - - .text : - { - . = ALIGN(8); - /* - * This section positions the app_descriptor_t used - * by the make_can_boot_descriptor.py tool to set - * the application image's descriptor so that the - * uavcan bootloader has the ability to validate the - * image crc, size etc - */ - KEEP(*(.app_descriptor)) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - . = ALIGN(8); - FILL(0xff) - . += 8; - } > pflash1 = 0xff - - .init_section : - { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > pflash1 - - .ARM.extab : - { - *(.ARM.extab*) - } >pflash1 - - .ARM.exidx : - { - __exidx_start = ABSOLUTE(.); - *(.ARM.exidx*) - __exidx_end = ABSOLUTE(.); - } >pflash1 - - .data : - { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - . = ALIGN(4); - _edata = ABSOLUTE(.); - . = ALIGN(8); - FILL(0xff) - . += 8; - } > sram AT > pflash1 = 0xff - - _eronly = LOADADDR(.data); - - .ramfunc ALIGN(4): - { - _sramfuncs = ABSOLUTE(.); - *(.ramfunc .ramfunc.*) - _eramfuncs = ABSOLUTE(.); - . = ALIGN(8); - FILL(0xff) - . += 8; - } > sram AT > pflash1 = 0xff - - _framfuncs = LOADADDR(.ramfunc); - - .bss : - { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/nxp/ucans32k146/nuttx-config/scripts/sram.ld b/boards/nxp/ucans32k146/nuttx-config/scripts/sram.ld deleted file mode 100644 index 61afa40..0000000 --- a/boards/nxp/ucans32k146/nuttx-config/scripts/sram.ld +++ /dev/null @@ -1,129 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k1xx/ucans32k146/scripts/sram.ld - * - * Copyright (C) 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The S32K146 has 1Mb of FLASH beginning at address 0x0000:0000 and - * 124Kb of SRAM beginning at address 0x1fff:0000 (plus 4Kb of FlexRAM) - * - * The on-chip RAM is split in two regions: SRAM_L and SRAM_U. The RAM is - * implemented such that the SRAM_L and SRAM_U ranges form a contiguous - * block in the memory map - * - * SRAM_L 1fff0000 - 1fffffff 64Kb - * SRAM_U 20000000 - 2000efff 60Kb - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x00000000, LENGTH = 1M - sram (rwx) : ORIGIN = 0x1fff0000, LENGTH = 124K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -SECTIONS -{ - .text : - { - _stext = ABSOLUTE(.); - *(.vectors) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - } > sram - - .init_section : - { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > sram - - .ARM.extab : - { - *(.ARM.extab*) - } >sram - - .ARM.exidx : - { - __exidx_start = ABSOLUTE(.); - *(.ARM.exidx*) - __exidx_end = ABSOLUTE(.); - } >sram - - .data : - { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - . = ALIGN(4); - _edata = ABSOLUTE(.); - } > sram - - .bss : - { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/nxp/ucans32k146/src/CMakeLists.txt b/boards/nxp/ucans32k146/src/CMakeLists.txt deleted file mode 100644 index e043e25..0000000 --- a/boards/nxp/ucans32k146/src/CMakeLists.txt +++ /dev/null @@ -1,77 +0,0 @@ -############################################################################ -# -# Copyright (c) 2016, 2018 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. -# -############################################################################ -if("${PX4_BOARD_LABEL}" STREQUAL "canbootloader") - - add_library(drivers_board - can_boot.c - led.cpp - clockconfig.c - periphclocks.c - timer_config.cpp - ) - - target_link_libraries(drivers_board - PRIVATE - nuttx_arch - nuttx_drivers - canbootloader - arch_led_pwm - ) - target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/canbootloader) - -else() - - add_library(drivers_board - autoleds.c - boot.c - bringup.c - buttons.c - clockconfig.c - i2c.cpp - init.c - mtd.cpp - periphclocks.c - spi.cpp - timer_config.cpp - userleds.c - ) - - target_link_libraries(drivers_board - PRIVATE - nuttx_arch # sdio - nuttx_drivers # sdio - drivers__led # drv_led_start - px4_layer - px4_platform # I2CBusIterator - ) -endif() diff --git a/boards/nxp/ucans32k146/src/autoleds.c b/boards/nxp/ucans32k146/src/autoleds.c deleted file mode 100644 index a762b71..0000000 --- a/boards/nxp/ucans32k146/src/autoleds.c +++ /dev/null @@ -1,162 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k1xx/ucans32k146/src/s32k1xx_autoleds.c - * - * Copyright (C) 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The UCANS32K146 has one RGB LED: - * - * RedLED PTD15 (FTM0 CH0) - * GreenLED PTD16 (FTM0 CH1) - * BlueLED PTD0 (FTM0 CH2) - * - * An output of '1' illuminates the LED. - * - * If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board - * the Freedom K66F. The following definitions describe how NuttX controls - * the LEDs: - * - * SYMBOL Meaning LED state - * RED GREEN BLUE - * ------------------- ----------------------- ----------------- - * LED_STARTED NuttX has been started OFF OFF OFF - * LED_HEAPALLOCATE Heap has been allocated OFF OFF ON - * LED_IRQSENABLED Interrupts enabled OFF OFF ON - * LED_STACKCREATED Idle stack created OFF ON OFF - * LED_INIRQ In an interrupt (no change) - * LED_SIGNAL In a signal handler (no change) - * LED_ASSERTION An assertion failed (no change) - * LED_PANIC The system has crashed FLASH OFF OFF - * LED_IDLE K66 is in sleep mode (Optional, not used) - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include - -#include -#include - -#include "arm_internal.h" -#include "arm_internal.h" - -#include "s32k1xx_pin.h" -#include "board_config.h" - -#include - -#ifdef CONFIG_ARCH_LEDS - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Summary of all possible settings */ - -#define LED_NOCHANGE 0 /* LED_IRQSENABLED, LED_INIRQ, LED_SIGNAL, LED_ASSERTION */ -#define LED_OFF_OFF_OFF 1 /* LED_STARTED */ -#define LED_OFF_OFF_ON 2 /* LED_HEAPALLOCATE */ -#define LED_OFF_ON_OFF 3 /* LED_STACKCREATED */ -#define LED_ON_OFF_OFF 4 /* LED_PANIC */ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_autoled_initialize - ****************************************************************************/ - -void board_autoled_initialize(void) -{ - /* Configure LED GPIOs for output */ - - s32k1xx_pinconfig(GPIO_LED_R); - s32k1xx_pinconfig(GPIO_LED_G); - s32k1xx_pinconfig(GPIO_LED_B); -} - -/**************************************************************************** - * Name: board_autoled_on - ****************************************************************************/ - -void board_autoled_on(int led) -{ - if (led != LED_NOCHANGE) { - bool redon = false; - bool greenon = false; - bool blueon = false; - - switch (led) { - default: - case LED_OFF_OFF_OFF: - break; - - case LED_OFF_OFF_ON: - blueon = true; - break; - - case LED_OFF_ON_OFF: - greenon = true; - break; - - case LED_ON_OFF_OFF: - redon = true; - break; - } - - s32k1xx_gpiowrite(GPIO_LED_R, redon); - s32k1xx_gpiowrite(GPIO_LED_G, greenon); - s32k1xx_gpiowrite(GPIO_LED_B, blueon); - } -} - -/**************************************************************************** - * Name: board_autoled_off - ****************************************************************************/ - -void board_autoled_off(int led) -{ - if (led == LED_ON_OFF_OFF) { - s32k1xx_gpiowrite(GPIO_LED_R, true); - s32k1xx_gpiowrite(GPIO_LED_G, false); - s32k1xx_gpiowrite(GPIO_LED_B, false); - } -} - -#endif /* CONFIG_ARCH_LEDS */ diff --git a/boards/nxp/ucans32k146/src/board_config.h b/boards/nxp/ucans32k146/src/board_config.h deleted file mode 100644 index d3b7a46..0000000 --- a/boards/nxp/ucans32k146/src/board_config.h +++ /dev/null @@ -1,186 +0,0 @@ -/**************************************************************************** - * - * - * Copyright (C) 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * NXP ucans32k146 internal definitions - */ - -#pragma once - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include - -#include - -__BEGIN_DECLS - -/* these headers are not C++ safe */ -#include "hardware/s32k1xx_pinmux.h" -#include "s32k1xx_periphclocks.h" -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Configuration ************************************************************/ - -/* UCANS32K146 GPIOs **************************************************/ - -/* LEDs. The UCANS32K146 has one RGB LED: - * - * RedLED PTD15 (FTM0 CH0) - * GreenLED PTD16 (FTM0 CH1) - * BlueLED PTD0 (FTM0 CH2) - * - * An output of '1' illuminates the LED. - */ - -#define GPIO_LED_R (PIN_PTD15 | GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO) -#define GPIO_LED_G (PIN_PTD16 | GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO) -#define GPIO_LED_B (PIN_PTD0 | GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO) - -/* Buttons. The UCANS32K146 supports one button: - * - * SW3 PTC14 - */ - -#define GPIO_SW3 (PIN_PTC14 | PIN_INT_BOTH) - -/* SPI chip selects */ - -/* High-resolution timer */ -#define HRT_TIMER 5 /* FTM timer for the HRT */ -#define HRT_TIMER_CHANNEL 0 /* Use capture/compare channel 0 */ - -/* Timer I/O PWM and capture - * - * 2 PWM outputs are configured. - * ?? Timer inputs are configured. - * - * Pins: - * Defined in board.h - */ - -#define DIRECT_PWM_OUTPUT_CHANNELS 2 - - -#define BOARD_HAS_LED_PWM 1 -#define BOARD_LED_PWM_DRIVE_ACTIVE_LOW 1 -#define BOARD_HAS_SHARED_PWM_TIMERS 1 - -#define LED_TIM0_CH0OUT /* PTD15 RGB_R */ PIN_FTM0_CH0_3 -#define LED_TIM0_CH1OUT /* PTD16 RGB_G */ PIN_FTM0_CH1_3 -#define LED_TIM0_CH2OUT /* PTD0 RGB_B */ PIN_FTM0_CH2_3 - -/**************************************************************************** - * Public Types - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -#ifndef __ASSEMBLY__ - -/* User peripheral configuration structure 0 */ - -extern const struct peripheral_clock_config_s g_peripheral_clockconfig0[]; - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Name: s32k1xx_bringup - * - * Description: - * Perform architecture-specific initialization - * - * CONFIG_BOARD_LATE_INITIALIZE=y : - * Called from board_late_initialize(). - * - * CONFIG_BOARD_LATE_INITIALIZE=y && CONFIG_BOARDCTL=y : - * Called from the NSH library - * - ****************************************************************************/ - -int s32k1xx_bringup(void); - -/**************************************************************************** - * Name: s32k1xx_spidev_initialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the UCANS32K146 - * board. - * - ****************************************************************************/ - -#ifdef CONFIG_S32K1XX_LPSPI0 -void s32k1xx_spidev_initialize(void); -int s32k1xx_spi_bus_initialize(void); -#endif - -/**************************************************************************************************** - * Name: board_spi_reset board_peripheral_reset - * - * Description: - * Called to reset SPI and the perferal bus - * - ****************************************************************************************************/ -void board_peripheral_reset(int ms); - -/************************************************************************************ - * Name: ucans32k_timer_initialize - * - * Description: - * Called to configure the FTM to provide 1 Mhz - * - ************************************************************************************/ - -void ucans32k_timer_initialize(void); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/nxp/ucans32k146/src/boot.c b/boards/nxp/ucans32k146/src/boot.c deleted file mode 100644 index e0928cf..0000000 --- a/boards/nxp/ucans32k146/src/boot.c +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k1xx/ucans32k146/src/s32k1xx_boot.c - * - * Copyright (C) 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include - -#include - -#include "board_config.h" - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: s32k1xx_board_initialize - * - * Description: - * All S32K1XX 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. - * - ****************************************************************************/ - -void s32k1xx_board_initialize(void) -{ -#ifdef CONFIG_ARCH_LEDS - /* Configure on-board LEDs if LED support has been selected. */ - - board_autoled_initialize(); -#endif - ucans32k_timer_initialize(); - -} - -/**************************************************************************** - * Name: board_late_initialize - * - * Description: - * If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional - * initialization call will be performed in the boot-up sequence to a - * function called board_late_initialize(). board_late_initialize() will - * be called immediately after up_initialize() is called and just before - * the initial application is started. This additional initialization - * phase may be used, for example, to initialize board-specific device - * drivers. - * - ****************************************************************************/ - -#ifdef CONFIG_BOARD_LATE_INITIALIZE -void board_late_initialize(void) -{ - /* Perform board-specific initialization */ - - s32k1xx_bringup(); -} -#endif diff --git a/boards/nxp/ucans32k146/src/boot_config.h b/boards/nxp/ucans32k146/src/boot_config.h deleted file mode 100644 index 06b7077..0000000 --- a/boards/nxp/ucans32k146/src/boot_config.h +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/* - * @file boot_config.h - * - * bootloader definitions that configures the behavior and options - * of the Boot loader - * This file is relies on the parent folder's boot_config.h file and defines - * different usages of the hardware for bootloading - */ - -#pragma once - - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -/* Bring in the board_config.h definitions - * todo:make this be pulled in from a targed's build - * files in nuttx*/ - -#include "board_config.h" -#include "uavcan.h" -#include - -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define OPT_PREFERRED_NODE_ID ANY_NODE_ID - -//todo:wrap OPT_x in in ifdefs for command line definitions -#define OPT_TBOOT_MS 5000 -#define OPT_NODE_STATUS_RATE_MS 800 -#define OPT_NODE_INFO_RATE_MS 50 -#define OPT_BL_NUMBER_TIMERS 7 -#undef S_RGB_LED_DMA // use the poled one -/* - * This Option set is set to 1 ensure a provider of firmware has an - * opportunity update the node's firmware. - * This Option is the default policy and can be overridden by - * a jumper - * When this Policy is set, the node will ignore tboot and - * wait indefinitely for a GetNodeInfo request before booting. - * - * OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO_INVERT is used to allow - * the polarity of the jumper to be True Active - * - * wait OPT_WAIT_FOR_GETNODEINFO OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO - * Jumper - * yes 1 0 x - * yes 1 1 Active - * no 1 1 Not Active - * no 0 0 X - * yes 0 1 Active - * no 0 1 Not Active - * - */ -#define OPT_WAIT_FOR_GETNODEINFO 0 -#define OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO 1 -#define OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO_INVERT 0 - -#define OPT_ENABLE_WD 1 - -#define OPT_RESTART_TIMEOUT_MS 20000 - -/* Reserved for the Booloader */ -#define OPT_BOOTLOADER_SIZE_IN_K (24 * 1024) - -/* Reserved for the application out of the total - * system flash minus the BOOTLOADER_SIZE_IN_K - */ -#define OPT_APPLICATION_RESERVER_IN_K (0) - -#define OPT_APPLICATION_IMAGE_OFFSET OPT_BOOTLOADER_SIZE_IN_K -#define OPT_APPLICATION_IMAGE_LENGTH (FLASH_SIZE-(OPT_BOOTLOADER_SIZE_IN_K + OPT_APPLICATION_RESERVER_IN_K)) - - -#define FLASH_BASE 0 -#define FLASH_SIZE (1024*1024) - -#define APPLICATION_LOAD_ADDRESS (FLASH_BASE + OPT_APPLICATION_IMAGE_OFFSET) -#define APPLICATION_SIZE (FLASH_SIZE-OPT_APPLICATION_IMAGE_OFFSET) -#define APPLICATION_LAST_8BIT_ADDRRESS ((uint8_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint8_t))) -#define APPLICATION_LAST_32BIT_ADDRRESS ((uint32_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint32_t))) -#define APPLICATION_LAST_64BIT_ADDRRESS ((uint64_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint64_t))) - -#define OPT_USE_YIELD -#define OPT_LATER_FLAHSED_WORDS 2 - -/* Bootloader Option***************************************************************** - * - */ -#define GPIO_GETNODEINFO_JUMPER (PIN_PTC14) diff --git a/boards/nxp/ucans32k146/src/bringup.c b/boards/nxp/ucans32k146/src/bringup.c deleted file mode 100644 index b74f218..0000000 --- a/boards/nxp/ucans32k146/src/bringup.c +++ /dev/null @@ -1,173 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k1xx/ucans32k146/src/s32k1xx_bringup.c - * - * Copyright (C) 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include - -#ifdef CONFIG_BUTTONS -# include -#endif - -#ifdef CONFIG_USERLED -# include -#endif - -#ifdef CONFIG_I2C_DRIVER -# include "s32k1xx_pin.h" -# include -# include "s32k1xx_lpi2c.h" -#endif - -#ifdef CONFIG_S32K1XX_EEEPROM -# include "s32k1xx_eeeprom.h" -#endif - -#include "board_config.h" - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: s32k1xx_bringup - * - * Description: - * Perform architecture-specific initialization - * - * CONFIG_BOARD_LATE_INITIALIZE=y : - * Called from board_late_initialize(). - * - * CONFIG_BOARD_LATE_INITIALIZE=n && CONFIG_BOARDCTL=y : - * Called from the NSH library - * - ****************************************************************************/ - -int s32k1xx_bringup(void) -{ - int ret = OK; - -#ifdef CONFIG_BUTTONS - /* Register the BUTTON driver */ - - ret = btn_lower_initialize("/dev/buttons"); - - if (ret < 0) { - syslog(LOG_ERR, "ERROR: btn_lower_initialize() failed: %d\n", ret); - } - -#endif - -#ifdef CONFIG_USERLED - /* Register the LED driver */ - - ret = userled_lower_initialize("/dev/userleds"); - - if (ret < 0) { - syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret); - } - -#endif - -#ifdef CONFIG_FS_PROCFS - /* Mount the procfs file system */ - - ret = mount(NULL, "/proc", "procfs", 0, NULL); - - if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to mount procfs at /proc: %d\n", ret); - } - -#endif - -#ifdef CONFIG_S32K1XX_EEEPROM - /* Register EEEPROM block device */ - - s32k1xx_eeeprom_register(0, 4096); -#endif - -#ifdef CONFIG_S32K1XX_LPSPI0 - /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak - * function s32k1xx_spidev_initialize() has been brought into the link. - */ - - s32k1xx_spidev_initialize(); - s32k1xx_spi_bus_initialize(); -#endif - -#if defined(CONFIG_S32K1XX_LPI2C0) -#if defined(CONFIG_I2C_DRIVER) - FAR struct i2c_master_s *i2c; - i2c = s32k1xx_i2cbus_initialize(0); - - if (i2c == NULL) { - serr("ERROR: Failed to get I2C0 interface\n"); - - } else { - ret = i2c_register(i2c, 0); - - if (ret < 0) { - serr("ERROR: Failed to register I2C0 driver: %d\n", ret); - s32k1xx_i2cbus_uninitialize(i2c); - } - } - -#endif -#endif - -#ifdef CONFIG_S32K1XX_FLEXCAN - s32k1xx_pinconfig(BOARD_REVISION_DETECT_PIN); - - if (s32k1xx_gpioread(BOARD_REVISION_DETECT_PIN)) { - /* STB high -> active CAN phy */ - s32k1xx_pinconfig(PIN_CAN0_STB | GPIO_OUTPUT_ONE); - s32k1xx_pinconfig(PIN_CAN1_STB | GPIO_OUTPUT_ONE); - - } else { - /* STB low -> active CAN phy */ - s32k1xx_pinconfig(PIN_CAN0_STB | GPIO_OUTPUT_ZERO); - s32k1xx_pinconfig(PIN_CAN1_STB | GPIO_OUTPUT_ZERO); - } - -#endif - - return ret; -} diff --git a/boards/nxp/ucans32k146/src/buttons.c b/boards/nxp/ucans32k146/src/buttons.c deleted file mode 100644 index 4099b80..0000000 --- a/boards/nxp/ucans32k146/src/buttons.c +++ /dev/null @@ -1,151 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k1xx/ucans32k146/src/s32k1xx_buttons.c - * - * Copyright (C) 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The UCANS32K146 supports one button: - * - * SW3 PTC14 - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include - -#include -#include - -#include "s32k1xx_pin.h" -#include "board_config.h" - -#include - -#ifdef CONFIG_ARCH_BUTTONS - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_button_initialize - * - * Description: - * board_button_initialize() must be called to initialize button resources. - * After that, board_buttons() may be called to collect the current state - * of all buttons or board_button_irq() may be called to register button - * interrupt handlers. - * - ****************************************************************************/ - -void board_button_initialize(void) -{ - /* Configure the GPIO pins as interrupting inputs. */ - - s32k1xx_pinconfig(GPIO_SW3); -} - -/**************************************************************************** - * Name: board_buttons - ****************************************************************************/ - -uint32_t board_buttons(void) -{ - uint32_t ret = 0; - - if (s32k1xx_gpioread(GPIO_SW3)) { - ret |= BUTTON_SW3_BIT; - } - - return ret; -} - -/**************************************************************************** - * Button support. - * - * Description: - * board_button_initialize() must be called to initialize button resources. - * After that, board_buttons() may be called to collect the current state - * of all buttons or board_button_irq() may be called to register button - * interrupt handlers. - * - * After board_button_initialize() has been called, board_buttons() may be - * called to collect the state of all buttons. board_buttons() returns a - * 32-bit bit set with each bit associated with a button. See the - * BUTTON_*_BIT definitions in board.h for the meaning of each bit. - * - * board_button_irq() may be called to register an interrupt handler that - * will be called when a button is depressed or released. The ID value is - * a button enumeration value that uniquely identifies a button resource. - * See the BUTTON_* definitions in board.h for the meaning of enumeration - * value. - * - ****************************************************************************/ - -#ifdef CONFIG_ARCH_IRQBUTTONS -int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) -{ - uint32_t pinset; - int ret; - - /* Map the button id to the GPIO bit set. */ - - if (id == BUTTON_SW3) { - pinset = GPIO_SW3; - - } else { - return -EINVAL; - } - - /* The button has already been configured as an interrupting input (by - * board_button_initialize() above). - * - * Attach the new button handler. - */ - - ret = s32k1xx_pinirqattach(pinset, irqhandler, NULL); - - if (ret >= 0) { - /* Then make sure that interrupts are enabled on the pin */ - - s32k1xx_pinirqenable(pinset); - } - - return ret; -} -#endif -#endif /* CONFIG_ARCH_BUTTONS */ diff --git a/boards/nxp/ucans32k146/src/can_boot.c b/boards/nxp/ucans32k146/src/can_boot.c deleted file mode 100644 index f6878bd..0000000 --- a/boards/nxp/ucans32k146/src/can_boot.c +++ /dev/null @@ -1,257 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 PX4 Development Team. All rights reserved. - * Author: David Sidrane - * - * 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include "boot_config.h" -#include "board.h" -#include "led.h" - -#include -#include -#include - -#include - -#include "s32k1xx_periphclocks.h" -#include "s32k1xx_flexcan.h" - -/************************************************************************************ - * 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 s32k1xx_board_initialize(void) -{ - struct peripheral_clock_config_s c; - c.clkname = FLEXCAN0_CLK, - c.clkgate = true, - // CAN clocking - s32k1xx_periphclocks(1, &c); - // Can GPIO - s32k1xx_pinconfig(PIN_CAN0_TX); - s32k1xx_pinconfig(PIN_CAN0_RX); - - s32k1xx_pinconfig(BOARD_REVISION_DETECT_PIN); - - if (s32k1xx_gpioread(BOARD_REVISION_DETECT_PIN)) { - /* Config Pins to do CAN tranceiver HW selftest */ - s32k1xx_pinconfig(PIN_CAN0_ERRN); - s32k1xx_pinconfig(PIN_CAN0_STB); - s32k1xx_pinconfig(PIN_CAN0_EN); - - /* EN high & STB high -> normal mode */ - s32k1xx_gpiowrite(PIN_CAN0_STB, 1); - s32k1xx_gpiowrite(PIN_CAN0_EN, 1); - up_udelay(3000); // Wait for startup to normal mode - - /* EN low & STB high -> listen only mode */ - s32k1xx_gpiowrite(PIN_CAN0_STB, 1); - s32k1xx_gpiowrite(PIN_CAN0_EN, 0); - up_udelay(100); // t moch ERRN_N - - /* Check for HW err and wait untill ERR has been cleared */ - while (!s32k1xx_gpioread(PIN_CAN0_ERRN)) { - board_indicate(hardware_failure); - s32k1xx_gpiowrite(PIN_CAN0_EN, 1); - up_udelay(50); - s32k1xx_gpiowrite(PIN_CAN0_EN, 0); - up_udelay(50); - } - - /* Enter normal-mode */ - s32k1xx_gpiowrite(PIN_CAN0_EN, 1); - - } else { - /* STB low -> active CAN phy */ - s32k1xx_pinconfig(PIN_CAN0_STB | GPIO_OUTPUT_ZERO); - } - - //s32k1xx_gpiowrite -#if defined(OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO) - s32k1xx_pinconfig(GPIO_GETNODEINFO_JUMPER); -#endif - ucans32k_timer_initialize(); -} - -/************************************************************************************ - * Name: board_deinitialize - * - * Description: - * This function is called by the bootloader code prior to booting - * the application. Is should place the HW into an benign initialized state. - * - ************************************************************************************/ - -void board_deinitialize(void) -{ - uint32_t regval = getreg32(S32K1XX_CAN0_MCR); - regval |= CAN_MCR_MDIS; - putreg32(regval, S32K1XX_CAN0_MCR); - - - do { - regval = getreg32(S32K1XX_CAN0_MCR); - up_udelay(10); - } while ((regval & CAN_MCR_LPMACK) == 0); - - - if (s32k1xx_gpioread(BOARD_REVISION_DETECT_PIN)) { - /* STB high -> standby CAN phy */ - s32k1xx_pinconfig(PIN_CAN0_STB | GPIO_OUTPUT_ZERO); - - } else { - /* STB low -> standby CAN phy */ - s32k1xx_pinconfig(PIN_CAN0_STB | GPIO_OUTPUT_ONE); - } -} - -/**************************************************************************** - * Name: board_get_product_name - * - * Description: - * Called to retrieve the product name. The returned value is a assumed - * to be written to a pascal style string that will be length prefixed - * and not null terminated - * - * Input Parameters: - * product_name - A pointer to a buffer to write the name. - * maxlen - The maximum number of charter that can be written - * - * Returned Value: - * The length of characters written to the buffer. - * - ****************************************************************************/ - -uint8_t board_get_product_name(uint8_t *product_name, size_t maxlen) -{ - DEBUGASSERT(maxlen > UAVCAN_STRLEN(HW_UAVCAN_NAME)); - memcpy(product_name, HW_UAVCAN_NAME, UAVCAN_STRLEN(HW_UAVCAN_NAME)); - return UAVCAN_STRLEN(HW_UAVCAN_NAME); -} - -/**************************************************************************** - * Name: board_get_hardware_version - * - * Description: - * Called to retrieve the hardware version information. The function - * will first initialize the the callers struct to all zeros. - * - * Input Parameters: - * hw_version - A pointer to a uavcan_hardwareversion_t. - * - * Returned Value: - * Length of the unique_id - * - ****************************************************************************/ - -size_t board_get_hardware_version(uavcan_HardwareVersion_t *hw_version) -{ - memset(hw_version, 0, sizeof(uavcan_HardwareVersion_t)); - - hw_version->major = HW_VERSION_MAJOR; - hw_version->minor = HW_VERSION_MINOR; - - return board_get_mfguid(*(mfguid_t *) hw_version->unique_id); -} - -/**************************************************************************** - * Name: board_indicate - * - * Description: - * Provides User feedback to indicate the state of the bootloader - * on board specific hardware. - * - * Input Parameters: - * indication - A member of the uiindication_t - * - * Returned Value: - * None - * - ****************************************************************************/ -#define led(n, code, r , g , b, h) {.red = (r),.green = (g), .blue = (b),.hz = (h)} - -typedef begin_packed_struct struct led_t { - uint16_t red : 5; - uint16_t green : 6; - uint16_t blue : 5; - uint8_t hz; -} end_packed_struct led_t; - -static const led_t i2l[] = { - - led(0, off, 0, 0, 0, 0), - led(1, reset, 10, 63, 31, 255), - led(2, autobaud_start, 0, 63, 0, 1), - led(3, autobaud_end, 0, 63, 0, 2), - led(4, allocation_start, 0, 0, 31, 2), - led(5, allocation_end, 0, 63, 31, 3), - led(6, fw_update_start, 15, 63, 31, 3), - led(7, fw_update_erase_fail, 15, 63, 15, 3), - led(8, fw_update_invalid_response, 31, 0, 0, 1), - led(9, fw_update_timeout, 31, 0, 0, 2), - led(a, fw_update_invalid_crc, 31, 0, 0, 4), - led(b, jump_to_app, 0, 63, 0, 10), - led(c, hardware_failure, 31, 0, 0, 10), - -}; - -void board_indicate(uiindication_t indication) -{ - rgb_led(i2l[indication].red << 3, - i2l[indication].green << 2, - i2l[indication].blue << 3, - i2l[indication].hz); -} - -#include - -// Stubs -void watchdog_init(void) -{ - -} -void watchdog_pet(void) -{ - -} diff --git a/boards/nxp/ucans32k146/src/clockconfig.c b/boards/nxp/ucans32k146/src/clockconfig.c deleted file mode 100644 index b892215..0000000 --- a/boards/nxp/ucans32k146/src/clockconfig.c +++ /dev/null @@ -1,211 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k1xx/ucans32k146/src/s32k1xx_clockconfig.c - * - * Copyright (C) 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - * Most of the settings within this file derives from NXP sample code for - * the S32K1XX MCUs. That sample code has this licensing information: - * - * Copyright (c) 2013 - 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2018 NXP - * All rights reserved. - * - * THIS SOFTWARE IS PROVIDED BY NXP "AS IS" AND ANY EXPRESSED 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 NXP OR ITS 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include - -#include "s32k1xx_clockconfig.h" -#include "s32k1xx_start.h" -#include "board_config.h" - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/* Each S32K1XX board must provide the following initialized structure. - * This is needed to establish the initial board clocking. - */ - -const struct clock_configuration_s g_initial_clkconfig = { - .scg = - { - .sirc = - { - .range = SCG_SIRC_RANGE_HIGH, /* RANGE - High range (8 MHz) */ - .div1 = SCG_ASYNC_CLOCK_DIV_BY_1, /* SIRCDIV1 */ - .div2 = SCG_ASYNC_CLOCK_DIV_BY_1, /* SIRCDIV2 */ - .initialize = true, /* Initialize */ - .stopmode = false, /* SIRCSTEN */ - .lowpower = true, /* SIRCLPEN */ - .locked = false, /* LK */ - }, - .firc = - { - .range = SCG_FIRC_RANGE_48M, /* RANGE */ - .div1 = SCG_ASYNC_CLOCK_DIV_BY_1, /* FIRCDIV1 */ - .div2 = SCG_ASYNC_CLOCK_DIV_BY_1, /* FIRCDIV2 */ - .initialize = true, /* Initialize */ - .regulator = true, /* FIRCREGOFF */ - .locked = false, /* LK */ - }, - .sosc = - { - .mode = SCG_SOSC_MONITOR_DISABLE, /* SOSCCM */ - .gain = SCG_SOSC_GAIN_LOW, /* HGO */ - .range = SCG_SOSC_RANGE_HIGH, /* RANGE */ - .extref = SCG_SOSC_REF_OSC, /* EREFS */ - .div1 = SCG_ASYNC_CLOCK_DIV_BY_1, /* SOSCDIV1 */ - .div2 = SCG_ASYNC_CLOCK_DIV_BY_1, /* SOSCDIV2 */ - .initialize = true, /* Initialize */ - .locked = false, /* LK */ - }, - .spll = - { - .mode = SCG_SPLL_MONITOR_DISABLE, /* SPLLCM */ - .div1 = SCG_ASYNC_CLOCK_DIV_BY_1, /* SPLLDIV1 */ - .div2 = SCG_ASYNC_CLOCK_DIV_BY_2, /* SPLLDIV2 */ - .prediv = 1, /* PREDIV */ - .mult = 40, /* MULT */ - .src = 0, /* SOURCE */ - .initialize = true, /* Initialize */ - .locked = false, /* LK */ - }, - .rtc = - { - .initialize = true, /* Initialize */ - .clkin = 0, /* RTC_CLKIN */ - }, - .clockout = - { - .source = SCG_CLOCKOUT_SRC_FIRC, /* SCG CLKOUTSEL */ - .initialize = true, /* Initialize */ - }, - .clockmode = - { - .rccr = /* RCCR - Run Clock Control Register */ - { - .src = SCG_SYSTEM_CLOCK_SRC_SYS_PLL, /* SCS */ - .divslow = 3, /* DIVSLOW, range 1..16 */ - .divbus = 2, /* DIVBUS, range 1..16 */ - .divcore = 2, /* DIVCORE, range 1..16 */ - }, - .vccr = /* VCCR - VLPR Clock Control Register */ - { - .src = SCG_SYSTEM_CLOCK_SRC_SIRC, /* SCS */ - .divslow = 4, /* DIVSLOW, range 1..16 */ - .divbus = 1, /* DIVBUS, range 1..16 */ - .divcore = 2, /* DIVCORE, range 1..16 */ - }, - .hccr = - { - .src = SCG_SYSTEM_CLOCK_SRC_SYS_PLL, /* SCS */ - .divslow = 3, /* DIVSLOW, range 1..16 */ - .divbus = 2, /* DIVBUS, range 1..16 */ - .divcore = 2, /* DIVCORE, range 1..16 */ - }, - .initialize = true, /* Initialize */ - }, - }, - .sim = - { - .clockout = /* Clock Out configuration. */ - { - .source = SIM_CLKOUT_SEL_SYSTEM_SCG_CLKOUT, /* CLKOUTSEL */ - .divider = 1, /* CLKOUTDIV, range 1..8 */ - .initialize = true, /* Initialize */ - .enable = false, /* CLKOUTEN */ - }, - .lpoclk = /* Low Power Clock configuration. */ - { - .rtc_source = SIM_RTCCLK_SEL_LPO_32K, /* RTCCLKSEL */ - .lpo_source = SIM_LPO_CLK_SEL_LPO_128K, /* LPOCLKSEL */ - .initialize = true, /* Initialize */ - .lpo32k = true, /* LPO32KCLKEN */ - .lpo1k = true, /* LPO1KCLKEN */ - }, - .tclk = /* TCLK CLOCK configuration. */ - { - .tclkfreq[0] = 0, /* TCLK0 */ - .tclkfreq[1] = 0, /* TCLK1 */ - .tclkfreq[2] = 0, /* TCLK2 */ - .initialize = true, /* Initialize */ - }, - .platgate = /* Platform Gate Clock configuration. */ - { - .initialize = true, /* Initialize */ - .mscm = true, /* CGCMSCM */ - .mpu = true, /* CGCMPU */ - .dma = true, /* CGCDMA */ - .erm = true, /* CGCERM */ - .eim = true, /* CGCEIM */ - }, - .traceclk = /* Debug trace Clock Configuration. */ - { - .source = CLOCK_TRACE_SRC_CORE_CLK, /* TRACECLK_SEL */ - .divider = 1, /* TRACEDIV, range 1..8 */ - .initialize = true, /* Initialize */ - .enable = true, /* TRACEDIVEN */ - .fraction = false, /* TRACEFRAC */ - }, - }, - .pcc = - { - .pclks = g_peripheral_clockconfig0, /* Peripheral clock configurations */ - }, - .pmc = - { - .lpoclk = /* Low Power Clock configuration. */ - { - .trim = 0, /* Trimming value for LPO */ - .initialize = true, /* Initialize */ - .enable = true, /* Enable/disable LPO */ - }, - }, -}; diff --git a/boards/nxp/ucans32k146/src/i2c.cpp b/boards/nxp/ucans32k146/src/i2c.cpp deleted file mode 100644 index 25afc62..0000000 --- a/boards/nxp/ucans32k146/src/i2c.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(PX4_BUS_NUMBER_TO_PX4(0)), -}; diff --git a/boards/nxp/ucans32k146/src/init.c b/boards/nxp/ucans32k146/src/init.c deleted file mode 100644 index eb1f9d7..0000000 --- a/boards/nxp/ucans32k146/src/init.c +++ /dev/null @@ -1,124 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k1xx/ucans32k146/src/s32k1xx_appinit.c - * - * Copyright (C) 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include - -#include "board_config.h" - -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef OK -# define OK 0 -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initialization logic and the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -int board_app_initialize(uintptr_t arg) -{ -#ifdef CONFIG_BOARD_LATE_INITIALIZE - /* Board initialization already performed by board_late_initialize() */ - - return OK; -#else - - px4_platform_init(); - - /* Perform board-specific initialization */ - - int rv = s32k1xx_bringup(); - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return rv; -#endif -} - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - /* set the peripheral rails off */ - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ -} diff --git a/boards/nxp/ucans32k146/src/led.cpp b/boards/nxp/ucans32k146/src/led.cpp deleted file mode 100644 index 6349946..0000000 --- a/boards/nxp/ucans32k146/src/led.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 PX4 Development Team. All rights reserved. - * Author: David Sidrane - * - * 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 - -#include -#include - -#include -#include "led.h" -#include - -#include - -#include "s32k1xx_pin.h" -#include "hardware/s32k1xx_ftm.h" - -#define REG(offset) (*(volatile uint32_t *)(S32K1XX_FTM0_BASE + (offset))) - -#define rSC() REG(S32K1XX_FTM_SC_OFFSET) -#define rCNT() REG(S32K1XX_FTM_CNT_OFFSET) -#define rMOD() REG(S32K1XX_FTM_MOD_OFFSET) - -#define FTM_SRC_CLOCK_FREQ 8000000 -#define LED_PWM_FREQ 1000000 - -extern int led_pwm_servo_set(unsigned channel, uint8_t value); -extern int led_pwm_servo_init(void); - -void rgb_led(int r, int g, int b, int freqs) -{ - long fosc = FTM_SRC_CLOCK_FREQ; - long prescale = 128; - long p1s = fosc / prescale; - long p0p5s = p1s / 2; - long p = freqs == 0 ? p1s : p1s / freqs; - - static bool once = false; - - if (!once) { - once = true; - led_pwm_servo_init(); - } - - irqstate_t flags = px4_enter_critical_section(); - uint32_t save = rSC(); - rSC() = save & ~(FTM_SC_CLKS_MASK); - rMOD() = p; - rSC() = save | FTP_SC_PS_DIV128; - px4_leave_critical_section(flags); - - p = freqs == 0 ? p1s + 1 : p0p5s / freqs; - - led_pwm_servo_set(0, r * p); - led_pwm_servo_set(1, g * p); - led_pwm_servo_set(2, b * p); - - if (freqs == 0) { - rSC() |= FTM_SC_CLKS_DIS; - - } else { - rSC() &= ~FTM_SC_CLKS_DIS; - } -} diff --git a/boards/nxp/ucans32k146/src/led.h b/boards/nxp/ucans32k146/src/led.h deleted file mode 100644 index 4b9bee6..0000000 --- a/boards/nxp/ucans32k146/src/led.h +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 PX4 Development Team. All rights reserved. - * Author: David Sidrane - * - * 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. - * - ****************************************************************************/ - -__BEGIN_DECLS -void rgb_led(int r, int g, int b, int freqs); -__END_DECLS diff --git a/boards/nxp/ucans32k146/src/mtd.cpp b/boards/nxp/ucans32k146/src/mtd.cpp deleted file mode 100644 index d16cf9f..0000000 --- a/boards/nxp/ucans32k146/src/mtd.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 -#include -// KiB BS nB -static const px4_mft_device_t eerom = { // Emulated EEPROB 4K - .bus_type = px4_mft_device_t::ONCHIP, -}; - - -static const px4_mtd_entry_t fmum_eeprom = { - .device = &eerom, - .npart = 1, - .partd = { - { - .type = MTD_PARAMETERS, - .path = "/dev/eeeprom0", - .nblocks = 1 - } - }, -}; - - -static const px4_mtd_manifest_t board_mtd_config = { - .nconfigs = 1, - .entries = { - &fmum_eeprom - } -}; - -static const px4_mft_entry_s mtd_mft = { - .type = MTD, - .pmft = (void *) &board_mtd_config, -}; - -static const px4_mft_s mft = { - .nmft = 1, - .mfts = { - &mtd_mft - } -}; - -const px4_mft_s *board_get_manifest(void) -{ - return &mft; -} diff --git a/boards/nxp/ucans32k146/src/periphclocks.c b/boards/nxp/ucans32k146/src/periphclocks.c deleted file mode 100644 index cacb214..0000000 --- a/boards/nxp/ucans32k146/src/periphclocks.c +++ /dev/null @@ -1,206 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k1xx/ucans32k146/src/s32k1xx_periphclks.c - * - * Copyright (C) 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - * Most of the settings within this file derives from NXP sample code for - * the S32K1XX MCUs. That sample code has this licensing information: - * - * Copyright (c) 2013 - 2015, Freescale Semiconductor, Inc. - * Copyright 2016-2018 NXP - * All rights reserved. - * - * THIS SOFTWARE IS PROVIDED BY NXP "AS IS" AND ANY EXPRESSED 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 NXP OR ITS 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include "s32k1xx_periphclocks.h" -#include "board_config.h" - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/* Each S32K1XX board must provide the following initialized structure. - * This is needed to establish the initial peripheral clocking. - */ - -const struct peripheral_clock_config_s g_peripheral_clockconfig0[] = { - { - .clkname = DMAMUX0_CLK, -#ifdef CONFIG_S32K1XX_EDMA - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = FLEXCAN0_CLK, -#ifdef CONFIG_S32K1XX_FLEXCAN0 - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = FLEXCAN1_CLK, -#ifdef CONFIG_S32K1XX_FLEXCAN1 - .clkgate = true, -#else - .clkgate = false, -#endif - }, - { - .clkname = LPI2C0_CLK, -#ifdef CONFIG_S32K1XX_LPI2C0 - .clkgate = true, -#else - .clkgate = false, -#endif - .clksrc = CLK_SRC_SPLL_DIV2, - }, - { - .clkname = LPSPI0_CLK, -#ifdef CONFIG_S32K1XX_LPSPI0 - .clkgate = true, -#else - .clkgate = false, -#endif - .clksrc = CLK_SRC_SPLL_DIV2, - }, - { - .clkname = LPUART0_CLK, -#ifdef CONFIG_S32K1XX_LPUART0 - .clkgate = true, -#else - .clkgate = false, -#endif - .clksrc = CLK_SRC_SPLL_DIV2, - }, - { - .clkname = LPUART1_CLK, -#ifdef CONFIG_S32K1XX_LPUART1 - .clkgate = true, -#else - .clkgate = false, -#endif - .clksrc = CLK_SRC_SPLL_DIV2, - }, - { - .clkname = RTC0_CLK, -#ifdef CONFIG_S32K1XX_RTC - .clkgate = true, -#else - .clkgate = false, -#endif - .clksrc = CLK_SRC_OFF, - .frac = MULTIPLY_BY_ONE, - .divider = 1, - }, - { - .clkname = FTM0_CLK, - .clkgate = true, - .clksrc = CLK_SRC_SOSC_DIV1, - }, - { - .clkname = FTM1_CLK, - .clkgate = true, - .clksrc = CLK_SRC_SOSC_DIV1, - }, - { - .clkname = FTM2_CLK, - .clkgate = true, - .clksrc = CLK_SRC_SOSC_DIV1, - }, - { - .clkname = FTM3_CLK, - .clkgate = true, - .clksrc = CLK_SRC_SOSC_DIV1, - }, - { - .clkname = FTM4_CLK, - .clkgate = true, - .clksrc = CLK_SRC_SOSC_DIV1, - }, - { - .clkname = FTM5_CLK, - .clkgate = true, - .clksrc = CLK_SRC_SOSC_DIV1, - }, - { - .clkname = PORTA_CLK, - .clkgate = true, - }, - { - .clkname = PORTB_CLK, - .clkgate = true, - }, - { - .clkname = PORTC_CLK, - .clkgate = true, - }, - { - .clkname = PORTD_CLK, - .clkgate = true, - }, - { - .clkname = PORTE_CLK, - .clkgate = true, - }, -}; - -unsigned int const num_of_peripheral_clocks_0 = - sizeof(g_peripheral_clockconfig0) / - sizeof(g_peripheral_clockconfig0[0]); diff --git a/boards/nxp/ucans32k146/src/spi.c b/boards/nxp/ucans32k146/src/spi.c deleted file mode 100644 index e6e7520..0000000 --- a/boards/nxp/ucans32k146/src/spi.c +++ /dev/null @@ -1,200 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k1xx/ucans32k146/src/s32k1xx_spi.c - * - * Copyright (C) 2018 Gregory Nutt. All rights reserved. - * Author: Ivan Ucherdzhiev - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include -#include - -#include "arm_internal.h" - -#include "s32k1xx_config.h" -#include "s32k1xx_lpspi.h" -#include "s32k1xx_pin.h" -#include "board_config.h" - -#if defined(CONFIG_S32K1XX_LPSPI0) || defined(CONFIG_S32K1XX_LPSPI1) || \ - defined(CONFIG_S32K1XX_LPSPI2) - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: s32k1xx_spidev_initialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the UCANS32K146 - * board. - * - ****************************************************************************/ - -void weak_function s32k1xx_spidev_initialize(void) -{ -#ifdef CONFIG_S32K1XX_LPSPI0 - s32k1xx_pinconfig(PIN_LPSPI0_PCS); - -#ifdef CONFIG_SPI_DRIVER - struct spi_dev_s *g_lpspi0; - g_lpspi0 = s32k1xx_lpspibus_initialize(0); - - if (!g_lpspi0) { - spierr("ERROR: [boot] FAILED to initialize LPSPI0\n"); - } - - spi_register(g_lpspi0, 0); -#endif -#endif - -#ifdef CONFIG_S32K1XX_LPSPI1 - s32k1xx_pinconfig(PIN_LPSPI1_PCS); - -#ifdef CONFIG_SPI_DRIVER - struct spi_dev_s *g_lpspi1; - g_lpspi1 = s32k1xx_lpspibus_initialize(1); - - if (!g_lpspi1) { - spierr("ERROR: [boot] FAILED to initialize LPSPI1\n"); - } - - spi_register(g_lpspi1, 1); -#endif -#endif - -#ifdef CONFIG_S32K1XX_LPSPI2 - s32k1xx_pinconfig(PIN_LPSPI2_PCS); - -#ifdef CONFIG_SPI_DRIVER - struct spi_dev_s *g_lpspi2; - g_lpspi2 = s32k1xx_lpspibus_initialize(2); - - if (!g_lpspi2) { - spierr("ERROR: [boot] FAILED to initialize LPSPI2\n"); - } - - spi_register(g_lpspi2, 2); -#endif -#endif -} - -/**************************************************************************** - * Name: s32k1xx_lpspi0/1/2select and s32k1xx_lpspi0/1/2status - * - * Description: - * The external functions, s32k1xx_lpspi0/1/2select and - * s32k1xx_lpspi0/1/2status must be provided by board-specific logic. - * They are implementations of the select and status methods of the SPI - * interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h). - * All other methods (including s32k1xx_lpspibus_initialize()) are provided - * by common logic. To use this common SPI logic on your board: - * - * 1. Provide logic in s32k1xx_boardinitialize() to configure SPI chip - * select pins. - * 2. Provide s32k1xx_lpspi0/1/2select() and s32k1xx_lpspi0/1/2status() - * functions in your board-specific logic. These functions will perform - * chip selection and status operations using GPIOs in the way your - * board is configured. - * 3. Add a calls to s32k1xx_lpspibus_initialize() in your low level - * application initialization logic - * 4. The handle returned by s32k1xx_lpspibus_initialize() may then be used - * to bind the SPI driver to higher level logic (e.g., calling - * mmcsd_spislotinitialize(), for example, will bind the SPI driver to - * the SPI MMC/SD driver). - * - ****************************************************************************/ - -#ifdef CONFIG_S32K1XX_LPSPI0 -void s32k1xx_lpspi0select(FAR struct spi_dev_s *dev, uint32_t devid, - bool selected) -{ - spiinfo("devid: %d CS: %s\n", (int)devid, - selected ? "assert" : "de-assert"); - - s32k1xx_gpiowrite(PIN_LPSPI0_PCS, !selected); -} - -uint8_t s32k1xx_lpspi0status(FAR struct spi_dev_s *dev, uint32_t devid) -{ - return 0; -} -#endif - -#ifdef CONFIG_S32K1XX_LPSPI1 -void s32k1xx_lpspi1select(FAR struct spi_dev_s *dev, - uint32_t devid, bool selected) -{ - spiinfo("devid: %d CS: %s\n", (int)devid, - selected ? "assert" : "de-assert"); - - s32k1xx_gpiowrite(PIN_LPSPI1_PCS, !selected); -} - -uint8_t s32k1xx_lpspi1status(FAR struct spi_dev_s *dev, uint32_t devid) -{ - return 0; -} -#endif - -#ifdef CONFIG_S32K1XX_LPSPI2 -void s32k1xx_lpspi2select(FAR struct spi_dev_s *dev, - uint32_t devid, bool selected) -{ - spiinfo("devid: %d CS: %s\n", (int)devid, - selected ? "assert" : "de-assert"); - - s32k1xx_gpiowrite(PIN_LPSPI2_PCS, !selected); -} - -uint8_t s32k1xx_lpspi2status(FAR struct spi_dev_s *dev, uint32_t devid) -{ - return 0; -} -#endif - -__EXPORT void board_spi_reset(int ms, int bus_mask) -{ - -} -#endif /* CONFIG_S32K1XX_LPSPI0 || CONFIG_S32K1XX_LPSPI01 || CONFIG_S32K1XX_LPSPI2 */ diff --git a/boards/nxp/ucans32k146/src/spi.cpp b/boards/nxp/ucans32k146/src/spi.cpp deleted file mode 100644 index 7dc8e1f..0000000 --- a/boards/nxp/ucans32k146/src/spi.cpp +++ /dev/null @@ -1,230 +0,0 @@ -/************************************************************************************ - * - * Copyright (C) 2016, 2018, 2021 Gregory Nutt. All rights reserved. - * Authors: Gregory Nutt - * David Sidrane - * Landon Haugh - * - * 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 NuttX 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 - -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include "arm_internal.h" -#include "chip.h" -#include - -#include "s32k1xx_config.h" -#include "s32k1xx_lpspi.h" -#include "s32k1xx_pin.h" -#include "board_config.h" - -#if defined(CONFIG_S32K1XX_LPSPI0) -// Only LPSPI0 is defined in defconfig. cont. || defined(CONFIG_S32K1XX_LPSPI1) || defined(CONFIG_S32K1XX_LPSPI2) - -// UCANS32K146 has only one external SPI @ PTB5 -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBusExternal(SPI::Bus::SPI0, { - // Going to assume PTB5 means PortB, Pin5 - initSPIConfigExternal(SPI::CS{GPIO::PortB, GPIO::Pin5}, SPI::DRDY{GPIO::PortE, GPIO::Pin0}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); - -#define PX4_MK_GPIO(pin_ftmx, io) ((((uint32_t)(pin_ftmx)) & ~(_PIN_MODE_MASK | _PIN_OPTIONS_MASK)) |(io)) - - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -__EXPORT void board_spi_reset(int ms, int bus_mask) -{ - /* Goal not to back feed the chips on the bus via IO lines */ - - /* Next Change CS to inputs with pull downs */ - for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) { - if (px4_spi_buses[bus].bus == PX4_BUS_NUMBER_TO_PX4(1)) { - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (px4_spi_buses[bus].devices[i].cs_gpio != 0) { - // s32k1xx_pinconfig is defined - // Only one argument, (uint32_t cfgset) - s32k1xx_pinconfig(PX4_MK_GPIO(px4_spi_buses[bus].devices[i].cs_gpio, GPIO_PULLDOWN)); - } - } - } - } - - /* Restore all the CS to outputs inactive */ - for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) { - if (px4_spi_buses[bus].bus == PX4_BUS_NUMBER_TO_PX4(1)) { - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (px4_spi_buses[bus].devices[i].cs_gpio != 0) { - s32k1xx_pinconfig(px4_spi_buses[bus].devices[i].cs_gpio); - } - } - } - } -} - -/************************************************************************************ - * Name: s32k1xx_spidev_initialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the NXP UCANS32K146 board. - * - ************************************************************************************/ - -void s32k1xx_spidev_initialize(void) -{ - board_spi_reset(10, 0xffff); - - for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) { - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (px4_spi_buses[bus].devices[i].cs_gpio != 0) { - s32k1xx_pinconfig(px4_spi_buses[bus].devices[i].cs_gpio); - } - } - } -} - -/************************************************************************************ - * Name: s32k1xx_spi_bus_initialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the NXP UCANS32K146 board. - * - ************************************************************************************/ - -static const px4_spi_bus_t *_spi_bus0; - -__EXPORT int s32k1xx_spi_bus_initialize(void) -{ - - for (int i = 0; i < SPI_BUS_MAX_BUS_ITEMS; ++i) { - switch (px4_spi_buses[i].bus) { - case 1: _spi_bus0 = &px4_spi_buses[i]; break; - } - } - - struct spi_dev_s *spi_ext = px4_spibus_initialize(1); - - if (!spi_ext) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 2); - return -ENODEV; - } - - /* Default external bus to 1MHz and de-assert the known chip selects. - */ - - SPI_SETFREQUENCY(spi_ext, 8 * 1000 * 1000); - SPI_SETBITS(spi_ext, 8); - SPI_SETMODE(spi_ext, SPIDEV_MODE3); - - /* deselect all */ - for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) { - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (px4_spi_buses[bus].devices[i].cs_gpio != 0) { - SPI_SELECT(spi_ext, px4_spi_buses[bus].devices[i].devid, false); - } - } - } - - return OK; - -} - -/************************************************************************************ - * Name: s32k1xx_spi[n]select, s32k1xx_spi[n]status, and s32k1xx_spi[n]cmddata - * - * Description: - * These external functions must be provided by board-specific logic. They are - * implementations of the select, status, and cmddata methods of the SPI interface - * defined by struct spi_ops_s (see include/nuttx/spi/spi.h). All other methods - * including s32k1xx_spibus_initialize()) are provided by common s32k1xx logic. - * To use this common SPI logic on your board: - * - * 1. Provide logic in s32k1xx_boardinitialize() to configure SPI chip select - * pins. - * 2. Provide s32k1xx_spi[n]select() and s32k1xx_spi[n]status() functions - * in your board-specific logic. These functions will perform chip selection - * and status operations using GPIOs in the way your board is configured. - * 2. If CONFIG_SPI_CMDDATA is defined in the NuttX configuration, provide - * s32k1xx_spi[n]cmddata() functions in your board-specific logic. These - * functions will perform cmd/data selection operations using GPIOs in the way - * your board is configured. - * 3. Add a call to s32k1xx_spibus_initialize() in your low level application - * initialization logic - * 4. The handle returned by s32k1xx_spibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling - * mmcsd_spislotinitialize(), for example, will bind the SPI driver to - * the SPI MMC/SD driver). - * - ************************************************************************************/ - -static inline void s32k1xx_spixselect(const px4_spi_bus_t *bus, struct spi_dev_s *dev, uint32_t devid, bool selected) -{ - for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) { - if (bus->devices[i].cs_gpio == 0) { - break; - } - - if (devid == bus->devices[i].devid) { - // SPI select is active low, so write !selected to select the device - // s32k1xx_gpiowrite is defined (uint32_t pinset, bool value) - s32k1xx_gpiowrite(bus->devices[i].cs_gpio, !selected); - } - } -} - - -void s32k1xx_lpspi0select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) -{ - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); - s32k1xx_spixselect(_spi_bus0, dev, devid, selected); -} - -uint8_t s32k1xx_lpspi0status(FAR struct spi_dev_s *dev, uint32_t devid) -{ - return SPI_STATUS_PRESENT; -} - -#endif /* CONFIG_S32K1XX_LPSPI0 */ diff --git a/boards/nxp/ucans32k146/src/timer_config.cpp b/boards/nxp/ucans32k146/src/timer_config.cpp deleted file mode 100644 index 7106489..0000000 --- a/boards/nxp/ucans32k146/src/timer_config.cpp +++ /dev/null @@ -1,182 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016, 2018 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. - * - ****************************************************************************/ - -/* - * @file timer_config.c - * - * Configuration data for the S32K1XX pwm_servo, input capture and pwm input driver. - * - * Note that these arrays must always be fully-sized. - */ - -// TODO:Stubbed out for now -#include - -#include "hardware/s32k1xx_pcc.h" -#include "hardware/s32k1xx_ftm.h" -#include "s32k1xx_pin.h" - -#include -#include - -#include "board_config.h" - -/**************************************************************************** - * Definitions - ****************************************************************************/ - -/* Register accessors */ - -#define _REG(_addr) (*(volatile uint32_t *)(_addr)) - -/* Timer register accessors */ - -#define REG(t, _reg) _REG(S32K1XX_FTM##t##_BASE + (_reg)) - -#define rSC(t) REG(t,S32K1XX_FTM_SC_OFFSET) -#define rCNT(t) REG(t,S32K1XX_FTM_CNT_OFFSET) -#define rMOD(t) REG(t,S32K1XX_FTM_MOD_OFFSET) -#define rC0SC(t) REG(t,S32K1XX_FTM_C0SC_OFFSET) -#define rC0V(t) REG(t,S32K1XX_FTM_C0V_OFFSET) -#define rC1SC(t) REG(t,S32K1XX_FTM_C1SC_OFFSET) -#define rC1V(t) REG(t,S32K1XX_FTM_C1V_OFFSET) -#define rC2SC(t) REG(t,S32K1XX_FTM_C2SC_OFFSET) -#define rC2V(t) REG(t,S32K1XX_FTM_C2V_OFFSET) -#define rC3SC(t) REG(t,S32K1XX_FTM_C3SC_OFFSET) -#define rC3V(t) REG(t,S32K1XX_FTM_C3V_OFFSET) -#define rC4SC(t) REG(t,S32K1XX_FTM_C4SC_OFFSET) -#define rC4V(t) REG(t,S32K1XX_FTM_C4V_OFFSET) -#define rC5SC(t) REG(t,S32K1XX_FTM_C5SC_OFFSET) -#define rC5V(t) REG(t,S32K1XX_FTM_C5V_OFFSET) -#define rC6SC(t) REG(t,S32K1XX_FTM_C6SC_OFFSET) -#define rC6V(t) REG(t,S32K1XX_FTM_C6V_OFFSET) -#define rC7SC(t) REG(t,S32K1XX_FTM_C7SC_OFFSET) -#define rC7V(t) REG(t,S32K1XX_FTM_C7V_OFFSET) - -#define rCNTIN(t) REG(t,S32K1XX_FTM_CNTIN_OFFSET) -#define rSTATUS(t) REG(t,S32K1XX_FTM_STATUS_OFFSET) -#define rMODE(t) REG(t,S32K1XX_FTM_MODE_OFFSET) -#define rSYNC(t) REG(t,S32K1XX_FTM_SYNC_OFFSET) -#define rOUTINIT(t) REG(t,S32K1XX_FTM_OUTINIT_OFFSET) -#define rOUTMASK(t) REG(t,S32K1XX_FTM_OUTMASK_OFFSET) -#define rCOMBINE(t) REG(t,S32K1XX_FTM_COMBINE_OFFSET) -#define rDEADTIME(t) REG(t,S32K1XX_FTM_DEADTIME_OFFSET) -#define rEXTTRIG(t) REG(t,S32K1XX_FTM_EXTTRIG_OFFSET) -#define rPOL(t) REG(t,S32K1XX_FTM_POL_OFFSET) -#define rFMS(t) REG(t,S32K1XX_FTM_FMS_OFFSET) -#define rFILTER(t) REG(t,S32K1XX_FTM_FILTER_OFFSET) -#define rFLTCTRL(t) REG(t,S32K1XX_FTM_FLTCTRL_OFFSET) -#define rQDCTRL(t) REG(t,S32K1XX_FTM_QDCTRL_OFFSET) -#define rCONF(t) REG(t,S32K1XX_FTM_CONF_OFFSET) -#define rFLTPOL(t) REG(t,S32K1XX_FTM_FLTPOL_OFFSET) -#define rSYNCONF(t) REG(t,S32K1XX_FTM_SYNCONF_OFFSET) -#define rINVCTRL(t) REG(t,S32K1XX_FTM_INVCTRL_OFFSET) -#define rSWOCTRL(t) REG(t,S32K1XX_FTM_SWOCTRL_OFFSET) -#define rPWMLOAD(t) REG(t,S32K1XX_FTM_PWMLOAD_OFFSET) - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::FTM1), - initIOTimer(Timer::FTM2), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::FTM2, Timer::Channel1}, {GPIO::PortA, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::FTM1, Timer::Channel1}, {GPIO::PortA, GPIO::Pin1}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); - -const struct io_timers_t led_pwm_timers[MAX_LED_TIMERS] = { - { - .base = S32K1XX_FTM0_BASE, - .clock_register = S32K1XX_PCC_FTM0, - .clock_bit = PCC_CGC, - //.vectorno = 0, - }, -}; - -const struct timer_io_channels_t led_pwm_channels[MAX_TIMER_LED_CHANNELS] = { - { - .gpio_out = LED_TIM0_CH0OUT, // RGB_R - .gpio_in = 0, - .timer_index = 0, - .timer_channel = 1, - }, - { - .gpio_out = LED_TIM0_CH1OUT, // RGB_G - .gpio_in = 0, - .timer_index = 0, - .timer_channel = 2, - }, - { - .gpio_out = LED_TIM0_CH2OUT, // RGB_B - .gpio_in = 0, - .timer_index = 0, - .timer_channel = 3, - }, -}; - -void ucans32k_timer_initialize(void) -{ - /* Select external clock (set to SOSC in periphclocks.c) as source for FTM0, and FTM2 */ - - uint32_t regval = _REG(S32K1XX_FTM0_SC); - regval &= ~(FTM_SC_CLKS_MASK); - regval |= FTM_SC_CLKS_FTM; - _REG(S32K1XX_FTM0_SC) = regval; - - regval = _REG(S32K1XX_FTM1_SC); - regval &= ~(FTM_SC_CLKS_MASK); - regval |= FTM_SC_CLKS_FTM; - _REG(S32K1XX_FTM1_SC) = regval; - - regval = _REG(S32K1XX_FTM2_SC); - regval &= ~(FTM_SC_CLKS_MASK); - regval |= FTM_SC_CLKS_FTM; - _REG(S32K1XX_FTM2_SC) = regval; - - /* Enabled System Clock Gating Control for FTM0, FTM1 and FTM2 */ - - regval = _REG(S32K1XX_PCC_FTM0); - regval |= PCC_CGC; - _REG(S32K1XX_PCC_FTM0) = regval; - - regval = _REG(S32K1XX_PCC_FTM1); - regval |= PCC_CGC; - _REG(S32K1XX_PCC_FTM1) = regval; - - regval = _REG(S32K1XX_PCC_FTM2); - regval |= PCC_CGC; - _REG(S32K1XX_PCC_FTM2) = regval; -} diff --git a/boards/nxp/ucans32k146/src/userleds.c b/boards/nxp/ucans32k146/src/userleds.c deleted file mode 100644 index 1361c12..0000000 --- a/boards/nxp/ucans32k146/src/userleds.c +++ /dev/null @@ -1,112 +0,0 @@ -/**************************************************************************** - * boards/arm/s32k1xx/ucans32k146/src/s32k1xx_userleds.c - * - * Copyright (C) 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include - -#include - -#include "arm_internal.h" -#include "arm_internal.h" - -#include "s32k1xx_pin.h" -#include "board_config.h" - -#include - -#ifndef CONFIG_ARCH_LEDS - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_userled_initialize - ****************************************************************************/ - -void board_userled_initialize(void) -{ - /* Configure LED GPIOs for output */ - - s32k1xx_pinconfig(GPIO_LED_R); - s32k1xx_pinconfig(GPIO_LED_G); - s32k1xx_pinconfig(GPIO_LED_B); -} - -/**************************************************************************** - * Name: board_userled - ****************************************************************************/ - -void board_userled(int led, bool ledon) -{ - uint32_t ledcfg; - - if (led == BOARD_LED_R) { - ledcfg = GPIO_LED_R; - - } else if (led == BOARD_LED_G) { - ledcfg = GPIO_LED_G; - - } else if (led == BOARD_LED_B) { - ledcfg = GPIO_LED_B; - - } else { - return; - } - - s32k1xx_gpiowrite(ledcfg, ledon); /* High illuminates */ -} - -/**************************************************************************** - * Name: board_userled_all - ****************************************************************************/ - -void board_userled_all(uint8_t ledset) -{ - /* Low illuminates */ - - s32k1xx_gpiowrite(GPIO_LED_R, (ledset & BOARD_LED_R_BIT) != 0); - s32k1xx_gpiowrite(GPIO_LED_G, (ledset & BOARD_LED_G_BIT) != 0); - s32k1xx_gpiowrite(GPIO_LED_B, (ledset & BOARD_LED_B_BIT) != 0); -} - -#endif /* !CONFIG_ARCH_LEDS */ diff --git a/boards/nxp/ucans32k146/uavcan_board_identity b/boards/nxp/ucans32k146/uavcan_board_identity deleted file mode 100644 index dd7e3fc..0000000 --- a/boards/nxp/ucans32k146/uavcan_board_identity +++ /dev/null @@ -1,19 +0,0 @@ -# UAVCAN boot loadable Module ID -set(uavcanblid_sw_version_major 0) -set(uavcanblid_sw_version_minor 1) -add_definitions( - -DAPP_VERSION_MAJOR=${uavcanblid_sw_version_major} - -DAPP_VERSION_MINOR=${uavcanblid_sw_version_minor} -) - -set(uavcanblid_hw_version_major 0) -set(uavcanblid_hw_version_minor 34) -set(uavcanblid_name "\"org.nxp.ucans32k146\"") - -set(uavcanbl_padding 8) - -add_definitions( - -DHW_UAVCAN_NAME=${uavcanblid_name} - -DHW_VERSION_MAJOR=${uavcanblid_hw_version_major} - -DHW_VERSION_MINOR=${uavcanblid_hw_version_minor} -) diff --git a/boards/omnibus/f4sd/default.px4board b/boards/omnibus/f4sd/default.px4board deleted file mode 100644 index ceabc36..0000000 --- a/boards/omnibus/f4sd/default.px4board +++ /dev/null @@ -1,37 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_CONSTRAINED_FLASH=y -CONFIG_BOARD_NO_HELP=y -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_BOARD_SERIAL_URT6="/dev/ttyS2" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS1" -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_BAROMETER_BMP280=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU6000=y -CONFIG_DRIVERS_MAGNETOMETER_HMC5883=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_TELEMETRY_FRSKY_TELEMETRY=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_SENSORS=y -# CONFIG_SENSORS_VEHICLE_AIRSPEED is not set -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/omnibus/f4sd/extras/omnibus_f4sd_bootloader.bin b/boards/omnibus/f4sd/extras/omnibus_f4sd_bootloader.bin deleted file mode 100644 index be73a7f..0000000 Binary files a/boards/omnibus/f4sd/extras/omnibus_f4sd_bootloader.bin and /dev/null differ diff --git a/boards/omnibus/f4sd/firmware.prototype b/boards/omnibus/f4sd/firmware.prototype deleted file mode 100644 index c7f2421..0000000 --- a/boards/omnibus/f4sd/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 42, - "magic": "OMNIBUSF4SD", - "description": "Firmware for the OmnibusF4SD board", - "image": "", - "build_time": 0, - "summary": "PX4/OmnibusF4", - "version": "0.1", - "image_size": 0, - "image_maxsize": 1032192, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/omnibus/f4sd/icm20608g.px4board b/boards/omnibus/f4sd/icm20608g.px4board deleted file mode 100644 index b7b57ee..0000000 --- a/boards/omnibus/f4sd/icm20608g.px4board +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=n -CONFIG_DRIVERS_IMU_INVENSENSE_MPU6000=n -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20608G=y diff --git a/boards/omnibus/f4sd/init/rc.board_defaults b/boards/omnibus/f4sd/init/rc.board_defaults deleted file mode 100644 index 5b492c4..0000000 --- a/boards/omnibus/f4sd/init/rc.board_defaults +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 11.12 -param set-default BAT1_A_PER_V 31 - -# system_power unavailable -param set-default CBRK_SUPPLY_CHK 894281 - -# Disable safety switch by default -param set-default CBRK_IO_SAFETY 22027 - -# use the Q attitude estimator, it works w/o mag or GPS. -param set-default SYS_MC_EST_GROUP 3 -param set-default ATT_ACC_COMP 0 -param set-default ATT_W_ACC 0.4000 -param set-default ATT_W_GYRO_BIAS 0.0000 - -param set-default SYS_HAS_MAG 0 diff --git a/boards/omnibus/f4sd/init/rc.board_extras b/boards/omnibus/f4sd/init/rc.board_extras deleted file mode 100644 index 25e6c26..0000000 --- a/boards/omnibus/f4sd/init/rc.board_extras +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# -# OmnibusF4SD specific board extras init -#------------------------------------------------------------------------------ - -if ! param compare OSD_ATXXXX_CFG 0 -then - atxxxx start -s -fi - - diff --git a/boards/omnibus/f4sd/init/rc.board_sensors b/boards/omnibus/f4sd/init/rc.board_sensors deleted file mode 100644 index 18ea496..0000000 --- a/boards/omnibus/f4sd/init/rc.board_sensors +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# -# Omnibus F4SD specific board sensors init -#------------------------------------------------------------------------------ - -board_adc start - -if ! mpu6000 -R 6 -s start -then - # some boards such as the Hobbywing XRotor F4 G2 use the ICM-20602 - if ! icm20602 -s -R 6 start - then - # some clones of Omnibus F4 use the ICM-20608G (such as F4 PDB for Martian II FPV Drone) - icm20608g -s -R 6 start - fi -fi - -bmp280 -s start diff --git a/boards/omnibus/f4sd/nuttx-config/include/board.h b/boards/omnibus/f4sd/nuttx-config/include/board.h deleted file mode 100644 index 6fae1aa..0000000 --- a/boards/omnibus/f4sd/nuttx-config/include/board.h +++ /dev/null @@ -1,327 +0,0 @@ -/************************************************************************************ - * nuttx-configs/omnibus-f4sd/include/board.h - * include/arch/board/board.h - * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Copyright (c) 2018 PX4 Development Team. All rights reserved. - * Author: Nathan Tsoi - * - * 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 NuttX 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. - * - ************************************************************************************/ - -#ifndef __CONFIG_OMNIBUSF4SD_INCLUDE_BOARD_H -#define __CONFIG_OMNIBUSF4SD_INCLUDE_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdio.h" -#include "stm32.h" - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The omnibusf4sd board features a single 8MHz crystal. Space is provided - * for a 32kHz RTC backup crystal, but it is not stuffed. - * - * This is the canonical configuration: - * System Clock source : PLL (HSE) - * SYSCLK(Hz) : 168000000 Determined by PLL configuration - * HCLK(Hz) : 168000000 (STM32_RCC_CFGR_HPRE) - * AHB Prescaler : 1 (STM32_RCC_CFGR_HPRE) - * APB1 Prescaler : 4 (STM32_RCC_CFGR_PPRE1) - * APB2 Prescaler : 2 (STM32_RCC_CFGR_PPRE2) - * HSE Frequency(Hz) : 8000000 (STM32_BOARD_XTAL) - * PLLM : 8 (STM32_PLLCFG_PLLM) - * PLLN : 336 (STM32_PLLCFG_PLLN) - * PLLP : 2 (STM32_PLLCFG_PLLP) - * PLLQ : 7 (STM32_PLLCFG_PLLQ) - * Main regulator output voltage : Scale1 mode Needed for high speed SYSCLK - * Flash Latency(WS) : 5 - * Prefetch Buffer : OFF - * Instruction cache : ON - * Data cache : ON - * Require 48MHz for USB OTG FS, : Enabled - * SDIO and RNG clock - */ - -/* HSI - 16 MHz RC factory-trimmed - * LSI - 32 KHz RC - * HSE - On-board crystal frequency is 8MHz - * LSE - 32.768 kHz - */ - -#define STM32_BOARD_XTAL 8000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 32768 - -/* Main PLL Configuration. - * - * PLL source is HSE - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * = (8,000,000 / 8) * 336 - * = 336,000,000 - * SYSCLK = PLL_VCO / PLLP - * = 336,000,000 / 2 = 168,000,000 - * USB OTG FS, SDIO and RNG Clock - * = PLL_VCO / PLLQ - * = 48,000,000 - */ - -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(8) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(336) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(7) - -#define STM32_SYSCLK_FREQUENCY 168000000ul - -/* AHB clock (HCLK) is SYSCLK (168MHz) */ - -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (42MHz) */ - -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (84MHz) */ - -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx - * otherwise frequency is 2xAPBx. - * Note: TIM1,8-11 are on APB2, others on APB1 - */ - -#define BOARD_TIM1_FREQUENCY STM32_APB2_TIM1_CLKIN -#define BOARD_TIM2_FREQUENCY STM32_APB1_TIM2_CLKIN -#define BOARD_TIM3_FREQUENCY STM32_APB1_TIM3_CLKIN -#define BOARD_TIM4_FREQUENCY STM32_APB1_TIM4_CLKIN -#define BOARD_TIM5_FREQUENCY STM32_APB1_TIM5_CLKIN -#define BOARD_TIM6_FREQUENCY STM32_APB1_TIM6_CLKIN -#define BOARD_TIM7_FREQUENCY STM32_APB1_TIM7_CLKIN -#define BOARD_TIM8_FREQUENCY STM32_APB2_TIM8_CLKIN -#define BOARD_TIM9_FREQUENCY STM32_APB2_TIM9_CLKIN -#define BOARD_TIM10_FREQUENCY STM32_APB2_TIM10_CLKIN -#define BOARD_TIM11_FREQUENCY STM32_APB2_TIM11_CLKIN -#define BOARD_TIM12_FREQUENCY STM32_APB1_TIM12_CLKIN -#define BOARD_TIM13_FREQUENCY STM32_APB1_TIM13_CLKIN -#define BOARD_TIM14_FREQUENCY STM32_APB1_TIM14_CLKIN - -/* SDIO dividers. Note that slower clocking is required when DMA is disabled - * in order to avoid RX overrun/TX underrun errors due to delayed responses - * to service FIFOs in interrupt driven mode. These values have not been - * tuned!!! - * - * SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(118+2)=400 KHz - */ - -#define SDIO_INIT_CLKDIV (118 << SDIO_CLKCR_CLKDIV_SHIFT) - -/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz - * DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32_SDIO_DMA -# define SDIO_MMCXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) -#else -# define SDIO_MMCXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) -#endif - -/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz - * DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32_SDIO_DMA -# define SDIO_SDXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) -#else -# define SDIO_SDXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) -#endif - -/* LED definitions ******************************************************************/ -/* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any - * way. The following definitions are used to access individual LEDs. - */ - -/* LED index values for use with stm32_setled() */ - -#define BOARD_LED1 0 -//#define BOARD_LED2 1 -#define BOARD_NLEDS 1 - -#define BOARD_LED_BLUE BOARD_LED1 -//#define BOARD_LED_RED BOARD_LED2 - -/* LED bits for use with stm32_setleds() */ - -#define BOARD_LED1_BIT (1 << BOARD_LED1) -#define BOARD_LED2_BIT (1 << BOARD_LED2) - -/* If CONFIG_ARCH_LEDs is defined, then NuttX will control the 2 LEDs on board the - * omnibusf4sd. The following definitions describe how NuttX controls the LEDs: - */ - -#define LED_STARTED 0 /* LED1 */ -#define LED_HEAPALLOCATE 1 /* LED2 */ -#define LED_IRQSENABLED 2 /* LED1 */ -#define LED_STACKCREATED 3 /* LED1 + LED2 */ -#define LED_INIRQ 4 /* LED1 */ -#define LED_SIGNAL 5 /* LED2 */ -#define LED_ASSERTION 6 /* LED1 + LED2 */ -#define LED_PANIC 7 /* LED1 + LED2 */ - -/* Alternate function pin selections ************************************************/ - -/* UART1: - * - * PA10 (RX) and PA9 (TX) are broken out on J5 - */ - -#define GPIO_USART1_RX GPIO_USART1_RX_1 -#define GPIO_USART1_TX GPIO_USART1_TX_1 - -/* USART3: - * - * PC10 (TX) and PC11 (RX) are broken out on J4 - * - * However, this port is shared with SPI3 which contains the BMP280 and MAX7456 - * - * The Silkscreen pin labeled SCL is TX - * MISO is RX - */ -//#define GPIO_USART3_RX GPIO_USART3_RX_2 -//#define GPIO_USART3_TX GPIO_USART3_TX_2 - -/* UART4: - * - * PA0 (TX) -- Labeled RSSI on the silkscreen is only broken out on a test pad - * on the pro version. It's on a 2.54mm header on other versions - * PA1 (RX) -- Motor 5 out - */ -#define GPIO_UART4_RX GPIO_UART4_RX_1 -#define GPIO_UART4_TX GPIO_UART4_TX_1 - -/* UART6: - * - * PC6 (TX) and PC7 (RX) are broken out on J10 - */ - -#define GPIO_USART6_RX GPIO_USART6_RX_1 -#define GPIO_USART6_TX GPIO_USART6_TX_1 - -/* SPI1: - * MPU6000 - * CS: PA4 -- configured in board_config.h - * CLK: PA5 - * MISO: PA6 - * MOSI: PA7 - */ - -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 - -/* SPI2: - * SD Card - * CS: PB12 -- configured in board_config.h - * CLK: PB13 - * MISO: PB14 - * MOSI: PB15 - */ - -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_2 -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 - -/* SPI3: - * BMP280 - * CS: PB3 -- configured in board_config.h - * CLK: PC10 - * MISO: PC11 - * MOSI: PC12 - */ - -#define GPIO_SPI3_SCK GPIO_SPI3_SCK_2 -#define GPIO_SPI3_MISO GPIO_SPI3_MISO_2 -#define GPIO_SPI3_MOSI GPIO_SPI3_MOSI_2 - -/* - * I2C (external) - * - * SCL: PB10 - * SDA: PB11 - * - * TODO: - * The optional _GPIO configurations allow the I2C driver to manually - * reset the bus to clear stuck slaves. They match the pin configuration, - * but are normally-high GPIOs. - */ -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_1 -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_1 - -#endif /* __CONFIG_OMNIBUSF4SD_INCLUDE_BOARD_H */ diff --git a/boards/omnibus/f4sd/nuttx-config/include/board_dma_map.h b/boards/omnibus/f4sd/nuttx-config/include/board_dma_map.h deleted file mode 100644 index d54cbdf..0000000 --- a/boards/omnibus/f4sd/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/* -| DMA1 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | SPI3_RX_1 | - | SPI3_RX_2 | SPI2_RX | SPI2_TX | SPI3_TX_1 | - | SPI3_TX_2 | -| Channel 1 | I2C1_RX | - | TIM7_UP_1 | - | TIM7_UP_2 | I2C1_RX_1 | I2C1_TX | I2C1_TX_1 | -| Channel 2 | TIM4_CH1 | - | I2C4_RX | TIM4_CH2 | - | I2C4_RX | TIM4_UP | TIM4_CH3 | -| Channel 3 | - | TIM2_UP_1 | I2C3_RX_1 | I2C2_EXT_RX | I2C3_TX | TIM2_CH1 | TIM2_CH2 | TIM2_UP_2 | -| | | TIM2_CH3 | | | | | TIM2_CH4_1 | TIM2_CH4_2 | -| Channel 4 | UART5_RX | USART3_RX | UART4_RX | USART3_TX_1 | UART4_TX | USART2_RX | USART2_TX | UART5_TX | -| Channel 5 | UART8_TX | UART7_TX | TIM3_CH4 | UART7_RX | TIM3_CH1 | TIM3_CH2 | UART8_RX | TIM3_CH3 | -| | | | TIM3_UP | | TIM3_TRIG | | | | -| Channel 6 | TIM5_CH3 | TIM5_CH4_1 | TIM5_CH1 | TIM5_CH4_2 | TIM5_CH2 | - | TIM5_UP_2 | - | -| | TIM5_UP_1 | TIM5_TRIG_1 | | TIM5_TRIG_2 | | | | | -| Channel 7 | - | TIM6_UP | I2C2_RX | I2C2_RX_1 | USART3_TX_2 | DAC1 | DAC2 | I2C2_TX | -| | | | | | | | | | -| Usage | | TIM2_UP_1 | TIM3_UP | SPI2_RX | SPI2_TX | | | | - - -| DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | ADC1_1 | SAI1_A | TIM8_CH1_1 | SAI1_A_1 | ADC1_2 | SAI1_B_1 | TIM1_CH1_1 | - | -| | | | TIM8_CH2_1 | | | | TIM1_CH2_1 | | -| | | | TIM8_CH3_1 | | | | TIM1_CH3_1 | | -| Channel 1 | - | DCMI_1 | ADC2_1 | ADC2_2 | SAI1_B | SPI6_TX | SPI6_RX | DCMI_2 | -| Channel 2 | ADC3_1 | ADC3_2 | - | SPI5_RX_1 | SPI5_TX_1 | CRYP_OUT | CRYP_IN | HASH_IN | -| Channel 3 | SPI1_RX_1 | - | SPI1_RX_2 | SPI1_TX_1 | - | SPI1_TX_2 | - | QUADSPI | -| Channel 4 | SPI4_RX_1 | SPI4_TX_1 | USART1_RX_1 | SDIO | - | USART1_RX_2 | SDIO | USART1_TX | -| Channel 5 | - | USART6_RX_1 | USART6_RX_2 | SPI4_RX_2 | SPI4_TX_2 | - | USART6_TX_1 | USART6_TX_2 | -| Channel 6 | TIM1_TRIG_1 | TIM1_CH1_2 | TIM1_CH2_2 | TIM1_CH1 | TIM1_CH4 | TIM1_UP | TIM1_CH3_2 | - | -| | | | | | TIM1_TRIG_2 | | | | -| | | | | | TIM1_COM | | | | -| Channel 7 | - | TIM8_UP | TIM8_CH1_2 | TIM8_CH2_2 | TIM8_CH3_2 | SPI5_RX_2 | SPI5_TX_2 | TIM8_CH4 | -| | | | | | | | | TIM8_TRIG | -| | | | | | | | | TIM8_COM | -| | | | | | | | | | -| Usage | SPI1_RX_1 | USART6_RX_1 | USART1_RX_1 | SPI1_TX_1 | | | SDIO | | - */ - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// AVAILABLE // DMA2, Stream 0 -// DMAMAP_TIM2_UP // DMA1, Stream 1, Channel 3 (DSHOT) -// DMAMAP_TIM3_UP // DMA1, Stream 2, Channel 5 (DSHOT) -#define DMACHAN_SPI2_RX DMAMAP_SPI2_RX // DMA1, Stream 3, Channel 0 (SPI2 RX) -#define DMACHAN_SPI2_TX DMAMAP_SPI2_TX // DMA1, Stream 4, Channel 0 (SPI2 TX) -// AVAILABLE // DMA2, Stream 5 -// AVAILABLE // DMA2, Stream 6 -// AVAILABLE // DMA2, Stream 7 - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMACHAN_SPI1_RX DMAMAP_SPI1_RX_1 // DMA2, Stream 0, Channel 3 (SPI1 RX) -#define DMAMAP_USART6_RX DMAMAP_USART6_RX_1 // DMA2, Stream 1, Channel 4 -#define DMAMAP_USART1_RX DMAMAP_USART1_RX_1 // DMA2, Stream 2, Channel 4 -#define DMACHAN_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 3, Channel 3 (SPI1 TX) -// AVAILABLE // DMA2, Stream 4 -// AVAILABLE // DMA2, Stream 5 -#define DMAMAP_SDIO DMAMAP_SDIO_2 // DMA2, Stream 6, Channel 4 -// AVAILABLE // DMA2, Stream 7 diff --git a/boards/omnibus/f4sd/nuttx-config/nsh/defconfig b/boards/omnibus/f4sd/nuttx-config/nsh/defconfig deleted file mode 100644 index 8cdd6c1..0000000 --- a/boards/omnibus/f4sd/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,182 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_CONSOLE is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_SPI_CALLBACK is not set -# CONFIG_STM32_CCMEXCLUDE is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/omnibus/f4sd/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F405RG=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_CUSTOM_LEDS=y -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0001 -CONFIG_CDCACM_PRODUCTSTR="PX4 OmnibusF4SD" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=2000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="Vertile" -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_DISABLE_MQUEUE=y -CONFIG_DISABLE_POSIX_TIMERS=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MM_REGIONS=2 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_DISABLE_BASENAME=y -CONFIG_NSH_DISABLE_DD=y -CONFIG_NSH_DISABLE_DIRNAME=y -CONFIG_NSH_DISABLE_HEXDUMP=y -CONFIG_NSH_DISABLE_LOSETUP=y -CONFIG_NSH_DISABLE_MKFIFO=y -CONFIG_NSH_DISABLE_MKRD=y -CONFIG_NSH_DISABLE_PUT=y -CONFIG_NSH_DISABLE_REBOOT=y -CONFIG_NSH_DISABLE_UNAME=y -CONFIG_NSH_DISABLE_WGET=y -CONFIG_NSH_DISABLE_XD=y -CONFIG_NSH_FATDEVNO=0 -CONFIG_NSH_FILEIOSIZE=512 -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_MMCSDSPIPORTNO=2 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_READLINE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=196608 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32_ADC1=y -CONFIG_STM32_BBSRAM=y -CONFIG_STM32_BBSRAM_FILES=5 -CONFIG_STM32_BKPSRAM=y -CONFIG_STM32_CCMDATARAM=y -CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y -CONFIG_STM32_DMA1=y -CONFIG_STM32_DMA2=y -CONFIG_STM32_FLASH_PREFETCH=y -CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_STM32_I2C2=y -CONFIG_STM32_I2CTIMEOMS=10 -CONFIG_STM32_I2CTIMEOTICKS=10 -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_OTGFS=y -CONFIG_STM32_PWR=y -CONFIG_STM32_RTC=y -CONFIG_STM32_RTC_HSECLOCK=y -CONFIG_STM32_RTC_MAGIC_REG=1 -CONFIG_STM32_SAVE_CRASHDUMP=y -CONFIG_STM32_SDIO=y -CONFIG_STM32_SDIO_CARD=y -CONFIG_STM32_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32_SPI1=y -CONFIG_STM32_SPI1_DMA=y -CONFIG_STM32_SPI1_DMA_BUFFER=512 -CONFIG_STM32_SPI2=y -CONFIG_STM32_SPI2_DMA=y -CONFIG_STM32_SPI3=y -CONFIG_STM32_SPI_DMATHRESHOLD=8 -CONFIG_STM32_TIM1=y -CONFIG_STM32_TIM5=y -CONFIG_STM32_UART4=y -CONFIG_STM32_USART1=y -CONFIG_STM32_USART6=y -CONFIG_STM32_USART_BREAKS=y -CONFIG_STM32_USART_SINGLEWIRE=y -CONFIG_STM32_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=300 -CONFIG_UART4_TXBUFSIZE=300 -CONFIG_USART1_RXBUFSIZE=300 -CONFIG_USART1_RXDMA=y -CONFIG_USART1_TXBUFSIZE=300 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=300 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/omnibus/f4sd/nuttx-config/scripts/script.ld b/boards/omnibus/f4sd/nuttx-config/scripts/script.ld deleted file mode 100644 index c1d3ec6..0000000 --- a/boards/omnibus/f4sd/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************** - * configs/omnibus-f4sd/scripts/ld.script - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F405RG has 1024Kb of FLASH beginning at address 0x0800:0000 and - * 192Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of CCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 16 KiB of flash is reserved for the bootloader. - * Paramater storage will use the next 16KiB Sector. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08008000, LENGTH = 992K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - ccsram (rwx) : ORIGIN = 0x10000000, LENGTH = 64K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/omnibus/f4sd/src/CMakeLists.txt b/boards/omnibus/f4sd/src/CMakeLists.txt deleted file mode 100644 index 4212b7e..0000000 --- a/boards/omnibus/f4sd/src/CMakeLists.txt +++ /dev/null @@ -1,50 +0,0 @@ -############################################################################ -# -# Copyright (c) 2018 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. -# -############################################################################ - -add_library(drivers_board - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - usb.c -) - -target_link_libraries(drivers_board - PRIVATE - arch_spi - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer -) diff --git a/boards/omnibus/f4sd/src/board_config.h b/boards/omnibus/f4sd/src/board_config.h deleted file mode 100644 index 627a42e..0000000 --- a/boards/omnibus/f4sd/src/board_config.h +++ /dev/null @@ -1,194 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2018, 2014 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * omnibusf4sd internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ -/* Configuration ************************************************************************************/ - -/* omnibusf4sd GPIOs ***********************************************************************************/ -/* LEDs */ -// power - green -// LED1 - PB5 - blue -#define GPIO_LED1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN5) -#define GPIO_LED_BLUE GPIO_LED1 - -#define BOARD_OVERLOAD_LED LED_BLUE - -#define FLASH_BASED_PARAMS - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that can be used by the Px4 Firmware in the adc driver - */ -#define ADC_CHANNELS (1 << 0) | (1 << 11) | (1 << 12) - -#define ADC_BATTERY_VOLTAGE_CHANNEL 12 -#define ADC_BATTERY_CURRENT_CHANNEL 11 -#define ADC_RC_RSSI_CHANNEL 0 - -/* User GPIOs - * - * GPIO0-5 are the PWM servo outputs. - * GPIO_TIM3_CH3OUT GPIO_TIM3_CH3OUT_1 //PB0 S1_OUT D1_ST7 - * GPIO_TIM3_CH4OUT GPIO_TIM3_CH4OUT_1 //PB1 S2_OUT D1_ST2 - * GPIO_TIM2_CH4OUT GPIO_TIM2_CH4OUT_1 //PA3 S3_OUT D1_ST6 - * GPIO_TIM2_CH3OUT GPIO_TIM2_CH3OUT_1 //PA2 S4_OUT D1_ST1 - * GPIO_TIM5_CH2OUT GPIO_TIM5_CH2OUT_1 //PA1 S5_OUT - * GPIO_TIM1_CH1OUT GPIO_TIM1_CH1OUT_1 //PA8 S6_OUT - */ - -#define _MK_GPIO_INPUT(def) (((def) & (GPIO_PORT_MASK | GPIO_PIN_MASK)) | (GPIO_INPUT|GPIO_PULLUP)) - -#define GPIO_GPIO0_INPUT _MK_GPIO_INPUT(GPIO_TIM3_CH3IN) -#define GPIO_GPIO1_INPUT _MK_GPIO_INPUT(GPIO_TIM3_CH4IN) -#define GPIO_GPIO2_INPUT _MK_GPIO_INPUT(GPIO_TIM2_CH4IN) -#define GPIO_GPIO3_INPUT _MK_GPIO_INPUT(GPIO_TIM2_CH3IN) -//#define GPIO_GPIO4_INPUT _MK_GPIO_INPUT(GPIO_TIM5_CH2IN) -//#define GPIO_GPIO5_INPUT _MK_GPIO_INPUT(GPIO_TIM1_CH1IN) - -#define _MK_GPIO_OUTPUT(def) (((def) & (GPIO_PORT_MASK | GPIO_PIN_MASK)) | (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR)) - -#define GPIO_GPIO0_OUTPUT _MK_GPIO_OUTPUT(GPIO_TIM3_CH3OUT) -#define GPIO_GPIO1_OUTPUT _MK_GPIO_OUTPUT(GPIO_TIM3_CH4OUT) -#define GPIO_GPIO2_OUTPUT _MK_GPIO_OUTPUT(GPIO_TIM2_CH4OUT) -#define GPIO_GPIO3_OUTPUT _MK_GPIO_OUTPUT(GPIO_TIM2_CH3OUT) -//#define GPIO_GPIO4_OUTPUT _MK_GPIO_OUTPUT(GPIO_TIM5_CH2OUT) -//#define GPIO_GPIO5_OUTPUT _MK_GPIO_OUTPUT(GPIO_TIM1_CH1OUT) - -/* USB OTG FS - * - * PA9 OTG_FS_VBUS VBUS sensing - */ -#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTC|GPIO_PIN5) - -/* PWM - * - * Alternatively CH3/CH4 could be assigned to UART6_TX/RX - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 4 - -/* High-resolution timer */ -#define HRT_TIMER 4 // T4C1 -#define HRT_TIMER_CHANNEL 1 // use capture/compare channel 1 - -#define HRT_PPM_CHANNEL 3 // capture/compare channel 3 -#define GPIO_PPM_IN (GPIO_ALT|GPIO_AF2|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN8) - -#define RC_SERIAL_PORT "/dev/ttyS0" -#define BOARD_SUPPORTS_RC_SERIAL_PORT_OUTPUT - -/* - * One RC_IN - * - * GPIO PPM_IN on PB8 T4CH3 - * SPEKTRUM_RX (it's TX or RX in Bind) on PA10 UART1 - * The FMU can drive GPIO PPM_IN as an output - */ -// TODO? -//#define GPIO_PPM_IN_AS_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN6) -//#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_PPM_IN_AS_OUT) -//#define SPEKTRUM_RX_AS_UART() px4_arch_configgpio(GPIO_USART1_RX) -//#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true)) - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -#define BOARD_HAS_ON_RESET 1 - -#define BOARD_ENABLE_CONSOLE_BUFFER -#define BOARD_CONSOLE_BUFFER_SIZE (1024*3) - - -__BEGIN_DECLS - -/**************************************************************************************************** - * Public Types - ****************************************************************************************************/ - -/**************************************************************************************************** - * Public data - ****************************************************************************************************/ - -#ifndef __ASSEMBLY__ - -/**************************************************************************************************** - * Public Functions - ****************************************************************************************************/ - -/**************************************************************************************************** - * Name: stm32_spiinitialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the PX4FMU board. - * - ****************************************************************************************************/ - -extern void stm32_spiinitialize(void); - - -/**************************************************************************************************** - * Name: stm32_usbinitialize - * - * Description: - * Called to configure USB IO. - * - ****************************************************************************************************/ - -extern void stm32_usbinitialize(void); - -extern void board_peripheral_reset(int ms); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/omnibus/f4sd/src/i2c.cpp b/boards/omnibus/f4sd/src/i2c.cpp deleted file mode 100644 index 3cf7e2e..0000000 --- a/boards/omnibus/f4sd/src/i2c.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(2), -}; diff --git a/boards/omnibus/f4sd/src/init.c b/boards/omnibus/f4sd/src/init.c deleted file mode 100644 index 746a544..0000000 --- a/boards/omnibus/f4sd/src/init.c +++ /dev/null @@ -1,338 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-2018 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * omnibusf4sd-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include "board_config.h" -#include - -#include - -#include -#include - -#include - -#include -#include -#include - -# if defined(FLASH_BASED_PARAMS) -# include -#endif - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/**************************************************************************** - * Protected Functions - ****************************************************************************/ -/**************************************************************************** - * Public Functions - ****************************************************************************/ -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - UNUSED(ms); -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - /* configure the GPIO pins to outputs and keep them low */ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(io_timer_channel_get_gpio_output(i)); - } - - /* On resets invoked from system (not boot) insure we establish a low - * output state (discharge the pins) on PWM pins before they become inputs. - */ - - if (status >= 0) { - up_mdelay(400); - } -} - -/************************************************************************************ - * 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 all PWM to Low outputs */ - - board_on_reset(-1); - - /* configure LEDs */ - board_autoled_initialize(); - - - /* configure ADC pins */ - stm32_configgpio(GPIO_ADC1_IN12); /* BATT_VOLTAGE_SENS */ - stm32_configgpio(GPIO_ADC1_IN11); /* BATT_CURRENT_SENS */ - //stm32_configgpio(GPIO_ADC1_IN0); /* RSSI analog in (TX of UART4 instead) */ - - // TODO: power peripherals - ///* configure power supply control/sense pins */ - //stm32_configgpio(GPIO_PERIPH_3V3_EN); - //stm32_configgpio(GPIO_VDD_BRICK_VALID); - //stm32_configgpio(GPIO_VDD_USB_VALID); - - // TODO: 3v3 Sensor? - ///* Start with Sensor voltage off We will enable it - // * in board_app_initialize - // */ - //stm32_configgpio(GPIO_VDD_3V3_SENSORS_EN); - - // TODO: SBUS inversion? SPEK power? - //stm32_configgpio(GPIO_SBUS_INV); - //stm32_configgpio(GPIO_SPEKTRUM_PWR_EN); - - // TODO: $$$ Unused? - //stm32_configgpio(GPIO_8266_GPIO0); - //stm32_configgpio(GPIO_8266_PD); - //stm32_configgpio(GPIO_8266_RST); - - /* Safety - led don in led driver */ - - // TODO: unused? - //stm32_configgpio(GPIO_BTN_SAFETY); - - // TODO: RSSI - //stm32_configgpio(GPIO_RSSI_IN); - - stm32_configgpio(GPIO_PPM_IN); - - /* configure SPI all interfaces GPIO */ - - stm32_spiinitialize(); - -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -static struct spi_dev_s *spi1; -static struct spi_dev_s *spi2; -static struct spi_dev_s *spi3; - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - px4_platform_init(); - - /* configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_BLUE); - } - - - /* Configure SPI-based devices */ - - // SPI1: MPU6000 - spi1 = stm32_spibus_initialize(1); - - if (!spi1) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 1\n"); - led_on(LED_BLUE); - } - - /* Default SPI1 to 1MHz and de-assert the known chip selects. */ - SPI_SETFREQUENCY(spi1, 10000000); - SPI_SETBITS(spi1, 8); - SPI_SETMODE(spi1, SPIDEV_MODE3); - up_udelay(20); - - // SPI2: SDCard - /* Get the SPI port for the microSD slot */ - spi2 = stm32_spibus_initialize(CONFIG_NSH_MMCSDSPIPORTNO); - - if (!spi2) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", CONFIG_NSH_MMCSDSPIPORTNO); - led_on(LED_BLUE); - } - - /* Now bind the SPI interface to the MMCSD driver */ - int result = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi2); - - if (result != OK) { - led_on(LED_BLUE); - syslog(LOG_ERR, "[boot] FAILED to bind SPI port 2 to the MMCSD driver\n"); - } - - up_udelay(20); - - - // SPI3: OSD / Baro - spi3 = stm32_spibus_initialize(3); - - if (!spi3) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 3\n"); - led_on(LED_BLUE); - } - - /* Copied from fmu-v4 - * Default SPI3 to 12MHz and de-assert the known chip selects. - * MS5611 has max SPI clock speed of 20MHz - */ - - // BMP280 max SPI speed is 10 MHz - SPI_SETFREQUENCY(spi3, 10 * 1000 * 1000); - SPI_SETBITS(spi3, 8); - SPI_SETMODE(spi3, SPIDEV_MODE3); - up_udelay(20); - -#if defined(FLASH_BASED_PARAMS) - static sector_descriptor_t params_sector_map[] = { - {1, 16 * 1024, 0x08004000}, - {0, 0, 0}, - }; - - /* Initialize the flashfs layer to use heap allocated memory */ - result = parameter_flashfs_init(params_sector_map, NULL, 0); - - if (result != OK) { - syslog(LOG_ERR, "[boot] FAILED to init params in FLASH %d\n", result); - led_on(LED_AMBER); - } - -#endif - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/omnibus/f4sd/src/led.c b/boards/omnibus/f4sd/src/led.c deleted file mode 100644 index 463474a..0000000 --- a/boards/omnibus/f4sd/src/led.c +++ /dev/null @@ -1,120 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2018 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * omnibusf4sd LED backend. - */ - -#include - -#include - -#include "stm32.h" -#include "board_config.h" - -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -static uint32_t g_ledmap[] = { - GPIO_LED_BLUE, -}; - -__EXPORT void led_init(void) -{ - /* Configure LED GPIOs for output */ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - stm32_configgpio(g_ledmap[l]); - } -} - -static void phy_set_led(int led, bool state) -{ - /* Pull Down to switch on */ - if (led == 0) { - stm32_gpiowrite(g_ledmap[led], !state); - } -} - -__EXPORT void led_on(int led) -{ - phy_set_led(led, true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(led, false); -} - -__EXPORT void led_toggle(int led) -{ - if (led == 0) { - phy_set_led(led, !stm32_gpioread(g_ledmap[led])); - } -} - -__EXPORT void board_autoled_initialize(void) -{ - /* Configure LED1 GPIO for output */ - stm32_configgpio(GPIO_LED1); -} - -__EXPORT void board_autoled_on(int led) -{ - if (led == 1) { - /* Pull down to switch on */ - stm32_gpiowrite(GPIO_LED1, false); - } -} - -__EXPORT void board_autoled_off(int led) -{ - if (led == 1) { - /* Pull up to switch off */ - stm32_gpiowrite(GPIO_LED1, true); - } -} diff --git a/boards/omnibus/f4sd/src/spi.cpp b/boards/omnibus/f4sd/src/spi.cpp deleted file mode 100644 index b3415ba..0000000 --- a/boards/omnibus/f4sd/src/spi.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2018 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_MPU6000, SPI::CS{GPIO::PortA, GPIO::Pin4}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortA, GPIO::Pin4}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20608G, SPI::CS{GPIO::PortA, GPIO::Pin4}), - }), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_MMCSD(0), SPI::CS{GPIO::PortB, GPIO::Pin12}) - }), - initSPIBus(SPI::Bus::SPI3, { - initSPIDevice(DRV_BARO_DEVTYPE_BMP280, SPI::CS{GPIO::PortB, GPIO::Pin3}), - initSPIDevice(DRV_OSD_DEVTYPE_ATXXXX, SPI::CS{GPIO::PortA, GPIO::Pin15}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/omnibus/f4sd/src/timer_config.cpp b/boards/omnibus/f4sd/src/timer_config.cpp deleted file mode 100644 index fe452f3..0000000 --- a/boards/omnibus/f4sd/src/timer_config.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2018 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer3, DMA{DMA::Index1, DMA::Stream2, DMA::Channel5}), - initIOTimer(Timer::Timer2, DMA{DMA::Index1, DMA::Stream1, DMA::Channel3}), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel3}, {GPIO::PortB, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel4}, {GPIO::PortB, GPIO::Pin1}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel4}, {GPIO::PortA, GPIO::Pin3}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel3}, {GPIO::PortA, GPIO::Pin2}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/omnibus/f4sd/src/usb.c b/boards/omnibus/f4sd/src/usb.c deleted file mode 100644 index 09f0cde..0000000 --- a/boards/omnibus/f4sd/src/usb.c +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2018 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include "board_config.h" - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -/************************************************************************************ - * Name: stm32_usbinitialize - * - * Description: - * Called to setup USB-related GPIO pins for the omnibusf4sd 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_STM32_OTGFS - stm32_configgpio(GPIO_OTGFS_VBUS); - /* XXX We only support device mode - stm32_configgpio(GPIO_OTGFS_PWRON); - stm32_configgpio(GPIO_OTGFS_OVER); - */ -#endif -} - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/px4/fmu-v2/default.px4board b/boards/px4/fmu-v2/default.px4board deleted file mode 100644 index 1e55f5c..0000000 --- a/boards/px4/fmu-v2/default.px4board +++ /dev/null @@ -1,52 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_CONSTRAINED_FLASH=y -CONFIG_BOARD_NO_HELP=y -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS3" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS2" -CONFIG_BOARD_SERIAL_TEL4="/dev/ttyS6" -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_BAROMETER_MS5611=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU6000=y -CONFIG_DRIVERS_IMU_L3GD20=y -CONFIG_DRIVERS_IMU_LSM303D=y -CONFIG_DRIVERS_LIGHTS_RGBLED=y -CONFIG_DRIVERS_MAGNETOMETER_HMC5883=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_PX4IO=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -# CONFIG_EKF2_AUXVEL is not set -# CONFIG_EKF2_BARO_COMPENSATION is not set -# CONFIG_EKF2_DRAG_FUSION is not set -# CONFIG_EKF2_EXTERNAL_VISION is not set -# CONFIG_EKF2_GNSS_YAW is not set -# CONFIG_EKF2_SIDESLIP is not set -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_SENSORS=y -# CONFIG_SENSORS_VEHICLE_AIRSPEED is not set -# CONFIG_SENSORS_VEHICLE_OPTICAL_FLOW is not set -CONFIG_SYSTEMCMDS_BL_UPDATE=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_VER=y diff --git a/boards/px4/fmu-v2/extras/px4_fmu-v2_bootloader.bin b/boards/px4/fmu-v2/extras/px4_fmu-v2_bootloader.bin deleted file mode 100644 index 75e1e3a..0000000 Binary files a/boards/px4/fmu-v2/extras/px4_fmu-v2_bootloader.bin and /dev/null differ diff --git a/boards/px4/fmu-v2/extras/px4_io-v2_default.bin b/boards/px4/fmu-v2/extras/px4_io-v2_default.bin deleted file mode 100755 index 957f0f1..0000000 Binary files a/boards/px4/fmu-v2/extras/px4_io-v2_default.bin and /dev/null differ diff --git a/boards/px4/fmu-v2/firmware.prototype b/boards/px4/fmu-v2/firmware.prototype deleted file mode 100644 index f605981..0000000 --- a/boards/px4/fmu-v2/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 9, - "magic": "PX4FWv1", - "description": "Firmware for the PX4FMUv2 board", - "image": "", - "build_time": 0, - "summary": "PX4FMUv2", - "version": "0.1", - "image_size": 0, - "image_maxsize": 1032192, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/px4/fmu-v2/fixedwing.px4board b/boards/px4/fmu-v2/fixedwing.px4board deleted file mode 100644 index 0bde0c7..0000000 --- a/boards/px4/fmu-v2/fixedwing.px4board +++ /dev/null @@ -1,12 +0,0 @@ -CONFIG_MODULES_FLIGHT_MODE_MANAGER=n -CONFIG_MODULES_MC_ATT_CONTROL=n -CONFIG_MODULES_MC_POS_CONTROL=n -CONFIG_MODULES_MC_RATE_CONTROL=n -CONFIG_SYSTEMCMDS_BL_UPDATE=n -CONFIG_DRIVERS_DIFFERENTIAL_PRESSURE_MS4525DO=y -CONFIG_DRIVERS_DISTANCE_SENSOR_LIGHTWARE_LASER_I2C=y -CONFIG_DRIVERS_DISTANCE_SENSOR_LIGHTWARE_LASER_SERIAL=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y diff --git a/boards/px4/fmu-v2/init/rc.board_defaults b/boards/px4/fmu-v2/init/rc.board_defaults deleted file mode 100644 index e9fecd7..0000000 --- a/boards/px4/fmu-v2/init/rc.board_defaults +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 10.177939394 -param set-default BAT1_A_PER_V 15.391030303 - -param set-default SYS_USE_IO 1 diff --git a/boards/px4/fmu-v2/init/rc.board_sensors b/boards/px4/fmu-v2/init/rc.board_sensors deleted file mode 100644 index f59e7b2..0000000 --- a/boards/px4/fmu-v2/init/rc.board_sensors +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/sh -# -# board specific sensors init -#------------------------------------------------------------------------------ - -rgbled start -I -rgbled_ncp5623c start -I - -board_adc start - -# Internal I2C bus -hmc5883 -T -I -R 4 start - -# Internal SPI (auto detect ms5611 or ms5607) -if ! ms5611 -T 5607 -q -s -b 1 start -then - ms5611 -s -b 1 start -fi - -set BOARD_FMUV3 0 - -# V3 build hwtypecmp supports V2|V2M|V30 -if ver hwtypecmp V30 -then - # Check for Pixhawk 2.0 cube (isolated IMU on SPI4) - # mpu6000 on v2.0, mpu9250 on v2.1 - if mpu6000 -s -b 4 -R 10 start - then - set BOARD_FMUV3 20 - else - # Check for Pixhawk 2.1 cube - # isolated/external mpu9250 (SPI4) - if mpu9250 -s -b 4 -R 10 start - then - set BOARD_FMUV3 21 - fi - fi -fi - -# Check if a Pixhack (which reports as V2M) is present -if ver hwtypecmp V2M -then - # Internal SPI bus ICM-20608-G - icm20608g -s -b 1 -R 14 start - - # Pixhawk Mini doesn't have these sensors, - # so if they are found we know its a Pixhack - - # mppu6000 internal (SPI1) - if mpu6000 -s -b 1 -R 10 start - then - set BOARD_FMUV3 20 - else - # Check for Pixhack 3.1 - # mpu9250 external (SPI4) - if mpu9250 -s -b 1 -R 10 start - then - set BOARD_FMUV3 21 - fi - fi -fi - -if [ $BOARD_FMUV3 != 0 ] -then - # sensor heating is available, but we disable it for now - param set-default SENS_EN_THERMAL 0 - - # ms5611 (external/isolated SPI4) - ms5611 -s -b 4 start - - if [ $BOARD_FMUV3 = 20 ] - then - # v2.0 internal mpu6000 - mpu6000 -s -b 1 start - - # v2.0 Has internal hmc5883 on SPI1 - hmc5883 -T -s -b 1 -R 8 start - fi - - if [ $BOARD_FMUV3 = 21 ] - then - # v2.1 mpu9250 on SPI1 - mpu9250 -s -b 1 start - fi - - # l3gd20 (external/isolated SPI4) - # low quality sensor disabled by default to save memory - #l3gd20 -s -b 4 -R 4 start - - # lsm303d (external/isolated SPI4) - lsm303d -s -b 4 -R 6 start - -else - # $BOARD_FMUV3 = 0 -> FMUv2 - - mpu6000 -s -b 1 -R 14 start - - # As we will use the external mag and the ICM-20608-G - # V2 build hwtypecmp is always false - # V3 build hwtypecmp supports V2|V2M|V30 - if ! ver hwtypecmp V2M - then - mpu9250 -s -b 1 -R 14 -q start - # else: On the PixhawkMini the mpu9250 has been disabled due to HW errata - fi - - l3gd20 -s -b 1 start - lsm303d -s -b 1 start -fi - -unset BOARD_FMUV3 diff --git a/boards/px4/fmu-v2/lto.px4board b/boards/px4/fmu-v2/lto.px4board deleted file mode 100644 index cca9cdd..0000000 --- a/boards/px4/fmu-v2/lto.px4board +++ /dev/null @@ -1 +0,0 @@ -CONFIG_BOARD_LTO=y diff --git a/boards/px4/fmu-v2/multicopter.px4board b/boards/px4/fmu-v2/multicopter.px4board deleted file mode 100644 index b4e05c4..0000000 --- a/boards/px4/fmu-v2/multicopter.px4board +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_SYSTEMCMDS_BL_UPDATE=n -CONFIG_DRIVERS_DISTANCE_SENSOR_LIGHTWARE_LASER_I2C=y diff --git a/boards/px4/fmu-v2/nuttx-config/Kconfig b/boards/px4/fmu-v2/nuttx-config/Kconfig deleted file mode 100644 index 6ce42ae..0000000 --- a/boards/px4/fmu-v2/nuttx-config/Kconfig +++ /dev/null @@ -1,22 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see misc/tools/kconfig-language.txt. -# - -if ARCH_BOARD_PX4_FMU_V2 - -config BOARD_HAS_PROBES - bool "Board provides GPIO or other Hardware for signaling to timing analyze." - default y - ---help--- - This board provides GPIO FMU-CH1-6 as PROBE_1-6 to provide timing signals from selected drivers. - -config BOARD_USE_PROBES - bool "Enable the use the board provided GPIO FMU-CH1-6 as PROBE_1-6 to provide timing signals from selected drivers" - default n - depends on BOARD_HAS_PROBES - - ---help--- - Select to use GPIO FMU-CH1-6 to provide timing signals from selected drivers. - -endif diff --git a/boards/px4/fmu-v2/nuttx-config/include/board.h b/boards/px4/fmu-v2/nuttx-config/include/board.h deleted file mode 100644 index 7ced3b6..0000000 --- a/boards/px4/fmu-v2/nuttx-config/include/board.h +++ /dev/null @@ -1,315 +0,0 @@ -/************************************************************************************ - * nuttx-configs/px4_fmu-v2/include/board.h - * include/arch/board/board.h - * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ************************************************************************************/ - -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ -#include "board_dma_map.h" - -#include -#ifndef __ASSEMBLY__ -# include -#endif - -#include - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The PX4FMUV2 uses a 24MHz crystal connected to the HSE. - * - * This is the "standard" configuration as set up by arch/arm/src/stm32f40xx_rcc.c: - * System Clock source : PLL (HSE) - * SYSCLK(Hz) : 168000000 Determined by PLL configuration - * HCLK(Hz) : 168000000 (STM32_RCC_CFGR_HPRE) - * AHB Prescaler : 1 (STM32_RCC_CFGR_HPRE) - * APB1 Prescaler : 4 (STM32_RCC_CFGR_PPRE1) - * APB2 Prescaler : 2 (STM32_RCC_CFGR_PPRE2) - * HSE Frequency(Hz) : 24000000 (STM32_BOARD_XTAL) - * PLLM : 24 (STM32_PLLCFG_PLLM) - * PLLN : 336 (STM32_PLLCFG_PLLN) - * PLLP : 2 (STM32_PLLCFG_PLLP) - * PLLQ : 7 (STM32_PLLCFG_PPQ) - * Main regulator output voltage : Scale1 mode Needed for high speed SYSCLK - * Flash Latency(WS) : 5 - * Prefetch Buffer : OFF - * Instruction cache : ON - * Data cache : ON - * Require 48MHz for USB OTG FS, : Enabled - * SDIO and RNG clock - */ - -/* HSI - 16 MHz RC factory-trimmed - * LSI - 32 KHz RC - * HSE - On-board crystal frequency is 24MHz - * LSE - not installed - */ - -#define STM32_BOARD_XTAL 24000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -//#define STM32_LSE_FREQUENCY 32768 - -/* Main PLL Configuration. - * - * PLL source is HSE - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * = (25,000,000 / 25) * 336 - * = 336,000,000 - * SYSCLK = PLL_VCO / PLLP - * = 336,000,000 / 2 = 168,000,000 - * USB OTG FS, SDIO and RNG Clock - * = PLL_VCO / PLLQ - * = 48,000,000 - */ - -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(24) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(336) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(7) - -#define STM32_SYSCLK_FREQUENCY 168000000ul - -/* AHB clock (HCLK) is SYSCLK (168MHz) */ - -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (42MHz) */ - -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (84MHz) */ - -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx - * otherwise frequency is 2xAPBx. - * Note: TIM1,8-11 are on APB2, others on APB1 - */ - -#define BOARD_TIM1_FREQUENCY STM32_APB2_TIM1_CLKIN -#define BOARD_TIM2_FREQUENCY STM32_APB1_TIM2_CLKIN -#define BOARD_TIM3_FREQUENCY STM32_APB1_TIM3_CLKIN -#define BOARD_TIM4_FREQUENCY STM32_APB1_TIM4_CLKIN -#define BOARD_TIM5_FREQUENCY STM32_APB1_TIM5_CLKIN -#define BOARD_TIM6_FREQUENCY STM32_APB1_TIM6_CLKIN -#define BOARD_TIM7_FREQUENCY STM32_APB1_TIM7_CLKIN -#define BOARD_TIM8_FREQUENCY STM32_APB2_TIM8_CLKIN -#define BOARD_TIM9_FREQUENCY STM32_APB2_TIM9_CLKIN -#define BOARD_TIM10_FREQUENCY STM32_APB2_TIM10_CLKIN -#define BOARD_TIM11_FREQUENCY STM32_APB2_TIM11_CLKIN -#define BOARD_TIM12_FREQUENCY STM32_APB1_TIM12_CLKIN -#define BOARD_TIM13_FREQUENCY STM32_APB1_TIM13_CLKIN -#define BOARD_TIM14_FREQUENCY STM32_APB1_TIM14_CLKIN - -/* SDIO dividers. Note that slower clocking is required when DMA is disabled - * in order to avoid RX overrun/TX underrun errors due to delayed responses - * to service FIFOs in interrupt driven mode. These values have not been - * tuned!!! - * - * SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(118+2)=400 KHz - */ - -#define SDIO_INIT_CLKDIV (118 << SDIO_CLKCR_CLKDIV_SHIFT) - -/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz - * DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32_SDIO_DMA -# define SDIO_MMCXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) -#else -# define SDIO_MMCXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) -#endif - -/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz - * DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32_SDIO_DMA -# define SDIO_SDXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) -#else -# define SDIO_SDXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) -#endif - -/* Alternate function pin selections ************************************************/ - -/* UARTs */ - -#define GPIO_USART1_RX GPIO_USART1_RX_1 /* Console in from IO */ -#define GPIO_USART1_TX 0 /* USART1 is RX-only */ - -#define GPIO_USART2_RX GPIO_USART2_RX_2 -#define GPIO_USART2_TX GPIO_USART2_TX_2 -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 -#define GPIO_USART2_CTS GPIO_USART2_CTS_2 - -#define GPIO_USART3_RX GPIO_USART3_RX_3 -#define GPIO_USART3_TX GPIO_USART3_TX_3 -#define GPIO_USART3_RTS GPIO_USART3_RTS_2 -#define GPIO_USART3_CTS GPIO_USART3_CTS_2 - -#define GPIO_UART4_RX GPIO_UART4_RX_1 -#define GPIO_UART4_TX GPIO_UART4_TX_1 - -#define GPIO_USART6_RX GPIO_USART6_RX_1 -#define GPIO_USART6_TX GPIO_USART6_TX_1 - -#define GPIO_UART7_RX GPIO_UART7_RX_1 -#define GPIO_UART7_TX GPIO_UART7_TX_1 - -/* UART8 has no alternate pin config */ - -/* CAN - * - * CAN1 is routed to the onboard transceiver. - * CAN2 is routed to the expansion connector. - */ - -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 -#define GPIO_CAN2_RX GPIO_CAN2_RX_1 -#define GPIO_CAN2_TX GPIO_CAN2_TX_2 - -/* I2C - * - * The optional _GPIO configurations allow the I2C driver to manually - * reset the bus to clear stuck slaves. They match the pin configuration, - * but are normally-high GPIOs. - */ - -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN8) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN9) - -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_1 -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_1 -#define GPIO_I2C2_SCL_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN10) -#define GPIO_I2C2_SDA_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN11) - -/* SPI - * - * There are sensors on SPI1, and SPI2 is connected to the FRAM. - */ - -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 - -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_2 - -#define GPIO_SPI4_MISO GPIO_SPI4_MISO_1 -#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_1 -#define GPIO_SPI4_SCK GPIO_SPI4_SCK_1 - -/* LED Definitions. Needed if CONFIG_ARCH_LEDs is defined */ - -#define LED_STARTED 0 -#define LED_HEAPALLOCATE 0 -#define LED_IRQSENABLED 0 -#define LED_STACKCREATED 1 -#define LED_INIRQ 1 -#define LED_SIGNAL 1 -#define LED_ASSERTION 1 -#define LED_PANIC 1 - -/* Board provides GPIO or other Hardware for signaling to timing analyzer */ - -#if defined(CONFIG_BOARD_USE_PROBES) -# define PROBE_N(n) (1<<((n)-1)) -# define PROBE_1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN14) -# define PROBE_2 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN13) -# define PROBE_3 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN11) -# define PROBE_4 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN9) -# define PROBE_5 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN13) -# define PROBE_6 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN14) - -# define PROBE_INIT(mask) \ - do { \ - if ((mask)& PROBE_N(1)) { stm32_configgpio(PROBE_1); } \ - if ((mask)& PROBE_N(2)) { stm32_configgpio(PROBE_2); } \ - if ((mask)& PROBE_N(3)) { stm32_configgpio(PROBE_3); } \ - if ((mask)& PROBE_N(4)) { stm32_configgpio(PROBE_4); } \ - if ((mask)& PROBE_N(5)) { stm32_configgpio(PROBE_5); } \ - if ((mask)& PROBE_N(6)) { stm32_configgpio(PROBE_6); } \ - } while(0) - -# define PROBE(n,s) do {stm32_gpiowrite(PROBE_##n,(s));}while(0) -# define PROBE_MARK(n) PROBE(n,false);PROBE(n,true) -#else -# define PROBE_INIT(mask) -# define PROBE(n,s) -# define PROBE_MARK(n) -#endif - - - - -#endif /* __ARCH_BOARD_BOARD_H */ diff --git a/boards/px4/fmu-v2/nuttx-config/include/board_dma_map.h b/boards/px4/fmu-v2/nuttx-config/include/board_dma_map.h deleted file mode 100644 index b947a9d..0000000 --- a/boards/px4/fmu-v2/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/* -| DMA1 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | SPI3_RX_1 | - | SPI3_RX_2 | SPI2_RX | SPI2_TX | SPI3_TX_1 | - | SPI3_TX_2 | -| Channel 1 | I2C1_RX | - | TIM7_UP_1 | - | TIM7_UP_2 | I2C1_RX_1 | I2C1_TX | I2C1_TX_1 | -| Channel 2 | TIM4_CH1 | - | I2C4_RX | TIM4_CH2 | - | I2C4_RX | TIM4_UP | TIM4_CH3 | -| Channel 3 | - | TIM2_UP_1 | I2C3_RX_1 | I2C2_EXT_RX | I2C3_TX | TIM2_CH1 | TIM2_CH2 | TIM2_UP_2 | -| | | TIM2_CH3 | | | | | TIM2_CH4_1 | TIM2_CH4_2 | -| Channel 4 | UART5_RX | USART3_RX | UART4_RX | USART3_TX_1 | UART4_TX | USART2_RX | USART2_TX | UART5_TX | -| Channel 5 | UART8_TX | UART7_TX | TIM3_CH4 | UART7_RX | TIM3_CH1 | TIM3_CH2 | UART8_RX | TIM3_CH3 | -| | | | TIM3_UP | | TIM3_TRIG | | | | -| Channel 6 | TIM5_CH3 | TIM5_CH4_1 | TIM5_CH1 | TIM5_CH4_2 | TIM5_CH2 | - | TIM5_UP_2 | - | -| | TIM5_UP_1 | TIM5_TRIG_1 | | TIM5_TRIG_2 | | | | | -| Channel 7 | - | TIM6_UP | I2C2_RX | I2C2_RX_1 | USART3_TX_2 | DAC1 | DAC2 | I2C2_TX | -| | | | | | | | | | -| Usage | | USART3_RX | UART4_RX | UART7_RX | USART3_TX_2 | USART2_RX | TIM4_UP | | - - -| DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | ADC1_1 | SAI1_A | TIM8_CH1_1 | SAI1_A_1 | ADC1_2 | SAI1_B_1 | TIM1_CH1_1 | - | -| | | | TIM8_CH2_1 | | | | TIM1_CH2_1 | | -| | | | TIM8_CH3_1 | | | | TIM1_CH3_1 | | -| Channel 1 | - | DCMI_1 | ADC2_1 | ADC2_2 | SAI1_B | SPI6_TX | SPI6_RX | DCMI_2 | -| Channel 2 | ADC3_1 | ADC3_2 | - | SPI5_RX_1 | SPI5_TX_1 | CRYP_OUT | CRYP_IN | HASH_IN | -| Channel 3 | SPI1_RX_1 | - | SPI1_RX_2 | SPI1_TX_1 | - | SPI1_TX_2 | - | QUADSPI | -| Channel 4 | SPI4_RX_1 | SPI4_TX_1 | USART1_RX_1 | SDIO | - | USART1_RX_2 | SDIO | USART1_TX | -| Channel 5 | - | USART6_RX_1 | USART6_RX_2 | SPI4_RX_2 | SPI4_TX_2 | - | USART6_TX_1 | USART6_TX_2 | -| Channel 6 | TIM1_TRIG_1 | TIM1_CH1_2 | TIM1_CH2_2 | TIM1_CH1 | TIM1_CH4 | TIM1_UP | TIM1_CH3_2 | - | -| | | | | | TIM1_TRIG_2 | | | | -| | | | | | TIM1_COM | | | | -| Channel 7 | - | TIM8_UP | TIM8_CH1_2 | TIM8_CH2_2 | TIM8_CH3_2 | SPI5_RX_2 | SPI5_TX_2 | TIM8_CH4 | -| | | | | | | | | TIM8_TRIG | -| | | | | | | | | TIM8_COM | -| | | | | | | | | | -| Usage | SPI4_RX_1 | USART6_RX_1 | SPI1_RX_2 | SPI1_TX_1 | SPI4_TX_2 | TIM1_UP | SDIO | USART6_TX_2 | - */ - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// DMAMAP_USART3_RX // DMA1, Stream 1, Channel 4 -// DMAMAP_UART4_RX // DMA1, Stream 2, Channel 4 -// DMAMAP_UART7_RX // DMA1, Stream 3, Channel 5 -#define DMAMAP_USART3_TX DMAMAP_USART3_TX_2 // DMA1, Stream 4, Channel 7 (TELEM2 TX) -// DMAMAP_USART2_RX // DMA1, Stream 5, Channel 4 -// DMAMAP_TIM4_UP // DMA1, Stream 6, Channel 2 (DSHOT) - - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMACHAN_SPI4_RX DMAMAP_SPI4_RX_1 // DMA2, Stream 0, Channel 4 (SPI4 sensors RX) -#define DMAMAP_USART6_RX DMAMAP_USART6_RX_1 // DMA2, Stream 1, Channel 4 (PX4IO RX) -#define DMACHAN_SPI1_RX DMAMAP_SPI1_RX_2 // DMA2, Stream 2, Channel 3 (SPI1 sensors RX) -#define DMACHAN_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 3, Channel 3 (SPI1 sensors TX) -#define DMACHAN_SPI4_TX DMAMAP_SPI4_TX_2 // DMA2, Stream 4, Channel 5 (SPI4 sensors TX) -// DMAMAP_TIM1_UP // DMA2, Stream 5, Channel 6 (DSHOT) -#define DMAMAP_SDIO DMAMAP_SDIO_2 // DMA2, Stream 6, Channel 4 -#define DMAMAP_USART6_TX DMAMAP_USART6_TX_2 // DMA2, Stream 7, Channel 5 (PX4IO TX) diff --git a/boards/px4/fmu-v2/nuttx-config/nsh/defconfig b/boards/px4/fmu-v2/nuttx-config/nsh/defconfig deleted file mode 100644 index e03b021..0000000 --- a/boards/px4/fmu-v2/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,252 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_STM32_CCMEXCLUDE is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/px4/fmu-v2/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F427V=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0011 -CONFIG_CDCACM_PRODUCTSTR="PX4 FMU v2.x" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=2000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="3D Robotics" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=2 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_DEFAULT_PRIO_INHERIT=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDIO_BLOCKSETUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32_ADC1=y -CONFIG_STM32_BBSRAM=y -CONFIG_STM32_BBSRAM_FILES=5 -CONFIG_STM32_BKPSRAM=y -CONFIG_STM32_CCMDATARAM=y -CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y -CONFIG_STM32_DMA1=y -CONFIG_STM32_DMA2=y -CONFIG_STM32_FLASH_CONFIG_I=y -CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_STM32_I2C1=y -CONFIG_STM32_I2C2=y -CONFIG_STM32_I2CTIMEOMS=10 -CONFIG_STM32_I2CTIMEOTICKS=10 -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_OTGFS=y -CONFIG_STM32_PWR=y -CONFIG_STM32_RTC=y -CONFIG_STM32_RTC_HSECLOCK=y -CONFIG_STM32_RTC_MAGIC=0xfacefeee -CONFIG_STM32_RTC_MAGIC_REG=1 -CONFIG_STM32_RTC_MAGIC_TIME_SET=0xfacefeef -CONFIG_STM32_SAVE_CRASHDUMP=y -CONFIG_STM32_SDIO=y -CONFIG_STM32_SDIO_CARD=y -CONFIG_STM32_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32_SPI1=y -CONFIG_STM32_SPI1_DMA=y -CONFIG_STM32_SPI1_DMA_BUFFER=512 -CONFIG_STM32_SPI2=y -CONFIG_STM32_SPI4=y -CONFIG_STM32_SPI4_DMA=y -CONFIG_STM32_SPI4_DMA_BUFFER=512 -CONFIG_STM32_SPI_DMATHRESHOLD=32 -CONFIG_STM32_TIM10=y -CONFIG_STM32_TIM11=y -CONFIG_STM32_TIM3=y -CONFIG_STM32_TIM9=y -CONFIG_STM32_UART4=y -CONFIG_STM32_UART7=y -CONFIG_STM32_UART8=y -CONFIG_STM32_USART1=y -CONFIG_STM32_USART2=y -CONFIG_STM32_USART3=y -CONFIG_STM32_USART6=y -CONFIG_STM32_USART_BREAKS=y -CONFIG_STM32_USART_SINGLEWIRE=y -CONFIG_STM32_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=300 -CONFIG_UART4_RXDMA=y -CONFIG_UART4_TXBUFSIZE=300 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=300 -CONFIG_UART7_RXDMA=y -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=300 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=300 -CONFIG_UART8_TXBUFSIZE=300 -CONFIG_USART1_RXBUFSIZE=128 -CONFIG_USART1_TXBUFSIZE=32 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=1100 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=300 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=600 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=300 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/px4/fmu-v2/nuttx-config/scripts/script.ld b/boards/px4/fmu-v2/nuttx-config/scripts/script.ld deleted file mode 100644 index a2d5f9f..0000000 --- a/boards/px4/fmu-v2/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,147 +0,0 @@ -/**************************************************************************** - * scripts/ld.script - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F427 has 2048Kb of FLASH beginning at address 0x0800:0000 and - * 256Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of SRAM beginning at address 0x2002:0000 - * 4) 64Kb of TCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 0x4000 of flash is reserved for the bootloader. - */ - -MEMORY -{ - /* disabled due to silicon errata flash (rx) : ORIGIN = 0x08004000, LENGTH = 2032K */ - flash (rx) : ORIGIN = 0x08004000, LENGTH = 1008K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 192K - ccsram (rwx) : ORIGIN = 0x10000000, LENGTH = 64K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/px4/fmu-v2/rover.px4board b/boards/px4/fmu-v2/rover.px4board deleted file mode 100644 index f274a94..0000000 --- a/boards/px4/fmu-v2/rover.px4board +++ /dev/null @@ -1,15 +0,0 @@ -CONFIG_MODULES_FLIGHT_MODE_MANAGER=n -CONFIG_MODULES_MC_ATT_CONTROL=n -CONFIG_MODULES_MC_POS_CONTROL=n -CONFIG_MODULES_MC_RATE_CONTROL=n -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_DRIVERS_OPTICAL_FLOW_PX4FLOW=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/px4/fmu-v2/src/CMakeLists.txt b/boards/px4/fmu-v2/src/CMakeLists.txt deleted file mode 100644 index ae93a84..0000000 --- a/boards/px4/fmu-v2/src/CMakeLists.txt +++ /dev/null @@ -1,52 +0,0 @@ -############################################################################ -# -# Copyright (c) 2015 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. -# -############################################################################ - -add_library(drivers_board - can.c - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - usb.c - manifest.c -) - -target_link_libraries(drivers_board - PRIVATE - arch_spi - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer -) diff --git a/boards/px4/fmu-v2/src/board_config.h b/boards/px4/fmu-v2/src/board_config.h deleted file mode 100644 index 643e175..0000000 --- a/boards/px4/fmu-v2/src/board_config.h +++ /dev/null @@ -1,212 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013-2016 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * PX4FMUv2 internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -/* Run time Hardware detection */ -#define BOARD_HAS_SIMPLE_HW_VERSIONING 1 -#define HW_VER_PA8 (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTA|GPIO_PIN8) -#define HW_VER_PB4 (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN4) -#define HW_VER_PB12 (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN12) -#define HW_VER_PA8_INIT (GPIO_VDD_5V_PERIPH_EN) -#define HW_VER_PB4_INIT (GPIO_SPI1_EXTI_DRDY_PB4) -#define HW_VER_PB12_INIT (GPIO_CAN2_RX | GPIO_PULLUP) /* Assume V2 needing pull up */ -#define HW_VER_FMUV2_STATE 0x8 /* PB12:PU:1 PB12:PD:0 PB4:PU:0 PB4PD:0 */ -#define HW_VER_FMUV3_STATE 0xE /* PB12:PU:1 PB12:PD:1 PB4:PU:1 PB4PD:0 */ -#define HW_VER_FMUV2MINI_STATE 0xA /* PB12:PU:1 PB12:PD:0 PB4:PU:1 PB4PD:0 */ -#define HW_VER_FMUV2X_STATE 0xB /* PB12:PU:1 PB12:PD:0 PB4:PU:1 PB4PD:1 */ -#define HW_VER_TYPE_INIT {'V','2',0, 0} -#define BOARD_NUM_SPI_CFG_HW_VERSIONS 3 - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ -/* Configuration ************************************************************************************/ - -/* PX4IO connection configuration */ -#define BOARD_USES_PX4IO_VERSION 2 -#define PX4IO_SERIAL_DEVICE "/dev/ttyS4" -#define PX4IO_SERIAL_TX_GPIO GPIO_USART6_TX -#define PX4IO_SERIAL_RX_GPIO GPIO_USART6_RX -#define PX4IO_SERIAL_BASE STM32_USART6_BASE /* hardwired on the board */ -#define PX4IO_SERIAL_VECTOR STM32_IRQ_USART6 -#define PX4IO_SERIAL_TX_DMAMAP DMAMAP_USART6_TX -#define PX4IO_SERIAL_RX_DMAMAP DMAMAP_USART6_RX -#define PX4IO_SERIAL_RCC_REG STM32_RCC_APB2ENR -#define PX4IO_SERIAL_RCC_EN RCC_APB2ENR_USART6EN -#define PX4IO_SERIAL_CLOCK STM32_PCLK2_FREQUENCY -#define PX4IO_SERIAL_BITRATE 1500000 /* 1.5Mbps -> max rate for IO */ - - -/* PX4FMU GPIOs ***********************************************************************************/ -/* LEDs */ - -#define GPIO_LED1 (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN12) -#define BOARD_OVERLOAD_LED LED_AMBER - -#define GPIO_SPI1_EXTI_DRDY_PB4 (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTB|GPIO_PIN4) - -#define BOARD_SPI_BUS_MAX_BUS_ITEMS 3 - -/* I2C busses */ -#define BOARD_OVERRIDE_I2C_BUS_EXTERNAL - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that can be used by the Px4 Firmware in the adc driver - */ -#define ADC_CHANNELS (1 << 2) | (1 << 3) | (1 << 4) | (1 << 10) | (1 << 11) | (1 << 12) | (1 << 13) | (1 << 14) | (1 << 15) - -// ADC defines to be used in sensors.cpp to read from a particular channel -#define ADC_BATTERY_VOLTAGE_CHANNEL 2 -#define ADC_BATTERY_CURRENT_CHANNEL 3 -#define ADC_5V_RAIL_SENSE 4 -#define ADC_AIRSPEED_VOLTAGE_CHANNEL 15 - -/* Power supply control and monitoring GPIOs */ -#define GPIO_VDD_5V_PERIPH_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN8) -#define GPIO_VDD_BRICK_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5) -#define GPIO_VDD_SERVO_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN7) -#define GPIO_VDD_USB_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN0) -#define GPIO_VDD_5V_HIPOWER_OC (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN10) -#define GPIO_VDD_5V_PERIPH_OC (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN15) - -/* Tone alarm output */ -#define TONE_ALARM_TIMER 2 /* timer 2 */ -#define TONE_ALARM_CHANNEL 1 /* channel 1 */ -#define GPIO_TONE_ALARM_IDLE (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) -#define GPIO_TONE_ALARM (GPIO_ALT|GPIO_AF1|GPIO_SPEED_2MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN15) - -/* PWM - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 6 - -/* USB OTG FS - * - * PA9 OTG_FS_VBUS VBUS sensing (also connected to the green LED) - */ -#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 8 /* use timer8 for the HRT */ -#define HRT_TIMER_CHANNEL 1 /* use capture/compare channel */ - -/* PWM input driver. Use FMU AUX5 pins attached to timer4 channel 2 */ -#define PWMIN_TIMER 4 -#define PWMIN_TIMER_CHANNEL 2 -#define GPIO_PWM_IN GPIO_TIM4_CH2IN_2 - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_BRICK_VALID (!px4_arch_gpioread(GPIO_VDD_BRICK_VALID)) -#define BOARD_ADC_SERVO_VALID (!px4_arch_gpioread(GPIO_VDD_SERVO_VALID)) -#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_VDD_USB_VALID)) -#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_VDD_5V_PERIPH_OC)) -#define BOARD_ADC_HIPOWER_5V_OC (!px4_arch_gpioread(GPIO_VDD_5V_HIPOWER_OC)) - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -#define BOARD_HAS_ON_RESET 1 - - -__BEGIN_DECLS - -/**************************************************************************************************** - * Public Types - ****************************************************************************************************/ - -/**************************************************************************************************** - * Public data - ****************************************************************************************************/ - -#ifndef __ASSEMBLY__ - -/**************************************************************************************************** - * Public Functions - ****************************************************************************************************/ - -/**************************************************************************************************** - * Name: stm32_spiinitialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the PX4FMU board. - * - ****************************************************************************************************/ - -extern void stm32_spiinitialize(void); - -/**************************************************************************************************** - * Name: board_spi_reset board_peripheral_reset - * - * Description: - * Called to reset SPI and the perferal bus - * - ****************************************************************************************************/ - -extern void board_peripheral_reset(int ms); - -/**************************************************************************************************** - * Name: stm32_usbinitialize - * - * Description: - * Called to configure USB IO. - * - ****************************************************************************************************/ - -extern void stm32_usbinitialize(void); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/px4/fmu-v2/src/can.c b/boards/px4/fmu-v2/src/can.c deleted file mode 100644 index 25943d5..0000000 --- a/boards/px4/fmu-v2/src/can.c +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file px4fmu_can.c - * - * Board-specific CAN functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include - -#include -#include - -#include "chip.h" -#include "arm_internal.h" - -#include "stm32.h" -#include "stm32_can.h" -#include "board_config.h" - -#ifdef CONFIG_CAN - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) -# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." -# undef CONFIG_STM32_CAN2 -#endif - -#ifdef CONFIG_STM32_CAN1 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); - -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} - -#endif diff --git a/boards/px4/fmu-v2/src/i2c.cpp b/boards/px4/fmu-v2/src/i2c.cpp deleted file mode 100644 index 75a4c3b..0000000 --- a/boards/px4/fmu-v2/src/i2c.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2017 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. - * - ****************************************************************************/ - -/** - * @file px4fmu_i2c.c - * - * Board-specific I2C functions. - */ - -#include "board_config.h" -#include -#include - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), - initI2CBusInternal(2), -}; - - -bool px4_i2c_bus_external(int bus) -{ - if (HW_VER_FMUV3 == board_get_hw_version()) { - /* All FMUV3 2.1 i2c buses are external */ - return true; - - } else { - if (bus != 2) { - return true; - } - } - - return false; -} diff --git a/boards/px4/fmu-v2/src/init.c b/boards/px4/fmu-v2/src/init.c deleted file mode 100644 index e1d010f..0000000 --- a/boards/px4/fmu-v2/src/init.c +++ /dev/null @@ -1,534 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-2015 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. - * - ****************************************************************************/ - -/** - * @file px4fmu2_init.c - * - * PX4FMUv2-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include "board_config.h" -#include - -#include - -#include -#include - -#include - -#include -#include -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/**************************************************************************** - * Private Data - ****************************************************************************/ -static int hw_version = 0; -static int hw_revision = 0; -static char hw_type[4] = HW_VER_TYPE_INIT; - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - /* set the peripheral rails off */ - stm32_configgpio(GPIO_VDD_5V_PERIPH_EN); - stm32_gpiowrite(GPIO_VDD_5V_PERIPH_EN, 1); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ - stm32_gpiowrite(GPIO_VDD_5V_PERIPH_EN, 0); -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ - -__EXPORT void board_on_reset(int status) -{ - UNUSED(status); - - /* configure the GPIO pins to outputs and keep them low */ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(io_timer_channel_get_gpio_output(i)); - } - - /* On resets invoked from system (not boot) insure we establish a low - * output state (discharge the pins) on PWM pins before they become inputs. - * - * We also delay the onset of the that 3.1 Ms pulse as boot. This has - * triggered some ESC to spin. By adding this delay here the reset - * is pushed out > 400 ms. So the ESC PWM input can not mistake - * the 3.1 Ms pulse as a valid PWM command. - * - * fixme:Establish in upstream NuttX an CONFIG_IO_INIT_STATE to - * the initialize the IO lines in the clock config. - * - */ - - if (status >= 0) { - up_mdelay(400); - - /* on reboot (status >= 0) reset sensors and peripherals */ - board_control_spi_sensors_power(false, 0xffff); - } -} - -/************************************************************************************ - * Name: determine_hw_info - * - * Description: - * - * This function looks at HW deltas to determine what the - * build is running on using the following criteria: - * - * MSN PB12 FMUv2 Cube MINI - * CAN2_RX CONECTOR MX30521 NC - * PU.PD 1,0 1,1 1,0 - * - * LSN PB4 FMUv2 Cube MINI - * ACCEL_DRDY LSM303D NC NC - * PU.PD 0,0 1,0 1,0 - - * PB12:PB4 - * ud ud - * 10 00 - 0x8 FMUv2 - * 11 10 - 0xE Cube AKA V2.0 - * 10 10 - 0xA PixhawkMini - * 10 11 - 0xB FMUv2 questionable hardware (should be treated like regular FMUv2) - * - * This will return OK on success. - * - * If PB12 is not returning a consistent result we assume that it's a Cube Black - * with something connected to CAN1 and talking to it. - * - * hw_type Initial state is {'V','2',0, 0} - * V 2 - FMUv2 - * V 3 0 - FMUv3 2.0 - * V 3 1 - FMUv3 2.1 - not differentiateable, - * V 2 M - FMUv2 Mini - * - ************************************************************************************/ - -static int determine_hw_info(int *revision, int *version) -{ - *revision = 0; /* default revision */ - int pos = 0; - stm32_configgpio(GPIO_PULLDOWN | (HW_VER_PB4 & ~GPIO_PUPD_MASK)); - up_udelay(10); - *version |= stm32_gpioread(HW_VER_PB4) << pos++; - stm32_configgpio(HW_VER_PB4); - up_udelay(10); - *version |= stm32_gpioread(HW_VER_PB4) << pos++; - - int votes = 100; - int ones[2] = {0, 0}; - int zeros[2] = {0, 0}; - - while (votes--) { - stm32_configgpio(GPIO_PULLDOWN | (HW_VER_PB12 & ~GPIO_PUPD_MASK)); - up_udelay(10); - stm32_gpioread(HW_VER_PB12) ? ones[0]++ : zeros[0]++; - stm32_configgpio(HW_VER_PB12); - up_udelay(10); - stm32_gpioread(HW_VER_PB12) ? ones[1]++ : zeros[1]++; - } - - const int margin = 50; - // On Cube the detection does not work as expected when something - // is connected to CAN1. In that case, there is no clear winner - // between ones and zeros. - - if (*version == 0x2 && abs(ones[0] - zeros[0]) < margin && abs(ones[1] - zeros[1]) < margin) { - *version = HW_VER_FMUV3_STATE; - syslog(LOG_DEBUG, "Ambiguous board detection, assuming Pixhawk Cube\n"); - - } else { - - if (ones[0] > zeros[0]) { - *version |= 1 << pos; - } - - pos++; - - if (ones[1] > zeros[1] + margin) { - *version |= 1 << pos; - } - } - - stm32_configgpio(HW_VER_PB4_INIT); - stm32_configgpio(HW_VER_PB12_INIT); - - return OK; -} - -/************************************************************************************ - * Name: board_get_hw_type_name - * - * Description: - * Optional returns a string defining the HW type - * - * - ************************************************************************************/ - -__EXPORT const char *board_get_hw_type_name() -{ - return (const char *) hw_type; -} - -/************************************************************************************ - * Name: board_get_hw_version - * - * Description: - * Optional returns a integer HW version - * - * - ************************************************************************************/ - -__EXPORT int board_get_hw_version() -{ - return HW_VER_SIMPLE(hw_version); -} - -/************************************************************************************ - * Name: board_get_hw_revision - * - * Description: - * Optional returns a integer HW revision - * - * - ************************************************************************************/ - -__EXPORT int board_get_hw_revision() -{ - return hw_revision; -} - -/************************************************************************************ - * Name: stm32_boardinitialize - * - * Description: - * All STM32 architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. - * - ************************************************************************************/ - -__EXPORT void -stm32_boardinitialize(void) -{ - board_on_reset(-1); - - /* configure LEDs */ - board_autoled_initialize(); - - /* configure ADC pins */ - - stm32_configgpio(GPIO_ADC1_IN2); /* BATT_VOLTAGE_SENS */ - stm32_configgpio(GPIO_ADC1_IN3); /* BATT_CURRENT_SENS */ - stm32_configgpio(GPIO_ADC1_IN4); /* VDD_5V_SENS */ - stm32_configgpio(GPIO_ADC1_IN13); /* FMU_AUX_ADC_1 */ - stm32_configgpio(GPIO_ADC1_IN14); /* FMU_AUX_ADC_2 */ - stm32_configgpio(GPIO_ADC1_IN15); /* PRESSURE_SENS */ - - /* configure power supply control/sense pins */ - stm32_configgpio(GPIO_VDD_5V_PERIPH_EN); - board_control_spi_sensors_power_configgpio(); - board_control_spi_sensors_power(true, 0xffff); - stm32_configgpio(GPIO_VDD_BRICK_VALID); - stm32_configgpio(GPIO_VDD_SERVO_VALID); - stm32_configgpio(GPIO_VDD_USB_VALID); - stm32_configgpio(GPIO_VDD_5V_HIPOWER_OC); - stm32_configgpio(GPIO_VDD_5V_PERIPH_OC); - - /* - * CAN GPIO config. - * Forced pull up on CAN2 is required for FMUv2 where the second interface lacks a transceiver. - * If no transceiver is connected, the RX pin will float, occasionally causing CAN controller to - * fail during initialization. - */ - stm32_configgpio(GPIO_CAN1_RX); - stm32_configgpio(GPIO_CAN1_TX); - stm32_configgpio(GPIO_CAN2_RX | GPIO_PULLUP); - stm32_configgpio(GPIO_CAN2_TX); - -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -static struct spi_dev_s *spi1; -static struct spi_dev_s *spi2; -static struct spi_dev_s *spi4; -static struct sdio_dev_s *sdio; - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Ensure the power is on 1 ms before we drive the GPIO pins */ - usleep(1000); - - if (OK == determine_hw_info(&hw_revision, &hw_version)) { - switch (hw_version) { - case HW_VER_FMUV2_STATE: - break; - - case HW_VER_FMUV3_STATE: - hw_type[1]++; - hw_type[2] = '0'; - - /* Has CAN2 transceiver Remove pull up */ - - stm32_configgpio(GPIO_CAN2_RX); - - break; - - case HW_VER_FMUV2MINI_STATE: - - /* Detection for a Pixhack3 */ - - stm32_configgpio(HW_VER_PA8); - up_udelay(10); - bool isph3 = stm32_gpioread(HW_VER_PA8); - stm32_configgpio(HW_VER_PA8_INIT); - - - if (isph3) { - - /* Pixhack3 looks like a FMuV3 Cube */ - - hw_version = HW_VER_FMUV3_STATE; - hw_type[1]++; - hw_type[2] = '0'; - syslog(LOG_INFO, "\nPixhack V3 detected, forcing to fmu-v3"); - - } else { - - /* It is a mini */ - - hw_type[2] = 'M'; - } - - break; - - default: - - /* questionable px4_fmu-v2 hardware, try forcing regular FMUv2 (not much else we can do) */ - - syslog(LOG_ERR, "\nbad version detected, forcing to fmu-v2"); - hw_version = HW_VER_FMUV2_STATE; - break; - } - - syslog(LOG_DEBUG, "\nFMUv2 ver 0x%1X : Rev %x %s\n", hw_version, hw_revision, hw_type); - } - - /* configure SPI interfaces (after the hw is determined) */ - stm32_spiinitialize(); - - px4_platform_init(); - - /* configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_AMBER); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_AMBER); - } - - /* Configure SPI-based devices */ - - spi1 = stm32_spibus_initialize(1); - - if (!spi1) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 1); - led_on(LED_AMBER); - } - - /* Default SPI1 to 1MHz and de-assert the known chip selects. */ - SPI_SETFREQUENCY(spi1, 10000000); - SPI_SETBITS(spi1, 8); - SPI_SETMODE(spi1, SPIDEV_MODE3); - up_udelay(20); - - /* Get the SPI port for the FRAM */ - - spi2 = stm32_spibus_initialize(2); - - if (!spi2) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 2); - led_on(LED_AMBER); - } - - /* Default SPI2 to 37.5 MHz (40 MHz rounded to nearest valid divider, F4 max) - * and de-assert the known chip selects. */ - - // XXX start with 10.4 MHz in FRAM usage and go up to 37.5 once validated - SPI_SETFREQUENCY(spi2, 12 * 1000 * 1000); - SPI_SETBITS(spi2, 8); - SPI_SETMODE(spi2, SPIDEV_MODE3); - - spi4 = stm32_spibus_initialize(4); - - if (!spi4) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 4); - led_on(LED_AMBER); - } - - /* Default SPI4 to 1MHz and de-assert the known chip selects. */ - SPI_SETFREQUENCY(spi4, 10000000); - SPI_SETBITS(spi4, 8); - SPI_SETMODE(spi4, SPIDEV_MODE3); - -#ifdef CONFIG_MMCSD - /* First, get an instance of the SDIO interface */ - - sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO); - - if (!sdio) { - led_on(LED_AMBER); - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", CONFIG_NSH_MMCSDSLOTNO); - } - - /* Now bind the SDIO interface to the MMC/SD driver */ - int ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio); - - if (ret != OK) { - led_on(LED_AMBER); - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); - } - - /* Then let's guess and say that there is a card in the slot. There is no card detect GPIO. */ - sdio_mediachange(sdio, true); - -#endif - - /* Configure the HW based on the manifest */ - px4_platform_configure(); - - return OK; -} diff --git a/boards/px4/fmu-v2/src/led.c b/boards/px4/fmu-v2/src/led.c deleted file mode 100644 index de15c05..0000000 --- a/boards/px4/fmu-v2/src/led.c +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013 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. - * - ****************************************************************************/ - -/** - * @file px4fmu2_led.c - * - * PX4FMU LED backend. - */ - -#include - -#include - -#include "stm32.h" -#include "board_config.h" - -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -__EXPORT void led_init() -{ - /* Configure LED1 GPIO for output */ - - stm32_configgpio(GPIO_LED1); -} - -__EXPORT void led_on(int led) -{ - if (led == 1) { - /* Pull down to switch on */ - stm32_gpiowrite(GPIO_LED1, false); - } -} - -__EXPORT void led_off(int led) -{ - if (led == 1) { - /* Pull up to switch off */ - stm32_gpiowrite(GPIO_LED1, true); - } -} - -__EXPORT void led_toggle(int led) -{ - if (led == 1) { - if (stm32_gpioread(GPIO_LED1)) { - stm32_gpiowrite(GPIO_LED1, false); - - } else { - stm32_gpiowrite(GPIO_LED1, true); - } - } -} diff --git a/boards/px4/fmu-v2/src/manifest.c b/boards/px4/fmu-v2/src/manifest.c deleted file mode 100644 index e1a9825..0000000 --- a/boards/px4/fmu-v2/src/manifest.c +++ /dev/null @@ -1,153 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2018-2021 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. - * - ****************************************************************************/ - -/** - * @file manifest.c - * - * This module supplies the interface to the manifest of hardware that is - * optional and dependent on the simple Hardware versioning - * BOARD_HAS_SIMPLE_HW_VERSIONING - * - * The manifest allows the system to know whether a hardware option - * say for example the PX4IO is an no-pop option vs it is broken. - * - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include - -#include "systemlib/px4_macros.h" - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -typedef struct { - uint32_t hw_ver_rev; /* the version and revision */ - const px4_hw_mft_item_t *mft; /* The first entry */ - uint32_t entries; /* the lenght of the list */ -} px4_hw_mft_list_entry_t; - -typedef px4_hw_mft_list_entry_t *px4_hw_mft_list_entry; -#define px4_hw_mft_list_uninitialized (px4_hw_mft_list_entry) -1 - -static const px4_hw_mft_item_t device_unsupported = {0, 0, 0}; - -static const px4_hw_mft_item_t hw_mft_list_FMUv2[] = { - { - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, -}; - -static const px4_hw_mft_item_t hw_mft_list_FMUv2Mini[] = { - { - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, -}; -static const px4_hw_mft_item_t hw_mft_list_FMUv2X[] = { - { - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, -}; -static const px4_hw_mft_item_t hw_mft_list_FMUv3[] = { - { - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, -}; - -static px4_hw_mft_list_entry_t mft_lists[] = { - {HW_VER_FMUV2, hw_mft_list_FMUv2, arraySize(hw_mft_list_FMUv2)}, - {HW_VER_FMUV2MINI, hw_mft_list_FMUv2Mini, arraySize(hw_mft_list_FMUv2Mini)}, - {HW_VER_FMUV2X, hw_mft_list_FMUv2X, arraySize(hw_mft_list_FMUv2X)}, - {HW_VER_FMUV3, hw_mft_list_FMUv3, arraySize(hw_mft_list_FMUv3)}, -}; - -/************************************************************************************ - * Name: board_query_manifest - * - * Description: - * Optional returns manifest item. - * - * Input Parameters: - * manifest_id - the ID for the manifest item to retrieve - * - * Returned Value: - * 0 - item is not in manifest => assume legacy operations - * pointer to a manifest item - * - ************************************************************************************/ - -__EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) -{ - static px4_hw_mft_list_entry boards_manifest = px4_hw_mft_list_uninitialized; - - if (boards_manifest == px4_hw_mft_list_uninitialized) { - uint32_t ver_rev = board_get_hw_version(); - - for (unsigned i = 0; i < arraySize(mft_lists); i++) { - if (mft_lists[i].hw_ver_rev == ver_rev) { - boards_manifest = &mft_lists[i]; - break; - } - } - - if (boards_manifest == px4_hw_mft_list_uninitialized) { - syslog(LOG_ERR, "[boot] Board %4" PRIx32 " is not supported!\n", ver_rev); - } - } - - px4_hw_mft_item rv = &device_unsupported; - - if (boards_manifest != px4_hw_mft_list_uninitialized && - id < boards_manifest->entries) { - rv = &boards_manifest->mft[id]; - } - - return rv; -} diff --git a/boards/px4/fmu-v2/src/spi.cpp b/boards/px4/fmu-v2/src/spi.cpp deleted file mode 100644 index e28958d..0000000 --- a/boards/px4/fmu-v2/src/spi.cpp +++ /dev/null @@ -1,202 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 -#include -#include - -/* Due to inconsistent use of chip select and data ready signal on - * different board that use this build, we are using different - * versions. - * - * --------------- SPI1 -------------------- SPI4 -------------- Incompatibilities --------- - * FMUv2: FmuV3 Cube PixhawkMini - * Power Domain: VDD_3V3_SENSORS_EN nVDD_5V_PERIPH_EN V3V:SPI1&SPI4 V3V:SPI1 No SPI4 - * PA5 SPI_INT_SCK - * PA6 SPI_INT_MISO - * PA7 SPI_INT_MOSI - * PB0 GYRO_DRDY SPI4:EXTERN_DRDY NC - * PB1 MAG_DRDY +SPI4:nEXTERN_CS NC - * PB4 ACCEL_DRDY NC NC - * PC1 Spare ADC ( NC ) +SPI1:SPI_INT_MAG_!CS - * PC2 nMPU_CS @MPU6000|MPU9250 @MPU9250 - * PC13 nGYRO_CS SPI4:nGYRO_EXT_CS NC - * PC14 GPIO_EXT_1 nBARO_EXT_CS -20608_DRDY - * PC15 nACCEL_MAG_CS SPI4:nACCEL_MAG_EXT_CS 20608_CS - * PD7 nBARO_CS - * PD15 nMPU_DRDY @MPU6000|MPU9250 @MPU9250 - * PE2 SPI_EXT_SCK NC - * PE4 nSPI_EXT_NSS SPI4:nMPU_EXT_CS NC - * PE5 SPI_EXT_MISO NC - * PE6 SPI_EXT_MOSI NC - * - * Notes: Prefixed with @ Does not effect board control - * Prefixed with + Input used as Output - * Prefixed with - Output used as Input - * Prefixed with SPIn: Bus changed - * - * The board API provides for mechanism to perform a SPI bus reset. - * To facilitate a SPI bus reset - * - * 1) All the pins: SPIn, CD, DRDY associated with the SPI bus are turned to inputs - * with outputs driven low. (OFFIng) - * 2) The power domain of that bus is turned off. - * 3) A usleep it done for ms. - * 4) The power domain of that bus is turned back on. - * 5) The SPIn pins are re-initialized. - * 6) The SPI CS, DRDY pins are re-initialized. - * - * To insure the complete net is de-energized and is not bing back fed, it is important to - * note the all signals in the net list of the parts/bus. - * - * I.E. Not OFFIng PC1 on V3 would leave that pin back feeding the HMC part. As would not - * OFFIng PE4, not associated with SPI1 on V2, but would back feed an MPUxxxx on V3 - * - */ - -/* - * - * --------------- SPI1 -------------------- SPI4 -------------- Incompatibilities --------- - * FMUv3 Cube: FmuV2 PixhawkMini - * Power Domain: VDD_3V3_SENSORS_EN NA V3V:SPI V5:SPI4 V3V:SPI1 No SPI4 - * PA5 SPI_INT_SCK - * PA6 SPI_INT_MISO - * PA7 SPI_INT_MOSI - * PB0 EXTERN_DRDY SPI1:GYRO_DRDY NC - * PB1 MAG_DRDY nEXTERN_CS -SPI1:MAG_DRDY NC - * PB4 NC SPI1:ACCEL_DRDY NC - * PC1 SPI_INT_MAG_!CS -ADC1_IN11 NC - * PC2 nMPU_CS @MPU6000 @MPU9250 - * PC13 nGYRO_EXT_CS SPI1:nGYRO_CS NC - * PC14 nBARO_EXT_CS GPIO_EXT_1 -20608_DRDY - * PC15 nACCEL_MAG_EXT_CS SPI1:nACCEL_MAG_CS 20608_CS - * PD7 nBARO_CS - * PD15 nMPU_DRDY @MPU6000 @MPU9250 - * PE2 SPI_EXT_SCK NC - * PE4 MPU_EXT_CS SPI4:nSPI_EXT_NSS NC - * PE5 SPI_EXT_MISO NC - * PE6 SPI_EXT_MOSI NC - * - * - * Notes: Prefixed with @ Does not effect board control - * Prefixed with + Input used as Output - * Prefixed with - Output used as Input - * Prefixed with SPIn: Bus changed - * - */ - -/*----------------------------------------------------------*/ -/* - * --------------- SPI1 -------------------- SPI4 -------------- Incompatibilities --------- - * FMUv2 Pixhawk Mini FmuV2 FmuV3 Cube - * Power Domain: VDD_3V3_SENSORS_EN NA V3V:SPI V5:SPI4 V3V:SPI1&SPI4 - * PA5 SPI_INT_SCK - * PA6 SPI_INT_MISO - * PA7 SPI_INT_MOSI - * PB0 NC SPI1:GYRO_DRDY SPI4:EXTERN_DRDY - * PB1 NC -SPI1:MAG_DRDY +SPI4:nEXTERN_CS - * PB4 NC SPI1:ACCEL_DRDY NC - * PC1 Spare ADC ( NC ) +SPI1:SPI_INT_MAG_!CS - * PC2 nMPU_CS @MPU6000 @MPU6000|MPU9250 - * PC13 NC SPI1:nGYRO_CS SPI4:nGYRO_EXT_CS - * PC14 20608_DRDY +GPIO_EXT_1 nBARO_EXT_CS - * PC15 20608_CS nACCEL_MAG_CS SPI4:nACCEL_MAG_EXT_CS - * PD7 nBARO_CS - * PD15 nMPU_DRDY @MPU6000 @MPU6000|MPU9250 - * PE2 NC SPI_EXT_SCK SPI_EXT_SCK - * PE4 NC SPI4:nSPI_EXT_NSS SPI4:nMPU_EXT_CS - * PE5 NC SPI_EXT_MISO SPI_EXT_MISO - * PE6 NC SPI_EXT_MOSI SPI_EXT_MOSI - * - * Notes: Prefixed with @ Does not effect board control - * Prefixed with + Input used as Output - * Prefixed with - Output used as Input - * Prefixed with SPIn: Bus changed - * - */ - -constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSIONS] = { - initSPIHWVersion(HW_VER_FMUV2, { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_MPU6000, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), - initSPIDevice(DRV_IMU_DEVTYPE_MPU9250, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), - initSPIDevice(DRV_GYR_DEVTYPE_L3GD20, SPI::CS{GPIO::PortC, GPIO::Pin13}, SPI::DRDY{GPIO::PortB, GPIO::Pin0}), - initSPIDevice(DRV_IMU_DEVTYPE_LSM303D, SPI::CS{GPIO::PortC, GPIO::Pin15}), - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortD, GPIO::Pin7}), - initSPIDevice(DRV_BARO_DEVTYPE_MS5607, SPI::CS{GPIO::PortD, GPIO::Pin7}), - }, {GPIO::PortE, GPIO::Pin3}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10}) - }), - initSPIBusExternal(SPI::Bus::SPI4, { - initSPIConfigExternal(SPI::CS{GPIO::PortE, GPIO::Pin4}), - initSPIConfigExternal(SPI::CS{GPIO::PortC, GPIO::Pin14}), - }), - }), - - initSPIHWVersion(HW_VER_FMUV3, { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_MPU6000, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), - initSPIDevice(DRV_IMU_DEVTYPE_MPU9250, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), - initSPIDevice(DRV_MAG_DEVTYPE_HMC5883, SPI::CS{GPIO::PortC, GPIO::Pin1}), // HMC5983 - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortD, GPIO::Pin7}), - initSPIDevice(DRV_BARO_DEVTYPE_MS5607, SPI::CS{GPIO::PortD, GPIO::Pin7}), - }, {GPIO::PortE, GPIO::Pin3}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10}) - }), - initSPIBus(SPI::Bus::SPI4, { - initSPIDevice(DRV_IMU_DEVTYPE_MPU6000, SPI::CS{GPIO::PortE, GPIO::Pin4}), - initSPIDevice(DRV_IMU_DEVTYPE_MPU9250, SPI::CS{GPIO::PortE, GPIO::Pin4}), - initSPIDevice(DRV_GYR_DEVTYPE_L3GD20, SPI::CS{GPIO::PortC, GPIO::Pin13}), - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortC, GPIO::Pin14}), - initSPIDevice(DRV_IMU_DEVTYPE_LSM303D, SPI::CS{GPIO::PortC, GPIO::Pin15}), - }), - }), - - initSPIHWVersion(HW_VER_FMUV2MINI, { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20608G, SPI::CS{GPIO::PortC, GPIO::Pin15}, SPI::DRDY{GPIO::PortC, GPIO::Pin14}), - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortD, GPIO::Pin7}), - initSPIDevice(DRV_DEVTYPE_UNUSED, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), // unused MPU9250 - }, {GPIO::PortE, GPIO::Pin3}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10}) - }), - initSPIBusExternal(SPI::Bus::SPI4, { // unused, but we must at least define it here - }), - }), - - // HW_VER_FMUV2X: treat as HW_VER_FMUV2 -}; -static constexpr bool unused = validateSPIConfig(px4_spi_buses_all_hw); diff --git a/boards/px4/fmu-v2/src/timer_config.cpp b/boards/px4/fmu-v2/src/timer_config.cpp deleted file mode 100644 index e8c680e..0000000 --- a/boards/px4/fmu-v2/src/timer_config.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1, DMA{DMA::Index2, DMA::Stream5, DMA::Channel6}), - initIOTimer(Timer::Timer4, DMA{DMA::Index1, DMA::Stream6, DMA::Channel2}), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortE, GPIO::Pin13}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/px4/fmu-v2/src/usb.c b/boards/px4/fmu-v2/src/usb.c deleted file mode 100644 index 023ec07..0000000 --- a/boards/px4/fmu-v2/src/usb.c +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file px4fmu_usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#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_STM32_OTGFS - stm32_configgpio(GPIO_OTGFS_VBUS); - /* XXX We only support device mode - stm32_configgpio(GPIO_OTGFS_PWRON); - stm32_configgpio(GPIO_OTGFS_OVER); - */ -#endif -} - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/px4/fmu-v3/default.px4board b/boards/px4/fmu-v3/default.px4board deleted file mode 100644 index 74c7b03..0000000 --- a/boards/px4/fmu-v3/default.px4board +++ /dev/null @@ -1,106 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS3" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS2" -CONFIG_BOARD_SERIAL_TEL4="/dev/ttyS6" -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_COMMON_BAROMETERS=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_HEATER=y -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20608G=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU6000=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU9250=y -CONFIG_DRIVERS_IMU_L3GD20=y -CONFIG_DRIVERS_IMU_LSM303D=y -CONFIG_COMMON_INS=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_PWM_INPUT=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_PX4IO=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UUV_ATT_CONTROL=y -CONFIG_MODULES_UUV_POS_CONTROL=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BL_UPDATE=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SERIAL_TEST=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_FAKE_GPS=y diff --git a/boards/px4/fmu-v3/extras/px4_fmu-v3_bootloader.bin b/boards/px4/fmu-v3/extras/px4_fmu-v3_bootloader.bin deleted file mode 100644 index 75e1e3a..0000000 Binary files a/boards/px4/fmu-v3/extras/px4_fmu-v3_bootloader.bin and /dev/null differ diff --git a/boards/px4/fmu-v3/extras/px4_io-v2_default.bin b/boards/px4/fmu-v3/extras/px4_io-v2_default.bin deleted file mode 100755 index 957f0f1..0000000 Binary files a/boards/px4/fmu-v3/extras/px4_io-v2_default.bin and /dev/null differ diff --git a/boards/px4/fmu-v3/firmware.prototype b/boards/px4/fmu-v3/firmware.prototype deleted file mode 100644 index 7f55dd2..0000000 --- a/boards/px4/fmu-v3/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 9, - "magic": "PX4FWv1", - "description": "Firmware for the PX4FMUv3 board", - "image": "", - "build_time": 0, - "summary": "PX4FMUv3", - "version": "0.1", - "image_size": 0, - "image_maxsize": 2080768, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/px4/fmu-v3/init/rc.board_defaults b/boards/px4/fmu-v3/init/rc.board_defaults deleted file mode 100644 index e9fecd7..0000000 --- a/boards/px4/fmu-v3/init/rc.board_defaults +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 10.177939394 -param set-default BAT1_A_PER_V 15.391030303 - -param set-default SYS_USE_IO 1 diff --git a/boards/px4/fmu-v3/init/rc.board_sensors b/boards/px4/fmu-v3/init/rc.board_sensors deleted file mode 100644 index f59e7b2..0000000 --- a/boards/px4/fmu-v3/init/rc.board_sensors +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/sh -# -# board specific sensors init -#------------------------------------------------------------------------------ - -rgbled start -I -rgbled_ncp5623c start -I - -board_adc start - -# Internal I2C bus -hmc5883 -T -I -R 4 start - -# Internal SPI (auto detect ms5611 or ms5607) -if ! ms5611 -T 5607 -q -s -b 1 start -then - ms5611 -s -b 1 start -fi - -set BOARD_FMUV3 0 - -# V3 build hwtypecmp supports V2|V2M|V30 -if ver hwtypecmp V30 -then - # Check for Pixhawk 2.0 cube (isolated IMU on SPI4) - # mpu6000 on v2.0, mpu9250 on v2.1 - if mpu6000 -s -b 4 -R 10 start - then - set BOARD_FMUV3 20 - else - # Check for Pixhawk 2.1 cube - # isolated/external mpu9250 (SPI4) - if mpu9250 -s -b 4 -R 10 start - then - set BOARD_FMUV3 21 - fi - fi -fi - -# Check if a Pixhack (which reports as V2M) is present -if ver hwtypecmp V2M -then - # Internal SPI bus ICM-20608-G - icm20608g -s -b 1 -R 14 start - - # Pixhawk Mini doesn't have these sensors, - # so if they are found we know its a Pixhack - - # mppu6000 internal (SPI1) - if mpu6000 -s -b 1 -R 10 start - then - set BOARD_FMUV3 20 - else - # Check for Pixhack 3.1 - # mpu9250 external (SPI4) - if mpu9250 -s -b 1 -R 10 start - then - set BOARD_FMUV3 21 - fi - fi -fi - -if [ $BOARD_FMUV3 != 0 ] -then - # sensor heating is available, but we disable it for now - param set-default SENS_EN_THERMAL 0 - - # ms5611 (external/isolated SPI4) - ms5611 -s -b 4 start - - if [ $BOARD_FMUV3 = 20 ] - then - # v2.0 internal mpu6000 - mpu6000 -s -b 1 start - - # v2.0 Has internal hmc5883 on SPI1 - hmc5883 -T -s -b 1 -R 8 start - fi - - if [ $BOARD_FMUV3 = 21 ] - then - # v2.1 mpu9250 on SPI1 - mpu9250 -s -b 1 start - fi - - # l3gd20 (external/isolated SPI4) - # low quality sensor disabled by default to save memory - #l3gd20 -s -b 4 -R 4 start - - # lsm303d (external/isolated SPI4) - lsm303d -s -b 4 -R 6 start - -else - # $BOARD_FMUV3 = 0 -> FMUv2 - - mpu6000 -s -b 1 -R 14 start - - # As we will use the external mag and the ICM-20608-G - # V2 build hwtypecmp is always false - # V3 build hwtypecmp supports V2|V2M|V30 - if ! ver hwtypecmp V2M - then - mpu9250 -s -b 1 -R 14 -q start - # else: On the PixhawkMini the mpu9250 has been disabled due to HW errata - fi - - l3gd20 -s -b 1 start - lsm303d -s -b 1 start -fi - -unset BOARD_FMUV3 diff --git a/boards/px4/fmu-v3/nuttx-config/Kconfig b/boards/px4/fmu-v3/nuttx-config/Kconfig deleted file mode 100644 index 6ce42ae..0000000 --- a/boards/px4/fmu-v3/nuttx-config/Kconfig +++ /dev/null @@ -1,22 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see misc/tools/kconfig-language.txt. -# - -if ARCH_BOARD_PX4_FMU_V2 - -config BOARD_HAS_PROBES - bool "Board provides GPIO or other Hardware for signaling to timing analyze." - default y - ---help--- - This board provides GPIO FMU-CH1-6 as PROBE_1-6 to provide timing signals from selected drivers. - -config BOARD_USE_PROBES - bool "Enable the use the board provided GPIO FMU-CH1-6 as PROBE_1-6 to provide timing signals from selected drivers" - default n - depends on BOARD_HAS_PROBES - - ---help--- - Select to use GPIO FMU-CH1-6 to provide timing signals from selected drivers. - -endif diff --git a/boards/px4/fmu-v3/nuttx-config/include/board.h b/boards/px4/fmu-v3/nuttx-config/include/board.h deleted file mode 100644 index 84e9220..0000000 --- a/boards/px4/fmu-v3/nuttx-config/include/board.h +++ /dev/null @@ -1,315 +0,0 @@ -/************************************************************************************ - * nuttx-configs/px4_fmu-v3/include/board.h - * include/arch/board/board.h - * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ************************************************************************************/ - -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ -#include "board_dma_map.h" - -#include -#ifndef __ASSEMBLY__ -# include -#endif - -#include - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The PX4FMUV2 uses a 24MHz crystal connected to the HSE. - * - * This is the "standard" configuration as set up by arch/arm/src/stm32f40xx_rcc.c: - * System Clock source : PLL (HSE) - * SYSCLK(Hz) : 168000000 Determined by PLL configuration - * HCLK(Hz) : 168000000 (STM32_RCC_CFGR_HPRE) - * AHB Prescaler : 1 (STM32_RCC_CFGR_HPRE) - * APB1 Prescaler : 4 (STM32_RCC_CFGR_PPRE1) - * APB2 Prescaler : 2 (STM32_RCC_CFGR_PPRE2) - * HSE Frequency(Hz) : 24000000 (STM32_BOARD_XTAL) - * PLLM : 24 (STM32_PLLCFG_PLLM) - * PLLN : 336 (STM32_PLLCFG_PLLN) - * PLLP : 2 (STM32_PLLCFG_PLLP) - * PLLQ : 7 (STM32_PLLCFG_PPQ) - * Main regulator output voltage : Scale1 mode Needed for high speed SYSCLK - * Flash Latency(WS) : 5 - * Prefetch Buffer : OFF - * Instruction cache : ON - * Data cache : ON - * Require 48MHz for USB OTG FS, : Enabled - * SDIO and RNG clock - */ - -/* HSI - 16 MHz RC factory-trimmed - * LSI - 32 KHz RC - * HSE - On-board crystal frequency is 24MHz - * LSE - not installed - */ - -#define STM32_BOARD_XTAL 24000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -//#define STM32_LSE_FREQUENCY 32768 - -/* Main PLL Configuration. - * - * PLL source is HSE - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * = (25,000,000 / 25) * 336 - * = 336,000,000 - * SYSCLK = PLL_VCO / PLLP - * = 336,000,000 / 2 = 168,000,000 - * USB OTG FS, SDIO and RNG Clock - * = PLL_VCO / PLLQ - * = 48,000,000 - */ - -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(24) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(336) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(7) - -#define STM32_SYSCLK_FREQUENCY 168000000ul - -/* AHB clock (HCLK) is SYSCLK (168MHz) */ - -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (42MHz) */ - -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (84MHz) */ - -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx - * otherwise frequency is 2xAPBx. - * Note: TIM1,8-11 are on APB2, others on APB1 - */ - -#define BOARD_TIM1_FREQUENCY STM32_APB2_TIM1_CLKIN -#define BOARD_TIM2_FREQUENCY STM32_APB1_TIM2_CLKIN -#define BOARD_TIM3_FREQUENCY STM32_APB1_TIM3_CLKIN -#define BOARD_TIM4_FREQUENCY STM32_APB1_TIM4_CLKIN -#define BOARD_TIM5_FREQUENCY STM32_APB1_TIM5_CLKIN -#define BOARD_TIM6_FREQUENCY STM32_APB1_TIM6_CLKIN -#define BOARD_TIM7_FREQUENCY STM32_APB1_TIM7_CLKIN -#define BOARD_TIM8_FREQUENCY STM32_APB2_TIM8_CLKIN -#define BOARD_TIM9_FREQUENCY STM32_APB2_TIM9_CLKIN -#define BOARD_TIM10_FREQUENCY STM32_APB2_TIM10_CLKIN -#define BOARD_TIM11_FREQUENCY STM32_APB2_TIM11_CLKIN -#define BOARD_TIM12_FREQUENCY STM32_APB1_TIM12_CLKIN -#define BOARD_TIM13_FREQUENCY STM32_APB1_TIM13_CLKIN -#define BOARD_TIM14_FREQUENCY STM32_APB1_TIM14_CLKIN - -/* SDIO dividers. Note that slower clocking is required when DMA is disabled - * in order to avoid RX overrun/TX underrun errors due to delayed responses - * to service FIFOs in interrupt driven mode. These values have not been - * tuned!!! - * - * SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(118+2)=400 KHz - */ - -#define SDIO_INIT_CLKDIV (118 << SDIO_CLKCR_CLKDIV_SHIFT) - -/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz - * DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32_SDIO_DMA -# define SDIO_MMCXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) -#else -# define SDIO_MMCXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) -#endif - -/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz - * DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32_SDIO_DMA -# define SDIO_SDXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) -#else -# define SDIO_SDXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) -#endif - -/* Alternate function pin selections ************************************************/ - -/* UARTs */ - -#define GPIO_USART1_RX GPIO_USART1_RX_1 /* Console in from IO */ -#define GPIO_USART1_TX 0 /* USART1 is RX-only */ - -#define GPIO_USART2_RX GPIO_USART2_RX_2 -#define GPIO_USART2_TX GPIO_USART2_TX_2 -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 -#define GPIO_USART2_CTS GPIO_USART2_CTS_2 - -#define GPIO_USART3_RX GPIO_USART3_RX_3 -#define GPIO_USART3_TX GPIO_USART3_TX_3 -#define GPIO_USART3_RTS GPIO_USART3_RTS_2 -#define GPIO_USART3_CTS GPIO_USART3_CTS_2 - -#define GPIO_UART4_RX GPIO_UART4_RX_1 -#define GPIO_UART4_TX GPIO_UART4_TX_1 - -#define GPIO_USART6_RX GPIO_USART6_RX_1 -#define GPIO_USART6_TX GPIO_USART6_TX_1 - -#define GPIO_UART7_RX GPIO_UART7_RX_1 -#define GPIO_UART7_TX GPIO_UART7_TX_1 - -/* UART8 has no alternate pin config */ - -/* CAN - * - * CAN1 is routed to the onboard transceiver. - * CAN2 is routed to the expansion connector. - */ - -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 -#define GPIO_CAN2_RX GPIO_CAN2_RX_1 -#define GPIO_CAN2_TX GPIO_CAN2_TX_2 - -/* I2C - * - * The optional _GPIO configurations allow the I2C driver to manually - * reset the bus to clear stuck slaves. They match the pin configuration, - * but are normally-high GPIOs. - */ - -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN8) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN9) - -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_1 -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_1 -#define GPIO_I2C2_SCL_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN10) -#define GPIO_I2C2_SDA_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN11) - -/* SPI - * - * There are sensors on SPI1, and SPI2 is connected to the FRAM. - */ - -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 - -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_2 - -#define GPIO_SPI4_MISO GPIO_SPI4_MISO_1 -#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_1 -#define GPIO_SPI4_SCK GPIO_SPI4_SCK_1 - -/* LED Definitions. Needed if CONFIG_ARCH_LEDs is defined */ - -#define LED_STARTED 0 -#define LED_HEAPALLOCATE 0 -#define LED_IRQSENABLED 0 -#define LED_STACKCREATED 1 -#define LED_INIRQ 1 -#define LED_SIGNAL 1 -#define LED_ASSERTION 1 -#define LED_PANIC 1 - -/* Board provides GPIO or other Hardware for signaling to timing analyzer */ - -#if defined(CONFIG_BOARD_USE_PROBES) -# define PROBE_N(n) (1<<((n)-1)) -# define PROBE_1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN14) -# define PROBE_2 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN13) -# define PROBE_3 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN11) -# define PROBE_4 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN9) -# define PROBE_5 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN13) -# define PROBE_6 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN14) - -# define PROBE_INIT(mask) \ - do { \ - if ((mask)& PROBE_N(1)) { stm32_configgpio(PROBE_1); } \ - if ((mask)& PROBE_N(2)) { stm32_configgpio(PROBE_2); } \ - if ((mask)& PROBE_N(3)) { stm32_configgpio(PROBE_3); } \ - if ((mask)& PROBE_N(4)) { stm32_configgpio(PROBE_4); } \ - if ((mask)& PROBE_N(5)) { stm32_configgpio(PROBE_5); } \ - if ((mask)& PROBE_N(6)) { stm32_configgpio(PROBE_6); } \ - } while(0) - -# define PROBE(n,s) do {stm32_gpiowrite(PROBE_##n,(s));}while(0) -# define PROBE_MARK(n) PROBE(n,false);PROBE(n,true) -#else -# define PROBE_INIT(mask) -# define PROBE(n,s) -# define PROBE_MARK(n) -#endif - - - - -#endif /* __ARCH_BOARD_BOARD_H */ diff --git a/boards/px4/fmu-v3/nuttx-config/include/board_dma_map.h b/boards/px4/fmu-v3/nuttx-config/include/board_dma_map.h deleted file mode 100644 index b947a9d..0000000 --- a/boards/px4/fmu-v3/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/* -| DMA1 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | SPI3_RX_1 | - | SPI3_RX_2 | SPI2_RX | SPI2_TX | SPI3_TX_1 | - | SPI3_TX_2 | -| Channel 1 | I2C1_RX | - | TIM7_UP_1 | - | TIM7_UP_2 | I2C1_RX_1 | I2C1_TX | I2C1_TX_1 | -| Channel 2 | TIM4_CH1 | - | I2C4_RX | TIM4_CH2 | - | I2C4_RX | TIM4_UP | TIM4_CH3 | -| Channel 3 | - | TIM2_UP_1 | I2C3_RX_1 | I2C2_EXT_RX | I2C3_TX | TIM2_CH1 | TIM2_CH2 | TIM2_UP_2 | -| | | TIM2_CH3 | | | | | TIM2_CH4_1 | TIM2_CH4_2 | -| Channel 4 | UART5_RX | USART3_RX | UART4_RX | USART3_TX_1 | UART4_TX | USART2_RX | USART2_TX | UART5_TX | -| Channel 5 | UART8_TX | UART7_TX | TIM3_CH4 | UART7_RX | TIM3_CH1 | TIM3_CH2 | UART8_RX | TIM3_CH3 | -| | | | TIM3_UP | | TIM3_TRIG | | | | -| Channel 6 | TIM5_CH3 | TIM5_CH4_1 | TIM5_CH1 | TIM5_CH4_2 | TIM5_CH2 | - | TIM5_UP_2 | - | -| | TIM5_UP_1 | TIM5_TRIG_1 | | TIM5_TRIG_2 | | | | | -| Channel 7 | - | TIM6_UP | I2C2_RX | I2C2_RX_1 | USART3_TX_2 | DAC1 | DAC2 | I2C2_TX | -| | | | | | | | | | -| Usage | | USART3_RX | UART4_RX | UART7_RX | USART3_TX_2 | USART2_RX | TIM4_UP | | - - -| DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | ADC1_1 | SAI1_A | TIM8_CH1_1 | SAI1_A_1 | ADC1_2 | SAI1_B_1 | TIM1_CH1_1 | - | -| | | | TIM8_CH2_1 | | | | TIM1_CH2_1 | | -| | | | TIM8_CH3_1 | | | | TIM1_CH3_1 | | -| Channel 1 | - | DCMI_1 | ADC2_1 | ADC2_2 | SAI1_B | SPI6_TX | SPI6_RX | DCMI_2 | -| Channel 2 | ADC3_1 | ADC3_2 | - | SPI5_RX_1 | SPI5_TX_1 | CRYP_OUT | CRYP_IN | HASH_IN | -| Channel 3 | SPI1_RX_1 | - | SPI1_RX_2 | SPI1_TX_1 | - | SPI1_TX_2 | - | QUADSPI | -| Channel 4 | SPI4_RX_1 | SPI4_TX_1 | USART1_RX_1 | SDIO | - | USART1_RX_2 | SDIO | USART1_TX | -| Channel 5 | - | USART6_RX_1 | USART6_RX_2 | SPI4_RX_2 | SPI4_TX_2 | - | USART6_TX_1 | USART6_TX_2 | -| Channel 6 | TIM1_TRIG_1 | TIM1_CH1_2 | TIM1_CH2_2 | TIM1_CH1 | TIM1_CH4 | TIM1_UP | TIM1_CH3_2 | - | -| | | | | | TIM1_TRIG_2 | | | | -| | | | | | TIM1_COM | | | | -| Channel 7 | - | TIM8_UP | TIM8_CH1_2 | TIM8_CH2_2 | TIM8_CH3_2 | SPI5_RX_2 | SPI5_TX_2 | TIM8_CH4 | -| | | | | | | | | TIM8_TRIG | -| | | | | | | | | TIM8_COM | -| | | | | | | | | | -| Usage | SPI4_RX_1 | USART6_RX_1 | SPI1_RX_2 | SPI1_TX_1 | SPI4_TX_2 | TIM1_UP | SDIO | USART6_TX_2 | - */ - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// DMAMAP_USART3_RX // DMA1, Stream 1, Channel 4 -// DMAMAP_UART4_RX // DMA1, Stream 2, Channel 4 -// DMAMAP_UART7_RX // DMA1, Stream 3, Channel 5 -#define DMAMAP_USART3_TX DMAMAP_USART3_TX_2 // DMA1, Stream 4, Channel 7 (TELEM2 TX) -// DMAMAP_USART2_RX // DMA1, Stream 5, Channel 4 -// DMAMAP_TIM4_UP // DMA1, Stream 6, Channel 2 (DSHOT) - - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMACHAN_SPI4_RX DMAMAP_SPI4_RX_1 // DMA2, Stream 0, Channel 4 (SPI4 sensors RX) -#define DMAMAP_USART6_RX DMAMAP_USART6_RX_1 // DMA2, Stream 1, Channel 4 (PX4IO RX) -#define DMACHAN_SPI1_RX DMAMAP_SPI1_RX_2 // DMA2, Stream 2, Channel 3 (SPI1 sensors RX) -#define DMACHAN_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 3, Channel 3 (SPI1 sensors TX) -#define DMACHAN_SPI4_TX DMAMAP_SPI4_TX_2 // DMA2, Stream 4, Channel 5 (SPI4 sensors TX) -// DMAMAP_TIM1_UP // DMA2, Stream 5, Channel 6 (DSHOT) -#define DMAMAP_SDIO DMAMAP_SDIO_2 // DMA2, Stream 6, Channel 4 -#define DMAMAP_USART6_TX DMAMAP_USART6_TX_2 // DMA2, Stream 7, Channel 5 (PX4IO TX) diff --git a/boards/px4/fmu-v3/nuttx-config/nsh/defconfig b/boards/px4/fmu-v3/nuttx-config/nsh/defconfig deleted file mode 100644 index c836579..0000000 --- a/boards/px4/fmu-v3/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,257 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_STM32_CCMEXCLUDE is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/px4/fmu-v3/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F427V=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0011 -CONFIG_CDCACM_PRODUCTSTR="PX4 FMU v2.x" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=2000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="3D Robotics" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXAMPLES_CALIB_UDELAY=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=2 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDIO_BLOCKSETUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32_ADC1=y -CONFIG_STM32_BBSRAM=y -CONFIG_STM32_BBSRAM_FILES=5 -CONFIG_STM32_BKPSRAM=y -CONFIG_STM32_CCMDATARAM=y -CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y -CONFIG_STM32_DMA1=y -CONFIG_STM32_DMA2=y -CONFIG_STM32_FLASH_CONFIG_I=y -CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_STM32_I2C1=y -CONFIG_STM32_I2C2=y -CONFIG_STM32_I2CTIMEOMS=10 -CONFIG_STM32_I2CTIMEOTICKS=10 -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_OTGFS=y -CONFIG_STM32_PWR=y -CONFIG_STM32_RTC=y -CONFIG_STM32_RTC_HSECLOCK=y -CONFIG_STM32_RTC_MAGIC=0xfacefeee -CONFIG_STM32_RTC_MAGIC_REG=1 -CONFIG_STM32_RTC_MAGIC_TIME_SET=0xfacefeef -CONFIG_STM32_SAVE_CRASHDUMP=y -CONFIG_STM32_SDIO=y -CONFIG_STM32_SDIO_CARD=y -CONFIG_STM32_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32_SPI1=y -CONFIG_STM32_SPI1_DMA=y -CONFIG_STM32_SPI1_DMA_BUFFER=512 -CONFIG_STM32_SPI2=y -CONFIG_STM32_SPI4=y -CONFIG_STM32_SPI4_DMA=y -CONFIG_STM32_SPI4_DMA_BUFFER=512 -CONFIG_STM32_SPI_DMATHRESHOLD=32 -CONFIG_STM32_TIM10=y -CONFIG_STM32_TIM11=y -CONFIG_STM32_TIM3=y -CONFIG_STM32_TIM9=y -CONFIG_STM32_UART4=y -CONFIG_STM32_UART7=y -CONFIG_STM32_UART8=y -CONFIG_STM32_USART1=y -CONFIG_STM32_USART2=y -CONFIG_STM32_USART3=y -CONFIG_STM32_USART6=y -CONFIG_STM32_USART_BREAKS=y -CONFIG_STM32_USART_SINGLEWIRE=y -CONFIG_STM32_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=300 -CONFIG_UART4_RXDMA=y -CONFIG_UART4_TXBUFSIZE=300 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=300 -CONFIG_UART7_RXDMA=y -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=300 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=300 -CONFIG_UART8_TXBUFSIZE=300 -CONFIG_USART1_RXBUFSIZE=128 -CONFIG_USART1_TXBUFSIZE=32 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=1100 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=300 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=600 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=300 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/px4/fmu-v3/nuttx-config/scripts/script.ld b/boards/px4/fmu-v3/nuttx-config/scripts/script.ld deleted file mode 100644 index 6d92733..0000000 --- a/boards/px4/fmu-v3/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************************** - * scripts/ld.script - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F427 has 2048Kb of FLASH beginning at address 0x0800:0000 and - * 256Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of SRAM beginning at address 0x2002:0000 - * 4) 64Kb of TCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 0x4000 of flash is reserved for the bootloader. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08004000, LENGTH = 2032K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 192K - ccsram (rwx) : ORIGIN = 0x10000000, LENGTH = 64K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/px4/fmu-v3/src/CMakeLists.txt b/boards/px4/fmu-v3/src/CMakeLists.txt deleted file mode 100644 index ae93a84..0000000 --- a/boards/px4/fmu-v3/src/CMakeLists.txt +++ /dev/null @@ -1,52 +0,0 @@ -############################################################################ -# -# Copyright (c) 2015 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. -# -############################################################################ - -add_library(drivers_board - can.c - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - usb.c - manifest.c -) - -target_link_libraries(drivers_board - PRIVATE - arch_spi - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer -) diff --git a/boards/px4/fmu-v3/src/board_config.h b/boards/px4/fmu-v3/src/board_config.h deleted file mode 100644 index 3c12d70..0000000 --- a/boards/px4/fmu-v3/src/board_config.h +++ /dev/null @@ -1,218 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013-2016 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * PX4FMUv2 internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -/* Run time Hardware detection */ -#define BOARD_HAS_SIMPLE_HW_VERSIONING 1 -#define HW_VER_PA8 (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTA|GPIO_PIN8) -#define HW_VER_PB4 (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN4) -#define HW_VER_PB12 (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN12) -#define HW_VER_PA8_INIT (GPIO_VDD_5V_PERIPH_EN) -#define HW_VER_PB4_INIT (GPIO_SPI1_EXTI_DRDY_PB4) -#define HW_VER_PB12_INIT (GPIO_CAN2_RX | GPIO_PULLUP) /* Assume V2 needing pull up */ -#define HW_VER_FMUV2_STATE 0x8 /* PB12:PU:1 PB12:PD:0 PB4:PU:0 PB4PD:0 */ -#define HW_VER_FMUV3_STATE 0xE /* PB12:PU:1 PB12:PD:1 PB4:PU:1 PB4PD:0 */ -#define HW_VER_FMUV2MINI_STATE 0xA /* PB12:PU:1 PB12:PD:0 PB4:PU:1 PB4PD:0 */ -#define HW_VER_FMUV2X_STATE 0xB /* PB12:PU:1 PB12:PD:0 PB4:PU:1 PB4PD:1 */ -#define HW_VER_TYPE_INIT {'V','2',0, 0} -#define BOARD_NUM_SPI_CFG_HW_VERSIONS 3 - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ -/* Configuration ************************************************************************************/ - -/* PX4IO connection configuration */ -#define BOARD_USES_PX4IO_VERSION 2 -#define PX4IO_SERIAL_DEVICE "/dev/ttyS4" -#define PX4IO_SERIAL_TX_GPIO GPIO_USART6_TX -#define PX4IO_SERIAL_RX_GPIO GPIO_USART6_RX -#define PX4IO_SERIAL_BASE STM32_USART6_BASE /* hardwired on the board */ -#define PX4IO_SERIAL_VECTOR STM32_IRQ_USART6 -#define PX4IO_SERIAL_TX_DMAMAP DMAMAP_USART6_TX -#define PX4IO_SERIAL_RX_DMAMAP DMAMAP_USART6_RX -#define PX4IO_SERIAL_RCC_REG STM32_RCC_APB2ENR -#define PX4IO_SERIAL_RCC_EN RCC_APB2ENR_USART6EN -#define PX4IO_SERIAL_CLOCK STM32_PCLK2_FREQUENCY -#define PX4IO_SERIAL_BITRATE 1500000 /* 1.5Mbps -> max rate for IO */ - - -/* PX4FMU GPIOs ***********************************************************************************/ -/* LEDs */ - -#define GPIO_LED1 (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN12) -#define BOARD_OVERLOAD_LED LED_AMBER - -#define GPIO_SPI1_EXTI_DRDY_PB4 (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTB|GPIO_PIN4) - -#define BOARD_SPI_BUS_MAX_BUS_ITEMS 3 - -/* I2C busses */ -#define BOARD_OVERRIDE_I2C_BUS_EXTERNAL - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that can be used by the Px4 Firmware in the adc driver - */ -#define ADC_CHANNELS (1 << 2) | (1 << 3) | (1 << 4) | (1 << 10) | (1 << 11) | (1 << 12) | (1 << 13) | (1 << 14) | (1 << 15) - -// ADC defines to be used in sensors.cpp to read from a particular channel -#define ADC_BATTERY_VOLTAGE_CHANNEL 2 -#define ADC_BATTERY_CURRENT_CHANNEL 3 -#define ADC_5V_RAIL_SENSE 4 -#define ADC_AIRSPEED_VOLTAGE_CHANNEL 15 - -/* Power supply control and monitoring GPIOs */ -#define GPIO_VDD_5V_PERIPH_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN8) -#define GPIO_VDD_BRICK_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5) -#define GPIO_VDD_SERVO_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN7) -#define GPIO_VDD_USB_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN0) -#define GPIO_VDD_5V_HIPOWER_OC (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN10) -#define GPIO_VDD_5V_PERIPH_OC (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN15) - -/* Tone alarm output */ -#define TONE_ALARM_TIMER 2 /* timer 2 */ -#define TONE_ALARM_CHANNEL 1 /* channel 1 */ -#define GPIO_TONE_ALARM_IDLE (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) -#define GPIO_TONE_ALARM (GPIO_ALT|GPIO_AF1|GPIO_SPEED_2MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN15) - -/* PWM - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 6 - -/* USB OTG FS - * - * PA9 OTG_FS_VBUS VBUS sensing (also connected to the green LED) - */ -#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 8 /* use timer8 for the HRT */ -#define HRT_TIMER_CHANNEL 1 /* use capture/compare channel */ - -/* PWM input driver. Use FMU AUX5 pins attached to timer4 channel 2 */ -#define PWMIN_TIMER 4 -#define PWMIN_TIMER_CHANNEL 2 -#define GPIO_PWM_IN GPIO_TIM4_CH2IN_2 - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_BRICK_VALID (!px4_arch_gpioread(GPIO_VDD_BRICK_VALID)) -#define BOARD_ADC_SERVO_VALID (!px4_arch_gpioread(GPIO_VDD_SERVO_VALID)) -#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_VDD_USB_VALID)) -#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_VDD_5V_PERIPH_OC)) -#define BOARD_ADC_HIPOWER_5V_OC (!px4_arch_gpioread(GPIO_VDD_5V_HIPOWER_OC)) - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -#define BOARD_HAS_ON_RESET 1 - - -/* Internal IMU Heater - * - * Connected to the IO MCU; tell compiler to enable support - */ -#define PX4IO_HEATER_ENABLED - -__BEGIN_DECLS - -/**************************************************************************************************** - * Public Types - ****************************************************************************************************/ - -/**************************************************************************************************** - * Public data - ****************************************************************************************************/ - -#ifndef __ASSEMBLY__ - -/**************************************************************************************************** - * Public Functions - ****************************************************************************************************/ - -/**************************************************************************************************** - * Name: stm32_spiinitialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the PX4FMU board. - * - ****************************************************************************************************/ - -extern void stm32_spiinitialize(void); - -/**************************************************************************************************** - * Name: board_spi_reset board_peripheral_reset - * - * Description: - * Called to reset SPI and the perferal bus - * - ****************************************************************************************************/ - -extern void board_peripheral_reset(int ms); - -/**************************************************************************************************** - * Name: stm32_usbinitialize - * - * Description: - * Called to configure USB IO. - * - ****************************************************************************************************/ - -extern void stm32_usbinitialize(void); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/px4/fmu-v3/src/can.c b/boards/px4/fmu-v3/src/can.c deleted file mode 100644 index 25943d5..0000000 --- a/boards/px4/fmu-v3/src/can.c +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file px4fmu_can.c - * - * Board-specific CAN functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include - -#include -#include - -#include "chip.h" -#include "arm_internal.h" - -#include "stm32.h" -#include "stm32_can.h" -#include "board_config.h" - -#ifdef CONFIG_CAN - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) -# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." -# undef CONFIG_STM32_CAN2 -#endif - -#ifdef CONFIG_STM32_CAN1 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); - -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} - -#endif diff --git a/boards/px4/fmu-v3/src/i2c.cpp b/boards/px4/fmu-v3/src/i2c.cpp deleted file mode 100644 index 75a4c3b..0000000 --- a/boards/px4/fmu-v3/src/i2c.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2017 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. - * - ****************************************************************************/ - -/** - * @file px4fmu_i2c.c - * - * Board-specific I2C functions. - */ - -#include "board_config.h" -#include -#include - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), - initI2CBusInternal(2), -}; - - -bool px4_i2c_bus_external(int bus) -{ - if (HW_VER_FMUV3 == board_get_hw_version()) { - /* All FMUV3 2.1 i2c buses are external */ - return true; - - } else { - if (bus != 2) { - return true; - } - } - - return false; -} diff --git a/boards/px4/fmu-v3/src/init.c b/boards/px4/fmu-v3/src/init.c deleted file mode 100644 index e1d010f..0000000 --- a/boards/px4/fmu-v3/src/init.c +++ /dev/null @@ -1,534 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-2015 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. - * - ****************************************************************************/ - -/** - * @file px4fmu2_init.c - * - * PX4FMUv2-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include "board_config.h" -#include - -#include - -#include -#include - -#include - -#include -#include -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/**************************************************************************** - * Private Data - ****************************************************************************/ -static int hw_version = 0; -static int hw_revision = 0; -static char hw_type[4] = HW_VER_TYPE_INIT; - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - /* set the peripheral rails off */ - stm32_configgpio(GPIO_VDD_5V_PERIPH_EN); - stm32_gpiowrite(GPIO_VDD_5V_PERIPH_EN, 1); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ - stm32_gpiowrite(GPIO_VDD_5V_PERIPH_EN, 0); -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ - -__EXPORT void board_on_reset(int status) -{ - UNUSED(status); - - /* configure the GPIO pins to outputs and keep them low */ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(io_timer_channel_get_gpio_output(i)); - } - - /* On resets invoked from system (not boot) insure we establish a low - * output state (discharge the pins) on PWM pins before they become inputs. - * - * We also delay the onset of the that 3.1 Ms pulse as boot. This has - * triggered some ESC to spin. By adding this delay here the reset - * is pushed out > 400 ms. So the ESC PWM input can not mistake - * the 3.1 Ms pulse as a valid PWM command. - * - * fixme:Establish in upstream NuttX an CONFIG_IO_INIT_STATE to - * the initialize the IO lines in the clock config. - * - */ - - if (status >= 0) { - up_mdelay(400); - - /* on reboot (status >= 0) reset sensors and peripherals */ - board_control_spi_sensors_power(false, 0xffff); - } -} - -/************************************************************************************ - * Name: determine_hw_info - * - * Description: - * - * This function looks at HW deltas to determine what the - * build is running on using the following criteria: - * - * MSN PB12 FMUv2 Cube MINI - * CAN2_RX CONECTOR MX30521 NC - * PU.PD 1,0 1,1 1,0 - * - * LSN PB4 FMUv2 Cube MINI - * ACCEL_DRDY LSM303D NC NC - * PU.PD 0,0 1,0 1,0 - - * PB12:PB4 - * ud ud - * 10 00 - 0x8 FMUv2 - * 11 10 - 0xE Cube AKA V2.0 - * 10 10 - 0xA PixhawkMini - * 10 11 - 0xB FMUv2 questionable hardware (should be treated like regular FMUv2) - * - * This will return OK on success. - * - * If PB12 is not returning a consistent result we assume that it's a Cube Black - * with something connected to CAN1 and talking to it. - * - * hw_type Initial state is {'V','2',0, 0} - * V 2 - FMUv2 - * V 3 0 - FMUv3 2.0 - * V 3 1 - FMUv3 2.1 - not differentiateable, - * V 2 M - FMUv2 Mini - * - ************************************************************************************/ - -static int determine_hw_info(int *revision, int *version) -{ - *revision = 0; /* default revision */ - int pos = 0; - stm32_configgpio(GPIO_PULLDOWN | (HW_VER_PB4 & ~GPIO_PUPD_MASK)); - up_udelay(10); - *version |= stm32_gpioread(HW_VER_PB4) << pos++; - stm32_configgpio(HW_VER_PB4); - up_udelay(10); - *version |= stm32_gpioread(HW_VER_PB4) << pos++; - - int votes = 100; - int ones[2] = {0, 0}; - int zeros[2] = {0, 0}; - - while (votes--) { - stm32_configgpio(GPIO_PULLDOWN | (HW_VER_PB12 & ~GPIO_PUPD_MASK)); - up_udelay(10); - stm32_gpioread(HW_VER_PB12) ? ones[0]++ : zeros[0]++; - stm32_configgpio(HW_VER_PB12); - up_udelay(10); - stm32_gpioread(HW_VER_PB12) ? ones[1]++ : zeros[1]++; - } - - const int margin = 50; - // On Cube the detection does not work as expected when something - // is connected to CAN1. In that case, there is no clear winner - // between ones and zeros. - - if (*version == 0x2 && abs(ones[0] - zeros[0]) < margin && abs(ones[1] - zeros[1]) < margin) { - *version = HW_VER_FMUV3_STATE; - syslog(LOG_DEBUG, "Ambiguous board detection, assuming Pixhawk Cube\n"); - - } else { - - if (ones[0] > zeros[0]) { - *version |= 1 << pos; - } - - pos++; - - if (ones[1] > zeros[1] + margin) { - *version |= 1 << pos; - } - } - - stm32_configgpio(HW_VER_PB4_INIT); - stm32_configgpio(HW_VER_PB12_INIT); - - return OK; -} - -/************************************************************************************ - * Name: board_get_hw_type_name - * - * Description: - * Optional returns a string defining the HW type - * - * - ************************************************************************************/ - -__EXPORT const char *board_get_hw_type_name() -{ - return (const char *) hw_type; -} - -/************************************************************************************ - * Name: board_get_hw_version - * - * Description: - * Optional returns a integer HW version - * - * - ************************************************************************************/ - -__EXPORT int board_get_hw_version() -{ - return HW_VER_SIMPLE(hw_version); -} - -/************************************************************************************ - * Name: board_get_hw_revision - * - * Description: - * Optional returns a integer HW revision - * - * - ************************************************************************************/ - -__EXPORT int board_get_hw_revision() -{ - return hw_revision; -} - -/************************************************************************************ - * Name: stm32_boardinitialize - * - * Description: - * All STM32 architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. - * - ************************************************************************************/ - -__EXPORT void -stm32_boardinitialize(void) -{ - board_on_reset(-1); - - /* configure LEDs */ - board_autoled_initialize(); - - /* configure ADC pins */ - - stm32_configgpio(GPIO_ADC1_IN2); /* BATT_VOLTAGE_SENS */ - stm32_configgpio(GPIO_ADC1_IN3); /* BATT_CURRENT_SENS */ - stm32_configgpio(GPIO_ADC1_IN4); /* VDD_5V_SENS */ - stm32_configgpio(GPIO_ADC1_IN13); /* FMU_AUX_ADC_1 */ - stm32_configgpio(GPIO_ADC1_IN14); /* FMU_AUX_ADC_2 */ - stm32_configgpio(GPIO_ADC1_IN15); /* PRESSURE_SENS */ - - /* configure power supply control/sense pins */ - stm32_configgpio(GPIO_VDD_5V_PERIPH_EN); - board_control_spi_sensors_power_configgpio(); - board_control_spi_sensors_power(true, 0xffff); - stm32_configgpio(GPIO_VDD_BRICK_VALID); - stm32_configgpio(GPIO_VDD_SERVO_VALID); - stm32_configgpio(GPIO_VDD_USB_VALID); - stm32_configgpio(GPIO_VDD_5V_HIPOWER_OC); - stm32_configgpio(GPIO_VDD_5V_PERIPH_OC); - - /* - * CAN GPIO config. - * Forced pull up on CAN2 is required for FMUv2 where the second interface lacks a transceiver. - * If no transceiver is connected, the RX pin will float, occasionally causing CAN controller to - * fail during initialization. - */ - stm32_configgpio(GPIO_CAN1_RX); - stm32_configgpio(GPIO_CAN1_TX); - stm32_configgpio(GPIO_CAN2_RX | GPIO_PULLUP); - stm32_configgpio(GPIO_CAN2_TX); - -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -static struct spi_dev_s *spi1; -static struct spi_dev_s *spi2; -static struct spi_dev_s *spi4; -static struct sdio_dev_s *sdio; - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Ensure the power is on 1 ms before we drive the GPIO pins */ - usleep(1000); - - if (OK == determine_hw_info(&hw_revision, &hw_version)) { - switch (hw_version) { - case HW_VER_FMUV2_STATE: - break; - - case HW_VER_FMUV3_STATE: - hw_type[1]++; - hw_type[2] = '0'; - - /* Has CAN2 transceiver Remove pull up */ - - stm32_configgpio(GPIO_CAN2_RX); - - break; - - case HW_VER_FMUV2MINI_STATE: - - /* Detection for a Pixhack3 */ - - stm32_configgpio(HW_VER_PA8); - up_udelay(10); - bool isph3 = stm32_gpioread(HW_VER_PA8); - stm32_configgpio(HW_VER_PA8_INIT); - - - if (isph3) { - - /* Pixhack3 looks like a FMuV3 Cube */ - - hw_version = HW_VER_FMUV3_STATE; - hw_type[1]++; - hw_type[2] = '0'; - syslog(LOG_INFO, "\nPixhack V3 detected, forcing to fmu-v3"); - - } else { - - /* It is a mini */ - - hw_type[2] = 'M'; - } - - break; - - default: - - /* questionable px4_fmu-v2 hardware, try forcing regular FMUv2 (not much else we can do) */ - - syslog(LOG_ERR, "\nbad version detected, forcing to fmu-v2"); - hw_version = HW_VER_FMUV2_STATE; - break; - } - - syslog(LOG_DEBUG, "\nFMUv2 ver 0x%1X : Rev %x %s\n", hw_version, hw_revision, hw_type); - } - - /* configure SPI interfaces (after the hw is determined) */ - stm32_spiinitialize(); - - px4_platform_init(); - - /* configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_AMBER); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_AMBER); - } - - /* Configure SPI-based devices */ - - spi1 = stm32_spibus_initialize(1); - - if (!spi1) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 1); - led_on(LED_AMBER); - } - - /* Default SPI1 to 1MHz and de-assert the known chip selects. */ - SPI_SETFREQUENCY(spi1, 10000000); - SPI_SETBITS(spi1, 8); - SPI_SETMODE(spi1, SPIDEV_MODE3); - up_udelay(20); - - /* Get the SPI port for the FRAM */ - - spi2 = stm32_spibus_initialize(2); - - if (!spi2) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 2); - led_on(LED_AMBER); - } - - /* Default SPI2 to 37.5 MHz (40 MHz rounded to nearest valid divider, F4 max) - * and de-assert the known chip selects. */ - - // XXX start with 10.4 MHz in FRAM usage and go up to 37.5 once validated - SPI_SETFREQUENCY(spi2, 12 * 1000 * 1000); - SPI_SETBITS(spi2, 8); - SPI_SETMODE(spi2, SPIDEV_MODE3); - - spi4 = stm32_spibus_initialize(4); - - if (!spi4) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 4); - led_on(LED_AMBER); - } - - /* Default SPI4 to 1MHz and de-assert the known chip selects. */ - SPI_SETFREQUENCY(spi4, 10000000); - SPI_SETBITS(spi4, 8); - SPI_SETMODE(spi4, SPIDEV_MODE3); - -#ifdef CONFIG_MMCSD - /* First, get an instance of the SDIO interface */ - - sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO); - - if (!sdio) { - led_on(LED_AMBER); - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", CONFIG_NSH_MMCSDSLOTNO); - } - - /* Now bind the SDIO interface to the MMC/SD driver */ - int ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio); - - if (ret != OK) { - led_on(LED_AMBER); - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); - } - - /* Then let's guess and say that there is a card in the slot. There is no card detect GPIO. */ - sdio_mediachange(sdio, true); - -#endif - - /* Configure the HW based on the manifest */ - px4_platform_configure(); - - return OK; -} diff --git a/boards/px4/fmu-v3/src/led.c b/boards/px4/fmu-v3/src/led.c deleted file mode 100644 index de15c05..0000000 --- a/boards/px4/fmu-v3/src/led.c +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013 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. - * - ****************************************************************************/ - -/** - * @file px4fmu2_led.c - * - * PX4FMU LED backend. - */ - -#include - -#include - -#include "stm32.h" -#include "board_config.h" - -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -__EXPORT void led_init() -{ - /* Configure LED1 GPIO for output */ - - stm32_configgpio(GPIO_LED1); -} - -__EXPORT void led_on(int led) -{ - if (led == 1) { - /* Pull down to switch on */ - stm32_gpiowrite(GPIO_LED1, false); - } -} - -__EXPORT void led_off(int led) -{ - if (led == 1) { - /* Pull up to switch off */ - stm32_gpiowrite(GPIO_LED1, true); - } -} - -__EXPORT void led_toggle(int led) -{ - if (led == 1) { - if (stm32_gpioread(GPIO_LED1)) { - stm32_gpiowrite(GPIO_LED1, false); - - } else { - stm32_gpiowrite(GPIO_LED1, true); - } - } -} diff --git a/boards/px4/fmu-v3/src/manifest.c b/boards/px4/fmu-v3/src/manifest.c deleted file mode 100644 index e1a9825..0000000 --- a/boards/px4/fmu-v3/src/manifest.c +++ /dev/null @@ -1,153 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2018-2021 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. - * - ****************************************************************************/ - -/** - * @file manifest.c - * - * This module supplies the interface to the manifest of hardware that is - * optional and dependent on the simple Hardware versioning - * BOARD_HAS_SIMPLE_HW_VERSIONING - * - * The manifest allows the system to know whether a hardware option - * say for example the PX4IO is an no-pop option vs it is broken. - * - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include - -#include "systemlib/px4_macros.h" - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -typedef struct { - uint32_t hw_ver_rev; /* the version and revision */ - const px4_hw_mft_item_t *mft; /* The first entry */ - uint32_t entries; /* the lenght of the list */ -} px4_hw_mft_list_entry_t; - -typedef px4_hw_mft_list_entry_t *px4_hw_mft_list_entry; -#define px4_hw_mft_list_uninitialized (px4_hw_mft_list_entry) -1 - -static const px4_hw_mft_item_t device_unsupported = {0, 0, 0}; - -static const px4_hw_mft_item_t hw_mft_list_FMUv2[] = { - { - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, -}; - -static const px4_hw_mft_item_t hw_mft_list_FMUv2Mini[] = { - { - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, -}; -static const px4_hw_mft_item_t hw_mft_list_FMUv2X[] = { - { - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, -}; -static const px4_hw_mft_item_t hw_mft_list_FMUv3[] = { - { - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, -}; - -static px4_hw_mft_list_entry_t mft_lists[] = { - {HW_VER_FMUV2, hw_mft_list_FMUv2, arraySize(hw_mft_list_FMUv2)}, - {HW_VER_FMUV2MINI, hw_mft_list_FMUv2Mini, arraySize(hw_mft_list_FMUv2Mini)}, - {HW_VER_FMUV2X, hw_mft_list_FMUv2X, arraySize(hw_mft_list_FMUv2X)}, - {HW_VER_FMUV3, hw_mft_list_FMUv3, arraySize(hw_mft_list_FMUv3)}, -}; - -/************************************************************************************ - * Name: board_query_manifest - * - * Description: - * Optional returns manifest item. - * - * Input Parameters: - * manifest_id - the ID for the manifest item to retrieve - * - * Returned Value: - * 0 - item is not in manifest => assume legacy operations - * pointer to a manifest item - * - ************************************************************************************/ - -__EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) -{ - static px4_hw_mft_list_entry boards_manifest = px4_hw_mft_list_uninitialized; - - if (boards_manifest == px4_hw_mft_list_uninitialized) { - uint32_t ver_rev = board_get_hw_version(); - - for (unsigned i = 0; i < arraySize(mft_lists); i++) { - if (mft_lists[i].hw_ver_rev == ver_rev) { - boards_manifest = &mft_lists[i]; - break; - } - } - - if (boards_manifest == px4_hw_mft_list_uninitialized) { - syslog(LOG_ERR, "[boot] Board %4" PRIx32 " is not supported!\n", ver_rev); - } - } - - px4_hw_mft_item rv = &device_unsupported; - - if (boards_manifest != px4_hw_mft_list_uninitialized && - id < boards_manifest->entries) { - rv = &boards_manifest->mft[id]; - } - - return rv; -} diff --git a/boards/px4/fmu-v3/src/spi.cpp b/boards/px4/fmu-v3/src/spi.cpp deleted file mode 100644 index e28958d..0000000 --- a/boards/px4/fmu-v3/src/spi.cpp +++ /dev/null @@ -1,202 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 -#include -#include - -/* Due to inconsistent use of chip select and data ready signal on - * different board that use this build, we are using different - * versions. - * - * --------------- SPI1 -------------------- SPI4 -------------- Incompatibilities --------- - * FMUv2: FmuV3 Cube PixhawkMini - * Power Domain: VDD_3V3_SENSORS_EN nVDD_5V_PERIPH_EN V3V:SPI1&SPI4 V3V:SPI1 No SPI4 - * PA5 SPI_INT_SCK - * PA6 SPI_INT_MISO - * PA7 SPI_INT_MOSI - * PB0 GYRO_DRDY SPI4:EXTERN_DRDY NC - * PB1 MAG_DRDY +SPI4:nEXTERN_CS NC - * PB4 ACCEL_DRDY NC NC - * PC1 Spare ADC ( NC ) +SPI1:SPI_INT_MAG_!CS - * PC2 nMPU_CS @MPU6000|MPU9250 @MPU9250 - * PC13 nGYRO_CS SPI4:nGYRO_EXT_CS NC - * PC14 GPIO_EXT_1 nBARO_EXT_CS -20608_DRDY - * PC15 nACCEL_MAG_CS SPI4:nACCEL_MAG_EXT_CS 20608_CS - * PD7 nBARO_CS - * PD15 nMPU_DRDY @MPU6000|MPU9250 @MPU9250 - * PE2 SPI_EXT_SCK NC - * PE4 nSPI_EXT_NSS SPI4:nMPU_EXT_CS NC - * PE5 SPI_EXT_MISO NC - * PE6 SPI_EXT_MOSI NC - * - * Notes: Prefixed with @ Does not effect board control - * Prefixed with + Input used as Output - * Prefixed with - Output used as Input - * Prefixed with SPIn: Bus changed - * - * The board API provides for mechanism to perform a SPI bus reset. - * To facilitate a SPI bus reset - * - * 1) All the pins: SPIn, CD, DRDY associated with the SPI bus are turned to inputs - * with outputs driven low. (OFFIng) - * 2) The power domain of that bus is turned off. - * 3) A usleep it done for ms. - * 4) The power domain of that bus is turned back on. - * 5) The SPIn pins are re-initialized. - * 6) The SPI CS, DRDY pins are re-initialized. - * - * To insure the complete net is de-energized and is not bing back fed, it is important to - * note the all signals in the net list of the parts/bus. - * - * I.E. Not OFFIng PC1 on V3 would leave that pin back feeding the HMC part. As would not - * OFFIng PE4, not associated with SPI1 on V2, but would back feed an MPUxxxx on V3 - * - */ - -/* - * - * --------------- SPI1 -------------------- SPI4 -------------- Incompatibilities --------- - * FMUv3 Cube: FmuV2 PixhawkMini - * Power Domain: VDD_3V3_SENSORS_EN NA V3V:SPI V5:SPI4 V3V:SPI1 No SPI4 - * PA5 SPI_INT_SCK - * PA6 SPI_INT_MISO - * PA7 SPI_INT_MOSI - * PB0 EXTERN_DRDY SPI1:GYRO_DRDY NC - * PB1 MAG_DRDY nEXTERN_CS -SPI1:MAG_DRDY NC - * PB4 NC SPI1:ACCEL_DRDY NC - * PC1 SPI_INT_MAG_!CS -ADC1_IN11 NC - * PC2 nMPU_CS @MPU6000 @MPU9250 - * PC13 nGYRO_EXT_CS SPI1:nGYRO_CS NC - * PC14 nBARO_EXT_CS GPIO_EXT_1 -20608_DRDY - * PC15 nACCEL_MAG_EXT_CS SPI1:nACCEL_MAG_CS 20608_CS - * PD7 nBARO_CS - * PD15 nMPU_DRDY @MPU6000 @MPU9250 - * PE2 SPI_EXT_SCK NC - * PE4 MPU_EXT_CS SPI4:nSPI_EXT_NSS NC - * PE5 SPI_EXT_MISO NC - * PE6 SPI_EXT_MOSI NC - * - * - * Notes: Prefixed with @ Does not effect board control - * Prefixed with + Input used as Output - * Prefixed with - Output used as Input - * Prefixed with SPIn: Bus changed - * - */ - -/*----------------------------------------------------------*/ -/* - * --------------- SPI1 -------------------- SPI4 -------------- Incompatibilities --------- - * FMUv2 Pixhawk Mini FmuV2 FmuV3 Cube - * Power Domain: VDD_3V3_SENSORS_EN NA V3V:SPI V5:SPI4 V3V:SPI1&SPI4 - * PA5 SPI_INT_SCK - * PA6 SPI_INT_MISO - * PA7 SPI_INT_MOSI - * PB0 NC SPI1:GYRO_DRDY SPI4:EXTERN_DRDY - * PB1 NC -SPI1:MAG_DRDY +SPI4:nEXTERN_CS - * PB4 NC SPI1:ACCEL_DRDY NC - * PC1 Spare ADC ( NC ) +SPI1:SPI_INT_MAG_!CS - * PC2 nMPU_CS @MPU6000 @MPU6000|MPU9250 - * PC13 NC SPI1:nGYRO_CS SPI4:nGYRO_EXT_CS - * PC14 20608_DRDY +GPIO_EXT_1 nBARO_EXT_CS - * PC15 20608_CS nACCEL_MAG_CS SPI4:nACCEL_MAG_EXT_CS - * PD7 nBARO_CS - * PD15 nMPU_DRDY @MPU6000 @MPU6000|MPU9250 - * PE2 NC SPI_EXT_SCK SPI_EXT_SCK - * PE4 NC SPI4:nSPI_EXT_NSS SPI4:nMPU_EXT_CS - * PE5 NC SPI_EXT_MISO SPI_EXT_MISO - * PE6 NC SPI_EXT_MOSI SPI_EXT_MOSI - * - * Notes: Prefixed with @ Does not effect board control - * Prefixed with + Input used as Output - * Prefixed with - Output used as Input - * Prefixed with SPIn: Bus changed - * - */ - -constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSIONS] = { - initSPIHWVersion(HW_VER_FMUV2, { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_MPU6000, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), - initSPIDevice(DRV_IMU_DEVTYPE_MPU9250, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), - initSPIDevice(DRV_GYR_DEVTYPE_L3GD20, SPI::CS{GPIO::PortC, GPIO::Pin13}, SPI::DRDY{GPIO::PortB, GPIO::Pin0}), - initSPIDevice(DRV_IMU_DEVTYPE_LSM303D, SPI::CS{GPIO::PortC, GPIO::Pin15}), - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortD, GPIO::Pin7}), - initSPIDevice(DRV_BARO_DEVTYPE_MS5607, SPI::CS{GPIO::PortD, GPIO::Pin7}), - }, {GPIO::PortE, GPIO::Pin3}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10}) - }), - initSPIBusExternal(SPI::Bus::SPI4, { - initSPIConfigExternal(SPI::CS{GPIO::PortE, GPIO::Pin4}), - initSPIConfigExternal(SPI::CS{GPIO::PortC, GPIO::Pin14}), - }), - }), - - initSPIHWVersion(HW_VER_FMUV3, { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_MPU6000, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), - initSPIDevice(DRV_IMU_DEVTYPE_MPU9250, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), - initSPIDevice(DRV_MAG_DEVTYPE_HMC5883, SPI::CS{GPIO::PortC, GPIO::Pin1}), // HMC5983 - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortD, GPIO::Pin7}), - initSPIDevice(DRV_BARO_DEVTYPE_MS5607, SPI::CS{GPIO::PortD, GPIO::Pin7}), - }, {GPIO::PortE, GPIO::Pin3}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10}) - }), - initSPIBus(SPI::Bus::SPI4, { - initSPIDevice(DRV_IMU_DEVTYPE_MPU6000, SPI::CS{GPIO::PortE, GPIO::Pin4}), - initSPIDevice(DRV_IMU_DEVTYPE_MPU9250, SPI::CS{GPIO::PortE, GPIO::Pin4}), - initSPIDevice(DRV_GYR_DEVTYPE_L3GD20, SPI::CS{GPIO::PortC, GPIO::Pin13}), - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortC, GPIO::Pin14}), - initSPIDevice(DRV_IMU_DEVTYPE_LSM303D, SPI::CS{GPIO::PortC, GPIO::Pin15}), - }), - }), - - initSPIHWVersion(HW_VER_FMUV2MINI, { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20608G, SPI::CS{GPIO::PortC, GPIO::Pin15}, SPI::DRDY{GPIO::PortC, GPIO::Pin14}), - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortD, GPIO::Pin7}), - initSPIDevice(DRV_DEVTYPE_UNUSED, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), // unused MPU9250 - }, {GPIO::PortE, GPIO::Pin3}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10}) - }), - initSPIBusExternal(SPI::Bus::SPI4, { // unused, but we must at least define it here - }), - }), - - // HW_VER_FMUV2X: treat as HW_VER_FMUV2 -}; -static constexpr bool unused = validateSPIConfig(px4_spi_buses_all_hw); diff --git a/boards/px4/fmu-v3/src/timer_config.cpp b/boards/px4/fmu-v3/src/timer_config.cpp deleted file mode 100644 index e8c680e..0000000 --- a/boards/px4/fmu-v3/src/timer_config.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1, DMA{DMA::Index2, DMA::Stream5, DMA::Channel6}), - initIOTimer(Timer::Timer4, DMA{DMA::Index1, DMA::Stream6, DMA::Channel2}), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortE, GPIO::Pin13}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/px4/fmu-v3/src/usb.c b/boards/px4/fmu-v3/src/usb.c deleted file mode 100644 index 023ec07..0000000 --- a/boards/px4/fmu-v3/src/usb.c +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file px4fmu_usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#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_STM32_OTGFS - stm32_configgpio(GPIO_OTGFS_VBUS); - /* XXX We only support device mode - stm32_configgpio(GPIO_OTGFS_PWRON); - stm32_configgpio(GPIO_OTGFS_OVER); - */ -#endif -} - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/px4/fmu-v4/default.px4board b/boards/px4/fmu-v4/default.px4board deleted file mode 100644 index f63e061..0000000 --- a/boards/px4/fmu-v4/default.px4board +++ /dev/null @@ -1,107 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS3" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS2" -CONFIG_BOARD_SERIAL_WIFI="/dev/ttyS0" -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_COMMON_BAROMETERS=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_HEATER=y -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20608G=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU9250=y -CONFIG_COMMON_INS=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_PWM_INPUT=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SAFETY_BUTTON=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_BOARD_UAVCAN_INTERFACES=1 -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UUV_ATT_CONTROL=y -CONFIG_MODULES_UUV_POS_CONTROL=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BL_UPDATE=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SERIAL_TEST=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_FAKE_GPS=y diff --git a/boards/px4/fmu-v4/extras/px4_fmu-v4_bootloader.bin b/boards/px4/fmu-v4/extras/px4_fmu-v4_bootloader.bin deleted file mode 100644 index 2092568..0000000 Binary files a/boards/px4/fmu-v4/extras/px4_fmu-v4_bootloader.bin and /dev/null differ diff --git a/boards/px4/fmu-v4/firmware.prototype b/boards/px4/fmu-v4/firmware.prototype deleted file mode 100644 index 949b4c5..0000000 --- a/boards/px4/fmu-v4/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 11, - "magic": "PX4FWv1", - "description": "Firmware for the PX4FMUv4 board", - "image": "", - "build_time": 0, - "summary": "PX4FMUv4", - "version": "0.1", - "image_size": 0, - "image_maxsize": 2080768, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/px4/fmu-v4/init/rc.board_defaults b/boards/px4/fmu-v4/init/rc.board_defaults deleted file mode 100644 index 275644b..0000000 --- a/boards/px4/fmu-v4/init/rc.board_defaults +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 13.653333333 -param set-default BAT1_A_PER_V 36.367515152 - -safety_button start diff --git a/boards/px4/fmu-v4/init/rc.board_extras b/boards/px4/fmu-v4/init/rc.board_extras deleted file mode 100644 index 6d6d166..0000000 --- a/boards/px4/fmu-v4/init/rc.board_extras +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# -# PX4 FMUv4 specific board extras init -#------------------------------------------------------------------------------ - -# Run FrSky Telemetry on Pixracer on the FrSky port if not enabled already -if param compare TEL_FRSKY_CONFIG 0 -then - frsky_telemetry start -d /dev/ttyS6 -t 15 -fi diff --git a/boards/px4/fmu-v4/init/rc.board_sensors b/boards/px4/fmu-v4/init/rc.board_sensors deleted file mode 100644 index 449d038..0000000 --- a/boards/px4/fmu-v4/init/rc.board_sensors +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# -# PX4 FMUv4 specific board sensors init -#------------------------------------------------------------------------------ - -board_adc start - -# Internal SPI -ms5611 -s start - -# hmc5883 internal SPI bus is rotated 90 deg yaw -if ! hmc5883 -T -s -R 2 -q start -then - # lis3mdl internal SPI bus is rotated 90 deg yaw - lis3mdl -s start -fi - -# Start either ICM2060X. They are both connected to the same SPI bus and use the same -# chip select pin. There are different boards with either one of them and the WHO_AM_I register -# will prevent the incorrect driver from a successful initialization. - -# ICM20602 internal SPI bus ICM-20608-G -if ! icm20602 -s -R 8 start -then - # ICM20608 internal SPI bus ICM-20602-G - icm20608g -s -R 8 start -fi - -# For Teal One airframe -if param compare SYS_AUTOSTART 4250 -then - mpu6500 -s -R 0 start -else - # mpu9250 internal SPI bus mpu9250 - mpu9250 -s -R 8 -M start -fi diff --git a/boards/px4/fmu-v4/nuttx-config/Kconfig b/boards/px4/fmu-v4/nuttx-config/Kconfig deleted file mode 100644 index affacc0..0000000 --- a/boards/px4/fmu-v4/nuttx-config/Kconfig +++ /dev/null @@ -1,17 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see misc/tools/kconfig-language.txt. -# -config BOARD_HAS_PROBES - bool "Board provides GPIO or other Hardware for signaling to timing analyze." - default y - ---help--- - This board provides GPIO FMU-CH1-6 to provide timing signals from selected drivers. - -config BOARD_USE_PROBES - bool "Enable the use the board provided FMU-CH1-6 as PROBE_1-6" - default n - depends on BOARD_HAS_PROBES - - ---help--- - Select to use GPIO FMU-CH1-6 to provide timing signals from selected drivers. diff --git a/boards/px4/fmu-v4/nuttx-config/drivers/Kconfig b/boards/px4/fmu-v4/nuttx-config/drivers/Kconfig deleted file mode 100644 index e69de29..0000000 diff --git a/boards/px4/fmu-v4/nuttx-config/include/board.h b/boards/px4/fmu-v4/nuttx-config/include/board.h deleted file mode 100644 index cbbe87a..0000000 --- a/boards/px4/fmu-v4/nuttx-config/include/board.h +++ /dev/null @@ -1,299 +0,0 @@ -/************************************************************************************ - * configs/px4fmu/include/board.h - * include/arch/board/board.h - * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ************************************************************************************/ - -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ -#include "board_dma_map.h" - -#include -#ifndef __ASSEMBLY__ -# include -#endif - -#include - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The PX4FMUV4 uses a 24MHz crystal connected to the HSE. - * - * This is the "standard" configuration as set up by arch/arm/src/stm32f40xx_rcc.c: - * System Clock source : PLL (HSE) - * SYSCLK(Hz) : 168000000 Determined by PLL configuration - * HCLK(Hz) : 168000000 (STM32_RCC_CFGR_HPRE) - * AHB Prescaler : 1 (STM32_RCC_CFGR_HPRE) - * APB1 Prescaler : 4 (STM32_RCC_CFGR_PPRE1) - * APB2 Prescaler : 2 (STM32_RCC_CFGR_PPRE2) - * HSE Frequency(Hz) : 24000000 (STM32_BOARD_XTAL) - * PLLM : 24 (STM32_PLLCFG_PLLM) - * PLLN : 336 (STM32_PLLCFG_PLLN) - * PLLP : 2 (STM32_PLLCFG_PLLP) - * PLLQ : 7 (STM32_PLLCFG_PPQ) - * Main regulator output voltage : Scale1 mode Needed for high speed SYSCLK - * Flash Latency(WS) : 5 - * Prefetch Buffer : OFF - * Instruction cache : ON - * Data cache : ON - * Require 48MHz for USB OTG FS, : Enabled - * SDIO and RNG clock - */ - -/* HSI - 16 MHz RC factory-trimmed - * LSI - 32 KHz RC - * HSE - On-board crystal frequency is 24MHz - * LSE - not installed - */ - -#define STM32_BOARD_XTAL 24000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -//#define STM32_LSE_FREQUENCY 32768 - -/* Main PLL Configuration. - * - * PLL source is HSE - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * = (25,000,000 / 25) * 336 - * = 336,000,000 - * SYSCLK = PLL_VCO / PLLP - * = 336,000,000 / 2 = 168,000,000 - * USB OTG FS, SDIO and RNG Clock - * = PLL_VCO / PLLQ - * = 48,000,000 - */ - -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(24) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(336) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(7) - -#define STM32_SYSCLK_FREQUENCY 168000000ul - -/* AHB clock (HCLK) is SYSCLK (168MHz) */ - -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (42MHz) */ - -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (84MHz) */ - -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx - * otherwise frequency is 2xAPBx. - * Note: TIM1,8-11 are on APB2, others on APB1 - */ - -#define BOARD_TIM1_FREQUENCY STM32_APB2_TIM1_CLKIN -#define BOARD_TIM2_FREQUENCY STM32_APB1_TIM2_CLKIN -#define BOARD_TIM3_FREQUENCY STM32_APB1_TIM3_CLKIN -#define BOARD_TIM4_FREQUENCY STM32_APB1_TIM4_CLKIN -#define BOARD_TIM5_FREQUENCY STM32_APB1_TIM5_CLKIN -#define BOARD_TIM6_FREQUENCY STM32_APB1_TIM6_CLKIN -#define BOARD_TIM7_FREQUENCY STM32_APB1_TIM7_CLKIN -#define BOARD_TIM8_FREQUENCY STM32_APB2_TIM8_CLKIN -#define BOARD_TIM9_FREQUENCY STM32_APB2_TIM9_CLKIN -#define BOARD_TIM10_FREQUENCY STM32_APB2_TIM10_CLKIN -#define BOARD_TIM11_FREQUENCY STM32_APB2_TIM11_CLKIN -#define BOARD_TIM12_FREQUENCY STM32_APB1_TIM12_CLKIN -#define BOARD_TIM13_FREQUENCY STM32_APB1_TIM13_CLKIN -#define BOARD_TIM14_FREQUENCY STM32_APB1_TIM14_CLKIN - -/* SDIO dividers. Note that slower clocking is required when DMA is disabled - * in order to avoid RX overrun/TX underrun errors due to delayed responses - * to service FIFOs in interrupt driven mode. These values have not been - * tuned!!! - * - * SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(118+2)=400 KHz - */ - -#define SDIO_INIT_CLKDIV (118 << SDIO_CLKCR_CLKDIV_SHIFT) - -/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz - * DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32_SDIO_DMA -# define SDIO_MMCXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) -#else -# define SDIO_MMCXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) -#endif - -/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz - * DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32_SDIO_DMA -# define SDIO_SDXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) -#else -# define SDIO_SDXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) -#endif - -/* Alternate function pin selections ************************************************/ - -/* - * UARTs. - */ -#define GPIO_USART1_RX GPIO_USART1_RX_2 /* ESP8266 */ -#define GPIO_USART1_TX GPIO_USART1_TX_2 - -#define GPIO_USART2_RX GPIO_USART2_RX_2 -#define GPIO_USART2_TX GPIO_USART2_TX_2 -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 -#define GPIO_USART2_CTS GPIO_USART2_CTS_2 - -#define GPIO_USART3_RX GPIO_USART3_RX_3 -#define GPIO_USART3_TX GPIO_USART3_TX_3 -#define GPIO_USART3_RTS GPIO_USART3_RTS_2 -#define GPIO_USART3_CTS GPIO_USART3_CTS_2 - -#define GPIO_UART4_RX GPIO_UART4_RX_1 -#define GPIO_UART4_TX GPIO_UART4_TX_1 - -#define GPIO_USART6_RX GPIO_USART6_RX_1 /* RC_INPUT */ -#define GPIO_USART6_TX GPIO_USART6_TX_1 - -#define GPIO_UART7_RX GPIO_UART7_RX_1 -#define GPIO_UART7_TX GPIO_UART7_TX_1 - -/* UART8 has no alternate pin config */ - - -/* - * CAN - * - * CAN1 is routed to the onboard transceiver. - */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 - -/* - * I2C - * - * The optional _GPIO configurations allow the I2C driver to manually - * reset the bus to clear stuck slaves. They match the pin configuration, - * but are normally-high GPIOs. - */ -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN8) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN9) - - -/* - * SPI - * - * There are sensors on SPI1, and SPI2 is connected to the FRAM. - */ -#define GPIO_SPI1_MISO (GPIO_SPI1_MISO_1|GPIO_SPEED_50MHz) -#define GPIO_SPI1_MOSI (GPIO_SPI1_MOSI_1|GPIO_SPEED_50MHz) -#define GPIO_SPI1_SCK (GPIO_SPI1_SCK_1|GPIO_SPEED_50MHz) - -#define GPIO_SPI2_MISO (GPIO_SPI2_MISO_1|GPIO_SPEED_50MHz) -#define GPIO_SPI2_MOSI (GPIO_SPI2_MOSI_1|GPIO_SPEED_50MHz) -#define GPIO_SPI2_SCK (GPIO_SPI2_SCK_1|GPIO_SPEED_50MHz) - -#if defined(CONFIG_STM32_SPI4) -# define GPIO_SPI4_MISO (GPIO_SPI4_MISO_1|GPIO_SPEED_50MHz) -# define GPIO_SPI4_MOSI (GPIO_SPI4_MOSI_1|GPIO_SPEED_50MHz) -# define GPIO_SPI4_SCK (GPIO_SPI4_SCK_1|GPIO_SPEED_50MHz) -#endif - -/* Board provides GPIO or other Hardware for signaling to timing analyzer */ - -#if defined(CONFIG_BOARD_USE_PROBES) -# define PROBE_N(n) (1<<((n)-1)) -# define PROBE_1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN14) -# define PROBE_2 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN13) -# define PROBE_3 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN11) -# define PROBE_4 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN9) -# define PROBE_5 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN13) -# define PROBE_6 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN14) - -# define PROBE_INIT(mask) \ - do { \ - if ((mask)& PROBE_N(1)) { stm32_configgpio(PROBE_1); } \ - if ((mask)& PROBE_N(2)) { stm32_configgpio(PROBE_2); } \ - if ((mask)& PROBE_N(3)) { stm32_configgpio(PROBE_3); } \ - if ((mask)& PROBE_N(4)) { stm32_configgpio(PROBE_4); } \ - if ((mask)& PROBE_N(5)) { stm32_configgpio(PROBE_5); } \ - if ((mask)& PROBE_N(6)) { stm32_configgpio(PROBE_6); } \ - } while(0) - -# define PROBE(n,s) do {stm32_gpiowrite(PROBE_##n,(s));}while(0) -# define PROBE_MARK(n) PROBE(n,false);PROBE(n,true) -#else -# define PROBE_INIT(mask) -# define PROBE(n,s) -# define PROBE_MARK(n) -#endif - - -#endif /* __ARCH_BOARD_BOARD_H */ diff --git a/boards/px4/fmu-v4/nuttx-config/include/board_dma_map.h b/boards/px4/fmu-v4/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 19437b7..0000000 --- a/boards/px4/fmu-v4/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/* -| DMA1 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | SPI3_RX_1 | - | SPI3_RX_2 | SPI2_RX | SPI2_TX | SPI3_TX_1 | - | SPI3_TX_2 | -| Channel 1 | I2C1_RX | - | TIM7_UP_1 | - | TIM7_UP_2 | I2C1_RX_1 | I2C1_TX | I2C1_TX_1 | -| Channel 2 | TIM4_CH1 | - | I2C4_RX | TIM4_CH2 | - | I2C4_RX | TIM4_UP | TIM4_CH3 | -| Channel 3 | - | TIM2_UP_1 | I2C3_RX_1 | I2C2_EXT_RX | I2C3_TX | TIM2_CH1 | TIM2_CH2 | TIM2_UP_2 | -| | | TIM2_CH3 | | | | | TIM2_CH4_1 | TIM2_CH4_2 | -| Channel 4 | UART5_RX | USART3_RX | UART4_RX | USART3_TX_1 | UART4_TX | USART2_RX | USART2_TX | UART5_TX | -| Channel 5 | UART8_TX | UART7_TX | TIM3_CH4 | UART7_RX | TIM3_CH1 | TIM3_CH2 | UART8_RX | TIM3_CH3 | -| | | | TIM3_UP | | TIM3_TRIG | | | | -| Channel 6 | TIM5_CH3 | TIM5_CH4_1 | TIM5_CH1 | TIM5_CH4_2 | TIM5_CH2 | - | TIM5_UP_2 | - | -| | TIM5_UP_1 | TIM5_TRIG_1 | | TIM5_TRIG_2 | | | | | -| Channel 7 | - | TIM6_UP | I2C2_RX | I2C2_RX_1 | USART3_TX_2 | DAC1 | DAC2 | I2C2_TX | -| | | | | | | | | | -| Usage | | USART3_RX | UART4_RX | UART7_RX | USART3_TX_2 | USART2_RX | TIM4_UP | | - - -| DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | ADC1_1 | SAI1_A | TIM8_CH1_1 | SAI1_A_1 | ADC1_2 | SAI1_B_1 | TIM1_CH1_1 | - | -| | | | TIM8_CH2_1 | | | | TIM1_CH2_1 | | -| | | | TIM8_CH3_1 | | | | TIM1_CH3_1 | | -| Channel 1 | - | DCMI_1 | ADC2_1 | ADC2_2 | SAI1_B | SPI6_TX | SPI6_RX | DCMI_2 | -| Channel 2 | ADC3_1 | ADC3_2 | - | SPI5_RX_1 | SPI5_TX_1 | CRYP_OUT | CRYP_IN | HASH_IN | -| Channel 3 | SPI1_RX_1 | - | SPI1_RX_2 | SPI1_TX_1 | - | SPI1_TX_2 | - | QUADSPI | -| Channel 4 | SPI4_RX_1 | SPI4_TX_1 | USART1_RX_1 | SDIO | - | USART1_RX_2 | SDIO | USART1_TX | -| Channel 5 | - | USART6_RX_1 | USART6_RX_2 | SPI4_RX_2 | SPI4_TX_2 | - | USART6_TX_1 | USART6_TX_2 | -| Channel 6 | TIM1_TRIG_1 | TIM1_CH1_2 | TIM1_CH2_2 | TIM1_CH1 | TIM1_CH4 | TIM1_UP | TIM1_CH3_2 | - | -| | | | | | TIM1_TRIG_2 | | | | -| | | | | | TIM1_COM | | | | -| Channel 7 | - | TIM8_UP | TIM8_CH1_2 | TIM8_CH2_2 | TIM8_CH3_2 | SPI5_RX_2 | SPI5_TX_2 | TIM8_CH4 | -| | | | | | | | | TIM8_TRIG | -| | | | | | | | | TIM8_COM | -| | | | | | | | | | -| Usage | SPI1_RX_1 | USART6_RX_1 | USART1_RX_1 | SPI1_TX_1 | | TIM1_UP | SDIO | | - */ - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// DMAMAP_USART3_RX // DMA1, Stream 1, Channel 4 -// DMAMAP_UART4_RX // DMA1, Stream 2, Channel 4 -// DMAMAP_UART7_RX // DMA1, Stream 3, Channel 5 -#define DMAMAP_USART3_TX DMAMAP_USART3_TX_2 // DMA1, Stream 4, Channel 7 (TELEM2 TX) -// DMAMAP_USART2_RX // DMA1, Stream 5, Channel 4 -// DMAMAP_TIM4_UP // DMA1, Stream 6, Channel 2 (DSHOT) - - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMACHAN_SPI1_RX DMAMAP_SPI1_RX_1 // DMA2, Stream 0, Channel 3 (SPI sensors RX) -#define DMAMAP_USART6_RX DMAMAP_USART6_RX_1 // DMA2, Stream 1, Channel 4 -#define DMAMAP_USART1_RX DMAMAP_USART1_RX_1 // DMA2, Stream 2, Channel 4 -#define DMACHAN_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 3, Channel 3 (SPI sensors TX) -// AVAILABLE // DMA2, Stream 4 -// DMAMAP_TIM1_UP // DMA2, Stream 5, Channel 6 (DSHOT) -#define DMAMAP_SDIO DMAMAP_SDIO_2 // DMA2, Stream 6, Channel 4 diff --git a/boards/px4/fmu-v4/nuttx-config/nsh/defconfig b/boards/px4/fmu-v4/nuttx-config/nsh/defconfig deleted file mode 100644 index a8ac1b9..0000000 --- a/boards/px4/fmu-v4/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,254 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_STM32_CCMEXCLUDE is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/px4/fmu-v4/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F427V=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0012 -CONFIG_CDCACM_PRODUCTSTR="PX4 FMU v4.x" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=2000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="3D Robotics" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXAMPLES_CALIB_UDELAY=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=2 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDIO_BLOCKSETUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32_ADC1=y -CONFIG_STM32_BBSRAM=y -CONFIG_STM32_BBSRAM_FILES=5 -CONFIG_STM32_BKPSRAM=y -CONFIG_STM32_CCMDATARAM=y -CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y -CONFIG_STM32_DMA1=y -CONFIG_STM32_DMA2=y -CONFIG_STM32_FLASH_CONFIG_I=y -CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_STM32_I2C1=y -CONFIG_STM32_I2CTIMEOMS=10 -CONFIG_STM32_I2CTIMEOTICKS=10 -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_OTGFS=y -CONFIG_STM32_PWR=y -CONFIG_STM32_RTC=y -CONFIG_STM32_RTC_HSECLOCK=y -CONFIG_STM32_RTC_MAGIC=0xfacefeee -CONFIG_STM32_RTC_MAGIC_REG=1 -CONFIG_STM32_RTC_MAGIC_TIME_SET=0xfacefeef -CONFIG_STM32_SAVE_CRASHDUMP=y -CONFIG_STM32_SDIO=y -CONFIG_STM32_SDIO_CARD=y -CONFIG_STM32_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32_SPI1=y -CONFIG_STM32_SPI1_DMA=y -CONFIG_STM32_SPI1_DMA_BUFFER=512 -CONFIG_STM32_SPI2=y -CONFIG_STM32_SPI4=y -CONFIG_STM32_SPI_DMATHRESHOLD=8 -CONFIG_STM32_TIM10=y -CONFIG_STM32_TIM11=y -CONFIG_STM32_TIM8=y -CONFIG_STM32_TIM9=y -CONFIG_STM32_UART4=y -CONFIG_STM32_UART7=y -CONFIG_STM32_UART8=y -CONFIG_STM32_USART1=y -CONFIG_STM32_USART2=y -CONFIG_STM32_USART3=y -CONFIG_STM32_USART6=y -CONFIG_STM32_USART_BREAKS=y -CONFIG_STM32_USART_SINGLEWIRE=y -CONFIG_STM32_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=300 -CONFIG_UART4_RXDMA=y -CONFIG_UART4_TXBUFSIZE=300 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=300 -CONFIG_UART7_RXDMA=y -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=300 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=300 -CONFIG_UART8_TXBUFSIZE=300 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_RXDMA=y -CONFIG_USART1_TXBUFSIZE=2500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=1100 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=1200 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=900 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=300 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/px4/fmu-v4/nuttx-config/scripts/script.ld b/boards/px4/fmu-v4/nuttx-config/scripts/script.ld deleted file mode 100644 index ff95ca6..0000000 --- a/boards/px4/fmu-v4/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,147 +0,0 @@ -/**************************************************************************** - * scripts/ld.script - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F427 has 2048Kb of FLASH beginning at address 0x0800:0000 and - * 256Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of SRAM beginning at address 0x2002:0000 - * 4) 64Kb of TCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 0x4000 of flash is reserved for the bootloader. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08004000, LENGTH = 2032K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 192K - ccsram (rwx) : ORIGIN = 0x10000000, LENGTH = 64K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - KEEP(*(.app_descriptor)) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/px4/fmu-v4/nuttx-config/test/defconfig b/boards/px4/fmu-v4/nuttx-config/test/defconfig deleted file mode 100644 index aa3d589..0000000 --- a/boards/px4/fmu-v4/nuttx-config/test/defconfig +++ /dev/null @@ -1,258 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CMP is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_STM32_CCMEXCLUDE is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/px4/fmu-v4/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F427V=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0012 -CONFIG_CDCACM_PRODUCTSTR="PX4 FMU v4.x" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=2000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="3D Robotics" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXAMPLES_CALIB_UDELAY=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=2 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDIO_BLOCKSETUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32_ADC1=y -CONFIG_STM32_BBSRAM=y -CONFIG_STM32_BBSRAM_FILES=5 -CONFIG_STM32_BKPSRAM=y -CONFIG_STM32_CCMDATARAM=y -CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y -CONFIG_STM32_DMA1=y -CONFIG_STM32_DMA2=y -CONFIG_STM32_FLASH_CONFIG_I=y -CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_STM32_I2C1=y -CONFIG_STM32_I2CTIMEOMS=10 -CONFIG_STM32_I2CTIMEOTICKS=10 -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_OTGFS=y -CONFIG_STM32_PWR=y -CONFIG_STM32_RTC=y -CONFIG_STM32_RTC_HSECLOCK=y -CONFIG_STM32_RTC_MAGIC=0xfacefeee -CONFIG_STM32_RTC_MAGIC_REG=1 -CONFIG_STM32_RTC_MAGIC_TIME_SET=0xfacefeef -CONFIG_STM32_SAVE_CRASHDUMP=y -CONFIG_STM32_SDIO=y -CONFIG_STM32_SDIO_CARD=y -CONFIG_STM32_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32_SPI1=y -CONFIG_STM32_SPI1_DMA=y -CONFIG_STM32_SPI1_DMA_BUFFER=512 -CONFIG_STM32_SPI2=y -CONFIG_STM32_SPI4=y -CONFIG_STM32_SPI_DMATHRESHOLD=8 -CONFIG_STM32_TIM10=y -CONFIG_STM32_TIM11=y -CONFIG_STM32_TIM8=y -CONFIG_STM32_TIM9=y -CONFIG_STM32_UART4=y -CONFIG_STM32_UART7=y -CONFIG_STM32_UART8=y -CONFIG_STM32_USART1=y -CONFIG_STM32_USART2=y -CONFIG_STM32_USART3=y -CONFIG_STM32_USART6=y -CONFIG_STM32_USART_BREAKS=y -CONFIG_STM32_USART_SINGLEWIRE=y -CONFIG_STM32_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TESTING_OSTEST=y -CONFIG_TESTING_OSTEST_FPUTESTDISABLE=y -CONFIG_TESTING_OSTEST_STACKSIZE=10240 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=300 -CONFIG_UART4_RXDMA=y -CONFIG_UART4_TXBUFSIZE=300 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=300 -CONFIG_UART7_RXDMA=y -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=300 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=300 -CONFIG_UART8_TXBUFSIZE=300 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_RXDMA=y -CONFIG_USART1_TXBUFSIZE=2500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=1100 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=1200 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=900 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=300 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/px4/fmu-v4/src/CMakeLists.txt b/boards/px4/fmu-v4/src/CMakeLists.txt deleted file mode 100644 index e28e360..0000000 --- a/boards/px4/fmu-v4/src/CMakeLists.txt +++ /dev/null @@ -1,51 +0,0 @@ -############################################################################ -# -# Copyright (c) 2015 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. -# -############################################################################ - -add_library(drivers_board - can.c - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - usb.c -) - -target_link_libraries(drivers_board - PRIVATE - arch_spi - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer -) diff --git a/boards/px4/fmu-v4/src/board_config.h b/boards/px4/fmu-v4/src/board_config.h deleted file mode 100644 index ef6571d..0000000 --- a/boards/px4/fmu-v4/src/board_config.h +++ /dev/null @@ -1,217 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013-2016 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * PX4FMUv4 internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ -/* Configuration ************************************************************************************/ - -/* PX4FMU GPIOs ***********************************************************************************/ -/* LEDs */ -#define GPIO_LED1 (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN11) -#define GPIO_LED2 (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN1) -#define GPIO_LED3 (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN3) - -#define GPIO_LED_RED GPIO_LED1 -#define GPIO_LED_GREEN GPIO_LED2 -#define GPIO_LED_BLUE GPIO_LED3 - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_OVERLOAD_LED LED_RED -#define BOARD_ARMED_LED LED_BLUE -#define BOARD_ARMED_STATE_LED LED_GREEN - -#ifdef CONFIG_STM32_SPI4 -# define BOARD_HAS_BUS_MANIFEST 1 // We support a bus manifest because spi 4 is optional -#endif /* CONFIG_STM32_SPI4 */ - -/** - * ADC channels: - * These are the channel numbers of the ADCs of the microcontroller that can be used by the Px4 Firmware in the adc driver. - */ -#define ADC_CHANNELS (1 << 2) | (1 << 3) | (1 << 4) | (1 << 10) | (1 << 11) | (1 << 12) | (1 << 13) | (1 << 14) - -/* ADC defines to be used in sensors.cpp to read from a particular channel. */ -#define ADC_BATTERY_VOLTAGE_CHANNEL 2 -#define ADC_BATTERY_CURRENT_CHANNEL 3 -#define ADC_5V_RAIL_SENSE 4 -#define ADC_RC_RSSI_CHANNEL 11 - -/* Power supply control and monitoring GPIOs. */ -#define GPIO_VDD_BRICK_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5) -#define GPIO_VDD_USB_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN0) - -/* Tone alarm output. */ -#define TONE_ALARM_TIMER 2 /* timer 2 */ -#define TONE_ALARM_CHANNEL 1 /* channel 1 */ -#define GPIO_TONE_ALARM_IDLE (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) -#define GPIO_TONE_ALARM (GPIO_ALT|GPIO_AF1|GPIO_SPEED_2MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN15) - -/** - * PWM: - * - * Six PWM outputs are configured. - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 6 - -/** - * USB OTG FS: - * PA9 OTG_FS_VBUS VBUS sensing. - */ -#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 3 /* use timer 3 for the HRT */ -#define HRT_TIMER_CHANNEL 4 /* use capture/compare channel 4 */ - -#define HRT_PPM_CHANNEL 3 /* use capture/compare channel 3 */ -#define GPIO_PPM_IN (GPIO_ALT|GPIO_AF2|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN0) - -/* RC Serial port */ - -#define RC_SERIAL_PORT "/dev/ttyS4" - -/* PWM input driver. Use FMU AUX5 pins attached to timer4 channel 2. */ -#define PWMIN_TIMER 4 -#define PWMIN_TIMER_CHANNEL 2 -#define GPIO_PWM_IN GPIO_TIM4_CH2IN_2 - -#define GPIO_RSSI_IN (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN1) -#define GPIO_LED_SAFETY (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN3) -#define GPIO_BTN_SAFETY (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN4) -#define GPIO_PERIPH_3V3_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN5) - -/* For R12, this signal is active high. */ -#define GPIO_SBUS_INV (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN13) -#define RC_INVERT_INPUT(_invert_true) px4_arch_gpiowrite(GPIO_SBUS_INV, _invert_true) - -#define GPIO_SPEKTRUM_PWR_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN4) - -#define GPIO_8266_GPIO0 (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN2) -#define GPIO_8266_GPIO2 (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN4) -#define GPIO_8266_PD (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN5) -#define GPIO_8266_RST (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN6) - -/* Heater pins */ -#define GPIO_HEATER_INPUT (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTC|GPIO_PIN6) -#define GPIO_HEATER_OUTPUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN6) -#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true)) - -/* Power switch controls */ - -#define SPEKTRUM_POWER(_on_true) px4_arch_gpiowrite(GPIO_SPEKTRUM_PWR_EN, (!_on_true)) - -/** - * FMUv4 has separate RC_IN - * - * GPIO PPM_IN on PB0 T3C3 - * SPEKTRUM_RX (it's TX or RX in Bind) on UART6 PC7 - * Inversion is possible via the 74LVC2G86 controlled by the FMU - * The FMU can drive GPIO PPM_IN as an output - */ - -#define GPIO_PPM_IN_AS_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN0) -#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_PPM_IN_AS_OUT) -#define SPEKTRUM_RX_AS_UART() /* Can be left as uart */ -#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true)) - -/** - * By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_BRICK_VALID (px4_arch_gpioread(GPIO_VDD_BRICK_VALID)) -#define BOARD_ADC_USB_VALID (px4_arch_gpioread(GPIO_VDD_USB_VALID)) -#define BOARD_ADC_SERVO_VALID (1) -#define BOARD_ADC_PERIPH_5V_OC (0) -#define BOARD_ADC_HIPOWER_5V_OC (0) - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -#define BOARD_HAS_ON_RESET 1 - - -__BEGIN_DECLS - -/**************************************************************************************************** - * Public Types - ****************************************************************************************************/ - -/**************************************************************************************************** - * Public data - ****************************************************************************************************/ - -#ifndef __ASSEMBLY__ - -/**************************************************************************************************** - * Public Functions - ****************************************************************************************************/ - -/**************************************************************************************************** - * 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 - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/px4/fmu-v4/src/can.c b/boards/px4/fmu-v4/src/can.c deleted file mode 100644 index 89b8ba2..0000000 --- a/boards/px4/fmu-v4/src/can.c +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file can.c - * - * Board-specific CAN functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include - -#include -#include - -#include "chip.h" -#include "arm_internal.h" - -#include "stm32.h" -#include "stm32_can.h" -#include "board_config.h" - -#ifdef CONFIG_CAN - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) -# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." -# undef CONFIG_STM32_CAN2 -#endif - -#ifdef CONFIG_STM32_CAN1 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); - -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} - -#endif diff --git a/boards/px4/fmu-v4/src/i2c.cpp b/boards/px4/fmu-v4/src/i2c.cpp deleted file mode 100644 index e9f26f9..0000000 --- a/boards/px4/fmu-v4/src/i2c.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), -}; diff --git a/boards/px4/fmu-v4/src/init.c b/boards/px4/fmu-v4/src/init.c deleted file mode 100644 index 6c3ee01..0000000 --- a/boards/px4/fmu-v4/src/init.c +++ /dev/null @@ -1,371 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-2016 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * PX4FMU-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include "board_config.h" -#include - -#include - -#include -#include - -#include - -#include -#include - -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/** - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/**************************************************************************** - * Protected Functions - ****************************************************************************/ -/**************************************************************************** - * Public Functions - ****************************************************************************/ -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - // Set the peripheral rails off. - stm32_configgpio(GPIO_PERIPH_3V3_EN); - - stm32_gpiowrite(GPIO_PERIPH_3V3_EN, 0); - - bool last = stm32_gpioread(GPIO_SPEKTRUM_PWR_EN); - // Keep Spektum on to discharge rail. - stm32_gpiowrite(GPIO_SPEKTRUM_PWR_EN, 1); - - // Wait for the peripheral rail to reach GND. - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - // Re-enable power. - // Switch the peripheral rail back on. - stm32_gpiowrite(GPIO_SPEKTRUM_PWR_EN, last); - stm32_gpiowrite(GPIO_PERIPH_3V3_EN, 1); - -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - // Configure the GPIO pins to outputs and keep them low. - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(io_timer_channel_get_gpio_output(i)); - } - - /* - * On resets invoked from system (not boot) insure we establish a low - * output state (discharge the pins) on PWM pins before they become inputs. - */ - - if (status >= 0) { - up_mdelay(400); - } -} - -/************************************************************************************ - * 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 all PWM to Low outputs. - board_on_reset(-1); - - // Configure LEDs. - board_autoled_initialize(); - - - // Configure ADC pins. - stm32_configgpio(GPIO_ADC1_IN2); /* BATT_VOLTAGE_SENS */ - stm32_configgpio(GPIO_ADC1_IN3); /* BATT_CURRENT_SENS */ - stm32_configgpio(GPIO_ADC1_IN4); /* VDD_5V_SENS */ - stm32_configgpio(GPIO_ADC1_IN11); /* RSSI analog in */ - - // Configure CAN interface - stm32_configgpio(GPIO_CAN1_RX); - stm32_configgpio(GPIO_CAN1_TX); - - // Configure power supply control/sense pins. - stm32_configgpio(GPIO_PERIPH_3V3_EN); - stm32_configgpio(GPIO_VDD_BRICK_VALID); - stm32_configgpio(GPIO_VDD_USB_VALID); - - stm32_configgpio(GPIO_SBUS_INV); - stm32_configgpio(GPIO_SPEKTRUM_PWR_EN); - - stm32_configgpio(GPIO_8266_GPIO2); - stm32_configgpio(GPIO_8266_GPIO0); - - // Safety - led on in led driver. - stm32_configgpio(GPIO_BTN_SAFETY); - stm32_configgpio(GPIO_PPM_IN); - -#if defined(CONFIG_STM32_SPI4) - - /* We have SPI4 is GPIO_8266_GPIO2 PB4 pin 3 Low */ - if (stm32_gpioread(GPIO_8266_GPIO2) != 0) { -#endif /* CONFIG_STM32_SPI4 */ - - stm32_configgpio(GPIO_8266_PD); - stm32_configgpio(GPIO_8266_RST); - -#if defined(CONFIG_STM32_SPI4) - } - -#endif /* CONFIG_STM32_SPI4 */ - - // Configure SPI all interfaces GPIO & enable power. - stm32_spiinitialize(); - - // Configure heater GPIO. - stm32_configgpio(GPIO_HEATER_INPUT); - stm32_configgpio(GPIO_HEATER_OUTPUT); -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -static struct spi_dev_s *spi1; -static struct spi_dev_s *spi2; -static struct sdio_dev_s *sdio; -#if defined(CONFIG_STM32_SPI4) -static struct spi_dev_s *spi4; -#endif - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - px4_platform_init(); - - // Configure the DMA allocator. - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - // Initial LED state. - drv_led_start(); - led_off(LED_RED); - led_off(LED_GREEN); - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - - // Power down the heater. - stm32_gpiowrite(GPIO_HEATER_OUTPUT, 0); - - // Configure SPI-based devices. - spi1 = stm32_spibus_initialize(1); - - if (!spi1) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 1\n"); - led_on(LED_RED); - } - - - // Default SPI1 to 1MHz - SPI_SETFREQUENCY(spi1, 10000000); - SPI_SETBITS(spi1, 8); - SPI_SETMODE(spi1, SPIDEV_MODE3); - up_udelay(20); - - // Get the SPI port for the FRAM. - spi2 = stm32_spibus_initialize(2); - - if (!spi2) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 2\n"); - led_on(LED_RED); - } - - /** - * Default SPI2 to 12MHz and de-assert the known chip selects. - * MS5611 has max SPI clock speed of 20MHz. - */ - - // XXX start with 10.4 MHz and go up to 20 once validated. - SPI_SETFREQUENCY(spi2, 20 * 1000 * 1000); - SPI_SETBITS(spi2, 8); - SPI_SETMODE(spi2, SPIDEV_MODE3); - -#if defined(CONFIG_STM32_SPI4) - - if (stm32_gpioread(GPIO_8266_GPIO2) == 0) { - syslog(LOG_INFO, "[boot] 8266_GPIO2 - Low Initialize SPI port 4 \n"); - - // Configure SPI-based devices. - spi4 = stm32_spibus_initialize(4); - - if (!spi4) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 4\n"); - - } else { - // Default SPI4 to 20 MHz - SPI_SETFREQUENCY(spi4, 20 * 1000 * 1000); - SPI_SETBITS(spi4, 8); - SPI_SETMODE(spi4, SPIDEV_MODE3); - } - } - -#endif /* defined(CONFIG_STM32_SPI4) */ - - -#ifdef CONFIG_MMCSD - - // First, get an instance of the SDIO interface. - sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO); - - if (!sdio) { - led_on(LED_RED); - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", CONFIG_NSH_MMCSDSLOTNO); - } - - // Now bind the SDIO interface to the MMC/SD driver. - int ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio); - - if (ret != OK) { - led_on(LED_RED); - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); - } - - // Then let's guess and say that there is a card in the slot. There is no card detect GPIO. - sdio_mediachange(sdio, true); - -#endif - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/px4/fmu-v4/src/led.c b/boards/px4/fmu-v4/src/led.c deleted file mode 100644 index a10318e..0000000 --- a/boards/px4/fmu-v4/src/led.c +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * PX4FMU LED backend. - */ - -#include - -#include - -#include "stm32.h" -#include "board_config.h" - -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - - - -static uint32_t g_ledmap[] = { - GPIO_LED_BLUE, // Indexed by LED_BLUE - GPIO_LED_RED, // Indexed by LED_RED, LED_AMBER - GPIO_LED_SAFETY, // Indexed by LED_SAFETY - GPIO_LED_GREEN, // Indexed by LED_GREEN -}; - -__EXPORT void led_init(void) -{ - /* Configure LED GPIOs for output */ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - stm32_configgpio(g_ledmap[l]); - } -} - -static void phy_set_led(int led, bool state) -{ - /* Pull Down to switch on */ - stm32_gpiowrite(g_ledmap[led], !state); -} - -static bool phy_get_led(int led) -{ - - return !stm32_gpioread(g_ledmap[led]); -} - -__EXPORT void led_on(int led) -{ - phy_set_led(led, true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(led, false); -} - -__EXPORT void led_toggle(int led) -{ - - phy_set_led(led, !phy_get_led(led)); -} diff --git a/boards/px4/fmu-v4/src/spi.cpp b/boards/px4/fmu-v4/src/spi.cpp deleted file mode 100644 index da181b5..0000000 --- a/boards/px4/fmu-v4/src/spi.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_MPU9250, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortC, GPIO::Pin15}, SPI::DRDY{GPIO::PortC, GPIO::Pin14}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20608G, SPI::CS{GPIO::PortC, GPIO::Pin15}, SPI::DRDY{GPIO::PortC, GPIO::Pin14}), - initSPIDevice(DRV_MAG_DEVTYPE_HMC5883, SPI::CS{GPIO::PortE, GPIO::Pin15}, SPI::DRDY{GPIO::PortE, GPIO::Pin12}), // hmc5983 - initSPIDevice(DRV_MAG_DEVTYPE_LIS3MDL, SPI::CS{GPIO::PortE, GPIO::Pin15}, SPI::DRDY{GPIO::PortE, GPIO::Pin12}), - }, {GPIO::PortE, GPIO::Pin3}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10}), - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortD, GPIO::Pin7}), - }), - initSPIBusExternal(SPI::Bus::SPI4, { - initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin8}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); - -__EXPORT bool board_has_bus(enum board_bus_types type, uint32_t bus) -{ - bool rv = true; - - switch (type) { - case BOARD_SPI_BUS: -#ifdef CONFIG_STM32_SPI4 - rv = bus != 4 || (stm32_gpioread(GPIO_8266_GPIO2) == 0); -#endif /* CONFIG_STM32_SPI4 */ - break; - - case BOARD_I2C_BUS: - break; - - default: break; - } - - return rv; -} diff --git a/boards/px4/fmu-v4/src/timer_config.cpp b/boards/px4/fmu-v4/src/timer_config.cpp deleted file mode 100644 index ad3c193..0000000 --- a/boards/px4/fmu-v4/src/timer_config.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1, DMA{DMA::Index2, DMA::Stream5, DMA::Channel6}), - initIOTimer(Timer::Timer4, DMA{DMA::Index1, DMA::Stream6, DMA::Channel2}), -}; - -static inline constexpr timer_io_channels_t initIOTimerChannelPulldown(const io_timers_t io_timers_conf[MAX_IO_TIMERS], - Timer::TimerChannel timer, GPIO::GPIOPin pin) -{ - timer_io_channels_t ret = initIOTimerChannel(io_timers_conf, timer, pin); - ret.gpio_out |= GPIO_OUTPUT_CLEAR | GPIO_PULLDOWN; - return ret; -} - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannelPulldown(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannelPulldown(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortE, GPIO::Pin13}), - initIOTimerChannelPulldown(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannelPulldown(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), - initIOTimerChannelPulldown(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannelPulldown(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/px4/fmu-v4/src/usb.c b/boards/px4/fmu-v4/src/usb.c deleted file mode 100644 index 5791d52..0000000 --- a/boards/px4/fmu-v4/src/usb.c +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#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_STM32_OTGFS - stm32_configgpio(GPIO_OTGFS_VBUS); - /* XXX We only support device mode - stm32_configgpio(GPIO_OTGFS_PWRON); - stm32_configgpio(GPIO_OTGFS_OVER); - */ -#endif -} - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} - diff --git a/boards/px4/fmu-v4/test.px4board b/boards/px4/fmu-v4/test.px4board deleted file mode 100644 index 6f18488..0000000 --- a/boards/px4/fmu-v4/test.px4board +++ /dev/null @@ -1,9 +0,0 @@ -CONFIG_DRIVERS_ADC_ADS1115=n -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=n -CONFIG_DRIVERS_IRLOCK=n -CONFIG_DRIVERS_PCA9685_PWM_OUT=n -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=n -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=n -CONFIG_BOARD_TESTING=y -CONFIG_DRIVERS_TEST_PPM=y -CONFIG_SYSTEMCMDS_MICROBENCH=y diff --git a/boards/px4/fmu-v4/uavcan_board_identity b/boards/px4/fmu-v4/uavcan_board_identity deleted file mode 100644 index 0905752..0000000 --- a/boards/px4/fmu-v4/uavcan_board_identity +++ /dev/null @@ -1,17 +0,0 @@ -# UAVCAN boot loadable Module ID -set(uavcanblid_sw_version_major 0) -set(uavcanblid_sw_version_minor 1) -add_definitions( - -DAPP_VERSION_MAJOR=${uavcanblid_sw_version_major} - -DAPP_VERSION_MINOR=${uavcanblid_sw_version_minor} -) - -set(uavcanblid_hw_version_major 1) -set(uavcanblid_hw_version_minor 0) -set(uavcanblid_name "\"org.px4.fmu-v4_cannode\"") - -add_definitions( - -DHW_UAVCAN_NAME=${uavcanblid_name} - -DHW_VERSION_MAJOR=${uavcanblid_hw_version_major} - -DHW_VERSION_MINOR=${uavcanblid_hw_version_minor} -) diff --git a/boards/px4/fmu-v4pro/default.px4board b/boards/px4/fmu-v4pro/default.px4board deleted file mode 100644 index f722e64..0000000 --- a/boards/px4/fmu-v4pro/default.px4board +++ /dev/null @@ -1,102 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS3" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS2" -CONFIG_BOARD_SERIAL_TEL3="/dev/ttyS0" -CONFIG_BOARD_SERIAL_TEL4="/dev/ttyS6" -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_COMMON_BAROMETERS=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20608G=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU9250=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_PWM_INPUT=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_PX4IO=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UUV_ATT_CONTROL=y -CONFIG_MODULES_UUV_POS_CONTROL=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BL_UPDATE=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_FAKE_GPS=y diff --git a/boards/px4/fmu-v4pro/extras/px4_fmu-v4pro_bootloader.bin b/boards/px4/fmu-v4pro/extras/px4_fmu-v4pro_bootloader.bin deleted file mode 100644 index 0cd3e09..0000000 Binary files a/boards/px4/fmu-v4pro/extras/px4_fmu-v4pro_bootloader.bin and /dev/null differ diff --git a/boards/px4/fmu-v4pro/extras/px4_io-v2_default.bin b/boards/px4/fmu-v4pro/extras/px4_io-v2_default.bin deleted file mode 100755 index 957f0f1..0000000 Binary files a/boards/px4/fmu-v4pro/extras/px4_io-v2_default.bin and /dev/null differ diff --git a/boards/px4/fmu-v4pro/firmware.prototype b/boards/px4/fmu-v4pro/firmware.prototype deleted file mode 100644 index a2f1a69..0000000 --- a/boards/px4/fmu-v4pro/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 13, - "magic": "PX4FWv1", - "description": "Firmware for the PX4FMUv4PRO board, based on STM32F469", - "image": "", - "build_time": 0, - "summary": "PX4FMUv4PRO", - "version": "0.1", - "image_size": 0, - "image_maxsize": 2080768, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/px4/fmu-v4pro/init/rc.board_defaults b/boards/px4/fmu-v4pro/init/rc.board_defaults deleted file mode 100644 index 42378a1..0000000 --- a/boards/px4/fmu-v4pro/init/rc.board_defaults +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 6.490196078 -param set-default BAT2_V_DIV 6.490196078 - -param set-default BAT1_A_PER_V 26.4 -param set-default BAT2_A_PER_V 26.4 - -# Multi-EKF -param set-default EKF2_MULTI_IMU 2 -param set-default SENS_IMU_MODE 0 - -param set-default SYS_USE_IO 1 - -set LOGGER_BUF 64 diff --git a/boards/px4/fmu-v4pro/init/rc.board_sensors b/boards/px4/fmu-v4pro/init/rc.board_sensors deleted file mode 100644 index 7906afc..0000000 --- a/boards/px4/fmu-v4pro/init/rc.board_sensors +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# PX4 FMUv4pro specific board sensors init -#------------------------------------------------------------------------------ - -rgbled start -I -rgbled_ncp5623c start -I -q - -board_adc start - -# Internal SPI bus ICM-20602 or ICM-20608-G -if ! icm20602 -s -R 8 start -then - icm20608g -s -R 8 start -fi - -# Internal SPI bus mpu9250 -mpu9250 -s -R 8 start - -# Internal SPI bus -lis3mdl -s -R 0 start - -# Internal SPI -ms5611 -s start diff --git a/boards/px4/fmu-v4pro/nuttx-config/Kconfig b/boards/px4/fmu-v4pro/nuttx-config/Kconfig deleted file mode 100644 index 90db796..0000000 --- a/boards/px4/fmu-v4pro/nuttx-config/Kconfig +++ /dev/null @@ -1,22 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see misc/tools/kconfig-language.txt. -# - -if ARCH_BOARD_PX4_FMU_V4PRO - -config BOARD_HAS_PROBES - bool "Board provides GPIO or other Hardware for signaling to timing analyze." - default y - ---help--- - This board provides GPIO FMU-CH1-6 as PROBE_1-6 to provide timing signals from selected drivers. - -config BOARD_USE_PROBES - bool "Enable the use the board provided GPIO FMU-CH1-6 as PROBE_1-6 to provide timing signals from selected drivers" - default n - depends on BOARD_HAS_PROBES - - ---help--- - Select to use GPIO FMU-CH1-6 to provide timing signals from selected drivers. - -endif diff --git a/boards/px4/fmu-v4pro/nuttx-config/include/board.h b/boards/px4/fmu-v4pro/nuttx-config/include/board.h deleted file mode 100644 index bbcc23d..0000000 --- a/boards/px4/fmu-v4pro/nuttx-config/include/board.h +++ /dev/null @@ -1,355 +0,0 @@ -/************************************************************************************ - * configs/px4_fmu-v4pro/include/board.h - * include/arch/board/board.h - * - * Copyright (C) 2009, 2016 Gregory Nutt. All rights reserved. - * Authors: Gregory Nutt - * David Sidrane - * Kevin Lopez Alvarez - * - * 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 NuttX 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. - * - ************************************************************************************/ - -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ -#include "board_dma_map.h" - -#include -#ifndef __ASSEMBLY__ -# include -#endif - -#include - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The PX4FMUV4-PRO uses a 24MHz crystal connected to the HSE. - * - * This is the "standard" configuration as set up by arch/arm/src/stm32f40xx_rcc.c: - * System Clock source : PLL (HSE) - * SYSCLK(Hz) : 180000000 Determined by PLL configuration - * HCLK(Hz) : 180000000 (STM32_RCC_CFGR_HPRE) - * AHB Prescaler : 1 (STM32_RCC_CFGR_HPRE) - * APB1 Prescaler : 4 (STM32_RCC_CFGR_PPRE1) - * APB2 Prescaler : 2 (STM32_RCC_CFGR_PPRE2) - * HSE Frequency(Hz) : 24000000 (STM32_BOARD_XTAL) - * PLLM : 12 (STM32_PLLCFG_PLLM) - * PLLN : 180 (STM32_PLLCFG_PLLN) - * PLLP : 2 (STM32_PLLCFG_PLLP) - * PLLQ : 2 (STM32_PLLCFG_PPQ) - * Main regulator output voltage : Scale1 mode Needed for high speed SYSCLK - * Flash Latency(WS) : 5 - * Prefetch Buffer : OFF - * Instruction cache : ON - * Data cache : ON - * Require 48MHz for USB OTG FS, : Use PLLSA1M - * SDIO and RNG clock - */ - -/* HSI - 16 MHz RC factory-trimmed - * LSI - 32 KHz RC - * HSE - On-board crystal frequency is 24MHz - * LSE - not installed - */ - -#define STM32_BOARD_XTAL 24000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL - -/* Main PLL Configuration. - * - * PLL source is HSE - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * = (24,000,000 / 12) * 180 - * = 369,000,000 - * SYSCLK = PLL_VCO / PLLP - * = 360,000,000 / 2 = 180,000,000 - * USB OTG FS, SDIO and RNG Clock is from PLL SAIP - * = 48,000,000 - */ - -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(12) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(180) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(2) -#define STM32_PLLCFG_PLLR RCC_PLLCFG_PLLR(2) - -/* Configure factors for PLLSAI clock */ - -#define STM32_RCC_PLLSAICFGR_PLLSAIN RCC_PLLSAICFGR_PLLSAIN(96) -#define STM32_RCC_PLLSAICFGR_PLLSAIP RCC_PLLSAICFGR_PLLSAIP(4) -#define STM32_RCC_PLLSAICFGR_PLLSAIQ RCC_PLLSAICFGR_PLLSAIQ(2) -#define STM32_RCC_PLLSAICFGR_PLLSAIR RCC_PLLSAICFGR_PLLSAIR(2) - -/* Configure Dedicated Clock Configuration Register */ - -#define STM32_RCC_DCKCFGR_PLLI2SDIVQ RCC_DCKCFGR_PLLI2SDIVQ(1) -#define STM32_RCC_DCKCFGR_PLLSAIDIVQ RCC_DCKCFGR_PLLSAIDIVQ(1) -#define STM32_RCC_DCKCFGR_PLLSAIDIVR RCC_DCKCFGR_PLLSAIDIVR_DIV2 -#define STM32_RCC_DCKCFGR_SAI1ASRC RCC_DCKCFGR_SAI1ASRC_PLLSAI -#define STM32_RCC_DCKCFGR_SAI1BSRC RCC_DCKCFGR_SAI1BSRC_PLLI2S -#define STM32_RCC_DCKCFGR_TIMPRE 0 -#define STM32_RCC_DCKCFGR_48MSEL RCC_DCKCFGR_48MSEL_PLLSAI -#define STM32_RCC_DCKCFGR_SDMMCSEL RCC_DCKCFGR_SDMMCSEL_48MHZ -#define STM32_RCC_DCKCFGR_DSISEL RCC_DCKCFGR_DSISEL_DSIPHY - -/* Configure factors for PLLI2S clock */ - -#define STM32_RCC_PLLI2SCFGR_PLLI2SN RCC_PLLI2SCFGR_PLLI2SN(96) -#define STM32_RCC_PLLI2SCFGR_PLLI2SQ RCC_PLLI2SCFGR_PLLI2SQ(4) -#define STM32_RCC_PLLI2SCFGR_PLLI2SR RCC_PLLI2SCFGR_PLLI2SR(2) - - -#define STM32_SYSCLK_FREQUENCY 180000000ul - -/* AHB clock (HCLK) is SYSCLK (180MHz) */ - -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (45MHz) */ - -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (90MHz) */ - -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx - * otherwise frequency is 2xAPBx. - * Note: TIM1,8-11 are on APB2, others on APB1 - */ - -#define BOARD_TIM1_FREQUENCY STM32_APB2_TIM1_CLKIN -#define BOARD_TIM2_FREQUENCY STM32_APB1_TIM2_CLKIN -#define BOARD_TIM3_FREQUENCY STM32_APB1_TIM3_CLKIN -#define BOARD_TIM4_FREQUENCY STM32_APB1_TIM4_CLKIN -#define BOARD_TIM5_FREQUENCY STM32_APB1_TIM5_CLKIN -#define BOARD_TIM6_FREQUENCY STM32_APB1_TIM6_CLKIN -#define BOARD_TIM7_FREQUENCY STM32_APB1_TIM7_CLKIN -#define BOARD_TIM8_FREQUENCY STM32_APB2_TIM8_CLKIN -#define BOARD_TIM9_FREQUENCY STM32_APB2_TIM9_CLKIN -#define BOARD_TIM10_FREQUENCY STM32_APB2_TIM10_CLKIN -#define BOARD_TIM11_FREQUENCY STM32_APB2_TIM11_CLKIN -#define BOARD_TIM12_FREQUENCY STM32_APB1_TIM12_CLKIN -#define BOARD_TIM13_FREQUENCY STM32_APB1_TIM13_CLKIN -#define BOARD_TIM14_FREQUENCY STM32_APB1_TIM14_CLKIN - -/* SDMMC dividers. Note that slower clocking is required when DMA is disabled - * in order to avoid RX overrun/TX underrun errors due to delayed responses - * to service FIFOs in interrupt driven mode. These values have not been - * tuned!!! - * - * SDIOCLK=48MHz, SDMMC_CK=SDIOCLK/(118+2)=400 KHz - */ - -/* Use the Falling edge of the SDIO_CLK clock to change the edge the - * data and commands are change on - */ - -#define SDIO_CLKCR_EDGE SDIO_CLKCR_NEGEDGE - -#define SDIO_INIT_CLKDIV (118 << SDIO_CLKCR_CLKDIV_SHIFT) - -/* DMA ON: SDIOCLK=48MHz, SDMMC_CK=SDIOCLK/(1+2)=16 MHz - * DMA OFF: SDIOCLK=48MHz, SDMMC_CK=SDIOCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32_SDIO_DMA -# define SDIO_MMCXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) -#else -# define SDIO_MMCXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) -#endif - -/* DMA ON: SDIOCLK=48MHz, SDMMC_CK=SDIOCLK/(1+2)=16 MHz - * DMA OFF: SDIOCLK=48MHz, SDMMC_CK=SDIOCLK/(2+2)=12 MHz - */ -//TODO #warning "Check Freq for 24mHz" - -#ifdef CONFIG_STM32_SDIO_DMA -# define SDIO_SDXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) -#else -# define SDIO_SDXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) -#endif - -/* FLASH wait states - * - * --------- ---------- ----------- --------- - * VDD MAX SYSCLK WAIT STATES OVERDRIVE - * --------- ---------- ----------- --------- - * 1.7-2.1 V 168 MHz 8 OFF - * 2.1-2.4 V 180 MHz 8 ON - * 2.4-2.7 V 180 MHz 7 ON - * 2.7-3.6 V 180 MHz 5 ON - * --------- ---------- ----------- -------- - *- - */ - -#define BOARD_FLASH_WAITSTATES 5 - -/* Alternate function pin selections ************************************************/ - -/* - * UARTs. - */ -#define GPIO_USART1_RX GPIO_USART1_RX_2 /* ESP8266 */ -#define GPIO_USART1_TX GPIO_USART1_TX_2 - -#define GPIO_USART2_RX GPIO_USART2_RX_2 -#define GPIO_USART2_TX GPIO_USART2_TX_2 -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 -#define GPIO_USART2_CTS GPIO_USART2_CTS_2 - -#define GPIO_USART3_RX GPIO_USART3_RX_3 -#define GPIO_USART3_TX GPIO_USART3_TX_3 -#define GPIO_USART3_RTS GPIO_USART3_RTS_2 -#define GPIO_USART3_CTS GPIO_USART3_CTS_2 - -#define GPIO_UART4_RX GPIO_UART4_RX_1 -#define GPIO_UART4_TX GPIO_UART4_TX_1 - -#define GPIO_USART6_RX GPIO_USART6_RX_1 /* RC_INPUT */ -#define GPIO_USART6_TX GPIO_USART6_TX_1 - -#define GPIO_UART7_RX GPIO_UART7_RX_1 -#define GPIO_UART7_TX GPIO_UART7_TX_1 - -/* UART8 has no alternate pin config */ - - -/* - * CAN - * - * CAN1 and CAN2 is routed to the onboard transceiver. - */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 - -#define GPIO_CAN2_RX GPIO_CAN2_RX_1 -#define GPIO_CAN2_TX GPIO_CAN2_TX_1 - -/* - * I2C - * - * The optional _GPIO configurations allow the I2C driver to manually - * reset the bus to clear stuck slaves. They match the pin configuration, - * but are normally-high GPIOs. - */ -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN8) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN9) - -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_2 -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_2 -#define GPIO_I2C2_SCL_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTF|GPIO_PIN1) -#define GPIO_I2C2_SDA_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTF|GPIO_PIN0) - - -/* - * SPI - * - * There are sensors on SPI1, and SPI2 is connected to the FRAM. - */ -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 - -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_1 - -#define GPIO_SPI5_MISO GPIO_SPI5_MISO_1 -#define GPIO_SPI5_MOSI GPIO_SPI5_MOSI_1 -#define GPIO_SPI5_SCK GPIO_SPI5_SCK_1 -#define GPIO_SPI5_NSS GPIO_SPI5_NSS_1 - -/* Board provides GPIO or other Hardware for signaling to timing analyzer */ - -#if defined(CONFIG_BOARD_USE_PROBES) -# define PROBE_N(n) (1<<((n)-1)) -# define PROBE_1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN14) -# define PROBE_2 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN13) -# define PROBE_3 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN11) -# define PROBE_4 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN9) -# define PROBE_5 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN13) -# define PROBE_6 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN14) - -# define PROBE_INIT(mask) \ - do { \ - if ((mask)& PROBE_N(1)) { stm32_configgpio(PROBE_1); } \ - if ((mask)& PROBE_N(2)) { stm32_configgpio(PROBE_2); } \ - if ((mask)& PROBE_N(3)) { stm32_configgpio(PROBE_3); } \ - if ((mask)& PROBE_N(4)) { stm32_configgpio(PROBE_4); } \ - if ((mask)& PROBE_N(5)) { stm32_configgpio(PROBE_5); } \ - if ((mask)& PROBE_N(6)) { stm32_configgpio(PROBE_6); } \ - } while(0) - -# define PROBE(n,s) do {stm32_gpiowrite(PROBE_##n,(s));}while(0) -# define PROBE_MARK(n) PROBE(n,false);PROBE(n,true) -#else -# define PROBE_INIT(mask) -# define PROBE(n,s) -# define PROBE_MARK(n) -#endif - - -#endif /* __ARCH_BOARD_BOARD_H */ diff --git a/boards/px4/fmu-v4pro/nuttx-config/include/board_dma_map.h b/boards/px4/fmu-v4pro/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 2a94fe8..0000000 --- a/boards/px4/fmu-v4pro/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/* -| DMA1 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | SPI3_RX_1 | - | SPI3_RX_2 | SPI2_RX | SPI2_TX | SPI3_TX_1 | - | SPI3_TX_2 | -| Channel 1 | I2C1_RX | - | TIM7_UP_1 | - | TIM7_UP_2 | I2C1_RX_1 | I2C1_TX | I2C1_TX_1 | -| Channel 2 | TIM4_CH1 | - | I2C4_RX | TIM4_CH2 | - | I2C4_RX | TIM4_UP | TIM4_CH3 | -| Channel 3 | - | TIM2_UP_1 | I2C3_RX_1 | I2C2_EXT_RX | I2C3_TX | TIM2_CH1 | TIM2_CH2 | TIM2_UP_2 | -| | | TIM2_CH3 | | | | | TIM2_CH4_1 | TIM2_CH4_2 | -| Channel 4 | UART5_RX | USART3_RX | UART4_RX | USART3_TX_1 | UART4_TX | USART2_RX | USART2_TX | UART5_TX | -| Channel 5 | UART8_TX | UART7_TX | TIM3_CH4 | UART7_RX | TIM3_CH1 | TIM3_CH2 | UART8_RX | TIM3_CH3 | -| | | | TIM3_UP | | TIM3_TRIG | | | | -| Channel 6 | TIM5_CH3 | TIM5_CH4_1 | TIM5_CH1 | TIM5_CH4_2 | TIM5_CH2 | - | TIM5_UP_2 | - | -| | TIM5_UP_1 | TIM5_TRIG_1 | | TIM5_TRIG_2 | | | | | -| Channel 7 | - | TIM6_UP | I2C2_RX | I2C2_RX_1 | USART3_TX_2 | DAC1 | DAC2 | I2C2_TX | -| | | | | | | | | | -| Usage | | USART3_RX | UART4_RX | UART7_RX | | USART2_RX | UART8_RX | | - - -| DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | ADC1_1 | SAI1_A | TIM8_CH1_1 | SAI1_A_1 | ADC1_2 | SAI1_B_1 | TIM1_CH1_1 | - | -| | | | TIM8_CH2_1 | | | | TIM1_CH2_1 | | -| | | | TIM8_CH3_1 | | | | TIM1_CH3_1 | | -| Channel 1 | - | DCMI_1 | ADC2_1 | ADC2_2 | SAI1_B | SPI6_TX | SPI6_RX | DCMI_2 | -| Channel 2 | ADC3_1 | ADC3_2 | - | SPI5_RX_1 | SPI5_TX_1 | CRYP_OUT | CRYP_IN | HASH_IN | -| Channel 3 | SPI1_RX_1 | - | SPI1_RX_2 | SPI1_TX_1 | - | SPI1_TX_2 | - | QUADSPI | -| Channel 4 | SPI4_RX_1 | SPI4_TX_1 | USART1_RX_1 | SDIO | - | USART1_RX_2 | SDIO | USART1_TX | -| Channel 5 | - | USART6_RX_1 | USART6_RX_2 | SPI4_RX_2 | SPI4_TX_2 | - | USART6_TX_1 | USART6_TX_2 | -| Channel 6 | TIM1_TRIG_1 | TIM1_CH1_2 | TIM1_CH2_2 | TIM1_CH1 | TIM1_CH4 | TIM1_UP | TIM1_CH3_2 | - | -| | | | | | TIM1_TRIG_2 | | | | -| | | | | | TIM1_COM | | | | -| Channel 7 | - | TIM8_UP | TIM8_CH1_2 | TIM8_CH2_2 | TIM8_CH3_2 | SPI5_RX_2 | SPI5_TX_2 | TIM8_CH4 | -| | | | | | | | | TIM8_TRIG | -| | | | | | | | | TIM8_COM | -| | | | | | | | | | -| Usage | SPI1_RX_1 | | USART6_RX_2 | SPI1_TX_1 | | USART1_RX_2 | SDIO | USART6_TX_2 | - */ - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// DMAMAP_USART3_RX // DMA1, Stream 1, Channel 4 -// DMAMAP_UART4_RX // DMA1, Stream 2, Channel 4 -// DMAMAP_UART7_RX // DMA1, Stream 3, Channel 5 -// AVAILABLE // DMA1, Stream 4 -// DMAMAP_USART2_RX // DMA1, Stream 5, Channel 4 -// DMAMAP_UART8_RX // DMA1, Stream 6, Channel 5 - - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMACHAN_SPI1_RX DMAMAP_SPI1_RX_1 // DMA2, Stream 0, Channel 3 (SPI sensors RX) -// AVAILABLE // DMA2, Stream 1 -#define DMAMAP_USART6_RX DMAMAP_USART6_RX_2 // DMA2, Stream 2, Channel 5 (PX4IO TX) -#define DMACHAN_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 3, Channel 3 (SPI sensors TX) -// AVAILABLE // DMA2, Stream 4 -#define DMAMAP_USART1_RX DMAMAP_USART1_RX_2 // DMA2, Stream 5, Channel 4 -#define DMAMAP_SDIO DMAMAP_SDIO_2 // DMA2, Stream 6, Channel 4 -#define DMAMAP_USART6_TX DMAMAP_USART6_TX_2 // DMA2, Stream 7, Channel 5 (PX4IO TX) diff --git a/boards/px4/fmu-v4pro/nuttx-config/nsh/defconfig b/boards/px4/fmu-v4pro/nuttx-config/nsh/defconfig deleted file mode 100644 index e8ecbae..0000000 --- a/boards/px4/fmu-v4pro/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,262 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_STM32_CCMEXCLUDE is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/px4/fmu-v4pro/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F469I=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0013 -CONFIG_CDCACM_PRODUCTSTR="PX4 FMU v4.x PRO" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=2000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="3D Robotics" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXAMPLES_CALIB_UDELAY=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=2 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=393216 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDIO_BLOCKSETUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32_ADC1=y -CONFIG_STM32_BBSRAM=y -CONFIG_STM32_BBSRAM_FILES=5 -CONFIG_STM32_BKPSRAM=y -CONFIG_STM32_CCMDATARAM=y -CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y -CONFIG_STM32_DMA1=y -CONFIG_STM32_DMA2=y -CONFIG_STM32_FLASH_CONFIG_I=y -CONFIG_STM32_FLASH_PREFETCH=y -CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_STM32_I2C1=y -CONFIG_STM32_I2C2=y -CONFIG_STM32_I2CTIMEOMS=10 -CONFIG_STM32_I2CTIMEOTICKS=10 -CONFIG_STM32_I2SPLL=y -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_OTGFS=y -CONFIG_STM32_PWR=y -CONFIG_STM32_RTC=y -CONFIG_STM32_RTC_HSECLOCK=y -CONFIG_STM32_RTC_MAGIC=0xfacefeee -CONFIG_STM32_RTC_MAGIC_REG=1 -CONFIG_STM32_RTC_MAGIC_TIME_SET=0xfacefeef -CONFIG_STM32_SAIPLL=y -CONFIG_STM32_SAVE_CRASHDUMP=y -CONFIG_STM32_SDIO=y -CONFIG_STM32_SDIO_CARD=y -CONFIG_STM32_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32_SPI1=y -CONFIG_STM32_SPI1_DMA=y -CONFIG_STM32_SPI1_DMA_BUFFER=512 -CONFIG_STM32_SPI2=y -CONFIG_STM32_SPI5=y -CONFIG_STM32_SPI6=y -CONFIG_STM32_SPI_DMATHRESHOLD=8 -CONFIG_STM32_TIM10=y -CONFIG_STM32_TIM11=y -CONFIG_STM32_TIM8=y -CONFIG_STM32_TIM9=y -CONFIG_STM32_UART4=y -CONFIG_STM32_UART7=y -CONFIG_STM32_UART8=y -CONFIG_STM32_USART1=y -CONFIG_STM32_USART2=y -CONFIG_STM32_USART3=y -CONFIG_STM32_USART6=y -CONFIG_STM32_USART_BREAKS=y -CONFIG_STM32_USART_SINGLEWIRE=y -CONFIG_STM32_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=300 -CONFIG_UART4_RXDMA=y -CONFIG_UART4_TXBUFSIZE=300 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=300 -CONFIG_UART7_RXDMA=y -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=300 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=300 -CONFIG_UART8_RXDMA=y -CONFIG_UART8_TXBUFSIZE=300 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_RXDMA=y -CONFIG_USART1_TXBUFSIZE=2500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=1100 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=300 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=600 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=300 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/px4/fmu-v4pro/nuttx-config/scripts/script.ld b/boards/px4/fmu-v4pro/nuttx-config/scripts/script.ld deleted file mode 100644 index d43f2e7..0000000 --- a/boards/px4/fmu-v4pro/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,147 +0,0 @@ -/**************************************************************************** - * scripts/ld.script - * - * Copyright (C) 2011, 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F469II has 2048Kb of FLASH beginning at address 0x0800:0000 and - * 384Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 160Kb of SRAM beginning at address 0x2000:0000 - * 2) 32Kb of SRAM beginning at address 0x2002:8000 - * 3) 128Kb of SRAM beginning at address 0x2003:0000 - * 4) 64Kb of TCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 0x4000 of flash is reserved for the bootloader. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08004000, LENGTH = 2032K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 320K - ccsram (rwx) : ORIGIN = 0x10000000, LENGTH = 64K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) -EXTERN(board_get_manifest) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/px4/fmu-v4pro/nuttx-config/test/defconfig b/boards/px4/fmu-v4pro/nuttx-config/test/defconfig deleted file mode 100644 index 7825cb6..0000000 --- a/boards/px4/fmu-v4pro/nuttx-config/test/defconfig +++ /dev/null @@ -1,266 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CMP is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_STM32_CCMEXCLUDE is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/px4/fmu-v4pro/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F469I=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0013 -CONFIG_CDCACM_PRODUCTSTR="PX4 FMU v4.x PRO" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=2000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="3D Robotics" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXAMPLES_CALIB_UDELAY=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=2 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=393216 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDIO_BLOCKSETUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32_ADC1=y -CONFIG_STM32_BBSRAM=y -CONFIG_STM32_BBSRAM_FILES=5 -CONFIG_STM32_BKPSRAM=y -CONFIG_STM32_CCMDATARAM=y -CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y -CONFIG_STM32_DMA1=y -CONFIG_STM32_DMA2=y -CONFIG_STM32_FLASH_CONFIG_I=y -CONFIG_STM32_FLASH_PREFETCH=y -CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_STM32_I2C1=y -CONFIG_STM32_I2C2=y -CONFIG_STM32_I2CTIMEOMS=10 -CONFIG_STM32_I2CTIMEOTICKS=10 -CONFIG_STM32_I2SPLL=y -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_OTGFS=y -CONFIG_STM32_PWR=y -CONFIG_STM32_RTC=y -CONFIG_STM32_RTC_HSECLOCK=y -CONFIG_STM32_RTC_MAGIC=0xfacefeee -CONFIG_STM32_RTC_MAGIC_REG=1 -CONFIG_STM32_RTC_MAGIC_TIME_SET=0xfacefeef -CONFIG_STM32_SAIPLL=y -CONFIG_STM32_SAVE_CRASHDUMP=y -CONFIG_STM32_SDIO=y -CONFIG_STM32_SDIO_CARD=y -CONFIG_STM32_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32_SPI1=y -CONFIG_STM32_SPI1_DMA=y -CONFIG_STM32_SPI1_DMA_BUFFER=512 -CONFIG_STM32_SPI2=y -CONFIG_STM32_SPI5=y -CONFIG_STM32_SPI6=y -CONFIG_STM32_SPI_DMATHRESHOLD=8 -CONFIG_STM32_TIM10=y -CONFIG_STM32_TIM11=y -CONFIG_STM32_TIM8=y -CONFIG_STM32_TIM9=y -CONFIG_STM32_UART4=y -CONFIG_STM32_UART7=y -CONFIG_STM32_UART8=y -CONFIG_STM32_USART1=y -CONFIG_STM32_USART2=y -CONFIG_STM32_USART3=y -CONFIG_STM32_USART6=y -CONFIG_STM32_USART_BREAKS=y -CONFIG_STM32_USART_SINGLEWIRE=y -CONFIG_STM32_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TESTING_OSTEST=y -CONFIG_TESTING_OSTEST_FPUTESTDISABLE=y -CONFIG_TESTING_OSTEST_STACKSIZE=10240 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=300 -CONFIG_UART4_RXDMA=y -CONFIG_UART4_TXBUFSIZE=300 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=300 -CONFIG_UART7_RXDMA=y -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=300 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=300 -CONFIG_UART8_RXDMA=y -CONFIG_UART8_TXBUFSIZE=300 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_RXDMA=y -CONFIG_USART1_TXBUFSIZE=2500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=1100 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=300 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=600 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=300 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/px4/fmu-v4pro/src/CMakeLists.txt b/boards/px4/fmu-v4pro/src/CMakeLists.txt deleted file mode 100644 index bb72c52..0000000 --- a/boards/px4/fmu-v4pro/src/CMakeLists.txt +++ /dev/null @@ -1,51 +0,0 @@ -############################################################################ -# -# Copyright (c) 2015 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. -# -############################################################################ - -add_library(drivers_board - can.c - i2c.cpp - init.c - led.c - mtd.cpp - spi.cpp - timer_config.cpp - usb.c -) -target_link_libraries(drivers_board - PRIVATE - arch_spi - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer -) diff --git a/boards/px4/fmu-v4pro/src/board_config.h b/boards/px4/fmu-v4pro/src/board_config.h deleted file mode 100644 index e45c81f..0000000 --- a/boards/px4/fmu-v4pro/src/board_config.h +++ /dev/null @@ -1,228 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013-2016 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * PX4FMUv4Pro internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ - -/* PX4IO connection configuration */ -#define BOARD_USES_PX4IO_VERSION 2 -#define PX4IO_SERIAL_DEVICE "/dev/ttyS4" -#define PX4IO_SERIAL_TX_GPIO GPIO_USART6_TX -#define PX4IO_SERIAL_RX_GPIO GPIO_USART6_RX -#define PX4IO_SERIAL_BASE STM32_USART6_BASE /* hardwired on the board */ -#define PX4IO_SERIAL_VECTOR STM32_IRQ_USART6 -#define PX4IO_SERIAL_TX_DMAMAP DMAMAP_USART6_TX -#define PX4IO_SERIAL_RX_DMAMAP DMAMAP_USART6_RX -#define PX4IO_SERIAL_RCC_REG STM32_RCC_APB2ENR -#define PX4IO_SERIAL_RCC_EN RCC_APB2ENR_USART6EN -#define PX4IO_SERIAL_CLOCK STM32_PCLK2_FREQUENCY -#define PX4IO_SERIAL_BITRATE 1500000 /* 1.5Mbps -> max rate for IO */ - -/* Configuration ************************************************************************************/ -//{GPIO_RSSI_IN, 0, 0}, - pio Analog used as PWM -//{0, GPIO_LED_SAFETY, 0}, pio replacement -//{GPIO_SAFETY_SWITCH_IN, 0, 0}, pio replacement -//{0, GPIO_PERIPH_3V3_EN, 0}, Owned by the 8266 driver -//{0, GPIO_SBUS_INV, 0}, https://github.com/PX4/Firmware/blob/master/src/modules/px4iofirmware/sbus.c -//{GPIO_8266_GPIO0, 0, 0}, Owned by the 8266 driver -//{0, GPIO_SPEKTRUM_PWR_EN, 0}, Owned Spektum driver input to auto pilot -//{0, GPIO_8266_PD, 0}, Owned by the 8266 driver -//{0, GPIO_8266_RST, 0}, Owned by the 8266 driver - -/* PX4FMU GPIOs ***********************************************************************************/ -/* LEDs */ - -#define GPIO_LED1 (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN11) -#define GPIO_LED2 (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN1) -#define GPIO_LED3 (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN3) - -#define GPIO_LED_RED GPIO_LED1 -#define GPIO_LED_GREEN GPIO_LED2 -#define GPIO_LED_BLUE GPIO_LED3 - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_OVERLOAD_LED LED_RED -#define BOARD_ARMED_LED LED_BLUE -#define BOARD_ARMED_STATE_LED LED_GREEN - -/* SPI */ -#define GPIO_SPI_CS_TEMPCAL_EEPROM (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTH|GPIO_PIN5) - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that can be used by the Px4 Firmware in the adc driver - */ -// ADC defines to be used in sensors.cpp to read from a particular channel - -#define ADC_BATTERY1_VOLTAGE_CHANNEL 2 // PA2 -#define ADC_BATTERY1_CURRENT_CHANNEL 3 // PA3 -#define ADC_5V_RAIL_SENSE 4 // PA4 -#define ADC_BATTERY2_VOLTAGE_CHANNEL 11 // PC1 -#define ADC_BATTERY2_CURRENT_CHANNEL 13 // PC3 - -#define ADC_CHANNELS (1 << ADC_BATTERY1_VOLTAGE_CHANNEL) | (1 << ADC_BATTERY1_CURRENT_CHANNEL) | \ - (1 << ADC_5V_RAIL_SENSE) | \ - (1 << ADC_BATTERY2_VOLTAGE_CHANNEL) | (1 << ADC_BATTERY2_CURRENT_CHANNEL) - -/* Define LTC4417 UV set by resistors on the board that are different than FMUv2 3.7V */ - -#define BOARD_VALID_UV (4.01f) - -/* Power supply control and monitoring GPIOs */ -#define GPIO_nVDD_BRICK1_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5) -#define GPIO_nVDD_BRICK2_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN5) -#define BOARD_NUMBER_BRICKS 2 -#define GPIO_nVDD_USB_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN0) -#define GPIO_VDD_3V3_PERIPH_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN5) -#define GPIO_VDD_5V_PERIPH_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN10) -#define GPIO_VDD_5V_HIPOWER_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTF|GPIO_PIN4) -#define GPIO_VDD_5V_PERIPH_OC (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTG|GPIO_PIN4) -#define GPIO_VDD_5V_HIPOWER_OC (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTF|GPIO_PIN3) - -/* Tone alarm output */ -#define TONE_ALARM_TIMER 2 /* timer 2 */ -#define TONE_ALARM_CHANNEL 1 /* channel 1 */ -#define GPIO_TONE_ALARM_IDLE (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) -#define GPIO_TONE_ALARM (GPIO_ALT|GPIO_AF1|GPIO_SPEED_2MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN15) - -/* PWM - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 6 - -/* USB OTG FS - * - * PA9 OTG_FS_VBUS VBUS sensing - */ -#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 3 /* use timer 3 for the HRT */ -#define HRT_TIMER_CHANNEL 4 /* use capture/compare channel 4 */ - -#define HRT_PPM_CHANNEL 3 /* use capture/compare channel 3 */ -#define GPIO_PPM_IN (GPIO_ALT|GPIO_AF2|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN0) - -/* PWM input driver. Use FMU AUX5 pins attached to timer4 channel 2 */ -#define PWMIN_TIMER 4 -#define PWMIN_TIMER_CHANNEL 2 -#define GPIO_PWM_IN GPIO_TIM4_CH2IN_2 - -/* N.B. By the virtue of not being named GPIO_BTN_SAFETY, this pin is - * initialized but not used (compiled for) in the FMU module - */ -#define GPIO_BTN_SAFETY_FMU (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTC|GPIO_PIN4) -#define GPIO_SBUS_INV (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN13) - -#define GPIO_8266_GPIO0 (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN2) -//TODO: fo not see on schematic #define GPIO_SPEKTRUM_PWR_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN4) -#define GPIO_8266_PD (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN5) -#define GPIO_8266_RST (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN6) - -/* No Power switch controls or binding control ********************************************* - * V4 Pro does not have control to bind SPEKTRUM - there is only 5V VCC on - * the connector interface and Spektrum requires VDD 3v3 to be controllable - */ - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -#define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID)) -#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID)) -#define BOARD_ADC_SERVO_VALID (1) -#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_VDD_5V_PERIPH_OC)) -#define BOARD_ADC_HIPOWER_5V_OC (!px4_arch_gpioread(GPIO_VDD_5V_HIPOWER_OC)) - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -#define BOARD_HAS_ON_RESET 1 - -#define BOARD_HAS_STATIC_MANIFEST 1 - -__BEGIN_DECLS - -/**************************************************************************************************** - * Public Types - ****************************************************************************************************/ - -/**************************************************************************************************** - * Public data - ****************************************************************************************************/ - -#ifndef __ASSEMBLY__ - -/**************************************************************************************************** - * Public Functions - ****************************************************************************************************/ - -/**************************************************************************************************** - * 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 - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/px4/fmu-v4pro/src/can.c b/boards/px4/fmu-v4pro/src/can.c deleted file mode 100644 index 25943d5..0000000 --- a/boards/px4/fmu-v4pro/src/can.c +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file px4fmu_can.c - * - * Board-specific CAN functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include - -#include -#include - -#include "chip.h" -#include "arm_internal.h" - -#include "stm32.h" -#include "stm32_can.h" -#include "board_config.h" - -#ifdef CONFIG_CAN - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) -# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." -# undef CONFIG_STM32_CAN2 -#endif - -#ifdef CONFIG_STM32_CAN1 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); - -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} - -#endif diff --git a/boards/px4/fmu-v4pro/src/i2c.cpp b/boards/px4/fmu-v4pro/src/i2c.cpp deleted file mode 100644 index 2b70895..0000000 --- a/boards/px4/fmu-v4pro/src/i2c.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusInternal(1), - initI2CBusExternal(2), -}; diff --git a/boards/px4/fmu-v4pro/src/init.c b/boards/px4/fmu-v4pro/src/init.c deleted file mode 100644 index 132db1f..0000000 --- a/boards/px4/fmu-v4pro/src/init.c +++ /dev/null @@ -1,395 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-2016 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. - * - ****************************************************************************/ - -/** - * @file px4fmu_init.c - * - * PX4FMU-specific early startup code. This file implements the - * board_app_initializ() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include "board_config.h" -#include - -#include - -#include -#include - -#include - -#include -#include -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/**************************************************************************** - * Protected Functions - ****************************************************************************/ -/**************************************************************************** - * Public Functions - ****************************************************************************/ -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - /* set the peripheral and sensor rails off */ - stm32_gpiowrite(GPIO_VDD_3V3_PERIPH_EN, 0); - board_control_spi_sensors_power(false, 0xffff); - stm32_gpiowrite(GPIO_VDD_5V_PERIPH_EN, 1); - stm32_gpiowrite(GPIO_VDD_5V_HIPOWER_EN, 1); - - -// bool last = stm32_gpioread(GPIO_SPEKTRUM_PWR_EN); - /* Keep Spektum on to discharge rail*/ -// stm32_gpiowrite(GPIO_SPEKTRUM_PWR_EN, 1); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ -// stm32_gpiowrite(GPIO_SPEKTRUM_PWR_EN, last); - stm32_gpiowrite(GPIO_VDD_3V3_PERIPH_EN, 1); - board_control_spi_sensors_power(true, 0xffff); - stm32_gpiowrite(GPIO_VDD_5V_PERIPH_EN, 0); - stm32_gpiowrite(GPIO_VDD_5V_HIPOWER_EN, 0); -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - /* configure the GPIO pins to outputs and keep them low */ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(io_timer_channel_get_gpio_output(i)); - } - - /* On resets invoked from system (not boot) insure we establish a low - * output state (discharge the pins) on PWM pins before they become inputs. - * - * We also delay the onset of the that 3.1 Ms pulse as boot. This has - * triggered some ESC to spin. By adding this delay here the reset - * is pushed out > 400 ms. So the ESC PWM input can not mistake - * the 3.1 Ms pulse as a valid PWM command. - * - * fixme:Establish in upstream NuttX an CONFIG_IO_INIT_STATE to - * the initialize the IO lines in the clock config. - * - */ - - if (status >= 0) { - up_mdelay(400); - } -} - -/************************************************************************************ - * 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 all PWM to Low outputs */ - - board_on_reset(-1); - - /* configure LEDs */ - - board_autoled_initialize(); - - /* Start with Power off */ - board_control_spi_sensors_power_configgpio(); - - /* configure ADC pins */ - stm32_configgpio(GPIO_ADC1_IN2); /* BATT_VOLTAGE_SENS */ - stm32_configgpio(GPIO_ADC1_IN3); /* BATT_CURRENT_SENS */ - stm32_configgpio(GPIO_ADC1_IN4); /* VDD_5V_SENS */ - stm32_configgpio(GPIO_ADC1_IN11); /* BATT2_VOLTAGE_SENS */ - stm32_configgpio(GPIO_ADC1_IN13); /* BATT2_CURRENT_SENS */ - - /* configure CAN interfaces */ - - stm32_configgpio(GPIO_CAN1_RX); - stm32_configgpio(GPIO_CAN1_TX); - stm32_configgpio(GPIO_CAN2_RX); - stm32_configgpio(GPIO_CAN2_TX); - - /* configure power supply control/sense pins */ - stm32_configgpio(GPIO_VDD_3V3_PERIPH_EN); - stm32_configgpio(GPIO_VDD_5V_PERIPH_EN); - stm32_configgpio(GPIO_VDD_5V_HIPOWER_EN); - - stm32_configgpio(GPIO_nVDD_BRICK1_VALID); - stm32_configgpio(GPIO_nVDD_BRICK2_VALID); - stm32_configgpio(GPIO_nVDD_USB_VALID); - - stm32_configgpio(GPIO_VDD_5V_PERIPH_OC); - stm32_configgpio(GPIO_VDD_5V_HIPOWER_OC); - - stm32_configgpio(GPIO_SBUS_INV); - stm32_configgpio(GPIO_8266_GPIO0); -// stm32_configgpio(GPIO_SPEKTRUM_PWR_EN); - stm32_configgpio(GPIO_8266_PD); - stm32_configgpio(GPIO_8266_RST); - stm32_configgpio(GPIO_BTN_SAFETY_FMU); - - - /* configure SPI interfaces - * is deferred to board_app_initialize - * to delay the sensor power up with - * out adding a delay - */ - - stm32_usbinitialize(); - -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -static struct spi_dev_s *spi1; -static struct spi_dev_s *spi2; -static struct spi_dev_s *spi5; -static struct spi_dev_s *spi6; -static struct sdio_dev_s *sdio; - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - - /* Now it is ok to drvie the pins high - * so configure SPI CPIO */ - - // the temp cal eeprom is unused, so disable the CS from here - stm32_configgpio(GPIO_SPI_CS_TEMPCAL_EEPROM); - stm32_gpiowrite(GPIO_SPI_CS_TEMPCAL_EEPROM, 1); - stm32_spiinitialize(); - - px4_platform_init(); - - /* configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_off(LED_GREEN); - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - - /* Configure SPI-based devices */ - - spi1 = stm32_spibus_initialize(1); - - if (!spi1) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 1); - led_on(LED_RED); - } - - /* Default SPI1 to 1MHz and de-assert the known chip selects. */ - SPI_SETFREQUENCY(spi1, 10000000); - SPI_SETBITS(spi1, 8); - SPI_SETMODE(spi1, SPIDEV_MODE3); - up_udelay(20); - - /* Get the SPI port for the FRAM */ - - spi2 = stm32_spibus_initialize(2); - - if (!spi2) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 2); - led_on(LED_RED); - } - - /* Default SPI2 to 12MHz and de-assert the known chip selects. - */ - - // XXX start with 10.4 MHz and go up to 20 once validated - SPI_SETFREQUENCY(spi2, 20 * 1000 * 1000); - SPI_SETBITS(spi2, 8); - SPI_SETMODE(spi2, SPIDEV_MODE3); - - /* Configure SPI 5-based devices */ - - spi5 = stm32_spibus_initialize(5); - - if (!spi5) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 5); - led_on(LED_RED); - } - - /* Default SPI5 to 1MHz and de-assert the known chip selects. */ - SPI_SETFREQUENCY(spi5, 10000000); - SPI_SETBITS(spi5, 8); - SPI_SETMODE(spi5, SPIDEV_MODE3); - - /* Configure SPI 6-based devices */ - - spi6 = stm32_spibus_initialize(6); - - if (!spi6) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 6); - led_on(LED_RED); - } - - /* Default SPI6 to 1MHz and de-assert the known chip selects. */ - SPI_SETFREQUENCY(spi6, 10000000); - SPI_SETBITS(spi6, 8); - SPI_SETMODE(spi6, SPIDEV_MODE3); - -#ifdef CONFIG_MMCSD - /* First, get an instance of the SDIO interface */ - - sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO); - - if (!sdio) { - led_on(LED_RED); - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", CONFIG_NSH_MMCSDSLOTNO); - } - - /* Now bind the SDIO interface to the MMC/SD driver */ - int ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio); - - if (ret != OK) { - led_on(LED_RED); - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); - } - - /* Then let's guess and say that there is a card in the slot. There is no card detect GPIO. */ - sdio_mediachange(sdio, true); - -#endif - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/px4/fmu-v4pro/src/led.c b/boards/px4/fmu-v4pro/src/led.c deleted file mode 100644 index 3196e08..0000000 --- a/boards/px4/fmu-v4pro/src/led.c +++ /dev/null @@ -1,114 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013 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. - * - ****************************************************************************/ - -/** - * @file px4fmu2_led.c - * - * PX4FMU LED backend. - */ - -#include - -#include - -#include "stm32.h" -#include "board_config.h" - -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - - - -static uint32_t g_ledmap[] = { - GPIO_LED_BLUE, // Indexed by LED_BLUE - GPIO_LED_RED, // Indexed by LED_RED, LED_AMBER - 0, // Indexed by LED_SAFETY - GPIO_LED_GREEN, // Indexed by LED_GREEN -}; - -__EXPORT void led_init(void) -{ - /* Configure LED GPIOs for output */ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - if (g_ledmap[l] != 0) { - stm32_configgpio(g_ledmap[l]); - } - } -} - -static void phy_set_led(int led, bool state) -{ - /* Pull Down to switch on */ - if (g_ledmap[led] != 0) { - stm32_gpiowrite(g_ledmap[led], !state); - } -} - -static bool phy_get_led(int led) -{ - - if (g_ledmap[led] != 0) { - return !stm32_gpioread(g_ledmap[led]); - } - - return 0; -} - -__EXPORT void led_on(int led) -{ - phy_set_led(led, true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(led, false); -} - -__EXPORT void led_toggle(int led) -{ - - phy_set_led(led, !phy_get_led(led)); -} diff --git a/boards/px4/fmu-v4pro/src/mtd.cpp b/boards/px4/fmu-v4pro/src/mtd.cpp deleted file mode 100644 index 4bd9361..0000000 --- a/boards/px4/fmu-v4pro/src/mtd.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 -#include -// KiB BS nB -static const px4_mft_device_t spi2 = { // FM25V01A on FMUM 16K - .bus_type = px4_mft_device_t::SPI, - .devid = SPIDEV_FLASH(0) -}; - -static const px4_mtd_entry_t fmum_fram = { - .device = &spi2, - .npart = 1, - .partd = { - { - .type = MTD_PARAMETERS, - .path = "/fs/mtd_params", - .nblocks = 32 - }, - }, -}; - -static const px4_mtd_manifest_t board_mtd_config = { - .nconfigs = 1, - .entries = { - &fmum_fram - } -}; - -static const px4_mft_entry_s mtd_mft = { - .type = MTD, - .pmft = (void *) &board_mtd_config, -}; - -static const px4_mft_s mft = { - .nmft = 1, - .mfts = { - &mtd_mft - } -}; - -const px4_mft_s *board_get_manifest(void) -{ - return &mft; -} diff --git a/boards/px4/fmu-v4pro/src/spi.cpp b/boards/px4/fmu-v4pro/src/spi.cpp deleted file mode 100644 index faa00c9..0000000 --- a/boards/px4/fmu-v4pro/src/spi.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_MPU9250, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortC, GPIO::Pin15}, SPI::DRDY{GPIO::PortC, GPIO::Pin14}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20608G, SPI::CS{GPIO::PortC, GPIO::Pin15}, SPI::DRDY{GPIO::PortC, GPIO::Pin14}), - initSPIDevice(DRV_MAG_DEVTYPE_LIS3MDL, SPI::CS{GPIO::PortE, GPIO::Pin15}, SPI::DRDY{GPIO::PortE, GPIO::Pin12}), - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortD, GPIO::Pin7}), - }, {GPIO::PortE, GPIO::Pin3}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10}), - }), - initSPIBusExternal(SPI::Bus::SPI5, { - initSPIConfigExternal(SPI::CS{GPIO::PortF, GPIO::Pin6}), - }), - initSPIBusExternal(SPI::Bus::SPI6, { - initSPIConfigExternal(SPI::CS{GPIO::PortG, GPIO::Pin11}), - }), -}; diff --git a/boards/px4/fmu-v4pro/src/timer_config.cpp b/boards/px4/fmu-v4pro/src/timer_config.cpp deleted file mode 100644 index 5d16012..0000000 --- a/boards/px4/fmu-v4pro/src/timer_config.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1), - initIOTimer(Timer::Timer4), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortE, GPIO::Pin13}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); - diff --git a/boards/px4/fmu-v4pro/src/usb.c b/boards/px4/fmu-v4pro/src/usb.c deleted file mode 100644 index 023ec07..0000000 --- a/boards/px4/fmu-v4pro/src/usb.c +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file px4fmu_usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#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_STM32_OTGFS - stm32_configgpio(GPIO_OTGFS_VBUS); - /* XXX We only support device mode - stm32_configgpio(GPIO_OTGFS_PWRON); - stm32_configgpio(GPIO_OTGFS_OVER); - */ -#endif -} - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/px4/fmu-v4pro/test.px4board b/boards/px4/fmu-v4pro/test.px4board deleted file mode 100644 index 057de06..0000000 --- a/boards/px4/fmu-v4pro/test.px4board +++ /dev/null @@ -1,10 +0,0 @@ -CONFIG_DRIVERS_ADC_ADS1115=n -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=n -CONFIG_DRIVERS_IRLOCK=n -CONFIG_DRIVERS_PCA9685_PWM_OUT=n -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=n -CONFIG_MODULES_GYRO_FFT=n -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=n -CONFIG_BOARD_TESTING=y -CONFIG_DRIVERS_TEST_PPM=y -CONFIG_SYSTEMCMDS_MICROBENCH=y diff --git a/boards/px4/fmu-v5/cryptotest.px4board b/boards/px4/fmu-v5/cryptotest.px4board deleted file mode 100644 index c023a5c..0000000 --- a/boards/px4/fmu-v5/cryptotest.px4board +++ /dev/null @@ -1,7 +0,0 @@ -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=n -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=n -CONFIG_BOARD_CRYPTO=y -CONFIG_DRIVERS_STUB_KEYSTORE=y -CONFIG_DRIVERS_SW_CRYPTO=y -CONFIG_PUBLIC_KEY0="../../../Tools/test_keys/key0.pub" -CONFIG_PUBLIC_KEY1="../../../Tools/test_keys/rsa2048.pub" diff --git a/boards/px4/fmu-v5/cyphal.px4board b/boards/px4/fmu-v5/cyphal.px4board deleted file mode 100644 index bb753f2..0000000 --- a/boards/px4/fmu-v5/cyphal.px4board +++ /dev/null @@ -1,7 +0,0 @@ -# CONFIG_BOARD_UAVCAN_TIMER_OVERRIDE is not set -CONFIG_DRIVERS_HEATER=n -CONFIG_DRIVERS_UAVCAN=n -CONFIG_CYPHAL_BMS_SUBSCRIBER=y -CONFIG_CYPHAL_ESC_CONTROLLER=y -CONFIG_CYPHAL_UORB_SENSOR_GPS_SUBSCRIBER=y -CONFIG_DRIVERS_CYPHAL=y diff --git a/boards/px4/fmu-v5/debug.px4board b/boards/px4/fmu-v5/debug.px4board deleted file mode 100644 index 7e590cf..0000000 --- a/boards/px4/fmu-v5/debug.px4board +++ /dev/null @@ -1,47 +0,0 @@ -# CONFIG_BOARD_UAVCAN_TIMER_OVERRIDE is not set -CONFIG_COMMON_BAROMETERS=n -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=n -CONFIG_COMMON_MAGNETOMETER=n -CONFIG_DRIVERS_ADC_ADS1115=n -CONFIG_DRIVERS_BATT_SMBUS=n -CONFIG_DRIVERS_DSHOT=n -CONFIG_DRIVERS_HEATER=n -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=n -CONFIG_DRIVERS_IMU_BOSCH_BMI055=n -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=n -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=n -CONFIG_DRIVERS_IRLOCK=n -CONFIG_DRIVERS_PCA9685_PWM_OUT=n -CONFIG_DRIVERS_POWER_MONITOR_INA226=n -CONFIG_DRIVERS_PWM_INPUT=n -CONFIG_DRIVERS_SMART_BATTERY_BATMON=n -CONFIG_DRIVERS_UAVCAN=n -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=n -CONFIG_MODULES_CAMERA_FEEDBACK=n -CONFIG_MODULES_ESC_BATTERY=n -CONFIG_MODULES_GIMBAL=n -CONFIG_MODULES_GYRO_CALIBRATION=n -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=n -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=n -CONFIG_MODULES_ROVER_POS_CONTROL=n -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=n -CONFIG_MODULES_TEMPERATURE_COMPENSATION=n -CONFIG_MODULES_UUV_ATT_CONTROL=n -CONFIG_MODULES_UUV_POS_CONTROL=n -CONFIG_SYSTEMCMDS_SERIAL_TEST=n -CONFIG_BOARD_CONSTRAINED_FLASH=y -CONFIG_BOARD_TESTING=y -CONFIG_DRIVERS_BAROMETER_MS5611=y -CONFIG_DRIVERS_MAGNETOMETER_AKM_AK09916=y -CONFIG_DRIVERS_MAGNETOMETER_AKM_AK8963=y -CONFIG_DRIVERS_MAGNETOMETER_BOSCH_BMM150=y -CONFIG_DRIVERS_MAGNETOMETER_HMC5883=y -CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8308=y -CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8310=y -CONFIG_DRIVERS_MAGNETOMETER_LIS2MDL=y -CONFIG_DRIVERS_MAGNETOMETER_LIS3MDL=y -CONFIG_DRIVERS_MAGNETOMETER_LSM303AGR=y -CONFIG_DRIVERS_MAGNETOMETER_QMC5883L=y -CONFIG_DRIVERS_MAGNETOMETER_RM3100=y -CONFIG_DRIVERS_MAGNETOMETER_VTRANTECH_VCM1193L=y -CONFIG_DRIVERS_TEST_PPM=y diff --git a/boards/px4/fmu-v5/default.px4board b/boards/px4/fmu-v5/default.px4board deleted file mode 100644 index fe8b075..0000000 --- a/boards/px4/fmu-v5/default.px4board +++ /dev/null @@ -1,111 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS0" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS2" -CONFIG_BOARD_SERIAL_TEL4="/dev/ttyS3" -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_COMMON_BAROMETERS=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_HEATER=y -CONFIG_COMMON_HYGROMETERS=y -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=y -CONFIG_DRIVERS_IMU_BOSCH_BMI055=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20689=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_DRIVERS_LIGHTS_RGBLED_PWM=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_COMMON_OSD=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_PWM_INPUT=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_PX4IO=y -CONFIG_COMMON_RC=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SAFETY_BUTTON=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_BOARD_UAVCAN_TIMER_OVERRIDE=6 -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UUV_ATT_CONTROL=y -CONFIG_MODULES_UUV_POS_CONTROL=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BL_UPDATE=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SERIAL_TEST=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_FAKE_GPS=y diff --git a/boards/px4/fmu-v5/extras/px4_fmu-v5_bootloader.bin b/boards/px4/fmu-v5/extras/px4_fmu-v5_bootloader.bin deleted file mode 100644 index f5adff9..0000000 Binary files a/boards/px4/fmu-v5/extras/px4_fmu-v5_bootloader.bin and /dev/null differ diff --git a/boards/px4/fmu-v5/extras/px4_io-v2_default.bin b/boards/px4/fmu-v5/extras/px4_io-v2_default.bin deleted file mode 100755 index 957f0f1..0000000 Binary files a/boards/px4/fmu-v5/extras/px4_io-v2_default.bin and /dev/null differ diff --git a/boards/px4/fmu-v5/firmware.prototype b/boards/px4/fmu-v5/firmware.prototype deleted file mode 100644 index 8fecd6b..0000000 --- a/boards/px4/fmu-v5/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 50, - "magic": "PX4FWv1", - "description": "Firmware for the PX4FMUv5 board", - "image": "", - "build_time": 0, - "summary": "PX4FMUv5", - "version": "0.1", - "image_size": 0, - "image_maxsize": 2064384, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/px4/fmu-v5/init/rc.board_defaults b/boards/px4/fmu-v5/init/rc.board_defaults deleted file mode 100644 index 83c1976..0000000 --- a/boards/px4/fmu-v5/init/rc.board_defaults +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 18.1 -param set-default BAT2_V_DIV 18.1 - -param set-default BAT1_A_PER_V 36.367515152 -param set-default BAT2_A_PER_V 36.367515152 - -if ver hwtypecmp V5004000 V5006000 -then - param set-default SYS_USE_IO 0 -else - param set-default SYS_USE_IO 1 -fi - -if ver hwtypecmp V5005000 V5005002 V5006000 V5006002 -then - # CUAV V5+ (V550/V552) and V5nano (V560/V562) have 3 IMUs - # Multi-EKF (IMUs only) - param set-default EKF2_MULTI_IMU 3 - param set-default SENS_IMU_MODE 0 -else - # Multi-EKF - param set-default EKF2_MULTI_IMU 2 - param set-default SENS_IMU_MODE 0 -fi - -rgbled_pwm start -safety_button start diff --git a/boards/px4/fmu-v5/init/rc.board_sensors b/boards/px4/fmu-v5/init/rc.board_sensors deleted file mode 100644 index b3d53a4..0000000 --- a/boards/px4/fmu-v5/init/rc.board_sensors +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# -# PX4 FMUv5 specific board sensors init -#------------------------------------------------------------------------------ - -board_adc start - -if ver hwtypecmp V5005002 V5006002 -then - # Internal SPI bus ICM-42688-P - icm42688p -s -R 2 -q start -else - # Internal SPI bus ICM-20602 - icm20602 -s -R 2 -q start -fi - -# Internal SPI bus ICM-20689 -icm20689 -s -R 2 start - -# Internal SPI bus BMI055 accel/gyro -bmi055 -A -R 2 -s start -bmi055 -G -R 2 -s start - -# Baro on internal SPI -ms5611 -s start - -# internal compass -ist8310 -I -R 10 start - -# External compass on GPS1/I2C1 (the 3rd external bus): standard Holybro Pixhawk 4 or CUAV V5 GPS/compass puck (with lights, safety button, and buzzer) -ist8310 -X -b 1 -R 10 start diff --git a/boards/px4/fmu-v5/lto.px4board b/boards/px4/fmu-v5/lto.px4board deleted file mode 100644 index cca9cdd..0000000 --- a/boards/px4/fmu-v5/lto.px4board +++ /dev/null @@ -1 +0,0 @@ -CONFIG_BOARD_LTO=y diff --git a/boards/px4/fmu-v5/nuttx-config/Kconfig b/boards/px4/fmu-v5/nuttx-config/Kconfig deleted file mode 100644 index a7f002b..0000000 --- a/boards/px4/fmu-v5/nuttx-config/Kconfig +++ /dev/null @@ -1,17 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see misc/tools/kconfig-language.txt. -# -config BOARD_HAS_PROBES - bool "Board provides GPIO or other Hardware for signaling to timing analyze." - default y - ---help--- - This board provides GPIO FMU-CH1-8, CAP1-3 as PROBE_1-11 to provide timing signals from selected drivers. - -config BOARD_USE_PROBES - bool "Enable the use the board provided FMU-CH1-8, CAP1-3 as PROBE_1-11" - default n - depends on BOARD_HAS_PROBES - - ---help--- - Select to use GPIO FMU-CH1-8, CAP1-3 to provide timing signals from selected drivers. diff --git a/boards/px4/fmu-v5/nuttx-config/cryptotest/defconfig b/boards/px4/fmu-v5/nuttx-config/cryptotest/defconfig deleted file mode 100644 index ff995b6..0000000 --- a/boards/px4/fmu-v5/nuttx-config/cryptotest/defconfig +++ /dev/null @@ -1,267 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_FS_PROCFS_EXCLUDE_ENVIRON is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/px4/fmu-v5/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32f7" -CONFIG_ARCH_CHIP_STM32F765II=y -CONFIG_ARCH_CHIP_STM32F7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0032 -CONFIG_CDCACM_PRODUCTSTR="PX4 FMU v5.x" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="3D Robotics" -CONFIG_CRYPTO=y -CONFIG_CRYPTO_RANDOM_POOL=y -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=3 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_MODE=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32F7_ADC1=y -CONFIG_STM32F7_BBSRAM=y -CONFIG_STM32F7_BBSRAM_FILES=5 -CONFIG_STM32F7_BKPSRAM=y -CONFIG_STM32F7_DMA1=y -CONFIG_STM32F7_DMA2=y -CONFIG_STM32F7_DMACAPABLE=y -CONFIG_STM32F7_FLOWCONTROL_BROKEN=y -CONFIG_STM32F7_I2C1=y -CONFIG_STM32F7_I2C2=y -CONFIG_STM32F7_I2C3=y -CONFIG_STM32F7_I2C4=y -CONFIG_STM32F7_I2C_DYNTIMEO=y -CONFIG_STM32F7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32F7_OTGFS=y -CONFIG_STM32F7_PROGMEM=y -CONFIG_STM32F7_PWR=y -CONFIG_STM32F7_RTC=y -CONFIG_STM32F7_RTC_AUTO_LSECLOCK_START_DRV_CAPABILITY=y -CONFIG_STM32F7_RTC_MAGIC_REG=1 -CONFIG_STM32F7_SAVE_CRASHDUMP=y -CONFIG_STM32F7_SDMMC1=y -CONFIG_STM32F7_SDMMC_DMA=y -CONFIG_STM32F7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32F7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32F7_SPI1=y -CONFIG_STM32F7_SPI1_DMA=y -CONFIG_STM32F7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI2=y -CONFIG_STM32F7_SPI4=y -CONFIG_STM32F7_SPI5=y -CONFIG_STM32F7_SPI6=y -CONFIG_STM32F7_SPI_DMATHRESHOLD=8 -CONFIG_STM32F7_TIM10=y -CONFIG_STM32F7_TIM11=y -CONFIG_STM32F7_UART4=y -CONFIG_STM32F7_UART7=y -CONFIG_STM32F7_UART8=y -CONFIG_STM32F7_USART1=y -CONFIG_STM32F7_USART2=y -CONFIG_STM32F7_USART3=y -CONFIG_STM32F7_USART6=y -CONFIG_STM32F7_USART_BREAKS=y -CONFIG_STM32F7_USART_INVERT=y -CONFIG_STM32F7_USART_SINGLEWIRE=y -CONFIG_STM32F7_USART_SWAP=y -CONFIG_STM32F7_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_RXDMA=y -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_RXDMA=y -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=3000 -CONFIG_USART3_TXDMA=y -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/px4/fmu-v5/nuttx-config/cyphal/defconfig b/boards/px4/fmu-v5/nuttx-config/cyphal/defconfig deleted file mode 100644 index 9e3596c..0000000 --- a/boards/px4/fmu-v5/nuttx-config/cyphal/defconfig +++ /dev/null @@ -1,271 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_FS_PROCFS_EXCLUDE_ENVIRON is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/px4/fmu-v5/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32f7" -CONFIG_ARCH_CHIP_STM32F765II=y -CONFIG_ARCH_CHIP_STM32F7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CAN_EXTID=y -CONFIG_CAN_FIFOSIZE=32 -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0032 -CONFIG_CDCACM_PRODUCTSTR="PX4 FMU v5.x" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="3D Robotics" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=3 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_MODE=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32F7_ADC1=y -CONFIG_STM32F7_BBSRAM=y -CONFIG_STM32F7_BBSRAM_FILES=5 -CONFIG_STM32F7_BKPSRAM=y -CONFIG_STM32F7_CAN1=y -CONFIG_STM32F7_CAN1_BAUD=1000000 -CONFIG_STM32F7_CAN_TSEG1=7 -CONFIG_STM32F7_CAN_TSEG2=1 -CONFIG_STM32F7_DMA1=y -CONFIG_STM32F7_DMA2=y -CONFIG_STM32F7_DMACAPABLE=y -CONFIG_STM32F7_FLOWCONTROL_BROKEN=y -CONFIG_STM32F7_I2C1=y -CONFIG_STM32F7_I2C2=y -CONFIG_STM32F7_I2C3=y -CONFIG_STM32F7_I2C4=y -CONFIG_STM32F7_I2C_DYNTIMEO=y -CONFIG_STM32F7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32F7_OTGFS=y -CONFIG_STM32F7_PROGMEM=y -CONFIG_STM32F7_PWR=y -CONFIG_STM32F7_RTC=y -CONFIG_STM32F7_RTC_HSECLOCK=y -CONFIG_STM32F7_RTC_MAGIC_REG=1 -CONFIG_STM32F7_SAVE_CRASHDUMP=y -CONFIG_STM32F7_SDMMC1=y -CONFIG_STM32F7_SDMMC_DMA=y -CONFIG_STM32F7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32F7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32F7_SPI1=y -CONFIG_STM32F7_SPI1_DMA=y -CONFIG_STM32F7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI2=y -CONFIG_STM32F7_SPI4=y -CONFIG_STM32F7_SPI5=y -CONFIG_STM32F7_SPI6=y -CONFIG_STM32F7_SPI_DMATHRESHOLD=8 -CONFIG_STM32F7_TIM10=y -CONFIG_STM32F7_TIM11=y -CONFIG_STM32F7_UART4=y -CONFIG_STM32F7_UART7=y -CONFIG_STM32F7_UART8=y -CONFIG_STM32F7_USART1=y -CONFIG_STM32F7_USART2=y -CONFIG_STM32F7_USART3=y -CONFIG_STM32F7_USART6=y -CONFIG_STM32F7_USART_BREAKS=y -CONFIG_STM32F7_USART_INVERT=y -CONFIG_STM32F7_USART_SINGLEWIRE=y -CONFIG_STM32F7_USART_SWAP=y -CONFIG_STM32F7_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_RXDMA=y -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_RXDMA=y -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=3000 -CONFIG_USART3_TXDMA=y -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/px4/fmu-v5/nuttx-config/debug/defconfig b/boards/px4/fmu-v5/nuttx-config/debug/defconfig deleted file mode 100644 index 74f4eca..0000000 --- a/boards/px4/fmu-v5/nuttx-config/debug/defconfig +++ /dev/null @@ -1,313 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_FS_PROCFS_EXCLUDE_ENVIRON is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/px4/fmu-v5/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32f7" -CONFIG_ARCH_CHIP_STM32F765II=y -CONFIG_ARCH_CHIP_STM32F7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0032 -CONFIG_CDCACM_PRODUCTSTR="PX4 FMU v5.x" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="3D Robotics" -CONFIG_DEBUG_ASSERTIONS=y -CONFIG_DEBUG_BINFMT=y -CONFIG_DEBUG_BINFMT_ERROR=y -CONFIG_DEBUG_BINFMT_WARN=y -CONFIG_DEBUG_DMA=y -CONFIG_DEBUG_DMA_ERROR=y -CONFIG_DEBUG_DMA_WARN=y -CONFIG_DEBUG_ERROR=y -CONFIG_DEBUG_FEATURES=y -CONFIG_DEBUG_FS=y -CONFIG_DEBUG_FS_WARN=y -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_GPIO=y -CONFIG_DEBUG_GPIO_ERROR=y -CONFIG_DEBUG_GPIO_WARN=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_IRQ=y -CONFIG_DEBUG_IRQ_ERROR=y -CONFIG_DEBUG_IRQ_WARN=y -CONFIG_DEBUG_LIB=y -CONFIG_DEBUG_LIB_ERROR=y -CONFIG_DEBUG_LIB_WARN=y -CONFIG_DEBUG_MEMCARD=y -CONFIG_DEBUG_MEMCARD_ERROR=y -CONFIG_DEBUG_MEMCARD_WARN=y -CONFIG_DEBUG_MM=y -CONFIG_DEBUG_MM_ERROR=y -CONFIG_DEBUG_MM_WARN=y -CONFIG_DEBUG_POWER=y -CONFIG_DEBUG_POWER_ERROR=y -CONFIG_DEBUG_POWER_WARN=y -CONFIG_DEBUG_RTC=y -CONFIG_DEBUG_RTC_WARN=y -CONFIG_DEBUG_SCHED=y -CONFIG_DEBUG_SCHED_ERROR=y -CONFIG_DEBUG_SCHED_WARN=y -CONFIG_DEBUG_SPI=y -CONFIG_DEBUG_SPI_ERROR=y -CONFIG_DEBUG_SPI_WARN=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TIMER=y -CONFIG_DEBUG_TIMER_ERROR=y -CONFIG_DEBUG_TIMER_WARN=y -CONFIG_DEBUG_USB=y -CONFIG_DEBUG_USB_ERROR=y -CONFIG_DEBUG_USB_WARN=y -CONFIG_DEBUG_WARN=y -CONFIG_DEBUG_WATCHDOG=y -CONFIG_DEBUG_WATCHDOG_ERROR=y -CONFIG_DEBUG_WATCHDOG_WARN=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=1064 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=3 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1300 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1728 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_MODE=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32F7_ADC1=y -CONFIG_STM32F7_BBSRAM=y -CONFIG_STM32F7_BBSRAM_FILES=5 -CONFIG_STM32F7_BKPSRAM=y -CONFIG_STM32F7_DMA1=y -CONFIG_STM32F7_DMA2=y -CONFIG_STM32F7_FLOWCONTROL_BROKEN=y -CONFIG_STM32F7_I2C1=y -CONFIG_STM32F7_I2C2=y -CONFIG_STM32F7_I2C3=y -CONFIG_STM32F7_I2C4=y -CONFIG_STM32F7_I2C_DYNTIMEO=y -CONFIG_STM32F7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32F7_OTGFS=y -CONFIG_STM32F7_PROGMEM=y -CONFIG_STM32F7_PWR=y -CONFIG_STM32F7_RTC=y -CONFIG_STM32F7_RTC_AUTO_LSECLOCK_START_DRV_CAPABILITY=y -CONFIG_STM32F7_RTC_MAGIC_REG=1 -CONFIG_STM32F7_SAVE_CRASHDUMP=y -CONFIG_STM32F7_SDMMC1=y -CONFIG_STM32F7_SDMMC_DMA=y -CONFIG_STM32F7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32F7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32F7_SPI1=y -CONFIG_STM32F7_SPI1_DMA=y -CONFIG_STM32F7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI2=y -CONFIG_STM32F7_SPI4=y -CONFIG_STM32F7_SPI5=y -CONFIG_STM32F7_SPI6=y -CONFIG_STM32F7_SPI_DMATHRESHOLD=8 -CONFIG_STM32F7_TIM10=y -CONFIG_STM32F7_TIM11=y -CONFIG_STM32F7_UART4=y -CONFIG_STM32F7_UART7=y -CONFIG_STM32F7_UART8=y -CONFIG_STM32F7_USART1=y -CONFIG_STM32F7_USART2=y -CONFIG_STM32F7_USART3=y -CONFIG_STM32F7_USART6=y -CONFIG_STM32F7_USART_BREAKS=y -CONFIG_STM32F7_USART_INVERT=y -CONFIG_STM32F7_USART_SINGLEWIRE=y -CONFIG_STM32F7_USART_SWAP=y -CONFIG_STM32F7_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TESTING_OSTEST=y -CONFIG_TESTING_OSTEST_FPUTESTDISABLE=y -CONFIG_TESTING_OSTEST_STACKSIZE=10240 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_RXDMA=y -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_RXDMA=y -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=3000 -CONFIG_USART3_TXDMA=y -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/px4/fmu-v5/nuttx-config/include/board.h b/boards/px4/fmu-v5/nuttx-config/include/board.h deleted file mode 100644 index de1fb20..0000000 --- a/boards/px4/fmu-v5/nuttx-config/include/board.h +++ /dev/null @@ -1,470 +0,0 @@ -/************************************************************************************ - * nuttx-configs/px4_fmu-v5/include/board.h - * - * Copyright (C) 2016-2018 Gregory Nutt. All rights reserved. - * Authors: David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ -#ifndef __NUTTX_CONFIG_PX4_FMU_V5_INCLUDE_BOARD_H -#define __NUTTX_CONFIG_PX4_FMU_V5_INCLUDE_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The px4_fmu-v5 board provides the following clock sources: - * - * X301: 16 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 16 MHz RC factory-trimmed - * HSE: 16 MHz crystal for HSE - */ - -#define STM32_BOARD_XTAL 16000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 0 - -/* Main PLL Configuration. - * - * PLL source is HSE = 16,000,000 - * - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 2 <= PLLM <= 63 - * 192 <= PLLN <= 432 - * 192 MHz <= PLL_VCO <= 432MHz - * - * SYSCLK = PLL_VCO / PLLP - * Subject to - * - * PLLP = {2, 4, 6, 8} - * SYSCLK <= 216 MHz - * - * USB OTG FS, SDMMC and RNG Clock = PLL_VCO / PLLQ - * Subject to - * The USB OTG FS requires a 48 MHz clock to work correctly. The SDMMC - * and the random number generator need a frequency lower than or equal - * to 48 MHz to work correctly. - * - * 2 <= PLLQ <= 15 - */ - -/* Highest SYSCLK with USB OTG FS clock = 48 MHz - * - * PLL_VCO = (16,000,000 / 8) * 216 = 432 MHz - * SYSCLK = 432 MHz / 2 = 216 MHz - * USB OTG FS, SDMMC and RNG Clock = 432 MHz / 9 = 48 MHz - */ - -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(8) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(216) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(9) - -#define STM32_VCO_FREQUENCY ((STM32_HSE_FREQUENCY / 8) * 216) -#define STM32_SYSCLK_FREQUENCY (STM32_VCO_FREQUENCY / 2) -#define STM32_OTGFS_FREQUENCY (STM32_VCO_FREQUENCY / 9) - -/* Configure factors for PLLSAI clock */ - -#define CONFIG_STM32F7_PLLSAI 1 -#define STM32_RCC_PLLSAICFGR_PLLSAIN RCC_PLLSAICFGR_PLLSAIN(192) -#define STM32_RCC_PLLSAICFGR_PLLSAIP RCC_PLLSAICFGR_PLLSAIP(8) -#define STM32_RCC_PLLSAICFGR_PLLSAIQ RCC_PLLSAICFGR_PLLSAIQ(4) -#define STM32_RCC_PLLSAICFGR_PLLSAIR RCC_PLLSAICFGR_PLLSAIR(2) - -/* Configure Dedicated Clock Configuration Register */ - -#define STM32_RCC_DCKCFGR1_PLLI2SDIVQ RCC_DCKCFGR1_PLLI2SDIVQ(1) -#define STM32_RCC_DCKCFGR1_PLLSAIDIVQ RCC_DCKCFGR1_PLLSAIDIVQ(1) -#define STM32_RCC_DCKCFGR1_PLLSAIDIVR RCC_DCKCFGR1_PLLSAIDIVR(0) -#define STM32_RCC_DCKCFGR1_SAI1SRC RCC_DCKCFGR1_SAI1SEL(0) -#define STM32_RCC_DCKCFGR1_SAI2SRC RCC_DCKCFGR1_SAI2SEL(0) -#define STM32_RCC_DCKCFGR1_TIMPRESRC 0 -#define STM32_RCC_DCKCFGR1_DFSDM1SRC 0 -#define STM32_RCC_DCKCFGR1_ADFSDM1SRC 0 - - - -/* Configure factors for PLLI2S clock */ - -#define CONFIG_STM32F7_PLLI2S 1 -#define STM32_RCC_PLLI2SCFGR_PLLI2SN RCC_PLLI2SCFGR_PLLI2SN(192) -#define STM32_RCC_PLLI2SCFGR_PLLI2SP RCC_PLLI2SCFGR_PLLI2SP(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SQ RCC_PLLI2SCFGR_PLLI2SQ(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SR RCC_PLLI2SCFGR_PLLI2SR(2) - -/* Configure Dedicated Clock Configuration Register 2 */ - -#define STM32_RCC_DCKCFGR2_USART1SRC RCC_DCKCFGR2_USART1SEL_APB -#define STM32_RCC_DCKCFGR2_USART2SRC RCC_DCKCFGR2_USART2SEL_APB -#define STM32_RCC_DCKCFGR2_UART4SRC RCC_DCKCFGR2_UART4SEL_APB -#define STM32_RCC_DCKCFGR2_UART5SRC RCC_DCKCFGR2_UART5SEL_APB -#define STM32_RCC_DCKCFGR2_USART6SRC RCC_DCKCFGR2_USART6SEL_APB -#define STM32_RCC_DCKCFGR2_UART7SRC RCC_DCKCFGR2_UART7SEL_APB -#define STM32_RCC_DCKCFGR2_UART8SRC RCC_DCKCFGR2_UART8SEL_APB -#define STM32_RCC_DCKCFGR2_I2C1SRC RCC_DCKCFGR2_I2C1SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C2SRC RCC_DCKCFGR2_I2C2SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C3SRC RCC_DCKCFGR2_I2C3SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C4SRC RCC_DCKCFGR2_I2C4SEL_HSI -#define STM32_RCC_DCKCFGR2_LPTIM1SRC RCC_DCKCFGR2_LPTIM1SEL_APB -#define STM32_RCC_DCKCFGR2_CECSRC RCC_DCKCFGR2_CECSEL_HSI -#define STM32_RCC_DCKCFGR2_CK48MSRC RCC_DCKCFGR2_CK48MSEL_PLL -#define STM32_RCC_DCKCFGR2_SDMMCSRC RCC_DCKCFGR2_SDMMCSEL_48MHZ -#define STM32_RCC_DCKCFGR2_SDMMC2SRC RCC_DCKCFGR2_SDMMC2SEL_48MHZ -#define STM32_RCC_DCKCFGR2_DSISRC RCC_DCKCFGR2_DSISEL_PHY - - -/* Several prescalers allow the configuration of the two AHB buses, the - * high-speed APB (APB2) and the low-speed APB (APB1) domains. The maximum - * frequency of the two AHB buses is 216 MHz while the maximum frequency of - * the high-speed APB domains is 108 MHz. The maximum allowed frequency of - * the low-speed APB domain is 54 MHz. - */ - -/* AHB clock (HCLK) is SYSCLK (216 MHz) */ - -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (54 MHz) */ - -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (108MHz) */ - -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* SDMMC dividers. Note that slower clocking is required when DMA is disabled - * in order to avoid RX overrun/TX underrun errors due to delayed responses - * to service FIFOs in interrupt driven mode. These values have not been - * tuned!!! - * - * SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(118+2)=400 KHz - */ - -/* Use the Falling edge of the SDIO_CLK clock to change the edge the - * data and commands are change on - */ - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - -#define STM32_SDMMC_INIT_CLKDIV (118 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* DMA ON: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(1+2)=16 MHz - * DMA OFF: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32F7_SDMMC_DMA -# define STM32_SDMMC_MMCXFR_CLKDIV (1 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (2 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -/* DMA ON: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(1+2)=16 MHz - * DMA OFF: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(2+2)=12 MHz - */ -//TODO #warning "Check Freq for 24mHz" - -#ifdef CONFIG_STM32F7_SDMMC_DMA -# define STM32_SDMMC_SDXFR_CLKDIV (1 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (2 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -/* FLASH wait states - * - * --------- ---------- ----------- - * VDD MAX SYSCLK WAIT STATES - * --------- ---------- ----------- - * 1.7-2.1 V 180 MHz 8 - * 2.1-2.4 V 216 MHz 9 - * 2.4-2.7 V 216 MHz 8 - * 2.7-3.6 V 216 MHz 7 - * --------- ---------- ----------- - */ - -#define BOARD_FLASH_WAITSTATES 7 - -/* LED definitions ******************************************************************/ -/* The px4_fmu-v5 board has numerous LEDs but only three, LED_GREEN a Green LED, LED_BLUE - * a Blue LED and LED_RED a Red LED, that can be controlled by software. - * - * If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any way. - * The following definitions are used to access individual LEDs. - */ - -/* LED index values for use with board_userled() */ - -#define BOARD_LED1 0 -#define BOARD_LED2 1 -#define BOARD_LED3 2 -#define BOARD_NLEDS 3 - -#define BOARD_LED_RED BOARD_LED1 -#define BOARD_LED_GREEN BOARD_LED2 -#define BOARD_LED_BLUE BOARD_LED3 - -/* LED bits for use with board_userled_all() */ - -#define BOARD_LED1_BIT (1 << BOARD_LED1) -#define BOARD_LED2_BIT (1 << BOARD_LED2) -#define BOARD_LED3_BIT (1 << BOARD_LED3) - -/* If CONFIG_ARCH_LEDS is defined, the usage by the board port is defined in - * include/board.h and src/stm32_leds.c. The LEDs are used to encode OS-related - * events as follows: - * - * - * SYMBOL Meaning LED state - * Red Green Blue - * ---------------------- -------------------------- ------ ------ ----*/ - -#define LED_STARTED 0 /* NuttX has been started OFF OFF OFF */ -#define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF OFF ON */ -#define LED_IRQSENABLED 2 /* Interrupts enabled OFF ON OFF */ -#define LED_STACKCREATED 3 /* Idle stack created OFF ON ON */ -#define LED_INIRQ 4 /* In an interrupt N/C N/C GLOW */ -#define LED_SIGNAL 5 /* In a signal handler N/C GLOW N/C */ -#define LED_ASSERTION 6 /* An assertion failed GLOW N/C GLOW */ -#define LED_PANIC 7 /* The system has crashed Blink OFF N/C */ -#define LED_IDLE 8 /* MCU is is sleep mode ON OFF OFF */ - -/* Thus if the Green LED is statically on, NuttX has successfully booted and - * is, apparently, running normally. If the Red LED is flashing at - * approximately 2Hz, then a fatal error has been detected and the system - * has halted. - */ - -/* Alternate function pin selections ************************************************/ - -#define GPIO_USART1_RX GPIO_USART1_RX_2 /* PB7 */ -#define GPIO_USART1_TX GPIO_USART1_TX_2 /* PB6 */ - -#define GPIO_USART2_RX GPIO_USART2_RX_2 /* PD6 */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 /* PD4 */ -#define GPIO_USART2_CTS GPIO_USART2_CTS_2 /* PD3 */ - -#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ -#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ -#define GPIO_USART3_RTS GPIO_USART3_RTS_2 /* PD12 */ -#define GPIO_USART3_CTS GPIO_USART3_CTS_2 /* PD11 */ - -#define GPIO_UART4_RX GPIO_UART4_RX_4 /* PD0 */ -#define GPIO_UART4_TX GPIO_UART4_TX_4 /* PD1 */ - -#define GPIO_USART6_RX GPIO_USART6_RX_2 /* PG9 */ -#define GPIO_USART6_TX GPIO_USART6_TX_2 /* PG14 */ -#define GPIO_USART6_RTS GPIO_USART6_RTS_2 /* PG8 */ -#define GPIO_USART6_CTS GPIO_USART6_CTS_2 /* PG15 */ - -#define GPIO_UART7_RX GPIO_UART7_RX_2 /* PF6 */ -#define GPIO_UART7_TX GPIO_UART7_TX_1 /* PE8 */ - -/* USART8: has no remap - * - * GPIO_UART8_RX PE0[CN12-64] - * GPIO_UART8_TX PE1[CN11-61] - */ - -/* CAN - * - * CAN1 is routed to transceiver. - * CAN2 is routed to transceiver. - * CAN3 is routed to transceiver. - */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_5 /* PI9 */ -#define GPIO_CAN1_TX GPIO_CAN1_TX_4 /* PH13 */ -#define GPIO_CAN2_RX GPIO_CAN2_RX_1 /* PB12 */ -#define GPIO_CAN2_TX GPIO_CAN2_TX_1 /* PB13 */ -#define GPIO_CAN3_RX GPIO_CAN3_RX_1 /* PA8 */ -#define GPIO_CAN3_TX GPIO_CAN3_TX_1 /* PA15 */ - -/* SPI - * SPI1 sensors - * SPI2 is FRAM. - * SPI4 is BARO - * SPI6 Reserved - * - */ - -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_3 /* PD7 */ -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_3 /* PG11 */ - -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_3 /* PI2 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_3 /* PI3 */ -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_5 /* PI1 */ - -#define GPIO_SPI4_MISO GPIO_SPI4_MISO_2 /* PE13 */ -#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_1 /* PE6 */ -#define GPIO_SPI4_SCK GPIO_SPI4_SCK_1 /* PE2 */ - -#define GPIO_SPI5_MISO GPIO_SPI5_MISO_1 /* PF8 */ -#define GPIO_SPI5_MOSI GPIO_SPI5_MOSI_1 /* PF9 */ -#define GPIO_SPI5_SCK GPIO_SPI5_SCK_1 /* PF7 */ - -#define GPIO_SPI6_MISO GPIO_SPI6_MISO_1 /* PG12 */ -#define GPIO_SPI6_MOSI GPIO_SPI6_MOSI_3 /* PB5 */ -#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, - * but are normally-high GPIOs. - * - */ - -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 /* PB8] */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 /* PB9 */ - -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_2 /* PF1 */ -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_2 /* PF0 */ - -#define GPIO_I2C3_SCL GPIO_I2C3_SCL_2 /* PH7 */ -#define GPIO_I2C3_SDA GPIO_I2C3_SDA_2 /* PH8 */ - -#define GPIO_I2C4_SCL GPIO_I2C4_SCL_2 /* PF14 */ -#define GPIO_I2C4_SDA GPIO_I2C4_SDA_2 /* PF15 */ - -/* SDMMC1 - * - * VDD 3.3 - * GND - * SDMMC1_CK PC12 - * SDMMC1_CMD PD2 - * SDMMC1_D0 PC8 - * SDMMC1_D1 PC9 - * SDMMC1_D2 PC10 - * SDMMC1_D3 PC11 - * GPIO_SDMMC1_NCD PG0 - */ - -/* USB - * - * OTG_FS_DM PA11 - * OTG_FS_DP PA12 - * VBUS PA9 - */ - - -/* Board provides GPIO or other Hardware for signaling to timing analyzer */ - -#if defined(CONFIG_BOARD_USE_PROBES) -# include "stm32_gpio.h" -# define PROBE_N(n) (1<<((n)-1)) -# define PROBE_1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN14) /* PE14 AUX1 */ -# define PROBE_2 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN10) /* PA10 AUX2 */ -# define PROBE_3 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN11) /* PE11 AUX3 */ -# define PROBE_4 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN9) /* PE9 AUX4 */ -# define PROBE_5 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN13) /* PD13 AUX5 */ -# define PROBE_6 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN14) /* PD14 AUX6 */ -# define PROBE_7 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN6) /* PH6 AUX7 */ -# define PROBE_8 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN9) /* PH9 AUX8 */ -# define PROBE_9 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN5) /* PA5 CAP1 */ -# define PROBE_10 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN3) /* PB3 CAP2 */ -# define PROBE_11 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN11) /* PB11 CAP3 */ - -# define PROBE_INIT(mask) \ - do { \ - if ((mask)& PROBE_N(1)) { stm32_configgpio(PROBE_1); } \ - if ((mask)& PROBE_N(2)) { stm32_configgpio(PROBE_2); } \ - if ((mask)& PROBE_N(3)) { stm32_configgpio(PROBE_3); } \ - if ((mask)& PROBE_N(4)) { stm32_configgpio(PROBE_4); } \ - if ((mask)& PROBE_N(5)) { stm32_configgpio(PROBE_5); } \ - if ((mask)& PROBE_N(6)) { stm32_configgpio(PROBE_6); } \ - if ((mask)& PROBE_N(7)) { stm32_configgpio(PROBE_7); } \ - if ((mask)& PROBE_N(8)) { stm32_configgpio(PROBE_8); } \ - if ((mask)& PROBE_N(9)) { stm32_configgpio(PROBE_9); } \ - if ((mask)& PROBE_N(10)) { stm32_configgpio(PROBE_10); } \ - if ((mask)& PROBE_N(11)) { stm32_configgpio(PROBE_11); } \ - } while(0) - -# define PROBE(n,s) do {stm32_gpiowrite(PROBE_##n,(s));}while(0) -# define PROBE_MARK(n) PROBE(n,false);PROBE(n,true) -#else -# define PROBE_INIT(mask) -# define PROBE(n,s) -# define PROBE_MARK(n) -#endif - -#endif /*__NUTTX_CONFIG_PX4_FMU_V5_INCLUDE_BOARD_H */ diff --git a/boards/px4/fmu-v5/nuttx-config/include/board_dma_map.h b/boards/px4/fmu-v5/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 2a017ed..0000000 --- a/boards/px4/fmu-v5/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/* -| DMA1 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | SPI3_RX_1 | SPDIFRX_DT | SPI3_RX_2 | SPI2_RX | SPI2_TX | SPI3_TX_1 | SPDIFRX_CS | SPI3_TX_2 | -| Channel 1 | I2C1_RX | I2C3_RX | TIM7_UP_1 | - | TIM7_UP_2 | I2C1_RX_1 | I2C1_TX | I2C1_TX_1 | -| Channel 2 | TIM4_CH1 | - | I2C4_RX | TIM4_CH2 | - | I2C4_TX | TIM4_UP | TIM4_CH3 | -| Channel 3 | - | TIM2_UP_1 | I2C3_RX_1 | - | I2C3_TX | TIM2_CH1 | TIM2_CH2 | TIM2_UP_2 | -| | | TIM2_CH3 | | | | | TIM2_CH4_1 | TIM2_CH4_2 | -| Channel 4 | UART5_RX | USART3_RX | UART4_RX | USART3_TX_1 | UART4_TX | USART2_RX | USART2_TX | UART5_TX | -| Channel 5 | UART8_TX | UART7_TX | TIM3_CH4 | UART7_RX | TIM3_CH1 | TIM3_CH2 | UART8_RX | TIM3_CH3 | -| | | | TIM3_UP | | TIM3_TRIG | | | | -| Channel 6 | TIM5_CH3 | TIM5_CH4_1 | TIM5_CH1 | TIM5_CH4_2 | TIM5_CH2 | - | TIM5_UP_2 | - | -| | TIM5_UP_1 | TIM5_TRIG_1 | | TIM5_TRIG_2 | | | | | -| Channel 7 | - | TIM6_UP | I2C2_RX | I2C2_RX_1 | USART3_TX_2 | DAC1 | DAC2 | I2C2_TX | -| Channel 8 | I2C3_TX_1 | I2C4_RX_1 | - | - | I2C2_TX_1 | - | I2C4_TX_1 | - | -| Channel 9 | - | SPI2_RX | - | - | - | - | SPI2_TX | - | -| | | | | | | | | | -| Usage | UART8_TX | USART3_RX | UART4_RX | USART3_TX_1 | | USART2_RX | UART8_RX | | - - -| DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | ADC1_1 | SAI1_A | TIM8_CH1_1 | SAI1_A_2 | ADC1_2 | SAI1_B_1 | TIM1_CH1_1 | SAI1_B_2 | -| | | | TIM8_CH2_1 | | | | TIM1_CH2_1 | | -| | | | TIM8_CH3_1 | | | | TIM1_CH3_1 | | -| Channel 1 | - | DCMI_1 | ADC2_1 | ADC2_2 | SAI1_B | SPI6_TX | SPI6_RX | DCMI_2 | -| Channel 2 | ADC3_1 | ADC3_2 | - | SPI5_RX_1 | SPI5_TX_1 | CRYP_OUT | CRYP_IN | HASH_IN | -| Channel 3 | SPI1_RX_1 | - | SPI1_RX_2 | SPI1_TX_1 | SAI2_A | SPI1_TX_2 | SAI2_B | QUADSPI | -| Channel 4 | SPI4_RX_1 | SPI4_TX_1 | USART1_RX_1 | SDMMC1_1 | - | USART1_RX_2 | SDMMC1_2 | USART1_TX | -| Channel 5 | - | USART6_RX_1 | USART6_RX_2 | SPI4_RX_2 | SPI4_TX_2 | - | USART6_TX_1 | USART6_TX_2 | -| Channel 6 | TIM1_TRIG_1 | TIM1_CH1_2 | TIM1_CH2_2 | TIM1_CH1 | TIM1_CH4 | TIM1_UP | TIM1_CH3_2 | - | -| | | | | | TIM1_TRIG_2 | | | | -| | | | | | TIM1_COM | | | | -| Channel 7 | - | TIM8_UP | TIM8_CH1_2 | TIM8_CH2_2 | TIM8_CH3_2 | SPI5_RX_2 | SPI5_TX_2 | TIM8_CH4 | -| | | | | | | | | TIM8_TRIG | -| | | | | | | | | TIM8_COM | -| Channel 8 | DFSDM1_FLT0_1 | DFSDM1_FLT1_1 | DFSDM1_FLT2_1 | DFSDM1_FLT3_1 | DFSDM1_FLT0_2 | DFSDM1_FLT1_2 | DFSDM1_FLT2_2 | DFSDM1_FLT3_2 | -| Channel 9 | JPEG_IN_1 | JPEG_OUT | SPI4_TX_3 | JPEG_IN_2 | JPEG_OUT_2 | SPI5_RX_3 | - | - | -| Channel 10 | SAI1_B_3 | SAI2_B_1 | SAI2_A_1 | - | - | - | SAI1_A_3 | - | -| Channel 11 | SDMMC2_1 | - | QUADSPI_1 | - | - | SDMMC2_2 | - | - | -| | | | | | | | | | -| Usage | SPI1_RX_1 | | USART6_RX_2 | SPI1_TX_1 | | TIM1_UP | SDMMC1_2 | | - */ - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// DMAMAP_UART8_TX // DMA1, Stream 0, Channel 5 (PX4IO TX) -// DMAMAP_USART3_RX // DMA1, Stream 1, Channel 4 (TELEM2 RX) -// DMAMAP_UART4_RX // DMA1, Stream 2, Channel 4 (TELEM4 RX) -#define DMAMAP_USART3_TX DMAMAP_USART3_TX_1 // DMA1, Stream 3, Channel 4 (TELEM2 TX) -// DMAMAP_USART2_RX // DMA1, Stream 5, Channel 4 (TELEM1 RX) -// DMAMAP_UART8_RX // DMA1, Stream 6, Channel 5 (PX4IO RX) - - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMAMAP_SPI1_RX DMAMAP_SPI1_RX_1 // DMA2, Stream 0, Channel 3 (SPI sensors RX) -// AVAILABLE // DMA2, Stream 1 -#define DMAMAP_USART6_RX DMAMAP_USART6_RX_2 // DMA2, Stream 2, Channel 5 -#define DMAMAP_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 3, Channel 3 (SPI sensors TX) -// AVAILABLE // DMA2, Stream 4 -// DMAMAP_TIM1_UP // DMA2, Stream 5, Channel 6 (DSHOT) -#define DMAMAP_SDMMC1 DMAMAP_SDMMC1_2 // DMA2, Stream 6, Channel 4 -// AVAILABLE // DMA2, Stream 7 diff --git a/boards/px4/fmu-v5/nuttx-config/nsh/defconfig b/boards/px4/fmu-v5/nuttx-config/nsh/defconfig deleted file mode 100644 index b045396..0000000 --- a/boards/px4/fmu-v5/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,265 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_FS_PROCFS_EXCLUDE_ENVIRON is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/px4/fmu-v5/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32f7" -CONFIG_ARCH_CHIP_STM32F765II=y -CONFIG_ARCH_CHIP_STM32F7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0032 -CONFIG_CDCACM_PRODUCTSTR="PX4 FMU v5.x" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="3D Robotics" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXAMPLES_CALIB_UDELAY=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=3 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_MODE=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32F7_ADC1=y -CONFIG_STM32F7_BBSRAM=y -CONFIG_STM32F7_BBSRAM_FILES=5 -CONFIG_STM32F7_BKPSRAM=y -CONFIG_STM32F7_DMA1=y -CONFIG_STM32F7_DMA2=y -CONFIG_STM32F7_DMACAPABLE=y -CONFIG_STM32F7_FLOWCONTROL_BROKEN=y -CONFIG_STM32F7_I2C1=y -CONFIG_STM32F7_I2C2=y -CONFIG_STM32F7_I2C3=y -CONFIG_STM32F7_I2C4=y -CONFIG_STM32F7_I2C_DYNTIMEO=y -CONFIG_STM32F7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32F7_OTGFS=y -CONFIG_STM32F7_PROGMEM=y -CONFIG_STM32F7_PWR=y -CONFIG_STM32F7_RTC=y -CONFIG_STM32F7_RTC_AUTO_LSECLOCK_START_DRV_CAPABILITY=y -CONFIG_STM32F7_RTC_MAGIC_REG=1 -CONFIG_STM32F7_SAVE_CRASHDUMP=y -CONFIG_STM32F7_SDMMC1=y -CONFIG_STM32F7_SDMMC_DMA=y -CONFIG_STM32F7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32F7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32F7_SPI1=y -CONFIG_STM32F7_SPI1_DMA=y -CONFIG_STM32F7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI2=y -CONFIG_STM32F7_SPI4=y -CONFIG_STM32F7_SPI5=y -CONFIG_STM32F7_SPI6=y -CONFIG_STM32F7_SPI_DMATHRESHOLD=8 -CONFIG_STM32F7_TIM10=y -CONFIG_STM32F7_TIM11=y -CONFIG_STM32F7_UART4=y -CONFIG_STM32F7_UART7=y -CONFIG_STM32F7_UART8=y -CONFIG_STM32F7_USART1=y -CONFIG_STM32F7_USART2=y -CONFIG_STM32F7_USART3=y -CONFIG_STM32F7_USART6=y -CONFIG_STM32F7_USART_BREAKS=y -CONFIG_STM32F7_USART_INVERT=y -CONFIG_STM32F7_USART_SINGLEWIRE=y -CONFIG_STM32F7_USART_SWAP=y -CONFIG_STM32F7_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_RXDMA=y -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_RXDMA=y -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=3000 -CONFIG_USART3_TXDMA=y -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/px4/fmu-v5/nuttx-config/protected/defconfig b/boards/px4/fmu-v5/nuttx-config/protected/defconfig deleted file mode 100644 index 1902014..0000000 --- a/boards/px4/fmu-v5/nuttx-config/protected/defconfig +++ /dev/null @@ -1,271 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_FS_PROCFS_EXCLUDE_ENVIRON is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/px4/fmu-v5/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32f7" -CONFIG_ARCH_CHIP_STM32F765II=y -CONFIG_ARCH_CHIP_STM32F7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_ARM_MPU_NREGIONS=8 -CONFIG_BOARDCTL_IOCTL=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILD_PROTECTED=y -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0032 -CONFIG_CDCACM_PRODUCTSTR="PX4 FMU v5.x" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="3D Robotics" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="px4_entry" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_LIBC_USRWORK=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_KERNEL_HEAPSIZE=131072 -CONFIG_MM_REGIONS=3 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_NUTTX_USERSPACE=0x08100000 -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_MODE=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32F7_ADC1=y -CONFIG_STM32F7_BBSRAM=y -CONFIG_STM32F7_BBSRAM_FILES=5 -CONFIG_STM32F7_BKPSRAM=y -CONFIG_STM32F7_DMA1=y -CONFIG_STM32F7_DMA2=y -CONFIG_STM32F7_DMACAPABLE=y -CONFIG_STM32F7_FLOWCONTROL_BROKEN=y -CONFIG_STM32F7_I2C1=y -CONFIG_STM32F7_I2C2=y -CONFIG_STM32F7_I2C3=y -CONFIG_STM32F7_I2C4=y -CONFIG_STM32F7_I2C_DYNTIMEO=y -CONFIG_STM32F7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32F7_OTGFS=y -CONFIG_STM32F7_PROGMEM=y -CONFIG_STM32F7_PWR=y -CONFIG_STM32F7_RTC=y -CONFIG_STM32F7_RTC_AUTO_LSECLOCK_START_DRV_CAPABILITY=y -CONFIG_STM32F7_RTC_MAGIC_REG=1 -CONFIG_STM32F7_SAVE_CRASHDUMP=y -CONFIG_STM32F7_SDMMC1=y -CONFIG_STM32F7_SDMMC_DMA=y -CONFIG_STM32F7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32F7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32F7_SPI1=y -CONFIG_STM32F7_SPI1_DMA=y -CONFIG_STM32F7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI2=y -CONFIG_STM32F7_SPI4=y -CONFIG_STM32F7_SPI5=y -CONFIG_STM32F7_SPI6=y -CONFIG_STM32F7_SPI_DMATHRESHOLD=8 -CONFIG_STM32F7_TIM10=y -CONFIG_STM32F7_TIM11=y -CONFIG_STM32F7_UART4=y -CONFIG_STM32F7_UART7=y -CONFIG_STM32F7_UART8=y -CONFIG_STM32F7_USART1=y -CONFIG_STM32F7_USART2=y -CONFIG_STM32F7_USART3=y -CONFIG_STM32F7_USART6=y -CONFIG_STM32F7_USART_BREAKS=y -CONFIG_STM32F7_USART_INVERT=y -CONFIG_STM32F7_USART_SINGLEWIRE=y -CONFIG_STM32F7_USART_SWAP=y -CONFIG_STM32F7_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_RXDMA=y -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_RXDMA=y -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=3000 -CONFIG_USART3_TXDMA=y -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/px4/fmu-v5/nuttx-config/scripts/kernel-space.ld b/boards/px4/fmu-v5/nuttx-config/scripts/kernel-space.ld deleted file mode 100644 index 8ad6e7b..0000000 --- a/boards/px4/fmu-v5/nuttx-config/scripts/kernel-space.ld +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************************** - * kernel-space.ld - * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* NOTE: This depends on the memory.ld script having been included prior to - * this script. - */ - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) -/* - * TODO: Fill in the signature location into TOC from user-space elf -EXTERN(_main_toc) -*/ - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - /* - *(.main_toc) - */ - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - } > kflash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > kflash - - - .ARM.extab : { - *(.ARM.extab*) - } > kflash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > kflash - - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > ksram AT > kflash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > ksram - - /* Stabs debugging sections */ - - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } - - .ramfunc : { - _sramfuncs = .; - *(.ramfunc .ramfunc.*) - . = ALIGN(4); - _eramfuncs = .; - } > ksram AT > kflash - - _framfuncs = LOADADDR(.ramfunc); -} diff --git a/boards/px4/fmu-v5/nuttx-config/scripts/memory.ld b/boards/px4/fmu-v5/nuttx-config/scripts/memory.ld deleted file mode 100644 index 23e536e..0000000 --- a/boards/px4/fmu-v5/nuttx-config/scripts/memory.ld +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** - * scripts/memory.ld - * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F765IIT6 has 2048 KiB of main FLASH memory. This FLASH memory - * can be accessed from either the AXIM interface at address 0x0800:0000 or - * from the ITCM interface at address 0x0020:0000. - * - * Additional information, including the option bytes, is available at at - * FLASH at address 0x1ff0:0000 (AXIM) or 0x0010:0000 (ITCM). - * - * In the STM32F765IIT6, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash on ITCM at 0x0020:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x0010:0000 - * - * NuttX does not modify these option byes. On the unmodified NUCLEO-144 - * board, the BOOT0 pin is at ground so by default, the STM32F765IIT6 will - * boot from address 0x0020:0000 in ITCM FLASH. - * - * The STM32F765IIT6 also has 512 KiB of data SRAM (in addition to ITCM SRAM). - * SRAM is split up into three blocks: - * - * 1) 128 KiB of DTCM SRM beginning at address 0x2000:0000 - * 2) 368 KiB of SRAM1 beginning at address 0x2002:0000 - * 3) 16 KiB of SRAM2 beginning at address 0x2007:c000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * Bootloader reserves the first 32K bank (2 Mbytes Flash memory single bank) - * organization (256 bits read width) - */ - -MEMORY -{ - /* ITCM boot address */ - - itcm (rwx) : ORIGIN = 0x00208000, LENGTH = 2048K-32K - - /* 2048KB FLASH, bootloader reserves the first 32kb */ - - kflash (rx) : ORIGIN = 0x08008000, LENGTH = 1024K-32K - uflash (rx) : ORIGIN = 0x08100000, LENGTH = 1024K - - /* ITCM RAM */ - - itcm_ram (rwx) : ORIGIN = 0x00000000, LENGTH = 16K - - /* DTCM SRAM */ - - dtcm_ram (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - - /* 368KB of contiguous SRAM1 */ - - ksram (rwx) : ORIGIN = 0x20020000, LENGTH = 128K - usram (rwx) : ORIGIN = 0x20040000, LENGTH = 368K-128K - - /* 16KB of SRAM2 */ - - sram2 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K -} diff --git a/boards/px4/fmu-v5/nuttx-config/scripts/script.ld b/boards/px4/fmu-v5/nuttx-config/scripts/script.ld deleted file mode 100644 index d73a97d..0000000 --- a/boards/px4/fmu-v5/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,190 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F765IIT6 has 2048 KiB of main FLASH memory. This FLASH memory - * can be accessed from either the AXIM interface at address 0x0800:0000 or - * from the ITCM interface at address 0x0020:0000. - * - * Additional information, including the option bytes, is available at at - * FLASH at address 0x1ff0:0000 (AXIM) or 0x0010:0000 (ITCM). - * - * In the STM32F765IIT6, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash on ITCM at 0x0020:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x0010:0000 - * - * NuttX does not modify these option byes. On the unmodified NUCLEO-144 - * board, the BOOT0 pin is at ground so by default, the STM32F765IIT6 will - * boot from address 0x0020:0000 in ITCM FLASH. - * - * The STM32F765IIT6 also has 512 KiB of data SRAM (in addition to ITCM SRAM). - * SRAM is split up into three blocks: - * - * 1) 128 KiB of DTCM SRM beginning at address 0x2000:0000 - * 2) 368 KiB of SRAM1 beginning at address 0x2002:0000 - * 3) 16 KiB of SRAM2 beginning at address 0x2007:c000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * Bootloader reserves the first 32K bank (2 Mbytes Flash memory single bank) - * organization (256 bits read width) - */ - -MEMORY -{ - FLASH_ITCM (rx) : ORIGIN = 0x00208000, LENGTH = 2016K - FLASH_AXIM (rx) : ORIGIN = 0x08008000, LENGTH = 2016K - - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 16K - DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - SRAM1 (rwx) : ORIGIN = 0x20020000, LENGTH = 368K - SRAM2 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) -EXTERN(_main_toc) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.main_toc) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH_AXIM - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH_AXIM - - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH_AXIM - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH_AXIM - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > SRAM1 AT > FLASH_AXIM - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > SRAM1 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } - - .ramfunc : { - _sramfuncs = .; - *(.ramfunc .ramfunc.*) - . = ALIGN(4); - _eramfuncs = .; - } > ITCM_RAM AT > FLASH_AXIM - - _framfuncs = LOADADDR(.ramfunc); - - /* Start of the image signature. This - * has to be in the end of the image - */ - .signature : { - _boot_signature = ALIGN(4); - } > FLASH_AXIM -} diff --git a/boards/px4/fmu-v5/nuttx-config/scripts/user-space.ld b/boards/px4/fmu-v5/nuttx-config/scripts/user-space.ld deleted file mode 100644 index e19ddea..0000000 --- a/boards/px4/fmu-v5/nuttx-config/scripts/user-space.ld +++ /dev/null @@ -1,124 +0,0 @@ -/**************************************************************************** - * user-space.ld - * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* NOTE: This depends on the memory.ld script having been included prior to - * this script. - */ -EXTERN(userspace) -OUTPUT_ARCH(arm) -SECTIONS -{ - .userspace : { - *(.userspace) - } > uflash - - .text : { - _stext = ABSOLUTE(.); - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - } > uflash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > uflash - - - .ARM.extab : { - *(.ARM.extab*) - } > uflash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > uflash - - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > usram AT > uflash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - /* Kernel heap start at _ebss, make _ebss MPU-friendly aligned */ - . = ALIGN(0x1000); - _ebss = ABSOLUTE(.); - } > usram - - /* Stabs debugging sections */ - - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } - - /* Start of the image signature. This - * has to be in the end of the image - */ - .signature : { - _boot_signature = ALIGN(4); - } > uflash -} diff --git a/boards/px4/fmu-v5/nuttx-config/stackcheck/defconfig b/boards/px4/fmu-v5/nuttx-config/stackcheck/defconfig deleted file mode 100644 index c5450ab..0000000 --- a/boards/px4/fmu-v5/nuttx-config/stackcheck/defconfig +++ /dev/null @@ -1,266 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_FS_PROCFS_EXCLUDE_ENVIRON is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/px4/fmu-v5/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32f7" -CONFIG_ARCH_CHIP_STM32F765II=y -CONFIG_ARCH_CHIP_STM32F7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_STACKCHECK=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0032 -CONFIG_CDCACM_PRODUCTSTR="PX4 FMU v5.x" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="3D Robotics" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=878 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=3 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_MODE=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32F7_ADC1=y -CONFIG_STM32F7_BBSRAM=y -CONFIG_STM32F7_BBSRAM_FILES=5 -CONFIG_STM32F7_BKPSRAM=y -CONFIG_STM32F7_DMA1=y -CONFIG_STM32F7_DMA2=y -CONFIG_STM32F7_DMACAPABLE=y -CONFIG_STM32F7_FLOWCONTROL_BROKEN=y -CONFIG_STM32F7_I2C1=y -CONFIG_STM32F7_I2C2=y -CONFIG_STM32F7_I2C3=y -CONFIG_STM32F7_I2C4=y -CONFIG_STM32F7_I2C_DYNTIMEO=y -CONFIG_STM32F7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32F7_OTGFS=y -CONFIG_STM32F7_PROGMEM=y -CONFIG_STM32F7_PWR=y -CONFIG_STM32F7_RTC=y -CONFIG_STM32F7_RTC_AUTO_LSECLOCK_START_DRV_CAPABILITY=y -CONFIG_STM32F7_RTC_MAGIC_REG=1 -CONFIG_STM32F7_SAVE_CRASHDUMP=y -CONFIG_STM32F7_SDMMC1=y -CONFIG_STM32F7_SDMMC_DMA=y -CONFIG_STM32F7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32F7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32F7_SPI1=y -CONFIG_STM32F7_SPI1_DMA=y -CONFIG_STM32F7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI2=y -CONFIG_STM32F7_SPI4=y -CONFIG_STM32F7_SPI5=y -CONFIG_STM32F7_SPI6=y -CONFIG_STM32F7_SPI_DMATHRESHOLD=8 -CONFIG_STM32F7_TIM10=y -CONFIG_STM32F7_TIM11=y -CONFIG_STM32F7_UART4=y -CONFIG_STM32F7_UART7=y -CONFIG_STM32F7_UART8=y -CONFIG_STM32F7_USART1=y -CONFIG_STM32F7_USART2=y -CONFIG_STM32F7_USART3=y -CONFIG_STM32F7_USART6=y -CONFIG_STM32F7_USART_BREAKS=y -CONFIG_STM32F7_USART_INVERT=y -CONFIG_STM32F7_USART_SINGLEWIRE=y -CONFIG_STM32F7_USART_SWAP=y -CONFIG_STM32F7_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_RXDMA=y -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_RXDMA=y -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=3000 -CONFIG_USART3_TXDMA=y -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/px4/fmu-v5/nuttx-config/test/defconfig b/boards/px4/fmu-v5/nuttx-config/test/defconfig deleted file mode 100644 index 357c5b2..0000000 --- a/boards/px4/fmu-v5/nuttx-config/test/defconfig +++ /dev/null @@ -1,268 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_FS_PROCFS_EXCLUDE_ENVIRON is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/px4/fmu-v5/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32f7" -CONFIG_ARCH_CHIP_STM32F765II=y -CONFIG_ARCH_CHIP_STM32F7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0032 -CONFIG_CDCACM_PRODUCTSTR="PX4 FMU v5.x" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="3D Robotics" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXAMPLES_CALIB_UDELAY=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=3 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_MODE=y -CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32F7_ADC1=y -CONFIG_STM32F7_BBSRAM=y -CONFIG_STM32F7_BBSRAM_FILES=5 -CONFIG_STM32F7_BKPSRAM=y -CONFIG_STM32F7_DMA1=y -CONFIG_STM32F7_DMA2=y -CONFIG_STM32F7_DMACAPABLE=y -CONFIG_STM32F7_FLOWCONTROL_BROKEN=y -CONFIG_STM32F7_I2C1=y -CONFIG_STM32F7_I2C2=y -CONFIG_STM32F7_I2C3=y -CONFIG_STM32F7_I2C4=y -CONFIG_STM32F7_I2C_DYNTIMEO=y -CONFIG_STM32F7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32F7_OTGFS=y -CONFIG_STM32F7_PROGMEM=y -CONFIG_STM32F7_PWR=y -CONFIG_STM32F7_RTC=y -CONFIG_STM32F7_RTC_AUTO_LSECLOCK_START_DRV_CAPABILITY=y -CONFIG_STM32F7_RTC_MAGIC_REG=1 -CONFIG_STM32F7_SAVE_CRASHDUMP=y -CONFIG_STM32F7_SDMMC1=y -CONFIG_STM32F7_SDMMC_DMA=y -CONFIG_STM32F7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32F7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32F7_SPI1=y -CONFIG_STM32F7_SPI1_DMA=y -CONFIG_STM32F7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI2=y -CONFIG_STM32F7_SPI4=y -CONFIG_STM32F7_SPI5=y -CONFIG_STM32F7_SPI6=y -CONFIG_STM32F7_SPI_DMATHRESHOLD=8 -CONFIG_STM32F7_TIM10=y -CONFIG_STM32F7_TIM11=y -CONFIG_STM32F7_UART4=y -CONFIG_STM32F7_UART7=y -CONFIG_STM32F7_UART8=y -CONFIG_STM32F7_USART1=y -CONFIG_STM32F7_USART2=y -CONFIG_STM32F7_USART3=y -CONFIG_STM32F7_USART6=y -CONFIG_STM32F7_USART_BREAKS=y -CONFIG_STM32F7_USART_INVERT=y -CONFIG_STM32F7_USART_SINGLEWIRE=y -CONFIG_STM32F7_USART_SWAP=y -CONFIG_STM32F7_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TESTING_OSTEST=y -CONFIG_TESTING_OSTEST_FPUTESTDISABLE=y -CONFIG_TESTING_OSTEST_STACKSIZE=10240 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_RXDMA=y -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_RXDMA=y -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=3000 -CONFIG_USART3_TXDMA=y -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/px4/fmu-v5/protected.px4board b/boards/px4/fmu-v5/protected.px4board deleted file mode 100644 index de913d6..0000000 --- a/boards/px4/fmu-v5/protected.px4board +++ /dev/null @@ -1,45 +0,0 @@ -# CONFIG_BOARD_UAVCAN_TIMER_OVERRIDE is not set -CONFIG_COMMON_BAROMETERS=n -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=n -CONFIG_COMMON_DISTANCE_SENSOR=n -CONFIG_COMMON_OPTICAL_FLOW=n -CONFIG_COMMON_TELEMETRY=n -CONFIG_DRIVERS_CAMERA_CAPTURE=n -CONFIG_DRIVERS_CAMERA_TRIGGER=n -CONFIG_DRIVERS_IRLOCK=n -CONFIG_DRIVERS_PCA9685_PWM_OUT=n -CONFIG_DRIVERS_PWM_INPUT=n -CONFIG_DRIVERS_UAVCAN=n -CONFIG_EXAMPLES_FAKE_GPS=n -CONFIG_MODULES_AIRSPEED_SELECTOR=n -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=n -CONFIG_MODULES_CAMERA_FEEDBACK=n -CONFIG_MODULES_ESC_BATTERY=n -CONFIG_MODULES_FW_ATT_CONTROL=n -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=n -CONFIG_MODULES_FW_POS_CONTROL=n -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=n -CONFIG_MODULES_ROVER_POS_CONTROL=n -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=n -CONFIG_MODULES_TEMPERATURE_COMPENSATION=n -CONFIG_MODULES_UUV_ATT_CONTROL=n -CONFIG_MODULES_UUV_POS_CONTROL=n -CONFIG_MODULES_VTOL_ATT_CONTROL=n -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=n -CONFIG_SYSTEMCMDS_BL_UPDATE=n -CONFIG_SYSTEMCMDS_DMESG=n -CONFIG_SYSTEMCMDS_DUMPFILE=n -CONFIG_SYSTEMCMDS_GPIO=n -CONFIG_SYSTEMCMDS_I2CDETECT=n -CONFIG_SYSTEMCMDS_LED_CONTROL=n -CONFIG_SYSTEMCMDS_MTD=n -CONFIG_SYSTEMCMDS_NSHTERM=n -CONFIG_SYSTEMCMDS_REFLECT=n -CONFIG_SYSTEMCMDS_SD_BENCH=n -CONFIG_SYSTEMCMDS_SD_STRESS=n -CONFIG_SYSTEMCMDS_SERIAL_TEST=n -CONFIG_SYSTEMCMDS_SYSTEM_TIME=n -CONFIG_SYSTEMCMDS_USB_CONNECTED=n -CONFIG_BOARD_PROTECTED=y -CONFIG_DRIVERS_BAROMETER_MS5611=y -CONFIG_DRIVERS_DISTANCE_SENSOR_LL40LS=y diff --git a/boards/px4/fmu-v5/src/CMakeLists.txt b/boards/px4/fmu-v5/src/CMakeLists.txt deleted file mode 100644 index 5323380..0000000 --- a/boards/px4/fmu-v5/src/CMakeLists.txt +++ /dev/null @@ -1,72 +0,0 @@ -############################################################################ -# -# Copyright (c) 2016 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. -# -############################################################################ - -add_library(board_bus_info - i2c.cpp - spi.cpp -) -add_dependencies(board_bus_info nuttx_context) - -add_library(drivers_board - can.c - init.c - led.c - manifest.c - sdio.c - timer_config.cpp - usb.c - toc.c -) -add_dependencies(drivers_board nuttx_context) - -target_link_libraries(drivers_board - PRIVATE - arch_board_hw_info - arch_io_pins - arch_spi - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio -) - -if (NOT DEFINED CONFIG_BUILD_FLAT) - target_link_libraries(drivers_board PRIVATE px4_kernel_layer) -else() - target_link_libraries(drivers_board PRIVATE px4_layer board_bus_info) -endif() - -add_library(drivers_userspace - stm32_userspace.c -) - -add_dependencies(drivers_userspace nuttx_context) diff --git a/boards/px4/fmu-v5/src/board_config.h b/boards/px4/fmu-v5/src/board_config.h deleted file mode 100644 index 8246664..0000000 --- a/boards/px4/fmu-v5/src/board_config.h +++ /dev/null @@ -1,505 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2016 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * PX4FMU-v5 internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include -#include - -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ - -/* PX4IO connection configuration */ - -#define BOARD_USES_PX4IO_VERSION 2 -#define PX4IO_SERIAL_DEVICE "/dev/ttyS6" -#define PX4IO_SERIAL_TX_GPIO GPIO_UART8_TX -#define PX4IO_SERIAL_RX_GPIO GPIO_UART8_RX -#define PX4IO_SERIAL_BASE STM32_UART8_BASE -#define PX4IO_SERIAL_VECTOR STM32_IRQ_UART8 -#define PX4IO_SERIAL_TX_DMAMAP DMAMAP_UART8_TX -#define PX4IO_SERIAL_RX_DMAMAP DMAMAP_UART8_RX -#define PX4IO_SERIAL_RCC_REG STM32_RCC_APB1ENR -#define PX4IO_SERIAL_RCC_EN RCC_APB1ENR_UART8EN -#define PX4IO_SERIAL_CLOCK STM32_PCLK1_FREQUENCY -#define PX4IO_SERIAL_BITRATE 1500000 /* 1.5Mbps -> max rate for IO */ - -/* Configuration ************************************************************************************/ - -#define BOARD_HAS_LTC4417 - -#if defined(BOARD_HAS_LTC4417) -# define BOARD_HAS_LTC44XX_VALIDS 2 // No LTC or N Bricks -# define BOARD_HAS_USB_VALID 1 // LTC Has No USB valid -# define BOARD_HAS_NBAT_V 2 // Only one Vbat to ADC -# define BOARD_HAS_NBAT_I 2 // No Ibat ADC -#else -# define BOARD_HAS_LTC44XX_VALIDS 0 // No LTC or N Bricks -# define BOARD_HAS_USB_VALID 0 // LTC Has No USB valid -# define BOARD_HAS_NBAT_V 1 // Only one Vbat to ADC -# define BOARD_HAS_NBAT_I 0 // No Ibat ADC -#endif - -/* PX4FMU GPIOs ***********************************************************************************/ - -/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */ - -#define GPIO_nLED_RED /* PB1 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN1) -#define GPIO_nLED_GREEN /* PC6 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN6) -#define GPIO_nLED_BLUE /* PC7 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN7) - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_OVERLOAD_LED LED_RED -#define BOARD_ARMED_STATE_LED LED_BLUE - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that - * can be used by the Px4 Firmware in the adc driver - */ - -/* ADC defines to be used in sensors.cpp to read from a particular channel */ - -#define ADC1_CH(n) (n) -#define ADC1_GPIO(n) GPIO_ADC1_IN##n - -/* Define GPIO pins used as ADC N.B. Channel numbers must match below */ - -#define PX4_ADC_GPIO \ - /* PA0 */ ADC1_GPIO(0), \ - /* PA1 */ ADC1_GPIO(1), \ - /* PA2 */ ADC1_GPIO(2), \ - /* PA3 */ ADC1_GPIO(3), \ - /* PA4 */ ADC1_GPIO(4), \ - /* PB8 */ ADC1_GPIO(8), \ - /* PC0 */ ADC1_GPIO(10), \ - /* PC1 */ ADC1_GPIO(11), \ - /* PC2 */ ADC1_GPIO(12), \ - /* PC3 */ ADC1_GPIO(13), \ - /* PC4 */ ADC1_GPIO(14) - -/* Define Channel numbers must match above GPIO pin IN(n)*/ - -#define ADC_BATTERY1_VOLTAGE_CHANNEL /* PA0 */ ADC1_CH(0) -#define ADC_BATTERY1_CURRENT_CHANNEL /* PA1 */ ADC1_CH(1) -#define ADC_BATTERY2_VOLTAGE_CHANNEL /* PA2 */ ADC1_CH(2) -#define ADC_BATTERY2_CURRENT_CHANNEL /* PA3 */ ADC1_CH(3) -#define ADC1_SPARE_2_CHANNEL /* PA4 */ ADC1_CH(4) -#define ADC_RSSI_IN_CHANNEL /* PB0 */ ADC1_CH(8) -#define ADC_SCALED_V5_CHANNEL /* PC0 */ ADC1_CH(10) -#define ADC_SCALED_VDD_3V3_SENSORS_CHANNEL /* PC1 */ ADC1_CH(11) -#define ADC_HW_VER_SENSE_CHANNEL /* PC2 */ ADC1_CH(12) -#define ADC_HW_REV_SENSE_CHANNEL /* PC3 */ ADC1_CH(13) -#define ADC1_SPARE_1_CHANNEL /* PC4 */ ADC1_CH(14) - -#if BOARD_HAS_NBAT_V == 2 && BOARD_HAS_NBAT_I == 2 -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY1_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY1_CURRENT_CHANNEL) | \ - (1 << ADC_BATTERY2_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY2_CURRENT_CHANNEL) | \ - (1 << ADC1_SPARE_2_CHANNEL) | \ - (1 << ADC_RSSI_IN_CHANNEL) | \ - (1 << ADC_SCALED_V5_CHANNEL) | \ - (1 << ADC_SCALED_VDD_3V3_SENSORS_CHANNEL) | \ - (1 << ADC_HW_VER_SENSE_CHANNEL) | \ - (1 << ADC_HW_REV_SENSE_CHANNEL) | \ - (1 << ADC1_SPARE_1_CHANNEL)) -#elif BOARD_HAS_NBAT_V == 1 && BOARD_HAS_NBAT_I == 1 -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY1_VOLTAGE_CHANNEL) | \ - (1 << ADC_BATTERY1_CURRENT_CHANNEL) | \ - (1 << ADC1_SPARE_2_CHANNEL) | \ - (1 << ADC_RSSI_IN_CHANNEL) | \ - (1 << ADC_SCALED_V5_CHANNEL) | \ - (1 << ADC_SCALED_VDD_3V3_SENSORS_CHANNEL) | \ - (1 << ADC_HW_VER_SENSE_CHANNEL) | \ - (1 << ADC_HW_REV_SENSE_CHANNEL) | \ - (1 << ADC1_SPARE_1_CHANNEL)) -#elif BOARD_HAS_NBAT_V == 1 && BOARD_HAS_NBAT_I == 0 -#define ADC_CHANNELS \ - ((1 << ADC_BATTERY1_VOLTAGE_CHANNEL) | \ - (1 << ADC1_SPARE_2_CHANNEL) | \ - (1 << ADC_RSSI_IN_CHANNEL) | \ - (1 << ADC_SCALED_V5_CHANNEL) | \ - (1 << ADC_SCALED_VDD_3V3_SENSORS_CHANNEL) | \ - (1 << ADC_HW_VER_SENSE_CHANNEL) | \ - (1 << ADC_HW_REV_SENSE_CHANNEL) | \ - (1 << ADC1_SPARE_1_CHANNEL)) -#endif - -/* HW has to large of R termination on ADC todo:change when HW value is chosen */ -#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f) - -/* HW Version and Revision drive signals Default to 1 to detect */ -#define BOARD_HAS_HW_VERSIONING - -#define GPIO_HW_REV_DRIVE /* PH14 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTH|GPIO_PIN14) -#define GPIO_HW_REV_SENSE /* PC3 */ ADC1_GPIO(13) -#define GPIO_HW_VER_DRIVE /* PG0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN0) -#define GPIO_HW_VER_SENSE /* PC2 */ ADC1_GPIO(12) - -#define HW_INFO_INIT_PREFIX "V5" -#define BOARD_NUM_SPI_CFG_HW_VERSIONS 3 -#define V500 HW_VER_REV(0x0,0x0) // FMUV5, Rev 0 -#define V515 HW_VER_REV(0x1,0x5) // CUAV V5, Rev 5 -#define V540 HW_VER_REV(0x4,0x0) // HolyBro mini no can 2,3, Rev 0 -#define V550 HW_VER_REV(0x5,0x0) // CUAV V5+, Rev 0 -#define V552 HW_VER_REV(0x5,0x2) // CUAV V5+ ICM42688P, Rev 2 -#define V560 HW_VER_REV(0x6,0x0) // CUAV V5nano with can 2, Rev 0 -#define V562 HW_VER_REV(0x6,0x2) // CUAV V5nano ICM42688P, Rev 2 - -/* CAN Silence - * - * Silent mode control \ ESC Mux select - */ - -#define GPIO_CAN1_SILENT_S0 /* PH2 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN2) -#define GPIO_CAN2_SILENT_S1 /* PH3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN3) -#define GPIO_CAN3_SILENT_S2 /* PH4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN4) - -#define UAVCAN_NUM_IFACES_RUNTIME 1 - -/* HEATER - * PWM in future - */ -#define GPIO_HEATER_OUTPUT /* PA7 T14CH1 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN7) -#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true)) - - -/* PI0 is nARMED - * The GPIO will be set as input while not armed HW will have external HW Pull UP. - * While armed it shall be configured at a GPIO OUT set LOW - */ -#define GPIO_nARMED_INIT /* PI0 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTI|GPIO_PIN0) -#define GPIO_nARMED /* PI0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTI|GPIO_PIN0) - -/* For protected build, define the LOCKOUT_STATE macros as function calls */ -#ifdef CONFIG_BUILD_FLAT -#define BOARD_INDICATE_EXTERNAL_LOCKOUT_STATE(enabled) px4_arch_configgpio((enabled) ? GPIO_nARMED : GPIO_nARMED_INIT) -#define BOARD_GET_EXTERNAL_LOCKOUT_STATE() px4_arch_gpioread(GPIO_nARMED) -#else -#define BOARD_INDICATE_EXTERNAL_LOCKOUT_STATE(enabled) boardctrl_indicate_external_lockout_state(enabled) -#define BOARD_GET_EXTERNAL_LOCKOUT_STATE() boardctrl_get_external_lockout_state() -#endif - -/* PWM - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 11 - -#define BOARD_HAS_LED_PWM 1 -#define BOARD_LED_PWM_DRIVE_ACTIVE_LOW 1 - -#define BOARD_HAS_UI_LED_PWM 1 - -#define BOARD_UI_LED_PWM_DRIVE_ACTIVE_LOW 1 - - -/* Power supply control and monitoring GPIOs */ - -#define GPIO_nPOWER_IN_A /* PG1 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN1) -#define GPIO_nPOWER_IN_B /* PG2 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN2) -#define GPIO_nPOWER_IN_C /* PG3 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN3) - -#define GPIO_nVDD_BRICK1_VALID GPIO_nPOWER_IN_A /* Brick 1 Is Chosen */ -#define GPIO_nVDD_BRICK2_VALID GPIO_nPOWER_IN_B /* Brick 2 Is Chosen */ -#define BOARD_NUMBER_BRICKS 2 -#define GPIO_nVDD_USB_VALID GPIO_nPOWER_IN_C /* USB Is Chosen */ - -#define GPIO_nVDD_5V_PERIPH_EN /* PG4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN4) -#define GPIO_nVDD_5V_PERIPH_OC /* PE15 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTE|GPIO_PIN15) -#define GPIO_nVDD_5V_HIPOWER_EN /* PF12 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTF|GPIO_PIN12) -#define GPIO_nVDD_5V_HIPOWER_OC /* PF13 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTF|GPIO_PIN13) -#define GPIO_VDD_3V3_SPEKTRUM_POWER_EN /* PE4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN4) -#define GPIO_VDD_3V3_SPEKTRUM_PASSIVE /* PE4 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN4) -#define GPIO_VDD_5V_RC_EN /* PG5 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN5) -#define GPIO_VDD_5V_WIFI_EN /* PG6 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN5) -#define GPIO_VDD_3V3_SD_CARD_EN /* PG7 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN7) - - -/* Define True logic Power Control in arch agnostic form */ - -#define VDD_5V_PERIPH_EN(on_true) px4_arch_gpiowrite(GPIO_nVDD_5V_PERIPH_EN, !(on_true)) -#define VDD_5V_HIPOWER_EN(on_true) px4_arch_gpiowrite(GPIO_nVDD_5V_HIPOWER_EN, !(on_true)) -#define VDD_3V3_SPEKTRUM_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SPEKTRUM_POWER_EN, (on_true)) -#define READ_VDD_3V3_SPEKTRUM_POWER_EN() px4_arch_gpioread(GPIO_VDD_3V3_SPEKTRUM_POWER_EN) -#define VDD_5V_RC_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_RC_EN, (on_true)) -#define VDD_5V_WIFI_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_WIFI_EN, (on_true)) -#define VDD_3V3_SD_CARD_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SD_CARD_EN, (on_true)) - -/* Tone alarm output */ - -#define TONE_ALARM_TIMER 9 /* timer 9 */ -#define TONE_ALARM_CHANNEL 1 /* PE5 TIM9_CH1 */ - -#define GPIO_BUZZER_1 /* PE5 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN5) - -#define GPIO_TONE_ALARM_IDLE GPIO_BUZZER_1 -#define GPIO_TONE_ALARM GPIO_TIM9_CH1OUT_2 - -/* USB OTG FS - * - * PA9 OTG_FS_VBUS VBUS sensing - */ -#define GPIO_OTGFS_VBUS /* PA9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 8 /* use timer8 for the HRT */ -#define HRT_TIMER_CHANNEL 3 /* use capture/compare channel 3 */ - -#define HRT_PPM_CHANNEL /* T8C1 */ 1 /* use capture/compare channel 1 */ -#define GPIO_PPM_IN /* PI5 T8C1 */ GPIO_TIM8_CH1IN_2 - -/* RC Serial port */ - -#define RC_SERIAL_PORT "/dev/ttyS4" -#define RC_SERIAL_SINGLEWIRE -#define BOARD_SUPPORTS_RC_SERIAL_PORT_OUTPUT - -/* PWM input driver. Use FMU AUX5 pins attached to timer4 channel 2 */ -#define PWMIN_TIMER 4 -#define PWMIN_TIMER_CHANNEL /* T4C2 */ 2 -#define GPIO_PWM_IN /* PD13 */ GPIO_TIM4_CH2IN_2 - -/* Shared pins Both FMU and PX4IO control/monitor - * FMU Initializes these pins to passive input until it is known - * if we have and PX4IO on board - */ - -#define GPIO_RSSI_IN /* PB0 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN0) -#define GPIO_RSSI_IN_INIT /* PB0 */ 0 /* Leave as ADC RSSI_IN */ - -/* Safety Switch is HW version dependent on having an PX4IO - * So we init to a benign state with the _INIT definition - * and provide the the non _INIT one for the driver to make a run time - * decision to use it. - */ -#define GPIO_nSAFETY_SWITCH_LED_OUT_INIT /* PE12 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTE|GPIO_PIN12) -#define GPIO_nSAFETY_SWITCH_LED_OUT /* PE12 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN12) - -/* Enable the FMU to control it if there is no px4io fixme:This should be BOARD_SAFETY_LED(__ontrue) */ -#define GPIO_LED_SAFETY GPIO_nSAFETY_SWITCH_LED_OUT -#define GPIO_SAFETY_SWITCH_IN /* PE10 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN10) -/* Enable the FMU to use the switch it if there is no px4io fixme:This should be BOARD_SAFTY_BUTTON() */ -#define GPIO_BTN_SAFETY GPIO_SAFETY_SWITCH_IN /* Enable the FMU to control it if there is no px4io */ - -/* Power switch controls ******************************************************/ - -#define SPEKTRUM_POWER(_on_true) VDD_3V3_SPEKTRUM_POWER_EN(_on_true) -#define SPEKTRUM_POWER_PASSIVE() px4_arch_configgpio(GPIO_VDD_3V3_SPEKTRUM_PASSIVE) -#define SPEKTRUM_POWER_CONFIG() px4_arch_configgpio(GPIO_VDD_3V3_SPEKTRUM_POWER_EN) - -/* - * FMUv5 has a separate RC_IN - * - * GPIO PPM_IN on PI5 T8CH1 - * SPEKTRUM_RX (it's TX or RX in Bind) on UART6 PG9 (NOT FMUv5 test HW ONLY) - * In version is possible in the UART - * and can drive GPIO PPM_IN as an output - */ - -#define GPIO_PPM_IN_AS_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTI|GPIO_PIN5) -#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_PPM_IN_AS_OUT) -#define SPEKTRUM_RX_AS_UART() /* Can be left as uart */ -#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true)) - -#define SDIO_SLOTNO 0 /* Only one slot */ -#define SDIO_MINOR 0 - -/* SD card bringup does not work if performed on the IDLE thread because it - * will cause waiting. Use either: - * - * CONFIG_BOARDCTL=y, OR - * CONFIG_BOARD_INITIALIZE=y && CONFIG_BOARD_INITTHREAD=y - */ - -#if defined(CONFIG_BOARD_INITIALIZE) && !defined(CONFIG_BOARDCTL) && \ - !defined(CONFIG_BOARD_INITTHREAD) -# warning SDIO initialization cannot be perfomed on the IDLE thread -#endif - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) - -#if BOARD_HAS_USB_VALID == 1 -# define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID)) -#else -# define BOARD_ADC_USB_VALID BOARD_ADC_USB_CONNECTED -#endif - -/* FMUv5 never powers odd the Servo rail */ - -#define BOARD_ADC_SERVO_VALID (1) - -#if !defined(BOARD_HAS_LTC44XX_VALIDS) || BOARD_HAS_LTC44XX_VALIDS == 0 -# define BOARD_ADC_BRICK1_VALID (1) -# define BOARD_ADC_BRICK2_VALID (0) -#elif BOARD_HAS_LTC44XX_VALIDS == 1 -# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -# define BOARD_ADC_BRICK2_VALID (0) -#elif BOARD_HAS_LTC44XX_VALIDS == 2 -# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -# define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID)) -#elif BOARD_HAS_LTC44XX_VALIDS == 3 -# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -# define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID)) -# define BOARD_ADC_BRICK3_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK3_VALID)) -#elif BOARD_HAS_LTC44XX_VALIDS == 4 -# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -# define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID)) -# define BOARD_ADC_BRICK3_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK3_VALID)) -# define BOARD_ADC_BRICK4_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK4_VALID)) -#else -# error Unsupported BOARD_HAS_LTC44XX_VALIDS value -#endif - -#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_nVDD_5V_PERIPH_OC)) -#define BOARD_ADC_HIPOWER_5V_OC (!px4_arch_gpioread(GPIO_nVDD_5V_HIPOWER_OC)) - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ - -#define BOARD_HAS_ON_RESET 1 - -#define PX4_GPIO_INIT_LIST { \ - 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, \ - GPIO_nPOWER_IN_C, \ - GPIO_nVDD_5V_PERIPH_EN, \ - GPIO_nVDD_5V_PERIPH_OC, \ - GPIO_nVDD_5V_HIPOWER_EN, \ - GPIO_nVDD_5V_HIPOWER_OC, \ - GPIO_VDD_3V3_SPEKTRUM_POWER_EN, \ - GPIO_VDD_5V_RC_EN, \ - GPIO_VDD_5V_WIFI_EN, \ - GPIO_VDD_3V3_SD_CARD_EN, \ - GPIO_TONE_ALARM_IDLE, \ - GPIO_RSSI_IN_INIT, \ - 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 - -#define BOARD_NUM_IO_TIMERS 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 - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/px4/fmu-v5/src/can.c b/boards/px4/fmu-v5/src/can.c deleted file mode 100644 index fb3ecce..0000000 --- a/boards/px4/fmu-v5/src/can.c +++ /dev/null @@ -1,151 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file can.c - * - * Board-specific CAN functions. - */ - -#if !defined(CONFIG_CAN) - -#include - -#include "board_config.h" - - -__EXPORT -uint16_t board_get_can_interfaces(void) -{ - uint16_t enabled_interfaces = 0x7; - - if (!PX4_MFT_HW_SUPPORTED(PX4_MFT_CAN2)) { - enabled_interfaces &= ~(1 << 1); - } - - if (!PX4_MFT_HW_SUPPORTED(PX4_MFT_CAN3)) { - enabled_interfaces &= ~(1 << 2); - } - - return enabled_interfaces; -} - -#else - -#include -#include - -#include -#include - -#include "chip.h" -#include "arm_internal.h" - -#include "chip.h" -#include "stm32_can.h" -#include "board_config.h" - -#ifdef CONFIG_CAN - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) -# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." -# undef CONFIG_STM32_CAN2 -#endif - -#ifdef CONFIG_STM32_CAN1 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); - -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} - -#endif - -#endif /* CONFIG_CAN */ diff --git a/boards/px4/fmu-v5/src/i2c.cpp b/boards/px4/fmu-v5/src/i2c.cpp deleted file mode 100644 index a74041d..0000000 --- a/boards/px4/fmu-v5/src/i2c.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(4), - initI2CBusExternal(2), - initI2CBusExternal(1), - initI2CBusInternal(3), -}; diff --git a/boards/px4/fmu-v5/src/init.c b/boards/px4/fmu-v5/src/init.c deleted file mode 100644 index cfec81b..0000000 --- a/boards/px4/fmu-v5/src/init.c +++ /dev/null @@ -1,287 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-2019 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * PX4FMU-specific early startup code. This file implements the - * board_app_initializ() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include "board_config.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ -#define _GPIO_PULL_DOWN_INPUT(def) (((def) & (GPIO_PORT_MASK | GPIO_PIN_MASK)) | (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_2MHz)) - -/* Configuration ************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - /* set the peripheral rails off */ - - VDD_5V_PERIPH_EN(false); - board_control_spi_sensors_power(false, 0xffff); - - bool last = READ_VDD_3V3_SPEKTRUM_POWER_EN(); - /* Keep Spektum on to discharge rail*/ - VDD_3V3_SPEKTRUM_POWER_EN(false); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ - VDD_3V3_SPEKTRUM_POWER_EN(last); - board_control_spi_sensors_power(true, 0xffff); - VDD_5V_PERIPH_EN(true); - -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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 - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Power on Interfaces */ - VDD_3V3_SD_CARD_EN(true); - VDD_5V_PERIPH_EN(true); - VDD_5V_HIPOWER_EN(true); - board_control_spi_sensors_power(true, 0xffff); -#ifdef SPEKTRUM_POWER_PASSIVE - // Turn power controls to passive - SPEKTRUM_POWER_PASSIVE(); -#endif - VDD_5V_RC_EN(true); - VDD_5V_WIFI_EN(true); - - /* Need hrt running before using the ADC */ - - px4_platform_init(); - - if (OK == board_determine_hw_info()) { - syslog(LOG_INFO, "[boot] Rev 0x%1x : Ver 0x%1x %s\n", board_get_hw_revision(), board_get_hw_version(), - board_get_hw_type_name()); - - } else { - syslog(LOG_ERR, "[boot] Failed to read HW revision and version\n"); - } - - /* configure SPI interfaces (after we determined the HW version) */ - - stm32_spiinitialize(); - - - /* Does this board have CAN 2 or CAN 3 if not decouple the RX - * from IP block Leave TX connected - */ - - if (!PX4_MFT_HW_SUPPORTED(PX4_MFT_CAN2)) { - px4_arch_configgpio(_GPIO_PULL_DOWN_INPUT(GPIO_CAN2_RX)); - } - - if (!PX4_MFT_HW_SUPPORTED(PX4_MFT_CAN3)) { - px4_arch_configgpio(_GPIO_PULL_DOWN_INPUT(GPIO_CAN3_RX)); - } - - /* configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_on(LED_GREEN); // Indicate Power. - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - -#ifdef CONFIG_MMCSD - int ret = stm32_sdio_initialize(); - - if (ret != OK) { - led_on(LED_RED); - } - -#endif /* CONFIG_MMCSD */ - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/px4/fmu-v5/src/led.c b/boards/px4/fmu-v5/src/led.c deleted file mode 100644 index edc8784..0000000 --- a/boards/px4/fmu-v5/src/led.c +++ /dev/null @@ -1,232 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * PX4FMU LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -#ifdef CONFIG_ARCH_LEDS -static bool nuttx_owns_leds = true; -// B R S G -// 0 1 2 3 -static const uint8_t xlatpx4[] = {1, 2, 4, 0}; -# define xlat(p) xlatpx4[(p)] -static uint32_t g_ledmap[] = { - GPIO_nLED_GREEN, // Indexed by BOARD_LED_GREEN - GPIO_nLED_BLUE, // Indexed by BOARD_LED_BLUE - GPIO_nLED_RED, // Indexed by BOARD_LED_RED - GPIO_nSAFETY_SWITCH_LED_OUT, // Indexed by LED_SAFETY by xlatpx4 -}; - -#else - -# define xlat(p) (p) -static uint32_t g_ledmap[] = { - GPIO_nLED_BLUE, // Indexed by LED_BLUE - GPIO_nLED_RED, // Indexed by LED_RED, LED_AMBER - GPIO_nSAFETY_SWITCH_LED_OUT_INIT, // Indexed by LED_SAFETY (defaulted to an input) - GPIO_nLED_GREEN, // Indexed by LED_GREEN -}; - -#endif - -__EXPORT void led_init(void) -{ - /* Configure LED GPIOs for output */ - if (!PX4_MFT_HW_SUPPORTED(PX4_MFT_PX4IO)) { - g_ledmap[2] = GPIO_nSAFETY_SWITCH_LED_OUT; - } - - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - stm32_configgpio(g_ledmap[l]); - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - - stm32_gpiowrite(g_ledmap[led], !state); -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - return !stm32_gpioread(g_ledmap[led]); -} - -__EXPORT void led_on(int led) -{ - phy_set_led(xlat(led), true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(xlat(led), false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(xlat(led), !phy_get_led(xlat(led))); -} - -#ifdef CONFIG_ARCH_LEDS -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_autoled_initialize - ****************************************************************************/ - -void board_autoled_initialize(void) -{ - led_init(); -} - -/**************************************************************************** - * Name: board_autoled_on - ****************************************************************************/ - -void board_autoled_on(int led) -{ - if (!nuttx_owns_leds) { - return; - } - - switch (led) { - default: - break; - - case LED_HEAPALLOCATE: - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_IRQSENABLED: - phy_set_led(BOARD_LED_BLUE, false); - phy_set_led(BOARD_LED_GREEN, true); - break; - - case LED_STACKCREATED: - phy_set_led(BOARD_LED_GREEN, true); - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_INIRQ: - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_SIGNAL: - phy_set_led(BOARD_LED_GREEN, true); - break; - - case LED_ASSERTION: - phy_set_led(BOARD_LED_RED, true); - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_PANIC: - phy_set_led(BOARD_LED_RED, true); - break; - - case LED_IDLE : /* IDLE */ - phy_set_led(BOARD_LED_RED, true); - break; - } -} - -/**************************************************************************** - * Name: board_autoled_off - ****************************************************************************/ - -void board_autoled_off(int led) -{ - if (!nuttx_owns_leds) { - return; - } - - switch (led) { - default: - break; - - case LED_SIGNAL: - phy_set_led(BOARD_LED_GREEN, false); - break; - - case LED_INIRQ: - phy_set_led(BOARD_LED_BLUE, false); - break; - - case LED_ASSERTION: - phy_set_led(BOARD_LED_RED, false); - phy_set_led(BOARD_LED_BLUE, false); - break; - - case LED_PANIC: - phy_set_led(BOARD_LED_RED, false); - break; - - case LED_IDLE : /* IDLE */ - phy_set_led(BOARD_LED_RED, false); - break; - } -} - -#endif /* CONFIG_ARCH_LEDS */ diff --git a/boards/px4/fmu-v5/src/manifest.c b/boards/px4/fmu-v5/src/manifest.c deleted file mode 100644 index 4db1368..0000000 --- a/boards/px4/fmu-v5/src/manifest.c +++ /dev/null @@ -1,212 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2018-2021 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. - * - ****************************************************************************/ - -/** - * @file manifest.c - * - * This module supplies the interface to the manifest of hardware that is - * optional and dependent on the HW REV and HW VER IDs - * - * The manifest allows the system to know whether a hardware option - * say for example the PX4IO is an no-pop option vs it is broken. - * - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include - -#include "systemlib/px4_macros.h" - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -typedef struct { - uint32_t hw_ver_rev; /* the version and revision */ - const px4_hw_mft_item_t *mft; /* The first entry */ - uint32_t entries; /* the lenght of the list */ -} px4_hw_mft_list_entry_t; - -typedef px4_hw_mft_list_entry_t *px4_hw_mft_list_entry; -#define px4_hw_mft_list_uninitialized (px4_hw_mft_list_entry) -1 - -static const px4_hw_mft_item_t device_unsupported = {0, 0, 0}; - -// List of components on a specific board configuration -// The index of those components is given by the enum (px4_hw_mft_item_id_t) -// declared in board_common.h - -static const px4_hw_mft_item_t hw_mft_list_v0500[] = { - { - // PX4_MFT_PX4IO - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, - { - // PX4_MFT_USB - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, - { - // PX4_MFT_CAN2 - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, - { - // PX4_MFT_CAN3 - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, -}; - -static const px4_hw_mft_item_t hw_mft_list_v0540[] = { - { - // PX4_MFT_PX4IO - .present = 0, - .mandatory = 0, - .connection = px4_hw_con_unknown, - }, - { - // PX4_MFT_USB - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, - { - // PX4_MFT_CAN2 - .present = 0, - .mandatory = 0, - .connection = px4_hw_con_unknown, - }, - { - // PX4_MFT_CAN3 - .present = 0, - .mandatory = 0, - .connection = px4_hw_con_unknown, - }, -}; - -static const px4_hw_mft_item_t hw_mft_list_v0600[] = { - { - // PX4_MFT_PX4IO - .present = 0, - .mandatory = 0, - .connection = px4_hw_con_unknown, - }, - { - // PX4_MFT_USB - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, - { - // PX4_MFT_CAN2 - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, - { - // PX4_MFT_CAN3 - .present = 0, - .mandatory = 0, - .connection = px4_hw_con_unknown, - }, -}; - - -static px4_hw_mft_list_entry_t mft_lists[] = { - {V500, hw_mft_list_v0500, arraySize(hw_mft_list_v0500)}, - {V515, hw_mft_list_v0500, arraySize(hw_mft_list_v0500)}, // Alias for CUAV V5 R:5 V:1 - {V540, hw_mft_list_v0540, arraySize(hw_mft_list_v0540)}, // HolyBro mini no can 2,3 - {V550, hw_mft_list_v0500, arraySize(hw_mft_list_v0500)}, // Alias for CUAV V5+ R:0 V:5 - {V552, hw_mft_list_v0500, arraySize(hw_mft_list_v0500)}, // Alias for CUAV V5+ R:2 V:5 ICM42688P - {V560, hw_mft_list_v0600, arraySize(hw_mft_list_v0600)}, // CUAV V5nano R:0 V:6 with can 2 - {V562, hw_mft_list_v0500, arraySize(hw_mft_list_v0500)}, // Alias for CUAV V5nano R:2 V:6 ICM42688P -}; - -/************************************************************************************ - * Name: board_query_manifest - * - * Description: - * Optional returns manifest item. - * - * Input Parameters: - * manifest_id - the ID for the manifest item to retrieve - * - * Returned Value: - * 0 - item is not in manifest => assume legacy operations - * pointer to a manifest item - * - ************************************************************************************/ - -__EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) -{ - static px4_hw_mft_list_entry boards_manifest = px4_hw_mft_list_uninitialized; - - if (boards_manifest == px4_hw_mft_list_uninitialized) { - uint32_t ver_rev = board_get_hw_version() << 16; - ver_rev |= board_get_hw_revision(); - - for (unsigned i = 0; i < arraySize(mft_lists); i++) { - if (mft_lists[i].hw_ver_rev == ver_rev) { - boards_manifest = &mft_lists[i]; - break; - } - } - - if (boards_manifest == px4_hw_mft_list_uninitialized) { - syslog(LOG_ERR, "[boot] Board %08" PRIx32 " is not supported!\n", ver_rev); - } - } - - px4_hw_mft_item rv = &device_unsupported; - - if (boards_manifest != px4_hw_mft_list_uninitialized && - id < boards_manifest->entries) { - rv = &boards_manifest->mft[id]; - } - - return rv; -} diff --git a/boards/px4/fmu-v5/src/sdio.c b/boards/px4/fmu-v5/src/sdio.c deleted file mode 100644 index 869d757..0000000 --- a/boards/px4/fmu-v5/src/sdio.c +++ /dev/null @@ -1,177 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include "chip.h" -#include "board_config.h" -#include "stm32_gpio.h" -#include "stm32_sdmmc.h" - -#ifdef CONFIG_MMCSD - - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Card detections requires card support and a card detection GPIO */ - -#define HAVE_NCD 1 -#if !defined(GPIO_SDMMC1_NCD) -# undef HAVE_NCD -#endif - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -static FAR struct sdio_dev_s *sdio_dev; -#ifdef HAVE_NCD -static bool g_sd_inserted = 0xff; /* Impossible value */ -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_ncd_interrupt - * - * Description: - * Card detect interrupt handler. - * - ****************************************************************************/ - -#ifdef HAVE_NCD -static int stm32_ncd_interrupt(int irq, FAR void *context) -{ - bool present; - - present = !stm32_gpioread(GPIO_SDMMC1_NCD); - - if (sdio_dev && present != g_sd_inserted) { - sdio_mediachange(sdio_dev, present); - g_sd_inserted = present; - } - - return OK; -} -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_sdio_initialize - * - * Description: - * Initialize SDIO-based MMC/SD card support - * - ****************************************************************************/ - -int stm32_sdio_initialize(void) -{ - int ret; - -#ifdef HAVE_NCD - /* Card detect */ - - bool cd_status; - - /* Configure the card detect GPIO */ - - stm32_configgpio(GPIO_SDMMC1_NCD); - - /* Register an interrupt handler for the card detect pin */ - - stm32_gpiosetevent(GPIO_SDMMC1_NCD, true, true, true, stm32_ncd_interrupt); -#endif - - /* Mount the SDIO-based MMC/SD block driver */ - /* First, get an instance of the SDIO interface */ - - finfo("Initializing SDIO slot %d\n", SDIO_SLOTNO); - - sdio_dev = sdio_initialize(SDIO_SLOTNO); - - if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", SDIO_SLOTNO); - return -ENODEV; - } - - /* Now bind the SDIO interface to the MMC/SD driver */ - - finfo("Bind SDIO to the MMC/SD driver, minor=%d\n", SDIO_MINOR); - - ret = mmcsd_slotinitialize(SDIO_MINOR, sdio_dev); - - if (ret != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); - return ret; - } - - finfo("Successfully bound SDIO to the MMC/SD driver\n"); - -#ifdef HAVE_NCD - /* Use SD card detect pin to check if a card is g_sd_inserted */ - - cd_status = !stm32_gpioread(GPIO_SDMMC1_NCD); - finfo("Card detect : %d\n", cd_status); - - sdio_mediachange(sdio_dev, cd_status); -#else - /* Assume that the SD card is inserted. What choice do we have? */ - - sdio_mediachange(sdio_dev, true); -#endif - - return OK; -} - -#endif /* CONFIG_MMCSD */ diff --git a/boards/px4/fmu-v5/src/spi.cpp b/boards/px4/fmu-v5/src/spi.cpp deleted file mode 100644 index 8a3f8c9..0000000 --- a/boards/px4/fmu-v5/src/spi.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 -#include -#include - -constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSIONS] = { - initSPIHWVersion(V500, { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20689, SPI::CS{GPIO::PortF, GPIO::Pin2}, SPI::DRDY{GPIO::PortB, GPIO::Pin4}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortF, GPIO::Pin3}, SPI::DRDY{GPIO::PortC, GPIO::Pin5}), - initSPIDevice(DRV_GYR_DEVTYPE_BMI055, SPI::CS{GPIO::PortF, GPIO::Pin4}, SPI::DRDY{GPIO::PortB, GPIO::Pin14}), - initSPIDevice(DRV_ACC_DEVTYPE_BMI055, SPI::CS{GPIO::PortG, GPIO::Pin10}, SPI::DRDY{GPIO::PortB, GPIO::Pin15}), - }, {GPIO::PortE, GPIO::Pin3}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortF, GPIO::Pin5}) - }), - initSPIBus(SPI::Bus::SPI4, { - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortF, GPIO::Pin10}), - }), - initSPIBusExternal(SPI::Bus::SPI5, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin4}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}), - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin11}) - }), - initSPIBusExternal(SPI::Bus::SPI6, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin6}), - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin7}), - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin8}) - }), - }), - - initSPIHWVersion(V552, { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20689, SPI::CS{GPIO::PortF, GPIO::Pin2}, SPI::DRDY{GPIO::PortB, GPIO::Pin4}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortF, GPIO::Pin11}, SPI::DRDY{GPIO::PortC, GPIO::Pin5}), - initSPIDevice(DRV_GYR_DEVTYPE_BMI055, SPI::CS{GPIO::PortF, GPIO::Pin4}, SPI::DRDY{GPIO::PortB, GPIO::Pin14}), - initSPIDevice(DRV_ACC_DEVTYPE_BMI055, SPI::CS{GPIO::PortG, GPIO::Pin10}, SPI::DRDY{GPIO::PortB, GPIO::Pin15}), - }, {GPIO::PortE, GPIO::Pin3}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortF, GPIO::Pin5}) - }), - initSPIBus(SPI::Bus::SPI4, { - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortF, GPIO::Pin10}), - }), - initSPIBusExternal(SPI::Bus::SPI5, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin4}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}), - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin11}) - }), - initSPIBusExternal(SPI::Bus::SPI6, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin6}), - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin7}), - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin8}) - }), - }), - - initSPIHWVersion(V562, { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20689, SPI::CS{GPIO::PortF, GPIO::Pin2}, SPI::DRDY{GPIO::PortB, GPIO::Pin4}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortF, GPIO::Pin11}, SPI::DRDY{GPIO::PortC, GPIO::Pin5}), - initSPIDevice(DRV_GYR_DEVTYPE_BMI055, SPI::CS{GPIO::PortF, GPIO::Pin4}, SPI::DRDY{GPIO::PortB, GPIO::Pin14}), - initSPIDevice(DRV_ACC_DEVTYPE_BMI055, SPI::CS{GPIO::PortG, GPIO::Pin10}, SPI::DRDY{GPIO::PortB, GPIO::Pin15}), - }, {GPIO::PortE, GPIO::Pin3}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortF, GPIO::Pin5}) - }), - initSPIBus(SPI::Bus::SPI4, { - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortF, GPIO::Pin10}), - }), - initSPIBusExternal(SPI::Bus::SPI5, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin4}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}), - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin11}) - }), - initSPIBusExternal(SPI::Bus::SPI6, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin6}), - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin7}), - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin8}) - }), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses_all_hw); diff --git a/boards/px4/fmu-v5/src/stm32_userspace.c b/boards/px4/fmu-v5/src/stm32_userspace.c deleted file mode 100644 index 1c3335c..0000000 --- a/boards/px4/fmu-v5/src/stm32_userspace.c +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************************** - * boards/px4/fmu-v5/src/stm32_userspace.c - * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include - -#include -#include -#include -#include -#include - -#if !defined(CONFIG_BUILD_FLAT) && !defined(__KERNEL__) - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Configuration ************************************************************/ - -#ifndef CONFIG_NUTTX_USERSPACE -# error "CONFIG_NUTTX_USERSPACE not defined" -#endif - -#if CONFIG_NUTTX_USERSPACE != 0x08100000 -# error "CONFIG_NUTTX_USERSPACE must be 0x08100000 to match memory.ld" -#endif - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/* These 'addresses' of these values are setup by the linker script. They are - * not actual uint32_t storage locations! They are only used meaningfully in - * the following way: - * - * - The linker script defines, for example, the symbol_sdata. - * - The declaration extern uint32_t _sdata; makes C happy. C will believe - * that the value _sdata is the address of a uint32_t variable _data (it - * is not!). - * - We can recover the linker value then by simply taking the address of - * of _data. like: uint32_t *pdata = &_sdata; - */ - -extern uint32_t _stext; /* Start of .text */ -extern uint32_t _etext; /* End_1 of .text + .rodata */ -extern const uint32_t _eronly; /* End+1 of read only section (.text + .rodata) */ -extern uint32_t _sdata; /* Start of .data */ -extern uint32_t _edata; /* End+1 of .data */ -extern uint32_t _sbss; /* Start of .bss */ -extern uint32_t _ebss; /* End+1 of .bss */ - -/* This is the user space entry point */ - -int CONFIG_INIT_ENTRYPOINT(int argc, char *argv[]); -int nsh_main(int argc, char *argv[]); - -const struct userspace_s userspace __attribute__((section(".userspace"))) = { - /* General memory map */ - - .us_entrypoint = (main_t)CONFIG_INIT_ENTRYPOINT, - .us_textstart = (uintptr_t) &_stext, - .us_textend = (uintptr_t) &_etext, - .us_datasource = (uintptr_t) &_eronly, - .us_datastart = (uintptr_t) &_sdata, - .us_dataend = (uintptr_t) &_edata, - .us_bssstart = (uintptr_t) &_sbss, - .us_bssend = (uintptr_t) &_ebss, - - /* Memory manager heap structure */ - - .us_heap = &g_mmheap, - - /* Task/thread startup routines */ - - .task_startup = nxtask_startup, - - /* Signal handler trampoline */ - - .signal_handler = up_signal_handler, - - /* User-space work queue support (declared in include/nuttx/wqueue.h) */ - -#ifdef CONFIG_LIBC_USRWORK - .work_usrstart = work_usrstart, -#endif -}; - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -void px4_userspace_init(void); - -int CONFIG_INIT_ENTRYPOINT(int argc, char *argv[]) -{ - -#ifdef CONFIG_NSH_ARCHINIT -#error CONFIG_NSH_ARCHINIT must not be defined! -#endif - - boardctl(BOARDIOC_INIT, 0); - - px4_userspace_init(); - - return nsh_main(argc, argv); -} - -#endif /* !CONFIG_BUILD_FLAT && !__KERNEL__ */ diff --git a/boards/px4/fmu-v5/src/timer_config.cpp b/boards/px4/fmu-v5/src/timer_config.cpp deleted file mode 100644 index 8bebdca..0000000 --- a/boards/px4/fmu-v5/src/timer_config.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1, DMA{DMA::Index2, DMA::Stream5, DMA::Channel6}), - initIOTimer(Timer::Timer4), - initIOTimer(Timer::Timer12), - initIOTimer(Timer::Timer2), - initIOTimer(Timer::Timer9), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortA, GPIO::Pin10}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer12, Timer::Channel1}, {GPIO::PortH, GPIO::Pin6}), - initIOTimerChannel(io_timers, {Timer::Timer12, Timer::Channel2}, {GPIO::PortH, GPIO::Pin9}), - initIOTimerChannelCapture(io_timers, {Timer::Timer2, Timer::Channel1}, {GPIO::PortA, GPIO::Pin5}), - initIOTimerChannelCapture(io_timers, {Timer::Timer2, Timer::Channel2}, {GPIO::PortB, GPIO::Pin3}), - initIOTimerChannelCapture(io_timers, {Timer::Timer2, Timer::Channel4}, {GPIO::PortB, GPIO::Pin11}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); - -#if defined(BOARD_HAS_LED_PWM) || defined(BOARD_HAS_UI_LED_PWM) -constexpr io_timers_t led_pwm_timers[MAX_LED_TIMERS] = { -# if defined(BOARD_HAS_UI_LED_PWM) - initIOTimer(Timer::Timer5), -# endif -# if defined(BOARD_HAS_LED_PWM) && !defined(BOARD_HAS_CONTROL_STATUS_LEDS) - initIOTimer(Timer::Timer3), -# endif -}; - -/* Support driving active low (preferred) or active high LED - * on both the onboard status LEDs or the [n]UI_LED_[_EXTERNAL] - * - * Use open drain to drive the LED. This will ensure that - * if the LED has a 5 Volt supply that the LED will be - * off when high. - */ -#define CCER_C1_NUM_BITS 4 -#define ACTIVE_LOW(c) (GTIM_CCER_CC1P << (((c)-1) * CCER_C1_NUM_BITS)) -#define ACTIVE_HIGH(c) 0 - -#if defined(BOARD_LED_PWM_DRIVE_ACTIVE_LOW) -# define POLARITY(c) ACTIVE_LOW(c) -# define DRIVE_TYPE(p) ((p)|GPIO_OPENDRAIN) -#else -# define POLARITY(c) ACTIVE_HIGH((c)) -# define DRIVE_TYPE(p) (p) -#endif - -#if defined(BOARD_UI_LED_PWM_DRIVE_ACTIVE_LOW) -# define UI_POLARITY(c) ACTIVE_LOW(c) -# define UI_DRIVE_TYPE(p) ((p)|GPIO_OPENDRAIN) -#else -# define UI_POLARITY(c) ACTIVE_HIGH((c)) -# define UI_DRIVE_TYPE(p) (p) -#endif - -static inline constexpr timer_io_channels_t initIOTimerChannelUILED(const io_timers_t io_timers_conf[MAX_LED_TIMERS], - Timer::TimerChannel timer, GPIO::GPIOPin pin, int ui_polarity) -{ - timer_io_channels_t ret = initIOTimerChannel(io_timers_conf, timer, pin); - ret.gpio_out = UI_DRIVE_TYPE(ret.gpio_out); - ret.masks = UI_POLARITY(ui_polarity); - return ret; -} - -static inline constexpr timer_io_channels_t initIOTimerChannelControlLED(const io_timers_t - io_timers_conf[MAX_LED_TIMERS], - Timer::TimerChannel timer, GPIO::GPIOPin pin, int polarity) -{ - timer_io_channels_t ret = initIOTimerChannel(io_timers_conf, timer, pin); - ret.gpio_out = DRIVE_TYPE(ret.gpio_out); - ret.masks = POLARITY(polarity); - return ret; -} - -constexpr timer_io_channels_t led_pwm_channels[MAX_TIMER_LED_CHANNELS] = { -# if defined(BOARD_HAS_UI_LED_PWM) -# if defined(BOARD_UI_LED_SWAP_RG) - initIOTimerChannelUILED(led_pwm_timers, {Timer::Timer5, Timer::Channel2}, {GPIO::PortH, GPIO::Pin11}, 2), - initIOTimerChannelUILED(led_pwm_timers, {Timer::Timer5, Timer::Channel1}, {GPIO::PortH, GPIO::Pin10}, 1), - initIOTimerChannelUILED(led_pwm_timers, {Timer::Timer5, Timer::Channel3}, {GPIO::PortH, GPIO::Pin12}, 3), -# else - initIOTimerChannelUILED(led_pwm_timers, {Timer::Timer5, Timer::Channel1}, {GPIO::PortH, GPIO::Pin10}, 1), - initIOTimerChannelUILED(led_pwm_timers, {Timer::Timer5, Timer::Channel2}, {GPIO::PortH, GPIO::Pin11}, 2), - initIOTimerChannelUILED(led_pwm_timers, {Timer::Timer5, Timer::Channel3}, {GPIO::PortH, GPIO::Pin12}, 3), -# endif -# endif -# if defined(BOARD_HAS_LED_PWM) && !defined(BOARD_HAS_CONTROL_STATUS_LEDS) - initIOTimerChannelControlLED(led_pwm_timers, {Timer::Timer3, Timer::Channel4}, {GPIO::PortB, GPIO::Pin1}, 4), - initIOTimerChannelControlLED(led_pwm_timers, {Timer::Timer3, Timer::Channel1}, {GPIO::PortC, GPIO::Pin6}, 1), - initIOTimerChannelControlLED(led_pwm_timers, {Timer::Timer3, Timer::Channel2}, {GPIO::PortC, GPIO::Pin7}, 2), -# endif -}; -#endif // BOARD_HAS_LED_PWM || BOARD_HAS_UI_LED_PWM diff --git a/boards/px4/fmu-v5/src/toc.c b/boards/px4/fmu-v5/src/toc.c deleted file mode 100644 index 5f3fec3..0000000 --- a/boards/px4/fmu-v5/src/toc.c +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 Technology Innovation Institute. 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 - -/* (Maximum) size of the signature */ -#define SIGNATURE_SIZE 64 - -/* Boot image starts at _vectors and ends at - * the beginning of signature -*/ - -extern uint32_t _vectors[]; -extern const int *_boot_signature; - -#define BOOT_ADDR _vectors -#define BOOT_END ((const void *)&_boot_signature) - -/* Boot signature start and end are defined by the - * signature definition below -*/ - -#define BOOTSIG_ADDR ((const void *)&_boot_signature) -#define BOOTSIG_END ((const void *)((const uint8_t *)BOOTSIG_ADDR+SIGNATURE_SIZE)) - -/* RD certifcate may follow boot signature */ - -#define RDCT_ADDR BOOTSIG_END -#define RDCT_END ((const void *)((const uint8_t*)BOOTSIG_END+sizeof(image_cert_t))) - -/* RD certificate signature follows the certificate */ - -#define RDCTSIG_ADDR RDCT_END -#define RDCTSIG_END ((const void *)((const uint8_t*)RDCTSIG_ADDR+SIGNATURE_SIZE)) - -/* The table of contents */ - -IMAGE_MAIN_TOC(4) = { - {TOC_START_MAGIC, TOC_VERSION}, - { - {"BOOT", BOOT_ADDR, BOOT_END, 0, 1, 0, 0, TOC_FLAG1_BOOT | TOC_FLAG1_CHECK_SIGNATURE}, - {"SIG1", BOOTSIG_ADDR, BOOTSIG_END, 0, 0, 0, 0, 0}, - {"RDCT", RDCT_ADDR, RDCT_END, 0, 3, 0, 0, TOC_FLAG1_RDCT | TOC_FLAG1_CHECK_SIGNATURE}, - {"RDSG", RDCTSIG_ADDR, RDCTSIG_END, 0, 0, 0, 0, 0}, - }, - TOC_END_MAGIC -}; diff --git a/boards/px4/fmu-v5/src/usb.c b/boards/px4/fmu-v5/src/usb.c deleted file mode 100644 index 0e28676..0000000 --- a/boards/px4/fmu-v5/src/usb.c +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#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 - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/px4/fmu-v5/stackcheck.px4board b/boards/px4/fmu-v5/stackcheck.px4board deleted file mode 100644 index fb10b4c..0000000 --- a/boards/px4/fmu-v5/stackcheck.px4board +++ /dev/null @@ -1,41 +0,0 @@ -# CONFIG_BOARD_UAVCAN_TIMER_OVERRIDE is not set -CONFIG_COMMON_BAROMETERS=n -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=n -CONFIG_COMMON_DISTANCE_SENSOR=n -CONFIG_COMMON_HYGROMETERS=n -CONFIG_COMMON_TELEMETRY=n -CONFIG_DRIVERS_ADC_ADS1115=n -CONFIG_DRIVERS_BATT_SMBUS=n -CONFIG_DRIVERS_CAMERA_CAPTURE=n -CONFIG_DRIVERS_CAMERA_TRIGGER=n -CONFIG_DRIVERS_HEATER=n -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=n -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=n -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20689=n -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=n -CONFIG_DRIVERS_IRLOCK=n -CONFIG_DRIVERS_PCA9685_PWM_OUT=n -CONFIG_DRIVERS_POWER_MONITOR_INA226=n -CONFIG_DRIVERS_PWM_INPUT=n -CONFIG_DRIVERS_SMART_BATTERY_BATMON=n -CONFIG_DRIVERS_UAVCAN=n -CONFIG_EXAMPLES_FAKE_GPS=n -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=n -CONFIG_MODULES_CAMERA_FEEDBACK=n -CONFIG_MODULES_ESC_BATTERY=n -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=n -CONFIG_MODULES_GIMBAL=n -CONFIG_MODULES_GYRO_CALIBRATION=n -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=n -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=n -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=n -CONFIG_MODULES_ROVER_POS_CONTROL=n -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=n -CONFIG_MODULES_TEMPERATURE_COMPENSATION=n -CONFIG_MODULES_UUV_ATT_CONTROL=n -CONFIG_MODULES_UUV_POS_CONTROL=n -CONFIG_SYSTEMCMDS_REFLECT=n -CONFIG_SYSTEMCMDS_SERIAL_TEST=n -CONFIG_BOARD_CONSTRAINED_FLASH=y -CONFIG_BOARD_TESTING=y -CONFIG_DRIVERS_BAROMETER_MS5611=y diff --git a/boards/px4/fmu-v5/test.px4board b/boards/px4/fmu-v5/test.px4board deleted file mode 100644 index 626efaf..0000000 --- a/boards/px4/fmu-v5/test.px4board +++ /dev/null @@ -1,16 +0,0 @@ -CONFIG_DRIVERS_ADC_ADS1115=n -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=n -CONFIG_DRIVERS_IRLOCK=n -CONFIG_DRIVERS_PCA9685_PWM_OUT=n -CONFIG_EXAMPLES_FAKE_GPS=n -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=n -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=n -CONFIG_MODULES_ROVER_POS_CONTROL=n -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=n -CONFIG_BOARD_TESTING=y -CONFIG_DRIVERS_TEST_PPM=y -CONFIG_SYSTEMCMDS_MICROBENCH=y -CONFIG_MODULES_FW_ATT_CONTROL=n -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=n -CONFIG_MODULES_FW_POS_CONTROL=n -CONFIG_MODULES_FW_RATE_CONTROL=n diff --git a/boards/px4/fmu-v5/uavcanv0periph.px4board b/boards/px4/fmu-v5/uavcanv0periph.px4board deleted file mode 100644 index 70e35ab..0000000 --- a/boards/px4/fmu-v5/uavcanv0periph.px4board +++ /dev/null @@ -1,40 +0,0 @@ -# CONFIG_BOARD_UAVCAN_TIMER_OVERRIDE is not set -CONFIG_COMMON_BAROMETERS=n -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=n -CONFIG_COMMON_HYGROMETERS=n -CONFIG_COMMON_TELEMETRY=n -CONFIG_DRIVERS_ADC_ADS1115=n -CONFIG_DRIVERS_GPS=n -CONFIG_DRIVERS_HEATER=n -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=n -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=n -CONFIG_DRIVERS_IRLOCK=n -CONFIG_DRIVERS_PCA9685_PWM_OUT=n -CONFIG_DRIVERS_PWM_INPUT=n -CONFIG_DRIVERS_SMART_BATTERY_BATMON=n -CONFIG_EXAMPLES_FAKE_GPS=n -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=n -CONFIG_MODULES_CAMERA_FEEDBACK=n -CONFIG_MODULES_ESC_BATTERY=n -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=n -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=n -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=n -CONFIG_MODULES_ROVER_POS_CONTROL=n -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=n -CONFIG_MODULES_TEMPERATURE_COMPENSATION=n -CONFIG_MODULES_UUV_ATT_CONTROL=n -CONFIG_MODULES_UUV_POS_CONTROL=n -CONFIG_MODULES_UXRCE_DDS_CLIENT=n -CONFIG_SYSTEMCMDS_BL_UPDATE=n -CONFIG_SYSTEMCMDS_DUMPFILE=n -CONFIG_SYSTEMCMDS_GPIO=n -CONFIG_SYSTEMCMDS_I2CDETECT=n -CONFIG_SYSTEMCMDS_LED_CONTROL=n -CONFIG_SYSTEMCMDS_REFLECT=n -CONFIG_SYSTEMCMDS_SD_BENCH=n -CONFIG_SYSTEMCMDS_SD_STRESS=n -CONFIG_SYSTEMCMDS_SERIAL_TEST=n -CONFIG_SYSTEMCMDS_SYSTEM_TIME=n -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=n -CONFIG_BOARD_UAVCAN_PERIPHERALS="cuav_can-gps-v1_default" -CONFIG_DRIVERS_BAROMETER_MS5611=y diff --git a/boards/px4/fmu-v5x/cmake/upload.cmake b/boards/px4/fmu-v5x/cmake/upload.cmake deleted file mode 100644 index e5c23c3..0000000 --- a/boards/px4/fmu-v5x/cmake/upload.cmake +++ /dev/null @@ -1,49 +0,0 @@ -############################################################################ -# -# Copyright (c) 2020 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. -# -############################################################################ - - -set(PX4_FW_NAME ${PX4_BINARY_DIR}/${PX4_BOARD_VENDOR}_${PX4_BOARD_MODEL}_${PX4_BOARD_LABEL}.px4) - -add_custom_target(upload_skynode_usb - COMMAND ${PX4_SOURCE_DIR}/Tools/auterion/upload_skynode.sh --file=${PX4_FW_NAME} - DEPENDS ${PX4_FW_NAME} - COMMENT "Uploading PX4" - USES_TERMINAL -) - -add_custom_target(upload_skynode_wifi - COMMAND ${PX4_SOURCE_DIR}/Tools/auterion/upload_skynode.sh --file=${PX4_FW_NAME} --wifi - DEPENDS ${PX4_FW_NAME} - COMMENT "Uploading PX4" - USES_TERMINAL -) diff --git a/boards/px4/fmu-v5x/default.px4board b/boards/px4/fmu-v5x/default.px4board deleted file mode 100644 index 5c662fb..0000000 --- a/boards/px4/fmu-v5x/default.px4board +++ /dev/null @@ -1,110 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_ETHERNET=y -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS0" -CONFIG_BOARD_SERIAL_GPS2="/dev/ttyS7" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS6" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS4" -CONFIG_BOARD_SERIAL_TEL3="/dev/ttyS1" -CONFIG_BOARD_SERIAL_EXT2="/dev/ttyS3" -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_BAROMETER_BMP388=y -CONFIG_DRIVERS_BAROMETER_MS5611=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_HEATER=y -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=y -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16507=y -CONFIG_DRIVERS_IMU_BOSCH_BMI088=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20649=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y -CONFIG_DRIVERS_IMU_INVENSENSE_IIM42652=y -CONFIG_COMMON_INS=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_COMMON_OSD=y -CONFIG_DRIVERS_POWER_MONITOR_INA226=y -CONFIG_DRIVERS_POWER_MONITOR_INA228=y -CONFIG_DRIVERS_POWER_MONITOR_INA238=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_PX4IO=y -CONFIG_COMMON_RC=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SAFETY_BUTTON=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_PAYLOAD_DELIVERER=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BL_UPDATE=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NETMAN=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/px4/fmu-v5x/extras/px4_fmu-v5x_bootloader.bin b/boards/px4/fmu-v5x/extras/px4_fmu-v5x_bootloader.bin deleted file mode 100644 index 6a9cba4..0000000 Binary files a/boards/px4/fmu-v5x/extras/px4_fmu-v5x_bootloader.bin and /dev/null differ diff --git a/boards/px4/fmu-v5x/extras/px4_io-v2_default.bin b/boards/px4/fmu-v5x/extras/px4_io-v2_default.bin deleted file mode 100755 index 957f0f1..0000000 Binary files a/boards/px4/fmu-v5x/extras/px4_io-v2_default.bin and /dev/null differ diff --git a/boards/px4/fmu-v5x/firmware.prototype b/boards/px4/fmu-v5x/firmware.prototype deleted file mode 100644 index 5ad0823..0000000 --- a/boards/px4/fmu-v5x/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 51, - "magic": "PX4FWv1", - "description": "Firmware for the PX4FMUv5X board", - "image": "", - "build_time": 0, - "summary": "PX4FMUv5X", - "version": "0.1", - "image_size": 0, - "image_maxsize": 2064384, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/px4/fmu-v5x/init/rc.board_defaults b/boards/px4/fmu-v5x/init/rc.board_defaults deleted file mode 100644 index ba812e4..0000000 --- a/boards/px4/fmu-v5x/init/rc.board_defaults +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -# Mavlink ethernet (CFG 1000) -param set-default MAV_2_CONFIG 1000 -param set-default MAV_2_BROADCAST 1 -param set-default MAV_2_MODE 0 -param set-default MAV_2_RADIO_CTL 0 -param set-default MAV_2_RATE 100000 -param set-default MAV_2_REMOTE_PRT 14550 -param set-default MAV_2_UDP_PRT 14550 - -param set-default SENS_EN_INA238 0 -param set-default SENS_EN_INA228 0 -param set-default SENS_EN_INA226 1 - -param set-default SYS_USE_IO 1 - -safety_button start diff --git a/boards/px4/fmu-v5x/init/rc.board_mavlink b/boards/px4/fmu-v5x/init/rc.board_mavlink deleted file mode 100644 index dad8437..0000000 --- a/boards/px4/fmu-v5x/init/rc.board_mavlink +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# -# board specific MAVLink startup script. -#------------------------------------------------------------------------------ - -if ver hwtypecmp V5X009000 V5X009001 V5X00a000 V5X00a001 V5X008000 V5X008001 V5X010001 -then - # Start MAVLink on the UART connected to the mission computer - mavlink start -d /dev/ttyS4 -b 3000000 -r 290000 -m onboard_low_bandwidth -x -z -fi diff --git a/boards/px4/fmu-v5x/init/rc.board_sensors b/boards/px4/fmu-v5x/init/rc.board_sensors deleted file mode 100644 index 4f7c1d0..0000000 --- a/boards/px4/fmu-v5x/init/rc.board_sensors +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/sh -# -# PX4 FMUv5X specific board sensors init -#------------------------------------------------------------------------------ - -set HAVE_PM2 yes - -if ver hwtypecmp V5X005000 V5X005001 V5X005002 -then - set HAVE_PM2 no -fi -if param compare -s ADC_ADS1115_EN 1 -then - ads1115 start -X - board_adc start -n -else - board_adc start -fi - - -if param compare SENS_EN_INA226 1 -then - # Start Digital power monitors - ina226 -X -b 1 -t 1 -k start - - if [ $HAVE_PM2 = yes ] - then - ina226 -X -b 2 -t 2 -k start - fi -fi - -if param compare SENS_EN_INA228 1 -then - # Start Digital power monitors - ina228 -X -b 1 -t 1 -k start - if [ $HAVE_PM2 = yes ] - then - ina228 -X -b 2 -t 2 -k start - fi -fi - -if param compare SENS_EN_INA238 1 -then - # Start Digital power monitors - ina238 -X -b 1 -t 1 -k start - if [ $HAVE_PM2 = yes ] - then - ina238 -X -b 2 -t 2 -k start - fi -fi - -if ver hwtypecmp V5X000000 V5X000001 V5X000002 V5X001000 V5X004000 V5X004001 V5X004002 V5X005001 V5X005002 -then - #FMUv5Xbase board orientation - - if ver hwtypecmp V5X000000 V5X000001 V5X004000 V5X004001 V5X005001 - then - # Internal SPI BMI088 - bmi088 -A -R 4 -s start - bmi088 -G -R 4 -s start - else - # Internal SPI bus ICM20649 - icm20649 -s -R 6 start - fi - - # Internal SPI bus ICM42688p - icm42688p -R 6 -s start - - # Internal SPI bus ICM-20602 (hard-mounted) - icm20602 -R 10 -s start - - # Internal magnetometer on I2c - bmm150 -I start - -else - #SKYNODE base fmu board orientation - - if ver hwtypecmp V5X009000 V5X009001 V5X00a000 V5X00a001 V5X008000 V5X008001 V5X010001 - then - # Internal SPI BMI088 - bmi088 -A -R 2 -s start - bmi088 -G -R 2 -s start - else - # Internal SPI bus ICM20649 - icm20649 -s -R 4 start - fi - - # Internal SPI bus ICM42688p - icm42688p -R 4 -s start - - # Internal SPI bus ICM-20602 (hard-mounted) - icm20602 -R 8 -s start - - # Internal magnetometer on I2c - bmm150 -I -R 6 start - -fi - -# External compass on GPS1/I2C1 (the 3rd external bus): standard Holybro Pixhawk 4 or CUAV V5 GPS/compass puck (with lights, safety button, and buzzer) -ist8310 -X -b 1 -R 10 start - -# Possible internal Baro - -# Disable startup of internal baros if param is set to false -if param compare SENS_INT_BARO_EN 1 -then - bmp388 -I -a 0x77 start - if ver hwtypecmp V5X000000 V5X001000 V5X008000 V5X009000 V5X00a000 - then - bmp388 -I start - else - bmp388 -X -b 2 start - fi - -fi -unset HAVE_PM2 diff --git a/boards/px4/fmu-v5x/nuttx-config/Kconfig b/boards/px4/fmu-v5x/nuttx-config/Kconfig deleted file mode 100644 index 520c5ab..0000000 --- a/boards/px4/fmu-v5x/nuttx-config/Kconfig +++ /dev/null @@ -1,17 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see misc/tools/kconfig-language.txt. -# -config BOARD_HAS_PROBES - bool "Board provides GPIO or other Hardware for signaling to timing analyze." - default y - ---help--- - This board provides GPIO FMU-CH1-8, CAP1 as PROBE_1-9 to provide timing signals from selected drivers. - -config BOARD_USE_PROBES - bool "Enable the use the board provided FMU-CH1-8, CAP1 as PROBE_1-9" - default n - depends on BOARD_HAS_PROBES - - ---help--- - Select to use GPIO FMU-CH1-8, CAP1 to provide timing signals from selected drivers. diff --git a/boards/px4/fmu-v5x/nuttx-config/include/board.h b/boards/px4/fmu-v5x/nuttx-config/include/board.h deleted file mode 100644 index 724ecd7..0000000 --- a/boards/px4/fmu-v5x/nuttx-config/include/board.h +++ /dev/null @@ -1,491 +0,0 @@ -/************************************************************************************ - * nuttx-configs/px4_fmu-v5x/include/board.h - * - * Copyright (C) 2016-2019 Gregory Nutt. All rights reserved. - * Authors: David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ -#ifndef __NUTTX_CONFIG_PX4_FMU_V5X_INCLUDE_BOARD_H -#define __NUTTX_CONFIG_PX4_FMU_V5X_INCLUDE_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The px4_fmu-v5 board provides the following clock sources: - * - * X301: 16 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 16 MHz RC factory-trimmed - * HSE: 16 MHz crystal for HSE - */ - -#define STM32_BOARD_XTAL 16000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 0 - -/* Main PLL Configuration. - * - * PLL source is HSE = 16,000,000 - * - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 2 <= PLLM <= 63 - * 192 <= PLLN <= 432 - * 192 MHz <= PLL_VCO <= 432MHz - * - * SYSCLK = PLL_VCO / PLLP - * Subject to - * - * PLLP = {2, 4, 6, 8} - * SYSCLK <= 216 MHz - * - * USB OTG FS, SDMMC and RNG Clock = PLL_VCO / PLLQ - * Subject to - * The USB OTG FS requires a 48 MHz clock to work correctly. The SDMMC - * and the random number generator need a frequency lower than or equal - * to 48 MHz to work correctly. - * - * 2 <= PLLQ <= 15 - */ - -/* Highest SYSCLK with USB OTG FS clock = 48 MHz - * - * PLL_VCO = (16,000,000 / 8) * 216 = 432 MHz - * SYSCLK = 432 MHz / 2 = 216 MHz - * USB OTG FS, SDMMC and RNG Clock = 432 MHz / 9 = 48 MHz - */ - -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(8) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(216) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(9) - -#define STM32_VCO_FREQUENCY ((STM32_HSE_FREQUENCY / 8) * 216) -#define STM32_SYSCLK_FREQUENCY (STM32_VCO_FREQUENCY / 2) -#define STM32_OTGFS_FREQUENCY (STM32_VCO_FREQUENCY / 9) - -/* Configure factors for PLLSAI clock */ - -#define CONFIG_STM32F7_PLLSAI 1 -#define STM32_RCC_PLLSAICFGR_PLLSAIN RCC_PLLSAICFGR_PLLSAIN(192) -#define STM32_RCC_PLLSAICFGR_PLLSAIP RCC_PLLSAICFGR_PLLSAIP(8) -#define STM32_RCC_PLLSAICFGR_PLLSAIQ RCC_PLLSAICFGR_PLLSAIQ(4) -#define STM32_RCC_PLLSAICFGR_PLLSAIR RCC_PLLSAICFGR_PLLSAIR(2) - -/* Configure Dedicated Clock Configuration Register */ - -#define STM32_RCC_DCKCFGR1_PLLI2SDIVQ RCC_DCKCFGR1_PLLI2SDIVQ(1) -#define STM32_RCC_DCKCFGR1_PLLSAIDIVQ RCC_DCKCFGR1_PLLSAIDIVQ(1) -#define STM32_RCC_DCKCFGR1_PLLSAIDIVR RCC_DCKCFGR1_PLLSAIDIVR(0) -#define STM32_RCC_DCKCFGR1_SAI1SRC RCC_DCKCFGR1_SAI1SEL(0) -#define STM32_RCC_DCKCFGR1_SAI2SRC RCC_DCKCFGR1_SAI2SEL(0) -#define STM32_RCC_DCKCFGR1_TIMPRESRC 0 -#define STM32_RCC_DCKCFGR1_DFSDM1SRC 0 -#define STM32_RCC_DCKCFGR1_ADFSDM1SRC 0 - - - -/* Configure factors for PLLI2S clock */ - -#define CONFIG_STM32F7_PLLI2S 1 -#define STM32_RCC_PLLI2SCFGR_PLLI2SN RCC_PLLI2SCFGR_PLLI2SN(192) -#define STM32_RCC_PLLI2SCFGR_PLLI2SP RCC_PLLI2SCFGR_PLLI2SP(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SQ RCC_PLLI2SCFGR_PLLI2SQ(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SR RCC_PLLI2SCFGR_PLLI2SR(2) - -/* Configure Dedicated Clock Configuration Register 2 */ - -#define STM32_RCC_DCKCFGR2_USART1SRC RCC_DCKCFGR2_USART1SEL_APB -#define STM32_RCC_DCKCFGR2_USART2SRC RCC_DCKCFGR2_USART2SEL_APB -#define STM32_RCC_DCKCFGR2_UART4SRC RCC_DCKCFGR2_UART4SEL_APB -#define STM32_RCC_DCKCFGR2_UART5SRC RCC_DCKCFGR2_UART5SEL_APB -#define STM32_RCC_DCKCFGR2_USART6SRC RCC_DCKCFGR2_USART6SEL_APB -#define STM32_RCC_DCKCFGR2_UART7SRC RCC_DCKCFGR2_UART7SEL_APB -#define STM32_RCC_DCKCFGR2_UART8SRC RCC_DCKCFGR2_UART8SEL_APB -#define STM32_RCC_DCKCFGR2_I2C1SRC RCC_DCKCFGR2_I2C1SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C2SRC RCC_DCKCFGR2_I2C2SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C3SRC RCC_DCKCFGR2_I2C3SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C4SRC RCC_DCKCFGR2_I2C4SEL_HSI -#define STM32_RCC_DCKCFGR2_LPTIM1SRC RCC_DCKCFGR2_LPTIM1SEL_APB -#define STM32_RCC_DCKCFGR2_CECSRC RCC_DCKCFGR2_CECSEL_HSI -#define STM32_RCC_DCKCFGR2_CK48MSRC RCC_DCKCFGR2_CK48MSEL_PLL -#define STM32_RCC_DCKCFGR2_SDMMCSRC RCC_DCKCFGR2_SDMMCSEL_48MHZ -#define STM32_RCC_DCKCFGR2_SDMMC2SRC RCC_DCKCFGR2_SDMMC2SEL_48MHZ -#define STM32_RCC_DCKCFGR2_DSISRC RCC_DCKCFGR2_DSISEL_PHY - - -/* Several prescalers allow the configuration of the two AHB buses, the - * high-speed APB (APB2) and the low-speed APB (APB1) domains. The maximum - * frequency of the two AHB buses is 216 MHz while the maximum frequency of - * the high-speed APB domains is 108 MHz. The maximum allowed frequency of - * the low-speed APB domain is 54 MHz. - */ - -/* AHB clock (HCLK) is SYSCLK (216 MHz) */ - -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (54 MHz) */ - -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (108MHz) */ - -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* SDMMC dividers. Note that slower clocking is required when DMA is disabled - * in order to avoid RX overrun/TX underrun errors due to delayed responses - * to service FIFOs in interrupt driven mode. These values have not been - * tuned!!! - * - * SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(118+2)=400 KHz - */ - -/* Use the Falling edge of the SDIO_CLK clock to change the edge the - * data and commands are change on - */ - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - -#define STM32_SDMMC_INIT_CLKDIV (118 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* DMA ON: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(1+2)=16 MHz - * DMA OFF: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32F7_SDMMC_DMA -# define STM32_SDMMC_MMCXFR_CLKDIV (1 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (2 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -/* DMA ON: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(1+2)=16 MHz - * DMA OFF: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(2+2)=12 MHz - */ -//TODO #warning "Check Freq for 24mHz" - -#ifdef CONFIG_STM32F7_SDMMC_DMA -# define STM32_SDMMC_SDXFR_CLKDIV (1 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (2 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -/* FLASH wait states - * - * --------- ---------- ----------- - * VDD MAX SYSCLK WAIT STATES - * --------- ---------- ----------- - * 1.7-2.1 V 180 MHz 8 - * 2.1-2.4 V 216 MHz 9 - * 2.4-2.7 V 216 MHz 8 - * 2.7-3.6 V 216 MHz 7 - * --------- ---------- ----------- - */ - -#define BOARD_FLASH_WAITSTATES 7 - -/* LED definitions ******************************************************************/ -/* The px4_fmu-v5 board has numerous LEDs but only three, LED_GREEN a Green LED, LED_BLUE - * a Blue LED and LED_RED a Red LED, that can be controlled by software. - * - * If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any way. - * The following definitions are used to access individual LEDs. - */ - -/* LED index values for use with board_userled() */ - -#define BOARD_LED1 0 -#define BOARD_LED2 1 -#define BOARD_LED3 2 -#define BOARD_NLEDS 3 - -#define BOARD_LED_RED BOARD_LED1 -#define BOARD_LED_GREEN BOARD_LED2 -#define BOARD_LED_BLUE BOARD_LED3 - -/* LED bits for use with board_userled_all() */ - -#define BOARD_LED1_BIT (1 << BOARD_LED1) -#define BOARD_LED2_BIT (1 << BOARD_LED2) -#define BOARD_LED3_BIT (1 << BOARD_LED3) - -/* If CONFIG_ARCH_LEDS is defined, the usage by the board port is defined in - * include/board.h and src/stm32_leds.c. The LEDs are used to encode OS-related - * events as follows: - * - * - * SYMBOL Meaning LED state - * Red Green Blue - * ---------------------- -------------------------- ------ ------ ----*/ - -#define LED_STARTED 0 /* NuttX has been started OFF OFF OFF */ -#define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF OFF ON */ -#define LED_IRQSENABLED 2 /* Interrupts enabled OFF ON OFF */ -#define LED_STACKCREATED 3 /* Idle stack created OFF ON ON */ -#define LED_INIRQ 4 /* In an interrupt N/C N/C GLOW */ -#define LED_SIGNAL 5 /* In a signal handler N/C GLOW N/C */ -#define LED_ASSERTION 6 /* An assertion failed GLOW N/C GLOW */ -#define LED_PANIC 7 /* The system has crashed Blink OFF N/C */ -#define LED_IDLE 8 /* MCU is is sleep mode ON OFF OFF */ - -/* Thus if the Green LED is statically on, NuttX has successfully booted and - * is, apparently, running normally. If the Red LED is flashing at - * approximately 2Hz, then a fatal error has been detected and the system - * has halted. - */ - -/* Alternate function pin selections ************************************************/ - -#define GPIO_USART1_RX GPIO_USART1_RX_3 /* PB15 */ -#define GPIO_USART1_TX GPIO_USART1_TX_3 /* PB14 */ - -#define GPIO_USART2_RX GPIO_USART2_RX_1 /* PA3 */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 /* PD4 */ -#define GPIO_USART2_CTS GPIO_USART2_CTS_2 /* PD3 */ - -#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ -#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ - -#define GPIO_UART4_RX GPIO_UART4_RX_5 /* PH14 */ -#define GPIO_UART4_TX GPIO_UART4_TX_5 /* PH13 */ - -#define GPIO_UART5_RX GPIO_UART5_RX_1 /* PD2 */ -#define GPIO_UART5_TX GPIO_UART5_TX_4 /* PB9 */ -#define GPIO_UART5_RTS GPIO_UART5_RTS_1 /* PC8 */ -#define GPIO_UART5_CTS GPIO_UART5_CTS_1 /* PC9 */ - -#define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC 7 */ -#define GPIO_USART6_TX GPIO_USART6_TX_1 /* PC6 */ - -#define GPIO_UART7_RX GPIO_UART7_RX_2 /* PF6 */ -#define GPIO_UART7_TX GPIO_UART7_TX_1 /* PE8 */ -#define GPIO_UART7_RTS GPIO_UART7_RTS_1 /* PE9 */ -#define GPIO_UART7_CTS GPIO_UART7_CTS_1 /* PE10 */ - -/* UART8: has no remap - * - * GPIO_UART8_RX PE0 - * GPIO_UART8_TX PE1 - */ - - -/* CAN - * - * CAN1 is routed to transceiver. - * CAN2 is routed to transceiver. - */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 /* PD0 */ -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 /* PD1 */ -#define GPIO_CAN2_RX GPIO_CAN2_RX_1 /* PB12 */ -#define GPIO_CAN2_TX GPIO_CAN2_TX_2 /* PB6 */ - -/* SPI - * SPI1 is sensors1 - * SPI2 is sensors2 - * SPI3 is sensors3 - * SPI4 is Not Used - * SPI5 is FRAM - * SPI6 is EXTERNAL1 - * - */ - -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_2 /* PB4 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_2 /* PB5 */ -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 /* PA5 */ - -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_3 /* PI2 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_3 /* PI3 */ -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_5 /* PI1 */ - -#define GPIO_SPI3_MISO GPIO_SPI3_MISO_2 /* PC11 */ -#define GPIO_SPI3_MOSI GPIO_SPI3_MOSI_1 /* PB2 */ -#define GPIO_SPI3_SCK GPIO_SPI3_SCK_2 /* PC10 */ - -#define GPIO_SPI5_MISO GPIO_SPI5_MISO_1 /* PF8 */ -#define GPIO_SPI5_MOSI GPIO_SPI5_MOSI_2 /* PF11 */ -#define GPIO_SPI5_SCK GPIO_SPI5_SCK_1 /* PF7 */ - -#define GPIO_SPI6_MISO GPIO_SPI6_MISO_2 /* PA6 */ -#define GPIO_SPI6_MOSI GPIO_SPI6_MOSI_1 /* PG14 */ -#define GPIO_SPI6_SCK GPIO_SPI6_SCK_3 /* PB3 */ - -/* I2C - * - * The optional _GPIO configurations allow the I2C driver to manually - * reset the bus to clear stuck slaves. They match the pin configuration, - * but are normally-high GPIOs. - * - */ - -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 /* PB8 */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_1 /* PB7 */ - -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_2 /* PF1 */ -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_2 /* PF0 */ - -#define GPIO_I2C3_SCL GPIO_I2C3_SCL_2 /* PH7 */ -#define GPIO_I2C3_SDA GPIO_I2C3_SDA_2 /* PH8 */ - -#define GPIO_I2C4_SCL GPIO_I2C4_SCL_2 /* PF14 */ -#define GPIO_I2C4_SDA GPIO_I2C4_SDA_2 /* PF15 */ - -/* SDMMC2 - * - * VDD 3.3 - * GND - * SDMMC2_CK PD6 - * SDMMC2_CMD PD7 - * SDMMC2_D0 PG9 - * SDMMC2_D1 PG10 - * SDMMC2_D2 PG11 - * SDMMC2_D3 PG12 - */ - -#define GPIO_SDMMC2_D0 GPIO_SDMMC2_D0_2 -#define GPIO_SDMMC2_D1 GPIO_SDMMC2_D1_2 -#define GPIO_SDMMC2_D2 GPIO_SDMMC2_D2_2 -#define GPIO_SDMMC2_D3 GPIO_SDMMC2_D3_2 - -/* The STM32 F7 connects to a TI DP83848TSQ/NOPB - * using RMII - * - * STM32 F7 BOARD DP83848TSQ/NOPB - * GPIO SIGNAL PIN NAME - * -------- ------------ ------------- - * PA7 ETH_CRS_DV CRS_DV - * PC1 ETH_MDC MDC - * PA2 ETH_MDIO MDIO - * PA1 ETH_REF_CL X1 - * PC4 ETH_RXD0 RX_D0 - * PC5 ETH_RXD1 RX_D1 - * PB11 ETH_TX_EN TX_EN - * PG13 ETH_TXD0 TX_D0 - * PB13 ETH_TXD1 TX_D1 - * - * The PHY address is 1, since COL/PHYAD0 features a pull up. - */ - -#define GPIO_ETH_RMII_TX_EN GPIO_ETH_RMII_TX_EN_1 -#define GPIO_ETH_RMII_TXD0 GPIO_ETH_RMII_TXD0_2 -#define GPIO_ETH_RMII_TXD1 GPIO_ETH_RMII_TXD1_1 - - -/* USB - * - * OTG_FS_DM PA11 - * OTG_FS_DP PA12 - * VBUS PA9 - */ - - -/* Board provides GPIO or other Hardware for signaling to timing analyzer */ - -#if defined(CONFIG_BOARD_USE_PROBES) -# include "stm32_gpio.h" -# define PROBE_N(n) (1<<((n)-1)) -# define PROBE_1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN14) /* PE14 AUX1 */ -# define PROBE_2 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN10) /* PA10 AUX2 */ -# define PROBE_3 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN11) /* PE11 AUX3 */ -# define PROBE_4 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN8) /* PA8 AUX4 */ -# define PROBE_5 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN13) /* PD13 AUX5 */ -# define PROBE_6 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN14) /* PD14 AUX6 */ -# define PROBE_7 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN6) /* PH6 AUX7 */ -# define PROBE_8 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN9) /* PH9 AUX8 */ -# define PROBE_9 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTI|GPIO_PIN0) /* PI0 CAP1 */ - -# define PROBE_INIT(mask) \ - do { \ - if ((mask)& PROBE_N(1)) { stm32_configgpio(PROBE_1); } \ - if ((mask)& PROBE_N(2)) { stm32_configgpio(PROBE_2); } \ - if ((mask)& PROBE_N(3)) { stm32_configgpio(PROBE_3); } \ - if ((mask)& PROBE_N(4)) { stm32_configgpio(PROBE_4); } \ - if ((mask)& PROBE_N(5)) { stm32_configgpio(PROBE_5); } \ - if ((mask)& PROBE_N(6)) { stm32_configgpio(PROBE_6); } \ - if ((mask)& PROBE_N(7)) { stm32_configgpio(PROBE_7); } \ - if ((mask)& PROBE_N(8)) { stm32_configgpio(PROBE_8); } \ - if ((mask)& PROBE_N(9)) { stm32_configgpio(PROBE_9); } \ - } while(0) - -# define PROBE(n,s) do {stm32_gpiowrite(PROBE_##n,(s));}while(0) -# define PROBE_MARK(n) PROBE(n,false);PROBE(n,true) -#else -# define PROBE_INIT(mask) -# define PROBE(n,s) -# define PROBE_MARK(n) -#endif - -#endif /*__NUTTX_CONFIG_PX4_FMU_V5X_INCLUDE_BOARD_H */ diff --git a/boards/px4/fmu-v5x/nuttx-config/include/board_dma_map.h b/boards/px4/fmu-v5x/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 9bc2f46..0000000 --- a/boards/px4/fmu-v5x/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/* -| DMA1 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | SPI3_RX_1 | SPDIFRX_DT | SPI3_RX_2 | SPI2_RX | SPI2_TX | SPI3_TX_1 | SPDIFRX_CS | SPI3_TX_2 | -| Channel 1 | I2C1_RX | I2C3_RX | TIM7_UP_1 | - | TIM7_UP_2 | I2C1_RX_1 | I2C1_TX | I2C1_TX_1 | -| Channel 2 | TIM4_CH1 | - | I2C4_RX | TIM4_CH2 | - | I2C4_RX | TIM4_UP | TIM4_CH3 | -| Channel 3 | - | TIM2_UP_1 | I2C3_RX_1 | - | I2C3_TX | TIM2_CH1 | TIM2_CH2 | TIM2_UP_2 | -| | | TIM2_CH3 | | | | | TIM2_CH4_1 | TIM2_CH4_2 | -| Channel 4 | UART5_RX | USART3_RX | UART4_RX | USART3_TX_1 | UART4_TX | USART2_RX | USART2_TX | UART5_TX | -| Channel 5 | UART8_TX | UART7_TX | TIM3_CH4 | UART7_RX | TIM3_CH1 | TIM3_CH2 | UART8_RX | TIM3_CH3 | -| | | | TIM3_UP | | TIM3_TRIG | | | | -| Channel 6 | TIM5_CH3 | TIM5_CH4_1 | TIM5_CH1 | TIM5_CH4_2 | TIM5_CH2 | - | TIM5_UP_2 | - | -| | TIM5_UP_1 | TIM5_TRIG_1 | | TIM5_TRIG_2 | | | | | -| Channel 7 | - | TIM6_UP | I2C2_RX | I2C2_RX_1 | USART3_TX_2 | DAC1 | DAC2 | I2C2_TX | -| Channel 8 | I2C3_TX | I2C4_RX | - | - | I2C2_TX | - | I2C4_TX | - | -| Channel 9 | - | SPI2_RX | - | - | - | - | SPI2_TX | - | -| | | | | | | | | | -| Usage | UART5_RX | SPI2_RX | SPI3_RX_2 | UART7_RX | SPI2_TX | SPI3_TX_1 | TIM4_UP | UART5_TX | - - -| DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | ADC1_1 | SAI1_A | TIM8_CH1_1 | SAI1_A_1 | ADC1_2 | SAI1_B_1 | TIM1_CH1_1 | SAI2_B_2 | -| | | | TIM8_CH2_1 | | | | TIM1_CH2_1 | | -| | | | TIM8_CH3_1 | | | | TIM1_CH3_1 | | -| Channel 1 | - | DCMI_1 | ADC2_1 | ADC2_2 | SAI1_B | SPI6_TX | SPI6_RX | DCMI_2 | -| Channel 2 | ADC3_1 | ADC3_2 | - | SPI5_RX_1 | SPI5_TX_1 | CRYP_OUT | CRYP_IN | HASH_IN | -| Channel 3 | SPI1_RX_1 | - | SPI1_RX_2 | SPI1_TX_1 | SAI2_A | SPI1_TX_2 | SAI2_B | QUADSPI | -| Channel 4 | SPI4_RX_1 | SPI4_TX_1 | USART1_RX_1 | SDMMC1_1 | - | USART1_RX_2 | SDMMC1_2 | USART1_TX | -| Channel 5 | - | USART6_RX_1 | USART6_RX_2 | SPI4_RX_2 | SPI4_TX_2 | - | USART6_TX_1 | USART6_TX_2 | -| Channel 6 | TIM1_TRIG_1 | TIM1_CH1_2 | TIM1_CH2_2 | TIM1_CH1 | TIM1_CH4 | TIM1_UP | TIM1_CH3_2 | - | -| | | | | | TIM1_TRIG_2 | | | | -| | | | | | TIM1_COM | | | | -| Channel 7 | - | TIM8_UP | TIM8_CH1_2 | TIM8_CH2_2 | TIM8_CH3_2 | SPI5_RX_2 | SPI5_TX_2 | TIM8_CH4 | -| | | | | | | | | TIM8_TRIG | -| | | | | | | | | TIM8_COM | -| Channel 8 | DSFDM1_FLT0 | DSFDM1_FLT1 | DSFDM1_FLT2 | DSFDM1_FLT3 | DSFDM1_FLT0 | DSFDM1_FLT1 | DSFDM1_FLT2 | DSFDM1_FLT3 | -| Channel 9 | JPEG_IN | JPEG_OUT | SPI4_TX | JPEG_IN | JPEG_OUT | SPI5_RX | - | - | -| Channel 10 | SAI1_B | SAI2_B | SAI2_A | - | - | - | SAI1_A | - | -| Channel 11 | SDMMC2 | - | QUADSPI | - | - | SDMMC2 | - | - | -| | | | | | | | | | -| Usage | SDMMC2 | USART6_RX_1 | SPI1_RX_2 | SPI1_TX_1 | | TIM1_UP | | USART6_TX_2 | - */ - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// DMAMAP_UART5_RX // DMA1, Stream 0, Channel 4 (TELEM2 RX) -#define DMAMAP_SPI2_RX DMAMAP_SPI2_RX_1 // DMA1, Stream 1, Channel 9 (SPI2 RX) -#define DMAMAP_SPI3_RX DMAMAP_SPI3_RX_2 // DMA1, Stream 2, Channel 0 (SPI3 RX) -// DMAMAP_UART7_RX // DMA1, Stream 3, Channel 5 (TELEM1 RX) -#define DMAMAP_SPI2_TX DMAMAP_SPI2_TX_2 // DMA1, Stream 4, Channel 0 (SPI2 TX) -#define DMAMAP_SPI3_TX DMAMAP_SPI3_TX_1 // DMA1, Stream 5, Channel 0 (SPI3 TX) -// DMAMAP_TIM4_UP // DMA1, Stream 6, Channel 2 (DSHOT) -// DMAMAP_UART5_TX // DMA1, Stream 7, Channel 4 (TELEM2 TX) - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMAMAP_SDMMC2 DMAMAP_SDMMC2_1 // DMA2, Stream 0, Channel 11 -#define DMAMAP_USART6_RX DMAMAP_USART6_RX_1 // DMA2, Stream 1, Channel 5 (PX4IO) -#define DMAMAP_SPI1_RX DMAMAP_SPI1_RX_2 // DMA2, Stream 2, Channel 3 (SPI sensors RX) -#define DMAMAP_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 3, Channel 3 (SPI sensors TX) -// AVAILABLE // DMA2, Stream 4 -// DMAMAP_TIM1_UP // DMA2, Stream 5, Channel 6 (DSHOT) -// AVAILABLE // DMA2, Stream 6 -#define DMAMAP_USART6_TX DMAMAP_USART6_TX_2 // DMA2, Stream 7, Channel 5 (PX4IO) diff --git a/boards/px4/fmu-v5x/nuttx-config/nsh/defconfig b/boards/px4/fmu-v5x/nuttx-config/nsh/defconfig deleted file mode 100644 index 5de6af2..0000000 --- a/boards/px4/fmu-v5x/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,323 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_ARP is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_IFCONFIG is not set -# CONFIG_NSH_DISABLE_IFUPDOWN is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_NSLOOKUP is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TELNETD is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/px4/fmu-v5x/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32f7" -CONFIG_ARCH_CHIP_STM32F765II=y -CONFIG_ARCH_CHIP_STM32F7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0033 -CONFIG_CDCACM_PRODUCTSTR="PX4 FMU v5X.x" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x3185 -CONFIG_CDCACM_VENDORSTR="Auterion" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_GPIO=y -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_ETH0_PHY_LAN8742A=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FSUTILS_IPCFG=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_IOB_NBUFFERS=24 -CONFIG_IOB_THROTTLE=0 -CONFIG_IPCFG_BINARY=y -CONFIG_IPCFG_CHARDEV=y -CONFIG_IPCFG_PATH="/fs/mtd_net" -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=3 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NET=y -CONFIG_NETDB_DNSCLIENT=y -CONFIG_NETDB_DNSCLIENT_ENTRIES=8 -CONFIG_NETDB_DNSSERVER_NOADDR=y -CONFIG_NETDEV_PHY_IOCTL=y -CONFIG_NETINIT_DHCPC=y -CONFIG_NETINIT_DNS=y -CONFIG_NETINIT_DNSIPADDR=0XC0A800FE -CONFIG_NETINIT_DRIPADDR=0XC0A800FE -CONFIG_NETINIT_MONITOR=y -CONFIG_NETINIT_THREAD=y -CONFIG_NETINIT_THREAD_PRIORITY=49 -CONFIG_NETUTILS_TELNETD=y -CONFIG_NET_ARP_IPIN=y -CONFIG_NET_ARP_SEND=y -CONFIG_NET_BROADCAST=y -CONFIG_NET_ETH_PKTSIZE=1518 -CONFIG_NET_ICMP=y -CONFIG_NET_ICMP_SOCKET=y -CONFIG_NET_NACTIVESOCKETS=16 -CONFIG_NET_SOLINGER=y -CONFIG_NET_TCP=y -CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_DELAYED_ACK=y -CONFIG_NET_TCP_WRITE_BUFFERS=y -CONFIG_NET_UDP=y -CONFIG_NET_UDP_CHECKSUMS=y -CONFIG_NET_UDP_WRITE_BUFFERS=y -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_TELNET=y -CONFIG_NSH_TELNET_LOGIN=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC2_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32F7_ADC1=y -CONFIG_STM32F7_ADC3=y -CONFIG_STM32F7_BBSRAM=y -CONFIG_STM32F7_BBSRAM_FILES=5 -CONFIG_STM32F7_BKPSRAM=y -CONFIG_STM32F7_DMA1=y -CONFIG_STM32F7_DMA2=y -CONFIG_STM32F7_DMACAPABLE=y -CONFIG_STM32F7_ETHMAC=y -CONFIG_STM32F7_FLOWCONTROL_BROKEN=y -CONFIG_STM32F7_I2C1=y -CONFIG_STM32F7_I2C2=y -CONFIG_STM32F7_I2C3=y -CONFIG_STM32F7_I2C4=y -CONFIG_STM32F7_I2C_DYNTIMEO=y -CONFIG_STM32F7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32F7_OTGFS=y -CONFIG_STM32F7_PHYADDR=0 -CONFIG_STM32F7_PHYSR=31 -CONFIG_STM32F7_PHYSR_100MBPS=0x8 -CONFIG_STM32F7_PHYSR_FULLDUPLEX=0x10 -CONFIG_STM32F7_PHYSR_MODE=0x10 -CONFIG_STM32F7_PHYSR_SPEED=0x8 -CONFIG_STM32F7_PHY_POLLING=y -CONFIG_STM32F7_PROGMEM=y -CONFIG_STM32F7_PWR=y -CONFIG_STM32F7_RTC=y -CONFIG_STM32F7_RTC_AUTO_LSECLOCK_START_DRV_CAPABILITY=y -CONFIG_STM32F7_RTC_MAGIC_REG=1 -CONFIG_STM32F7_SAVE_CRASHDUMP=y -CONFIG_STM32F7_SDMMC2=y -CONFIG_STM32F7_SDMMC_DMA=y -CONFIG_STM32F7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32F7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32F7_SPI1=y -CONFIG_STM32F7_SPI1_DMA=y -CONFIG_STM32F7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI2=y -CONFIG_STM32F7_SPI2_DMA=y -CONFIG_STM32F7_SPI2_DMA_BUFFER=4096 -CONFIG_STM32F7_SPI3=y -CONFIG_STM32F7_SPI3_DMA=y -CONFIG_STM32F7_SPI3_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI5=y -CONFIG_STM32F7_SPI6=y -CONFIG_STM32F7_SPI_DMATHRESHOLD=8 -CONFIG_STM32F7_TIM10=y -CONFIG_STM32F7_TIM11=y -CONFIG_STM32F7_TIM3=y -CONFIG_STM32F7_TIM9=y -CONFIG_STM32F7_UART4=y -CONFIG_STM32F7_UART5=y -CONFIG_STM32F7_UART7=y -CONFIG_STM32F7_UART8=y -CONFIG_STM32F7_USART1=y -CONFIG_STM32F7_USART2=y -CONFIG_STM32F7_USART3=y -CONFIG_STM32F7_USART6=y -CONFIG_STM32F7_USART_BREAKS=y -CONFIG_STM32F7_USART_INVERT=y -CONFIG_STM32F7_USART_SINGLEWIRE=y -CONFIG_STM32F7_USART_SWAP=y -CONFIG_STM32F7_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_DHCPC_RENEW=y -CONFIG_SYSTEM_NSH=y -CONFIG_SYSTEM_PING=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART5_IFLOWCONTROL=y -CONFIG_UART5_OFLOWCONTROL=y -CONFIG_UART5_RXBUFSIZE=600 -CONFIG_UART5_RXDMA=y -CONFIG_UART5_TXBUFSIZE=3000 -CONFIG_UART5_TXDMA=y -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_IFLOWCONTROL=y -CONFIG_UART7_OFLOWCONTROL=y -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_RXDMA=y -CONFIG_UART7_TXBUFSIZE=3000 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_TXBUFSIZE=3000 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_RXBUFSIZE=180 -CONFIG_USART3_SERIAL_CONSOLE=y -CONFIG_USART3_TXBUFSIZE=1500 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/px4/fmu-v5x/nuttx-config/scripts/script.ld b/boards/px4/fmu-v5x/nuttx-config/scripts/script.ld deleted file mode 100644 index 8d5a78d..0000000 --- a/boards/px4/fmu-v5x/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,190 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F765IIT6 has 2048 KiB of main FLASH memory. This FLASH memory - * can be accessed from either the AXIM interface at address 0x0800:0000 or - * from the ITCM interface at address 0x0020:0000. - * - * Additional information, including the option bytes, is available at at - * FLASH at address 0x1ff0:0000 (AXIM) or 0x0010:0000 (ITCM). - * - * In the STM32F765IIT6, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash on ITCM at 0x0020:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x0010:0000 - * - * NuttX does not modify these option byes. On the unmodified NUCLEO-144 - * board, the BOOT0 pin is at ground so by default, the STM32F765IIT6 will - * boot from address 0x0020:0000 in ITCM FLASH. - * - * The STM32F765IIT6 also has 512 KiB of data SRAM (in addition to ITCM SRAM). - * SRAM is split up into three blocks: - * - * 1) 128 KiB of DTCM SRM beginning at address 0x2000:0000 - * 2) 368 KiB of SRAM1 beginning at address 0x2002:0000 - * 3) 16 KiB of SRAM2 beginning at address 0x2007:c000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * Bootloader reserves the first 32K bank (2 Mbytes Flash memory single bank) - * organization (256 bits read width) - */ - -MEMORY -{ - FLASH_ITCM (rx) : ORIGIN = 0x00208000, LENGTH = 2016K - FLASH_AXIM (rx) : ORIGIN = 0x08008000, LENGTH = 2016K - - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 16K - DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - SRAM1 (rwx) : ORIGIN = 0x20020000, LENGTH = 368K - SRAM2 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) -EXTERN(board_get_manifest) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH_AXIM - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH_AXIM - - /* - * Construction data for parameters. - */ - __param ALIGN(4): { - __param_start = ABSOLUTE(.); - KEEP(*(__param*)) - __param_end = ABSOLUTE(.); - } > FLASH_AXIM - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH_AXIM - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH_AXIM - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > SRAM1 AT > FLASH_AXIM - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > SRAM1 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } - - .ramfunc : { - _sramfuncs = .; - *(.ramfunc .ramfunc.*) - . = ALIGN(4); - _eramfuncs = .; - } > ITCM_RAM AT > FLASH_AXIM - - _framfuncs = LOADADDR(.ramfunc); -} diff --git a/boards/px4/fmu-v5x/nuttx-config/test/defconfig b/boards/px4/fmu-v5x/nuttx-config/test/defconfig deleted file mode 100644 index 2b8361d..0000000 --- a/boards/px4/fmu-v5x/nuttx-config/test/defconfig +++ /dev/null @@ -1,324 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_ARP is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_IFCONFIG is not set -# CONFIG_NSH_DISABLE_IFUPDOWN is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_NSLOOKUP is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/px4/fmu-v5x/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32f7" -CONFIG_ARCH_CHIP_STM32F765II=y -CONFIG_ARCH_CHIP_STM32F7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0033 -CONFIG_CDCACM_PRODUCTSTR="PX4 FMU v5X.x" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x3185 -CONFIG_CDCACM_VENDORSTR="Auterion" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_GPIO=y -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_ETH0_PHY_LAN8742A=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FSUTILS_IPCFG=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_IOB_NBUFFERS=24 -CONFIG_IOB_THROTTLE=0 -CONFIG_IPCFG_BINARY=y -CONFIG_IPCFG_CHARDEV=y -CONFIG_IPCFG_PATH="/fs/mtd_net" -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=3 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NET=y -CONFIG_NETDB_DNSCLIENT=y -CONFIG_NETDB_DNSCLIENT_ENTRIES=8 -CONFIG_NETDB_DNSSERVER_NOADDR=y -CONFIG_NETDEV_PHY_IOCTL=y -CONFIG_NETINIT_DHCPC=y -CONFIG_NETINIT_DNS=y -CONFIG_NETINIT_DNSIPADDR=0XC0A800FE -CONFIG_NETINIT_DRIPADDR=0XC0A800FE -CONFIG_NETINIT_THREAD=y -CONFIG_NETINIT_THREAD_PRIORITY=49 -CONFIG_NETUTILS_TELNETD=y -CONFIG_NET_ARP_IPIN=y -CONFIG_NET_ARP_SEND=y -CONFIG_NET_BROADCAST=y -CONFIG_NET_ETH_PKTSIZE=1518 -CONFIG_NET_ICMP=y -CONFIG_NET_ICMP_SOCKET=y -CONFIG_NET_SOLINGER=y -CONFIG_NET_TCP=y -CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_DELAYED_ACK=y -CONFIG_NET_TCP_WRITE_BUFFERS=y -CONFIG_NET_UDP=y -CONFIG_NET_UDP_CHECKSUMS=y -CONFIG_NET_UDP_WRITE_BUFFERS=y -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_TELNET=y -CONFIG_NSH_TELNET_LOGIN=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC2_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32F7_ADC1=y -CONFIG_STM32F7_ADC3=y -CONFIG_STM32F7_BBSRAM=y -CONFIG_STM32F7_BBSRAM_FILES=5 -CONFIG_STM32F7_BKPSRAM=y -CONFIG_STM32F7_DMA1=y -CONFIG_STM32F7_DMA2=y -CONFIG_STM32F7_DMACAPABLE=y -CONFIG_STM32F7_ETHMAC=y -CONFIG_STM32F7_FLOWCONTROL_BROKEN=y -CONFIG_STM32F7_I2C1=y -CONFIG_STM32F7_I2C2=y -CONFIG_STM32F7_I2C3=y -CONFIG_STM32F7_I2C4=y -CONFIG_STM32F7_I2C_DYNTIMEO=y -CONFIG_STM32F7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32F7_OTGFS=y -CONFIG_STM32F7_PHYADDR=0 -CONFIG_STM32F7_PHYSR=31 -CONFIG_STM32F7_PHYSR_100MBPS=0x8 -CONFIG_STM32F7_PHYSR_FULLDUPLEX=0x10 -CONFIG_STM32F7_PHYSR_MODE=0x10 -CONFIG_STM32F7_PHYSR_SPEED=0x8 -CONFIG_STM32F7_PHY_POLLING=y -CONFIG_STM32F7_PROGMEM=y -CONFIG_STM32F7_PWR=y -CONFIG_STM32F7_RTC=y -CONFIG_STM32F7_RTC_AUTO_LSECLOCK_START_DRV_CAPABILITY=y -CONFIG_STM32F7_RTC_MAGIC_REG=1 -CONFIG_STM32F7_SAVE_CRASHDUMP=y -CONFIG_STM32F7_SDMMC2=y -CONFIG_STM32F7_SDMMC_DMA=y -CONFIG_STM32F7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32F7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32F7_SPI1=y -CONFIG_STM32F7_SPI1_DMA=y -CONFIG_STM32F7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI2=y -CONFIG_STM32F7_SPI2_DMA=y -CONFIG_STM32F7_SPI2_DMA_BUFFER=4096 -CONFIG_STM32F7_SPI3=y -CONFIG_STM32F7_SPI3_DMA=y -CONFIG_STM32F7_SPI3_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI5=y -CONFIG_STM32F7_SPI6=y -CONFIG_STM32F7_SPI_DMATHRESHOLD=8 -CONFIG_STM32F7_TIM10=y -CONFIG_STM32F7_TIM11=y -CONFIG_STM32F7_TIM3=y -CONFIG_STM32F7_TIM9=y -CONFIG_STM32F7_UART4=y -CONFIG_STM32F7_UART5=y -CONFIG_STM32F7_UART7=y -CONFIG_STM32F7_UART8=y -CONFIG_STM32F7_USART1=y -CONFIG_STM32F7_USART2=y -CONFIG_STM32F7_USART3=y -CONFIG_STM32F7_USART6=y -CONFIG_STM32F7_USART_BREAKS=y -CONFIG_STM32F7_USART_INVERT=y -CONFIG_STM32F7_USART_SINGLEWIRE=y -CONFIG_STM32F7_USART_SWAP=y -CONFIG_STM32F7_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_DHCPC_RENEW=y -CONFIG_SYSTEM_NSH=y -CONFIG_SYSTEM_PING=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TESTING_OSTEST=y -CONFIG_TESTING_OSTEST_FPUTESTDISABLE=y -CONFIG_TESTING_OSTEST_STACKSIZE=10240 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART5_IFLOWCONTROL=y -CONFIG_UART5_OFLOWCONTROL=y -CONFIG_UART5_RXBUFSIZE=600 -CONFIG_UART5_RXDMA=y -CONFIG_UART5_TXBUFSIZE=3000 -CONFIG_UART5_TXDMA=y -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_IFLOWCONTROL=y -CONFIG_UART7_OFLOWCONTROL=y -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_RXDMA=y -CONFIG_UART7_TXBUFSIZE=3000 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_TXBUFSIZE=3000 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_RXBUFSIZE=180 -CONFIG_USART3_SERIAL_CONSOLE=y -CONFIG_USART3_TXBUFSIZE=1500 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/px4/fmu-v5x/src/CMakeLists.txt b/boards/px4/fmu-v5x/src/CMakeLists.txt deleted file mode 100644 index 684b117..0000000 --- a/boards/px4/fmu-v5x/src/CMakeLists.txt +++ /dev/null @@ -1,59 +0,0 @@ -############################################################################ -# -# Copyright (c) 2016 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. -# -############################################################################ - -add_library(drivers_board - can.c - i2c.cpp - init.cpp - led.c - manifest.c - mtd.cpp - sdio.c - spi.cpp - timer_config.cpp - usb.c -) - -add_dependencies(drivers_board platform_gpio_mcp23009) - -target_link_libraries(drivers_board - PRIVATE - arch_io_pins - arch_spi - arch_board_hw_info - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer - platform_gpio_mcp23009 -) diff --git a/boards/px4/fmu-v5x/src/board_config.h b/boards/px4/fmu-v5x/src/board_config.h deleted file mode 100644 index 281c769..0000000 --- a/boards/px4/fmu-v5x/src/board_config.h +++ /dev/null @@ -1,497 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2016-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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * PX4FMU-v5 internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ - -/* PX4IO connection configuration */ - -#define BOARD_USES_PX4IO_VERSION 2 -#define PX4IO_SERIAL_DEVICE "/dev/ttyS5" -#define PX4IO_SERIAL_TX_GPIO GPIO_USART6_TX -#define PX4IO_SERIAL_RX_GPIO GPIO_USART6_RX -#define PX4IO_SERIAL_BASE STM32_USART6_BASE -#define PX4IO_SERIAL_VECTOR STM32_IRQ_USART6 -#define PX4IO_SERIAL_TX_DMAMAP DMAMAP_USART6_TX -#define PX4IO_SERIAL_RX_DMAMAP DMAMAP_USART6_RX -#define PX4IO_SERIAL_RCC_REG STM32_RCC_APB2ENR -#define PX4IO_SERIAL_RCC_EN RCC_APB2ENR_USART6EN -#define PX4IO_SERIAL_CLOCK STM32_PCLK2_FREQUENCY -#define PX4IO_SERIAL_BITRATE 1500000 /* 1.5Mbps -> max rate for IO */ - -/* Configuration ************************************************************************************/ - -#define BOARD_HAS_LTC44XX_VALIDS 2 // N Bricks -#define BOARD_HAS_USB_VALID 1 // LTC Has USB valid -#define BOARD_HAS_NBAT_V 2d // 2 Digital Voltage -#define BOARD_HAS_NBAT_I 2d // 2 Digital Current - -/* PX4FMU GPIOs ***********************************************************************************/ - -/* Trace Clock and D0-D3 are available on the trace connector - * - * TRACECLK PE2 - Dedicated - Trace Connector Pin 1 - * TRACED0 PE3 - nLED_RED - Trace Connector Pin 3 - * TRACED1 PE4 - nLED_GREEN - Trace Connector Pin 5 - * TRACED2 PE5 - nLED_BLUE - Trace Connector Pin 7 - * TRACED3 PC12 - nARMED - Trace Connector Pin 8 - - */ -#undef TRACE_PINS - -/* LEDs are driven with push open drain to support Anode to 5V or 3.3V or used as TRACE0-2 */ - -#if !defined(TRACE_PINS) -# define GPIO_nLED_RED /* PE3 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN3) -# define GPIO_nLED_GREEN /* PE4 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN4) -# define GPIO_nLED_BLUE /* PE5 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN5) - -# define BOARD_HAS_CONTROL_STATUS_LEDS 1 -# define BOARD_OVERLOAD_LED LED_RED -# define BOARD_ARMED_STATE_LED LED_BLUE -#endif - -/* SPI */ - -#define SPI6_nRESET_EXTERNAL1 /* PF10 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTF|GPIO_PIN10) -#define GPIO_SYNC /* PH10 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_100MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN10) - -/* I2C busses */ - -/* Devices on the onboard buses. - * - * Note that these are unshifted addresses. - */ - -#define BOARD_MTD_NUM_EEPROM 2 /* MTD: base_eeprom, imu_eeprom*/ -#define PX4_I2C_OBDEV_SE050 0x48 - -#define GPIO_I2C4_DRDY1_BMP388 /* PG5 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTG|GPIO_PIN5) -#define GPIO_PG6 /* PG6 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN6) - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that - * can be used by the Px4 Firmware in the adc driver - */ - -/* ADC defines to be used in sensors.cpp to read from a particular channel */ - -#define ADC1_CH(n) (n) -#define ADC1_GPIO(n) GPIO_ADC1_IN##n -#define ADC3_CH(n) (n) -#define ADC3_GPIO(n) GPIO_ADC3_IN##n - -/* Define GPIO pins used as ADC N.B. Channel numbers must match below */ - -#define PX4_ADC_GPIO \ - /* PA0 */ ADC1_GPIO(0), \ - /* PA4 */ ADC1_GPIO(4), \ - /* PB0 */ ADC1_GPIO(8), \ - /* PB1 */ ADC1_GPIO(9), \ - /* PC0 */ ADC1_GPIO(10), \ - /* PC2 */ ADC1_GPIO(12), \ - /* PC3 */ ADC1_GPIO(13), \ - /* PF4 */ ADC3_GPIO(14), \ - /* PF5 */ ADC3_GPIO(15) - -/* Define Channel numbers must match above GPIO pin IN(n)*/ - -#define ADC_SCALED_VDD_3V3_SENSORS1_CHANNEL /* PA0 */ ADC1_CH(0) -#define ADC_SCALED_VDD_3V3_SENSORS2_CHANNEL /* PA4 */ ADC1_CH(4) -#define ADC_SCALED_VDD_3V3_SENSORS3_CHANNEL /* PB0 */ ADC1_CH(8) -#define ADC_SCALED_V5_CHANNEL /* PB1 */ ADC1_CH(9) -#define ADC_ADC1_6V6_CHANNEL /* PC0 */ ADC1_CH(10) -#define ADC_SCALED_VDD_3V3_SENSORS4_CHANNEL /* PC2 */ ADC1_CH(12) -#define ADC_ADC1_3V3_CHANNEL /* PC3 */ ADC1_CH(13) - -#define ADC_HW_VER_SENSE_CHANNEL /* PF4 */ ADC3_CH(14) -#define ADC_HW_REV_SENSE_CHANNEL /* PF5 */ ADC3_CH(15) - -#define ADC_CHANNELS \ - ((1 << ADC_SCALED_VDD_3V3_SENSORS1_CHANNEL) | \ - (1 << ADC_SCALED_VDD_3V3_SENSORS2_CHANNEL) | \ - (1 << ADC_SCALED_VDD_3V3_SENSORS3_CHANNEL) | \ - (1 << ADC_SCALED_V5_CHANNEL) | \ - (1 << ADC_ADC1_6V6_CHANNEL) | \ - (1 << ADC_SCALED_VDD_3V3_SENSORS4_CHANNEL) | \ - (1 << ADC_ADC1_3V3_CHANNEL)) - -/* HW has to large of R termination on ADC todo:change when HW value is chosen */ - -#define HW_REV_VER_ADC_BASE STM32_ADC3_BASE - -#define SYSTEM_ADC_BASE STM32_ADC1_BASE - - - -#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f) - -/* HW Version and Revision drive signals Default to 1 to detect */ - -#define BOARD_HAS_HW_VERSIONING - -#define GPIO_HW_VER_REV_DRIVE /* PG0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN0) -#define GPIO_HW_REV_SENSE /* PF5 */ ADC3_GPIO(15) -#define GPIO_HW_VER_SENSE /* PF4 */ ADC3_GPIO(14) -#define HW_INFO_INIT_PREFIX "V5X" -#define BOARD_NUM_SPI_CFG_HW_VERSIONS 7 -// Base FMUM -#define V5X00 HW_VER_REV(0x0,0x0) // FMUV5X, Rev 0 -#define V5X10 HW_VER_REV(0x1,0x0) // NO PX4IO, Rev 0 -#define V5X01 HW_VER_REV(0x0,0x1) // FMUV5X I2C2 BMP388, Rev 1 -#define V5X02 HW_VER_REV(0x0,0x2) // FMUV5X, Rev 2 -#define V5X40 HW_VER_REV(0x4,0x0) // FMUV5X, HB CM4 base Rev 0 -#define V5X41 HW_VER_REV(0x4,0x1) // FMUV5X I2C2 BMP388, HB CM4 base Rev 1 -#define V5X42 HW_VER_REV(0x4,0x2) // FMUV5X, HB CM4 base Rev 2 -#define V5X50 HW_VER_REV(0x5,0x0) // FMUV5X, HB Mini Rev 0 -#define V5X51 HW_VER_REV(0x5,0x1) // FMUV5X I2C2 BMP388, HB Mini Rev 1 -#define V5X52 HW_VER_REV(0x5,0x2) // FMUV5X, HB Mini Rev 2 -#define V5X90 HW_VER_REV(0x9,0x0) // NO USB, Rev 0 -#define V5X91 HW_VER_REV(0x9,0x1) // NO USB I2C2 BMP388, Rev 1 -#define V5X92 HW_VER_REV(0x9,0x2) // NO USB I2C2 BMP388, Rev 2 -#define V5Xa0 HW_VER_REV(0xa,0x0) // NO USB (Q), Rev 0 -#define V5Xa1 HW_VER_REV(0xa,0x1) // NO USB (Q) I2C2 BMP388, Rev 1 -#define V5Xa2 HW_VER_REV(0xa,0x2) // NO USB (Q) I2C2 BMP388, Rev 2 -#define V5X101 HW_VER_REV(0x10,0x1) // NO USB (Q) I2C2 BMP388, Rev 1 - -#define UAVCAN_NUM_IFACES_RUNTIME 1 - -/* HEATER - * PWM in future - */ -#define GPIO_HEATER_OUTPUT /* PB10 T2CH3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN10) -#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true)) - -/* PC12 is nARMED - * The GPIO will be set as input while not armed HW will have external HW Pull UP. - * While armed it shall be configured at a GPIO OUT set LOW - */ -#define GPIO_nARMED_INIT /* PC12 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN12) -#define GPIO_nARMED /* PC12 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN12) - -#if !defined(TRACE_PINS) -# define BOARD_INDICATE_EXTERNAL_LOCKOUT_STATE(enabled) px4_arch_configgpio((enabled) ? GPIO_nARMED : GPIO_nARMED_INIT) -# define BOARD_GET_EXTERNAL_LOCKOUT_STATE() px4_arch_gpioread(GPIO_nARMED) -#endif -/* PWM - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 9 - - -/* Power supply control and monitoring GPIOs */ - -#define GPIO_nPOWER_IN_A /* PG1 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN1) -#define GPIO_nPOWER_IN_B /* PG2 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN2) -#define GPIO_nPOWER_IN_C /* PG3 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN3) - -#define GPIO_nVDD_BRICK1_VALID GPIO_nPOWER_IN_A /* Brick 1 Is Chosen */ -#define GPIO_nVDD_BRICK2_VALID GPIO_nPOWER_IN_B /* Brick 2 Is Chosen */ -#define BOARD_NUMBER_BRICKS 2 -#define BOARD_NUMBER_DIGITAL_BRICKS 2 -#define GPIO_nVDD_USB_VALID GPIO_nPOWER_IN_C /* USB Is Chosen */ - -#define GPIO_VDD_5V_PERIPH_nEN /* PG4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN4) -#define GPIO_VDD_5V_PERIPH_nOC /* PE15 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTE|GPIO_PIN15) -#define GPIO_VDD_5V_HIPOWER_nEN /* PF12 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTF|GPIO_PIN12) -#define GPIO_VDD_5V_HIPOWER_nOC /* PF13 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTF|GPIO_PIN13) -#define GPIO_VDD_3V3_SENSORS4_EN /* PG8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN8) -#define GPIO_VDD_3V3_SPEKTRUM_POWER_EN /* PH2 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN2) -#define GPIO_VDD_3V3_SD_CARD_EN /* PC13 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN13) - -/* MCP23009 GPIO expander */ -#define BOARD_GPIO_VDD_5V_COMP_VALID "/dev/gpin4" -#define BOARD_GPIO_VDD_5V_CAN1_GPS1_VALID "/dev/gpin5" - -/* Spare GPIO */ - -#define GPIO_PH11 /* PH11 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTH|GPIO_PIN11) - -/* ETHERNET GPIO */ - -#define GPIO_ETH_POWER_EN /* PG15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN15) - -/* NFC GPIO */ - -#define GPIO_NFC_GPIO /* PH3 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTH|GPIO_PIN3) - - -/* Define True logic Power Control in arch agnostic form */ - -#define VDD_5V_PERIPH_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_PERIPH_nEN, !(on_true)) -#define VDD_5V_HIPOWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_HIPOWER_nEN, !(on_true)) -#define VDD_3V3_SENSORS4_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS4_EN, (on_true)) -#define VDD_3V3_SPEKTRUM_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SPEKTRUM_POWER_EN, (on_true)) -#define READ_VDD_3V3_SPEKTRUM_POWER_EN() px4_arch_gpioread(GPIO_VDD_3V3_SPEKTRUM_POWER_EN) -#define VDD_3V3_SD_CARD_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SD_CARD_EN, (on_true)) -#define VDD_3V3_ETH_POWER_EN(on_true) px4_arch_gpiowrite(GPIO_ETH_POWER_EN, (on_true)) - - -/* Tone alarm output */ - -#define TONE_ALARM_TIMER 14 /* Timer 14 */ -#define TONE_ALARM_CHANNEL 1 /* PF9 GPIO_TIM14_CH1OUT_2 */ - -#define GPIO_BUZZER_1 /* PF9 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTF|GPIO_PIN9) - -#define GPIO_TONE_ALARM_IDLE GPIO_BUZZER_1 -#define GPIO_TONE_ALARM GPIO_TIM14_CH1OUT_2 - -/* USB OTG FS - * - * PA9 OTG_FS_VBUS VBUS sensing - */ -#define GPIO_OTGFS_VBUS /* PA9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 8 /* use timer8 for the HRT */ -#define HRT_TIMER_CHANNEL 3 /* use capture/compare channel 3 */ - -#define HRT_PPM_CHANNEL /* T8C1 */ 1 /* use capture/compare channel 1 */ -#define GPIO_PPM_IN /* PI5 T8C1 */ GPIO_TIM8_CH1IN_2 - -/* RC Serial port */ - -#define RC_SERIAL_PORT "/dev/ttyS5" -#define RC_SERIAL_SINGLEWIRE - -/* Input Capture Channels. */ -#define INPUT_CAP1_TIMER 5 -#define INPUT_CAP1_CHANNEL /* T5C4 */ 4 -#define GPIO_INPUT_CAP1 /* PI0 */ GPIO_TIM5_CH4IN - -/* PWM input driver. Use FMU AUX5 pins attached to timer4 channel 2 */ -#define PWMIN_TIMER 4 -#define PWMIN_TIMER_CHANNEL /* T4C2 */ 2 -#define GPIO_PWM_IN /* PD13 */ GPIO_TIM4_CH2IN_2 - -/* Safety Switch is HW version dependent on having an PX4IO - * So we init to a benign state with the _INIT definition - * and provide the the non _INIT one for the driver to make a run time - * decision to use it. - */ -#define GPIO_nSAFETY_SWITCH_LED_OUT_INIT /* PD10 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTD|GPIO_PIN10) -#define GPIO_nSAFETY_SWITCH_LED_OUT /* PD10 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTD|GPIO_PIN10) - -/* Enable the FMU to control it if there is no px4io fixme:This should be BOARD_SAFETY_LED(__ontrue) */ -#define GPIO_LED_SAFETY GPIO_nSAFETY_SWITCH_LED_OUT -#define GPIO_SAFETY_SWITCH_IN /* PH4 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTH|GPIO_PIN4) -/* Enable the FMU to use the switch it if there is no px4io fixme:This should be BOARD_SAFTY_BUTTON() */ -#define GPIO_BTN_SAFETY GPIO_SAFETY_SWITCH_IN /* Enable the FMU to control it if there is no px4io */ - -/* Power switch controls ******************************************************/ - -#define SPEKTRUM_POWER(_on_true) VDD_3V3_SPEKTRUM_POWER_EN(_on_true) - -/* - * FMUv5X has a separate RC_IN - * - * GPIO PPM_IN on PI5 T8CH1 - * SPEKTRUM_RX (it's TX or RX in Bind) on UART6 PC7 - * Inversion is possible in the UART and can drive GPIO PPM_IN as an output - */ - -#define GPIO_PPM_IN_AS_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTI|GPIO_PIN5) -#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_PPM_IN_AS_OUT) -#define SPEKTRUM_RX_AS_UART() /* Can be left as uart */ -#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true)) - -#define SDIO_SLOTNO 0 /* Only one slot */ -#define SDIO_MINOR 0 - -/* SD card bringup does not work if performed on the IDLE thread because it - * will cause waiting. Use either: - * - * CONFIG_BOARDCTL=y, OR - * CONFIG_BOARD_INITIALIZE=y && CONFIG_BOARD_INITTHREAD=y - */ - -#if defined(CONFIG_BOARD_INITIALIZE) && !defined(CONFIG_BOARDCTL) && \ - !defined(CONFIG_BOARD_INITTHREAD) -# warning SDIO initialization cannot be perfomed on the IDLE thread -#endif - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID)) - -/* FMUv5X never powers off the Servo rail */ - -#define BOARD_ADC_SERVO_VALID (1) - -#if !defined(BOARD_HAS_LTC44XX_VALIDS) || BOARD_HAS_LTC44XX_VALIDS == 0 -# define BOARD_ADC_BRICK1_VALID (1) -# define BOARD_ADC_BRICK2_VALID (0) -#elif BOARD_HAS_LTC44XX_VALIDS == 1 -# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -# define BOARD_ADC_BRICK2_VALID (0) -#elif BOARD_HAS_LTC44XX_VALIDS == 2 -# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -# define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID)) -#elif BOARD_HAS_LTC44XX_VALIDS == 3 -# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -# define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID)) -# define BOARD_ADC_BRICK3_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK3_VALID)) -#elif BOARD_HAS_LTC44XX_VALIDS == 4 -# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID)) -# define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID)) -# define BOARD_ADC_BRICK3_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK3_VALID)) -# define BOARD_ADC_BRICK4_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK4_VALID)) -#else -# error Unsupported BOARD_HAS_LTC44XX_VALIDS value -#endif - -#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_VDD_5V_PERIPH_nOC)) -#define BOARD_ADC_HIPOWER_5V_OC (!px4_arch_gpioread(GPIO_VDD_5V_HIPOWER_nOC)) - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ - -#define BOARD_HAS_ON_RESET 1 - -#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, \ - GPIO_nPOWER_IN_C, \ - GPIO_VDD_5V_PERIPH_nEN, \ - GPIO_VDD_5V_PERIPH_nOC, \ - GPIO_VDD_5V_HIPOWER_nEN, \ - GPIO_VDD_5V_HIPOWER_nOC, \ - GPIO_VDD_3V3_SENSORS4_EN, \ - GPIO_VDD_3V3_SPEKTRUM_POWER_EN, \ - GPIO_VDD_3V3_SD_CARD_EN, \ - GPIO_PH11, \ - GPIO_SYNC, \ - SPI6_nRESET_EXTERNAL1, \ - GPIO_ETH_POWER_EN, \ - GPIO_NFC_GPIO, \ - GPIO_TONE_ALARM_IDLE, \ - GPIO_nSAFETY_SWITCH_LED_OUT_INIT, \ - 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 - -#define BOARD_NUM_IO_TIMERS 5 - - -#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 - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/px4/fmu-v5x/src/can.c b/boards/px4/fmu-v5x/src/can.c deleted file mode 100644 index bb777d8..0000000 --- a/boards/px4/fmu-v5x/src/can.c +++ /dev/null @@ -1,142 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file px4fmu_can.c - * - * Board-specific CAN functions. - */ - -#if !defined(CONFIG_CAN) - -#include - -#include "board_config.h" - - -__EXPORT -uint16_t board_get_can_interfaces(void) -{ - uint16_t enabled_interfaces = 0x3; - - if (!PX4_MFT_HW_SUPPORTED(PX4_MFT_CAN2)) { - enabled_interfaces &= ~(1 << 1); - } - - return enabled_interfaces; -} - -#else - -#include -#include - -#include -#include - -#include "chip.h" -#include "arm_internal.h" - -#include "chip.h" -#include "stm32_can.h" -#include "board_config.h" - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(CONFIG_STM32F7_CAN1) && defined(CONFIG_STM32F7_CAN2) -# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." -# undef CONFIG_STM32F7_CAN2 -#endif - -#ifdef CONFIG_STM32F7_CAN1 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); - -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} -#endif /* CONFIG_CAN */ diff --git a/boards/px4/fmu-v5x/src/i2c.cpp b/boards/px4/fmu-v5x/src/i2c.cpp deleted file mode 100644 index 8a55707..0000000 --- a/boards/px4/fmu-v5x/src/i2c.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), - initI2CBusExternal(2), - initI2CBusExternal(3), - initI2CBusInternal(4), -}; diff --git a/boards/px4/fmu-v5x/src/init.cpp b/boards/px4/fmu-v5x/src/init.cpp deleted file mode 100644 index a660676..0000000 --- a/boards/px4/fmu-v5x/src/init.cpp +++ /dev/null @@ -1,304 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * PX4FMU-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include "board_config.h" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* Configuration ************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - /* set the peripheral rails off */ - - VDD_5V_PERIPH_EN(false); - board_control_spi_sensors_power(false, 0xffff); - VDD_3V3_SENSORS4_EN(false); - - bool last = READ_VDD_3V3_SPEKTRUM_POWER_EN(); - /* Keep Spektum on to discharge rail*/ - VDD_3V3_SPEKTRUM_POWER_EN(false); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ - VDD_3V3_SPEKTRUM_POWER_EN(last); - board_control_spi_sensors_power(true, 0xffff); - VDD_3V3_SENSORS4_EN(true); - VDD_5V_PERIPH_EN(true); - -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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 - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Power on Interfaces */ - VDD_3V3_SD_CARD_EN(true); - VDD_5V_PERIPH_EN(true); - VDD_5V_HIPOWER_EN(true); - VDD_3V3_SENSORS4_EN(true); - VDD_3V3_SPEKTRUM_POWER_EN(true); - - /* Need hrt running before using the ADC */ - - px4_platform_init(); - - // Use the default HW_VER_REV(0x0,0x0) for Ramtron - - stm32_spiinitialize(); - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - if (OK == board_determine_hw_info()) { - syslog(LOG_INFO, "[boot] Rev 0x%1x : Ver 0x%1x %s\n", board_get_hw_revision(), board_get_hw_version(), - board_get_hw_type_name()); - - } else { - syslog(LOG_ERR, "[boot] Failed to read HW revision and version\n"); - } - - /* Configure the Actual SPI interfaces (after we determined the HW version) */ - - stm32_spiinitialize(); - - board_spi_reset(10, 0xffff); - - /* Configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_on(LED_GREEN); // Indicate Power. - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - -#ifdef CONFIG_MMCSD - int ret = stm32_sdio_initialize(); - - if (ret != OK) { - led_on(LED_RED); - return ret; - } - -#endif /* CONFIG_MMCSD */ - - int hw_version = board_get_hw_version(); - - if (hw_version == 0x9 || hw_version == 0xa) { - static MCP23009 mcp23009{3, 0x25}; - - // No USB - if (hw_version == 0x9) { - // < P8 - ret = mcp23009.init(0xf0, 0xf0, 0x0f); - // >= P8 - //ret = mcp23009.init(0xf1, 0xf0, 0x0f); - } - - if (hw_version == 0xa) { - // < P6 - //ret = mcp23009.init(0xf0, 0xf0, 0x0f); - // >= P6 - ret = mcp23009.init(0xf1, 0xf0, 0x0f); - } - - if (ret != OK) { - led_on(LED_RED); - return ret; - } - } - - return OK; -} diff --git a/boards/px4/fmu-v5x/src/led.c b/boards/px4/fmu-v5x/src/led.c deleted file mode 100644 index 1173343..0000000 --- a/boards/px4/fmu-v5x/src/led.c +++ /dev/null @@ -1,232 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013 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. - * - ****************************************************************************/ - -/** - * @file px4fmu2_led.c - * - * PX4FMU LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -#ifdef CONFIG_ARCH_LEDS -static bool nuttx_owns_leds = true; -// B R S G -// 0 1 2 3 -static const uint8_t xlatpx4[] = {1, 2, 4, 0}; -# define xlat(p) xlatpx4[(p)] -static uint32_t g_ledmap[] = { - GPIO_nLED_GREEN, // Indexed by BOARD_LED_GREEN - GPIO_nLED_BLUE, // Indexed by BOARD_LED_BLUE - GPIO_nLED_RED, // Indexed by BOARD_LED_RED - GPIO_nSAFETY_SWITCH_LED_OUT, // Indexed by LED_SAFETY by xlatpx4 -}; - -#else - -# define xlat(p) (p) -static uint32_t g_ledmap[] = { - GPIO_nLED_BLUE, // Indexed by LED_BLUE - GPIO_nLED_RED, // Indexed by LED_RED, LED_AMBER - GPIO_nSAFETY_SWITCH_LED_OUT_INIT, // Indexed by LED_SAFETY (defaulted to an input) - GPIO_nLED_GREEN, // Indexed by LED_GREEN -}; - -#endif - -__EXPORT void led_init(void) -{ - /* Configure LED GPIOs for output */ - if (!PX4_MFT_HW_SUPPORTED(PX4_MFT_PX4IO)) { - g_ledmap[2] = GPIO_nSAFETY_SWITCH_LED_OUT; - } - - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - stm32_configgpio(g_ledmap[l]); - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - - stm32_gpiowrite(g_ledmap[led], !state); -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - return !stm32_gpioread(g_ledmap[led]); -} - -__EXPORT void led_on(int led) -{ - phy_set_led(xlat(led), true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(xlat(led), false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(xlat(led), !phy_get_led(xlat(led))); -} - -#ifdef CONFIG_ARCH_LEDS -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_autoled_initialize - ****************************************************************************/ - -void board_autoled_initialize(void) -{ - led_init(); -} - -/**************************************************************************** - * Name: board_autoled_on - ****************************************************************************/ - -void board_autoled_on(int led) -{ - if (!nuttx_owns_leds) { - return; - } - - switch (led) { - default: - break; - - case LED_HEAPALLOCATE: - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_IRQSENABLED: - phy_set_led(BOARD_LED_BLUE, false); - phy_set_led(BOARD_LED_GREEN, true); - break; - - case LED_STACKCREATED: - phy_set_led(BOARD_LED_GREEN, true); - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_INIRQ: - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_SIGNAL: - phy_set_led(BOARD_LED_GREEN, true); - break; - - case LED_ASSERTION: - phy_set_led(BOARD_LED_RED, true); - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_PANIC: - phy_set_led(BOARD_LED_RED, true); - break; - - case LED_IDLE : /* IDLE */ - phy_set_led(BOARD_LED_RED, true); - break; - } -} - -/**************************************************************************** - * Name: board_autoled_off - ****************************************************************************/ - -void board_autoled_off(int led) -{ - if (!nuttx_owns_leds) { - return; - } - - switch (led) { - default: - break; - - case LED_SIGNAL: - phy_set_led(BOARD_LED_GREEN, false); - break; - - case LED_INIRQ: - phy_set_led(BOARD_LED_BLUE, false); - break; - - case LED_ASSERTION: - phy_set_led(BOARD_LED_RED, false); - phy_set_led(BOARD_LED_BLUE, false); - break; - - case LED_PANIC: - phy_set_led(BOARD_LED_RED, false); - break; - - case LED_IDLE : /* IDLE */ - phy_set_led(BOARD_LED_RED, false); - break; - } -} - -#endif /* CONFIG_ARCH_LEDS */ diff --git a/boards/px4/fmu-v5x/src/manifest.c b/boards/px4/fmu-v5x/src/manifest.c deleted file mode 100644 index 56f0009..0000000 --- a/boards/px4/fmu-v5x/src/manifest.c +++ /dev/null @@ -1,222 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2018-2021 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. - * - ****************************************************************************/ - -/** - * @file manifest.c - * - * This module supplies the interface to the manifest of hardware that is - * optional and dependent on the HW REV and HW VER IDs - * - * The manifest allows the system to know whether a hardware option - * say for example the PX4IO is an no-pop option vs it is broken. - * - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include - -#include "systemlib/px4_macros.h" - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -typedef struct { - uint32_t hw_ver_rev; /* the version and revision */ - const px4_hw_mft_item_t *mft; /* The first entry */ - uint32_t entries; /* the lenght of the list */ -} px4_hw_mft_list_entry_t; - -typedef px4_hw_mft_list_entry_t *px4_hw_mft_list_entry; -#define px4_hw_mft_list_uninitialized (px4_hw_mft_list_entry) -1 - -static const px4_hw_mft_item_t device_unsupported = {0, 0, 0}; - -// List of components on a specific board configuration -// The index of those components is given by the enum (px4_hw_mft_item_id_t) -// declared in board_common.h -static const px4_hw_mft_item_t hw_mft_list_v0500[] = { - { - // PX4_MFT_PX4IO - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, - { - // PX4_MFT_USB - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, - { - // PX4_MFT_CAN2 - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, -}; - -static const px4_hw_mft_item_t hw_mft_list_v0550[] = { - { - // PX4_MFT_PX4IO - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, - { - // PX4_MFT_USB - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, - { - // PX4_MFT_CAN2 - .present = 0, - .mandatory = 0, - .connection = px4_hw_con_unknown, - }, -}; - -static const px4_hw_mft_item_t hw_mft_list_v0510[] = { - { - // PX4_MFT_PX4IO - .present = 0, - .mandatory = 0, - .connection = px4_hw_con_unknown, - }, - { - // PX4_MFT_USB - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, - { - // PX4_MFT_CAN2 - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, -}; - -static const px4_hw_mft_item_t hw_mft_list_v0509[] = { - { - // PX4_MFT_PX4IO - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, - { - // PX4_MFT_USB - .present = 0, - .mandatory = 0, - .connection = px4_hw_con_unknown, - }, - { - // PX4_MFT_CAN2 - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, -}; - -static px4_hw_mft_list_entry_t mft_lists[] = { -// ver_rev - {V5X00, hw_mft_list_v0500, arraySize(hw_mft_list_v0500)}, // FMUV5X, Rev 0 - {V5X01, hw_mft_list_v0500, arraySize(hw_mft_list_v0500)}, // FMUV5X, Rev 1 - {V5X02, hw_mft_list_v0500, arraySize(hw_mft_list_v0500)}, // FMUV5X, Rev 2 - {V5X10, hw_mft_list_v0510, arraySize(hw_mft_list_v0510)}, // NO PX4IO, Rev 0 - {V5X41, hw_mft_list_v0500, arraySize(hw_mft_list_v0500)}, // FMUV5X, HB CM4 base Rev 1 - {V5X42, hw_mft_list_v0500, arraySize(hw_mft_list_v0500)}, // FMUV5X, HB CM4 base Rev 2 - {V5X51, hw_mft_list_v0550, arraySize(hw_mft_list_v0550)}, // FMUV5X, HB Mini Rev 1 - {V5X52, hw_mft_list_v0550, arraySize(hw_mft_list_v0550)}, // FMUV5X, HB Mini Rev 2 - {V5X90, hw_mft_list_v0509, arraySize(hw_mft_list_v0509)}, // NO USB, Rev 0 - {V5X91, hw_mft_list_v0509, arraySize(hw_mft_list_v0509)}, // NO USB I2C2 BMP388, Rev 1 - {V5X92, hw_mft_list_v0509, arraySize(hw_mft_list_v0509)}, // NO USB I2C2 BMP388, Rev 2 - {V5Xa0, hw_mft_list_v0509, arraySize(hw_mft_list_v0509)}, // NO USB (Q), Rev 0 - {V5Xa1, hw_mft_list_v0509, arraySize(hw_mft_list_v0509)}, // NO USB (Q) I2C2 BMP388, Rev 1 - {V5Xa2, hw_mft_list_v0509, arraySize(hw_mft_list_v0509)}, // NO USB (Q) I2C2 BMP388, Rev 2 - {V5X101, hw_mft_list_v0509, arraySize(hw_mft_list_v0509)}, // NO USB I2C2 BMP388, Rev 1 -}; - -/************************************************************************************ - * Name: board_query_manifest - * - * Description: - * Optional returns manifest item. - * - * Input Parameters: - * manifest_id - the ID for the manifest item to retrieve - * - * Returned Value: - * 0 - item is not in manifest => assume legacy operations - * pointer to a manifest item - * - ************************************************************************************/ - -__EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) -{ - static px4_hw_mft_list_entry boards_manifest = px4_hw_mft_list_uninitialized; - - if (boards_manifest == px4_hw_mft_list_uninitialized) { - uint32_t ver_rev = board_get_hw_version() << 16; - ver_rev |= board_get_hw_revision(); - - for (unsigned i = 0; i < arraySize(mft_lists); i++) { - if (mft_lists[i].hw_ver_rev == ver_rev) { - boards_manifest = &mft_lists[i]; - break; - } - } - - if (boards_manifest == px4_hw_mft_list_uninitialized) { - syslog(LOG_ERR, "[boot] Board %08" PRIx32 " is not supported!\n", ver_rev); - } - } - - px4_hw_mft_item rv = &device_unsupported; - - if (boards_manifest != px4_hw_mft_list_uninitialized && - id < boards_manifest->entries) { - rv = &boards_manifest->mft[id]; - } - - return rv; -} diff --git a/boards/px4/fmu-v5x/src/mtd.cpp b/boards/px4/fmu-v5x/src/mtd.cpp deleted file mode 100644 index fc1e97d..0000000 --- a/boards/px4/fmu-v5x/src/mtd.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include -// KiB BS nB -static const px4_mft_device_t spi5 = { // FM25V02A on FMUM 32K 512 X 64 - .bus_type = px4_mft_device_t::SPI, - .devid = SPIDEV_FLASH(0) -}; -static const px4_mft_device_t i2c3 = { // 24LC64T on Base 8K 32 X 256 - .bus_type = px4_mft_device_t::I2C, - .devid = PX4_MK_I2C_DEVID(3, 0x51) -}; -static const px4_mft_device_t i2c4 = { // 24LC64T on IMU 8K 32 X 256 - .bus_type = px4_mft_device_t::I2C, - .devid = PX4_MK_I2C_DEVID(4, 0x50) -}; - - -static const px4_mtd_entry_t fmum_fram = { - .device = &spi5, - .npart = 2, - .partd = { - { - .type = MTD_PARAMETERS, - .path = "/fs/mtd_params", - .nblocks = 32 - }, - { - .type = MTD_WAYPOINTS, - .path = "/fs/mtd_waypoints", - .nblocks = 32 - - } - }, -}; - -static const px4_mtd_entry_t base_eeprom = { - .device = &i2c3, - .npart = 2, - .partd = { - { - .type = MTD_MFT_VER, - .path = "/fs/mtd_mft_ver", - .nblocks = 248 - }, - { - .type = MTD_NET, - .path = "/fs/mtd_net", - .nblocks = 8 // 256 = 32 * 8 - - } - }, -}; - -static const px4_mtd_entry_t imu_eeprom = { - .device = &i2c4, - .npart = 3, - .partd = { - { - .type = MTD_CALDATA, - .path = "/fs/mtd_caldata", - .nblocks = 240 - }, - { - .type = MTD_MFT_REV, - .path = "/fs/mtd_mft_rev", - .nblocks = 8 - }, - { - .type = MTD_ID, - .path = "/fs/mtd_id", - .nblocks = 8 // 256 = 32 * 8 - } - }, -}; - -static const px4_mtd_manifest_t board_mtd_config = { - .nconfigs = 3, - .entries = { - &fmum_fram, - &base_eeprom, - &imu_eeprom - } -}; - -static const px4_mft_entry_s mtd_mft = { - .type = MTD, - .pmft = (void *) &board_mtd_config, -}; - -static const px4_mft_s mft = { - .nmft = 1, - .mfts = { - &mtd_mft - } -}; - -const px4_mft_s *board_get_manifest(void) -{ - return &mft; -} diff --git a/boards/px4/fmu-v5x/src/sdio.c b/boards/px4/fmu-v5x/src/sdio.c deleted file mode 100644 index 869d757..0000000 --- a/boards/px4/fmu-v5x/src/sdio.c +++ /dev/null @@ -1,177 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include "chip.h" -#include "board_config.h" -#include "stm32_gpio.h" -#include "stm32_sdmmc.h" - -#ifdef CONFIG_MMCSD - - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Card detections requires card support and a card detection GPIO */ - -#define HAVE_NCD 1 -#if !defined(GPIO_SDMMC1_NCD) -# undef HAVE_NCD -#endif - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -static FAR struct sdio_dev_s *sdio_dev; -#ifdef HAVE_NCD -static bool g_sd_inserted = 0xff; /* Impossible value */ -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_ncd_interrupt - * - * Description: - * Card detect interrupt handler. - * - ****************************************************************************/ - -#ifdef HAVE_NCD -static int stm32_ncd_interrupt(int irq, FAR void *context) -{ - bool present; - - present = !stm32_gpioread(GPIO_SDMMC1_NCD); - - if (sdio_dev && present != g_sd_inserted) { - sdio_mediachange(sdio_dev, present); - g_sd_inserted = present; - } - - return OK; -} -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_sdio_initialize - * - * Description: - * Initialize SDIO-based MMC/SD card support - * - ****************************************************************************/ - -int stm32_sdio_initialize(void) -{ - int ret; - -#ifdef HAVE_NCD - /* Card detect */ - - bool cd_status; - - /* Configure the card detect GPIO */ - - stm32_configgpio(GPIO_SDMMC1_NCD); - - /* Register an interrupt handler for the card detect pin */ - - stm32_gpiosetevent(GPIO_SDMMC1_NCD, true, true, true, stm32_ncd_interrupt); -#endif - - /* Mount the SDIO-based MMC/SD block driver */ - /* First, get an instance of the SDIO interface */ - - finfo("Initializing SDIO slot %d\n", SDIO_SLOTNO); - - sdio_dev = sdio_initialize(SDIO_SLOTNO); - - if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", SDIO_SLOTNO); - return -ENODEV; - } - - /* Now bind the SDIO interface to the MMC/SD driver */ - - finfo("Bind SDIO to the MMC/SD driver, minor=%d\n", SDIO_MINOR); - - ret = mmcsd_slotinitialize(SDIO_MINOR, sdio_dev); - - if (ret != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); - return ret; - } - - finfo("Successfully bound SDIO to the MMC/SD driver\n"); - -#ifdef HAVE_NCD - /* Use SD card detect pin to check if a card is g_sd_inserted */ - - cd_status = !stm32_gpioread(GPIO_SDMMC1_NCD); - finfo("Card detect : %d\n", cd_status); - - sdio_mediachange(sdio_dev, cd_status); -#else - /* Assume that the SD card is inserted. What choice do we have? */ - - sdio_mediachange(sdio_dev, true); -#endif - - return OK; -} - -#endif /* CONFIG_MMCSD */ diff --git a/boards/px4/fmu-v5x/src/spi.cpp b/boards/px4/fmu-v5x/src/spi.cpp deleted file mode 100644 index 8fa378e..0000000 --- a/boards/px4/fmu-v5x/src/spi.cpp +++ /dev/null @@ -1,205 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2019-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 -#include -#include - -constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSIONS] = { - initSPIHWVersion(V5X00, { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}), - }, {GPIO::PortI, GPIO::Pin11}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortH, GPIO::Pin12}), - }, {GPIO::PortD, GPIO::Pin15}), - initSPIBus(SPI::Bus::SPI3, { - initSPIDevice(DRV_GYR_DEVTYPE_BMI088, SPI::CS{GPIO::PortI, GPIO::Pin8}, SPI::DRDY{GPIO::PortI, GPIO::Pin7}), - initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::PortI, GPIO::Pin4}), - }, {GPIO::PortE, GPIO::Pin7}), - // initSPIBus(SPI::Bus::SPI4, { - // // no devices - // TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h - // }, {GPIO::PortG, GPIO::Pin8}), - initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7}) - }), - initSPIBusExternal(SPI::Bus::SPI6, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}, SPI::DRDY{GPIO::PortD, GPIO::Pin11}), - initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}), - }), - }), - - initSPIHWVersion(V5X01, { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}), - }, {GPIO::PortI, GPIO::Pin11}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortH, GPIO::Pin12}), - }, {GPIO::PortD, GPIO::Pin15}), - initSPIBus(SPI::Bus::SPI3, { - initSPIDevice(DRV_GYR_DEVTYPE_BMI088, SPI::CS{GPIO::PortI, GPIO::Pin8}, SPI::DRDY{GPIO::PortI, GPIO::Pin7}), - initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::PortI, GPIO::Pin4}), - }, {GPIO::PortE, GPIO::Pin7}), - // initSPIBus(SPI::Bus::SPI4, { - // // no devices - // TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h - // }, {GPIO::PortG, GPIO::Pin8}), - initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7}) - }), - initSPIBusExternal(SPI::Bus::SPI6, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}, SPI::DRDY{GPIO::PortD, GPIO::Pin11}), - initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}), - }), - }), - - initSPIHWVersion(V5X02, { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}), - }, {GPIO::PortI, GPIO::Pin11}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortH, GPIO::Pin12}), - }, {GPIO::PortD, GPIO::Pin15}), - initSPIBus(SPI::Bus::SPI3, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20649, SPI::CS{GPIO::PortI, GPIO::Pin4}, SPI::DRDY{GPIO::PortI, GPIO::Pin7}), - }, {GPIO::PortE, GPIO::Pin7}), - // initSPIBus(SPI::Bus::SPI4, { - // // no devices - // TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h - // }, {GPIO::PortG, GPIO::Pin8}), - initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7}) - }), - initSPIBusExternal(SPI::Bus::SPI6, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}, SPI::DRDY{GPIO::PortD, GPIO::Pin11}), - initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}), - }), - }), - - initSPIHWVersion(V5X41, { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}), - }, {GPIO::PortI, GPIO::Pin11}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortH, GPIO::Pin12}), - }, {GPIO::PortD, GPIO::Pin15}), - initSPIBus(SPI::Bus::SPI3, { - initSPIDevice(DRV_GYR_DEVTYPE_BMI088, SPI::CS{GPIO::PortI, GPIO::Pin8}, SPI::DRDY{GPIO::PortI, GPIO::Pin7}), - initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::PortI, GPIO::Pin4}), - }, {GPIO::PortE, GPIO::Pin7}), - // initSPIBus(SPI::Bus::SPI4, { - // // no devices - // TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h - // }, {GPIO::PortG, GPIO::Pin8}), - initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7}) - }), - initSPIBusExternal(SPI::Bus::SPI6, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}, SPI::DRDY{GPIO::PortD, GPIO::Pin11}), - initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}), - }), - }), - - initSPIHWVersion(V5X42, { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}), - }, {GPIO::PortI, GPIO::Pin11}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortH, GPIO::Pin12}), - }, {GPIO::PortD, GPIO::Pin15}), - initSPIBus(SPI::Bus::SPI3, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20649, SPI::CS{GPIO::PortI, GPIO::Pin4}, SPI::DRDY{GPIO::PortI, GPIO::Pin7}), - }, {GPIO::PortE, GPIO::Pin7}), - // initSPIBus(SPI::Bus::SPI4, { - // // no devices - // TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h - // }, {GPIO::PortG, GPIO::Pin8}), - initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7}) - }), - initSPIBusExternal(SPI::Bus::SPI6, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}, SPI::DRDY{GPIO::PortD, GPIO::Pin11}), - initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}), - }), - }), - - initSPIHWVersion(V5X51, { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}), - }, {GPIO::PortI, GPIO::Pin11}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortH, GPIO::Pin12}), - }, {GPIO::PortD, GPIO::Pin15}), - initSPIBus(SPI::Bus::SPI3, { - initSPIDevice(DRV_GYR_DEVTYPE_BMI088, SPI::CS{GPIO::PortI, GPIO::Pin8}, SPI::DRDY{GPIO::PortI, GPIO::Pin7}), - initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::PortI, GPIO::Pin4}), - }, {GPIO::PortE, GPIO::Pin7}), - // initSPIBus(SPI::Bus::SPI4, { - // // no devices - // TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h - // }, {GPIO::PortG, GPIO::Pin8}), - initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7}) - }), - initSPIBusExternal(SPI::Bus::SPI6, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}, SPI::DRDY{GPIO::PortD, GPIO::Pin11}), - initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}), - }), - }), - - initSPIHWVersion(V5X52, { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}), - }, {GPIO::PortI, GPIO::Pin11}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortH, GPIO::Pin12}), - }, {GPIO::PortD, GPIO::Pin15}), - initSPIBus(SPI::Bus::SPI3, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20649, SPI::CS{GPIO::PortI, GPIO::Pin4}, SPI::DRDY{GPIO::PortI, GPIO::Pin7}), - }, {GPIO::PortE, GPIO::Pin7}), - // initSPIBus(SPI::Bus::SPI4, { - // // no devices - // TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h - // }, {GPIO::PortG, GPIO::Pin8}), - initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7}) - }), - initSPIBusExternal(SPI::Bus::SPI6, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}, SPI::DRDY{GPIO::PortD, GPIO::Pin11}), - initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}), - }), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses_all_hw); diff --git a/boards/px4/fmu-v5x/src/timer_config.cpp b/boards/px4/fmu-v5x/src/timer_config.cpp deleted file mode 100644 index 67adba6..0000000 --- a/boards/px4/fmu-v5x/src/timer_config.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 - -/* Timer allocation - * - * TIM1_CH4 T FMU_CH1 - * TIM1_CH3 T FMU_CH2 - * TIM1_CH2 T FMU_CH3 - * TIM1_CH1 T FMU_CH4 - * - * TIM4_CH2 T FMU_CH5 - * TIM4_CH3 T FMU_CH6 - * - * TIM12_CH1 T FMU_CH7 - * TIM12_CH2 T FMU_CH8 - * - * TIM5_CH4 T FMU_CAP1 < Capture - * TIM5_CH3 T SPI2_DRDY2_ISM330_INT2 < Capture or GPIO INT - * TIM5_CH1 T SPIX_SYNC > Pulse or GPIO strobe - * TIM2_CH3 T HEATER > PWM OUT or GPIO - * - * TIM14_CH1 T BUZZER_1 - Driven by other driver - * TIM8_CH1_IN T FMU_PPM_INPUT - Sampled byt HRT by other driver - */ - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1, DMA{DMA::Index2, DMA::Stream5, DMA::Channel6}), - initIOTimer(Timer::Timer4, DMA{DMA::Index1, DMA::Stream6, DMA::Channel2}), - initIOTimer(Timer::Timer12), - initIOTimer(Timer::Timer5), - initIOTimer(Timer::Timer2), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortA, GPIO::Pin10}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortA, GPIO::Pin8}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer12, Timer::Channel1}, {GPIO::PortH, GPIO::Pin6}), - initIOTimerChannel(io_timers, {Timer::Timer12, Timer::Channel2}, {GPIO::PortH, GPIO::Pin9}), - initIOTimerChannelCapture(io_timers, {Timer::Timer5, Timer::Channel4}, {GPIO::PortI, GPIO::Pin0}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/px4/fmu-v5x/src/usb.c b/boards/px4/fmu-v5x/src/usb.c deleted file mode 100644 index 28965c4..0000000 --- a/boards/px4/fmu-v5x/src/usb.c +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016 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. - * - ****************************************************************************/ - -/** - * @file px4fmu_usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#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 - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/px4/fmu-v5x/test.px4board b/boards/px4/fmu-v5x/test.px4board deleted file mode 100644 index 0b1517d..0000000 --- a/boards/px4/fmu-v5x/test.px4board +++ /dev/null @@ -1,13 +0,0 @@ -CONFIG_COMMON_DISTANCE_SENSOR=n -CONFIG_COMMON_INS=n -CONFIG_COMMON_TELEMETRY=n -CONFIG_DRIVERS_ADC_ADS1115=n -CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=n -CONFIG_DRIVERS_IRLOCK=n -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=n -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=n -CONFIG_MODULES_ROVER_POS_CONTROL=n -CONFIG_BOARD_TESTING=y -CONFIG_DRIVERS_DISTANCE_SENSOR_LIGHTWARE_LASER_SERIAL=y -CONFIG_DRIVERS_TEST_PPM=y -CONFIG_SYSTEMCMDS_MICROBENCH=y diff --git a/boards/px4/fts-proto/extras/px4_fmu-v6c_bootloader.bin b/boards/px4/fts-proto/extras/px4_fmu-v6c_bootloader.bin new file mode 100755 index 0000000..536dcc4 Binary files /dev/null and b/boards/px4/fts-proto/extras/px4_fmu-v6c_bootloader.bin differ diff --git a/boards/ark/fmu-v6x/extras/px4_io-v2_default.bin b/boards/px4/fts-proto/extras/px4_io-v2_default.bin similarity index 100% rename from boards/ark/fmu-v6x/extras/px4_io-v2_default.bin rename to boards/px4/fts-proto/extras/px4_io-v2_default.bin diff --git a/boards/px4/io-v2/default.px4board b/boards/px4/io-v2/default.px4board deleted file mode 100644 index 9e69a1e..0000000 --- a/boards/px4/io-v2/default.px4board +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m3" -CONFIG_BOARD_ROMFSROOT="" -CONFIG_BOARD_CONSTRAINED_FLASH=y -CONFIG_MODULES_PX4IOFIRMWARE=y diff --git a/boards/px4/io-v2/extras/px4_io-v2_bootloader.bin b/boards/px4/io-v2/extras/px4_io-v2_bootloader.bin deleted file mode 100644 index 235c65c..0000000 Binary files a/boards/px4/io-v2/extras/px4_io-v2_bootloader.bin and /dev/null differ diff --git a/boards/px4/io-v2/firmware.prototype b/boards/px4/io-v2/firmware.prototype deleted file mode 100644 index 5758931..0000000 --- a/boards/px4/io-v2/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 10, - "magic": "PX4FWv2", - "description": "Firmware for the PX4IOv2 board", - "image": "", - "build_time": 0, - "summary": "PX4IOv2", - "version": "2.0", - "image_size": 0, - "image_maxsize": 61440, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/px4/io-v2/nuttx-config/include/board.h b/boards/px4/io-v2/nuttx-config/include/board.h deleted file mode 100644 index 577e02d..0000000 --- a/boards/px4/io-v2/nuttx-config/include/board.h +++ /dev/null @@ -1,141 +0,0 @@ -/************************************************************************************ - * nuttx-configs/px4io/include/board.h - * include/arch/board/board.h - * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * Copyright (C) 2012 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 NuttX 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. - * - ************************************************************************************/ - -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include -#ifndef __ASSEMBLY__ -# include -#endif -#include - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ - -/* On-board crystal frequency is 24MHz (HSE) */ - -#define STM32_BOARD_XTAL 24000000ul - -/* Use the HSE output as the system clock */ - -#define STM32_SYSCLK_SW RCC_CFGR_SW_HSE -#define STM32_SYSCLK_SWS RCC_CFGR_SWS_HSE -#define STM32_SYSCLK_FREQUENCY STM32_BOARD_XTAL - -/* AHB clock (HCLK) is SYSCLK (24MHz) */ - -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB2 clock (PCLK2) is HCLK (24MHz) */ - -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLK -#define STM32_PCLK2_FREQUENCY STM32_HCLK_FREQUENCY -#define STM32_APB2_CLKIN (STM32_PCLK2_FREQUENCY) /* Timers 2-4 */ - -/* APB2 timer 1 will receive PCLK2. */ - -#define STM32_APB2_TIM1_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM15_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM16_CLKIN (STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM17_CLKIN (STM32_PCLK2_FREQUENCY) - -/* APB1 clock (PCLK1) is HCLK (24MHz) */ - -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLK -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY) - -/* All timers run off PCLK */ - - -#define STM32_APB1_TIM2_CLKIN (STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (STM32_PCLK1_FREQUENCY) - -/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx - * otherwise frequency is 2xAPBx. - * Note: TIM1, 15-17 are on APB2, others on APB1 - */ - -#define BOARD_TIM1_FREQUENCY STM32_APB2_TIM1_CLKIN -#define BOARD_TIM2_FREQUENCY STM32_APB1_TIM2_CLKIN -#define BOARD_TIM3_FREQUENCY STM32_APB1_TIM3_CLKIN -#define BOARD_TIM4_FREQUENCY STM32_APB1_TIM4_CLKIN -#define BOARD_TIM5_FREQUENCY STM32_APB1_TIM5_CLKIN -#define BOARD_TIM6_FREQUENCY STM32_APB1_TIM6_CLKIN -#define BOARD_TIM7_FREQUENCY STM32_APB1_TIM7_CLKIN -#define BOARD_TIM12_FREQUENCY STM32_APB1_TIM12_CLKIN -#define BOARD_TIM13_FREQUENCY STM32_APB1_TIM13_CLKIN -#define BOARD_TIM14_FREQUENCY STM32_APB1_TIM14_CLKIN -#define BOARD_TIM15_FREQUENCY STM32_APB2_TIM15_CLKIN -#define BOARD_TIM16_FREQUENCY STM32_APB2_TIM16_CLKIN -#define BOARD_TIM17_FREQUENCY STM32_APB2_TIM17_CLKIN - - -/* - * Some of the USART pins are not available; override the GPIO - * definitions with an invalid pin configuration. - */ -#undef GPIO_USART2_CTS -#define GPIO_USART2_CTS 0xffffffff -#undef GPIO_USART2_RTS -#define GPIO_USART2_RTS 0xffffffff -#undef GPIO_USART2_CK -#define GPIO_USART2_CK 0xffffffff -#undef GPIO_USART3_CK -#define GPIO_USART3_CK 0xffffffff -#undef GPIO_USART3_CTS -#define GPIO_USART3_CTS 0xffffffff -#undef GPIO_USART3_RTS -#define GPIO_USART3_RTS 0xffffffff - -#endif /* __ARCH_BOARD_BOARD_H */ diff --git a/boards/px4/io-v2/nuttx-config/nsh/defconfig b/boards/px4/io-v2/nuttx-config/nsh/defconfig deleted file mode 100644 index 79f11ed..0000000 --- a/boards/px4/io-v2/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,61 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_NULL is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/px4/io-v2/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F100C8=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARD_LOOPSPERMSEC=2000 -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DISABLE_MOUNTPOINT=y -CONFIG_FDCLONE_DISABLE=y -CONFIG_FDCLONE_STDIO=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=316 -CONFIG_INIT_ENTRYPOINT="user_start" -CONFIG_INIT_STACKSIZE=1100 -CONFIG_MM_FILL_ALLOCATIONS=y -CONFIG_MM_SMALL=y -CONFIG_NAME_MAX=12 -CONFIG_PREALLOC_TIMERS=0 -CONFIG_RAM_SIZE=8192 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_DISABLE_BUFFERING=y -CONFIG_STM32_ADC1=y -CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y -CONFIG_STM32_DMA1=y -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_USART1=y -CONFIG_STM32_USART2=y -CONFIG_STM32_USART3=y -CONFIG_STM32_USART_SINGLEWIRE=y -CONFIG_TASK_NAME_SIZE=0 -CONFIG_USART1_RXBUFSIZE=64 -CONFIG_USART1_RXDMA=y -CONFIG_USART1_SERIAL_CONSOLE=y -CONFIG_USART1_TXBUFSIZE=32 -CONFIG_USART2_RXBUFSIZE=64 -CONFIG_USART2_TXBUFSIZE=64 -CONFIG_USART3_RXBUFSIZE=64 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=64 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/px4/io-v2/nuttx-config/scripts/script.ld b/boards/px4/io-v2/nuttx-config/scripts/script.ld deleted file mode 100644 index c842153..0000000 --- a/boards/px4/io-v2/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,131 +0,0 @@ -/**************************************************************************** - * configs/px4io-v2/scripts/ld.script - * - * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F100C8 has 64Kb of FLASH beginning at address 0x0800:0000 and - * 8Kb of SRAM beginning at address 0x2000:0000. When booting from FLASH, - * FLASH memory is aliased to address 0x0000:0000 where the code expects to - * begin execution by jumping to the entry point in the 0x0800:0000 address - * range. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08001000, LENGTH = 60K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 8K -} - -OUTPUT_ARCH(arm) -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - /* The STM32F100CB has 8Kb of SRAM beginning at the following address */ - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - . = ALIGN(4); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/px4/io-v2/src/CMakeLists.txt b/boards/px4/io-v2/src/CMakeLists.txt deleted file mode 100644 index 5cef2f6..0000000 --- a/boards/px4/io-v2/src/CMakeLists.txt +++ /dev/null @@ -1,42 +0,0 @@ -############################################################################ -# -# Copyright (c) 2015 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. -# -############################################################################ - -add_library(drivers_board - init.c - timer_config.cpp -) - -target_link_libraries(drivers_board - PRIVATE - nuttx_arch -) diff --git a/boards/px4/io-v2/src/board_config.h b/boards/px4/io-v2/src/board_config.h deleted file mode 100644 index e934397..0000000 --- a/boards/px4/io-v2/src/board_config.h +++ /dev/null @@ -1,165 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013, 2014 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * PX4IOV2 internal definitions - */ - -#pragma once - -/****************************************************************************** - * Included Files - ******************************************************************************/ - -#include -#include -#include - -/****************************************************************************** - * Definitions - ******************************************************************************/ -/* Configuration **************************************************************/ - -/****************************************************************************** - * Serial - ******************************************************************************/ -#define PX4FMU_SERIAL_BASE STM32_USART2_BASE -#define PX4FMU_SERIAL_VECTOR STM32_IRQ_USART2 -#define PX4FMU_SERIAL_TX_GPIO GPIO_USART2_TX -#define PX4FMU_SERIAL_RX_GPIO GPIO_USART2_RX -#define PX4FMU_SERIAL_TX_DMA DMACHAN_USART2_TX -#define PX4FMU_SERIAL_RX_DMA DMACHAN_USART2_RX -#define PX4FMU_SERIAL_CLOCK STM32_PCLK1_FREQUENCY -#define PX4FMU_SERIAL_BITRATE 1500000 - -/****************************************************************************** - * GPIOS - ******************************************************************************/ - -/* LEDS **********************************************************************/ - -#define GPIO_LED_BLUE (GPIO_OUTPUT|GPIO_CNF_OUTOD|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN14) // IO-LED_BLUE or IMU_TEMPERATURE_CONTROL on Pixhawk 2.1 -#define GPIO_LED_AMBER (GPIO_OUTPUT|GPIO_CNF_OUTOD|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN15) // IO-LED_AMBER -#define GPIO_LED_SAFETY (GPIO_OUTPUT|GPIO_CNF_OUTOD|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN13) // IO-LED_SAFETY -#define GPIO_LED_GREEN (GPIO_OUTPUT|GPIO_CNF_OUTOD|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN11) // IO-LED_POWER_BREATHING - -#define GPIO_PC14 (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN14) -#define GPIO_PC15 (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN15) - -/* PixHawk 1: - * PC14 Floating - * PC15 Floating - * - * PixHawk 2: - * PC14 3.3v - * PC15 GND - */ -#define GPIO_SENSE_PC14_DN (GPIO_INPUT|GPIO_CNF_INPULLDWN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN14) -#define GPIO_SENSE_PC15_UP (GPIO_INPUT|GPIO_CNF_INPULLUP|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN15) -# define SENSE_PH1 0b10 /* Floating pulled as set */ -# define SENSE_PH2 0b01 /* Driven as tied */ - -#define SENSE_PIXHAWK2() (((stm32_gpioread(GPIO_SENSE_PC15_UP) << 1 | stm32_gpioread(GPIO_SENSE_PC14_DN)) == SENSE_PH2) ? 1 : 0) - -#define LED_BLUE(on_true) (SENSE_PIXHAWK2() ? (void)0 : stm32_gpiowrite(GPIO_LED_BLUE, !(on_true))) -#define LED_AMBER(on_true) stm32_gpiowrite(GPIO_LED_AMBER, !(on_true)) -#define LED_SAFETY(on_true) stm32_gpiowrite(GPIO_LED_SAFETY, !(on_true)) -#define LED_GREEN(on_true) stm32_gpiowrite(GPIO_LED_GREEN, (on_true)) - - -/* HEATER */ -#define GPIO_HEATER_OUTPUT /* PB14 */ (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN14) -#define HEATER_OUTPUT_EN(on_true) (SENSE_PIXHAWK2() ? stm32_gpiowrite(GPIO_HEATER_OUTPUT, !(on_true)) : (void)0) - - -#define GPIO_USART1_RX_SPEKTRUM (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN10) - -/* Safety switch button *******************************************************/ - -#define GPIO_BTN_SAFETY (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN5) - -/* Power switch controls ******************************************************/ - -#define GPIO_SPEKTRUM_PWR_EN (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN13) -#define SPEKTRUM_POWER(_on_true) px4_arch_gpiowrite(GPIO_SPEKTRUM_PWR_EN, (_on_true)) - -#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_USART1_RX_SPEKTRUM, (_one_true)) -#define SPEKTRUM_RX_AS_UART() px4_arch_configgpio(GPIO_USART1_RX) -#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_USART1_RX_SPEKTRUM) - -#define GPIO_SERVO_FAULT_DETECT (GPIO_INPUT|GPIO_CNF_INPULLUP|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN15) - -/* Analog inputs **************************************************************/ - -#define GPIO_ADC_VSERVO (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN4) - -/* the same rssi signal goes to both an adc and a timer input */ -#define GPIO_ADC_RSSI (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN5) -#define GPIO_TIM_RSSI (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN12) - -/* PWM pins **************************************************************/ - -#define GPIO_PPM (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN8) - -#define GPIO_PWM1 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN0) -#define GPIO_PWM2 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN1) -#define GPIO_PWM3 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN8) -#define GPIO_PWM4 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN9) -#define GPIO_PWM5 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN6) -#define GPIO_PWM6 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN7) -#define GPIO_PWM7 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN0) -#define GPIO_PWM8 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN1) - -#define DIRECT_PWM_OUTPUT_CHANNELS 8 -#define BOARD_HAS_NO_CAPTURE - -/* SBUS pins *************************************************************/ - -/* XXX these should be UART pins */ -#define GPIO_SBUS_INPUT (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN11) -#define GPIO_SBUS_OUTPUT (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN10) -#define GPIO_SBUS_OENABLE (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN4) - -/* - * High-resolution timer - */ -#define HRT_TIMER 1 /* use timer1 for the HRT */ -#define HRT_TIMER_CHANNEL 2 /* use capture/compare channel 2 */ -#define HRT_PPM_CHANNEL 1 /* use capture/compare channel 1 PA8 */ -#define GPIO_PPM_IN (GPIO_ALT|GPIO_CNF_INPULLUP|GPIO_PORTA|GPIO_PIN8) - -#define BOARD_NUM_IO_TIMERS 3 - -#include diff --git a/boards/px4/io-v2/src/init.c b/boards/px4/io-v2/src/init.c deleted file mode 100644 index 404a362..0000000 --- a/boards/px4/io-v2/src/init.c +++ /dev/null @@ -1,163 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * PX4FMU-specific early startup code. This file implements the - * stm32_boardinitialize() function that is called during cpu startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include -#include -#include - -#include - -#include -#include "board_config.h" - -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Protected Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/************************************************************************************ - * Name: stm32_boardinitialize - * - * Description: - * All STM32 architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. - * - ************************************************************************************/ - -__EXPORT void stm32_boardinitialize(void) -{ - /* configure GPIOs */ - - /* Set up for sensing HW */ - stm32_configgpio(GPIO_SENSE_PC14_DN); - stm32_configgpio(GPIO_SENSE_PC15_UP); - - /* some boards such as Pixhawk 2.1 made - the unfortunate choice to combine the blue led channel with - the IMU heater. We need a software hack to fix the hardware hack - by allowing to disable the LED / heater. - */ - if (SENSE_PIXHAWK2()) { - stm32_configgpio(GPIO_HEATER_OUTPUT); - - } else { - stm32_configgpio(GPIO_LED_BLUE); - } - - stm32_configgpio(GPIO_PC14); - stm32_configgpio(GPIO_PC15); - - - /* LEDS - default to off */ - stm32_configgpio(GPIO_LED_AMBER); - stm32_configgpio(GPIO_LED_SAFETY); - stm32_configgpio(GPIO_LED_GREEN); - - stm32_configgpio(GPIO_BTN_SAFETY); - - /* spektrum power enable is active high - enable it by default */ - stm32_configgpio(GPIO_SPEKTRUM_PWR_EN); - - stm32_configgpio(GPIO_SERVO_FAULT_DETECT); - - /* RSSI inputs */ - stm32_configgpio(GPIO_TIM_RSSI); /* xxx alternate function */ - stm32_configgpio(GPIO_ADC_RSSI); - - /* servo rail voltage */ - stm32_configgpio(GPIO_ADC_VSERVO); - - stm32_configgpio(GPIO_SBUS_INPUT); /* xxx alternate function */ - stm32_configgpio(GPIO_SBUS_OUTPUT); - - /* sbus output enable is active low - disable it by default */ - stm32_gpiowrite(GPIO_SBUS_OENABLE, true); - stm32_configgpio(GPIO_SBUS_OENABLE); - - stm32_configgpio(GPIO_PPM); /* xxx alternate function */ - - stm32_gpiowrite(GPIO_PWM1, true); - stm32_configgpio(GPIO_PWM1); - - stm32_gpiowrite(GPIO_PWM2, true); - stm32_configgpio(GPIO_PWM2); - - stm32_gpiowrite(GPIO_PWM3, true); - stm32_configgpio(GPIO_PWM3); - - stm32_gpiowrite(GPIO_PWM4, true); - stm32_configgpio(GPIO_PWM4); - - stm32_gpiowrite(GPIO_PWM5, true); - stm32_configgpio(GPIO_PWM5); - - stm32_gpiowrite(GPIO_PWM6, true); - stm32_configgpio(GPIO_PWM6); - - stm32_gpiowrite(GPIO_PWM7, true); - stm32_configgpio(GPIO_PWM7); - - stm32_gpiowrite(GPIO_PWM8, true); - stm32_configgpio(GPIO_PWM8); - - /* disable heater */ - HEATER_OUTPUT_EN(false); -} diff --git a/boards/px4/io-v2/src/timer_config.cpp b/boards/px4/io-v2/src/timer_config.cpp deleted file mode 100644 index bb7dfa8..0000000 --- a/boards/px4/io-v2/src/timer_config.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer2), - initIOTimer(Timer::Timer4), - initIOTimer(Timer::Timer3), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel1}, {GPIO::PortA, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel2}, {GPIO::PortA, GPIO::Pin1}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortB, GPIO::Pin8}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel4}, {GPIO::PortB, GPIO::Pin9}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel1}, {GPIO::PortA, GPIO::Pin6}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel2}, {GPIO::PortA, GPIO::Pin7}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel3}, {GPIO::PortB, GPIO::Pin0}), - initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel4}, {GPIO::PortB, GPIO::Pin1}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/px4/raspberrypi/cmake/upload.cmake b/boards/px4/raspberrypi/cmake/upload.cmake deleted file mode 100644 index 5abefb0..0000000 --- a/boards/px4/raspberrypi/cmake/upload.cmake +++ /dev/null @@ -1,47 +0,0 @@ -############################################################################ -# -# Copyright (c) 2020 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. -# -############################################################################ - -if(DEFINED ENV{AUTOPILOT_HOST}) - set(AUTOPILOT_HOST $ENV{AUTOPILOT_HOST}) -else() - set(AUTOPILOT_HOST "raspberrypi") -endif() - -add_custom_target(upload - COMMAND rsync -arh --progress -e "ssh -o StrictHostKeyChecking=no" - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/rpi/*.config ${PX4_BINARY_DIR}/etc # source - pi@${AUTOPILOT_HOST}:/home/pi/px4 # destination - DEPENDS px4 - COMMENT "uploading px4" - USES_TERMINAL -) diff --git a/boards/px4/raspberrypi/default.px4board b/boards/px4/raspberrypi/default.px4board deleted file mode 100644 index ade7dd4..0000000 --- a/boards/px4/raspberrypi/default.px4board +++ /dev/null @@ -1,82 +0,0 @@ -CONFIG_PLATFORM_POSIX=y -CONFIG_BOARD_LINUX_TARGET=y -CONFIG_BOARD_TOOLCHAIN="arm-linux-gnueabihf" -CONFIG_BOARD_ARCHITECTURE="cortex-a53" -CONFIG_BOARD_TESTING=y -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_COMMON_BAROMETERS=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_GPS=y -CONFIG_COMMON_IMU=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_RPI_RC_IN=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_BATTERY_SIMULATOR=y -CONFIG_MODULES_SIMULATION_SIMULATOR_MAVLINK=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UUV_ATT_CONTROL=y -CONFIG_MODULES_UUV_POS_CONTROL=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DYN=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SHUTDOWN=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_DYN_HELLO=y -CONFIG_EXAMPLES_FAKE_GPS=y -CONFIG_EXAMPLES_FAKE_IMU=y -CONFIG_EXAMPLES_FAKE_MAGNETOMETER=y -CONFIG_EXAMPLES_HELLO=y -CONFIG_EXAMPLES_PX4_MAVLINK_DEBUG=y -CONFIG_EXAMPLES_PX4_SIMPLE_APP=y -CONFIG_EXAMPLES_WORK_ITEM=y diff --git a/boards/px4/raspberrypi/src/CMakeLists.txt b/boards/px4/raspberrypi/src/CMakeLists.txt deleted file mode 100644 index 42ca05a..0000000 --- a/boards/px4/raspberrypi/src/CMakeLists.txt +++ /dev/null @@ -1,37 +0,0 @@ -############################################################################ -# -# Copyright (c) 2017 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. -# -############################################################################ - -add_library(drivers_board - i2c.cpp - spi.cpp -) diff --git a/boards/px4/raspberrypi/src/board_config.h b/boards/px4/raspberrypi/src/board_config.h deleted file mode 100644 index 14653d1..0000000 --- a/boards/px4/raspberrypi/src/board_config.h +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2017 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * RPI internal definitions - */ - -#pragma once - -#define BOARD_OVERRIDE_UUID "RPIID00000000000" // must be of length 16 -#define PX4_SOC_ARCH_ID PX4_SOC_ARCH_ID_RPI - - -// I2C -#define CONFIG_I2C 1 -#define PX4_NUMBER_I2C_BUSES 2 - - -// SPI -#define CONFIG_SPI 1 - - -#define ADC_BATTERY_VOLTAGE_CHANNEL 0 -#define ADC_BATTERY_CURRENT_CHANNEL -1 -#define ADC_AIRSPEED_VOLTAGE_CHANNEL 2 - -#define ADC_DP_V_DIV 1.0f - -#include -#include diff --git a/boards/px4/raspberrypi/src/i2c.cpp b/boards/px4/raspberrypi/src/i2c.cpp deleted file mode 100644 index 2546cd0..0000000 --- a/boards/px4/raspberrypi/src/i2c.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(0), - initI2CBusInternal(1), -}; diff --git a/boards/px4/raspberrypi/src/spi.cpp b/boards/px4/raspberrypi/src/spi.cpp deleted file mode 100644 index 11451a3..0000000 --- a/boards/px4/raspberrypi/src/spi.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(0, { - initSPIDevice(DRV_IMU_DEVTYPE_MPU9250, 0), - }), -}; diff --git a/boards/px4/ros2/default.px4board b/boards/px4/ros2/default.px4board deleted file mode 100644 index a9c5b91..0000000 --- a/boards/px4/ros2/default.px4board +++ /dev/null @@ -1 +0,0 @@ -CONFIG_PLATFORM_ROS2=y diff --git a/boards/px4/ros2/src/CMakeLists.txt b/boards/px4/ros2/src/CMakeLists.txt deleted file mode 100644 index 8aacb8b..0000000 --- a/boards/px4/ros2/src/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -############################################################################ -# -# 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. -# -############################################################################ - -add_library(drivers_board - init.cpp -) diff --git a/boards/px4/ros2/src/board_config.h b/boards/px4/ros2/src/board_config.h deleted file mode 100644 index 476e1bb..0000000 --- a/boards/px4/ros2/src/board_config.h +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** - * - * 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * SITL internal definitions - */ - -#pragma once - -#define BOARD_OVERRIDE_UUID "SIMULATIONID0000" // must be of length 16 -#define PX4_SOC_ARCH_ID PX4_SOC_ARCH_ID_SITL - -#define BOARD_HAS_POWER_CONTROL 1 - -#define BOARD_NUMBER_BRICKS 0 - -#include -#include diff --git a/boards/px4/ros2/src/init.cpp b/boards/px4/ros2/src/init.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/boards/px4/sitl/default.px4board b/boards/px4/sitl/default.px4board deleted file mode 100644 index db358c3..0000000 --- a/boards/px4/sitl/default.px4board +++ /dev/null @@ -1,74 +0,0 @@ -CONFIG_PLATFORM_POSIX=y -CONFIG_BOARD_TESTING=y -CONFIG_BOARD_ETHERNET=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_OSD_MSP_OSD=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_MODULES_AIRSHIP_ATT_CONTROL=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MAVLINK_DIALECT="development" -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_PAYLOAD_DELIVERER=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_REPLAY=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_COMMON_SIMULATION=y -CONFIG_MODULES_SIMULATION_GZ_BRIDGE=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UUV_ATT_CONTROL=y -CONFIG_MODULES_UUV_POS_CONTROL=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DYN=y -CONFIG_SYSTEMCMDS_FAILURE=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SHUTDOWN=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_DYN_HELLO=y -CONFIG_EXAMPLES_FAKE_GPS=y -CONFIG_EXAMPLES_FAKE_IMU=y -CONFIG_EXAMPLES_FAKE_MAGNETOMETER=y -CONFIG_EXAMPLES_HELLO=y -CONFIG_EXAMPLES_PX4_MAVLINK_DEBUG=y -CONFIG_EXAMPLES_PX4_SIMPLE_APP=y -CONFIG_EXAMPLES_WORK_ITEM=y diff --git a/boards/px4/sitl/nolockstep.px4board b/boards/px4/sitl/nolockstep.px4board deleted file mode 100644 index 61671c9..0000000 --- a/boards/px4/sitl/nolockstep.px4board +++ /dev/null @@ -1 +0,0 @@ -CONFIG_BOARD_NOLOCKSTEP=y diff --git a/boards/px4/sitl/replay.px4board b/boards/px4/sitl/replay.px4board deleted file mode 100644 index aab3a27..0000000 --- a/boards/px4/sitl/replay.px4board +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_BOARD_COMPILE_DEFINITIONS="-DORB_USE_PUBLISHER_RULES" -CONFIG_BOARD_LOCKSTEP=y diff --git a/boards/px4/sitl/sitl.cmake b/boards/px4/sitl/sitl.cmake deleted file mode 100644 index a6b3823..0000000 --- a/boards/px4/sitl/sitl.cmake +++ /dev/null @@ -1,15 +0,0 @@ - -# If the environment variable 'replay' is defined, we are building with replay -# support. In this case, we enable the orb publisher rules. -set(REPLAY_FILE "$ENV{replay}") -if(REPLAY_FILE) - message(STATUS "Building with uorb publisher rules support") - add_definitions(-DORB_USE_PUBLISHER_RULES) - - message(STATUS "Building without lockstep for replay") - set(ENABLE_LOCKSTEP_SCHEDULER no) -elseif(CMAKE_BUILD_TYPE STREQUAL FuzzTesting) - set(ENABLE_LOCKSTEP_SCHEDULER no) -else() - set(ENABLE_LOCKSTEP_SCHEDULER yes) -endif() diff --git a/boards/px4/sitl/src/CMakeLists.txt b/boards/px4/sitl/src/CMakeLists.txt deleted file mode 100644 index 294f986..0000000 --- a/boards/px4/sitl/src/CMakeLists.txt +++ /dev/null @@ -1,37 +0,0 @@ -############################################################################ -# -# Copyright (c) 2015-2017 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. -# -############################################################################ - -add_library(drivers_board - board_shutdown.cpp - sitl_led.c -) diff --git a/boards/px4/sitl/src/board_config.h b/boards/px4/sitl/src/board_config.h deleted file mode 100644 index e27c3ee..0000000 --- a/boards/px4/sitl/src/board_config.h +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2017 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * SITL internal definitions - */ - -#pragma once - -#define BOARD_OVERRIDE_UUID "SIMULATIONID0000" // must be of length 16 -#define PX4_SOC_ARCH_ID PX4_SOC_ARCH_ID_SITL - -#define BOARD_HAS_POWER_CONTROL 1 - -#define PX4_NUMBER_I2C_BUSES 1 - -#define BOARD_NUMBER_BRICKS 0 -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_OVERLOAD_LED LED_RED -#define BOARD_ARMED_LED LED_BLUE -#define BOARD_ARMED_STATE_LED LED_GREEN - -#include -#include diff --git a/boards/px4/sitl/src/board_shutdown.cpp b/boards/px4/sitl/src/board_shutdown.cpp deleted file mode 100644 index eeb3e92..0000000 --- a/boards/px4/sitl/src/board_shutdown.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013 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. - * - ****************************************************************************/ - -/** - * @file board_shutdown.cpp - * - * sitl board shutdown backend. - */ - -#include -#include -#include -#include - -#if defined(BOARD_HAS_POWER_CONTROL) -int board_register_power_state_notification_cb(power_button_state_notification_t cb) -{ - return 0; -} - -int board_power_off(int status) -{ - printf("Exiting NOW.\n"); - fflush(stdout); - system_exit(0); - return 0; -} -#endif // BOARD_HAS_POWER_CONTROL diff --git a/boards/px4/sitl/src/sitl_led.c b/boards/px4/sitl/src/sitl_led.c deleted file mode 100644 index c9d3f4d..0000000 --- a/boards/px4/sitl/src/sitl_led.c +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013 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. - * - ****************************************************************************/ - -/** - * @file sitl_led.c - * - * sitl LED backend. - */ - -#include -#include -#include - -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -static bool _led_state[2] = { false, false }; - -__EXPORT void led_init() -{ - PX4_DEBUG("LED_INIT"); -} - -__EXPORT void led_on(int led) -{ - if (led == 1 || led == 0) { - PX4_DEBUG("LED%d_ON", led); - _led_state[led] = true; - } -} - -__EXPORT void led_off(int led) -{ - if (led == 1 || led == 0) { - PX4_DEBUG("LED%d_OFF", led); - _led_state[led] = false; - } -} - -__EXPORT void led_toggle(int led) -{ - if (led == 1 || led == 0) { - _led_state[led] = !_led_state[led]; - PX4_DEBUG("LED%d_TOGGLE: %s", led, _led_state[led] ? "ON" : "OFF"); - - } -} diff --git a/boards/px4/sitl/test.px4board b/boards/px4/sitl/test.px4board deleted file mode 100644 index fcaf472..0000000 --- a/boards/px4/sitl/test.px4board +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_BOARD_NOLOCKSTEP=y -CONFIG_DRIVERS_DISTANCE_SENSOR_LIGHTWARE_LASER_SERIAL=y diff --git a/boards/raspberrypi/pico/default.px4board b/boards/raspberrypi/pico/default.px4board deleted file mode 100644 index a572726..0000000 --- a/boards/raspberrypi/pico/default.px4board +++ /dev/null @@ -1,50 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m0plus" -CONFIG_BOARD_CONSTRAINED_FLASH=y -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS2" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS1" -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_BAROMETER_BMP280=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU9250=y -CONFIG_DRIVERS_MAGNETOMETER_HMC5883=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_SENSORS=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/raspberrypi/pico/firmware.prototype b/boards/raspberrypi/pico/firmware.prototype deleted file mode 100644 index 1fcf0a3..0000000 --- a/boards/raspberrypi/pico/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 42, - "magic": "RASPBERRYPIPICO", - "description": "Firmware for the raspberry pi Pico board", - "image": "", - "build_time": 0, - "summary": "RaspberrypiPico", - "version": "0.1", - "image_size": 0, - "image_maxsize": 1032192, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/raspberrypi/pico/init/rc.board_defaults b/boards/raspberrypi/pico/init/rc.board_defaults deleted file mode 100644 index ec0c720..0000000 --- a/boards/raspberrypi/pico/init/rc.board_defaults +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 13.653333333 -param set-default BAT1_A_PER_V 36.367515152 - -# system_power unavailable -param set-default CBRK_SUPPLY_CHK 894281 - -# Disable safety switch by default -param set-default CBRK_IO_SAFETY 22027 - -# use the Q attitude estimator, it works w/o mag or GPS. -# param set-default SYS_MC_EST_GROUP 3 -# param set-default ATT_ACC_COMP 0 -# param set-default ATT_W_ACC 0.4000 -# param set-default ATT_W_GYRO_BIAS 0.0000 - -# param set-default SYS_HAS_MAG 0 diff --git a/boards/raspberrypi/pico/init/rc.board_mavlink b/boards/raspberrypi/pico/init/rc.board_mavlink deleted file mode 100644 index 75c5256..0000000 --- a/boards/raspberrypi/pico/init/rc.board_mavlink +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -# -# board specific MAVLink startup script. -#------------------------------------------------------------------------------ - -# Start MAVLink on the USB port -mavlink start -d /dev/ttyACM0 diff --git a/boards/raspberrypi/pico/init/rc.board_sensors b/boards/raspberrypi/pico/init/rc.board_sensors deleted file mode 100644 index 2246747..0000000 --- a/boards/raspberrypi/pico/init/rc.board_sensors +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# -# board specific sensors init -#------------------------------------------------------------------------------ - -board_adc start - -# try starting an mpu9250 IMU on external SPI -mpu9250 start -S - -# try starting a bmp280 barometer on external SPI -bmp280 start -S diff --git a/boards/raspberrypi/pico/nuttx-config/Kconfig b/boards/raspberrypi/pico/nuttx-config/Kconfig deleted file mode 100644 index f70b26d..0000000 --- a/boards/raspberrypi/pico/nuttx-config/Kconfig +++ /dev/null @@ -1,25 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see the file kconfig-language.txt in the NuttX tools repository. -# - -config RP2040_FLASH_BOOT - bool "flash boot" - default y - ---help--- - If y, the built binary can be used for flash boot. - If not, the binary is for SRAM boot. - -config RP2040_FLASH_CHIP - string "flash chip name" - default "w25q080" - ---help--- - Name of NOR flash device connected to RP2040 SoC. - (Used to choose the secondary boot loader.) - Basically this option should not be changed. - -config RP2040_UF2_BINARY - bool "uf2 binary format" - default y - ---help--- - Create nuttx.uf2 binary format used on RP2040 based arch. diff --git a/boards/raspberrypi/pico/nuttx-config/include/board.h b/boards/raspberrypi/pico/nuttx-config/include/board.h deleted file mode 100644 index fe16b07..0000000 --- a/boards/raspberrypi/pico/nuttx-config/include/board.h +++ /dev/null @@ -1,129 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include -#ifndef __ASSEMBLY__ -# include -#endif - -/* Clocking *****************************************************************/ - -#define MHZ 1000000 - -#define BOARD_XOSC_FREQ (12 * MHZ) -#define BOARD_PLL_SYS_FREQ (125 * MHZ) -#define BOARD_PLL_USB_FREQ (48 * MHZ) - -#define BOARD_REF_FREQ (12 * MHZ) -#define BOARD_SYS_FREQ (125 * MHZ) -#define BOARD_PERI_FREQ (125 * MHZ) -#define BOARD_USB_FREQ (48 * MHZ) -#define BOARD_ADC_FREQ (48 * MHZ) -#define BOARD_RTC_FREQ 46875 - -#define BOARD_UART_BASEFREQ BOARD_PERI_FREQ - -#define BOARD_TICK_CLOCK (1 * MHZ) - -/* If CONFIG_ARCH_LEDs is defined, then NuttX will control the 2 LEDs on board the - * omnibusf4sd. The following definitions describe how NuttX controls the LEDs: - */ - -// #define LED_STARTED 0 /* LED1 */ -// #define LED_HEAPALLOCATE 1 /* LED2 */ -// #define LED_IRQSENABLED 2 /* LED1 */ -// #define LED_STACKCREATED 3 /* LED1 + LED2 */ -// #define LED_INIRQ 4 /* LED1 */ -// #define LED_SIGNAL 5 /* LED2 */ -// #define LED_ASSERTION 6 /* LED1 + LED2 */ -// #define LED_PANIC 7 /* LED1 + LED2 */ - -/* Alternate function pin selections ************************************************/ - -/* - * UARTs. - * UART0TX: GPIO0 - * UART0RX: GPIO1 - * UART1TX: GPIO8 - * UART1RX: GPIO9 - */ -#define CONFIG_RP2040_UART0_GPIO 0 /* TELEM */ - -#define CONFIG_RP2040_UART1_GPIO 8 /* GPS */ - -/* - * I2C (external) - * - * I2C1SCL: GPIO7 - * I2C1SDA: GPIO6 - * - * TODO: - * The optional _GPIO configurations allow the I2C driver to manually - * reset the bus to clear stuck slaves. They match the pin configuration, - * but are normally-high GPIOs. - */ -#define CONFIG_RP2040_I2C1_GPIO 6 - -/* SPI0: - * SPIDEV_FLASH (probably micro sd card) - * CS: GPIO5 -- should be configured in sec/spi.cpp (probably) - * CLK: GPIO2 - * MISO: GPIO4 - * MOSI: GPIO3 - */ - -#define GPIO_SPI0_SCLK ( 2 | GPIO_FUN(RP2040_GPIO_FUNC_SPI) ) -#define GPIO_SPI0_MISO ( 4 | GPIO_FUN(RP2040_GPIO_FUNC_SPI) ) -#define GPIO_SPI0_MOSI ( 3 | GPIO_FUN(RP2040_GPIO_FUNC_SPI) ) - -/* SPI1: - * MPU9250 and BMP280 - * CS: GPIO13 for MPU9250, GPIO14 for BMP280 -- should be configured in sec/spi.cpp (probably) - * CLK: GPIO10 - * MISO: GPIO12 - * MOSI: GPIO11 - */ - -#define GPIO_SPI1_SCLK ( 10 | GPIO_FUN(RP2040_GPIO_FUNC_SPI) ) -#define GPIO_SPI1_MISO ( 12 | GPIO_FUN(RP2040_GPIO_FUNC_SPI) ) -#define GPIO_SPI1_MOSI ( 11 | GPIO_FUN(RP2040_GPIO_FUNC_SPI) ) - - -#endif /* __ARCH_BOARD_BOARD_H */ diff --git a/boards/raspberrypi/pico/nuttx-config/nsh/defconfig b/boards/raspberrypi/pico/nuttx-config/nsh/defconfig deleted file mode 100644 index 2efb22f..0000000 --- a/boards/raspberrypi/pico/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,113 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DEV_CONSOLE is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_RP2040_SPI_DRIVER is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/raspberrypi/pico/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="rp2040" -CONFIG_ARCH_CHIP_RP2040=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_LOOPSPERMSEC=10450 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_PRODUCTSTR="PX4 RaspberryPi Pico" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=2000 -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_DISABLE_MQUEUE=y -CONFIG_DISABLE_POSIX_TIMERS=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_DISABLE_REBOOT=y -CONFIG_NSH_FATDEVNO=0 -CONFIG_NSH_FILEIOSIZE=512 -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_READLINE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_USBCONSOLE=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=270336 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_RP2040_I2C1=y -CONFIG_RP2040_I2C=y -CONFIG_RP2040_SPI0=y -CONFIG_RP2040_SPI1=y -CONFIG_RP2040_SPI=y -CONFIG_RP2040_UART1=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 -CONFIG_WATCHDOG=y diff --git a/boards/raspberrypi/pico/nuttx-config/scripts/flash.ld b/boards/raspberrypi/pico/nuttx-config/scripts/flash.ld deleted file mode 100644 index 1193a1f..0000000 --- a/boards/raspberrypi/pico/nuttx-config/scripts/flash.ld +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** - * boards/arm/rp2040/raspberrypi-pico/scripts/raspberrypi-pico-flash.ld - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -MEMORY -{ - flash (rx) : ORIGIN = 0x10000000, LENGTH = 2048K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 264K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) -EXTERN(bootStr) - -SECTIONS -{ - .flash_begin : { - __flash_binary_start = .; - } > flash - - .boot2 : { - __boot2_start__ = .; - KEEP (*(.boot2)) - __boot2_end__ = .; - } > flash - - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - } > flash - - .init_section : { - _sinit = ABSOLUTE(.); - KEEP (*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .ram_vectors (COPY) : { - *(.ram_vectors) - } > sram - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - . = ALIGN(4); - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/raspberrypi/pico/nuttx-config/scripts/script.ld b/boards/raspberrypi/pico/nuttx-config/scripts/script.ld deleted file mode 100644 index 1193a1f..0000000 --- a/boards/raspberrypi/pico/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** - * boards/arm/rp2040/raspberrypi-pico/scripts/raspberrypi-pico-flash.ld - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -MEMORY -{ - flash (rx) : ORIGIN = 0x10000000, LENGTH = 2048K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 264K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) -EXTERN(bootStr) - -SECTIONS -{ - .flash_begin : { - __flash_binary_start = .; - } > flash - - .boot2 : { - __boot2_start__ = .; - KEEP (*(.boot2)) - __boot2_end__ = .; - } > flash - - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - } > flash - - .init_section : { - _sinit = ABSOLUTE(.); - KEEP (*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .ram_vectors (COPY) : { - *(.ram_vectors) - } > sram - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - . = ALIGN(4); - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/raspberrypi/pico/nuttx-config/src/Make.defs b/boards/raspberrypi/pico/nuttx-config/src/Make.defs deleted file mode 100644 index e69de29..0000000 diff --git a/boards/raspberrypi/pico/src/CMakeLists.txt b/boards/raspberrypi/pico/src/CMakeLists.txt deleted file mode 100644 index b2cb070..0000000 --- a/boards/raspberrypi/pico/src/CMakeLists.txt +++ /dev/null @@ -1,51 +0,0 @@ -############################################################################ -# -# Copyright (c) 2021 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. -# -############################################################################ - -add_library(drivers_board - boot_string.c - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - usb.c -) - -target_link_libraries(drivers_board - PRIVATE - arch_spi - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer -) diff --git a/boards/raspberrypi/pico/src/board_config.h b/boards/raspberrypi/pico/src/board_config.h deleted file mode 100644 index 581233e..0000000 --- a/boards/raspberrypi/pico/src/board_config.h +++ /dev/null @@ -1,136 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * board internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -/* LEDs */ -// LED1 - GPIO 25 - Green -#define GPIO_LED1 PX4_MAKE_GPIO_OUTPUT_CLEAR(25) // Take a look at rpi_common micro_hal.h -#define GPIO_LED_BLUE GPIO_LED1 - -#define BOARD_OVERLOAD_LED LED_BLUE - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that can be used by the Px4 Firmware in the adc driver - */ -#define ADC_CHANNELS (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) // Change this later based on the adc channels actually used - -#define ADC_BATTERY_VOLTAGE_CHANNEL 1 // Corresponding GPIO 27. Used in init.c for disabling GPIO_IE -#define ADC_BATTERY_CURRENT_CHANNEL 2 // Corresponding GPIO 28. Used in init.c for disabling GPIO_IE -#define ADC_RC_RSSI_CHANNEL 0 - -/* High-resolution timer */ -#define HRT_TIMER 1 -#define HRT_TIMER_CHANNEL 1 -#define HRT_PPM_CHANNEL 1 // Number really doesn't matter for this board -#define GPIO_PPM_IN (16 | GPIO_FUN(RP2040_GPIO_FUNC_SIO)) -#define RC_SERIAL_PORT "/dev/ttyS3" -#define BOARD_SUPPORTS_RC_SERIAL_PORT_OUTPUT - -/* This board provides a DMA pool and APIs */ // Needs to be figured out -#define BOARD_DMA_ALLOC_POOL_SIZE 2048 - -#define BOARD_ENABLE_CONSOLE_BUFFER -#define BOARD_CONSOLE_BUFFER_SIZE (1024*3) - -/* USB - * - * VBUS detection is on 29 ADC_DPM0 and PTE8 - */ -#define GPIO_USB_VBUS_VALID (24 | GPIO_FUN(RP2040_GPIO_FUNC_SIO)) // Used in usb.c - -/* PWM - * - * Alternatively CH3/CH4 could be assigned to UART6_TX/RX - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 4 - -// Has pwm outputs -#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS - -/* - * By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ - -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_USB_VBUS_VALID)) - -__BEGIN_DECLS - -#ifndef __ASSEMBLY__ - -/**************************************************************************************************** - * Name: rp2040_spiinitialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the PX4FMU board. - * - ****************************************************************************************************/ - -extern void rp2040_spiinitialize(void); - - -/**************************************************************************************************** - * Name: rp2040_usbinitialize - * - * Description: - * Called to configure USB IO. - * - ****************************************************************************************************/ - -extern void rp2040_usbinitialize(void); - -extern void board_peripheral_reset(int ms); - -#include - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/raspberrypi/pico/src/boot_string.c b/boards/raspberrypi/pico/src/boot_string.c deleted file mode 100644 index 3b3b2ec..0000000 --- a/boards/raspberrypi/pico/src/boot_string.c +++ /dev/null @@ -1,20 +0,0 @@ -#include - -__attribute__((section(".boot2"))) -const char bootStr[256] = {0x00, 0xb5, 0x32, 0x4b, 0x21, 0x20, 0x58, 0x60, 0x98, 0x68, 0x02, 0x21, 0x88, 0x43, 0x98, 0x60, - 0xd8, 0x60, 0x18, 0x61, 0x58, 0x61, 0x2e, 0x4b, 0x00, 0x21, 0x99, 0x60, 0x02, 0x21, 0x59, 0x61, - 0x01, 0x21, 0xf0, 0x22, 0x99, 0x50, 0x2b, 0x49, 0x19, 0x60, 0x01, 0x21, 0x99, 0x60, 0x35, 0x20, - 0x00, 0xf0, 0x44, 0xf8, 0x02, 0x22, 0x90, 0x42, 0x14, 0xd0, 0x06, 0x21, 0x19, 0x66, 0x00, 0xf0, - 0x34, 0xf8, 0x19, 0x6e, 0x01, 0x21, 0x19, 0x66, 0x00, 0x20, 0x18, 0x66, 0x1a, 0x66, 0x00, 0xf0, - 0x2c, 0xf8, 0x19, 0x6e, 0x19, 0x6e, 0x19, 0x6e, 0x05, 0x20, 0x00, 0xf0, 0x2f, 0xf8, 0x01, 0x21, - 0x08, 0x42, 0xf9, 0xd1, 0x00, 0x21, 0x99, 0x60, 0x1b, 0x49, 0x19, 0x60, 0x00, 0x21, 0x59, 0x60, - 0x1a, 0x49, 0x1b, 0x48, 0x01, 0x60, 0x01, 0x21, 0x99, 0x60, 0xeb, 0x21, 0x19, 0x66, 0xa0, 0x21, - 0x19, 0x66, 0x00, 0xf0, 0x12, 0xf8, 0x00, 0x21, 0x99, 0x60, 0x16, 0x49, 0x14, 0x48, 0x01, 0x60, - 0x01, 0x21, 0x99, 0x60, 0x01, 0xbc, 0x00, 0x28, 0x00, 0xd0, 0x00, 0x47, 0x12, 0x48, 0x13, 0x49, - 0x08, 0x60, 0x03, 0xc8, 0x80, 0xf3, 0x08, 0x88, 0x08, 0x47, 0x03, 0xb5, 0x99, 0x6a, 0x04, 0x20, - 0x01, 0x42, 0xfb, 0xd0, 0x01, 0x20, 0x01, 0x42, 0xf8, 0xd1, 0x03, 0xbd, 0x02, 0xb5, 0x18, 0x66, - 0x18, 0x66, 0xff, 0xf7, 0xf2, 0xff, 0x18, 0x6e, 0x18, 0x6e, 0x02, 0xbd, 0x00, 0x00, 0x02, 0x40, - 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x07, 0x00, 0x00, 0x03, 0x5f, 0x00, 0x21, 0x22, 0x00, 0x00, - 0xf4, 0x00, 0x00, 0x18, 0x22, 0x20, 0x00, 0xa0, 0x00, 0x01, 0x00, 0x10, 0x08, 0xed, 0x00, 0xe0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0xb2, 0x4e, 0x7a - }; diff --git a/boards/raspberrypi/pico/src/i2c.cpp b/boards/raspberrypi/pico/src/i2c.cpp deleted file mode 100644 index 4ab0a07..0000000 --- a/boards/raspberrypi/pico/src/i2c.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(2), -}; diff --git a/boards/raspberrypi/pico/src/init.c b/boards/raspberrypi/pico/src/init.c deleted file mode 100644 index f66a91c..0000000 --- a/boards/raspberrypi/pico/src/init.c +++ /dev/null @@ -1,395 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * board specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "board_config.h" -#include - -#include - -#include -#include - -#include - -#include -#include -#include - -# if defined(FLASH_BASED_PARAMS) -# include -#endif - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/** - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/**************************************************************************** - * Protected Functions - ****************************************************************************/ -/**************************************************************************** - * Public Functions - ****************************************************************************/ -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - UNUSED(ms); -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - // Configure the GPIO pins to outputs and keep them low. - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(io_timer_channel_get_gpio_output(i)); - } - - /* - * On resets invoked from system (not boot) insure we establish a low - * output state (discharge the pins) on PWM pins before they become inputs. - */ - - if (status >= 0) { - up_mdelay(400); - } -} - -/************************************************************************************ - * Name: board_read_VBUS_state - * - * Description: - * All boards must provide a way to read the state of VBUS, this my be simple - * digital input on a GPIO. Or something more complicated like a Analong input - * or reading a bit from a USB controller register. - * - * Returns - 0 if connected. - * - ************************************************************************************/ - -int board_read_VBUS_state(void) -{ - return BOARD_ADC_USB_CONNECTED ? 0 : 1; -} - -/**************************************************************************** - * Name: rp2040_boardearlyinitialize - * - * Description: - * - * This function is taken directly from nuttx's rp2040_boardinitialize.c - ****************************************************************************/ - -void rp2040_boardearlyinitialize(void) -{ - /* Set default UART pin */ -#if defined(CONFIG_RP2040_UART0) && CONFIG_RP2040_UART0_GPIO >= 0 - rp2040_gpio_set_function(CONFIG_RP2040_UART0_GPIO, RP2040_GPIO_FUNC_UART); /* TX */ - rp2040_gpio_set_function(CONFIG_RP2040_UART0_GPIO + 1, RP2040_GPIO_FUNC_UART); /* RX */ -# ifdef CONFIG_SERIAL_OFLOWCONTROL - rp2040_gpio_set_function(CONFIG_RP2040_UART0_GPIO + 2, RP2040_GPIO_FUNC_UART); /* CTS */ -# endif /* CONFIG_SERIAL_OFLOWCONTROL */ -# ifdef CONFIG_SERIAL_IFLOWCONTROL - rp2040_gpio_set_function(CONFIG_RP2040_UART0_GPIO + 3, RP2040_GPIO_FUNC_UART); /* RTS */ -# endif /* CONFIG_SERIAL_IFLOWCONTROL */ -#endif - -#if defined(CONFIG_RP2040_UART1) && CONFIG_RP2040_UART1_GPIO >= 0 - rp2040_gpio_set_function(CONFIG_RP2040_UART1_GPIO, RP2040_GPIO_FUNC_UART); /* TX */ - rp2040_gpio_set_function(CONFIG_RP2040_UART1_GPIO + 1, RP2040_GPIO_FUNC_UART); /* RX */ -# ifdef CONFIG_SERIAL_OFLOWCONTROL - rp2040_gpio_set_function(CONFIG_RP2040_UART1_GPIO + 2, RP2040_GPIO_FUNC_UART); /* CTS */ -# endif /* CONFIG_SERIAL_OFLOWCONTROL */ -# ifdef CONFIG_SERIAL_IFLOWCONTROL - rp2040_gpio_set_function(CONFIG_RP2040_UART1_GPIO + 3, RP2040_GPIO_FUNC_UART); /* RTS */ -# endif /* CONFIG_SERIAL_IFLOWCONTROL */ -#endif -} - -/************************************************************************************ - * Name: rp2040_boardinitialize - * - * Description: - * All 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 -rp2040_boardinitialize(void) -{ - // /* Reset all PWM to Low outputs */ - // board_on_reset(-1); - - // /* configure LEDs */ - board_autoled_initialize(); - - // Disable IE and enable OD on GPIO 26-29 (These are ADC Pins) - // Do this only for the channels configured in board_config.h - rp2040_gpioconfig(27 | GPIO_FUN(RP2040_GPIO_FUNC_NULL)); /* BATT_VOLTAGE_SENS */ - clrbits_reg32(RP2040_PADS_BANK0_GPIO_IE, RP2040_PADS_BANK0_GPIO(27)); /* BATT_VOLTAGE_SENS */ - setbits_reg32(RP2040_PADS_BANK0_GPIO_OD, RP2040_PADS_BANK0_GPIO(27)); /* BATT_VOLTAGE_SENS */ - rp2040_gpioconfig(28 | GPIO_FUN(RP2040_GPIO_FUNC_NULL)); /* BATT_VOLTAGE_SENS */ - clrbits_reg32(RP2040_PADS_BANK0_GPIO_IE, RP2040_PADS_BANK0_GPIO(28)); /* BATT_CURRENT_SENS */ - setbits_reg32(RP2040_PADS_BANK0_GPIO_OD, RP2040_PADS_BANK0_GPIO(28)); /* BATT_CURRENT_SENS */ - - /* Set default I2C pin */ -#if defined(CONFIG_RP2040_I2C0) && CONFIG_RP2040_I2C0_GPIO >= 0 - rp2040_gpio_set_function(CONFIG_RP2040_I2C0_GPIO, RP2040_GPIO_FUNC_I2C); /* SDA */ - rp2040_gpio_set_function(CONFIG_RP2040_I2C0_GPIO + 1, RP2040_GPIO_FUNC_I2C); /* SCL */ - rp2040_gpio_set_pulls(CONFIG_RP2040_I2C0_GPIO, true, false); /* Pull up */ - rp2040_gpio_set_pulls(CONFIG_RP2040_I2C0_GPIO + 1, true, false); -#endif - -#if defined(CONFIG_RP2040_I2C1) && CONFIG_RP2040_I2C1_GPIO >= 0 - rp2040_gpio_set_function(CONFIG_RP2040_I2C1_GPIO, RP2040_GPIO_FUNC_I2C); /* SDA */ - rp2040_gpio_set_function(CONFIG_RP2040_I2C1_GPIO + 1, RP2040_GPIO_FUNC_I2C); /* SCL */ - rp2040_gpio_set_pulls(CONFIG_RP2040_I2C1_GPIO, true, false); /* Pull up */ - rp2040_gpio_set_pulls(CONFIG_RP2040_I2C1_GPIO + 1, true, false); -#endif - - // // TODO: power peripherals - // ///* configure power supply control/sense pins */ - // //stm32_configgpio(GPIO_PERIPH_3V3_EN); - // //stm32_configgpio(GPIO_VDD_BRICK_VALID); - // //stm32_configgpio(GPIO_VDD_USB_VALID); - - // // TODO: 3v3 Sensor? - // ///* Start with Sensor voltage off We will enable it - // // * in board_app_initialize - // // */ - // //stm32_configgpio(GPIO_VDD_3V3_SENSORS_EN); - - // // TODO: SBUS inversion? SPEK power? - // //stm32_configgpio(GPIO_SBUS_INV); - // //stm32_configgpio(GPIO_SPEKTRUM_PWR_EN); - - // // TODO: $$$ Unused? - // //stm32_configgpio(GPIO_8266_GPIO0); - // //stm32_configgpio(GPIO_8266_PD); - // //stm32_configgpio(GPIO_8266_RST); - - // /* Safety - led don in led driver */ - - // // TODO: unused? - // //stm32_configgpio(GPIO_BTN_SAFETY); - - // // TODO: RSSI - // //stm32_configgpio(GPIO_RSSI_IN); - - // stm32_configgpio(GPIO_PPM_IN); - - /* configure SPI all interfaces GPIO */ - rp2040_spiinitialize(); - -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -// static struct spi_dev_s *spi1; -static struct spi_dev_s *spi2; - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - px4_platform_init(); - - /* configure the DMA allocator */ // Needs to be figured out - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "DMA alloc FAILED\n"); - } - - /* set up the serial DMA polling */ // RP2040 nuttx implementation doesn't have serial_dma_poll function yet. - // static struct hrt_call serial_dma_call; - // struct timespec ts; - - // /* - // * Poll at 1ms intervals for received bytes that have not triggered - // * a DMA event. - // */ - // ts.tv_sec = 0; - // ts.tv_nsec = 1000000; - - // hrt_call_every(&serial_dma_call, - // ts_to_abstime(&ts), - // ts_to_abstime(&ts), - // (hrt_callout)stm32_serial_dma_poll, - // NULL); - - /* initial LED state */ - drv_led_start(); - led_on(LED_BLUE); - - // if (board_hardfault_init(2, true) != 0) { // Needs to be figured out as RP2040 doesn't have BBSRAM. - // led_off(LED_BLUE); - // } - - - /* Configure SPI-based devices */ - - // // SPI1: SDCard // Will be configured later - // /* Get the SPI port for the microSD slot */ - // spi1 = rp2040_spibus_initialize(CONFIG_NSH_MMCSDSPIPORTNO); // PX4_BUS_NUMBER_FROM_PX4(1) - - // if (!spi1) { - // syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", CONFIG_NSH_MMCSDSPIPORTNO); - // led_off(LED_BLUE); - // } - - // /* Now bind the SPI interface to the MMCSD driver */ - // int result = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi1); - - // if (result != OK) { - // led_off(LED_BLUE); - // syslog(LOG_ERR, "[boot] FAILED to bind SPI port 1 to the MMCSD driver\n"); - // } - - // up_udelay(20); - - // SPI2: MPU9250 and BMP280 - spi2 = rp2040_spibus_initialize(PX4_BUS_NUMBER_FROM_PX4(2)); - - if (!spi2) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 2\n"); - led_off(LED_BLUE); - } - - /* Default SPI2 to 1MHz and de-assert the known chip selects. */ - SPI_SETFREQUENCY(spi2, 10000000); - SPI_SETBITS(spi2, 8); - SPI_SETMODE(spi2, SPIDEV_MODE3); - up_udelay(20); - -// #if defined(FLASH_BASED_PARAMS) // This probably doesn't relate to RP2040 right now. -// static sector_descriptor_t params_sector_map[] = { -// {1, 16 * 1024, 0x08004000}, -// {0, 0, 0}, -// }; - -// /* Initialize the flashfs layer to use heap allocated memory */ -// result = parameter_flashfs_init(params_sector_map, NULL, 0); - -// if (result != OK) { -// syslog(LOG_ERR, "[boot] FAILED to init params in FLASH %d\n", result); -// led_off(LED_AMBER); -// } - -// #endif - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/raspberrypi/pico/src/led.c b/boards/raspberrypi/pico/src/led.c deleted file mode 100644 index 2e92025..0000000 --- a/boards/raspberrypi/pico/src/led.c +++ /dev/null @@ -1,119 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2021 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * board LED backend. - */ - -#include - -#include - -#include "board_config.h" - -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -static uint32_t g_ledmap[] = { - GPIO_LED_BLUE, // Onboard led on raspberrypi pico -}; - -__EXPORT void led_init(void) -{ - /* Configure LED GPIOs for output */ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - px4_arch_configgpio(g_ledmap[l]); - } -} - -static void phy_set_led(int led, bool state) -{ - /* Pull Down to switch on */ - if (led == 0) { - px4_arch_gpiowrite(g_ledmap[led], state); - } -} - -__EXPORT void led_on(int led) -{ - phy_set_led(led, true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(led, false); -} - -__EXPORT void led_toggle(int led) -{ - if (led == 0) { - phy_set_led(led, !px4_arch_gpioread(g_ledmap[led])); - } -} - -// __EXPORT void board_autoled_initialize() -// { -// /* Configure LED1 GPIO for output */ -// px4_arch_configgpio(GPIO_LED1); -// } - -// __EXPORT void board_autoled_on(int led) -// { -// if (led == 1) { -// /* Pull down to switch on */ -// px4_arch_gpiowrite(GPIO_LED1, false); -// } -// } - -// __EXPORT void board_autoled_off(int led) -// { -// if (led == 1) { -// /* Pull up to switch off */ -// px4_arch_gpiowrite(GPIO_LED1, true); -// } -// } diff --git a/boards/raspberrypi/pico/src/spi.cpp b/boards/raspberrypi/pico/src/spi.cpp deleted file mode 100644 index a258dec..0000000 --- a/boards/raspberrypi/pico/src/spi.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI0, { - initSPIDevice(SPIDEV_MMCSD(0), SPI::CS{GPIO::Pin5}), - }), - initSPIBusExternal(SPI::Bus::SPI1, { - initSPIConfigExternal(SPI::CS{GPIO::Pin13}), - initSPIConfigExternal(SPI::CS{GPIO::Pin14}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/raspberrypi/pico/src/timer_config.cpp b/boards/raspberrypi/pico/src/timer_config.cpp deleted file mode 100644 index 4cf036e..0000000 --- a/boards/raspberrypi/pico/src/timer_config.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1), - initIOTimer(Timer::Timer2), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::ChannelA}, {GPIO::Pin18}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::ChannelB}, {GPIO::Pin19}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::ChannelA}, {GPIO::Pin20}), - initIOTimerChannel(io_timers, {Timer::Timer2, Timer::ChannelB}, {GPIO::Pin21}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = initIOTimerChannelMapping(io_timers, - timer_io_channels); diff --git a/boards/raspberrypi/pico/src/usb.c b/boards/raspberrypi/pico/src/usb.c deleted file mode 100644 index bc6306a..0000000 --- a/boards/raspberrypi/pico/src/usb.c +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2021 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include "board_config.h" - -/************************************************************************************ - * Name: rp2040_usbinitialize - * - * Description: - * Called to setup USB-related GPIO pins for the omnibusf4sd board. - * - ************************************************************************************/ - -__EXPORT void rp2040_usbinitialize(void) -{ - px4_arch_configgpio(GPIO_USB_VBUS_VALID); -} - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void rp2040_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} - diff --git a/boards/scumaker/pilotpi/arm64.px4board b/boards/scumaker/pilotpi/arm64.px4board deleted file mode 100644 index 756dd57..0000000 --- a/boards/scumaker/pilotpi/arm64.px4board +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="aarch64-linux-gnu" -CONFIG_EXAMPLES_FAKE_IMU=y -CONFIG_EXAMPLES_FAKE_MAGNETOMETER=y diff --git a/boards/scumaker/pilotpi/cmake/upload.cmake b/boards/scumaker/pilotpi/cmake/upload.cmake deleted file mode 100644 index f3ff69c..0000000 --- a/boards/scumaker/pilotpi/cmake/upload.cmake +++ /dev/null @@ -1,53 +0,0 @@ -############################################################################ -# -# Copyright (c) 2020 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. -# -############################################################################ - -if(DEFINED ENV{AUTOPILOT_HOST}) - set(AUTOPILOT_HOST $ENV{AUTOPILOT_HOST}) -else() - set(AUTOPILOT_HOST "raspberrypi") -endif() - -if(DEFINED ENV{AUTOPILOT_USER}) - set(AUTOPILOT_USER $ENV{AUTOPILOT_USER}) -else() - set(AUTOPILOT_USER "pi") -endif() - -add_custom_target(upload - COMMAND rsync -arh --progress - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/rpi/pilotpi*.config ${PX4_BINARY_DIR}/etc # source - "${AUTOPILOT_USER}@${AUTOPILOT_HOST}:/home/${AUTOPILOT_USER}/px4" # destination - DEPENDS px4 - COMMENT "uploading px4" - USES_TERMINAL -) diff --git a/boards/scumaker/pilotpi/default.px4board b/boards/scumaker/pilotpi/default.px4board deleted file mode 100644 index 0de2a43..0000000 --- a/boards/scumaker/pilotpi/default.px4board +++ /dev/null @@ -1,76 +0,0 @@ -CONFIG_PLATFORM_POSIX=y -CONFIG_BOARD_LINUX_TARGET=y -CONFIG_BOARD_TOOLCHAIN="arm-linux-gnueabihf" -CONFIG_BOARD_ARCHITECTURE="cortex-a53" -CONFIG_BOARD_TESTING=y -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_BAROMETER_MS5611=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM42605=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y -CONFIG_DRIVERS_MAGNETOMETER_HMC5883=y -CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8310=y -CONFIG_DRIVERS_MAGNETOMETER_QMC5883L=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_COMMON_RC=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DYN=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SHUTDOWN=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_DYN_HELLO=y -CONFIG_EXAMPLES_FAKE_GPS=y -CONFIG_EXAMPLES_HELLO=y -CONFIG_EXAMPLES_PX4_MAVLINK_DEBUG=y -CONFIG_EXAMPLES_PX4_SIMPLE_APP=y -CONFIG_EXAMPLES_WORK_ITEM=y diff --git a/boards/scumaker/pilotpi/init/rc.board_defaults b/boards/scumaker/pilotpi/init/rc.board_defaults deleted file mode 100644 index 1677fa4..0000000 --- a/boards/scumaker/pilotpi/init/rc.board_defaults +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -# 1K + 4.7K -param set-default BAT1_V_DIV 5.7 diff --git a/boards/scumaker/pilotpi/src/CMakeLists.txt b/boards/scumaker/pilotpi/src/CMakeLists.txt deleted file mode 100644 index fbe6748..0000000 --- a/boards/scumaker/pilotpi/src/CMakeLists.txt +++ /dev/null @@ -1,37 +0,0 @@ -############################################################################ -# -# Copyright (c) 2020 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. -# -############################################################################ - -add_library(drivers_board - i2c.cpp - spi.cpp -) diff --git a/boards/scumaker/pilotpi/src/board_config.h b/boards/scumaker/pilotpi/src/board_config.h deleted file mode 100644 index 76abae2..0000000 --- a/boards/scumaker/pilotpi/src/board_config.h +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * RPI internal definitions - */ - -#pragma once - -#define BOARD_OVERRIDE_UUID "RPIID00000000000" // must be of length 16 -#define PX4_SOC_ARCH_ID PX4_SOC_ARCH_ID_RPI - - -// I2C -#define CONFIG_I2C 1 -#define PX4_NUMBER_I2C_BUSES 2 - - -// SPI -#define CONFIG_SPI 1 - - -#define ADC_BATTERY_VOLTAGE_CHANNEL 0 -#define ADC_BATTERY_CURRENT_CHANNEL -1 -#define ADC_AIRSPEED_VOLTAGE_CHANNEL 2 - -#define ADC_DP_V_DIV 1.0f - -#define BOARD_ADC_OPEN_CIRCUIT_V 5.3f // Powered from USB - -#include -#include diff --git a/boards/scumaker/pilotpi/src/i2c.cpp b/boards/scumaker/pilotpi/src/i2c.cpp deleted file mode 100644 index 2546cd0..0000000 --- a/boards/scumaker/pilotpi/src/i2c.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(0), - initI2CBusInternal(1), -}; diff --git a/boards/scumaker/pilotpi/src/spi.cpp b/boards/scumaker/pilotpi/src/spi.cpp deleted file mode 100644 index 55ff4a9..0000000 --- a/boards/scumaker/pilotpi/src/spi.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(0, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, 0), - initSPIDevice(DRV_IMU_DEVTYPE_ICM42605, 0), - }), -}; diff --git a/boards/sky-drones/smartap-airlink/default.px4board b/boards/sky-drones/smartap-airlink/default.px4board deleted file mode 100644 index c571683..0000000 --- a/boards/sky-drones/smartap-airlink/default.px4board +++ /dev/null @@ -1,100 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_BOARD_ETHERNET=y -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS0" -CONFIG_BOARD_SERIAL_GPS2="/dev/ttyS7" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS6" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS4" -CONFIG_BOARD_SERIAL_TEL3="/dev/ttyS1" -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_COMMON_BAROMETERS=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_HEATER=y -CONFIG_DRIVERS_IMU_BOSCH_BMI088=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU9250=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_PWM_INPUT=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_PX4IO=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_SAFETY_BUTTON=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BL_UPDATE=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NETMAN=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SERIAL_TEST=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/sky-drones/smartap-airlink/extras/px4_io-v2_default.bin b/boards/sky-drones/smartap-airlink/extras/px4_io-v2_default.bin deleted file mode 100755 index 25a00e2..0000000 Binary files a/boards/sky-drones/smartap-airlink/extras/px4_io-v2_default.bin and /dev/null differ diff --git a/boards/sky-drones/smartap-airlink/extras/sky-drones_smartap-airlink_bootlader.bin b/boards/sky-drones/smartap-airlink/extras/sky-drones_smartap-airlink_bootlader.bin deleted file mode 100755 index 8651520..0000000 Binary files a/boards/sky-drones/smartap-airlink/extras/sky-drones_smartap-airlink_bootlader.bin and /dev/null differ diff --git a/boards/sky-drones/smartap-airlink/firmware.prototype b/boards/sky-drones/smartap-airlink/firmware.prototype deleted file mode 100644 index 96f17fb..0000000 --- a/boards/sky-drones/smartap-airlink/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 55, - "magic": "PX4FWv1", - "description": "Firmware for the SMARTAP AIRLINK board", - "image": "", - "build_time": 0, - "summary": "SMARTAP-AIRLINK", - "version": "0.1", - "image_size": 0, - "image_maxsize": 2064384, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/sky-drones/smartap-airlink/init/rc.board_defaults b/boards/sky-drones/smartap-airlink/init/rc.board_defaults deleted file mode 100644 index c581f8c..0000000 --- a/boards/sky-drones/smartap-airlink/init/rc.board_defaults +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -# Telemetry for onboard computer -param set-default MAV_1_CONFIG 102 # TELEM2 -param set-default MAV_1_MODE 0 # Normal -param set-default SER_TEL2_BAUD 921600 # 921600 - -# Temperature stabilization -param set-default SENS_EN_THERMAL 1 # Enable heater -param set-default SENS_TEMP_ID 2359314 # Heated IMU ID - -# Battery scaling -param set-default BAT_N_CELLS 4 -param set-default BAT1_N_CELLS 4 - -param set-default BAT1_V_DIV 15.51 - -param set-default BAT1_A_PER_V 36.00 - -param set-default BAT_V_OFFS_CURR 0.413 - -# Disable safety switch -param set-default CBRK_IO_SAFETY 22027 - -param set-default SYS_USE_IO 1 - -safety_button start - -set LOGGER_BUF 32 diff --git a/boards/sky-drones/smartap-airlink/init/rc.board_sensors b/boards/sky-drones/smartap-airlink/init/rc.board_sensors deleted file mode 100644 index 5ce477b..0000000 --- a/boards/sky-drones/smartap-airlink/init/rc.board_sensors +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# -# board specific sensors init -#------------------------------------------------------------------------------ -board_adc start - -# Internal SPI bus MPU-9250 / SPI 2 [FPC] -mpu9250 -s -b 2 -R 6 start - -# Internal SPI bus ICM-20602 / SPI 1 -icm20602 -R 0 -s start - -# Internal SPI bus MPU-9250 / SPI 3 -mpu9250 -s -b 3 -M -R 4 start - -# Internal compass -bmm150 -I start - -# Internal Baro -ms5611 -X start - -# Internal Baro -bmp388 -I -a 0x77 start -#bmp388 -I start - -# External HMC5983 -hmc5883 -T -X -R 4 start - -# External LIS3MDL -lis3mdl -R 2 -X start - -# NCP5623 Led driver -rgbled_ncp5623c -X -a 0x38 start - diff --git a/boards/sky-drones/smartap-airlink/nuttx-config/Kconfig b/boards/sky-drones/smartap-airlink/nuttx-config/Kconfig deleted file mode 100644 index 520c5ab..0000000 --- a/boards/sky-drones/smartap-airlink/nuttx-config/Kconfig +++ /dev/null @@ -1,17 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see misc/tools/kconfig-language.txt. -# -config BOARD_HAS_PROBES - bool "Board provides GPIO or other Hardware for signaling to timing analyze." - default y - ---help--- - This board provides GPIO FMU-CH1-8, CAP1 as PROBE_1-9 to provide timing signals from selected drivers. - -config BOARD_USE_PROBES - bool "Enable the use the board provided FMU-CH1-8, CAP1 as PROBE_1-9" - default n - depends on BOARD_HAS_PROBES - - ---help--- - Select to use GPIO FMU-CH1-8, CAP1 to provide timing signals from selected drivers. diff --git a/boards/sky-drones/smartap-airlink/nuttx-config/include/board.h b/boards/sky-drones/smartap-airlink/nuttx-config/include/board.h deleted file mode 100644 index 6e5759b..0000000 --- a/boards/sky-drones/smartap-airlink/nuttx-config/include/board.h +++ /dev/null @@ -1,503 +0,0 @@ -/************************************************************************************ - * nuttx-configs/smartap-airlink/include/board.h - * - * Copyright (C) 2016-2019 Gregory Nutt. All rights reserved. - * Authors: David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ -#ifndef __NUTTX_CONFIG_SMARTAP_AIRLINK_INCLUDE_BOARD_H -#define __NUTTX_CONFIG_SMARTAP_AIRLINK_INCLUDE_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The board provides the following clock sources: - * - * X301: 16 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 16 MHz RC factory-trimmed - * HSE: 16 MHz crystal for HSE - */ - -#define STM32_BOARD_XTAL 16000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 0 - -/* Main PLL Configuration. - * - * PLL source is HSE = 16,000,000 - * - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 2 <= PLLM <= 63 - * 192 <= PLLN <= 432 - * 192 MHz <= PLL_VCO <= 432MHz - * - * SYSCLK = PLL_VCO / PLLP - * Subject to - * - * PLLP = {2, 4, 6, 8} - * SYSCLK <= 216 MHz - * - * USB OTG FS, SDMMC and RNG Clock = PLL_VCO / PLLQ - * Subject to - * The USB OTG FS requires a 48 MHz clock to work correctly. The SDMMC - * and the random number generator need a frequency lower than or equal - * to 48 MHz to work correctly. - * - * 2 <= PLLQ <= 15 - */ - -/* Highest SYSCLK with USB OTG FS clock = 48 MHz - * - * PLL_VCO = (16,000,000 / 8) * 216 = 432 MHz - * SYSCLK = 432 MHz / 2 = 216 MHz - * USB OTG FS, SDMMC and RNG Clock = 432 MHz / 9 = 48 MHz - */ - -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(8) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(216) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(9) - -#define STM32_VCO_FREQUENCY ((STM32_HSE_FREQUENCY / 8) * 216) -#define STM32_SYSCLK_FREQUENCY (STM32_VCO_FREQUENCY / 2) -#define STM32_OTGFS_FREQUENCY (STM32_VCO_FREQUENCY / 9) - -/* Configure factors for PLLSAI clock */ - -#define CONFIG_STM32F7_PLLSAI 1 -#define STM32_RCC_PLLSAICFGR_PLLSAIN RCC_PLLSAICFGR_PLLSAIN(192) -#define STM32_RCC_PLLSAICFGR_PLLSAIP RCC_PLLSAICFGR_PLLSAIP(8) -#define STM32_RCC_PLLSAICFGR_PLLSAIQ RCC_PLLSAICFGR_PLLSAIQ(4) -#define STM32_RCC_PLLSAICFGR_PLLSAIR RCC_PLLSAICFGR_PLLSAIR(2) - -/* Configure Dedicated Clock Configuration Register */ - -#define STM32_RCC_DCKCFGR1_PLLI2SDIVQ RCC_DCKCFGR1_PLLI2SDIVQ(1) -#define STM32_RCC_DCKCFGR1_PLLSAIDIVQ RCC_DCKCFGR1_PLLSAIDIVQ(1) -#define STM32_RCC_DCKCFGR1_PLLSAIDIVR RCC_DCKCFGR1_PLLSAIDIVR(0) -#define STM32_RCC_DCKCFGR1_SAI1SRC RCC_DCKCFGR1_SAI1SEL(0) -#define STM32_RCC_DCKCFGR1_SAI2SRC RCC_DCKCFGR1_SAI2SEL(0) -#define STM32_RCC_DCKCFGR1_TIMPRESRC 0 -#define STM32_RCC_DCKCFGR1_DFSDM1SRC 0 -#define STM32_RCC_DCKCFGR1_ADFSDM1SRC 0 - - - -/* Configure factors for PLLI2S clock */ - -#define CONFIG_STM32F7_PLLI2S 1 -#define STM32_RCC_PLLI2SCFGR_PLLI2SN RCC_PLLI2SCFGR_PLLI2SN(192) -#define STM32_RCC_PLLI2SCFGR_PLLI2SP RCC_PLLI2SCFGR_PLLI2SP(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SQ RCC_PLLI2SCFGR_PLLI2SQ(2) -#define STM32_RCC_PLLI2SCFGR_PLLI2SR RCC_PLLI2SCFGR_PLLI2SR(2) - -/* Configure Dedicated Clock Configuration Register 2 */ - -#define STM32_RCC_DCKCFGR2_USART1SRC RCC_DCKCFGR2_USART1SEL_APB -#define STM32_RCC_DCKCFGR2_USART2SRC RCC_DCKCFGR2_USART2SEL_APB -#define STM32_RCC_DCKCFGR2_UART4SRC RCC_DCKCFGR2_UART4SEL_APB -#define STM32_RCC_DCKCFGR2_UART5SRC RCC_DCKCFGR2_UART5SEL_APB -#define STM32_RCC_DCKCFGR2_USART6SRC RCC_DCKCFGR2_USART6SEL_APB -#define STM32_RCC_DCKCFGR2_UART7SRC RCC_DCKCFGR2_UART7SEL_APB -#define STM32_RCC_DCKCFGR2_UART8SRC RCC_DCKCFGR2_UART8SEL_APB -#define STM32_RCC_DCKCFGR2_I2C1SRC RCC_DCKCFGR2_I2C1SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C2SRC RCC_DCKCFGR2_I2C2SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C3SRC RCC_DCKCFGR2_I2C3SEL_HSI -#define STM32_RCC_DCKCFGR2_I2C4SRC RCC_DCKCFGR2_I2C4SEL_HSI -#define STM32_RCC_DCKCFGR2_LPTIM1SRC RCC_DCKCFGR2_LPTIM1SEL_APB -#define STM32_RCC_DCKCFGR2_CECSRC RCC_DCKCFGR2_CECSEL_HSI -#define STM32_RCC_DCKCFGR2_CK48MSRC RCC_DCKCFGR2_CK48MSEL_PLL -#define STM32_RCC_DCKCFGR2_SDMMCSRC RCC_DCKCFGR2_SDMMCSEL_48MHZ -#define STM32_RCC_DCKCFGR2_SDMMC2SRC RCC_DCKCFGR2_SDMMC2SEL_48MHZ -#define STM32_RCC_DCKCFGR2_DSISRC RCC_DCKCFGR2_DSISEL_PHY - - -/* Several prescalers allow the configuration of the two AHB buses, the - * high-speed APB (APB2) and the low-speed APB (APB1) domains. The maximum - * frequency of the two AHB buses is 216 MHz while the maximum frequency of - * the high-speed APB domains is 108 MHz. The maximum allowed frequency of - * the low-speed APB domain is 54 MHz. - */ - -/* AHB clock (HCLK) is SYSCLK (216 MHz) */ - -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (54 MHz) */ - -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (108MHz) */ - -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* SDMMC dividers. Note that slower clocking is required when DMA is disabled - * in order to avoid RX overrun/TX underrun errors due to delayed responses - * to service FIFOs in interrupt driven mode. These values have not been - * tuned!!! - * - * SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(118+2)=400 KHz - */ - -/* Use the Falling edge of the SDIO_CLK clock to change the edge the - * data and commands are change on - */ - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - -#define STM32_SDMMC_INIT_CLKDIV (118 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* DMA ON: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(1+2)=16 MHz - * DMA OFF: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32F7_SDMMC_DMA -# define STM32_SDMMC_MMCXFR_CLKDIV (1 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (2 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -/* DMA ON: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(1+2)=16 MHz - * DMA OFF: SDMMCCLK=48MHz, SDMMC_CK=SDMMCCLK/(2+2)=12 MHz - */ -//TODO #warning "Check Freq for 24mHz" - -#ifdef CONFIG_STM32F7_SDMMC_DMA -# define STM32_SDMMC_SDXFR_CLKDIV (1 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (2 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -/* FLASH wait states - * - * --------- ---------- ----------- - * VDD MAX SYSCLK WAIT STATES - * --------- ---------- ----------- - * 1.7-2.1 V 180 MHz 8 - * 2.1-2.4 V 216 MHz 9 - * 2.4-2.7 V 216 MHz 8 - * 2.7-3.6 V 216 MHz 7 - * --------- ---------- ----------- - */ - -#define BOARD_FLASH_WAITSTATES 7 - -/* LED definitions ******************************************************************/ -/* The board has numerous LEDs but only three, LED_GREEN a Green LED, LED_BLUE - * a Blue LED and LED_RED a Red LED, that can be controlled by software. - * - * If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any way. - * The following definitions are used to access individual LEDs. - */ - -/* LED index values for use with board_userled() */ - -#define BOARD_LED1 0 -#define BOARD_LED2 1 -#define BOARD_LED3 2 -#define BOARD_NLEDS 3 - -#define BOARD_LED_RED BOARD_LED1 -#define BOARD_LED_GREEN BOARD_LED2 -#define BOARD_LED_BLUE BOARD_LED3 - -/* LED bits for use with board_userled_all() */ - -#define BOARD_LED1_BIT (1 << BOARD_LED1) -#define BOARD_LED2_BIT (1 << BOARD_LED2) -#define BOARD_LED3_BIT (1 << BOARD_LED3) - -/* If CONFIG_ARCH_LEDS is defined, the usage by the board port is defined in - * include/board.h and src/stm32_leds.c. The LEDs are used to encode OS-related - * events as follows: - * - * - * SYMBOL Meaning LED state - * Red Green Blue - * ---------------------- -------------------------- ------ ------ ----*/ - -#define LED_STARTED 0 /* NuttX has been started OFF OFF OFF */ -#define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF OFF ON */ -#define LED_IRQSENABLED 2 /* Interrupts enabled OFF ON OFF */ -#define LED_STACKCREATED 3 /* Idle stack created OFF ON ON */ -#define LED_INIRQ 4 /* In an interrupt N/C N/C GLOW */ -#define LED_SIGNAL 5 /* In a signal handler N/C GLOW N/C */ -#define LED_ASSERTION 6 /* An assertion failed GLOW N/C GLOW */ -#define LED_PANIC 7 /* The system has crashed Blink OFF N/C */ -#define LED_IDLE 8 /* MCU is is sleep mode ON OFF OFF */ - -/* Thus if the Green LED is statically on, NuttX has successfully booted and - * is, apparently, running normally. If the Red LED is flashing at - * approximately 2Hz, then a fatal error has been detected and the system - * has halted. - */ - -/* Alternate function pin selections ************************************************/ - -#define GPIO_USART1_RX GPIO_USART1_RX_3 /* PB15 */ -#define GPIO_USART1_TX GPIO_USART1_TX_3 /* PB14 */ - -#define GPIO_USART2_RX GPIO_USART2_RX_1 /* PA3 */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 /* PD4 */ -#define GPIO_USART2_CTS GPIO_USART2_CTS_2 /* PD3 */ - -#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ -#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ - -#define GPIO_UART4_RX GPIO_UART4_RX_5 /* PH14 */ -#define GPIO_UART4_TX GPIO_UART4_TX_5 /* PH13 */ - -#define GPIO_UART5_RX GPIO_UART5_RX_1 /* PD2 */ -#define GPIO_UART5_TX GPIO_UART5_TX_4 /* PB9 */ -#define GPIO_UART5_RTS GPIO_UART5_RTS_1 /* PC8 */ -#define GPIO_UART5_CTS GPIO_UART5_CTS_1 /* PC9 */ - -#define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC 7 */ -#define GPIO_USART6_TX GPIO_USART6_TX_1 /* PC6 */ - -#define GPIO_UART7_RX GPIO_UART7_RX_2 /* PF6 */ -#define GPIO_UART7_TX GPIO_UART7_TX_1 /* PE8 */ -#define GPIO_UART7_RTS GPIO_UART7_RTS_1 /* PE9 */ -#define GPIO_UART7_CTS GPIO_UART7_CTS_1 /* PE10 */ - -/* UART8: has no remap - * - * GPIO_UART8_RX PE0 - * GPIO_UART8_TX PE1 - */ - - -/* CAN - * - * CAN1 is routed to transceiver. - * CAN2 is routed to transceiver. - */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 /* PD0 */ -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 /* PD1 */ -#define GPIO_CAN2_RX GPIO_CAN2_RX_1 /* PB12 */ -#define GPIO_CAN2_TX GPIO_CAN2_TX_2 /* PB6 */ - -/* SPI - * SPI1 is sensors1 - * SPI2 is sensors2 - * SPI3 is sensors3 - * SPI4 is Not Used - * SPI5 is FRAM - * SPI6 is EXTERNAL1 - * - */ - -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_2 /* PB4 */ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_2 /* PB5 */ -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 /* PA5 */ - -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_3 /* PI2 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_3 /* PI3 */ -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_5 /* PI1 */ - -#define GPIO_SPI3_MISO GPIO_SPI3_MISO_2 /* PC11 */ -#define GPIO_SPI3_MOSI GPIO_SPI3_MOSI_1 /* PB2 */ -#define GPIO_SPI3_SCK GPIO_SPI3_SCK_2 /* PC10 */ - -#define GPIO_SPI5_MISO GPIO_SPI5_MISO_1 /* PF8 */ -#define GPIO_SPI5_MOSI GPIO_SPI5_MOSI_2 /* PF11 */ -#define GPIO_SPI5_SCK GPIO_SPI5_SCK_1 /* PF7 */ - -#define GPIO_SPI6_MISO GPIO_SPI6_MISO_2 /* PA6 */ -#define GPIO_SPI6_MOSI GPIO_SPI6_MOSI_1 /* PG14 */ -#define GPIO_SPI6_SCK GPIO_SPI6_SCK_3 /* PB3 */ - -/* I2C - * - * The optional _GPIO configurations allow the I2C driver to manually - * reset the bus to clear stuck slaves. They match the pin configuration, - * but are normally-high GPIOs. - * - */ - -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 /* PB8 */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_1 /* PB7 */ - -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN8) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN7) - -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_2 /* PF1 */ -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_2 /* PF0 */ - -#define GPIO_I2C2_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTF | GPIO_PIN1) -#define GPIO_I2C2_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTF | GPIO_PIN0) - -#define GPIO_I2C3_SCL GPIO_I2C3_SCL_2 /* PH7 */ -#define GPIO_I2C3_SDA GPIO_I2C3_SDA_2 /* PH8 */ - -#define GPIO_I2C3_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTH | GPIO_PIN7) -#define GPIO_I2C3_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTH | GPIO_PIN8) - -#define GPIO_I2C4_SCL GPIO_I2C4_SCL_2 /* PF14 */ -#define GPIO_I2C4_SDA GPIO_I2C4_SDA_2 /* PF15 */ - -#define GPIO_I2C4_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTF | GPIO_PIN14) -#define GPIO_I2C4_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTF | GPIO_PIN15) - -/* SDMMC2 - * - * VDD 3.3 - * GND - * SDMMC2_CK PD6 - * SDMMC2_CMD PD7 - * SDMMC2_D0 PG9 - * SDMMC2_D1 PG10 - * SDMMC2_D2 PG11 - * SDMMC2_D3 PG12 - */ - -#define GPIO_SDMMC2_D0 GPIO_SDMMC2_D0_2 -#define GPIO_SDMMC2_D1 GPIO_SDMMC2_D1_2 -#define GPIO_SDMMC2_D2 GPIO_SDMMC2_D2_2 -#define GPIO_SDMMC2_D3 GPIO_SDMMC2_D3_2 - -/* The STM32 F7 connects to a TI DP83848TSQ/NOPB - * using RMII - * - * STM32 F7 BOARD DP83848TSQ/NOPB - * GPIO SIGNAL PIN NAME - * -------- ------------ ------------- - * PA7 ETH_CRS_DV CRS_DV - * PC1 ETH_MDC MDC - * PA2 ETH_MDIO MDIO - * PA1 ETH_REF_CL X1 - * PC4 ETH_RXD0 RX_D0 - * PC5 ETH_RXD1 RX_D1 - * PB11 ETH_TX_EN TX_EN - * PG13 ETH_TXD0 TX_D0 - * PB13 ETH_TXD1 TX_D1 - * - * The PHY address is 1, since COL/PHYAD0 features a pull up. - */ - -#define GPIO_ETH_RMII_TX_EN GPIO_ETH_RMII_TX_EN_1 -#define GPIO_ETH_RMII_TXD0 GPIO_ETH_RMII_TXD0_2 -#define GPIO_ETH_RMII_TXD1 GPIO_ETH_RMII_TXD1_1 - - -/* USB - * - * OTG_FS_DM PA11 - * OTG_FS_DP PA12 - * VBUS PA9 - */ - - -/* Board provides GPIO or other Hardware for signaling to timing analyzer */ - -#if defined(CONFIG_BOARD_USE_PROBES) -# include "stm32_gpio.h" -# define PROBE_N(n) (1<<((n)-1)) -# define PROBE_1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN14) /* PE14 AUX1 */ -# define PROBE_2 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN10) /* PA10 AUX2 */ -# define PROBE_3 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN11) /* PE11 AUX3 */ -# define PROBE_4 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN8) /* PA8 AUX4 */ -# define PROBE_5 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN13) /* PD13 AUX5 */ -# define PROBE_6 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN14) /* PD14 AUX6 */ -# define PROBE_7 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN6) /* PH6 AUX7 */ -# define PROBE_8 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN9) /* PH9 AUX8 */ -# define PROBE_9 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTI|GPIO_PIN0) /* PI0 CAP1 */ - -# define PROBE_INIT(mask) \ - do { \ - if ((mask)& PROBE_N(1)) { stm32_configgpio(PROBE_1); } \ - if ((mask)& PROBE_N(2)) { stm32_configgpio(PROBE_2); } \ - if ((mask)& PROBE_N(3)) { stm32_configgpio(PROBE_3); } \ - if ((mask)& PROBE_N(4)) { stm32_configgpio(PROBE_4); } \ - if ((mask)& PROBE_N(5)) { stm32_configgpio(PROBE_5); } \ - if ((mask)& PROBE_N(6)) { stm32_configgpio(PROBE_6); } \ - if ((mask)& PROBE_N(7)) { stm32_configgpio(PROBE_7); } \ - if ((mask)& PROBE_N(8)) { stm32_configgpio(PROBE_8); } \ - if ((mask)& PROBE_N(9)) { stm32_configgpio(PROBE_9); } \ - } while(0) - -# define PROBE(n,s) do {stm32_gpiowrite(PROBE_##n,(s));}while(0) -# define PROBE_MARK(n) PROBE(n,false);PROBE(n,true) -#else -# define PROBE_INIT(mask) -# define PROBE(n,s) -# define PROBE_MARK(n) -#endif - -#endif /*__NUTTX_CONFIG_SMARTAP_AIRLINK_INCLUDE_BOARD_H */ diff --git a/boards/sky-drones/smartap-airlink/nuttx-config/include/board_dma_map.h b/boards/sky-drones/smartap-airlink/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 5722e13..0000000 --- a/boards/sky-drones/smartap-airlink/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** - * - * 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. - * - ****************************************************************************/ - -#pragma once - -/* -| DMA1 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | SPI3_RX_1 | SPDIFRX_DT | SPI3_RX_2 | SPI2_RX | SPI2_TX | SPI3_TX_1 | SPDIFRX_CS | SPI3_TX_2 | -| Channel 1 | I2C1_RX | I2C3_RX | TIM7_UP_1 | - | TIM7_UP_2 | I2C1_RX_1 | I2C1_TX | I2C1_TX_1 | -| Channel 2 | TIM4_CH1 | - | I2C4_RX | TIM4_CH2 | - | I2C4_RX | TIM4_UP | TIM4_CH3 | -| Channel 3 | - | TIM2_UP_1 | I2C3_RX_1 | - | I2C3_TX | TIM2_CH1 | TIM2_CH2 | TIM2_UP_2 | -| | | TIM2_CH3 | | | | | TIM2_CH4_1 | TIM2_CH4_2 | -| Channel 4 | UART5_RX | USART3_RX | UART4_RX | USART3_TX_1 | UART4_TX | USART2_RX | USART2_TX | UART5_TX | -| Channel 5 | UART8_TX | UART7_TX | TIM3_CH4 | UART7_RX | TIM3_CH1 | TIM3_CH2 | UART8_RX | TIM3_CH3 | -| | | | TIM3_UP | | TIM3_TRIG | | | | -| Channel 6 | TIM5_CH3 | TIM5_CH4_1 | TIM5_CH1 | TIM5_CH4_2 | TIM5_CH2 | - | TIM5_UP_2 | - | -| | TIM5_UP_1 | TIM5_TRIG_1 | | TIM5_TRIG_2 | | | | | -| Channel 7 | - | TIM6_UP | I2C2_RX | I2C2_RX_1 | USART3_TX_2 | DAC1 | DAC2 | I2C2_TX | -| Channel 8 | I2C3_TX | I2C4_RX | - | - | I2C2_TX | - | I2C4_TX | - | -| Channel 9 | - | SPI2_RX | - | - | - | - | SPI2_TX | - | -| | | | | | | | | | -| Usage | UART5_RX | SPI2_RX | SPI3_RX_2 | UART7_RX | SPI2_TX | SPI3_TX_1 | TIM4_UP | UART5_TX | - - -| DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | ADC1_1 | SAI1_A | TIM8_CH1_1 | SAI1_A_1 | ADC1_2 | SAI1_B_1 | TIM1_CH1_1 | SAI2_B_2 | -| | | | TIM8_CH2_1 | | | | TIM1_CH2_1 | | -| | | | TIM8_CH3_1 | | | | TIM1_CH3_1 | | -| Channel 1 | - | DCMI_1 | ADC2_1 | ADC2_2 | SAI1_B | SPI6_TX | SPI6_RX | DCMI_2 | -| Channel 2 | ADC3_1 | ADC3_2 | - | SPI5_RX_1 | SPI5_TX_1 | CRYP_OUT | CRYP_IN | HASH_IN | -| Channel 3 | SPI1_RX_1 | - | SPI1_RX_2 | SPI1_TX_1 | SAI2_A | SPI1_TX_2 | SAI2_B | QUADSPI | -| Channel 4 | SPI4_RX_1 | SPI4_TX_1 | USART1_RX_1 | SDMMC1_1 | - | USART1_RX_2 | SDMMC1_2 | USART1_TX | -| Channel 5 | - | USART6_RX_1 | USART6_RX_2 | SPI4_RX_2 | SPI4_TX_2 | - | USART6_TX_1 | USART6_TX_2 | -| Channel 6 | TIM1_TRIG_1 | TIM1_CH1_2 | TIM1_CH2_2 | TIM1_CH1 | TIM1_CH4 | TIM1_UP | TIM1_CH3_2 | - | -| | | | | | TIM1_TRIG_2 | | | | -| | | | | | TIM1_COM | | | | -| Channel 7 | - | TIM8_UP | TIM8_CH1_2 | TIM8_CH2_2 | TIM8_CH3_2 | SPI5_RX_2 | SPI5_TX_2 | TIM8_CH4 | -| | | | | | | | | TIM8_TRIG | -| | | | | | | | | TIM8_COM | -| Channel 8 | DSFDM1_FLT0 | DSFDM1_FLT1 | DSFDM1_FLT2 | DSFDM1_FLT3 | DSFDM1_FLT0 | DSFDM1_FLT1 | DSFDM1_FLT2 | DSFDM1_FLT3 | -| Channel 9 | JPEG_IN | JPEG_OUT | SPI4_TX | JPEG_IN | JPEG_OUT | SPI5_RX | - | - | -| Channel 10 | SAI1_B | SAI2_B | SAI2_A | - | - | - | SAI1_A | - | -| Channel 11 | SDMMC2 | - | QUADSPI | - | - | SDMMC2 | - | - | -| | | | | | | | | | -| Usage | SDMMC2 | USART6_RX_1 | SPI1_RX_2 | SPI1_TX_1 | | TIM1_UP | | USART6_TX_2 | - */ - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// DMAMAP_UART5_RX // DMA1, Stream 0, Channel 4 (TELEM2 RX) -#define DMAMAP_SPI2_RX DMAMAP_SPI2_RX_1 // DMA1, Stream 1, Channel 9 (SPI2 RX) -#define DMAMAP_SPI3_RX DMAMAP_SPI3_RX_2 // DMA1, Stream 2, Channel 0 (SPI3 RX) -// DMAMAP_UART7_RX // DMA1, Stream 3, Channel 5 (TELEM1 RX) -#define DMAMAP_SPI2_TX DMAMAP_SPI2_TX_2 // DMA1, Stream 4, Channel 0 (SPI2 TX) -#define DMAMAP_SPI3_TX DMAMAP_SPI3_TX_1 // DMA1, Stream 5, Channel 0 (SPI3 TX) -// DMAMAP_TIM4_UP // DMA1, Stream 6, Channel 2 (DSHOT) -// DMAMAP_UART5_TX // DMA1, Stream 7, Channel 4 (TELEM2 TX) - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMAMAP_SDMMC2 DMAMAP_SDMMC2_1 // DMA2, Stream 0, Channel 11 -#define DMAMAP_USART6_RX DMAMAP_USART6_RX_1 // DMA2, Stream 1, Channel 5 (PX4IO) -#define DMAMAP_SPI1_RX DMAMAP_SPI1_RX_2 // DMA2, Stream 2, Channel 3 (SPI sensors RX) -#define DMAMAP_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 3, Channel 3 (SPI sensors TX) -// AVAILABLE // DMA2, Stream 4 -// DMAMAP_TIM1_UP // DMA2, Stream 5, Channel 6 (DSHOT) -// AVAILABLE // DMA2, Stream 6 -#define DMAMAP_USART6_TX DMAMAP_USART6_TX_2 // DMA2, Stream 7, Channel 5 (PX4IO) diff --git a/boards/sky-drones/smartap-airlink/nuttx-config/nsh/defconfig b/boards/sky-drones/smartap-airlink/nuttx-config/nsh/defconfig deleted file mode 100644 index 3efa0c1..0000000 --- a/boards/sky-drones/smartap-airlink/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,316 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_ARP is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_NSLOOKUP is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/sky-drones/smartap-airlink/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32f7" -CONFIG_ARCH_CHIP_STM32F765II=y -CONFIG_ARCH_CHIP_STM32F7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=22114 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0037 -CONFIG_CDCACM_PRODUCTSTR="PX4 FMU SmartAP AIRLink" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x0483 -CONFIG_CDCACM_VENDORSTR="Sky-Drones" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_GPIO=y -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_ETH0_PHY_LAN8742A=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FSUTILS_IPCFG=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_IOB_NBUFFERS=24 -CONFIG_IOB_THROTTLE=0 -CONFIG_IPCFG_BINARY=y -CONFIG_IPCFG_CHARDEV=y -CONFIG_IPCFG_PATH="/fs/mtd_net" -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=3 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NET=y -CONFIG_NETDB_DNSCLIENT=y -CONFIG_NETDB_DNSCLIENT_ENTRIES=8 -CONFIG_NETDB_DNSSERVER_NOADDR=y -CONFIG_NETDEV_PHY_IOCTL=y -CONFIG_NETINIT_DNS=y -CONFIG_NETINIT_DNSIPADDR=0XC0A800FE -CONFIG_NETINIT_DRIPADDR=0XC0A800FE -CONFIG_NETINIT_THREAD=y -CONFIG_NETINIT_THREAD_PRIORITY=49 -CONFIG_NETUTILS_TELNETD=y -CONFIG_NET_ARP_IPIN=y -CONFIG_NET_ARP_SEND=y -CONFIG_NET_BROADCAST=y -CONFIG_NET_ETH_PKTSIZE=1518 -CONFIG_NET_ICMP=y -CONFIG_NET_ICMP_SOCKET=y -CONFIG_NET_SOLINGER=y -CONFIG_NET_TCP=y -CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_DELAYED_ACK=y -CONFIG_NET_TCP_WRITE_BUFFERS=y -CONFIG_NET_UDP=y -CONFIG_NET_UDP_CHECKSUMS=y -CONFIG_NET_UDP_WRITE_BUFFERS=y -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_TELNET=y -CONFIG_NSH_TELNET_LOGIN=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC2_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32F7_ADC1=y -CONFIG_STM32F7_ADC3=y -CONFIG_STM32F7_BBSRAM=y -CONFIG_STM32F7_BBSRAM_FILES=5 -CONFIG_STM32F7_BKPSRAM=y -CONFIG_STM32F7_DMA1=y -CONFIG_STM32F7_DMA2=y -CONFIG_STM32F7_DMACAPABLE=y -CONFIG_STM32F7_ETHMAC=y -CONFIG_STM32F7_FLOWCONTROL_BROKEN=y -CONFIG_STM32F7_I2C1=y -CONFIG_STM32F7_I2C2=y -CONFIG_STM32F7_I2C3=y -CONFIG_STM32F7_I2C4=y -CONFIG_STM32F7_I2C_DYNTIMEO=y -CONFIG_STM32F7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32F7_OTGFS=y -CONFIG_STM32F7_PHYADDR=0 -CONFIG_STM32F7_PHYSR=31 -CONFIG_STM32F7_PHYSR_100MBPS=0x8 -CONFIG_STM32F7_PHYSR_FULLDUPLEX=0x10 -CONFIG_STM32F7_PHYSR_MODE=0x10 -CONFIG_STM32F7_PHYSR_SPEED=0x8 -CONFIG_STM32F7_PROGMEM=y -CONFIG_STM32F7_PWR=y -CONFIG_STM32F7_RTC=y -CONFIG_STM32F7_RTC_MAGIC_REG=1 -CONFIG_STM32F7_SAVE_CRASHDUMP=y -CONFIG_STM32F7_SDMMC2=y -CONFIG_STM32F7_SDMMC_DMA=y -CONFIG_STM32F7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32F7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32F7_SPI1=y -CONFIG_STM32F7_SPI1_DMA=y -CONFIG_STM32F7_SPI1_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI2=y -CONFIG_STM32F7_SPI2_DMA=y -CONFIG_STM32F7_SPI2_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI3=y -CONFIG_STM32F7_SPI3_DMA=y -CONFIG_STM32F7_SPI3_DMA_BUFFER=1024 -CONFIG_STM32F7_SPI5=y -CONFIG_STM32F7_SPI6=y -CONFIG_STM32F7_SPI_DMATHRESHOLD=8 -CONFIG_STM32F7_TIM10=y -CONFIG_STM32F7_TIM11=y -CONFIG_STM32F7_TIM3=y -CONFIG_STM32F7_TIM9=y -CONFIG_STM32F7_UART4=y -CONFIG_STM32F7_UART5=y -CONFIG_STM32F7_UART7=y -CONFIG_STM32F7_UART8=y -CONFIG_STM32F7_USART1=y -CONFIG_STM32F7_USART2=y -CONFIG_STM32F7_USART3=y -CONFIG_STM32F7_USART6=y -CONFIG_STM32F7_USART_BREAKS=y -CONFIG_STM32F7_USART_INVERT=y -CONFIG_STM32F7_USART_SINGLEWIRE=y -CONFIG_STM32F7_USART_SWAP=y -CONFIG_STM32F7_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_SYSTEM_PING=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART5_IFLOWCONTROL=y -CONFIG_UART5_OFLOWCONTROL=y -CONFIG_UART5_RXBUFSIZE=600 -CONFIG_UART5_RXDMA=y -CONFIG_UART5_TXBUFSIZE=3000 -CONFIG_UART5_TXDMA=y -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_IFLOWCONTROL=y -CONFIG_UART7_OFLOWCONTROL=y -CONFIG_UART7_RXBUFSIZE=600 -CONFIG_UART7_RXDMA=y -CONFIG_UART7_TXBUFSIZE=3000 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_TXBUFSIZE=3000 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_RXBUFSIZE=180 -CONFIG_USART3_SERIAL_CONSOLE=y -CONFIG_USART3_TXBUFSIZE=1500 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/sky-drones/smartap-airlink/nuttx-config/scripts/script.ld b/boards/sky-drones/smartap-airlink/nuttx-config/scripts/script.ld deleted file mode 100644 index 8d5a78d..0000000 --- a/boards/sky-drones/smartap-airlink/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,190 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F765IIT6 has 2048 KiB of main FLASH memory. This FLASH memory - * can be accessed from either the AXIM interface at address 0x0800:0000 or - * from the ITCM interface at address 0x0020:0000. - * - * Additional information, including the option bytes, is available at at - * FLASH at address 0x1ff0:0000 (AXIM) or 0x0010:0000 (ITCM). - * - * In the STM32F765IIT6, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash on ITCM at 0x0020:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x0010:0000 - * - * NuttX does not modify these option byes. On the unmodified NUCLEO-144 - * board, the BOOT0 pin is at ground so by default, the STM32F765IIT6 will - * boot from address 0x0020:0000 in ITCM FLASH. - * - * The STM32F765IIT6 also has 512 KiB of data SRAM (in addition to ITCM SRAM). - * SRAM is split up into three blocks: - * - * 1) 128 KiB of DTCM SRM beginning at address 0x2000:0000 - * 2) 368 KiB of SRAM1 beginning at address 0x2002:0000 - * 3) 16 KiB of SRAM2 beginning at address 0x2007:c000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * Bootloader reserves the first 32K bank (2 Mbytes Flash memory single bank) - * organization (256 bits read width) - */ - -MEMORY -{ - FLASH_ITCM (rx) : ORIGIN = 0x00208000, LENGTH = 2016K - FLASH_AXIM (rx) : ORIGIN = 0x08008000, LENGTH = 2016K - - ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 16K - DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K - SRAM1 (rwx) : ORIGIN = 0x20020000, LENGTH = 368K - SRAM2 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) -EXTERN(board_get_manifest) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > FLASH_AXIM - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > FLASH_AXIM - - /* - * Construction data for parameters. - */ - __param ALIGN(4): { - __param_start = ABSOLUTE(.); - KEEP(*(__param*)) - __param_end = ABSOLUTE(.); - } > FLASH_AXIM - - .ARM.extab : { - *(.ARM.extab*) - } > FLASH_AXIM - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH_AXIM - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > SRAM1 AT > FLASH_AXIM - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > SRAM1 - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } - - .ramfunc : { - _sramfuncs = .; - *(.ramfunc .ramfunc.*) - . = ALIGN(4); - _eramfuncs = .; - } > ITCM_RAM AT > FLASH_AXIM - - _framfuncs = LOADADDR(.ramfunc); -} diff --git a/boards/sky-drones/smartap-airlink/src/CMakeLists.txt b/boards/sky-drones/smartap-airlink/src/CMakeLists.txt deleted file mode 100644 index 7afd265..0000000 --- a/boards/sky-drones/smartap-airlink/src/CMakeLists.txt +++ /dev/null @@ -1,58 +0,0 @@ -############################################################################ -# -# 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. -# -############################################################################ - -add_library(drivers_board - can.c - i2c.cpp - init.cpp - led.c - manifest.c - mtd.cpp - sdio.c - spi.cpp - timer_config.cpp - usb.c -) - -add_dependencies(drivers_board arch_board_hw_info) - -target_link_libraries(drivers_board - PRIVATE - arch_io_pins - arch_spi - arch_board_hw_info - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer -) diff --git a/boards/sky-drones/smartap-airlink/src/board_config.h b/boards/sky-drones/smartap-airlink/src/board_config.h deleted file mode 100644 index ac21a16..0000000 --- a/boards/sky-drones/smartap-airlink/src/board_config.h +++ /dev/null @@ -1,404 +0,0 @@ -/**************************************************************************** - * - * 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * board internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ - -/* PX4IO connection configuration */ - -#define BOARD_USES_PX4IO_VERSION 2 -#define PX4IO_SERIAL_DEVICE "/dev/ttyS5" -#define PX4IO_SERIAL_TX_GPIO GPIO_USART6_TX -#define PX4IO_SERIAL_RX_GPIO GPIO_USART6_RX -#define PX4IO_SERIAL_BASE STM32_USART6_BASE -#define PX4IO_SERIAL_VECTOR STM32_IRQ_USART6 -#define PX4IO_SERIAL_TX_DMAMAP DMAMAP_USART6_TX -#define PX4IO_SERIAL_RX_DMAMAP DMAMAP_USART6_RX -#define PX4IO_SERIAL_RCC_REG STM32_RCC_APB2ENR -#define PX4IO_SERIAL_RCC_EN RCC_APB2ENR_USART6EN -#define PX4IO_SERIAL_CLOCK STM32_PCLK2_FREQUENCY -#define PX4IO_SERIAL_BITRATE 1500000 /* 1.5Mbps -> max rate for IO */ - -/* PX4FMU GPIOs ***********************************************************************************/ - -/* Trace Clock and D0-D3 are available on the trace connector - * - * TRACECLK PE2 - Dedicated - Trace Connector Pin 1 - * TRACED0 PE3 - nLED_RED - Trace Connector Pin 3 - * TRACED1 PE4 - nLED_GREEN - Trace Connector Pin 5 - * TRACED2 PE5 - nLED_BLUE - Trace Connector Pin 7 - * TRACED3 PC12 - nARMED - Trace Connector Pin 8 - - */ -#undef TRACE_PINS - -/* LEDs are driven with push open drain to support Anode to 5V or 3.3V or used as TRACE0-2 */ - -#if !defined(TRACE_PINS) -# define GPIO_nLED_RED /* PE3 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN3) -# define GPIO_nLED_GREEN /* PE4 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN4) -# define GPIO_nLED_BLUE /* PE5 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN5) - -# define BOARD_HAS_CONTROL_STATUS_LEDS 1 -# define BOARD_OVERLOAD_LED LED_RED -# define BOARD_ARMED_STATE_LED LED_BLUE -#endif - -/* I2C busses */ - -/* Devices on the onboard buses. - * - * Note that these are unshifted addresses. - */ -#define PX4_I2C_OBDEV_SE050 0x48 - -#define GPIO_I2C4_DRDY1_BMP388 /* PG5 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTG|GPIO_PIN5) -#define GPIO_PG6 /* PG6 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN6) - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that - * can be used by the Px4 Firmware in the adc driver - */ - -/* ADC defines to be used in sensors.cpp to read from a particular channel */ - -#define BOARD_NUMBER_BRICKS 1 - -#define ADC1_CH(n) (n) -#define ADC1_GPIO(n) GPIO_ADC1_IN##n -#define ADC3_CH(n) (n) -#define ADC3_GPIO(n) GPIO_ADC3_IN##n - -/* Define GPIO pins used as ADC N.B. Channel numbers must match below */ - -#define PX4_ADC_GPIO \ - /* PA0 */ ADC1_GPIO(0), \ - /* PA4 */ ADC1_GPIO(4), \ - /* PB0 */ ADC1_GPIO(8), \ - /* PB1 */ ADC1_GPIO(9), \ - /* PC0 */ ADC1_GPIO(10), \ - /* PC2 */ ADC1_GPIO(12), \ - /* PC3 */ ADC1_GPIO(13), \ - /* PF4 */ ADC3_GPIO(14), \ - /* PF5 */ ADC3_GPIO(15), \ - /* PF10 */ ADC3_GPIO(8) - -/* Define Channel numbers must match above GPIO pin IN(n)*/ - -#define ADC_SCALED_VDD_3V3_SENSORS1_CHANNEL /* PA0 */ ADC1_CH(0) -#define ADC_SCALED_VDD_3V3_SENSORS2_CHANNEL /* PA4 */ ADC1_CH(4) -#define ADC_SCALED_VDD_3V3_SENSORS3_CHANNEL /* PB0 */ ADC1_CH(8) -#define ADC_SCALED_V5_CHANNEL /* PB1 */ ADC1_CH(9) -#define ADC_BATTERY_CURRENT_CHANNEL /* PC0 */ ADC1_CH(10) -#define ADC_SCALED_VDD_3V3_SENSORS4_CHANNEL /* PC2 */ ADC1_CH(12) -#define ADC_BATTERY_VOLTAGE_CHANNEL /* PC3 */ ADC1_CH(13) - -#define ADC_HW_VER_SENSE_CHANNEL /* PF4 */ ADC3_CH(14) -#define ADC_HW_REV_SENSE_CHANNEL /* PF5 */ ADC3_CH(15) - - -#define ADC_CHANNELS \ - ((1 << ADC_SCALED_VDD_3V3_SENSORS1_CHANNEL) | \ - (1 << ADC_SCALED_VDD_3V3_SENSORS2_CHANNEL) | \ - (1 << ADC_SCALED_VDD_3V3_SENSORS3_CHANNEL) | \ - (1 << ADC_SCALED_V5_CHANNEL) | \ - (1 << ADC_BATTERY_CURRENT_CHANNEL)) | \ - (1 << ADC_SCALED_VDD_3V3_SENSORS4_CHANNEL) | \ - (1 << ADC_BATTERY_VOLTAGE_CHANNEL) - - -/* HW has to large of R termination on ADC todo:change when HW value is chosen */ - -#define HW_REV_VER_ADC_BASE STM32_ADC3_BASE - -#define SYSTEM_ADC_BASE STM32_ADC1_BASE - -#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f) - -/* HW Version and Revision drive signals Default to 1 to detect */ - -#define BOARD_HAS_HW_VERSIONING - -#define GPIO_HW_VER_REV_DRIVE /* PG0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN0) -#define GPIO_HW_REV_SENSE /* PF5 */ ADC3_GPIO(15) -#define GPIO_HW_VER_SENSE /* PF4 */ ADC3_GPIO(14) -#define HW_INFO_INIT_PREFIX "SDSA" -#define SDSA0501 HW_VER_REV(0x05,0x01) -/* HEATER - * PWM in future - */ -#define GPIO_HEATER_OUTPUT /* PB10 T2CH3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN10) -#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true)) - -/* PC12 is nARMED - * The GPIO will be set as input while not armed HW will have external HW Pull UP. - * While armed it shall be configured at a GPIO OUT set LOW - */ -#define GPIO_nARMED_INIT /* PC12 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN12) -#define GPIO_nARMED /* PC12 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN12) - -#if !defined(TRACE_PINS) -# define BOARD_INDICATE_EXTERNAL_LOCKOUT_STATE(enabled) px4_arch_configgpio((enabled) ? GPIO_nARMED : GPIO_nARMED_INIT) -# define BOARD_GET_EXTERNAL_LOCKOUT_STATE() px4_arch_gpioread(GPIO_nARMED) -#endif -/* PWM - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 8 - -/* Define Battery 1 g Divider and A per V. */ -#define BOARD_BATTERY_V_DIV (13.653333333f) -#define BOARD_BATTERY_A_PER_V (36.367515152f) - -/* Power supply control and monitoring GPIOs */ -#define GPIO_VDD_BRICK_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN1) -#define GPIO_VDD_USB_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTA|GPIO_PIN9) - -#define GPIO_VDD_3V5_LTE_nEN /* PG4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN4) -#define GPIO_VDD_3V5_LTE_nOC /* PE15 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTE|GPIO_PIN15) -#define GPIO_VDD_5V_HIPOWER_nEN /* PF12 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTF|GPIO_PIN12) -#define GPIO_VDD_5V_HIPOWER_nOC /* PF13 */ (GPIO_INPUT |GPIO_FLOAT|GPIO_PORTF|GPIO_PIN13) -#define GPIO_VDD_3V3_SENSORS4_EN /* PG8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN8) - - -/* Spare GPIO */ - -#define GPIO_PH11 /* PH11 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTH|GPIO_PIN11) - - -/* NFC GPIO */ - -#define GPIO_NFC_GPIO /* PH3 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTH|GPIO_PIN3) - - -/* Define True logic Power Control in arch agnostic form */ -#define VDD_5V_PERIPH_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_PERIPH_nEN, !(on_true)) -#define VDD_3V5_LTE_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V5_LTE_nEN, on_true) -#define VDD_5V_HIPOWER_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_5V_HIPOWER_nEN, on_true) -#define VDD_3V3_SENSORS4_EN(on_true) px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS4_EN, (on_true)) - -/* Tone alarm output */ - -#define TONE_ALARM_TIMER 14 /* Timer 14 */ -#define TONE_ALARM_CHANNEL 1 /* PF9 GPIO_TIM14_CH1OUT_2 */ - -#define GPIO_BUZZER_1 /* PF9 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTF|GPIO_PIN9) - -#define GPIO_TONE_ALARM_IDLE GPIO_BUZZER_1 -#define GPIO_TONE_ALARM GPIO_TIM14_CH1OUT_2 - -/* USB OTG FS - * - * PA9 OTG_FS_VBUS VBUS sensing - */ -#define GPIO_OTGFS_VBUS /* PA9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 8 /* use timer8 for the HRT */ -#define HRT_TIMER_CHANNEL 3 /* use capture/compare channel 3 */ - -#define HRT_PPM_CHANNEL /* T8C1 */ 1 /* use capture/compare channel 1 */ -#define GPIO_PPM_IN /* PI5 T8C1 */ GPIO_TIM8_CH1IN_2 - -/* RC Serial port */ - -#define RC_SERIAL_PORT "/dev/ttyS5" -#define RC_SERIAL_SINGLEWIRE - -/* Input Capture Channels. */ -#define INPUT_CAP1_TIMER 5 -#define INPUT_CAP1_CHANNEL /* T5C4 */ 4 -#define GPIO_INPUT_CAP1 /* PI0 */ GPIO_TIM5_CH4IN - -/* PWM input driver. Use FMU AUX5 pins attached to timer4 channel 2 */ -#define PWMIN_TIMER 4 -#define PWMIN_TIMER_CHANNEL /* T4C2 */ 2 -#define GPIO_PWM_IN /* PD13 */ GPIO_TIM4_CH2IN_2 - -/* Safety Switch is HW version dependent on having an PX4IO - * So we init to a benign state with the _INIT definition - * and provide the the non _INIT one for the driver to make a run time - * decision to use it. - */ -#define GPIO_nSAFETY_SWITCH_LED_OUT_INIT /* PD10 */ (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTD|GPIO_PIN10) -#define GPIO_nSAFETY_SWITCH_LED_OUT /* PD10 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTD|GPIO_PIN10) - -/* Enable the FMU to control it if there is no px4io fixme:This should be BOARD_SAFETY_LED(__ontrue) */ -#define GPIO_LED_SAFETY GPIO_nSAFETY_SWITCH_LED_OUT -#define GPIO_SAFETY_SWITCH_IN /* PH4 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTH|GPIO_PIN4) -/* Enable the FMU to use the switch it if there is no px4io fixme:This should be BOARD_SAFTY_BUTTON() */ -#define GPIO_BTN_SAFETY GPIO_SAFETY_SWITCH_IN /* Enable the FMU to control it if there is no px4io */ - -/* Power switch controls ******************************************************/ - -/* - * FMUv5X has a separate RC_IN - * - * GPIO PPM_IN on PI5 T8CH1 - * SPEKTRUM_RX (it's TX or RX in Bind) on UART6 PC7 - * Inversion is possible in the UART and can drive GPIO PPM_IN as an output - */ - -#define GPIO_PPM_IN_AS_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTI|GPIO_PIN5) -#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_PPM_IN_AS_OUT) -#define SPEKTRUM_RX_AS_UART() /* Can be left as uart */ -#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true)) - -#define SDIO_SLOTNO 0 /* Only one slot */ -#define SDIO_MINOR 0 - -/* SD card bringup does not work if performed on the IDLE thread because it - * will cause waiting. Use either: - * - * CONFIG_BOARDCTL=y, OR - * CONFIG_BOARD_INITIALIZE=y && CONFIG_BOARD_INITTHREAD=y - */ - -#if defined(CONFIG_BOARD_INITIALIZE) && !defined(CONFIG_BOARDCTL) && \ - !defined(CONFIG_BOARD_INITTHREAD) -# warning SDIO initialization cannot be perfomed on the IDLE thread -#endif - -/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_USB_VALID BOARD_ADC_USB_CONNECTED -#define BOARD_ADC_SERVO_VALID (1) -#define BOARD_ADC_BRICK_VALID (1) //(px4_arch_gpioread(GPIO_VDD_BRICK_VALID)) - -// #define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_VDD_3V5_LTE_nOC)) -#define BOARD_ADC_HIPOWER_5V_OC (!px4_arch_gpioread(GPIO_VDD_5V_HIPOWER_nOC)) - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ - -#define BOARD_HAS_ON_RESET 1 - -#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_VDD_3V5_LTE_nEN, \ - GPIO_VDD_3V5_LTE_nOC, \ - GPIO_VDD_5V_HIPOWER_nEN, \ - GPIO_VDD_5V_HIPOWER_nOC, \ - GPIO_VDD_3V3_SENSORS4_EN, \ - GPIO_PH11, \ - GPIO_NFC_GPIO, \ - GPIO_TONE_ALARM_IDLE, \ - GPIO_nSAFETY_SWITCH_LED_OUT_INIT, \ - GPIO_SAFETY_SWITCH_IN, \ - GPIO_PG6, \ - GPIO_nARMED_INIT \ - } - -#define BOARD_ENABLE_CONSOLE_BUFFER - -#define BOARD_NUM_IO_TIMERS 5 - - -#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 - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/sky-drones/smartap-airlink/src/can.c b/boards/sky-drones/smartap-airlink/src/can.c deleted file mode 100644 index 3074b01..0000000 --- a/boards/sky-drones/smartap-airlink/src/can.c +++ /dev/null @@ -1,123 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file px4fmu_can.c - * - * Board-specific CAN functions. - */ - -#ifdef CONFIG_CAN - -#include -#include - -#include -#include - -#include "chip.h" -#include "arm_internal.h" - -#include "chip.h" -#include "stm32_can.h" -#include "board_config.h" - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(CONFIG_STM32F7_CAN1) && defined(CONFIG_STM32F7_CAN2) -# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." -# undef CONFIG_STM32F7_CAN2 -#endif - -#ifdef CONFIG_STM32F7_CAN1 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); - -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} -#endif /* CONFIG_CAN */ diff --git a/boards/sky-drones/smartap-airlink/src/i2c.cpp b/boards/sky-drones/smartap-airlink/src/i2c.cpp deleted file mode 100644 index eb200ca..0000000 --- a/boards/sky-drones/smartap-airlink/src/i2c.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** - * - * 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), - initI2CBusExternal(2), - initI2CBusExternal(3), - initI2CBusInternal(4), -}; diff --git a/boards/sky-drones/smartap-airlink/src/init.cpp b/boards/sky-drones/smartap-airlink/src/init.cpp deleted file mode 100644 index f3ab4a9..0000000 --- a/boards/sky-drones/smartap-airlink/src/init.cpp +++ /dev/null @@ -1,269 +0,0 @@ -/**************************************************************************** - * - * 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * PX4FMU-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include "board_config.h" - -#include -#include -#include -#include -#include - -#include -extern "C" { -#include -} -#include -#include -#include -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* Configuration ************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - /* set the peripheral rails off */ - - VDD_3V5_LTE_EN(false); - VDD_5V_HIPOWER_EN(false); - board_control_spi_sensors_power(false, 0xffff); - VDD_3V3_SENSORS4_EN(false); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ - board_control_spi_sensors_power(true, 0xffff); - VDD_3V5_LTE_EN(true); - VDD_5V_HIPOWER_EN(true); - VDD_3V3_SENSORS4_EN(true); - -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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(); -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Power on Interfaces */ - VDD_3V5_LTE_EN(true); - VDD_5V_HIPOWER_EN(true); - VDD_3V3_SENSORS4_EN(true); - - /* Need hrt running before using the ADC */ - - px4_platform_init(); - - - if (OK == board_determine_hw_info()) { - syslog(LOG_INFO, "[boot] Rev 0x%1x : Ver 0x%1x %s\n", board_get_hw_revision(), board_get_hw_version(), - board_get_hw_type_name()); - - } else { - syslog(LOG_ERR, "[boot] Failed to read HW revision and version\n"); - } - - stm32_spiinitialize(); - - board_spi_reset(10, 0xffff); - - /* configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - led_on(LED_GREEN); // Indicate Power. - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - - // Power down the heater - px4_arch_configgpio(GPIO_HEATER_OUTPUT); - px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, 1); - -#ifdef CONFIG_MMCSD - int ret = stm32_sdio_initialize(); - - if (ret != OK) { - led_on(LED_RED); - return ret; - } - -#endif /* CONFIG_MMCSD */ - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/sky-drones/smartap-airlink/src/led.c b/boards/sky-drones/smartap-airlink/src/led.c deleted file mode 100644 index fe722c6..0000000 --- a/boards/sky-drones/smartap-airlink/src/led.c +++ /dev/null @@ -1,232 +0,0 @@ -/**************************************************************************** - * - * 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. - * - ****************************************************************************/ - -/** - * @file px4fmu2_led.c - * - * PX4FMU LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -#ifdef CONFIG_ARCH_LEDS -static bool nuttx_owns_leds = true; -// B R S G -// 0 1 2 3 -static const uint8_t xlatpx4[] = {1, 2, 4, 0}; -# define xlat(p) xlatpx4[(p)] -static uint32_t g_ledmap[] = { - GPIO_nLED_GREEN, // Indexed by BOARD_LED_GREEN - GPIO_nLED_BLUE, // Indexed by BOARD_LED_BLUE - GPIO_nLED_RED, // Indexed by BOARD_LED_RED - GPIO_nSAFETY_SWITCH_LED_OUT, // Indexed by LED_SAFETY by xlatpx4 -}; - -#else - -# define xlat(p) (p) -static uint32_t g_ledmap[] = { - GPIO_nLED_BLUE, // Indexed by LED_BLUE - GPIO_nLED_RED, // Indexed by LED_RED, LED_AMBER - GPIO_nSAFETY_SWITCH_LED_OUT_INIT, // Indexed by LED_SAFETY (defaulted to an input) - GPIO_nLED_GREEN, // Indexed by LED_GREEN -}; - -#endif - -__EXPORT void led_init(void) -{ - /* Configure LED GPIOs for output */ - if (!PX4_MFT_HW_SUPPORTED(PX4_MFT_PX4IO)) { - g_ledmap[2] = GPIO_nSAFETY_SWITCH_LED_OUT; - } - - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - stm32_configgpio(g_ledmap[l]); - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - - stm32_gpiowrite(g_ledmap[led], !state); -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - return !stm32_gpioread(g_ledmap[led]); -} - -__EXPORT void led_on(int led) -{ - phy_set_led(xlat(led), true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(xlat(led), false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(xlat(led), !phy_get_led(xlat(led))); -} - -#ifdef CONFIG_ARCH_LEDS -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_autoled_initialize - ****************************************************************************/ - -void board_autoled_initialize(void) -{ - led_init(); -} - -/**************************************************************************** - * Name: board_autoled_on - ****************************************************************************/ - -void board_autoled_on(int led) -{ - if (!nuttx_owns_leds) { - return; - } - - switch (led) { - default: - break; - - case LED_HEAPALLOCATE: - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_IRQSENABLED: - phy_set_led(BOARD_LED_BLUE, false); - phy_set_led(BOARD_LED_GREEN, true); - break; - - case LED_STACKCREATED: - phy_set_led(BOARD_LED_GREEN, true); - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_INIRQ: - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_SIGNAL: - phy_set_led(BOARD_LED_GREEN, true); - break; - - case LED_ASSERTION: - phy_set_led(BOARD_LED_RED, true); - phy_set_led(BOARD_LED_BLUE, true); - break; - - case LED_PANIC: - phy_set_led(BOARD_LED_RED, true); - break; - - case LED_IDLE : /* IDLE */ - phy_set_led(BOARD_LED_RED, true); - break; - } -} - -/**************************************************************************** - * Name: board_autoled_off - ****************************************************************************/ - -void board_autoled_off(int led) -{ - if (!nuttx_owns_leds) { - return; - } - - switch (led) { - default: - break; - - case LED_SIGNAL: - phy_set_led(BOARD_LED_GREEN, false); - break; - - case LED_INIRQ: - phy_set_led(BOARD_LED_BLUE, false); - break; - - case LED_ASSERTION: - phy_set_led(BOARD_LED_RED, false); - phy_set_led(BOARD_LED_BLUE, false); - break; - - case LED_PANIC: - phy_set_led(BOARD_LED_RED, false); - break; - - case LED_IDLE : /* IDLE */ - phy_set_led(BOARD_LED_RED, false); - break; - } -} - -#endif /* CONFIG_ARCH_LEDS */ diff --git a/boards/sky-drones/smartap-airlink/src/manifest.c b/boards/sky-drones/smartap-airlink/src/manifest.c deleted file mode 100644 index ce45fef..0000000 --- a/boards/sky-drones/smartap-airlink/src/manifest.c +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************** - * - * 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. - * - ****************************************************************************/ - -/** - * @file manifest.c - * - * This module supplies the interface to the manifest of hardware that is - * optional and dependent on the HW REV and HW VER IDs - * - * The manifest allows the system to know whether a hardware option - * say for example the PX4IO is an no-pop option vs it is broken. - * - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include - -#include "systemlib/px4_macros.h" - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -typedef struct { - uint32_t hw_ver_rev; /* the version and revision */ - const px4_hw_mft_item_t *mft; /* The first entry */ - uint32_t entries; /* the lenght of the list */ -} px4_hw_mft_list_entry_t; - -typedef px4_hw_mft_list_entry_t *px4_hw_mft_list_entry; -#define px4_hw_mft_list_uninitialized (px4_hw_mft_list_entry) -1 - -static const px4_hw_mft_item_t device_unsupported = {0, 0, 0}; - -// List of components on a specific board configuration -// The index of those components is given by the enum (px4_hw_mft_item_id_t) -// declared in board_common.h -static const px4_hw_mft_item_t hw_mft_list_v0501[] = { - { - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, - { - .present = 1, - .mandatory = 1, - .connection = px4_hw_con_onboard, - }, -}; - - -static px4_hw_mft_list_entry_t mft_lists[] = { - {SDSA0501, hw_mft_list_v0501, arraySize(hw_mft_list_v0501)}, -}; - - -/************************************************************************************ - * Name: board_query_manifest - * - * Description: - * Optional returns manifest item. - * - * Input Parameters: - * manifest_id - the ID for the manifest item to retrieve - * - * Returned Value: - * 0 - item is not in manifest => assume legacy operations - * pointer to a manifest item - * - ************************************************************************************/ - -__EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) -{ - static px4_hw_mft_list_entry boards_manifest = px4_hw_mft_list_uninitialized; - - if (boards_manifest == px4_hw_mft_list_uninitialized) { - uint32_t ver_rev = board_get_hw_version() << 16; - ver_rev |= board_get_hw_revision(); - - for (unsigned i = 0; i < arraySize(mft_lists); i++) { - if (mft_lists[i].hw_ver_rev == ver_rev) { - boards_manifest = &mft_lists[i]; - break; - } - } - - if (boards_manifest == px4_hw_mft_list_uninitialized) { - syslog(LOG_ERR, "[boot] Board %08" PRIx32 " is not supported!\n", ver_rev); - } - } - - px4_hw_mft_item rv = &device_unsupported; - - if (boards_manifest != px4_hw_mft_list_uninitialized && - id < boards_manifest->entries) { - rv = &boards_manifest->mft[id]; - } - - return rv; -} diff --git a/boards/sky-drones/smartap-airlink/src/mtd.cpp b/boards/sky-drones/smartap-airlink/src/mtd.cpp deleted file mode 100644 index 8b74a46..0000000 --- a/boards/sky-drones/smartap-airlink/src/mtd.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** - * - * 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 -#include -// KiB BS nB -static const px4_mft_device_t spi5 = { // FM25V02A on FMUM 32K 512 X 64 - .bus_type = px4_mft_device_t::SPI, - .devid = SPIDEV_FLASH(0) -}; -static const px4_mft_device_t i2c3 = { // 24LC64T on Base 8K 32 X 256 - .bus_type = px4_mft_device_t::I2C, - .devid = PX4_MK_I2C_DEVID(3, 0x51) -}; - -static const px4_mtd_entry_t fmum_fram = { - .device = &spi5, - .npart = 2, - .partd = { - { - .type = MTD_PARAMETERS, - .path = "/fs/mtd_params", - .nblocks = 32 - }, - { - .type = MTD_WAYPOINTS, - .path = "/fs/mtd_waypoints", - .nblocks = 32 - - } - }, -}; - -static const px4_mtd_entry_t base_eeprom = { - .device = &i2c3, - .npart = 2, - .partd = { - { - .type = MTD_MFT_VER, - .path = "/fs/mtd_mft_ver", - .nblocks = 248 - }, - { - .type = MTD_NET, - .path = "/fs/mtd_net", - .nblocks = 8 // 256 = 32 * 8 - - } - }, -}; - - -static const px4_mtd_manifest_t board_mtd_config = { - .nconfigs = 2, - .entries = { - &fmum_fram, - &base_eeprom, - } -}; - -static const px4_mft_entry_s mtd_mft = { - .type = MTD, - .pmft = (void *) &board_mtd_config, -}; - -static const px4_mft_s mft = { - .nmft = 1, - .mfts = { - &mtd_mft - } -}; - -const px4_mft_s *board_get_manifest(void) -{ - return &mft; -} diff --git a/boards/sky-drones/smartap-airlink/src/sdio.c b/boards/sky-drones/smartap-airlink/src/sdio.c deleted file mode 100644 index 869d757..0000000 --- a/boards/sky-drones/smartap-airlink/src/sdio.c +++ /dev/null @@ -1,177 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include "chip.h" -#include "board_config.h" -#include "stm32_gpio.h" -#include "stm32_sdmmc.h" - -#ifdef CONFIG_MMCSD - - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Card detections requires card support and a card detection GPIO */ - -#define HAVE_NCD 1 -#if !defined(GPIO_SDMMC1_NCD) -# undef HAVE_NCD -#endif - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -static FAR struct sdio_dev_s *sdio_dev; -#ifdef HAVE_NCD -static bool g_sd_inserted = 0xff; /* Impossible value */ -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_ncd_interrupt - * - * Description: - * Card detect interrupt handler. - * - ****************************************************************************/ - -#ifdef HAVE_NCD -static int stm32_ncd_interrupt(int irq, FAR void *context) -{ - bool present; - - present = !stm32_gpioread(GPIO_SDMMC1_NCD); - - if (sdio_dev && present != g_sd_inserted) { - sdio_mediachange(sdio_dev, present); - g_sd_inserted = present; - } - - return OK; -} -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_sdio_initialize - * - * Description: - * Initialize SDIO-based MMC/SD card support - * - ****************************************************************************/ - -int stm32_sdio_initialize(void) -{ - int ret; - -#ifdef HAVE_NCD - /* Card detect */ - - bool cd_status; - - /* Configure the card detect GPIO */ - - stm32_configgpio(GPIO_SDMMC1_NCD); - - /* Register an interrupt handler for the card detect pin */ - - stm32_gpiosetevent(GPIO_SDMMC1_NCD, true, true, true, stm32_ncd_interrupt); -#endif - - /* Mount the SDIO-based MMC/SD block driver */ - /* First, get an instance of the SDIO interface */ - - finfo("Initializing SDIO slot %d\n", SDIO_SLOTNO); - - sdio_dev = sdio_initialize(SDIO_SLOTNO); - - if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", SDIO_SLOTNO); - return -ENODEV; - } - - /* Now bind the SDIO interface to the MMC/SD driver */ - - finfo("Bind SDIO to the MMC/SD driver, minor=%d\n", SDIO_MINOR); - - ret = mmcsd_slotinitialize(SDIO_MINOR, sdio_dev); - - if (ret != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); - return ret; - } - - finfo("Successfully bound SDIO to the MMC/SD driver\n"); - -#ifdef HAVE_NCD - /* Use SD card detect pin to check if a card is g_sd_inserted */ - - cd_status = !stm32_gpioread(GPIO_SDMMC1_NCD); - finfo("Card detect : %d\n", cd_status); - - sdio_mediachange(sdio_dev, cd_status); -#else - /* Assume that the SD card is inserted. What choice do we have? */ - - sdio_mediachange(sdio_dev, true); -#endif - - return OK; -} - -#endif /* CONFIG_MMCSD */ diff --git a/boards/sky-drones/smartap-airlink/src/spi.cpp b/boards/sky-drones/smartap-airlink/src/spi.cpp deleted file mode 100644 index a0e3e32..0000000 --- a/boards/sky-drones/smartap-airlink/src/spi.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** - * - * 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}), - }, {GPIO::PortI, GPIO::Pin11}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_IMU_DEVTYPE_MPU9250, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortH, GPIO::Pin12}), - }, {GPIO::PortD, GPIO::Pin15}), - initSPIBus(SPI::Bus::SPI3, { - initSPIDevice(DRV_IMU_DEVTYPE_MPU9250, SPI::CS{GPIO::PortI, GPIO::Pin8}, SPI::DRDY{GPIO::PortI, GPIO::Pin6}), - }, {GPIO::PortE, GPIO::Pin7}), - // initSPIBus(SPI::Bus::SPI4, { - // // initSPIDevice(DRV_MAG_DEVTYPE_BMM150, SPI::CS{GPIO::PortH, GPIO::Pin15}, SPI::DRDY{GPIO::PortF, GPIO::Pin3}), - // }, {GPIO::PortG, GPIO::Pin8}), - initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7}) - }), - initSPIBusExternal(SPI::Bus::SPI6, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}, SPI::DRDY{GPIO::PortD, GPIO::Pin11}), - initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/sky-drones/smartap-airlink/src/timer_config.cpp b/boards/sky-drones/smartap-airlink/src/timer_config.cpp deleted file mode 100644 index 52cce68..0000000 --- a/boards/sky-drones/smartap-airlink/src/timer_config.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** - * - * 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 - -/* Timer allocation - * - * TIM1_CH4 T FMU_CH1 - * TIM1_CH3 T FMU_CH2 - * TIM1_CH2 T FMU_CH3 - * TIM1_CH1 T FMU_CH4 - * - * TIM4_CH2 T FMU_CH5 - * TIM4_CH3 T FMU_CH6 - * - * TIM12_CH1 T FMU_CH7 - * TIM12_CH2 T FMU_CH8 - * - * TIM5_CH4 T FMU_CAP1 < Capture - * TIM5_CH3 T SPI2_DRDY2_ISM330_INT2 < Capture or GPIO INT - * TIM5_CH1 T SPIX_SYNC > Pulse or GPIO strobe - * TIM2_CH3 T HEATER > PWM OUT or GPIO - * - * TIM14_CH1 T BUZZER_1 - Driven by other driver - * TIM8_CH1_IN T FMU_PPM_INPUT - Sampled byt HRT by other driver - */ - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1, DMA{DMA::Index2, DMA::Stream5, DMA::Channel6}), - initIOTimer(Timer::Timer4, DMA{DMA::Index1, DMA::Stream6, DMA::Channel2}), - initIOTimer(Timer::Timer12), - initIOTimer(Timer::Timer5), - initIOTimer(Timer::Timer2), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortA, GPIO::Pin10}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortA, GPIO::Pin8}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), - initIOTimerChannel(io_timers, {Timer::Timer12, Timer::Channel1}, {GPIO::PortH, GPIO::Pin6}), - initIOTimerChannel(io_timers, {Timer::Timer12, Timer::Channel2}, {GPIO::PortH, GPIO::Pin9}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/sky-drones/smartap-airlink/src/usb.c b/boards/sky-drones/smartap-airlink/src/usb.c deleted file mode 100644 index 8377bb4..0000000 --- a/boards/sky-drones/smartap-airlink/src/usb.c +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** - * - * 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#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 - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/spracing/h7extreme/default.px4board b/boards/spracing/h7extreme/default.px4board deleted file mode 100644 index c6c2872..0000000 --- a/boards/spracing/h7extreme/default.px4board +++ /dev/null @@ -1,63 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m7" -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_COMMON_BAROMETERS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU6000=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_SENSORS=y -# CONFIG_SENSORS_VEHICLE_AIRSPEED is not set -CONFIG_MODULES_UXRCE_DDS_CLIENT=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_FAKE_GPS=y diff --git a/boards/spracing/h7extreme/firmware.prototype b/boards/spracing/h7extreme/firmware.prototype deleted file mode 100644 index ec63f2f..0000000 --- a/boards/spracing/h7extreme/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 139, - "magic": "PX4FWv1", - "description": "Firmware for the SP Racing H7 Extreme board", - "image": "", - "build_time": 0, - "summary": "SPRacing_H7Extreme", - "version": "0.1", - "image_size": 0, - "image_maxsize": 1966080, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/spracing/h7extreme/init/rc.board_defaults b/boards/spracing/h7extreme/init/rc.board_defaults deleted file mode 100644 index 34177ec..0000000 --- a/boards/spracing/h7extreme/init/rc.board_defaults +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 10.9 -param set-default BAT1_A_PER_V 17 - -# system_power unavailable -param set-default CBRK_SUPPLY_CHK 894281 - -# Select the Generic 250 Racer by default -param set-default SYS_AUTOSTART 4050 - -# use the Q attitude estimator, it works w/o mag or GPS. -param set-default SYS_MC_EST_GROUP 3 -param set-default ATT_ACC_COMP 0 -param set-default ATT_W_ACC 0.4000 -param set-default ATT_W_GYRO_BIAS 0.0000 - -param set-default SYS_HAS_MAG 0 diff --git a/boards/spracing/h7extreme/init/rc.board_extras b/boards/spracing/h7extreme/init/rc.board_extras deleted file mode 100644 index 25e6c26..0000000 --- a/boards/spracing/h7extreme/init/rc.board_extras +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# -# OmnibusF4SD specific board extras init -#------------------------------------------------------------------------------ - -if ! param compare OSD_ATXXXX_CFG 0 -then - atxxxx start -s -fi - - diff --git a/boards/spracing/h7extreme/init/rc.board_sensors b/boards/spracing/h7extreme/init/rc.board_sensors deleted file mode 100644 index 15ceb4b..0000000 --- a/boards/spracing/h7extreme/init/rc.board_sensors +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# -# board specific sensors init -#------------------------------------------------------------------------------ - -board_adc start - -# Internal SPI bus ICM-20602 or ICM-42688-P - -# SPI2 -if ! icm20602 -s -b 2 -R 5 start -then - icm42688p -s -b 2 -R 5 start -fi - -# SPI3 -if ! icm20602 -s -b 3 -R 4 start -then - icm42688p -s -b 3 -R 4 start -fi - -# Internal I2C bus -bmp388 -I start diff --git a/boards/spracing/h7extreme/nuttx-config/Kconfig b/boards/spracing/h7extreme/nuttx-config/Kconfig deleted file mode 100644 index ab39ed0..0000000 --- a/boards/spracing/h7extreme/nuttx-config/Kconfig +++ /dev/null @@ -1,24 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see misc/tools/kconfig-language.txt. -# -config BOARD_HAS_PROBES - bool "Board provides GPIO or other Hardware for signaling to timing analyze." - default y - ---help--- - This board provides GPIO FMU-CH1-5, CAP1-6 as PROBE_1-11 to provide timing signals from selected drivers. - -config BOARD_USE_PROBES - bool "Enable the use the board provided FMU-CH1-5, CAP1-6 as PROBE_1-11" - default n - depends on BOARD_HAS_PROBES - - ---help--- - Select to use GPIO FMU-CH1-5, CAP1-6 to provide timing signals from selected drivers. - - -config STM32_RAMFUNCS - bool "Use stm32_board_clockconfig as ram function." - default y - select ARCH_HAVE_RAMFUNCS - diff --git a/boards/spracing/h7extreme/nuttx-config/include/board.h b/boards/spracing/h7extreme/nuttx-config/include/board.h deleted file mode 100644 index 91edb4e..0000000 --- a/boards/spracing/h7extreme/nuttx-config/include/board.h +++ /dev/null @@ -1,506 +0,0 @@ -/************************************************************************************ - * nuttx-configs/spracing/h7extreme/include/board.h - * - * Copyright (C) 2016-2020 Gregory Nutt. All rights reserved. - * Authors: Igor Misic - * - * 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 NuttX 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. - * - ************************************************************************************/ -#ifndef __NUTTX_CONFIG_SPRACING_H7EXTREME_INCLUDE_BOARD_H -#define __NUTTX_CONFIG_SPRACING_H7EXTREME_INCLUDE_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ -#include "board_dma_map.h" - -#include - -#ifndef __ASSEMBLY__ -# include -#endif - -#include "stm32_rcc.h" -#include "stm32_sdmmc.h" - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The sp racing h7 extreme board provides the following clock sources: - * - * X1: 8 MHz crystal for HSE - * - * So we have these clock source available within the STM32 - * - * HSI: 64 MHz RC factory-trimmed - * HSE: 8 MHz crystal for HSE - */ - -#define STM32_BOARD_XTAL 8000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -#define STM32_LSE_FREQUENCY 32768 - -/* Main PLL Configuration. - * - * PLL source is HSE = 8,000,000 - * - * PLL_VCOx = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * Subject to: - * - * 1 <= PLLM <= 63 - * 4 <= PLLN <= 512 - * 150 MHz <= PLL_VCOL <= 420MHz - * 192 MHz <= PLL_VCOH <= 836MHz - * - * SYSCLK = PLL_VCO / PLLP - * CPUCLK = SYSCLK / D1CPRE - * Subject to - * - * PLLP1 = {2, 4, 6, 8, ..., 128} - * PLLP2,3 = {2, 3, 4, ..., 128} - * CPUCLK <= 480 MHz - */ - -#define STM32_BOARD_USEHSE - -#define STM32_PLLCFG_PLLSRC RCC_PLLCKSELR_PLLSRC_HSE - -/* PLL1, wide 4 - 8 MHz input, enable DIVP, DIVQ, DIVR - * - * PLL1_VCO = (8,000,000 / 2) * 200 = 800 MHz - * - * PLL1P = PLL1_VCO/2 = 800 MHz / 2 = 400 MHz - * PLL1Q = PLL1_VCO/4 = 800 MHz / 4 = 200 MHz - * PLL1R = PLL1_VCO/2 = 800 MHz / 2 = 400 MHz - locked for H750 - */ - -#define STM32_PLLCFG_PLL1CFG (RCC_PLLCFGR_PLL1VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL1RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVP1EN | \ - RCC_PLLCFGR_DIVQ1EN | \ - RCC_PLLCFGR_DIVR1EN) -#define STM32_PLLCFG_PLL1M RCC_PLLCKSELR_DIVM1(2) -#define STM32_PLLCFG_PLL1N RCC_PLL1DIVR_N1(200) -#define STM32_PLLCFG_PLL1P RCC_PLL1DIVR_P1(2) -#define STM32_PLLCFG_PLL1Q RCC_PLL1DIVR_Q1(4) -#define STM32_PLLCFG_PLL1R RCC_PLL1DIVR_R1(2) - -#define STM32_VCO1_FREQUENCY ((STM32_HSE_FREQUENCY / 2) * 200) -#define STM32_PLL1P_FREQUENCY (STM32_VCO1_FREQUENCY / 2) -#define STM32_PLL1Q_FREQUENCY (STM32_VCO1_FREQUENCY / 4) -#define STM32_PLL1R_FREQUENCY (STM32_VCO1_FREQUENCY / 2) - -/* PLL2 */ - -#define STM32_PLLCFG_PLL2CFG (RCC_PLLCFGR_PLL2VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL2RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVP2EN | \ - RCC_PLLCFGR_DIVQ2EN | \ - RCC_PLLCFGR_DIVR2EN) -#define STM32_PLLCFG_PLL2M RCC_PLLCKSELR_DIVM2(4) -#define STM32_PLLCFG_PLL2N RCC_PLL2DIVR_N2(260) -#define STM32_PLLCFG_PLL2P RCC_PLL2DIVR_P2(2) -#define STM32_PLLCFG_PLL2Q RCC_PLL2DIVR_Q2(10) -#define STM32_PLLCFG_PLL2R RCC_PLL2DIVR_R2(2) - -#define STM32_VCO2_FREQUENCY ((STM32_HSE_FREQUENCY / 4) * 260) -#define STM32_PLL2P_FREQUENCY (STM32_VCO2_FREQUENCY / 2) -#define STM32_PLL2Q_FREQUENCY (STM32_VCO2_FREQUENCY / 10) -#define STM32_PLL2R_FREQUENCY (STM32_VCO2_FREQUENCY / 2) - -/* PLL3 */ - -#define STM32_PLLCFG_PLL3CFG (RCC_PLLCFGR_PLL3VCOSEL_WIDE | \ - RCC_PLLCFGR_PLL3RGE_4_8_MHZ | \ - RCC_PLLCFGR_DIVP3EN | \ - RCC_PLLCFGR_DIVQ3EN | \ - RCC_PLLCFGR_DIVR3EN) -#define STM32_PLLCFG_PLL3M RCC_PLLCKSELR_DIVM3(2) -#define STM32_PLLCFG_PLL3N RCC_PLL3DIVR_N3(50) -#define STM32_PLLCFG_PLL3P RCC_PLL3DIVR_P3(2) -#define STM32_PLLCFG_PLL3Q RCC_PLL3DIVR_Q3(2) -#define STM32_PLLCFG_PLL3R RCC_PLL3DIVR_R3(2) - -#define STM32_VCO3_FREQUENCY ((STM32_HSE_FREQUENCY / 2) * 50) -#define STM32_PLL3P_FREQUENCY (STM32_VCO3_FREQUENCY / 2) -#define STM32_PLL3Q_FREQUENCY (STM32_VCO3_FREQUENCY / 2) -#define STM32_PLL3R_FREQUENCY (STM32_VCO3_FREQUENCY / 2) - -/* SYSCLK = PLL1P = 400MHz - * CPUCLK = SYSCLK / 1 = 400 MHz - */ - -#define STM32_RCC_D1CFGR_D1CPRE (RCC_D1CFGR_D1CPRE_SYSCLK) -#define STM32_SYSCLK_FREQUENCY (STM32_PLL1P_FREQUENCY) -#define STM32_CPUCLK_FREQUENCY (STM32_SYSCLK_FREQUENCY / 1) - -/* Configure Clock Assignments */ - -/* AHB clock (HCLK) is SYSCLK/2 (200 MHz max) - * HCLK1 = HCLK2 = HCLK3 = HCLK4 = 200 - */ - -#define STM32_RCC_D1CFGR_HPRE RCC_D1CFGR_HPRE_SYSCLKd2 /* HCLK = SYSCLK / 2 */ -#define STM32_ACLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* ACLK in D1, HCLK3 in D1 */ -#define STM32_HCLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* HCLK in D2, HCLK4 in D3 */ -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/2 (100 MHz) */ - -#define STM32_RCC_D2CFGR_D2PPRE1 RCC_D2CFGR_D2PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB2 clock (PCLK2) is HCLK/2 (50 MHz) */ - -#define STM32_RCC_D2CFGR_D2PPRE2 RCC_D2CFGR_D2PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB3 clock (PCLK3) is HCLK/2 (50 MHz) */ - -#define STM32_RCC_D1CFGR_D1PPRE RCC_D1CFGR_D1PPRE_HCLKd2 /* PCLK3 = HCLK / 2 */ -#define STM32_PCLK3_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* APB4 clock (PCLK4) is HCLK/4 (50 MHz) */ - -#define STM32_RCC_D3CFGR_D3PPRE RCC_D3CFGR_D3PPRE_HCLKd2 /* PCLK4 = HCLK / 2 */ -#define STM32_PCLK4_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timer clock frequencies */ - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM15_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM16_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM17_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Kernel Clock Configuration - * - * Note: look at Table 54 in ST Manual - */ - -/* I2C123 clock source */ - -#define STM32_RCC_D2CCIP2R_I2C123SRC RCC_D2CCIP2R_I2C123SEL_HSI - -/* SPI123 clock source */ - -#define STM32_RCC_D2CCIP1R_SPI123SRC RCC_D2CCIP1R_SPI123SEL_PLL1 - -/* SPI45 clock source */ - -#define STM32_RCC_D2CCIP1R_SPI45SRC RCC_D2CCIP1R_SPI45SEL_APB - -/* USB 1 and 2 clock source */ - -#define STM32_RCC_D2CCIP2R_USBSRC RCC_D2CCIP2R_USBSEL_HSI48 - -/* ADC 1 2 3 clock source */ - -#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2 - -/* QSPI clock source */ -#define STM32_RCC_D1CCIPR_QSPISEL RCC_D1CCIPR_QSPISEL_PLL2 - -/* FLASH wait states - * - * ------------ ---------- ----------- - * Vcore MAX ACLK WAIT STATES - * ------------ ---------- ----------- - * 1.15-1.26 V 70 MHz 0 - * (VOS1 level) 140 MHz 1 - * 210 MHz 2 - * 1.05-1.15 V 55 MHz 0 - * (VOS2 level) 110 MHz 1 - * 165 MHz 2 - * 220 MHz 3 - * 0.95-1.05 V 45 MHz 0 - * (VOS3 level) 90 MHz 1 - * 135 MHz 2 - * 180 MHz 3 - * 225 MHz 4 - * ------------ ---------- ----------- - */ - -#define BOARD_FLASH_WAITSTATES 2 - -/* SDMMC definitions ********************************************************/ - -/* Init 400kHz, freq = PLL1Q/(2*div) div = PLL1Q/(2*freq) */ - -#define STM32_SDMMC_INIT_CLKDIV (300 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) - -/* 25 MHz Max for now, 25 mHZ = PLL1Q/(2*div), div = PLL1Q/(2*freq) - * div = 4.8 = 240 / 50, So round up to 5 for default speed 24 MB/s - */ - -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_MMCXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_MMCXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif -#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA) -# define STM32_SDMMC_SDXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#else -# define STM32_SDMMC_SDXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT) -#endif - -#define STM32_SDMMC_CLKCR_EDGE STM32_SDMMC_CLKCR_NEGEDGE - -/* LED definitions ******************************************************************/ -/* The sp racing h7 extreme board has three, LED_GREEN a Green LED, LED_BLUE - * Red LED can be controlled by software. - * - * If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any way. - * The following definitions are used to access individual LEDs. - */ - -/* LED index values for use with board_userled() */ - -#define BOARD_LED1 0 -#define BOARD_NLEDS 1 - -#define BOARD_LED_RED BOARD_LED1 - -/* LED bits for use with board_userled_all() */ - -#define BOARD_LED1_BIT (1 << BOARD_LED1) - -/* If CONFIG_ARCH_LEDS is defined, the usage by the board port is defined in - * include/board.h and src/stm32_leds.c. The LEDs are used to encode OS-related - * events as follows: - * - * - * SYMBOL Meaning LED state - * Red Green Blue - * ---------------------- -------------------------- ------ ------ ----*/ - -#define LED_STARTED 0 /* NuttX has been started OFF OFF OFF */ -#define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF OFF ON */ -#define LED_IRQSENABLED 2 /* Interrupts enabled OFF ON OFF */ -#define LED_STACKCREATED 3 /* Idle stack created OFF ON ON */ -#define LED_INIRQ 4 /* In an interrupt N/C N/C GLOW */ -#define LED_SIGNAL 5 /* In a signal handler N/C GLOW N/C */ -#define LED_ASSERTION 6 /* An assertion failed GLOW N/C GLOW */ -#define LED_PANIC 7 /* The system has crashed Blink OFF N/C */ -#define LED_IDLE 8 /* MCU is in sleep mode ON OFF OFF */ - -/* Alternate function pin selections ************************************************/ - -#define GPIO_USART1_RX GPIO_USART1_RX_1 /* PB15 */ -#define GPIO_USART1_TX GPIO_USART1_TX_1 /* PB14 */ - -#define GPIO_USART2_RX 0 /* Not in use */ -#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ - -#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ -#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ - -#define GPIO_UART4_RX GPIO_UART4_RX_5 /* PD0 */ -#define GPIO_UART4_TX GPIO_UART4_TX_5 /* PD1 */ - -#define GPIO_UART5_RX GPIO_UART5_RX_2 /* PB5 */ -#define GPIO_UART5_TX GPIO_UART5_TX_1 /* PB13 */ - -#define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC7 */ -#define GPIO_USART6_TX GPIO_USART6_TX_1 /* PC6 */ - -#define GPIO_UART8_RX GPIO_UART8_RX_1 /* PE0 */ -#define GPIO_UART8_TX GPIO_UART8_TX_1 /* PE1 */ - -/* SPI - * SPI2 is gyro 1 - * SPI3 is gyro 2 - * SPI4 is BARO - */ - - -//#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */ -//#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_3 /* PD7 */ -//#define GPIO_SPI1_SCK GPIO_SPI1_SCK_3 /* PG11 */ - -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_2 /* PC2 */ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_3 /* PC3 */ -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_5 /* PD3 */ - -#define GPIO_SPI3_MISO GPIO_SPI3_MISO_1 /* PB4 */ -#define GPIO_SPI3_MOSI GPIO_SPI3_MOSI_1 /* PD6 */ -#define GPIO_SPI3_SCK GPIO_SPI3_SCK_1 /* PB3 */ - -#define GPIO_SPI4_MISO GPIO_SPI4_MISO_1 /* PE13 */ -#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_1 /* PE14 */ -#define GPIO_SPI4_SCK GPIO_SPI4_SCK_1 /* PE12 */ - -/* I2C - * - * Each I2C is associated with a U[S]ART - * hence the naming I2C2_SDA_UART4 in FMU USAGE spreadsheet - * - * The optional _GPIO configurations allow the I2C driver to manually - * reset the bus to clear stuck slaves. They match the pin configuration, - * but are normally-high GPIOs. - * - */ - -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 /* PB8 */ -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 /* PB9 */ - -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN8) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN9) - -/* SDMMC1 - * - * VDD 3.3 - * GND - * SDMMC1_CK PC12 - * SDMMC1_CMD PD2 - * SDMMC1_D0 PC8 - * SDMMC1_D1 PC9 - * SDMMC1_D2 PC10 - * SDMMC1_D3 PC11 - * GPIO_SDMMC1_NCD PG0 - */ - -/* USB - * - * OTG_FS_DM PA11 - * OTG_FS_DP PA12 - * VBUS PA9 - */ - - -/* Board provides GPIO or other Hardware for signaling to timing analyzer */ - -#if defined(CONFIG_BOARD_USE_PROBES) -# include "stm32_gpio.h" -# define PROBE_N(n) (1<<((n)-1)) -# define PROBE_1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN14) /* PE14 AUX1 */ -# define PROBE_2 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN10) /* PA10 AUX2 */ -# define PROBE_3 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN11) /* PE11 AUX3 */ -# define PROBE_4 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN9) /* PE9 AUX4 */ -# define PROBE_5 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN13) /* PD13 AUX5 */ -# define PROBE_6 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN14) /* PD14 FMU_CAP6 */ -# define PROBE_7 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN6) /* PH6 FMU_CAP5 */ -# define PROBE_8 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN9) /* PH9 FMU_CAP4 */ -# define PROBE_9 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN5) /* PA5 FMU_CAP3 */ -# define PROBE_10 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN3) /* PB3 FMU_CAP2 */ -# define PROBE_11 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN11) /* PB11 FMU_CAP1 */ - -# define PROBE_INIT(mask) \ - do { \ - if ((mask)& PROBE_N(1)) { stm32_configgpio(PROBE_1); } \ - if ((mask)& PROBE_N(2)) { stm32_configgpio(PROBE_2); } \ - if ((mask)& PROBE_N(3)) { stm32_configgpio(PROBE_3); } \ - if ((mask)& PROBE_N(4)) { stm32_configgpio(PROBE_4); } \ - if ((mask)& PROBE_N(5)) { stm32_configgpio(PROBE_5); } \ - if ((mask)& PROBE_N(6)) { stm32_configgpio(PROBE_6); } \ - if ((mask)& PROBE_N(7)) { stm32_configgpio(PROBE_7); } \ - if ((mask)& PROBE_N(8)) { stm32_configgpio(PROBE_8); } \ - if ((mask)& PROBE_N(9)) { stm32_configgpio(PROBE_9); } \ - if ((mask)& PROBE_N(10)) { stm32_configgpio(PROBE_10); } \ - if ((mask)& PROBE_N(11)) { stm32_configgpio(PROBE_11); } \ - } while(0) - -# define PROBE(n,s) do {stm32_gpiowrite(PROBE_##n,(s));}while(0) -# define PROBE_MARK(n) PROBE(n,false);PROBE(n,true) -#else -# define PROBE_INIT(mask) -# define PROBE(n,s) -# define PROBE_MARK(n) -#endif - -/* QSPI configuration */ - -#define CONFIG_STM32H7_QUADSPI -#define CONFIG_STM32H7_QSPI_FLASH_SIZE 16777216 /* bytes */ -#define CONFIG_STM32H7_QSPI_FIFO_THESHOLD 1 -#define CONFIG_STM32H7_QSPI_CSHT 1 /* HIGH TIME 1 CYCLE */ - -#define GPIO_QSPI_CS GPIO_QUADSPI_BK1_NCS_3 /* PB10 */ -#define GPIO_QSPI_IO0 GPIO_QUADSPI_BK1_IO0_3 /* PD11 */ -#define GPIO_QSPI_IO1 GPIO_QUADSPI_BK1_IO1_3 /* PD12 */ -#define GPIO_QSPI_IO2 GPIO_QUADSPI_BK1_IO2_1 /* PE2 */ -#define GPIO_QSPI_IO3 GPIO_QUADSPI_BK1_IO3_2 /* PD13 */ -#define GPIO_QSPI_SCK GPIO_QUADSPI_CLK_1 /* PB2 */ - -/************************************************************************************ - * Public Data - ************************************************************************************/ -#ifndef __ASSEMBLY__ - -#undef EXTERN -#if defined(__cplusplus) -#define EXTERN extern "C" -extern "C" -{ -#else -#define EXTERN extern -#endif - -/************************************************************************************ - * Public Function Prototypes - ************************************************************************************/ - -/************************************************************************************ - * 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. - * - ************************************************************************************/ - -void stm32_boardinitialize(void); - -#undef EXTERN -#if defined(__cplusplus) -} -#endif - -#endif /* __ASSEMBLY__ */ -#endif /*__NUTTX_CONFIG_SPRACING_H7EXTREME_INCLUDE_BOARD_H */ diff --git a/boards/spracing/h7extreme/nuttx-config/include/board_dma_map.h b/boards/spracing/h7extreme/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 1e92544..0000000 --- a/boards/spracing/h7extreme/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -#define DMAMAP_SPI2_RX DMAMAP_DMA12_SPI2RX_0 //(SPI Gyro 1) -#define DMAMAP_SPI2_TX DMAMAP_DMA12_SPI2TX_0 //(SPI Gyro 1) -#define DMAMAP_SPI3_RX DMAMAP_DMA12_SPI3RX_0 //(SPI Gyro 2) -#define DMAMAP_SPI3_TX DMAMAP_DMA12_SPI3TX_0 //(SPI Gyro 2) -#define DMAMAP_SPI4_RX DMAMAP_DMA12_SPI4RX_0 //(SPI OSD) -#define DMAMAP_SPI4_TX DMAMAP_DMA12_SPI4TX_0 //(SPI OSD) diff --git a/boards/spracing/h7extreme/nuttx-config/nsh/defconfig b/boards/spracing/h7extreme/nuttx-config/nsh/defconfig deleted file mode 100644 index f478a92..0000000 --- a/boards/spracing/h7extreme/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,248 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_OS_API is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/spracing/h7extreme/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32h7" -CONFIG_ARCH_CHIP_STM32H743ZI=y -CONFIG_ARCH_CHIP_STM32H7=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_BASEPRI_WAR=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_ARMV7M_ITCM=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=95150 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x004b -CONFIG_CDCACM_PRODUCTSTR="PX4 SP RACING H7 EXTREME" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=12000 -CONFIG_CDCACM_VENDORID=0x3162 -CONFIG_CDCACM_VENDORSTR="SPRacing" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXPERIMENTAL=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_MAX_TASKS=64 -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2688 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_OTG_ID_GPIO_DISABLE=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=294912 -CONFIG_RAM_START=0x30000000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDMMC1_SDIO_MODE=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=256 -CONFIG_STM32H7_ADC1=y -CONFIG_STM32H7_ADC3=y -CONFIG_STM32H7_BBSRAM=y -CONFIG_STM32H7_BBSRAM_FILES=5 -CONFIG_STM32H7_BKPSRAM=y -CONFIG_STM32H7_CUSTOM_CLOCKCONFIG=y -CONFIG_STM32H7_DMA1=y -CONFIG_STM32H7_DMA2=y -CONFIG_STM32H7_DMACAPABLE=y -CONFIG_STM32H7_DTCMEXCLUDE=y -CONFIG_STM32H7_DTCM_PROCFS=y -CONFIG_STM32H7_HSI48=y -CONFIG_STM32H7_I2C1=y -CONFIG_STM32H7_I2C_DYNTIMEO=y -CONFIG_STM32H7_I2C_DYNTIMEO_STARTSTOP=10 -CONFIG_STM32H7_OTGFS=y -CONFIG_STM32H7_PROGMEM=y -CONFIG_STM32H7_RTC=y -CONFIG_STM32H7_RTC_HSECLOCK=y -CONFIG_STM32H7_RTC_MAGIC_REG=1 -CONFIG_STM32H7_SAVE_CRASHDUMP=y -CONFIG_STM32H7_SDMMC1=y -CONFIG_STM32H7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32H7_SPI2=y -CONFIG_STM32H7_SPI2_DMA=y -CONFIG_STM32H7_SPI2_DMA_BUFFER=1024 -CONFIG_STM32H7_SPI3=y -CONFIG_STM32H7_SPI3_DMA=y -CONFIG_STM32H7_SPI3_DMA_BUFFER=1024 -CONFIG_STM32H7_SPI4=y -CONFIG_STM32H7_SPI4_DMA=y -CONFIG_STM32H7_SPI4_DMA_BUFFER=1024 -CONFIG_STM32H7_TIM1=y -CONFIG_STM32H7_TIM3=y -CONFIG_STM32H7_UART4=y -CONFIG_STM32H7_UART5=y -CONFIG_STM32H7_UART8=y -CONFIG_STM32H7_USART1=y -CONFIG_STM32H7_USART2=y -CONFIG_STM32H7_USART3=y -CONFIG_STM32H7_USART6=y -CONFIG_STM32H7_USART_BREAKS=y -CONFIG_STM32H7_USART_INVERT=y -CONFIG_STM32H7_USART_SINGLEWIRE=y -CONFIG_STM32H7_USART_SWAP=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_TTY_SIGINT=y -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=600 -CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART5_BAUD=57600 -CONFIG_UART5_RXBUFSIZE=600 -CONFIG_UART5_TXBUFSIZE=1500 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_SERIAL_CONSOLE=y -CONFIG_UART8_TXBUFSIZE=1500 -CONFIG_USART1_BAUD=57600 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_TXBUFSIZE=1500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_TXBUFSIZE=1500 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_RXBUFSIZE=600 -CONFIG_USART3_TXBUFSIZE=3000 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=600 -CONFIG_USART6_TXBUFSIZE=1500 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 -CONFIG_WATCHDOG=y diff --git a/boards/spracing/h7extreme/nuttx-config/scripts/script.ld b/boards/spracing/h7extreme/nuttx-config/scripts/script.ld deleted file mode 100644 index 263688c..0000000 --- a/boards/spracing/h7extreme/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,271 +0,0 @@ -/**************************************************************************** - * scripts/script.ld - * - * Copyright (C) 2016, 2019, 2020 Gregory Nutt. All rights reserved. - * Authors: Gregory Nutt - * Igor Misic - * - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The SP Racing H7 Extreme uses an STM32H750VIT6 has 128Kb of main FLASH memory and -128 MB external NAND FLASH memory. - * The flash memory is partitioned into a User Flash memory and a System - * Flash memory. Each of these memories has two banks: - * - * 1) User Flash memory: - * - * Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each - * Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each - * - * 2) System Flash memory: - * - * Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector - * Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector - * - * 3) User option bytes for user configuration, only in Bank 1. - * - * In the STM32H743II, two different boot spaces can be selected through - * the BOOT pin and the boot base address programmed in the BOOT_ADD0 and - * BOOT_ADD1 option bytes: - * - * 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0]. - * ST programmed value: Flash memory at 0x0800:0000 - * 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0]. - * ST programmed value: System bootloader at 0x1FF0:0000 - * - * The SP Racing H7 Extreme has a Swtich on board, the BOOT0 pin is at ground so by default, - * the STM32 will boot to address 0x0800:0000 in FLASH unless the swiutch is - * drepresed, then the boot will be from 0x1FF0:0000 - * - * The STM32H743ZI also has 1024Kb of data SRAM. - * SRAM is split up into several blocks and into three power domains: - * - * 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with - * 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus - * - * 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000 - * - * The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit - * DTCM ports. The DTCM-RAM could be used for critical real-time - * data, such as interrupt service routines or stack / heap memory. - * Both DTCM-RAMs can be used in parallel (for load/store operations) - * thanks to the Cortex-M7 dual issue capability. - * - * 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000 - * - * This RAM is connected to ITCM 64-bit interface designed for - * execution of critical real-times routines by the CPU. - * - * 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA - * through D1 domain AXI bus matrix - * - * 2.1) 512Kb of SRAM beginning at address 0x2400:0000 - * - * 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA - * through D2 domain AHB bus matrix - * - * 3.1) 128Kb of sram beginning at address 0x3000:0000 - * 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000 - * 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000 - * - * sram - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000 - * - * 4) AHB SRAM (D3 domain) accessible by most of system masters - * through D3 domain AHB bus matrix - * - * 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000 - * 4.1) 4Kb of backup RAM beginning at address 0x3880:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - */ - -MEMORY -{ - dtcm (xrw) : ORIGIN = 0x20000000, LENGTH = 128K - sram (xrw) : ORIGIN = 0x24000000, LENGTH = 512K - sram2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K - sram3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K - itcm (xrw) : ORIGIN = 0x00000000, LENGTH = 64K - flash (xrw) : ORIGIN = 0x08000000, LENGTH = 128K - qspi (xrw) : ORIGIN = 0x90100000, LENGTH = 1536K /* FW that run in memory-mapped mode */ - qspi2 (xrw) : ORIGIN = 0x90280000, LENGTH = 512K /* FW segment that will be copied to ram and itcm */ - conf (xrw) : ORIGIN = 0x90f80000, LENGTH = 64K /* PX4 Config on an single 64kb erasable block. */ -} - -OUTPUT_ARCH(arm) -EXTERN(_vectors) -ENTRY(_stext) - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - - .itcm_code : { - _start_itcm = ABSOLUTE(.); - . = ALIGN(4); - - *modules__mc_att_control.a:*(.text* .rodata*) - *modules__mc_rate_control.a:*(.text* .rodata*) - *drivers__imu__invensense__icm20602.a:*(.text* .rodata*) - *drivers__imu__invensense__icm42688p.a:*(.text* .rodata*) - *drivers__device.a:*(.text* .rodata*) - *drivers__pwm_out.a:*(.text* .rodata*) - *vehicle_angular_velocity.a:*(.text* .rodata*) - *modules__attitude_estimator_q.a:*(.text* .rodata*) - *stm32_spi.o(.text* .rodata*) - *stm32_dma.o(.text* .rodata*) - - _end_itcm = ABSOLUTE(.); - } > itcm AT > qspi2 - _load_itcm = LOADADDR(.itcm_code); - - .sram_code : { - _start_sram = ABSOLUTE(.); - . = ALIGN(4); - - *drivers__dshot.a:*(.text* .rodata*) - *modules__flight_mode_manager.a:*(.text* .rodata*) - *modules__mc_pos_control.a:*(.text* .rodata*) - *modules__mc_hover_thrust_estimator.a:*(.text* .rodata*) - *modules__rc_update.a:*(.text* .rodata*) - *modules__sensors.a:*(.text* .rodata*) - *libc.a:*(.text* .rodata*) - *modules__commander.a:*(.text* .rodata*) - *modules__dataman.a:*(.text* .rodata*) - *modules__events.a:*(.text* .rodata*) - *modules__load_mon.a:*(.text* .rodata*) - *modules__logger.a:*(.text* .rodata*) - *battery_status.a:*(.text* .rodata*) - *land_detector.a:*(.text* .rodata*) - *uorb_msgs.a:*(.text* .rodata*) - *arch_spi.a:*(.text* .rodata*) - - _end_sram = ABSOLUTE(.); - } > sram AT > qspi2 - _load_sram = LOADADDR(.sram_code); - - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.rodata .rodata.*) - *(.fixup) - *(.gnu.warning) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - } > qspi - - .ramfunc : { - _sramfuncs = ABSOLUTE(.); - . = ALIGN(4); - *(.ramfunc .ramfunc.*) - _eramfuncs = ABSOLUTE(.); - } > sram AT > qspi - - _framfuncs = LOADADDR(.ramfunc); - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > qspi - - .ARM.extab : { - *(.ARM.extab*) - } > qspi - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > qspi - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - - /* Pad out last section as the STM32H7 Flash write size is 256 bits. 32 bytes */ - . = ALIGN(16); - FILL(0xffff) - . += 16; - } > sram AT > qspi = 0xffff - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/spracing/h7extreme/src/CMakeLists.txt b/boards/spracing/h7extreme/src/CMakeLists.txt deleted file mode 100644 index db917c9..0000000 --- a/boards/spracing/h7extreme/src/CMakeLists.txt +++ /dev/null @@ -1,55 +0,0 @@ -############################################################################ -# -# Copyright (c) 2020 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. -# -############################################################################ - -add_library(drivers_board - i2c.cpp - init.c - led.c - sdio.c - spi.cpp - timer_config.cpp - usb.c - rcc.c - qspi.c - flash_w25q128.c -) - -target_link_libraries(drivers_board - PRIVATE - arch_io_pins - arch_spi - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer -) diff --git a/boards/spracing/h7extreme/src/board_config.h b/boards/spracing/h7extreme/src/board_config.h deleted file mode 100644 index 9c1ea8e..0000000 --- a/boards/spracing/h7extreme/src/board_config.h +++ /dev/null @@ -1,194 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 PX4 Development Team. All rights reserved. - * Authors: Igor Misic - * - * 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * sp racing h7 extreme internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ - -#define FLASH_BASED_PARAMS -#define BOARD_USE_EXTERNAL_FLASH //Configuration and firmware are in external flash - -#define BOARD_HAS_USB_VALID 1 // LTC Has No USB valid - -/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */ - -#define GPIO_nLED_RED /* PE3 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN3) - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_ARMED_STATE_LED LED_RED -#define BOARD_OVERLOAD_LED LED_RED - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that - * can be used by the Px4 Firmware in the adc driver - */ - -/* Define GPIO pins used as ADC N.B. Channel numbers must match below */ -#define PX4_ADC_GPIO \ - /* PC4 */ GPIO_ADC12_INP4, \ - /* PC1 */ GPIO_ADC123_INP11, \ - /* PC0 */ GPIO_ADC123_INP10 - - -/* Define Channel numbers must match above GPIO pin IN(n)*/ -#define ADC_RSSI_IN_CHANNEL /* PC4 */ 4 -#define ADC_BATTERY_VOLTAGE_CHANNEL /* PC1 */ 11 -#define ADC_BATTERY_CURRENT_CHANNEL /* PC0 */ 10 - -#define ADC_CHANNELS (1 << 4) | (1 << 10) | (1 << 11) - -/* PWM - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 8 - -/* Tone alarm output */ -#define GPIO_TONE_ALARM_IDLE /* PE5 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN5) -#define GPIO_TONE_ALARM_GPIO /* PE5 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN5) - -/* USB OTG FS - * - * PA8 OTG_FS_VBUS VBUS sensing - */ -#define GPIO_OTGFS_VBUS /* PA9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 2 /* use timer2 for the HRT */ -#define HRT_TIMER_CHANNEL 3 /* use capture/compare channel 3 */ - - -/* RC Serial port */ - -#define RC_SERIAL_PORT "/dev/ttyS0" - -#define GPIO_RSSI_IN /* PC5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN5) - -#define SDIO_SLOTNO 0 /* Only one slot */ -#define SDIO_MINOR 0 - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ -#define BOARD_HAS_ON_RESET 1 - -#define PX4_GPIO_INIT_LIST { \ - PX4_ADC_GPIO, \ - GPIO_TONE_ALARM_IDLE, \ - GPIO_RSSI_IN, \ - } - -#define BOARD_ENABLE_CONSOLE_BUFFER - -#define BOARD_NUM_IO_TIMERS 3 - - -__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 board. - * - ****************************************************************************************************/ - -extern void stm32_spiinitialize(void); - -extern void stm32_usbinitialize(void); - -extern void board_peripheral_reset(int ms); - -#include - -/**************************************************************************************************** - * Progmem external flash functions: - * - * This board has custom progmem functions. It is used to save data to external flash. - * - ****************************************************************************************************/ -void flash_w25q128_init(void); - -#include -__ramfunc__ ssize_t up_progmem_ext_getpage(size_t addr); -__ramfunc__ ssize_t up_progmem_ext_eraseblock(size_t block); -__ramfunc__ ssize_t up_progmem_ext_write(size_t addr, FAR const void *buf, size_t count); - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/spracing/h7extreme/src/flash_w25q128.c b/boards/spracing/h7extreme/src/flash_w25q128.c deleted file mode 100644 index 3a3e2ce..0000000 --- a/boards/spracing/h7extreme/src/flash_w25q128.c +++ /dev/null @@ -1,505 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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. - * - ****************************************************************************/ - -/** - * @file flash_w25q128.c - * - * Board-specific external flash W25Q128 functions. - */ - - -#include "board_config.h" -#include "qspi.h" -#include "arm_internal.h" -#include -#include - - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#define N25Q128_SECTOR_SIZE (4*1024) -#define N25Q128_SECTOR_SHIFT (12) -#define N25Q128_SECTOR_COUNT (4096) -#define N25Q128_PAGE_SIZE (256) -#define N25Q128_PAGE_SHIFT (8) - -#define W25Q_DUMMY_CYCLES_FAST_READ_QUAD 6 -#define W25Q_INSTR_FAST_READ_QUAD 0xEB -#define W25Q_ADDRESS_SIZE 3 // 3 bytes -> 24 bits - -#define N25QXXX_READ_STATUS 0x05 /* Read status register: * - * 0x05 | SR */ -#define N25QXXX_PAGE_PROGRAM 0x02 /* Page Program: * - * 0x02 | ADDR(MS) | ADDR(MID) | * - * ADDR(LS) | data */ -#define N25QXXX_WRITE_ENABLE 0x06 /* Write enable: * - * 0x06 */ -#define N25QXXX_WRITE_DISABLE 0x04 /* Write disable command code: * - * 0x04 */ -#define N25QXXX_SUBSECTOR_ERASE 0x20 /* Sub-sector Erase (4 kB) * - * 0x20 | ADDR(MS) | ADDR(MID) | * - * ADDR(LS) */ - - -/* N25QXXX Registers ****************************************************************/ -/* Status register bit definitions */ - -#define STATUS_BUSY_MASK (1 << 0) /* Bit 0: Device ready/busy status */ -# define STATUS_READY (0 << 0) /* 0 = Not Busy */ -# define STATUS_BUSY (1 << 0) /* 1 = Busy */ -#define STATUS_WEL_MASK (1 << 1) /* Bit 1: Write enable latch status */ -# define STATUS_WEL_DISABLED (0 << 1) /* 0 = Not Write Enabled */ -# define STATUS_WEL_ENABLED (1 << 1) /* 1 = Write Enabled */ -#define STATUS_BP_SHIFT (2) /* Bits 2-4: Block protect bits */ -#define STATUS_BP_MASK (7 << STATUS_BP_SHIFT) -# define STATUS_BP_NONE (0 << STATUS_BP_SHIFT) -# define STATUS_BP_ALL (7 << STATUS_BP_SHIFT) -#define STATUS_TB_MASK (1 << 5) /* Bit 5: Top / Bottom Protect */ -# define STATUS_TB_TOP (0 << 5) /* 0 = BP2-BP0 protect Top down */ -# define STATUS_TB_BOTTOM (1 << 5) /* 1 = BP2-BP0 protect Bottom up */ -#define STATUS_BP3_MASK (1 << 5) /* Bit 6: BP3 */ -#define STATUS_SRP0_MASK (1 << 7) /* Bit 7: Status register protect 0 */ -# define STATUS_SRP0_UNLOCKED (0 << 7) /* 0 = WP# no effect / PS Lock Down */ -# define STATUS_SRP0_LOCKED (1 << 7) /* 1 = WP# protect / OTP Lock Down */ - -/************************************************************************************ - * Private Types - ************************************************************************************/ - -/* This type represents the state of the MTD device. The struct mtd_dev_s must - * appear at the beginning of the definition so that you can freely cast between - * pointers to struct mtd_dev_s and struct n25qxxx_dev_s. - */ - -struct n25qxxx_dev_s { - //struct mtd_dev_s mtd; /* MTD interface */ - FAR struct qspi_dev_s *qspi; /* Saved QuadSPI interface instance */ - uint16_t nsectors; /* Number of erase sectors */ - uint8_t sectorshift; /* Log2 of sector size */ - uint8_t pageshift; /* Log2 of page size */ - FAR uint8_t *cmdbuf; /* Allocated command buffer */ - FAR uint8_t *readbuf; /* Allocated status read buffer */ -}; - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -struct qspi_dev_s *ptr_qspi_dev; -struct qspi_meminfo_s qspi_meminfo = { - .flags = QSPIMEM_QUADIO, - .addrlen = W25Q_ADDRESS_SIZE, - .dummies = W25Q_DUMMY_CYCLES_FAST_READ_QUAD, - .cmd = W25Q_INSTR_FAST_READ_QUAD -}; - -struct n25qxxx_dev_s n25qxxx_dev; -uint8_t cmdbuf[4] = {0u}; -uint8_t readbuf[1] = {0u}; - -/************************************************************************************ - * Private Functions - ************************************************************************************/ -__ramfunc__ int n25qxxx_command(FAR struct qspi_dev_s *qspi, uint8_t cmd); -__ramfunc__ uint8_t n25qxxx_read_status(FAR struct n25qxxx_dev_s *priv); -__ramfunc__ int n25qxxx_command_read(FAR struct qspi_dev_s *qspi, uint8_t cmd, - FAR void *buffer, size_t buflen); -__ramfunc__ void n25qxxx_write_enable(FAR struct n25qxxx_dev_s *priv); -__ramfunc__ void n25qxxx_write_disable(FAR struct n25qxxx_dev_s *priv); - -__ramfunc__ int n25qxxx_write_page(struct n25qxxx_dev_s *priv, FAR const uint8_t *buffer, - off_t address, size_t buflen); - -__ramfunc__ int n25qxxx_write_one_page(struct n25qxxx_dev_s *priv, struct qspi_meminfo_s *meminfo); - -__ramfunc__ int n25qxxx_erase_sector(struct n25qxxx_dev_s *priv, off_t sector); - -__ramfunc__ bool n25qxxx_isprotected(FAR struct n25qxxx_dev_s *priv, uint8_t status, - off_t address); - -__ramfunc__ int n25qxxx_command_address(FAR struct qspi_dev_s *qspi, uint8_t cmd, - off_t addr, uint8_t addrlen); - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -void flash_w25q128_init(void) -{ - int qspi_interface_number = 0; - ptr_qspi_dev = stm32h7_qspi_initialize(qspi_interface_number); - n25qxxx_dev.qspi = ptr_qspi_dev; - n25qxxx_dev.cmdbuf = cmdbuf; - n25qxxx_dev.readbuf = readbuf; - n25qxxx_dev.sectorshift = N25Q128_SECTOR_SHIFT; - n25qxxx_dev.pageshift = N25Q128_PAGE_SHIFT; - n25qxxx_dev.nsectors = N25Q128_SECTOR_COUNT; -} - -__ramfunc__ ssize_t up_progmem_ext_getpage(size_t addr) -{ - ssize_t page_address = (addr - STM32_FMC_BANK4) / N25Q128_SECTOR_COUNT; - - return page_address; -} - -__ramfunc__ ssize_t up_progmem_ext_eraseblock(size_t block) -{ - ssize_t size = N25Q128_SECTOR_COUNT; - - irqstate_t irqstate = px4_enter_critical_section(); - stm32h7_qspi_exit_memorymapped(ptr_qspi_dev); - - n25qxxx_erase_sector(&n25qxxx_dev, block); - - stm32h7_qspi_enter_memorymapped(ptr_qspi_dev, &qspi_meminfo, 0); - px4_leave_critical_section(irqstate); - return size; -} - -__ramfunc__ ssize_t up_progmem_ext_write(size_t addr, FAR const void *buf, size_t count) -{ - ssize_t ret_val = 0; - - irqstate_t irqstate = px4_enter_critical_section(); - stm32h7_qspi_exit_memorymapped(ptr_qspi_dev); - - addr &= 0xFFFFFF; - n25qxxx_write_page(&n25qxxx_dev, buf, (off_t)addr, count); - - stm32h7_qspi_enter_memorymapped(ptr_qspi_dev, &qspi_meminfo, 0); - px4_leave_critical_section(irqstate); - - return ret_val; -} - -/************************************************************************************ - * Name: n25qxxx_command - ************************************************************************************/ - -__ramfunc__ int n25qxxx_command(FAR struct qspi_dev_s *qspi, uint8_t cmd) -{ - struct qspi_cmdinfo_s cmdinfo; - - finfo("CMD: %02" PRIx8 "\n", cmd); - - cmdinfo.flags = 0; - cmdinfo.addrlen = 0; - cmdinfo.cmd = cmd; - cmdinfo.buflen = 0; - cmdinfo.addr = 0; - cmdinfo.buffer = NULL; - - int rv; - rv = qspi_command(qspi, &cmdinfo); - return rv; -} - -/************************************************************************************ - * Name: n25qxxx_read_status - ************************************************************************************/ - -__ramfunc__ uint8_t n25qxxx_read_status(FAR struct n25qxxx_dev_s *priv) -{ - DEBUGVERIFY(n25qxxx_command_read(priv->qspi, N25QXXX_READ_STATUS, - (FAR void *)&priv->readbuf[0], 1)); - return priv->readbuf[0]; -} - -/************************************************************************************ - * Name: n25qxxx_command_read - ************************************************************************************/ - -__ramfunc__ int n25qxxx_command_read(FAR struct qspi_dev_s *qspi, uint8_t cmd, - FAR void *buffer, size_t buflen) -{ - struct qspi_cmdinfo_s cmdinfo; - - finfo("CMD: %02" PRIx8 " buflen: %zu\n", cmd, buflen); - - cmdinfo.flags = QSPICMD_READDATA; - cmdinfo.addrlen = 0; - cmdinfo.cmd = cmd; - cmdinfo.buflen = buflen; - cmdinfo.addr = 0; - cmdinfo.buffer = buffer; - - int rv; - rv = qspi_command(qspi, &cmdinfo); - return rv; -} - - -/************************************************************************************ - * Name: n25qxxx_write_enable - ************************************************************************************/ - -__ramfunc__ void n25qxxx_write_enable(FAR struct n25qxxx_dev_s *priv) -{ - uint8_t status; - - do { - n25qxxx_command(priv->qspi, N25QXXX_WRITE_ENABLE); - status = n25qxxx_read_status(priv); - } while ((status & STATUS_WEL_MASK) != STATUS_WEL_ENABLED); -} - -/************************************************************************************ - * Name: n25qxxx_write_disable - ************************************************************************************/ - -__ramfunc__ void n25qxxx_write_disable(FAR struct n25qxxx_dev_s *priv) -{ - uint8_t status; - - do { - n25qxxx_command(priv->qspi, N25QXXX_WRITE_DISABLE); - status = n25qxxx_read_status(priv); - } while ((status & STATUS_WEL_MASK) != STATUS_WEL_DISABLED); -} - -/************************************************************************************ - * Name: n25qxxx_write_page - ************************************************************************************/ - -__ramfunc__ int n25qxxx_write_page(struct n25qxxx_dev_s *priv, FAR const uint8_t *buffer, - off_t address, size_t buflen) -{ - struct qspi_meminfo_s meminfo; - unsigned int pagesize; - unsigned int npages; - unsigned int firstpagesize = 0; - int ret = OK; - unsigned int i; - - finfo("address: %08jx buflen: %zu\n", (intmax_t)address, buflen); - - pagesize = (1 << priv->pageshift); - - /* Set up non-varying parts of transfer description */ - - meminfo.flags = QSPIMEM_WRITE; - meminfo.cmd = N25QXXX_PAGE_PROGRAM; - meminfo.addrlen = 3; - meminfo.dummies = 0; - meminfo.buffer = (void *)buffer; - - if (0 != (address % pagesize)) { - firstpagesize = pagesize - (address % pagesize); - } - - if (buflen <= firstpagesize) { - meminfo.addr = address; - meminfo.buflen = buflen; - ret = n25qxxx_write_one_page(priv, &meminfo); - - } else { - - if (firstpagesize > 0) { - meminfo.addr = address; - meminfo.buflen = firstpagesize; - ret = n25qxxx_write_one_page(priv, &meminfo); - - buffer += firstpagesize; - address += firstpagesize; - buflen -= firstpagesize; - } - - npages = (buflen >> priv->pageshift); - - meminfo.buflen = pagesize; - - /* Then write each page */ - - for (i = 0; (i < npages) && (ret == OK); i++) { - /* Set up varying parts of the transfer description */ - - meminfo.addr = address; - meminfo.buffer = (void *)buffer; - - ret = n25qxxx_write_one_page(priv, &meminfo); - - /* Update for the next time through the loop */ - - buffer += pagesize; - address += pagesize; - buflen -= pagesize; - } - - if ((ret == OK) && (buflen > 0)) { - meminfo.addr = address; - meminfo.buffer = (void *)buffer; - meminfo.buflen = buflen; - - ret = n25qxxx_write_one_page(priv, &meminfo); - } - } - - return ret; -} - -__ramfunc__ int n25qxxx_write_one_page(struct n25qxxx_dev_s *priv, struct qspi_meminfo_s *meminfo) -{ - int ret; - - n25qxxx_write_enable(priv); - ret = qspi_memory(priv->qspi, meminfo); - n25qxxx_write_disable(priv); - - if (ret < 0) { - ferr("ERROR: QSPI_MEMORY failed writing address=%06" PRIx32 "\n", - meminfo->addr); - } - - return ret; -} - -/************************************************************************************ - * Name: n25qxxx_erase_sector - ************************************************************************************/ - -__ramfunc__ int n25qxxx_erase_sector(struct n25qxxx_dev_s *priv, off_t sector) -{ - off_t address; - uint8_t status; - - finfo("sector: %08jx\n", (intmax_t) sector); - - /* Check that the flash is ready and unprotected */ - - status = n25qxxx_read_status(priv); - - if ((status & STATUS_BUSY_MASK) != STATUS_READY) { - ferr("ERROR: Flash busy: %02" PRIx8, status); - return -EBUSY; - } - - /* Get the address associated with the sector */ - - address = (off_t)sector << priv->sectorshift; - - if ((status & (STATUS_BP3_MASK | STATUS_BP_MASK)) != 0 && - n25qxxx_isprotected(priv, status, address)) { - ferr("ERROR: Flash protected: %02" PRIx8, status); - return -EACCES; - } - - /* Send the sector erase command */ - - n25qxxx_write_enable(priv); - n25qxxx_command_address(priv->qspi, N25QXXX_SUBSECTOR_ERASE, address, 3); - - /* Wait for erasure to finish */ - - while ((n25qxxx_read_status(priv) & STATUS_BUSY_MASK) != 0); - - return OK; -} - -/************************************************************************************ - * Name: n25qxxx_isprotected - ************************************************************************************/ - -__ramfunc__ bool n25qxxx_isprotected(FAR struct n25qxxx_dev_s *priv, uint8_t status, - off_t address) -{ - off_t protstart; - off_t protend; - off_t protsize; - unsigned int bp; - - /* The BP field is spread across non-contiguous bits */ - - bp = (status & STATUS_BP_MASK) >> STATUS_BP_SHIFT; - - if (status & STATUS_BP3_MASK) { - bp |= 8; - } - - /* the BP field is essentially the power-of-two of the number of 64k sectors, - * saturated to the device size. - */ - - if (0 == bp) { - return false; - } - - protsize = 0x00010000; - protsize <<= (protsize << (bp - 1)); - protend = (1 << priv->sectorshift) * priv->nsectors; - - if (protsize > protend) { - protsize = protend; - } - - /* The final protection range then depends on if the protection region is - * configured top-down or bottom up (assuming CMP=0). - */ - - if ((status & STATUS_TB_MASK) != 0) { - protstart = 0x00000000; - protend = protstart + protsize; - - } else { - protstart = protend - protsize; - /* protend already computed above */ - } - - return (address >= protstart && address < protend); -} - -/************************************************************************************ - * Name: n25qxxx_command_address - ************************************************************************************/ - -__ramfunc__ int n25qxxx_command_address(FAR struct qspi_dev_s *qspi, uint8_t cmd, - off_t addr, uint8_t addrlen) -{ - struct qspi_cmdinfo_s cmdinfo; - - finfo("CMD: %02" PRIx8 " Address: %04jx addrlen=%" PRIx8 "\n", cmd, (intmax_t) addr, addrlen); - - cmdinfo.flags = QSPICMD_ADDRESS; - cmdinfo.addrlen = addrlen; - cmdinfo.cmd = cmd; - cmdinfo.buflen = 0; - cmdinfo.addr = addr; - cmdinfo.buffer = NULL; - - int rv; - rv = qspi_command(qspi, &cmdinfo); - return rv; -} diff --git a/boards/spracing/h7extreme/src/hardware/stm32_qspi.h b/boards/spracing/h7extreme/src/hardware/stm32_qspi.h deleted file mode 100644 index 6b7f6bf..0000000 --- a/boards/spracing/h7extreme/src/hardware/stm32_qspi.h +++ /dev/null @@ -1,239 +0,0 @@ -/**************************************************************************** - * arch/arm/src/stm32h7/hardware/stm32_qspi.h - * - * Copyright (C) 2016, 2019 Gregory Nutt. All rights reserved. - * Author: dev@ziggurat29.com - * - * 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 NuttX 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. - * - ****************************************************************************/ - -#ifndef __ARCH_ARM_SRC_STM32H7_HARDWARE_STM32H7_QSPI_H -#define __ARCH_ARM_SRC_STM32H7_HARDWARE_STM32H7_QSPI_H - -/**************************************************************************************** - * Included Files - ****************************************************************************************/ - -#include -#include - -#include "chip.h" - -/**************************************************************************************** - * Pre-processor Definitions - ****************************************************************************************/ - -/* General Characteristics **************************************************************/ - -#define STM32H7_QSPI_MINBITS 8 /* Minimum word width */ -#define STM32H7_QSPI_MAXBITS 32 /* Maximum word width */ - -/* QSPI register offsets ****************************************************************/ - -#define STM32_QUADSPI_CR_OFFSET 0x0000 /* Control Register */ -#define STM32_QUADSPI_DCR_OFFSET 0x0004 /* Device Configuration Register */ -#define STM32_QUADSPI_SR_OFFSET 0x0008 /* Status Register */ -#define STM32_QUADSPI_FCR_OFFSET 0x000c /* Flag Clear Register */ -#define STM32_QUADSPI_DLR_OFFSET 0x0010 /* Data Length Register */ -#define STM32_QUADSPI_CCR_OFFSET 0x0014 /* Communication Configuration Register */ -#define STM32_QUADSPI_AR_OFFSET 0x0018 /* Address Register */ -#define STM32_QUADSPI_ABR_OFFSET 0x001c /* Alternate Bytes Register */ -#define STM32_QUADSPI_DR_OFFSET 0x0020 /* Data Register */ -#define STM32_QUADSPI_PSMKR_OFFSET 0x0024 /* Polling Status mask Register */ -#define STM32_QUADSPI_PSMAR_OFFSET 0x0028 /* Polling Status match Register */ -#define STM32_QUADSPI_PIR_OFFSET 0x002c /* Polling Interval Register */ -#define STM32_QUADSPI_LPTR_OFFSET 0x0030 /* Low-Power Timeout Register */ - -/* QSPI register addresses **************************************************************/ - -#define STM32_QUADSPI_CR (STM32_QUADSPI_BASE+STM32_QUADSPI_CR_OFFSET) /* Control Register */ -#define STM32_QUADSPI_DCR (STM32_QUADSPI_BASE+STM32_QUADSPI_DCR_OFFSET) /* Device Configuration Register */ -#define STM32_QUADSPI_SR (STM32_QUADSPI_BASE+STM32_QUADSPI_SR_OFFSET) /* Status Register */ -#define STM32_QUADSPI_FCR (STM32_QUADSPI_BASE+STM32_QUADSPI_FCR_OFFSET) /* Flag Clear Register */ -#define STM32_QUADSPI_DLR (STM32_QUADSPI_BASE+STM32_QUADSPI_DLR_OFFSET) /* Data Length Register */ -#define STM32_QUADSPI_CCR (STM32_QUADSPI_BASE+STM32_QUADSPI_CCR_OFFSET) /* Communication Configuration Register */ -#define STM32_QUADSPI_AR (STM32_QUADSPI_BASE+STM32_QUADSPI_AR_OFFSET) /* Address Register */ -#define STM32_QUADSPI_ABR (STM32_QUADSPI_BASE+STM32_QUADSPI_ABR_OFFSET) /* Alternate Bytes Register */ -#define STM32_QUADSPI_DR (STM32_QUADSPI_BASE+STM32_QUADSPI_DR_OFFSET) /* Data Register */ -#define STM32_QUADSPI_PSMKR (STM32_QUADSPI_BASE+STM32_QUADSPI_PSMKR_OFFSET) /* Polling Status mask Register */ -#define STM32_QUADSPI_PSMAR (STM32_QUADSPI_BASE+STM32_QUADSPI_PSMAR_OFFSET) /* Polling Status match Register */ -#define STM32_QUADSPI_PIR (STM32_QUADSPI_BASE+STM32_QUADSPI_PIR_OFFSET) /* Polling Interval Register */ -#define STM32_QUADSPI_LPTR (STM32_QUADSPI_BASE+STM32_QUADSPI_LPTR_OFFSET) /* Low-Power Timeout Register */ - -/* QSPI register bit definitions ********************************************************/ - -/* Control Register */ - -#define QSPI_CR_EN (1 << 0) /* Bit 0: QSPI Enable */ -#define QSPI_CR_ABORT (1 << 1) /* Bit 1: Abort request */ -#define QSPI_CR_TCEN (1 << 3) /* Bit 3: Timeout counter enable */ -#define QSPI_CR_SSHIFT (1 << 4) /* Bit 4: Sample shift */ -#define QSPI_CR_DFM (1 << 6) /* Bit 6: DFM: Dual-flash mode */ -#define QSPI_CR_FSEL (1 << 7) /* Bit 7: FSEL: Flash memory selection */ -#define QSPI_CR_FTHRES_SHIFT (8) /* Bits 8-11: FIFO threshold level */ -#define QSPI_CR_FTHRES_MASK (0x0f << QSPI_CR_FTHRES_SHIFT) -#define QSPI_CR_TEIE (1 << 16) /* Bit 16: Transfer error interrupt enable */ -#define QSPI_CR_TCIE (1 << 17) /* Bit 17: Transfer complete interrupt enable */ -#define QSPI_CR_FTIE (1 << 18) /* Bit 18: FIFO threshold interrupt enable */ -#define QSPI_CR_SMIE (1 << 19) /* Bit 19: Status match interrupt enable */ -#define QSPI_CR_TOIE (1 << 20) /* Bit 20: TimeOut interrupt enable */ -#define QSPI_CR_APMS (1 << 22) /* Bit 22: Automatic poll mode stop */ -#define QSPI_CR_PMM (1 << 23) /* Bit 23: Polling match mode */ -#define QSPI_CR_PRESCALER_SHIFT (24) /* Bits 24-31: Clock prescaler */ -#define QSPI_CR_PRESCALER_MASK (0xff << QSPI_CR_PRESCALER_SHIFT) - -/* Device Configuration Register */ - -#define QSPI_DCR_CKMODE (1 << 0) /* Bit 0: Mode 0 / mode 3 */ -#define QSPI_DCR_CSHT_SHIFT (8) /* Bits 8-10: Chip select high time */ -#define QSPI_DCR_CSHT_MASK (0x7 << QSPI_DCR_CSHT_SHIFT) -#define QSPI_DCR_FSIZE_SHIFT (16) /* Bits 16-20: Flash memory size */ -#define QSPI_DCR_FSIZE_MASK (0x1f << QSPI_DCR_FSIZE_SHIFT) - -/* Status Register */ - -#define QSPI_SR_TEF (1 << 0) /* Bit 0: Transfer error flag */ -#define QSPI_SR_TCF (1 << 1) /* Bit 1: Transfer complete flag */ -#define QSPI_SR_FTF (1 << 2) /* Bit 2: FIFO threshold flag */ -#define QSPI_SR_SMF (1 << 3) /* Bit 3: Status match flag */ -#define QSPI_SR_TOF (1 << 4) /* Bit 4: Timeout flag */ -#define QSPI_SR_BUSY (1 << 5) /* Bit 5: Busy */ -#define QSPI_SR_FLEVEL_SHIFT (8) /* Bits 8-12: FIFO threshold level */ -#define QSPI_SR_FLEVEL_MASK (0x1f << QSPI_SR_FLEVEL_SHIFT) - -/* Flag Clear Register */ - -#define QSPI_FCR_CTEF (1 << 0) /* Bit 0: Clear Transfer error flag */ -#define QSPI_FCR_CTCF (1 << 1) /* Bit 1: Clear Transfer complete flag */ -#define QSPI_FCR_CSMF (1 << 3) /* Bit 3: Clear Status match flag */ -#define QSPI_FCR_CTOF (1 << 4) /* Bit 4: Clear Timeout flag */ - -/* Data Length Register */ - -/* Communication Configuration Register */ - -#define CCR_IMODE_NONE 0 /* No instruction */ -#define CCR_IMODE_SINGLE 1 /* Instruction on a single line */ -#define CCR_IMODE_DUAL 2 /* Instruction on two lines */ -#define CCR_IMODE_QUAD 3 /* Instruction on four lines */ - -#define CCR_ADMODE_NONE 0 /* No address */ -#define CCR_ADMODE_SINGLE 1 /* Address on a single line */ -#define CCR_ADMODE_DUAL 2 /* Address on two lines */ -#define CCR_ADMODE_QUAD 3 /* Address on four lines */ - -#define CCR_ADSIZE_8 0 /* 8-bit address */ -#define CCR_ADSIZE_16 1 /* 16-bit address */ -#define CCR_ADSIZE_24 2 /* 24-bit address */ -#define CCR_ADSIZE_32 3 /* 32-bit address */ - -#define CCR_ABMODE_NONE 0 /* No alternate bytes */ -#define CCR_ABMODE_SINGLE 1 /* Alternate bytes on a single line */ -#define CCR_ABMODE_DUAL 2 /* Alternate bytes on two lines */ -#define CCR_ABMODE_QUAD 3 /* Alternate bytes on four lines */ - -#define CCR_ABSIZE_8 0 /* 8-bit alternate byte */ -#define CCR_ABSIZE_16 1 /* 16-bit alternate bytes */ -#define CCR_ABSIZE_24 2 /* 24-bit alternate bytes */ -#define CCR_ABSIZE_32 3 /* 32-bit alternate bytes */ - -#define CCR_DMODE_NONE 0 /* No data */ -#define CCR_DMODE_SINGLE 1 /* Data on a single line */ -#define CCR_DMODE_DUAL 2 /* Data on two lines */ -#define CCR_DMODE_QUAD 3 /* Data on four lines */ - -#define CCR_FMODE_INDWR 0 /* Indirect write mode */ -#define CCR_FMODE_INDRD 1 /* Indirect read mode */ -#define CCR_FMODE_AUTOPOLL 2 /* Automatic polling mode */ -#define CCR_FMODE_MEMMAP 3 /* Memory-mapped mode */ - -#define QSPI_CCR_INSTRUCTION_SHIFT (0) /* Bits 0-7: Instruction */ -#define QSPI_CCR_INSTRUCTION_MASK (0xff << QSPI_CCR_INSTRUCTION_SHIFT) -# define QSPI_CCR_INST(n) ((uint32_t)(n) << QSPI_CCR_INSTRUCTION_SHIFT) -#define QSPI_CCR_IMODE_SHIFT (8) /* Bits 8-9: Instruction mode */ -#define QSPI_CCR_IMODE_MASK (0x3 << QSPI_CCR_IMODE_SHIFT) -# define QSPI_CCR_IMODE(n) ((uint32_t)(n) << QSPI_CCR_IMODE_SHIFT) -#define QSPI_CCR_ADMODE_SHIFT (10) /* Bits 10-11: Address mode */ -#define QSPI_CCR_ADMODE_MASK (0x3 << QSPI_CCR_ADMODE_SHIFT) -# define QSPI_CCR_ADMODE(n) ((uint32_t)(n) << QSPI_CCR_ADMODE_SHIFT) -#define QSPI_CCR_ADSIZE_SHIFT (12) /* Bits 12-13: Address size */ -#define QSPI_CCR_ADSIZE_MASK (0x3 << QSPI_CCR_ADSIZE_SHIFT) -# define QSPI_CCR_ADSIZE(n) ((uint32_t)(n) << QSPI_CCR_ADSIZE_SHIFT) -#define QSPI_CCR_ABMODE_SHIFT (14) /* Bits 14-15: Alternate bytes mode */ -#define QSPI_CCR_ABMODE_MASK (0x3 << QSPI_CCR_ABMODE_SHIFT) -# define QSPI_CCR_ABMODE(n) ((uint32_t)(n) << QSPI_CCR_ABMODE_SHIFT) -#define QSPI_CCR_ABSIZE_SHIFT (16) /* Bits 16-17: Alternate bytes size */ -#define QSPI_CCR_ABSIZE_MASK (0x3 << QSPI_CCR_ABSIZE_SHIFT) -# define QSPI_CCR_ABSIZE(n) ((uint32_t)(n) << QSPI_CCR_ABSIZE_SHIFT) -#define QSPI_CCR_DCYC_SHIFT (18) /* Bits 18-23: Number of dummy cycles */ -#define QSPI_CCR_DCYC_MASK (0x1f << QSPI_CCR_DCYC_SHIFT) -# define QSPI_CCR_DCYC(n) ((uint32_t)(n) << QSPI_CCR_DCYC_SHIFT) -#define QSPI_CCR_DMODE_SHIFT (24) /* Bits 24-25: Data mode */ -#define QSPI_CCR_DMODE_MASK (0x3 << QSPI_CCR_DMODE_SHIFT) -# define QSPI_CCR_DMODE(n) ((uint32_t)(n) << QSPI_CCR_DMODE_SHIFT) -#define QSPI_CCR_FMODE_SHIFT (26) /* Bits 26-27: Functional mode */ -#define QSPI_CCR_FMODE_MASK (0x3 << QSPI_CCR_FMODE_SHIFT) -# define QSPI_CCR_FMODE(n) ((uint32_t)(n) << QSPI_CCR_FMODE_SHIFT) -#define QSPI_CCR_SIOO (1 << 28) /* Bit 28: Send instruction only once mode */ -#define QSPI_CCR_FRCM (1 << 29) /* Bit 28: Enters Free running clock mode */ -#define QSPI_CCR_DDRM (1 << 31) /* Bit 31: Double data rate mode */ - -/* Address Register */ - -/* Alternate Bytes Register */ - -/* Data Register */ - -/* Polling Status mask Register */ - -/* Polling Status match Register */ - -/* Polling Interval Register */ - -#define QSPI_PIR_INTERVAL_SHIFT (0) /* Bits 0-15: Polling interval */ -#define QSPI_PIR_INTERVAL_MASK (0xFFff << QSPI_PIR_INTERVAL_SHIFT) - -/* Low-Power Timeout Register */ - -#define QSPI_LPTR_TIMEOUT_SHIFT (0) /* Bits 0-15: Timeout period */ -#define QSPI_LPTR_TIMEOUT_MASK (0xFFff << QSPI_PIR_INTERVAL_SHIFT) - -/**************************************************************************************** - * Public Types - ****************************************************************************************/ - -/**************************************************************************************** - * Public Data - ****************************************************************************************/ - -/**************************************************************************************** - * Public Functions - ****************************************************************************************/ - -#endif /* __ARCH_ARM_SRC_STM32H7_HARDWARE_STM32H4_QSPI_H */ diff --git a/boards/spracing/h7extreme/src/i2c.cpp b/boards/spracing/h7extreme/src/i2c.cpp deleted file mode 100644 index d59c97b..0000000 --- a/boards/spracing/h7extreme/src/i2c.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusInternal(1), -}; diff --git a/boards/spracing/h7extreme/src/init.c b/boards/spracing/h7extreme/src/init.c deleted file mode 100644 index b241fb6..0000000 --- a/boards/spracing/h7extreme/src/init.c +++ /dev/null @@ -1,284 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-2020 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * Board-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialisation. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include "board_config.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "arm_internal.h" - -#include -#include -#include -#include -#include -#include -#include - -# if defined(FLASH_BASED_PARAMS) -# include -#endif - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* Configuration ************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - UNUSED(ms); -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); - } - - if (status >= 0) { - up_mdelay(6); - } -} - -/************************************************************************************ - * 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(); - - /* configure external memory*/ - flash_w25q128_init(); - -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - /* Need hrt running before using the ADC */ - - px4_platform_init(); - - /* configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "[boot] DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_RED); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - - -#ifdef CONFIG_MMCSD - int ret = stm32_sdio_initialize(); - - if (ret != OK) { - led_on(LED_RED); - } - -#endif - - up_udelay(20); - - /* W25128 external flash memory: - * 0x90030000 - 0x9003FFFF -> 64KB for FlashFS - * 0x90100000 - 0x902FFFFF -> 2MB for PX4 firmware - */ - - /* Page calculator for W25Q128: - * page = (address - 0x90000000)/0x1000 (sector size is 0x1000 (4096 bytes)) - * examples: - * 1) address = 0x90001000, page = (0x90001000 - 0x90000000)/0x1000 = 0x1 - * 2) address = 0x90200000, page = (0x90200000 - 0x90000000)/0x1000 = 0x200 - * 3) address = 0x90200000, page = (0x90200100 - 0x90000000)/0x1000 = 0x201 - * 4) address = 0x90f80000, page = (0x90f80000 - 0x90000000)/0x1000 = 0xF80 - */ - -#if defined(FLASH_BASED_PARAMS) - static sector_descriptor_t params_sector_map[] = { - {0xF80, 4096, 0x90f80000}, - {0xF81, 4096, 0x90f81000}, - {0xF82, 4096, 0x90f82000}, - {0xF83, 4096, 0x90f83000}, - {0xF84, 4096, 0x90f84000}, - {0xF85, 4096, 0x90f85000}, - {0xF86, 4096, 0x90f86000}, - {0xF87, 4096, 0x90f87000}, - {0xF88, 4096, 0x90f88000}, - {0xF89, 4096, 0x90f89000}, - {0xF8A, 4096, 0x90f8A000}, - {0xF8B, 4096, 0x90f8B000}, - {0xF8C, 4096, 0x90f8C000}, - {0xF8D, 4096, 0x90f8D000}, - {0xF8E, 4096, 0x90f8E000}, - {0xF8F, 4096, 0x90f8F000}, - {0, 0, 0}, - }; - - /* Initialize the flashfs layer to use heap allocated memory */ - int result = parameter_flashfs_init(params_sector_map, NULL, 0); - - if (result != OK) { - syslog(LOG_ERR, "[boot] FAILED to init params in FLASH %d\n", result); - led_on(LED_AMBER); - } - -#endif - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/spracing/h7extreme/src/led.c b/boards/spracing/h7extreme/src/led.c deleted file mode 100644 index d3453ae..0000000 --- a/boards/spracing/h7extreme/src/led.c +++ /dev/null @@ -1,218 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -/** - * @file px4fmu2_led.c - * - * PX4FMU LED backend. - */ - -#include - -#include - -#include "chip.h" -#include "stm32_gpio.h" -#include "board_config.h" - -#include -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -#ifdef CONFIG_ARCH_LEDS -static bool nuttx_owns_leds = true; -// B R S G -// 0 1 2 3 -static const uint8_t xlatpx4[] = {1, 2, 4, 0}; -# define xlat(p) xlatpx4[(p)] -static uint32_t g_ledmap[] = { - GPIO_nLED_RED, // Indexed by BOARD_LED_RED -}; - -#else - -# define xlat(p) (p) -static uint32_t g_ledmap[] = { - GPIO_nLED_RED // Indexed by LED_RED -}; - -#endif - -__EXPORT void led_init(void) -{ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - if (g_ledmap[l] != 0) { - stm32_configgpio(g_ledmap[l]); - } - } -} - -static void phy_set_led(int led, bool state) -{ - /* Drive Low to switch on */ - - if (g_ledmap[led] != 0) { - stm32_gpiowrite(g_ledmap[led], !state); - } -} - -static bool phy_get_led(int led) -{ - /* If Low it is on */ - if (g_ledmap[led] != 0) { - return !stm32_gpioread(g_ledmap[led]); - } - - return false; -} - -__EXPORT void led_on(int led) -{ - phy_set_led(xlat(led), true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(xlat(led), false); -} - -__EXPORT void led_toggle(int led) -{ - phy_set_led(xlat(led), !phy_get_led(xlat(led))); -} - -#ifdef CONFIG_ARCH_LEDS -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_autoled_initialize - ****************************************************************************/ - -void board_autoled_initialize(void) -{ - led_init(); -} - -/**************************************************************************** - * Name: board_autoled_on - ****************************************************************************/ - -void board_autoled_on(int led) -{ - if (!nuttx_owns_leds) { - return; - } - - switch (led) { - default: - break; - - case LED_HEAPALLOCATE: - break; - - case LED_IRQSENABLED: - break; - - case LED_STACKCREATED: - break; - - case LED_INIRQ: - break; - - case LED_SIGNAL: - break; - - case LED_ASSERTION: - phy_set_led(BOARD_LED_RED, true); - break; - - case LED_PANIC: - phy_set_led(BOARD_LED_RED, true); - break; - - case LED_IDLE : /* IDLE */ - phy_set_led(BOARD_LED_RED, true); - break; - } -} - -/**************************************************************************** - * Name: board_autoled_off - ****************************************************************************/ - -void board_autoled_off(int led) -{ - if (!nuttx_owns_leds) { - return; - } - - switch (led) { - default: - break; - - case LED_SIGNAL: - break; - - case LED_INIRQ: - break; - - case LED_ASSERTION: - phy_set_led(BOARD_LED_RED, false); - break; - - case LED_PANIC: - phy_set_led(BOARD_LED_RED, false); - break; - - case LED_IDLE : /* IDLE */ - phy_set_led(BOARD_LED_RED, false); - break; - } -} - -#endif /* CONFIG_ARCH_LEDS */ diff --git a/boards/spracing/h7extreme/src/qspi.c b/boards/spracing/h7extreme/src/qspi.c deleted file mode 100644 index 6ba3549..0000000 --- a/boards/spracing/h7extreme/src/qspi.c +++ /dev/null @@ -1,2776 +0,0 @@ -/**************************************************************************** - * arch/arm/src/stm32h7/stm32_qspi.c - * - * Copyright (C) 2016-2017, 2019 Gregory Nutt. All rights reserved. - * Author: dev@ziggurat29.com - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "arm_internal.h" -#include "arm_internal.h" -#include "barriers.h" - -#include "stm32_gpio.h" -#include "stm32_dma.h" -#include "stm32_rcc.h" -#include "hardware/stm32_qspi.h" -#include "qspi.h" - -#ifdef CONFIG_STM32H7_QUADSPI -#define QSPI_BOOT_IN_MEMORY_MAPPED_MOD - -/**************************************************************************** - * This defines exist in NuttX from 8.2.2020. - * It can be deleted once when NuttX in submodule will support it. - ****************************************************************************/ - -#define QSPICMD_IDUAL (1 << 3) /* Bit 3: Instruction on two lines */ -#define QSPICMD_IQUAD (1 << 4) /* Bit 4: Instruction on four lines */ - -#define QSPICMD_ISIDUAL(f) (((f) & QSPICMD_IDUAL) != 0) -#define QSPICMD_ISIQUAD(f) (((f) & QSPICMD_IQUAD) != 0) - -#define QSPIMEM_IDUAL (1 << 7) /* Bit 7: Instruction on two lines */ -#define QSPIMEM_IQUAD (1 << 0) /* Bit 0: Instruction on four lines */ - -#define QSPIMEM_ISIDUAL(f) (((f) & QSPIMEM_IDUAL) != 0) -#define QSPIMEM_ISIQUAD(f) (((f) & QSPIMEM_IQUAD) != 0) - -/* Non-atomic, but more effective modification of registers */ - -# undef modreg8 -# undef modreg16 -# undef modreg32 -# define modreg8(v,m,a) putreg8((getreg8(a) & ~(m)) | ((v) & (m)), a) -# define modreg16(v,m,a) putreg16((getreg16(a) & ~(m)) | ((v) & (m)), a) -# define modreg32(v,m,a) putreg32((getreg32(a) & ~(m)) | ((v) & (m)), a) - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* QSPI memory synchronization */ - -#define MEMORY_SYNC() do { ARM_DSB(); ARM_ISB(); } while (0) - -/* Ensure that the DMA buffers are word-aligned. */ - -#define ALIGN_SHIFT 2 -#define ALIGN_MASK 3 -#define ALIGN_UP(n) (((n)+ALIGN_MASK) & ~ALIGN_MASK) -#define IS_ALIGNED(n) (((uint32_t)(n) & ALIGN_MASK) == 0) - -/* Debug ********************************************************************/ - -/* Check if QSPI debug is enabled */ - -#ifndef CONFIG_DEBUG_DMA -# undef CONFIG_STM32H7_QSPI_DMADEBUG -#endif - -#define DMA_INITIAL 0 -#define DMA_AFTER_SETUP 1 -#define DMA_AFTER_START 2 -#define DMA_CALLBACK 3 -#define DMA_TIMEOUT 3 -#define DMA_END_TRANSFER 4 -#define DMA_NSAMPLES 5 - -/* Can't have both interrupt-driven QSPI and DMA QSPI */ - -#if defined(CONFIG_STM32H7_QSPI_INTERRUPTS) && defined(CONFIG_STM32H7_QSPI_DMA) -# error "Cannot enable both interrupt mode and DMA mode for QSPI" -#endif - -/* Sanity check that board.h defines requisite QSPI pinmap options for */ - -#if (!defined(GPIO_QSPI_CS) || !defined(GPIO_QSPI_IO0) || !defined(GPIO_QSPI_IO1) || \ - !defined(GPIO_QSPI_IO2) || !defined(GPIO_QSPI_IO3) || !defined(GPIO_QSPI_SCK)) -# error you must define QSPI pinmapping options for GPIO_QSPI_CS GPIO_QSPI_IO0 \ -GPIO_QSPI_IO1 GPIO_QSPI_IO2 GPIO_QSPI_IO3 GPIO_QSPI_SCK in your board.h -#endif - -#ifdef CONFIG_STM32H7_QSPI_DMA - -# ifdef DMAMAP_QUADSPI - -/* QSPI DMA Channel/Stream selection. There - * are multiple DMA stream options that must be dis-ambiguated in the board.h - * file. - */ - -# define DMACHAN_QUADSPI DMAMAP_QUADSPI -# endif - -# if defined(CONFIG_STM32H7_QSPI_DMAPRIORITY_LOW) -# define QSPI_DMA_PRIO DMA_SCR_PRILO -# elif defined(CONFIG_STM32H7_QSPI_DMAPRIORITY_MEDIUM) -# define QSPI_DMA_PRIO DMA_SCR_PRIMED -# elif defined(CONFIG_STM32H7_QSPI_DMAPRIORITY_HIGH) -# define QSPI_DMA_PRIO DMA_SCR_PRIHI -# elif defined(CONFIG_STM32H7_QSPI_DMAPRIORITY_VERYHIGH) -# define QSPI_DMA_PRIO DMA_SCR_PRIVERYHI -# else -# define QSPI_DMA_PRIO DMA_SCR_PRIMED -# endif - -#endif /* CONFIG_STM32H7_QSPI_DMA */ - -#ifndef STM32_SYSCLK_FREQUENCY -# error your board.h needs to define the value of STM32_SYSCLK_FREQUENCY -#endif - -#if !defined(CONFIG_STM32H7_QSPI_FLASH_SIZE) || 0 == CONFIG_STM32H7_QSPI_FLASH_SIZE -# error you must specify a positive flash size via CONFIG_STM32H7_QSPI_FLASH_SIZE -#endif - -/* DMA timeout. The value is not critical; we just don't want the system to - * hang in the event that a DMA does not finish. - */ - -#define DMA_TIMEOUT_MS (800) -#define DMA_TIMEOUT_TICKS MSEC2TICK(DMA_TIMEOUT_MS) - -/* Clocking *****************************************************************/ - -/* The board.h file may choose a different clock source for QUADSPI - * peripherial by defining the BOARD_QSPI_CLK macro to one of the - * RCC_D1CCIPR_QSPISEL_XXX values (XXX = HCLK, PLL1, PLL2, PER). - * QUADSPI clock defaults to HCLK. - */ - -#ifndef BOARD_QSPI_CLK -/* Clock QUADSPI from HCLK by default */ - -# define BOARD_QSPI_CLK RCC_D1CCIPR_QSPISEL_HCLK -#endif - -/* The QSPI bit rate clock is generated by dividing the peripheral clock by - * a value between 1 and 255. - * - * Find out the frequency of the QSPI clock. - */ - -#if BOARD_QSPI_CLK == RCC_D1CCIPR_QSPISEL_HCLK -# define QSPI_CLK_FREQUENCY STM32_HCLK_FREQUENCY -#elif BOARD_QSPI_CLK == RCC_D1CCIPR_QSPISEL_PLL1 -# define QSPI_CLK_FREQUENCY STM32_PLL1Q_FREQUENCY -#elif BOARD_QSPI_CLK == RCC_D1CCIPR_QSPISEL_PLL2 -# define QSPI_CLK_FREQUENCY STM32_PLL2R_FREQUENCY -#elif BOARD_QSPI_CLK == RCC_D1CCIPR_QSPISEL_PER -# define QSPI_CLK_FREQUENCY STM32_PER_FREQUENCY -#else -# error "BOARD_QSPI_CLK has unknown value!" -#endif - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/* The state of the QSPI controller. - * - * NOTE: the STM32H7 supports only a single QSPI peripheral. Logic here is - * designed to support multiple QSPI peripherals. - */ - -struct stm32h7_qspidev_s { - struct qspi_dev_s qspi; /* Externally visible part of the QSPI interface */ - uint32_t base; /* QSPI controller register base address */ - uint32_t frequency; /* Requested clock frequency */ - uint32_t actual; /* Actual clock frequency */ - uint8_t mode; /* Mode 0,3 */ - uint8_t nbits; /* Width of word in bits (8 to 32) */ - uint8_t intf; /* QSPI controller number (0) */ - bool initialized; /* TRUE: Controller has been initialized */ - sem_t exclsem; /* Assures mutually exclusive access to QSPI */ - bool memmap; /* TRUE: Controller is in memory mapped mode */ - -#ifdef CONFIG_STM32H7_QSPI_INTERRUPTS - xcpt_t handler; /* Interrupt handler */ - uint8_t irq; /* Interrupt number */ - sem_t op_sem; /* Block until complete */ - struct qspi_xctnspec_s *xctn; /* context of transaction in progress */ -#endif - -#ifdef CONFIG_STM32H7_QSPI_DMA - bool candma; /* DMA is supported */ - sem_t dmawait; /* Used to wait for DMA completion */ - int result; /* DMA result */ - DMA_HANDLE dmach; /* QSPI DMA handle */ - WDOG_ID dmadog; /* Watchdog that handles DMA timeouts */ -#endif - - /* Debug stuff */ - -#ifdef CONFIG_STM32H7_QSPI_DMADEBUG - struct stm32h7_dmaregs_s dmaregs[DMA_NSAMPLES]; -#endif - -#ifdef CONFIG_STM32H7_QSPI_REGDEBUG - bool wrlast; /* Last was a write */ - uint32_t addresslast; /* Last address */ - uint32_t valuelast; /* Last value */ - int ntimes; /* Number of times */ -#endif -}; - -/* The QSPI transaction specification - * - * This is mostly the values of the CCR and DLR, AR, ABR, broken out into a C - * structure since these fields need to be considered at various phases of - * thee transaction processing activity. - */ - -struct qspi_xctnspec_s { - uint8_t instrmode; /* 'instruction mode'; 0=none, 1=single, 2=dual, 3=quad */ - uint8_t instr; /* the (8-bit) Instruction (if any) */ - - uint8_t addrmode; /* 'address mode'; 0=none, 1=single, 2=dual, 3=quad */ - uint8_t addrsize; /* address size (n - 1); 0, 1, 2, 3 */ - uint32_t addr; /* the address (if any) (1 to 4 bytes as per addrsize) */ - - uint8_t altbytesmode; /* 'alt bytes mode'; 0=none, 1=single, 2=dual, 3=quad */ - uint8_t altbytessize; /* 'alt bytes' size (n - 1); 0, 1, 2, 3 */ - uint32_t altbytes; /* the 'alt bytes' (if any) */ - - uint8_t dummycycles; /* number of Dummy Cycles; 0 - 32 */ - - uint8_t datamode; /* 'data mode'; 0=none, 1=single, 2=dual, 3=quad */ - uint32_t datasize; /* number of data bytes (0xffffffff == undefined) */ - FAR void *buffer; /* Data buffer */ - - uint8_t isddr; /* true if 'double data rate' */ - uint8_t issioo; /* true if 'send instruction only once' mode */ - -#ifdef CONFIG_STM32H7_QSPI_INTERRUPTS - uint8_t function; /* functional mode; to distinguish a read or write */ - int8_t disposition; /* how it all turned out */ - uint32_t idxnow; /* index into databuffer of current byte in transfer */ -#endif -}; - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/* Helpers */ - -#ifdef CONFIG_STM32H7_QSPI_REGDEBUG -bool qspi_checkreg(struct stm32h7_qspidev_s *priv, bool wr, - uint32_t value, uint32_t address); -#else -# define qspi_checkreg(priv,wr,value,address) (false) -#endif - -inline uint32_t qspi_getreg(struct stm32h7_qspidev_s *priv, unsigned int offset); -static inline void qspi_putreg(struct stm32h7_qspidev_s *priv, uint32_t value, - unsigned int offset); - -#ifdef CONFIG_DEBUG_SPI_INFO -QUADSPI_RAMFUNC void qspi_dumpregs(struct stm32h7_qspidev_s *priv, - const char *msg); -#else -# define qspi_dumpregs(priv,msg) -#endif - -#if defined(CONFIG_DEBUG_SPI_INFO) && defined(CONFIG_DEBUG_GPIO) -QUADSPI_RAMFUNC void qspi_dumpgpioconfig(const char *msg); -#else -# define qspi_dumpgpioconfig(msg) -#endif - -/* Interrupts */ - -#ifdef CONFIG_STM32H7_QSPI_INTERRUPTS -static int qspi0_interrupt(int irq, void *context, FAR void *arg); - -#endif - -/* DMA support */ - -#ifdef CONFIG_STM32H7_QSPI_DMA - -# ifdef CONFIG_STM32H7_QSPI_DMADEBUG -# define qspi_dma_sample(s,i) stm32h7_dmasample((s)->dmach, &(s)->dmaregs[i]) -QUADSPI_RAMFUNC void qspi_dma_sampleinit(struct stm32h7_qspidev_s *priv); -QUADSPI_RAMFUNC void qspi_dma_sampledone(struct stm32h7_qspidev_s *priv); -# else -# define qspi_dma_sample(s,i) -# define qspi_dma_sampleinit(s) -# define qspi_dma_sampledone(s) -# endif - -# ifndef CONFIG_STM32H7_QSPI_DMATHRESHOLD -# define CONFIG_STM32H7_QSPI_DMATHRESHOLD 4 -# endif - -#endif - -/* Initialization */ - -#if !defined(QSPI_BOOT_IN_MEMORY_MAPPED_MOD) -QUADSPI_RAMFUNC int qspi_hw_initialize(struct stm32h7_qspidev_s *priv); -#endif - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/* QSPI0 driver operations */ - -static const struct qspi_ops_s g_qspi0ops = { .lock = qspi_lock, .setfrequency = - qspi_setfrequency, .setmode = qspi_setmode, .setbits = qspi_setbits, .command = - qspi_command, .memory = qspi_memory, .alloc = qspi_alloc, .free = qspi_free, -}; - -/* This is the overall state of the QSPI0 controller */ - -static struct stm32h7_qspidev_s g_qspi0dev = { .qspi = { .ops = &g_qspi0ops, }, - .base = STM32_QUADSPI_BASE, -#ifdef CONFIG_STM32H7_QSPI_INTERRUPTS - handler = qspi0_interrupt, - .irq = STM32_IRQ_QUADSPI, -#endif - .intf = 0, -#ifdef CONFIG_STM32H7_QSPI_DMA - .candma = true, -#endif -}; - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: qspi_checkreg - * - * Description: - * Check if the current register access is a duplicate of the preceding. - * - * Input Parameters: - * value - The value to be written - * address - The address of the register to write to - * - * Returned Value: - * true: This is the first register access of this type. - * false: This is the same as the preceding register access. - * - ****************************************************************************/ - -#ifdef CONFIG_STM32H7_QSPI_REGDEBUG -QUADSPI_RAMFUNC bool qspi_checkreg(struct stm32h7_qspidev_s *priv, bool wr, - uint32_t value, uint32_t address) -{ - if (wr == priv->wrlast && /* Same kind of access? */ - value == priv->valuelast && /* Same value? */ - address == priv->addresslast) { /* Same address? */ - /* Yes, then just keep a count of the number of times we did this. */ - - priv->ntimes++; - return false; - - } else { - /* Did we do the previous operation more than once? */ - - if (priv->ntimes > 0) { - /* Yes... show how many times we did it */ - - spiinfo("...[Repeats %d times]...\n", priv->ntimes); - } - - /* Save information about the new access */ - - priv->wrlast = wr; - priv->valuelast = value; - priv->addresslast = address; - priv->ntimes = 0; - } - - /* Return true if this is the first time that we have done this operation */ - - return true; -} -#endif - -/**************************************************************************** - * Name: qspi_getreg - * - * Description: - * Read an QSPI register - * - ****************************************************************************/ - -inline uint32_t qspi_getreg(struct stm32h7_qspidev_s *priv, unsigned int offset) -{ - uint32_t address = priv->base + offset; - uint32_t value = getreg32(address); - -#ifdef CONFIG_STM32H7_QSPI_REGDEBUG - - if (qspi_checkreg(priv, false, value, address)) { - spiinfo("%08" PRIx32 "->%08" PRIx32 "\n", address, value); - } - -#endif - - return value; -} - -/**************************************************************************** - * Name: qspi_putreg - * - * Description: - * Write a value to an QSPI register - * - ****************************************************************************/ - -static inline void qspi_putreg(struct stm32h7_qspidev_s *priv, uint32_t value, - unsigned int offset) -{ - uint32_t address = priv->base + offset; - -#ifdef CONFIG_STM32H7_QSPI_REGDEBUG - - if (qspi_checkreg(priv, true, value, address)) { - spiinfo("%08" PRIx32 "<-%08" PRIx32 "\n", address, value); - } - -#endif - - putreg32(value, address); -} - -/**************************************************************************** - * Name: qspi_dumpregs - * - * Description: - * Dump the contents of all QSPI registers - * - * Input Parameters: - * priv - The QSPI controller to dump - * msg - Message to print before the register data - * - * Returned Value: - * None - * - ****************************************************************************/ - -#ifdef CONFIG_DEBUG_SPI_INFO -QUADSPI_RAMFUNC void qspi_dumpregs(struct stm32h7_qspidev_s *priv, const char *msg) -{ - uint32_t regval; - spiinfo("%s:\n", msg); - -#if 0 - /* this extra verbose output may be helpful in some cases; you'll need - * to make sure your syslog is large enough to accommodate extra output. - */ - - regval = getreg32(priv->base + STM32_QUADSPI_CR_OFFSET); /* Control Register */ - spiinfo("CR:%08" PRIx32 "\n", regval); - spiinfo(" EN:%1d ABORT:%1d DMAEN:%1d TCEN:%1d SSHIFT:%1d\n" - " FTHRES: %d\n" - " TEIE:%1d TCIE:%1d FTIE:%1d SMIE:%1d TOIE:%1d APMS:%1d PMM:%1d\n" - " PRESCALER: %" PRId32 "\n", - (regval & QSPI_CR_EN) ? 1 : 0, - (regval & QSPI_CR_ABORT) ? 1 : 0, - (regval & QSPI_CR_DMAEN) ? 1 : 0, - (regval & QSPI_CR_TCEN) ? 1 : 0, - (regval & QSPI_CR_SSHIFT) ? 1 : 0, - (regval & QSPI_CR_FTHRES_MASK) >> QSPI_CR_FTHRES_SHIFT, - (regval & QSPI_CR_TEIE) ? 1 : 0, - (regval & QSPI_CR_TCIE) ? 1 : 0, - (regval & QSPI_CR_FTIE) ? 1 : 0, - (regval & QSPI_CR_SMIE) ? 1 : 0, - (regval & QSPI_CR_TOIE) ? 1 : 0, - (regval & QSPI_CR_APMS) ? 1 : 0, - (regval & QSPI_CR_PMM) ? 1 : 0, - (regval & QSPI_CR_PRESCALER_MASK) >> QSPI_CR_PRESCALER_SHIFT); - - regval = getreg32(priv->base + STM32_QUADSPI_DCR_OFFSET); /* Device Configuration Register */ - spiinfo("DCR:%08" PRIx32 "\n", regval); - spiinfo(" CKMODE:%1d CSHT:%" PRId32 " FSIZE:%" PRId32 "\n", - (regval & QSPI_DCR_CKMODE) ? 1 : 0, - (regval & QSPI_DCR_CSHT_MASK) >> QSPI_DCR_CSHT_SHIFT, - (regval & QSPI_DCR_FSIZE_MASK) >> QSPI_DCR_FSIZE_SHIFT); - - regval = getreg32(priv->base + STM32_QUADSPI_CCR_OFFSET); /* Communication Configuration Register */ - spiinfo("CCR:%08" PRIx32 "\n", regval); - spiinfo(" INST:%02" PRId32 " IMODE:%" PRId32 " ADMODE:%" PRId32 " ADSIZE:%" PRId32 " ABMODE:%" PRId32 "\n" - " ABSIZE:%" PRId32 " DCYC:%" PRId32 " DMODE:%" PRId32 " FMODE:%" PRId32 "\n" - " SIOO:%1d DDRM:%1d\n", - (regval & QSPI_CCR_INSTRUCTION_MASK) >> QSPI_CCR_INSTRUCTION_SHIFT, - (regval & QSPI_CCR_IMODE_MASK) >> QSPI_CCR_IMODE_SHIFT, - (regval & QSPI_CCR_ADMODE_MASK) >> QSPI_CCR_ADMODE_SHIFT, - (regval & QSPI_CCR_ADSIZE_MASK) >> QSPI_CCR_ABSIZE_SHIFT, - (regval & QSPI_CCR_ABMODE_MASK) >> QSPI_CCR_ABMODE_SHIFT, - (regval & QSPI_CCR_ABSIZE_MASK) >> QSPI_CCR_ABSIZE_SHIFT, - (regval & QSPI_CCR_DCYC_MASK) >> QSPI_CCR_DCYC_SHIFT, - (regval & QSPI_CCR_DMODE_MASK) >> QSPI_CCR_DMODE_SHIFT, - (regval & QSPI_CCR_FMODE_MASK) >> QSPI_CCR_FMODE_SHIFT, - (regval & QSPI_CCR_SIOO) ? 1 : 0, - (regval & QSPI_CCR_DDRM) ? 1 : 0); - - regval = getreg32(priv->base + STM32_QUADSPI_SR_OFFSET); /* Status Register */ - spiinfo("SR:%08" PRIx32 "\n", regval); - spiinfo(" TEF:%1d TCF:%1d FTF:%1d SMF:%1d TOF:%1d BUSY:%1d FLEVEL:%" PRId32 "\n", - (regval & QSPI_SR_TEF) ? 1 : 0, - (regval & QSPI_SR_TCF) ? 1 : 0, - (regval & QSPI_SR_FTF) ? 1 : 0, - (regval & QSPI_SR_SMF) ? 1 : 0, - (regval & QSPI_SR_TOF) ? 1 : 0, - (regval & QSPI_SR_BUSY) ? 1 : 0, - (regval & QSPI_SR_FLEVEL_MASK) >> QSPI_SR_FLEVEL_SHIFT); - -#else - spiinfo(" CR:%08" PRIx32 " DCR:%08" PRIx32 " CCR:%08" PRIx32 " SR:%08" PRIx32 "\n", - getreg32(priv->base + STM32_QUADSPI_CR_OFFSET), /* Control Register */ - getreg32(priv->base + STM32_QUADSPI_DCR_OFFSET), /* Device Configuration Register */ - getreg32(priv->base + STM32_QUADSPI_CCR_OFFSET), /* Communication Configuration Register */ - getreg32(priv->base + STM32_QUADSPI_SR_OFFSET)); /* Status Register */ - spiinfo(" DLR:%08" PRIx32 " ABR:%08" PRIx32 " PSMKR:%08" PRIx32 " PSMAR:%08" PRIx32 "\n", - getreg32(priv->base + STM32_QUADSPI_DLR_OFFSET), /* Data Length Register */ - getreg32(priv->base + STM32_QUADSPI_ABR_OFFSET), /* Alternate Bytes Register */ - getreg32(priv->base + STM32_QUADSPI_PSMKR_OFFSET), /* Polling Status mask Register */ - getreg32(priv->base + STM32_QUADSPI_PSMAR_OFFSET)); /* Polling Status match Register */ - spiinfo(" PIR:%08" PRIx32 " LPTR:%08" PRIx32 "\n", - getreg32(priv->base + STM32_QUADSPI_PIR_OFFSET), /* Polling Interval Register */ - getreg32(priv->base + STM32_QUADSPI_LPTR_OFFSET)); /* Low-Power Timeout Register */ - (void)regval; -#endif -} -#endif - -#if defined(CONFIG_DEBUG_SPI_INFO) && defined(CONFIG_DEBUG_GPIO) -QUADSPI_RAMFUNC void qspi_dumpgpioconfig(const char *msg) -{ - uint32_t regval; - spiinfo("%s:\n", msg); - - /* Port B */ - - regval = getreg32(STM32_GPIOB_MODER); - spiinfo("B_MODER:%" PRIx32 "\n", regval); - - regval = getreg32(STM32_GPIOB_OTYPER); - spiinfo("B_OTYPER:%" PRIx32 "\n", regval); - - regval = getreg32(STM32_GPIOB_OSPEED); - spiinfo("B_OSPEED:%" PRIx32 "\n", regval); - - regval = getreg32(STM32_GPIOB_PUPDR); - spiinfo("B_PUPDR:%" PRIx32 "\n", regval); - - regval = getreg32(STM32_GPIOB_AFRL); - spiinfo("B_AFRL:%" PRIx32 "\n", regval); - - regval = getreg32(STM32_GPIOB_AFRH); - spiinfo("B_AFRH:%" PRIx32 "\n", regval); - - /* Port D */ - - regval = getreg32(STM32_GPIOD_MODER); - spiinfo("D_MODER:%" PRIx32 "\n", regval); - - regval = getreg32(STM32_GPIOD_OTYPER); - spiinfo("D_OTYPER:%" PRIx32 "\n", regval); - - regval = getreg32(STM32_GPIOD_OSPEED); - spiinfo("D_OSPEED:%" PRIx32 "\n", regval); - - regval = getreg32(STM32_GPIOD_PUPDR); - spiinfo("D_PUPDR:%" PRIx32 "\n", regval); - - regval = getreg32(STM32_GPIOD_AFRL); - spiinfo("D_AFRL:%" PRIx32 "\n", regval); - - regval = getreg32(STM32_GPIOD_AFRH); - spiinfo("D_AFRH:%" PRIx32 "\n", regval); - - /* Port E */ - - regval = getreg32(STM32_GPIOE_MODER); - spiinfo("E_MODER:%" PRIx32 "\n", regval); - - regval = getreg32(STM32_GPIOE_OTYPER); - spiinfo("E_OTYPER:%" PRIx32 "\n", regval); - - regval = getreg32(STM32_GPIOE_OSPEED); - spiinfo("E_OSPEED:%" PRIx32 "\n", regval); - - regval = getreg32(STM32_GPIOE_PUPDR); - spiinfo("E_PUPDR:%" PRIx32 "\n", regval); - - regval = getreg32(STM32_GPIOE_AFRL); - spiinfo("E_AFRL:%" PRIx32 "\n", regval); - - regval = getreg32(STM32_GPIOE_AFRH); - spiinfo("E_AFRH:%" PRIx32 "\n", regval); -} -#endif - -#ifdef CONFIG_STM32H7_QSPI_DMADEBUG -/**************************************************************************** - * Name: qspi_dma_sampleinit - * - * Description: - * Initialize sampling of DMA registers - * - * Input Parameters: - * priv - QSPI driver instance - * - * Returned Value: - * None - * - ****************************************************************************/ - -QUADSPI_RAMFUNC void qspi_dma_sampleinit(struct stm32h7_qspidev_s *priv) -{ - /* Put contents of register samples into a known state */ - - memset(priv->dmaregs, 0xff, - DMA_NSAMPLES * sizeof(struct stm32h7_dmaregs_s)); - - /* Then get the initial samples */ - - stm32h7_dmasample(priv->dmach, &priv->dmaregs[DMA_INITIAL]); -} - -/**************************************************************************** - * Name: qspi_dma_sampledone - * - * Description: - * Dump sampled DMA registers - * - * Input Parameters: - * priv - QSPI driver instance - * - * Returned Value: - * None - * - ****************************************************************************/ - -QUADSPI_RAMFUNC void qspi_dma_sampledone(struct stm32h7_qspidev_s *priv) -{ - /* Sample the final registers */ - - stm32h7_dmasample(priv->dmach, &priv->dmaregs[DMA_END_TRANSFER]); - - /* Then dump the sampled DMA registers */ - - /* Initial register values */ - - stm32h7_dmadump(priv->dmach, &priv->dmaregs[DMA_INITIAL], - "Initial Registers"); - - /* Register values after DMA setup */ - - stm32h7_dmadump(priv->dmach, &priv->dmaregs[DMA_AFTER_SETUP], - "After DMA Setup"); - - /* Register values after DMA start */ - - stm32h7_dmadump(priv->dmach, &priv->dmaregs[DMA_AFTER_START], - "After DMA Start"); - - /* Register values at the time of the TX and RX DMA callbacks - * -OR- DMA timeout. - * - * If the DMA timed out, then there will not be any RX DMA - * callback samples. There is probably no TX DMA callback - * samples either, but we don't know for sure. - */ - - if (priv->result == -ETIMEDOUT) { - stm32h7_dmadump(priv->dmach, &priv->dmaregs[DMA_TIMEOUT], - "At DMA timeout"); - - } else { - stm32h7_dmadump(priv->dmach, &priv->dmaregs[DMA_CALLBACK], - "At DMA callback"); - } - - stm32h7_dmadump(priv->dmach, &priv->dmaregs[DMA_END_TRANSFER], - "At End-of-Transfer"); -} -#endif - -/**************************************************************************** - * Name: qspi_setupxctnfromcmd - * - * Description: - * Setup our transaction descriptor from a command info structure - * - * Input Parameters: - * xctn - the transaction descriptor we setup - * cmdinfo - the command info (originating from the MTD device) - * - * Returned Value: - * OK, or -errno if invalid - * - ****************************************************************************/ - -QUADSPI_RAMFUNC int qspi_setupxctnfromcmd(struct qspi_xctnspec_s *xctn, - const struct qspi_cmdinfo_s *cmdinfo) -{ - DEBUGASSERT(xctn != NULL && cmdinfo != NULL); - -#ifdef CONFIG_DEBUG_SPI_INFO - spiinfo("Transfer:\n"); - spiinfo(" flags: %02" PRIx8 "\n", cmdinfo->flags); - spiinfo(" cmd: %04" PRIx16 "\n", cmdinfo->cmd); - - if (QSPICMD_ISADDRESS(cmdinfo->flags)) { - spiinfo(" address/length: %08" PRIx32 "/%" PRId8 "\n", - cmdinfo->addr, cmdinfo->addrlen); - } - - if (QSPICMD_ISDATA(cmdinfo->flags)) { - spiinfo(" %s Data:\n", - QSPICMD_ISWRITE(cmdinfo->flags) ? "Write" : "Read"); - spiinfo(" buffer/length: %p/%" PRId16 "\n", - cmdinfo->buffer, cmdinfo->buflen); - } - -#endif - - DEBUGASSERT(cmdinfo->cmd < 256); - - /* Specify the instruction as per command info */ - - /* XXX III instruction mode, single dual quad option bits */ - - if (QSPICMD_ISIQUAD(cmdinfo->flags)) { - xctn->instrmode = CCR_IMODE_QUAD; - - } else if (QSPICMD_ISIDUAL(cmdinfo->flags)) { - xctn->instrmode = CCR_IMODE_DUAL; - - } else { - xctn->instrmode = CCR_IMODE_SINGLE; - } - - xctn->instr = cmdinfo->cmd; - - /* XXX III option bits for 'send instruction only once' */ - - xctn->issioo = 0; - - /* XXX III options for alt bytes, dummy cycles */ - - xctn->altbytesmode = CCR_ABMODE_NONE; - xctn->altbytessize = CCR_ABSIZE_8; - xctn->altbytes = 0; - xctn->dummycycles = 0; - - /* Specify the address size as needed */ - - if (QSPICMD_ISADDRESS(cmdinfo->flags)) { - /* XXX III address mode mode, single, dual, quad option bits */ - - xctn->addrmode = CCR_ADMODE_SINGLE; - - if (cmdinfo->addrlen == 1) { - xctn->addrsize = CCR_ADSIZE_8; - - } else if (cmdinfo->addrlen == 2) { - xctn->addrsize = CCR_ADSIZE_16; - - } else if (cmdinfo->addrlen == 3) { - xctn->addrsize = CCR_ADSIZE_24; - - } else if (cmdinfo->addrlen == 4) { - xctn->addrsize = CCR_ADSIZE_32; - - } else { - return -EINVAL; - } - - xctn->addr = cmdinfo->addr; - - } else { - xctn->addrmode = CCR_ADMODE_NONE; - xctn->addrsize = 0; - xctn->addr = cmdinfo->addr; - } - - /* Specify the data as needed */ - - xctn->buffer = cmdinfo->buffer; - - if (QSPICMD_ISDATA(cmdinfo->flags)) { - /* XXX III data mode mode, single, dual, quad option bits */ - - xctn->datamode = CCR_DMODE_SINGLE; - xctn->datasize = cmdinfo->buflen; - - /* XXX III double data rate option bits */ - - xctn->isddr = 0; - - } else { - xctn->datamode = CCR_DMODE_NONE; - xctn->datasize = 0; - xctn->isddr = 0; - } - -#if defined(CONFIG_STM32H7_QSPI_INTERRUPTS) - xctn->function = QSPICMD_ISWRITE(cmdinfo->flags) ? CCR_FMODE_INDWR : - CCR_FMODE_INDRD; - xctn->disposition = - EIO; - xctn->idxnow = 0; -#endif - - return OK; -} - -/**************************************************************************** - * Name: qspi_setupxctnfrommem - * - * Description: - * Setup our transaction descriptor from a memory info structure - * - * Input Parameters: - * xctn - the transaction descriptor we setup - * meminfo - the memory info (originating from the MTD device) - * - * Returned Value: - * OK, or -errno if invalid - * - ****************************************************************************/ - -QUADSPI_RAMFUNC int qspi_setupxctnfrommem(struct qspi_xctnspec_s *xctn, - const struct qspi_meminfo_s *meminfo) -{ - DEBUGASSERT(xctn != NULL && meminfo != NULL); - -#ifdef CONFIG_DEBUG_SPI_INFO - spiinfo("Transfer:\n"); - spiinfo(" flags: %02" PRIx32 "\n", meminfo->flags); - spiinfo(" cmd: %04" PRIx16 "\n", meminfo->cmd); - spiinfo(" address/length: %08" PRIx32 "/%" PRId8 "\n", - meminfo->addr, meminfo->addrlen); - spiinfo(" %s Data:\n", QSPIMEM_ISWRITE(meminfo->flags) ? - "Write" : "Read"); - spiinfo(" buffer/length: %p/%" PRId32 "\n", meminfo->buffer, meminfo->buflen); -#endif - - DEBUGASSERT(meminfo->cmd < 256); - - /* Specify the instruction as per command info */ - - /* XXX III instruction mode, single dual quad option bits */ - - if (QSPIMEM_ISIQUAD(meminfo->flags)) { - xctn->instrmode = CCR_IMODE_QUAD; - - } else if (QSPIMEM_ISIDUAL(meminfo->flags)) { - xctn->instrmode = CCR_IMODE_DUAL; - - } else { - xctn->instrmode = CCR_IMODE_SINGLE; - } - - xctn->instr = meminfo->cmd; - - /* XXX III option bits for 'send instruction only once' */ - - xctn->issioo = 0; - - /* XXX III options for alt bytes */ - - xctn->altbytesmode = CCR_ABMODE_NONE; - xctn->altbytessize = CCR_ABSIZE_8; - xctn->altbytes = 0; - - xctn->dummycycles = meminfo->dummies; - - /* Specify the address size as needed */ - - /* XXX III there should be a separate flags for single/dual/quad for each - * of i,a,d - */ - - if (QSPIMEM_ISDUALIO(meminfo->flags)) { - xctn->addrmode = CCR_ADMODE_DUAL; - - } else if (QSPIMEM_ISQUADIO(meminfo->flags)) { - xctn->addrmode = CCR_ADMODE_QUAD; - - } else { - xctn->addrmode = CCR_ADMODE_SINGLE; - } - - if (meminfo->addrlen == 1) { - xctn->addrsize = CCR_ADSIZE_8; - - } else if (meminfo->addrlen == 2) { - xctn->addrsize = CCR_ADSIZE_16; - - } else if (meminfo->addrlen == 3) { - xctn->addrsize = CCR_ADSIZE_24; - - } else if (meminfo->addrlen == 4) { - xctn->addrsize = CCR_ADSIZE_32; - - } else { - return -EINVAL; - } - - xctn->addr = meminfo->addr; - - /* Specify the data as needed */ - - xctn->buffer = meminfo->buffer; - - /* XXX III there should be a separate flags for single/dual/quad for each - * of i,a,d - */ - - if (QSPIMEM_ISDUALIO(meminfo->flags)) { - xctn->datamode = CCR_DMODE_DUAL; - - } else if (QSPIMEM_ISQUADIO(meminfo->flags)) { - xctn->datamode = CCR_DMODE_QUAD; - - } else { - xctn->datamode = CCR_DMODE_SINGLE; - } - - xctn->datasize = meminfo->buflen; - - /* XXX III double data rate option bits */ - - xctn->isddr = 0; - -#if defined(CONFIG_STM32H7_QSPI_INTERRUPTS) - xctn->function = QSPIMEM_ISWRITE(meminfo->flags) ? CCR_FMODE_INDWR : - CCR_FMODE_INDRD; - xctn->disposition = - EIO; - xctn->idxnow = 0; -#endif - - return OK; -} - -/**************************************************************************** - * Name: qspi_waitstatusflags - * - * Description: - * Spin wait for specified status flags to be set as desired - * - * Input Parameters: - * priv - The QSPI controller to dump - * mask - bits to check, can be multiple - * polarity - true wait if any set, false to wait if all reset - * - * Returned Value: - * None - * - ****************************************************************************/ - -QUADSPI_RAMFUNC static void qspi_waitstatusflags(struct stm32h7_qspidev_s *priv, - uint32_t mask, int polarity) -{ - uint32_t regval; - - if (polarity) { - while (!((regval = qspi_getreg(priv, STM32_QUADSPI_SR_OFFSET)) & mask)) - ; - - } else { - while (((regval = qspi_getreg(priv, STM32_QUADSPI_SR_OFFSET)) & mask)) - ; - } -} - -/**************************************************************************** - * Name: qspi_abort - * - * Description: - * Abort any transaction in progress - * - * Input Parameters: - * priv - The QSPI controller to dump - * - * Returned Value: - * None - * - ****************************************************************************/ - -QUADSPI_RAMFUNC static void qspi_abort(struct stm32h7_qspidev_s *priv) -{ - uint32_t regval; - - regval = qspi_getreg(priv, STM32_QUADSPI_CR_OFFSET); - regval |= QSPI_CR_ABORT; - qspi_putreg(priv, regval, STM32_QUADSPI_CR_OFFSET); -} - -/**************************************************************************** - * Name: qspi_ccrconfig - * - * Description: - * Do common Communications Configuration Register setup - * - * Input Parameters: - * priv - The QSPI controller to dump - * xctn - the transaction descriptor; CCR setup - * fctn - 'functional mode'; 0=indwrite, 1=indread, 2=autopoll, 3=memmmap - * - * Returned Value: - * None - * - ****************************************************************************/ - -QUADSPI_RAMFUNC static void qspi_ccrconfig(struct stm32h7_qspidev_s *priv, - struct qspi_xctnspec_s *xctn, uint8_t fctn) -{ - uint32_t regval; - - /* If we have data, and it's not memory mapped, write the length */ - - if (CCR_DMODE_NONE != xctn->datamode && CCR_FMODE_MEMMAP != fctn) { - qspi_putreg(priv, xctn->datasize - 1, STM32_QUADSPI_DLR_OFFSET); - } - - /* If we have alternate bytes, stick them in now */ - - if (CCR_ABMODE_NONE != xctn->altbytesmode) { - qspi_putreg(priv, xctn->altbytes, STM32_QUADSPI_ABR_OFFSET); - } - - /* Build the CCR value and set it */ - - regval = QSPI_CCR_INST(xctn->instr) | QSPI_CCR_IMODE(xctn->instrmode) - | QSPI_CCR_ADMODE(xctn->addrmode) | QSPI_CCR_ADSIZE(xctn->addrsize) - | QSPI_CCR_ABMODE(xctn->altbytesmode) | QSPI_CCR_ABSIZE(xctn->altbytessize) - | QSPI_CCR_DCYC(xctn->dummycycles) | QSPI_CCR_DMODE(xctn->datamode) - | QSPI_CCR_FMODE(fctn) | (xctn->isddr ? QSPI_CCR_SIOO : 0) - | (xctn->issioo ? QSPI_CCR_DDRM : 0); - qspi_putreg(priv, regval, STM32_QUADSPI_CCR_OFFSET); - - /* If we have and need and address, set that now, too */ - - if (CCR_ADMODE_NONE != xctn->addrmode && CCR_FMODE_MEMMAP != fctn) { - qspi_putreg(priv, xctn->addr, STM32_QUADSPI_AR_OFFSET); - } -} - -#if defined(CONFIG_STM32H7_QSPI_INTERRUPTS) -/**************************************************************************** - * Name: qspi0_interrupt - * - * Description: - * Interrupt handler; we handle all QSPI cases -- reads, writes, - * automatic status polling, etc. - * - * Input Parameters: - * irq - - * context - - * - * Returned Value: - * OK means we handled it - * - ****************************************************************************/ - -static int qspi0_interrupt(int irq, void *context, FAR void *arg) -{ - uint32_t status; - uint32_t cr; - uint32_t regval; - - /* Let's find out what is going on */ - - status = qspi_getreg(&g_qspi0dev, STM32_QUADSPI_SR_OFFSET); - cr = qspi_getreg(&g_qspi0dev, STM32_QUADSPI_CR_OFFSET); - - /* Is it 'FIFO Threshold'? */ - - if ((status & QSPI_SR_FTF) && (cr & QSPI_CR_FTIE)) { - volatile uint32_t *datareg = - (volatile uint32_t *)(g_qspi0dev.base + STM32_QUADSPI_DR_OFFSET); - - if (g_qspi0dev.xctn->function == CCR_FMODE_INDWR) { - /* Write data until we have no more or have no place to put it */ - - while (((regval = qspi_getreg( - &g_qspi0dev, STM32_QUADSPI_SR_OFFSET)) & QSPI_SR_FTF) != 0) { - if (g_qspi0dev.xctn->idxnow < g_qspi0dev.xctn->datasize) { - *(volatile uint8_t *)datareg = - ((uint8_t *)g_qspi0dev.xctn->buffer) - [g_qspi0dev.xctn->idxnow]; - ++g_qspi0dev.xctn->idxnow; - - } else { - /* Fresh out of data to write */ - - break; - } - } - - } else if (g_qspi0dev.xctn->function == CCR_FMODE_INDRD) { - /* Read data until we have no more or have no place to put it */ - - while (((regval = qspi_getreg( - &g_qspi0dev, STM32_QUADSPI_SR_OFFSET)) & QSPI_SR_FTF) != 0) { - if (g_qspi0dev.xctn->idxnow < g_qspi0dev.xctn->datasize) { - ((uint8_t *)g_qspi0dev.xctn->buffer) - [g_qspi0dev.xctn->idxnow] = *(volatile uint8_t *)datareg; - ++g_qspi0dev.xctn->idxnow; - - } else { - /* no room at the inn */ - - break; - } - } - } - } - - /* Is it 'Transfer Complete'? */ - - if ((status & QSPI_SR_TCF) && (cr & QSPI_CR_TCIE)) { - /* Acknowledge interrupt */ - - qspi_putreg(&g_qspi0dev, QSPI_FCR_CTCF, STM32_QUADSPI_FCR_OFFSET); - - /* Disable the QSPI FIFO Threshold, Transfer Error and Transfer - * complete Interrupts - */ - - regval = qspi_getreg(&g_qspi0dev, STM32_QUADSPI_CR_OFFSET); - regval &= ~(QSPI_CR_TEIE | QSPI_CR_TCIE | QSPI_CR_FTIE); - qspi_putreg(&g_qspi0dev, regval, STM32_QUADSPI_CR_OFFSET); - - /* Do the last bit of read if needed */ - - if (g_qspi0dev.xctn->function == CCR_FMODE_INDRD) { - volatile uint32_t *datareg = - (volatile uint32_t *)(g_qspi0dev.base + STM32_QUADSPI_DR_OFFSET); - - /* Read any remaining data */ - - while (((regval = qspi_getreg( - &g_qspi0dev, STM32_QUADSPI_SR_OFFSET)) & - QSPI_SR_FLEVEL_MASK) != 0) { - if (g_qspi0dev.xctn->idxnow < g_qspi0dev.xctn->datasize) { - ((uint8_t *)g_qspi0dev.xctn->buffer) - [g_qspi0dev.xctn->idxnow] = *(volatile uint8_t *)datareg; - ++g_qspi0dev.xctn->idxnow; - - } else { - /* No room at the inn */ - - break; - } - } - } - - /* Use 'abort' to ditch any stray fifo contents and clear BUSY flag */ - - qspi_abort(&g_qspi0dev); - - /* Set success status */ - - g_qspi0dev.xctn->disposition = OK; - - /* Signal complete */ - - nxsem_post(&g_qspi0dev.op_sem); - } - - /* Is it 'Status Match'? */ - - if ((status & QSPI_SR_SMF) && (cr & QSPI_CR_SMIE)) { - /* Acknowledge interrupt */ - - qspi_putreg(&g_qspi0dev, QSPI_FCR_CSMF, STM32_QUADSPI_FCR_OFFSET); - - /* If 'automatic poll mode stop' is activated, we're done */ - - if (cr & QSPI_CR_APMS) { - /* Disable the QSPI Transfer Error and Status Match Interrupts */ - - regval = qspi_getreg(&g_qspi0dev, STM32_QUADSPI_CR_OFFSET); - regval &= ~(QSPI_CR_TEIE | QSPI_CR_SMIE); - qspi_putreg(&g_qspi0dev, regval, STM32_QUADSPI_CR_OFFSET); - - /* Set success status */ - - g_qspi0dev.xctn->disposition = OK; - - /* Signal complete */ - - nxsem_post(&g_qspi0dev.op_sem); - - } else { - /* XXX if it's NOT auto stop; something needs to happen here; - * a callback? - */ - } - } - - /* Is it' Transfer Error'? :( */ - - if ((status & QSPI_SR_TEF) && (cr & QSPI_CR_TEIE)) { - /* Acknowledge interrupt */ - - qspi_putreg(&g_qspi0dev, QSPI_FCR_CTEF, STM32_QUADSPI_FCR_OFFSET); - - /* Disable all the QSPI Interrupts */ - - regval = qspi_getreg(&g_qspi0dev, STM32_QUADSPI_CR_OFFSET); - regval &= ~(QSPI_CR_TEIE | QSPI_CR_TCIE | QSPI_CR_FTIE | - QSPI_CR_SMIE | QSPI_CR_TOIE); - qspi_putreg(&g_qspi0dev, regval, STM32_QUADSPI_CR_OFFSET); - - /* Set error status; 'transfer error' means that, in 'indirect mode', - * an invalid address is attempted to be accessed. 'Invalid' is - * presumably relative to the FSIZE field in CCR; the manual is not - * explicit, but what else could it be? - */ - - g_qspi0dev.xctn->disposition = - EIO; - - /* Signal complete */ - - nxsem_post(&g_qspi0dev.op_sem); - } - - /* Is it 'Timeout'? */ - - if ((status & QSPI_SR_TOF) && (cr & QSPI_CR_TOIE)) { - /* Acknowledge interrupt */ - - qspi_putreg(&g_qspi0dev, QSPI_FCR_CTOF, STM32_QUADSPI_FCR_OFFSET); - - /* XXX this interrupt simply means that, in 'memory mapped mode', - * the QSPI memory has not been accessed for a while, and the - * IP block was configured to automatically de-assert CS after - * a timeout. And now we're being informed that has happened. - * - * But who cares? If someone does, perhaps a user callback is - * appropriate, or some signal? Either way, realize the xctn - * member is /not/ valid, so you can't set the disposition - * field. Also, note signaling completion has no meaning here - * because in memory mapped mode no one holds the semaphore. - */ - } - - return OK; -} - -#elif defined(CONFIG_STM32H7_QSPI_DMA) -/**************************************************************************** - * Name: qspi_dma_timeout - * - * Description: - * The watchdog timeout setup when a has expired without completion of a - * DMA. - * - * Input Parameters: - * argc - The number of arguments (should be 1) - * arg - The argument (state structure reference cast to uint32_t) - * - * Returned Value: - * None - * - * Assumptions: - * Always called from the interrupt level with interrupts disabled. - * - ****************************************************************************/ - -QUADSPI_RAMFUNC void qspi_dma_timeout(int argc, uint32_t arg, ...) -{ - struct stm32h7_qspidev_s *priv = (struct stm32h7_qspidev_s *)arg; - DEBUGASSERT(priv != NULL); - - /* Sample DMA registers at the time of the timeout */ - - qspi_dma_sample(priv, DMA_CALLBACK); - - /* Report timeout result, perhaps overwriting any failure reports from - * the TX callback. - */ - - priv->result = -ETIMEDOUT; - - /* Then wake up the waiting thread */ - - nxsem_post(&priv->dmawait); -} - -/**************************************************************************** - * Name: qspi_dma_callback - * - * Description: - * This callback function is invoked at the completion of the QSPI DMA. - * - * Input Parameters: - * handle - The DMA handler - * isr - source of the DMA interrupt - * arg - A pointer to the chip select structure - * - * Returned Value: - * None - * - ****************************************************************************/ - -QUADSPI_RAMFUNC void qspi_dma_callback(DMA_HANDLE handle, uint8_t isr, void *arg) -{ - struct stm32h7_qspidev_s *priv = (struct stm32h7_qspidev_s *)arg; - DEBUGASSERT(priv != NULL); - - /* Cancel the watchdog timeout */ - - wd_cancel(priv->dmadog); - - /* Sample DMA registers at the time of the callback */ - - qspi_dma_sample(priv, DMA_CALLBACK); - - /* Report the result of the transfer only if the callback has not already - * reported an error. - */ - - if (priv->result == -EBUSY) { - /* Save the result of the transfer if no error was previously - * reported - */ - - if (isr & DMA_STREAM_TCIF_BIT) { - priv->result = OK; - - } else if (isr & DMA_STREAM_TEIF_BIT) { - priv->result = -EIO; - - } else { - priv->result = OK; - } - } - - /* Then wake up the waiting thread */ - - nxsem_post(&priv->dmawait); -} - -/**************************************************************************** - * Name: qspi_regaddr - * - * Description: - * Return the address of an QSPI register - * - ****************************************************************************/ - -static inline uintptr_t qspi_regaddr(struct stm32h7_qspidev_s *priv, - unsigned int offset) -{ - return priv->base + offset; -} - -/**************************************************************************** - * Name: qspi_memory_dma - * - * Description: - * Perform one QSPI memory transfer using DMA - * - * Input Parameters: - * priv - Device-specific state data - * meminfo - Describes the memory transfer to be performed. - * xctn - Describes the transaction context. - * - * Returned Value: - * Zero (OK) on SUCCESS, a negated errno on value of failure - * - ****************************************************************************/ - -QUADSPI_RAMFUNC int qspi_memory_dma(struct stm32h7_qspidev_s *priv, - struct qspi_meminfo_s *meminfo, - struct qspi_xctnspec_s *xctn) -{ - uint32_t dmaflags; - uint32_t regval; - int ret; - - /* Initialize register sampling */ - - qspi_dma_sampleinit(priv); - - /* Determine DMA flags and setup the DMA */ - - if (QSPIMEM_ISWRITE(meminfo->flags)) { - /* Setup the DMA (memory-to-peripheral) */ - - dmaflags = (QSPI_DMA_PRIO | DMA_SCR_MSIZE_8BITS | - DMA_SCR_PSIZE_8BITS | DMA_SCR_MINC | DMA_SCR_DIR_M2P); - - up_clean_dcache((uintptr_t)meminfo->buffer, - (uintptr_t)meminfo->buffer + meminfo->buflen); - - } else { - /* Setup the DMA (peripheral-to-memory) */ - - dmaflags = (QSPI_DMA_PRIO | DMA_SCR_MSIZE_8BITS | - DMA_SCR_PSIZE_8BITS | DMA_SCR_MINC | DMA_SCR_DIR_P2M); - } - - stm32_dmasetup(priv->dmach, qspi_regaddr(priv, STM32_QUADSPI_DR_OFFSET), - (uint32_t)meminfo->buffer, meminfo->buflen, dmaflags); - - qspi_dma_sample(priv, DMA_AFTER_SETUP); - - /* Enable the memory transfer */ - - regval = qspi_getreg(priv, STM32_QUADSPI_CR_OFFSET); - regval |= QSPI_CR_DMAEN; - qspi_putreg(priv, regval, STM32_QUADSPI_CR_OFFSET); - - /* Set up the Communications Configuration Register as per command info */ - - qspi_ccrconfig(priv, xctn, - QSPIMEM_ISWRITE(meminfo->flags) ? CCR_FMODE_INDWR : - CCR_FMODE_INDRD); - - /* Start the DMA */ - - priv->result = -EBUSY; - stm32_dmastart(priv->dmach, qspi_dma_callback, priv, false); - - qspi_dma_sample(priv, DMA_AFTER_START); - - /* Wait for DMA completion. This is done in a loop because there may be - * false alarm semaphore counts that cause nxsem_wait() not fail to wait - * or to wake-up prematurely (for example due to the receipt of a signal). - * We know that the DMA has completed when the result is anything other - * that -EBUSY. - */ - - do { - /* Start (or re-start) the watchdog timeout */ - - ret = wd_start(priv->dmadog, DMA_TIMEOUT_TICKS, - qspi_dma_timeout, 1, (uint32_t)priv); - - if (ret < 0) { - spierr("ERROR: wd_start failed: %d\n", ret); - } - - /* Wait for the DMA complete */ - - ret = nxsem_wait(&priv->dmawait); - - if (QSPIMEM_ISREAD(meminfo->flags)) { - up_invalidate_dcache((uintptr_t)meminfo->buffer, - (uintptr_t)meminfo->buffer + meminfo->buflen); - } - - /* Cancel the watchdog timeout */ - - wd_cancel(priv->dmadog); - - /* Check if we were awakened by an error of some kind */ - - if (ret < 0) { - /* EINTR is not a failure. That simply means that the wait - * was awakened by a signal. - */ - - if (ret != -EINTR) { - DEBUGPANIC(); - regval = qspi_getreg(priv, STM32_QUADSPI_CR_OFFSET); - regval &= ~QSPI_CR_DMAEN; - qspi_putreg(priv, regval, STM32_QUADSPI_CR_OFFSET); - return ret; - } - } - - /* Note that we might be awakened before the wait is over due to - * residual counts on the semaphore. So, to handle, that case, - * we loop until something changes the DMA result to any value other - * than -EBUSY. - */ - } while (priv->result == -EBUSY); - - /* Wait for Transfer complete, and not busy */ - - qspi_waitstatusflags(priv, QSPI_SR_TCF, 1); - qspi_waitstatusflags(priv, QSPI_SR_BUSY, 0); - MEMORY_SYNC(); - - /* Dump the sampled DMA registers */ - - qspi_dma_sampledone(priv); - - /* Make sure that the DMA is stopped (it will be stopped automatically - * on normal transfers, but not necessarily when the transfer terminates - * on an error condition). - */ - - stm32_dmastop(priv->dmach); - - regval = qspi_getreg(priv, STM32_QUADSPI_CR_OFFSET); - regval &= ~QSPI_CR_DMAEN; - qspi_putreg(priv, regval, STM32_QUADSPI_CR_OFFSET); - - /* Complain if the DMA fails */ - - if (priv->result) { - spierr("ERROR: DMA failed with result: %d\n", priv->result); - } - - return priv->result; -} -#endif - -#if !defined(CONFIG_STM32H7_QSPI_INTERRUPTS) -/**************************************************************************** - * Name: qspi_receive_blocking - * - * Description: - * Do common data receive in a blocking (status polling) way - * - * Input Parameters: - * priv - The QSPI controller to dump - * xctn - the transaction descriptor - * - * Returned Value: - * OK, or -errno on error - * - ****************************************************************************/ - -QUADSPI_RAMFUNC int qspi_receive_blocking(struct stm32h7_qspidev_s *priv, - struct qspi_xctnspec_s *xctn) -{ - int ret = OK; - volatile uint32_t *datareg = (volatile uint32_t *)(priv->base - + STM32_QUADSPI_DR_OFFSET); - uint8_t *dest = (uint8_t *) xctn->buffer; - uint32_t addrval; - uint32_t regval; - - addrval = qspi_getreg(priv, STM32_QUADSPI_AR_OFFSET); - - if (dest != NULL) { - /* Counter of remaining data */ - - uint32_t remaining = xctn->datasize; - - /* Ensure CCR register specifies indirect read */ - - regval = qspi_getreg(priv, STM32_QUADSPI_CCR_OFFSET); - regval &= ~QSPI_CCR_FMODE_MASK; - regval |= QSPI_CCR_FMODE(CCR_FMODE_INDRD); - qspi_putreg(priv, regval, STM32_QUADSPI_CCR_OFFSET); - - /* Start the transfer by re-writing the address in AR register */ - - qspi_putreg(priv, addrval, STM32_QUADSPI_AR_OFFSET); - - /* Transfer loop */ - - while (remaining > 0) { - /* Wait for Fifo Threshold, or Transfer Complete, to read data */ - - qspi_waitstatusflags(priv, QSPI_SR_FTF | QSPI_SR_TCF, 1); - - *dest = *(volatile uint8_t *) datareg; - dest++; - remaining--; - } - - if (ret == OK) { - /* Wait for transfer complete, then clear it */ - - qspi_waitstatusflags(priv, QSPI_SR_TCF, 1); - qspi_putreg(priv, QSPI_FCR_CTCF, STM32_QUADSPI_FCR_OFFSET); - - /* Use Abort to clear the busy flag, and ditch any extra bytes in - * fifo - */ - - qspi_abort(priv); - } - - } else { - ret = -EINVAL; - } - - return ret; -} - -/**************************************************************************** - * Name: qspi_transmit_blocking - * - * Description: - * Do common data transmit in a blocking (status polling) way - * - * Input Parameters: - * priv - The QSPI controller to dump - * xctn - the transaction descriptor - * - * Returned Value: - * OK, or -errno on error - * - ****************************************************************************/ - -QUADSPI_RAMFUNC int qspi_transmit_blocking(struct stm32h7_qspidev_s *priv, - struct qspi_xctnspec_s *xctn) -{ - int ret = OK; - volatile uint32_t *datareg = (volatile uint32_t *)(priv->base - + STM32_QUADSPI_DR_OFFSET); - uint8_t *src = (uint8_t *) xctn->buffer; - - if (src != NULL) { - /* Counter of remaining data */ - - uint32_t remaining = xctn->datasize; - - /* Transfer loop */ - - while (remaining > 0) { - /* Wait for Fifo Threshold to write data */ - - qspi_waitstatusflags(priv, QSPI_SR_FTF, 1); - - *(volatile uint8_t *) datareg = *src++; - remaining--; - } - - if (ret == OK) { - /* Wait for transfer complete, then clear it */ - - qspi_waitstatusflags(priv, QSPI_SR_TCF, 1); - qspi_putreg(priv, QSPI_FCR_CTCF, STM32_QUADSPI_FCR_OFFSET); - - /* Use Abort to clear the Busy flag */ - - qspi_abort(priv); - } - - } else { - ret = -EINVAL; - } - - return ret; -} - -#endif - -/**************************************************************************** - * Name: qspi_lock - * - * Description: - * On QSPI buses where there are multiple devices, it will be necessary to - * lock QSPI to have exclusive access to the buses for a sequence of - * transfers. The bus should be locked before the chip is selected. After - * locking the QSPI bus, the caller should then also call the setfrequency, - * setbits, and setmode methods to make sure that the QSPI is properly - * configured for the device. If the QSPI bus is being shared, then it - * may have been left in an incompatible state. - * - * Input Parameters: - * dev - Device-specific state data - * lock - true: Lock QSPI bus, false: unlock QSPI bus - * - * Returned Value: - * None - * - ****************************************************************************/ - -QUADSPI_RAMFUNC int qspi_lock(struct qspi_dev_s *dev, bool lock) -{ -#if 0 //semaphore can't work as ramfunc - struct stm32h7_qspidev_s *priv = (struct stm32h7_qspidev_s *)dev; - int ret; - - spiinfo("lock=%d\n", lock); - - if (lock) { - /* Take the semaphore (perhaps waiting) */ - - do { - ret = nxsem_wait(&priv->exclsem); - - /* The only case that an error should occur here is if the wait - * was awakened by a signal. - */ - - DEBUGASSERT(ret == OK || ret == -EINTR); - } while (ret == -EINTR); - - } else { - ret = nxsem_post(&priv->exclsem); - } - - return ret; -#endif - return 0; -} - -/**************************************************************************** - * Name: qspi_setfrequency - * - * Description: - * Set the QSPI frequency. - * - * Input Parameters: - * dev - Device-specific state data - * frequency - The QSPI frequency requested - * - * Returned Value: - * Returns the actual frequency selected - * - ****************************************************************************/ - -QUADSPI_RAMFUNC uint32_t qspi_setfrequency(struct qspi_dev_s *dev, - uint32_t frequency) -{ - struct stm32h7_qspidev_s *priv = (struct stm32h7_qspidev_s *) dev; - uint32_t actual; - uint32_t prescaler; - uint32_t regval; - - if (priv->memmap) { - /* XXX we have no better return here, but the caller will find out - * in their subsequent calls. - */ - - return 0; - } - - spiinfo("frequency=%" PRId32 "\n", frequency); - DEBUGASSERT(priv); - - /* Wait till BUSY flag reset */ - - qspi_abort(priv); - qspi_waitstatusflags(priv, QSPI_SR_BUSY, 0); - - /* Check if the requested frequency is the same as the frequency - * selection - */ - - if (priv->frequency == frequency) { - /* We are already at this frequency. Return the actual. */ - - return priv->actual; - } - - /* Configure QSPI to a frequency as close as possible to the requested - * frequency. - * - * QSCK frequency = QSPI_CLK_FREQUENCY / prescaler, or - * prescaler = QSPI_CLK_FREQUENCY / frequency - * - * Where prescaler can have the range 1 to 256 and the - * STM32_QUADSPI_CR_OFFSET register field holds prescaler - 1. - * NOTE that a "ceiling" type of calculation is performed. - * 'frequency' is treated as a not-to-exceed value. - */ - - prescaler = (frequency + QSPI_CLK_FREQUENCY - 1) / frequency; - - /* Make sure that the divider is within range */ - - if (prescaler < 1) { - prescaler = 1; - - } else if (prescaler > 256) { - prescaler = 256; - } - - /* Save the new prescaler value (minus one) */ - - regval = qspi_getreg(priv, STM32_QUADSPI_CR_OFFSET); - regval &= ~(QSPI_CR_PRESCALER_MASK); - regval |= (prescaler - 1) << QSPI_CR_PRESCALER_SHIFT; - qspi_putreg(priv, regval, STM32_QUADSPI_CR_OFFSET); - - /* Calculate the new actual frequency */ - - actual = QSPI_CLK_FREQUENCY / prescaler; - spiinfo("prescaler=%" PRId32 " actual=%" PRId32 "\n", prescaler, actual); - - /* Save the frequency setting */ - - priv->frequency = frequency; - priv->actual = actual; - - spiinfo("Frequency %" PRId32 "->%" PRId32 "\n", frequency, actual); - return actual; -} - -/**************************************************************************** - * Name: qspi_setmode - * - * Description: - * Set the QSPI mode. Optional. See enum qspi_mode_e for mode definitions. - * NOTE: the STM32H7 QSPI supports only modes 0 and 3. - * - * Input Parameters: - * dev - Device-specific state data - * mode - The QSPI mode requested - * - * Returned Value: - * none - * - ****************************************************************************/ - -QUADSPI_RAMFUNC void qspi_setmode(struct qspi_dev_s *dev, enum qspi_mode_e mode) -{ - struct stm32h7_qspidev_s *priv = (struct stm32h7_qspidev_s *) dev; - uint32_t regval; - - if (priv->memmap) { - /* XXX we have no better return here, but the caller will find out - * in their subsequent calls. - */ - - return; - } - - spiinfo("mode=%d\n", mode); - - /* Has the mode changed? */ - - if (mode != priv->mode) { - /* Yes... Set the mode appropriately: - * - * QSPI CPOL CPHA - * MODE - * 0 0 0 - * 1 0 1 - * 2 1 0 - * 3 1 1 - */ - - regval = qspi_getreg(priv, STM32_QUADSPI_DCR_OFFSET); - regval &= ~(QSPI_DCR_CKMODE); - - switch (mode) { - case QSPIDEV_MODE0: /* CPOL=0; CPHA=0 */ - break; - - case QSPIDEV_MODE3: /* CPOL=1; CPHA=1 */ - regval |= (QSPI_DCR_CKMODE); - break; - - case QSPIDEV_MODE1: /* CPOL=0; CPHA=1 */ - case QSPIDEV_MODE2: /* CPOL=1; CPHA=0 */ - spiinfo("unsupported mode=%d\n", mode); - - default: - DEBUGASSERT(FALSE); - return; - } - - qspi_putreg(priv, regval, STM32_QUADSPI_DCR_OFFSET); - spiinfo("DCR=%" PRIx32 "\n", regval); - - /* Save the mode so that subsequent re-configurations will be faster */ - - priv->mode = mode; - } -} - -/**************************************************************************** - * Name: qspi_setbits - * - * Description: - * Set the number if bits per word. - * NOTE: the STM32H7 QSPI only supports 8 bits, so this does nothing. - * - * Input Parameters: - * dev - Device-specific state data - * nbits - The number of bits requests - * - * Returned Value: - * none - * - ****************************************************************************/ - -QUADSPI_RAMFUNC void qspi_setbits(struct qspi_dev_s *dev, int nbits) -{ - /* Not meaningful for the STM32H7x6 */ - - if (8 != nbits) { - spiinfo("unsupported nbits=%d\n", nbits); - DEBUGASSERT(FALSE); - } -} - -/**************************************************************************** - * Name: qspi_command - * - * Description: - * Perform one QSPI data transfer - * - * Input Parameters: - * dev - Device-specific state data - * cmdinfo - Describes the command transfer to be performed. - * - * Returned Value: - * Zero (OK) on SUCCESS, a negated errno on value of failure - * - ****************************************************************************/ - -QUADSPI_RAMFUNC int qspi_command(struct qspi_dev_s *dev, - struct qspi_cmdinfo_s *cmdinfo) -{ - struct stm32h7_qspidev_s *priv = (struct stm32h7_qspidev_s *) dev; - struct qspi_xctnspec_s xctn; - int ret; - - /* Reject commands issued while in memory mapped mode, which will - * automatically cancel the memory mapping. You must exit the - * memory mapped mode first. - */ - - if (priv->memmap) { - return -EBUSY; - } - - /* Set up the transaction descriptor as per command info */ - - ret = qspi_setupxctnfromcmd(&xctn, cmdinfo); - - if (OK != ret) { - return ret; - } - - /* Prepare for transaction */ - - /* Wait 'till non-busy */ - - qspi_abort(priv); - qspi_waitstatusflags(priv, QSPI_SR_BUSY, 0); - - /* Clear flags */ - - qspi_putreg(priv, - QSPI_FCR_CTEF | QSPI_FCR_CTCF | QSPI_FCR_CSMF | QSPI_FCR_CTOF, - STM32_QUADSPI_FCR_OFFSET); - -#ifdef CONFIG_STM32H7_QSPI_INTERRUPTS - /* interrupt mode will need access to the transaction context */ - - priv->xctn = &xctn; - - if (QSPICMD_ISDATA(cmdinfo->flags)) { - DEBUGASSERT(cmdinfo->buffer != NULL && cmdinfo->buflen > 0); - DEBUGASSERT(IS_ALIGNED(cmdinfo->buffer)); - - if (QSPICMD_ISWRITE(cmdinfo->flags)) { - uint32_t regval; - - /* Set up the Communications Configuration Register as per command - * info - */ - - qspi_ccrconfig(priv, &xctn, CCR_FMODE_INDWR); - - /* Enable 'Transfer Error' 'FIFO Threshhold' and - * 'Transfer Complete' interrupts. - */ - - regval = qspi_getreg(priv, STM32_QUADSPI_CR_OFFSET); - regval |= (QSPI_CR_TEIE | QSPI_CR_FTIE | QSPI_CR_TCIE); - qspi_putreg(priv, regval, STM32_QUADSPI_CR_OFFSET); - - } else { - uint32_t regval; - uint32_t addrval; - - addrval = qspi_getreg(priv, STM32_QUADSPI_AR_OFFSET); - - /* Set up the Communications Configuration Register as per command - * info - */ - - qspi_ccrconfig(priv, &xctn, CCR_FMODE_INDRD); - - /* Start the transfer by re-writing the address in AR register */ - - qspi_putreg(priv, addrval, STM32_QUADSPI_AR_OFFSET); - - /* Enable 'Transfer Error' 'FIFO Threshhold' and - * 'Transfer Complete' interrupts - */ - - regval = qspi_getreg(priv, STM32_QUADSPI_CR_OFFSET); - regval |= (QSPI_CR_TEIE | QSPI_CR_FTIE | QSPI_CR_TCIE); - qspi_putreg(priv, regval, STM32_QUADSPI_CR_OFFSET); - } - - } else { - uint32_t regval; - - /* We have no data phase, the command will execute as soon as we emit - * the CCR - */ - - /* Enable 'Transfer Error' and 'Transfer Complete' interrupts */ - - regval = qspi_getreg(priv, STM32_QUADSPI_CR_OFFSET); - regval |= (QSPI_CR_TEIE | QSPI_CR_TCIE); - qspi_putreg(priv, regval, STM32_QUADSPI_CR_OFFSET); - - /* Set up the Communications Configuration Register as per command - * info - */ - - qspi_ccrconfig(priv, &xctn, CCR_FMODE_INDRD); - } - - /* Wait for the interrupt routine to finish it's magic */ - - nxsem_wait(&priv->op_sem); - MEMORY_SYNC(); - - /* Convey the result */ - - ret = xctn.disposition; - - /* because command transfers are so small, we're not going to use - * DMA for them, only interrupts or polling - */ - -#else - /* Polling mode */ - - /* Set up the Communications Configuration Register as per command info */ - - qspi_ccrconfig(priv, &xctn, CCR_FMODE_INDWR); - - /* That may be it, unless there is also data to transfer */ - - if (QSPICMD_ISDATA(cmdinfo->flags)) { - DEBUGASSERT(cmdinfo->buffer != NULL && cmdinfo->buflen > 0); - DEBUGASSERT(IS_ALIGNED(cmdinfo->buffer)); - - if (QSPICMD_ISWRITE(cmdinfo->flags)) { - ret = qspi_transmit_blocking(priv, &xctn); - - } else { - ret = qspi_receive_blocking(priv, &xctn); - } - - MEMORY_SYNC() - ; - - } else { - ret = OK; - } - - /* Wait for Transfer complete, and not busy - if (QSPICMD_ISDATA(cmdinfo->flags)) - { - qspi_waitstatusflags(priv, QSPI_SR_TCF, 1); - } - */ - qspi_waitstatusflags(priv, QSPI_SR_BUSY, 0); - -#endif - - return ret; -} - -/**************************************************************************** - * Name: qspi_memory - * - * Description: - * Perform one QSPI memory transfer - * - * Input Parameters: - * dev - Device-specific state data - * meminfo - Describes the memory transfer to be performed. - * - * Returned Value: - * Zero (OK) on SUCCESS, a negated errno on value of failure - * - ****************************************************************************/ - -QUADSPI_RAMFUNC int qspi_memory(struct qspi_dev_s *dev, - struct qspi_meminfo_s *meminfo) -{ - struct stm32h7_qspidev_s *priv = (struct stm32h7_qspidev_s *) dev; - struct qspi_xctnspec_s xctn; - int ret; - - /* Reject commands issued while in memory mapped mode, which will - * automatically cancel the memory mapping. You must exit the - * memory mapped mode first. - */ - - if (priv->memmap) { - return -EBUSY; - } - - /* Set up the transaction descriptor as per command info */ - - ret = qspi_setupxctnfrommem(&xctn, meminfo); - - if (OK != ret) { - return ret; - } - - /* Prepare for transaction */ - - /* Wait 'till non-busy */ - - qspi_abort(priv); - qspi_waitstatusflags(priv, QSPI_SR_BUSY, 0); - - /* Clear flags */ - - qspi_putreg(priv, - QSPI_FCR_CTEF | QSPI_FCR_CTCF | QSPI_FCR_CSMF | QSPI_FCR_CTOF, - STM32_QUADSPI_FCR_OFFSET); - -#ifdef CONFIG_STM32H7_QSPI_INTERRUPTS - /* interrupt mode will need access to the transaction context */ - - priv->xctn = &xctn; - - DEBUGASSERT(meminfo->buffer != NULL && meminfo->buflen > 0); - DEBUGASSERT(IS_ALIGNED(meminfo->buffer)); - - if (QSPIMEM_ISWRITE(meminfo->flags)) { - uint32_t regval; - - /* Set up the Communications Configuration Register as per command - * info - */ - - qspi_ccrconfig(priv, &xctn, CCR_FMODE_INDWR); - - /* Enable 'Transfer Error' 'FIFO Threshhold' and 'Transfer Complete' - * interrupts - */ - - regval = qspi_getreg(priv, STM32_QUADSPI_CR_OFFSET); - regval |= (QSPI_CR_TEIE | QSPI_CR_FTIE | QSPI_CR_TCIE); - qspi_putreg(priv, regval, STM32_QUADSPI_CR_OFFSET); - - } else { - uint32_t regval; - uint32_t addrval; - - addrval = qspi_getreg(priv, STM32_QUADSPI_AR_OFFSET); - - /* Set up the Communications Configuration Register as per command - * info - */ - - qspi_ccrconfig(priv, &xctn, CCR_FMODE_INDRD); - - /* Start the transfer by re-writing the address in AR register */ - - qspi_putreg(priv, addrval, STM32_QUADSPI_AR_OFFSET); - - /* Enable 'Transfer Error' 'FIFO Threshhold' and 'Transfer Complete' - * interrupts - */ - - regval = qspi_getreg(priv, STM32_QUADSPI_CR_OFFSET); - regval |= (QSPI_CR_TEIE | QSPI_CR_FTIE | QSPI_CR_TCIE); - qspi_putreg(priv, regval, STM32_QUADSPI_CR_OFFSET); - } - - /* Wait for the interrupt routine to finish it's magic */ - - nxsem_wait(&priv->op_sem); - MEMORY_SYNC(); - - /* convey the result */ - - ret = xctn.disposition; - -#elif defined(CONFIG_STM32H7_QSPI_DMA) - /* Can we perform DMA? Should we perform DMA? */ - - if (priv->candma && - meminfo->buflen > CONFIG_STM32H7_QSPI_DMATHRESHOLD && - IS_ALIGNED((uintptr_t)meminfo->buffer) && - IS_ALIGNED(meminfo->buflen)) { - ret = qspi_memory_dma(priv, meminfo, &xctn); - - } else { - /* polling mode */ - - /* Set up the Communications Configuration Register as per command - * info - */ - - qspi_ccrconfig(priv, &xctn, - QSPIMEM_ISWRITE(meminfo->flags) ? CCR_FMODE_INDWR : - CCR_FMODE_INDRD); - - /* Transfer data */ - - DEBUGASSERT(meminfo->buffer != NULL && meminfo->buflen > 0); - DEBUGASSERT(IS_ALIGNED(meminfo->buffer)); - - if (QSPIMEM_ISWRITE(meminfo->flags)) { - ret = qspi_transmit_blocking(priv, &xctn); - - } else { - ret = qspi_receive_blocking(priv, &xctn); - } - - /* Wait for Transfer complete, and not busy */ - - qspi_waitstatusflags(priv, QSPI_SR_TCF, 1); - qspi_waitstatusflags(priv, QSPI_SR_BUSY, 0); - - MEMORY_SYNC(); - } - -#else - /* polling mode */ - - /* Set up the Communications Configuration Register as per command info */ - - qspi_ccrconfig(priv, &xctn, - QSPIMEM_ISWRITE(meminfo->flags) ? CCR_FMODE_INDWR : - CCR_FMODE_INDRD); - - /* Transfer data */ - - DEBUGASSERT(meminfo->buffer != NULL && meminfo->buflen > 0); - DEBUGASSERT(IS_ALIGNED(meminfo->buffer)); - - if (QSPIMEM_ISWRITE(meminfo->flags)) { - ret = qspi_transmit_blocking(priv, &xctn); - - } else { - ret = qspi_receive_blocking(priv, &xctn); - } - - /* Wait for Transfer complete, and not busy */ - -//qspi_waitstatusflags(priv, QSPI_SR_TCF, 1); - qspi_waitstatusflags(priv, QSPI_SR_BUSY, 0); - - MEMORY_SYNC() - ; - -#endif - - return ret; -} - -/**************************************************************************** - * Name: qspi_alloc - * - * Description: - * Allocate a buffer suitable for DMA data transfer - * - * Input Parameters: - * dev - Device-specific state data - * buflen - Buffer length to allocate in bytes - * - * Returned Value: - * Address of the allocated memory on success; NULL is returned on any - * failure. - * - ****************************************************************************/ - -QUADSPI_RAMFUNC FAR void *qspi_alloc(FAR struct qspi_dev_s *dev, size_t buflen) -{ - /* Here we exploit the carnal knowledge the kmm_malloc() will return memory - * aligned to 64-bit addresses. The buffer length must be large enough to - * hold the rested buflen in units a 32-bits. - */ - - return kmm_malloc(ALIGN_UP(buflen)); -} - -/**************************************************************************** - * Name: QSPI_FREE - * - * Description: - * Free memory returned by QSPI_ALLOC - * - * Input Parameters: - * dev - Device-specific state data - * buffer - Buffer previously allocated via QSPI_ALLOC - * - * Returned Value: - * None. - * - ****************************************************************************/ - -QUADSPI_RAMFUNC void qspi_free(FAR struct qspi_dev_s *dev, FAR void *buffer) -{ - if (buffer) { - kmm_free(buffer); - } -} - -/**************************************************************************** - * Name: qspi_hw_initialize - * - * Description: - * Initialize the QSPI peripheral from hardware reset. - * - * Input Parameters: - * priv - Device state structure. - * - * Returned Value: - * Zero (OK) on SUCCESS, a negated errno on value of failure - * - ****************************************************************************/ - -#if !defined(QSPI_BOOT_IN_MEMORY_MAPPED_MOD) -int qspi_hw_initialize(struct stm32h7_qspidev_s *priv) -{ - uint32_t regval; - - /* Disable the QSPI; abort anything happening, disable, wait for not busy */ - - qspi_abort(priv); - - regval = 0; - regval &= ~(QSPI_CR_EN); - qspi_putreg(priv, regval, STM32_QUADSPI_CR_OFFSET); - - /* Wait till BUSY flag reset */ - - qspi_waitstatusflags(priv, QSPI_SR_BUSY, 0); - - /* Disable all interrupt sources for starters */ - - regval = qspi_getreg(priv, STM32_QUADSPI_CR_OFFSET); - regval &= ~(QSPI_CR_TEIE | QSPI_CR_TCIE | QSPI_CR_FTIE | QSPI_CR_SMIE | - QSPI_CR_TOIE | QSPI_CR_FSEL | QSPI_CR_DFM); - -#if defined(CONFIG_STM32H7_QSPI_MODE_BANK2) - regval |= QSPI_CR_FSEL; -#endif - -#if defined(CONFIG_STM32H7_QSPI_MODE_DUAL) - regval |= QSPI_CR_DFM; -#endif - - /* Configure QSPI FIFO Threshold */ - - regval &= ~(QSPI_CR_FTHRES_MASK); - regval |= ((CONFIG_STM32H7_QSPI_FIFO_THESHOLD - 1) << - QSPI_CR_FTHRES_SHIFT); - qspi_putreg(priv, regval, STM32_QUADSPI_CR_OFFSET); - - /* Wait till BUSY flag reset */ - - qspi_waitstatusflags(priv, QSPI_SR_BUSY, 0); - - /* Configure QSPI Clock Prescaler and Sample Shift */ - - regval = qspi_getreg(priv, STM32_QUADSPI_CR_OFFSET); - regval &= ~(QSPI_CR_PRESCALER_MASK | QSPI_CR_SSHIFT); - regval |= (0x01 << QSPI_CR_PRESCALER_SHIFT); - regval |= (0x00); - qspi_putreg(priv, regval, STM32_QUADSPI_CR_OFFSET); - - /* Configure QSPI Flash Size, CS High Time and Clock Mode */ - - regval = qspi_getreg(priv, STM32_QUADSPI_DCR_OFFSET); - regval &= ~(QSPI_DCR_CKMODE | QSPI_DCR_CSHT_MASK | QSPI_DCR_FSIZE_MASK); - regval |= (0x00); - regval |= ((CONFIG_STM32H7_QSPI_CSHT - 1) << QSPI_DCR_CSHT_SHIFT); - - if (0 != CONFIG_STM32H7_QSPI_FLASH_SIZE) { - unsigned int nsize = CONFIG_STM32H7_QSPI_FLASH_SIZE; - int nlog2size = 31; - - while ((nsize & 0x80000000) == 0) { - --nlog2size; - nsize <<= 1; - } - - regval |= ((nlog2size - 1) << QSPI_DCR_FSIZE_SHIFT); - } - - qspi_putreg(priv, regval, STM32_QUADSPI_DCR_OFFSET); - - /* Enable QSPI */ - - regval = qspi_getreg(priv, STM32_QUADSPI_CR_OFFSET); - regval |= QSPI_CR_EN; - qspi_putreg(priv, regval, STM32_QUADSPI_CR_OFFSET); - - /* Wait till BUSY flag reset */ - - qspi_waitstatusflags(priv, QSPI_SR_BUSY, 0); - - qspi_dumpregs(priv, "After initialization"); - qspi_dumpgpioconfig("GPIO"); - - return OK; -} -#endif //!defined(QSPI_BOOT_IN_MEMORY_MAPPED_MOD) - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32h7_qspi_initialize - * - * Description: - * Initialize the selected QSPI port in master mode - * - * Input Parameters: - * intf - Interface number(must be zero) - * - * Returned Value: - * Valid QSPI device structure reference on success; a NULL on failure - * - ****************************************************************************/ - -struct qspi_dev_s *stm32h7_qspi_initialize(int intf) -{ - struct stm32h7_qspidev_s *priv; - -#if !defined(QSPI_BOOT_IN_MEMORY_MAPPED_MOD) - uint32_t regval; - int ret; -#endif - - /* The STM32H7 has only a single QSPI port */ - - spiinfo("intf: %d\n", intf); - DEBUGASSERT(intf == 0); - - /* Select the QSPI interface */ - - if (intf == 0) { - /* If this function is called multiple times, the following operations - * will be performed multiple times. - */ - - /* Select QSPI0 */ - - priv = &g_qspi0dev; - -#if !defined(QSPI_BOOT_IN_MEMORY_MAPPED_MOD) - /* Select QSPI clock source */ - - modreg32(BOARD_QSPI_CLK, RCC_D1CCIPR_QSPISEL_MASK, STM32_RCC_D1CCIPR); - - /* Enable clocking to the QSPI peripheral */ - - regval = getreg32(STM32_RCC_AHB3ENR); - regval |= RCC_AHB3ENR_QSPIEN; - putreg32(regval, STM32_RCC_AHB3ENR); - - /* Reset the QSPI peripheral */ - - regval = getreg32(STM32_RCC_AHB3RSTR); - regval |= RCC_AHB3RSTR_QSPIRST; - putreg32(regval, STM32_RCC_AHB3RSTR); - regval &= ~RCC_AHB3RSTR_QSPIRST; - putreg32(regval, STM32_RCC_AHB3RSTR); - - /* Configure multiplexed pins as connected on the board. */ - - stm32_configgpio(GPIO_QSPI_CS); - stm32_configgpio(GPIO_QSPI_IO0); - stm32_configgpio(GPIO_QSPI_IO1); - stm32_configgpio(GPIO_QSPI_IO2); - stm32_configgpio(GPIO_QSPI_IO3); - stm32_configgpio(GPIO_QSPI_SCK); - -#endif //!defined(QSPI_BOOT_IN_MEMORY_MAPPED_MOD) - - } else { - spierr("ERROR: QSPI%d not supported\n", intf); - return NULL; - } - - /* Has the QSPI hardware been initialized? */ - - if (!priv->initialized) { - /* Now perform one time initialization. - * - * Initialize the QSPI semaphore that enforces mutually exclusive - * access to the QSPI registers. - */ - - nxsem_init(&priv->exclsem, 0, 1); - -#ifdef CONFIG_STM32H7_QSPI_DMA - /* Pre-allocate DMA channels. */ - - if (priv->candma) { - priv->dmach = stm32_dmachannel(DMACHAN_QUADSPI); - - if (!priv->dmach) { - spierr("ERROR: Failed to allocate the DMA channel\n"); - priv->candma = false; - } - } - - /* Initialize the QSPI semaphore that is used to wake up the waiting - * thread when the DMA transfer completes. This semaphore is used for - * signaling and, hence, should not have priority inheritance enabled. - */ - - nxsem_init(&priv->dmawait, 0, 0); - nxsem_setprotocol(&priv->dmawait, SEM_PRIO_NONE); - - /* Create a watchdog time to catch DMA timeouts */ - - priv->dmadog = wd_create(); - - if (priv->dmadog == NULL) { - spierr("ERROR: Failed to create wdog\n"); - goto errout_with_dmahandles; - } - -#endif - -#ifdef CONFIG_STM32H7_QSPI_INTERRUPTS - /* Attach the interrupt handler */ - - ret = irq_attach(priv->irq, priv->handler, NULL); - - if (ret < 0) { - spierr("ERROR: Failed to attach irq %" PRId8 "\n", priv->irq); - goto errout_with_dmadog; - } - - /* Initialize the semaphore that blocks until the operation completes. - * This semaphore is used for signaling and, hence, should not have - * priority inheritance enabled. - */ - - nxsem_init(&priv->op_sem, 0, 0); - nxsem_setprotocol(&priv->op_sem, SEM_PRIO_NONE); -#endif - - /* Perform hardware initialization. Puts the QSPI into an active - * state. - */ - -#if !defined(QSPI_BOOT_IN_MEMORY_MAPPED_MOD) - ret = qspi_hw_initialize(priv); - - if (ret < 0) { - spierr("ERROR: Failed to initialize QSPI hardware\n"); - goto errout_with_irq; - } - -#endif - - /* Enable interrupts at the NVIC */ - - priv->initialized = true; - priv->memmap = false; -#ifdef CONFIG_STM32H7_QSPI_INTERRUPTS - up_enable_irq(priv->irq); -#endif - } - - return &priv->qspi; - -#if !defined(QSPI_BOOT_IN_MEMORY_MAPPED_MOD) -errout_with_irq: -#endif -#ifdef CONFIG_STM32H7_QSPI_INTERRUPTS - irq_detach(priv->irq); - -errout_with_dmadog: -#endif -#ifdef CONFIG_STM32H7_QSPI_DMA - wd_delete(priv->dmadog); - -errout_with_dmahandles: - nxsem_destroy(&priv->dmawait); - - if (priv->dmach) { - stm32_dmafree(priv->dmach); - priv->dmach = NULL; - } - -#endif - - nxsem_destroy(&priv->exclsem); - return NULL; -} - -/**************************************************************************** - * Name: stm32h7_qspi_enter_memorymapped - * - * Description: - * Put the QSPI device into memory mapped mode - * - * Input Parameters: - * dev - QSPI device - * meminfo - parameters like for a memory transfer used for reading - * - * Returned Value: - * None - * - ****************************************************************************/ - -QUADSPI_RAMFUNC void stm32h7_qspi_enter_memorymapped(struct qspi_dev_s *dev, - const struct qspi_meminfo_s *meminfo, uint32_t lpto) -{ - struct stm32h7_qspidev_s *priv = (struct stm32h7_qspidev_s *) dev; - uint32_t regval; - struct qspi_xctnspec_s xctn; - - /* lock during this mode change */ - - qspi_lock(dev, true); - - if (priv->memmap) { - qspi_lock(dev, false); - return; - } - - /* Abort anything in-progress */ - - qspi_abort(priv); - - /* Wait till BUSY flag reset */ - - qspi_waitstatusflags(priv, QSPI_SR_BUSY, 0); - - /* if we want the 'low-power timeout counter' */ - - if (lpto > 0) { - /* Set the Low Power Timeout value (automatically de-assert - * CS if memory is not accessed for a while) - */ - - qspi_putreg(priv, lpto, STM32_QUADSPI_LPTR_OFFSET); - - /* Clear Timeout interrupt */ - - qspi_putreg(&g_qspi0dev, QSPI_FCR_CTOF, STM32_QUADSPI_FCR_OFFSET); - -#ifdef CONFIG_STM32H7_QSPI_INTERRUPTS - /* Enable Timeout interrupt */ - - regval = qspi_getreg(priv, STM32_QUADSPI_CR_OFFSET); - regval |= (QSPI_CR_TCEN | QSPI_CR_TOIE); - qspi_putreg(priv, regval, STM32_QUADSPI_CR_OFFSET); -#endif - - } else { - regval = qspi_getreg(priv, STM32_QUADSPI_CR_OFFSET); - regval &= ~QSPI_CR_TCEN; - qspi_putreg(priv, regval, STM32_QUADSPI_CR_OFFSET); - } - - /* create a transaction object */ - - qspi_setupxctnfrommem(&xctn, meminfo); - -#ifdef CONFIG_STM32H7_QSPI_INTERRUPTS - priv->xctn = NULL; -#endif - - /* set it into the ccr */ - - qspi_ccrconfig(priv, &xctn, CCR_FMODE_MEMMAP); - priv->memmap = true; - - /* we should be in memory mapped mode now */ - - qspi_dumpregs(priv, "After memory mapped:"); - - /* finished this mode change */ - - qspi_lock(dev, false); -} - -/**************************************************************************** - * Name: stm32h7_qspi_exit_memorymapped - * - * Description: - * Take the QSPI device out of memory mapped mode - * - * Input Parameters: - * dev - QSPI device - * - * Returned Value: - * None - * - ****************************************************************************/ - -QUADSPI_RAMFUNC void stm32h7_qspi_exit_memorymapped(struct qspi_dev_s *dev) -{ - struct stm32h7_qspidev_s *priv = (struct stm32h7_qspidev_s *) dev; - - qspi_lock(dev, true); - - /* A simple abort is sufficient */ - - qspi_abort(priv); - priv->memmap = false; - - struct qspi_xctnspec_s xctn = { 0 }; - xctn.datamode = 3; /* 3 = quad */ - qspi_ccrconfig(priv, &xctn, CCR_FMODE_INDWR); - - qspi_lock(dev, false); -} - -#endif /* CONFIG_STM32H7_QSPI */ diff --git a/boards/spracing/h7extreme/src/qspi.h b/boards/spracing/h7extreme/src/qspi.h deleted file mode 100644 index f93573d..0000000 --- a/boards/spracing/h7extreme/src/qspi.h +++ /dev/null @@ -1,167 +0,0 @@ -/**************************************************************************** - * arch/arm/src/stm32h7/stm32_qspi.h - * - * Copyright (C) 2016, 2019 Gregory Nutt. All rights reserved. - * Author: dev@ziggurat29.com - * - * 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 NuttX 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. - * - ****************************************************************************/ - -#ifndef __ARCH_ARM_SRC_STM32_STM32H7_QSPI_H -#define __ARCH_ARM_SRC_STM32_STM32H7_QSPI_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include - -#include "chip.h" - -#ifdef CONFIG_STM32H7_QUADSPI - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Types - ****************************************************************************/ - -/**************************************************************************** - * Inline Functions - ****************************************************************************/ - -#ifndef __ASSEMBLY__ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -#undef EXTERN -#if defined(__cplusplus) -#define EXTERN extern "C" -extern "C" -{ -#else -#define EXTERN extern -#endif - -#define CONFIG_STM32H7_QUADSPI_USE_RAMFUNC - -#ifdef CONFIG_STM32H7_QUADSPI_USE_RAMFUNC -#define QUADSPI_RAMFUNC __ramfunc__ -#else -#define QUADSPI_RAMFUNC -#endif - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -/* QSPI methods */ - -QUADSPI_RAMFUNC int qspi_lock(struct qspi_dev_s *dev, bool lock); -QUADSPI_RAMFUNC uint32_t qspi_setfrequency(struct qspi_dev_s *dev, - uint32_t frequency); -QUADSPI_RAMFUNC void qspi_setmode(struct qspi_dev_s *dev, enum qspi_mode_e mode); -QUADSPI_RAMFUNC void qspi_setbits(struct qspi_dev_s *dev, int nbits); -QUADSPI_RAMFUNC int qspi_command(struct qspi_dev_s *dev, - struct qspi_cmdinfo_s *cmdinfo); -QUADSPI_RAMFUNC int qspi_memory(struct qspi_dev_s *dev, - struct qspi_meminfo_s *meminfo); -QUADSPI_RAMFUNC FAR void *qspi_alloc(FAR struct qspi_dev_s *dev, size_t buflen); -QUADSPI_RAMFUNC void qspi_free(FAR struct qspi_dev_s *dev, FAR void *buffer); - -/**************************************************************************** - * Name: stm32l4_qspi_initialize - * - * Description: - * Initialize the selected QSPI port in master mode - * - * Input Parameters: - * intf - Interface number(must be zero) - * - * Returned Value: - * Valid SPI device structure reference on success; a NULL on failure - * - ****************************************************************************/ - -struct qspi_dev_s; -FAR struct qspi_dev_s *stm32h7_qspi_initialize(int intf); - -/**************************************************************************** - * Name: stm32l4_qspi_enter_memorymapped - * - * Description: - * Put the QSPI device into memory mapped mode - * - * Input Parameters: - * dev - QSPI device - * meminfo - parameters like for a memory transfer used for reading - * lpto - number of cycles to wait to automatically de-assert CS - * - * Returned Value: - * None - * - ****************************************************************************/ - -QUADSPI_RAMFUNC void stm32h7_qspi_enter_memorymapped(struct qspi_dev_s *dev, - const struct qspi_meminfo_s *meminfo, - uint32_t lpto); - -/**************************************************************************** - * Name: stm32l4_qspi_exit_memorymapped - * - * Description: - * Take the QSPI device out of memory mapped mode - * - * Input Parameters: - * dev - QSPI device - * - * Returned Value: - * None - * - ****************************************************************************/ - -QUADSPI_RAMFUNC void stm32h7_qspi_exit_memorymapped(struct qspi_dev_s *dev); - -#undef EXTERN -#if defined(__cplusplus) -} -#endif - -#endif /* __ASSEMBLY__ */ -#endif /* CONFIG_STM32H7_QSPI */ -#endif /* __ARCH_ARM_SRC_STM32_STM32H7_QSPI_H */ diff --git a/boards/spracing/h7extreme/src/rcc.c b/boards/spracing/h7extreme/src/rcc.c deleted file mode 100644 index 9fc0584..0000000 --- a/boards/spracing/h7extreme/src/rcc.c +++ /dev/null @@ -1,532 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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. - * - ****************************************************************************/ - -/** - * @file rcc.c - * - * Board-specific clock config functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ -#include "board_config.h" - -#include "stm32_pwr.h" -#include "hardware/stm32_axi.h" -#include "hardware/stm32_syscfg.h" - -/************************************************************************************ - * Definitions - ************************************************************************************/ -/* Allow up to 100 milliseconds for the high speed clock to become ready. - * that is a very long delay, but if the clock does not become ready we are - * hosed anyway. Normally this is very fast, but I have seen at least one - * board that required this long, long timeout for the HSE to be ready. - */ - -#define HSERDY_TIMEOUT (100 * CONFIG_BOARD_LOOPSPERMSEC) - -/* Same for HSI */ - -#define HSIRDY_TIMEOUT HSERDY_TIMEOUT - -/* HSE divisor to yield ~1MHz RTC clock */ - -#define HSE_DIVISOR (STM32_HSE_FREQUENCY + 500000) / 1000000 - -/* Voltage output scale (default to Scale 1 mode) */ - -#ifndef STM32_PWR_VOS_SCALE -# define STM32_PWR_VOS_SCALE PWR_D3CR_VOS_SCALE_1 -#endif - -#if !defined(BOARD_FLASH_PROGDELAY) -# if STM32_PWR_VOS_SCALE == PWR_D3CR_VOS_SCALE_1 -# if STM32_SYSCLK_FREQUENCY <= 70000000 && BOARD_FLASH_WAITSTATES == 0 -# define BOARD_FLASH_PROGDELAY 0 -# elif STM32_SYSCLK_FREQUENCY <= 140000000 && BOARD_FLASH_WAITSTATES == 1 -# define BOARD_FLASH_PROGDELAY 10 -# elif STM32_SYSCLK_FREQUENCY <= 185000000 && BOARD_FLASH_WAITSTATES == 2 -# define BOARD_FLASH_PROGDELAY 1 -# elif STM32_SYSCLK_FREQUENCY <= 210000000 && BOARD_FLASH_WAITSTATES == 2 -# define BOARD_FLASH_PROGDELAY 2 -# elif STM32_SYSCLK_FREQUENCY <= 225000000 && BOARD_FLASH_WAITSTATES == 3 -# define BOARD_FLASH_PROGDELAY 2 -# else -# define BOARD_FLASH_PROGDELAY 2 -# endif -# endif -#endif - -/* PLL are only enabled if the P,Q or R outputs are enabled. */ - -#undef USE_PLL1 -#if STM32_PLLCFG_PLL1CFG & (RCC_PLLCFGR_DIVP1EN | RCC_PLLCFGR_DIVQ1EN | \ - RCC_PLLCFGR_DIVR1EN) -# define USE_PLL1 -#endif - -#undef USE_PLL2 -#if STM32_PLLCFG_PLL2CFG & (RCC_PLLCFGR_DIVP2EN | RCC_PLLCFGR_DIVQ2EN | \ - RCC_PLLCFGR_DIVR2EN) -# define USE_PLL2 -#endif - -#undef USE_PLL3 -#if STM32_PLLCFG_PLL3CFG & (RCC_PLLCFGR_DIVP3EN | RCC_PLLCFGR_DIVQ3EN | \ - RCC_PLLCFGR_DIVR3EN) -# define USE_PLL3 -#endif - - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -#if defined(CONFIG_STM32H7_CUSTOM_CLOCKCONFIG) - -extern uint32_t _start_itcm; -extern uint32_t _end_itcm; -extern uint32_t _load_itcm; - -extern uint32_t _start_sram; -extern uint32_t _end_sram; -extern uint32_t _load_sram; - -__ramfunc__ void stm32_board_clockconfig(void) -{ - volatile uint32_t regval = 0; - volatile int32_t timeout; - - /* This is not the best place for copying code to ITCM and RAM. - * Since our code work to slow in External Flash, we need to copy it to ITCM and RAM. - * This currently way to do it inside board specific code. - */ - - const uint32_t *src; - uint32_t *dest; - - for (src = &_load_itcm, dest = &_start_itcm; dest < &_end_itcm;) { - *dest++ = *src++; - } - - for (src = &_load_sram, dest = &_start_sram; dest < &_end_sram;) { - *dest++ = *src++; - } - -#ifdef STM32_BOARD_USEHSI - /* Enable Internal High-Speed Clock (HSI) */ - - regval = getreg32(STM32_RCC_CR); - regval |= RCC_CR_HSION; /* Enable HSI */ - putreg32(regval, STM32_RCC_CR); - - /* Wait until the HSI is ready (or until a timeout elapsed) */ - - for (timeout = HSIRDY_TIMEOUT; timeout > 0; timeout--) { - /* Check if the HSIRDY flag is the set in the CR */ - - if ((getreg32(STM32_RCC_CR) & RCC_CR_HSIRDY) != 0) { - /* If so, then break-out with timeout > 0 */ - - break; - } - } - -#else /* if STM32_BOARD_USEHSE */ - /* Enable External High-Speed Clock (HSE) */ - - regval = getreg32(STM32_RCC_CR); -#ifdef STM32_HSEBYP_ENABLE /* May be defined in board.h header file */ - regval |= RCC_CR_HSEBYP; /* Enable HSE clock bypass */ -#else - regval &= ~RCC_CR_HSEBYP; /* Disable HSE clock bypass */ -#endif - regval |= RCC_CR_HSEON; /* Enable HSE */ - putreg32(regval, STM32_RCC_CR); - - /* Wait until the HSE is ready (or until a timeout elapsed) */ - - for (timeout = HSERDY_TIMEOUT; timeout > 0; timeout--) { - /* Check if the HSERDY flag is the set in the CR */ - - if ((getreg32(STM32_RCC_CR) & RCC_CR_HSERDY) != 0) { - /* If so, then break-out with timeout > 0 */ - - break; - } - } - -#endif - -#ifdef CONFIG_STM32H7_HSI48 - /* Enable HSI48 */ - - regval = getreg32(STM32_RCC_CR); - regval |= RCC_CR_HSI48ON; - putreg32(regval, STM32_RCC_CR); - - /* Wait until the HSI48 is ready */ - - while ((getreg32(STM32_RCC_CR) & RCC_CR_HSI48RDY) == 0) { - } - -#endif - - /* Check for a timeout. If this timeout occurs, then we are hosed. We - * have no real back-up plan, although the following logic makes it look - * as though we do. - */ - - if (timeout > 0) { - /* Set the D1 domain Core prescaler and the HCLK source/divider */ - - regval = getreg32(STM32_RCC_D1CFGR); - regval &= ~(RCC_D1CFGR_HPRE_MASK | RCC_D1CFGR_D1CPRE_MASK); - regval |= (STM32_RCC_D1CFGR_HPRE | STM32_RCC_D1CFGR_D1CPRE); - putreg32(regval, STM32_RCC_D1CFGR); - - /* Set PCLK1 */ - - regval = getreg32(STM32_RCC_D2CFGR); - regval &= ~RCC_D2CFGR_D2PPRE2_MASK; - regval |= STM32_RCC_D2CFGR_D2PPRE1; - putreg32(regval, STM32_RCC_D2CFGR); - - /* Set PCLK2 */ - - regval = getreg32(STM32_RCC_D2CFGR); - regval &= ~RCC_D2CFGR_D2PPRE2_MASK; - regval |= STM32_RCC_D2CFGR_D2PPRE2; - putreg32(regval, STM32_RCC_D2CFGR); - - /* Set PCLK3 */ - - regval = getreg32(STM32_RCC_D1CFGR); - regval &= ~RCC_D1CFGR_D1PPRE_MASK; - regval |= STM32_RCC_D1CFGR_D1PPRE; - putreg32(regval, STM32_RCC_D1CFGR); - - /* Set PCLK4 */ - - regval = getreg32(STM32_RCC_D3CFGR); - regval &= ~RCC_D3CFGR_D3PPRE_MASK; - regval |= STM32_RCC_D3CFGR_D3PPRE; - putreg32(regval, STM32_RCC_D3CFGR); - -#ifdef CONFIG_STM32H7_RTC_HSECLOCK - /* Set the RTC clock divisor */ - - regval = getreg32(STM32_RCC_CFGR); - regval &= ~RCC_CFGR_RTCPRE_MASK; - regval |= RCC_CFGR_RTCPRE(HSE_DIVISOR); - putreg32(regval, STM32_RCC_CFGR); -#endif - - /* Configure PLL123 clock source and multipiers */ - -#ifdef STM32_BOARD_USEHSI - regval = (RCC_PLLCKSELR_PLLSRC_HSI | - STM32_PLLCFG_PLL1M | - STM32_PLLCFG_PLL2M | - STM32_PLLCFG_PLL3M); -#else /* if STM32_BOARD_USEHSE */ - regval = (RCC_PLLCKSELR_PLLSRC_HSE | - STM32_PLLCFG_PLL1M | - STM32_PLLCFG_PLL2M | - STM32_PLLCFG_PLL3M); -#endif - putreg32(regval, STM32_RCC_PLLCKSELR); - - /* Each PLL offers 3 outputs with post-dividers (PLLxP/PLLxQ/PLLxR) */ - - /* Configure PLL1 dividers */ - - regval = (STM32_PLLCFG_PLL1N | - STM32_PLLCFG_PLL1P | - STM32_PLLCFG_PLL1Q | - STM32_PLLCFG_PLL1R); - putreg32(regval, STM32_RCC_PLL1DIVR); - - /* Configure PLL2 dividers */ - - regval = (STM32_PLLCFG_PLL2N | - STM32_PLLCFG_PLL2P | - STM32_PLLCFG_PLL2Q | - STM32_PLLCFG_PLL2R); - putreg32(regval, STM32_RCC_PLL2DIVR); - - /* Configure PLL3 dividers */ - - regval = (STM32_PLLCFG_PLL3N | - STM32_PLLCFG_PLL3P | - STM32_PLLCFG_PLL3Q | - STM32_PLLCFG_PLL3R); - putreg32(regval, STM32_RCC_PLL3DIVR); - - /* Configure PLLs */ - - regval = (STM32_PLLCFG_PLL1CFG | - STM32_PLLCFG_PLL2CFG | - STM32_PLLCFG_PLL3CFG); - putreg32(regval, STM32_RCC_PLLCFGR); - - regval = getreg32(STM32_RCC_CR); -#if defined(USE_PLL1) - /* Enable the PLL1 */ - - regval |= RCC_CR_PLL1ON; -#endif - -#if defined(USE_PLL2) - /* Enable the PLL2 */ - - regval |= RCC_CR_PLL2ON; -#endif - -#if defined(USE_PLL3) - /* Enable the PLL3 */ - - regval |= RCC_CR_PLL3ON; -#endif - putreg32(regval, STM32_RCC_CR); - -#if defined(USE_PLL1) - /* Wait until the PLL1 is ready */ - - while ((getreg32(STM32_RCC_CR) & RCC_CR_PLL1RDY) == 0) { - } - -#endif - -#if defined(USE_PLL2) - /* Wait until the PLL2 is ready */ - - while ((getreg32(STM32_RCC_CR) & RCC_CR_PLL2RDY) == 0) { - } - -#endif -#if defined(USE_PLL3) - /* Wait until the PLL3 is ready */ - - while ((getreg32(STM32_RCC_CR) & RCC_CR_PLL3RDY) == 0) { - } - -#endif - - /* Ww must write the lower byte of the PWR_CR3 register is written once - * after POR and it shall be written before changing VOS level or ck_sys - * clock frequency. No limitation applies to the upper bytes. - * - * Programming data corresponding to an invalid combination of - * LDOEN and BYPASS bits will be ignored: data will not be written, - * the written-once mechanism will lock the register and any further - * write access will be ignored. The default supply configuration will - * be kept and the ACTVOSRDY bit in PWR control status register 1 (PWR_CSR1) - * will go on indicating invalid voltage levels. - * - * N.B. The system shall be power cycled before writing a new value. - */ - - regval = getreg32(STM32_PWR_CR3); - regval |= STM32_PWR_CR3_LDOEN | STM32_PWR_CR3_LDOESCUEN; - putreg32(regval, STM32_PWR_CR3); - - /* Set the voltage output scale */ - - regval = getreg32(STM32_PWR_D3CR); - regval &= ~STM32_PWR_D3CR_VOS_MASK; - regval |= STM32_PWR_VOS_SCALE; - putreg32(regval, STM32_PWR_D3CR); - - while ((getreg32(STM32_PWR_D3CR) & STM32_PWR_D3CR_VOSRDY) == 0) { - } - - /* Over-drive is needed if - * - Voltage output scale 1 mode is selected and SYSCLK frequency is - * over 400 Mhz. - */ - - if ((STM32_PWR_VOS_SCALE == PWR_D3CR_VOS_SCALE_1) && - STM32_SYSCLK_FREQUENCY > 400000000) { - - /* Enable System configuration controller clock to Enable ODEN */ - - regval = getreg32(STM32_RCC_APB4ENR); - regval |= RCC_APB4ENR_SYSCFGEN; - putreg32(regval, STM32_RCC_APB4ENR); - - /* Enable Overdrive to extend the clock frequency up to 480 Mhz. */ - - regval = getreg32(STM32_SYSCFG_PWRCR); - regval |= SYSCFG_PWRCR_ODEN; - putreg32(regval, STM32_SYSCFG_PWRCR); - - while ((getreg32(STM32_PWR_D3CR) & STM32_PWR_D3CR_VOSRDY) == 0) { - } - } - - /* Configure FLASH wait states */ - - regval = FLASH_ACR_WRHIGHFREQ(BOARD_FLASH_PROGDELAY) | - FLASH_ACR_LATENCY(BOARD_FLASH_WAITSTATES); - - - putreg32(regval, STM32_FLASH_ACR); - - /* Configure new QSPI source clock */ - -#if defined(STM32_RCC_D1CCIPR_QSPISEL) - regval = getreg32(STM32_RCC_D1CCIPR); - regval &= ~RCC_D1CCIPR_QSPISEL_MASK; - regval |= STM32_RCC_D1CCIPR_QSPISEL; - putreg32(regval, STM32_RCC_D1CCIPR); -#endif - - /* Select the PLL1P as system clock source */ - - regval = getreg32(STM32_RCC_CFGR); - regval &= ~RCC_CFGR_SW_MASK; - regval |= RCC_CFGR_SW_PLL1; - putreg32(regval, STM32_RCC_CFGR); - - /* Wait until the PLL source is used as the system clock source */ - - while ((getreg32(STM32_RCC_CFGR) & RCC_CFGR_SWS_MASK) != - RCC_CFGR_SWS_PLL1) { - } - - /* Configure I2C source clock */ - -#if (STM32_RCC_D2CCIP2R_I2C123SRC == RCC_D2CCIP2R_I2C123SEL_HSI) - /* Enable Internal High-Speed Clock (HSI) */ - - regval = getreg32(STM32_RCC_CR); - regval |= RCC_CR_HSION; /* Enable HSI */ - regval |= RCC_CR_HSIDIV_4; /* Set HSI to 16 MHz */ - putreg32(regval, STM32_RCC_CR); - - /* Wait until the HSI is ready (or until a timeout elapsed) */ - - for (timeout = HSIRDY_TIMEOUT; timeout > 0; timeout--) { - /* Check if the HSIRDY flag is the set in the CR */ - - if ((getreg32(STM32_RCC_CR) & RCC_CR_HSIRDY) != 0) { - /* If so, then break-out with timeout > 0 */ - - break; - } - } - -#endif - -#if defined(STM32_RCC_D2CCIP2R_I2C123SRC) - regval = getreg32(STM32_RCC_D2CCIP2R); - regval &= ~RCC_D2CCIP2R_I2C123SEL_MASK; - regval |= STM32_RCC_D2CCIP2R_I2C123SRC; - putreg32(regval, STM32_RCC_D2CCIP2R); -#endif - -#if defined(STM32_RCC_D3CCIPR_I2C4SRC) - regval = getreg32(STM32_RCC_D3CCIPR); - regval &= ~RCC_D3CCIPR_I2C4SEL_MASK; - regval |= STM32_RCC_D3CCIPR_I2C4SRC; - putreg32(regval, STM32_RCC_D3CCIPR); -#endif - - /* Configure SPI source clock */ - -#if defined(STM32_RCC_D2CCIP1R_SPI123SRC) - regval = getreg32(STM32_RCC_D2CCIP1R); - regval &= ~RCC_D2CCIP1R_SPI123SEL_MASK; - regval |= STM32_RCC_D2CCIP1R_SPI123SRC; - putreg32(regval, STM32_RCC_D2CCIP1R); -#endif - -#if defined(STM32_RCC_D2CCIP1R_SPI45SRC) - regval = getreg32(STM32_RCC_D2CCIP1R); - regval &= ~RCC_D2CCIP1R_SPI45SEL_MASK; - regval |= STM32_RCC_D2CCIP1R_SPI45SRC; - putreg32(regval, STM32_RCC_D2CCIP1R); -#endif - -#if defined(STM32_RCC_D3CCIPR_SPI6SRC) - regval = getreg32(STM32_RCC_D3CCIPR); - regval &= ~RCC_D3CCIPR_SPI6SEL_MASK; - regval |= STM32_RCC_D3CCIPR_SPI6SRC; - putreg32(regval, STM32_RCC_D3CCIPR); -#endif - - /* Configure USB source clock */ - -#if defined(STM32_RCC_D2CCIP2R_USBSRC) - regval = getreg32(STM32_RCC_D2CCIP2R); - regval &= ~RCC_D2CCIP2R_USBSEL_MASK; - regval |= STM32_RCC_D2CCIP2R_USBSRC; - putreg32(regval, STM32_RCC_D2CCIP2R); -#endif - - /* Configure ADC source clock */ - -#if defined(STM32_RCC_D3CCIPR_ADCSEL) - regval = getreg32(STM32_RCC_D3CCIPR); - regval &= ~RCC_D3CCIPR_ADCSEL_MASK; - regval |= STM32_RCC_D3CCIPR_ADCSEL; - putreg32(regval, STM32_RCC_D3CCIPR); -#endif - -#if defined(CONFIG_STM32H7_IWDG) || defined(CONFIG_STM32H7_RTC_LSICLOCK) - /* Low speed internal clock source LSI */ - - stm32_rcc_enablelsi(); -#endif - -#if defined(CONFIG_STM32H7_RTC_LSECLOCK) - /* Low speed external clock source LSE - * - * TODO: There is another case where the LSE needs to - * be enabled: if the MCO1 pin selects LSE as source. - */ - - stm32_rcc_enablelse(); -#endif - } - -} - -#endif //#if defined(CONFIG_STM32H7_CUSTOM_CLOCKCONFIG) diff --git a/boards/spracing/h7extreme/src/sdio.c b/boards/spracing/h7extreme/src/sdio.c deleted file mode 100644 index 869d757..0000000 --- a/boards/spracing/h7extreme/src/sdio.c +++ /dev/null @@ -1,177 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include "chip.h" -#include "board_config.h" -#include "stm32_gpio.h" -#include "stm32_sdmmc.h" - -#ifdef CONFIG_MMCSD - - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Card detections requires card support and a card detection GPIO */ - -#define HAVE_NCD 1 -#if !defined(GPIO_SDMMC1_NCD) -# undef HAVE_NCD -#endif - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -static FAR struct sdio_dev_s *sdio_dev; -#ifdef HAVE_NCD -static bool g_sd_inserted = 0xff; /* Impossible value */ -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_ncd_interrupt - * - * Description: - * Card detect interrupt handler. - * - ****************************************************************************/ - -#ifdef HAVE_NCD -static int stm32_ncd_interrupt(int irq, FAR void *context) -{ - bool present; - - present = !stm32_gpioread(GPIO_SDMMC1_NCD); - - if (sdio_dev && present != g_sd_inserted) { - sdio_mediachange(sdio_dev, present); - g_sd_inserted = present; - } - - return OK; -} -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: stm32_sdio_initialize - * - * Description: - * Initialize SDIO-based MMC/SD card support - * - ****************************************************************************/ - -int stm32_sdio_initialize(void) -{ - int ret; - -#ifdef HAVE_NCD - /* Card detect */ - - bool cd_status; - - /* Configure the card detect GPIO */ - - stm32_configgpio(GPIO_SDMMC1_NCD); - - /* Register an interrupt handler for the card detect pin */ - - stm32_gpiosetevent(GPIO_SDMMC1_NCD, true, true, true, stm32_ncd_interrupt); -#endif - - /* Mount the SDIO-based MMC/SD block driver */ - /* First, get an instance of the SDIO interface */ - - finfo("Initializing SDIO slot %d\n", SDIO_SLOTNO); - - sdio_dev = sdio_initialize(SDIO_SLOTNO); - - if (!sdio_dev) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", SDIO_SLOTNO); - return -ENODEV; - } - - /* Now bind the SDIO interface to the MMC/SD driver */ - - finfo("Bind SDIO to the MMC/SD driver, minor=%d\n", SDIO_MINOR); - - ret = mmcsd_slotinitialize(SDIO_MINOR, sdio_dev); - - if (ret != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); - return ret; - } - - finfo("Successfully bound SDIO to the MMC/SD driver\n"); - -#ifdef HAVE_NCD - /* Use SD card detect pin to check if a card is g_sd_inserted */ - - cd_status = !stm32_gpioread(GPIO_SDMMC1_NCD); - finfo("Card detect : %d\n", cd_status); - - sdio_mediachange(sdio_dev, cd_status); -#else - /* Assume that the SD card is inserted. What choice do we have? */ - - sdio_mediachange(sdio_dev, true); -#endif - - return OK; -} - -#endif /* CONFIG_MMCSD */ diff --git a/boards/spracing/h7extreme/src/spi.cpp b/boards/spracing/h7extreme/src/spi.cpp deleted file mode 100644 index 9684ffe..0000000 --- a/boards/spracing/h7extreme/src/spi.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortB, GPIO::Pin12}, SPI::DRDY{GPIO::PortE, GPIO::Pin15}) - }), - initSPIBus(SPI::Bus::SPI3, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin4}) - }), - initSPIBus(SPI::Bus::SPI4, { - initSPIDevice(DRV_OSD_DEVTYPE_ATXXXX, SPI::CS{GPIO::PortE, GPIO::Pin11}), - }), - -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/spracing/h7extreme/src/timer_config.cpp b/boards/spracing/h7extreme/src/timer_config.cpp deleted file mode 100644 index d7c83bb..0000000 --- a/boards/spracing/h7extreme/src/timer_config.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer5, DMA{DMA::Index1, DMA::Stream0, DMA::Channel6}), - initIOTimer(Timer::Timer4, DMA{DMA::Index1, DMA::Stream6, DMA::Channel2}), - initIOTimer(Timer::Timer8, DMA{DMA::Index2, DMA::Stream1, DMA::Channel7}), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel1}, {GPIO::PortA, GPIO::Pin0}), //Motor 1 - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel2}, {GPIO::PortA, GPIO::Pin1}), //Motor 2 - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel3}, {GPIO::PortA, GPIO::Pin2}), //Motor 3 - initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel4}, {GPIO::PortA, GPIO::Pin3}), //Motor 4 - - - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel1}, {GPIO::PortB, GPIO::Pin6}), //Motor 5 - initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortB, GPIO::Pin7}), //Motor 6 - -// initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin6}), //Motor 9 -// initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel4}, {GPIO::PortD, GPIO::Pin7}), //Motor 10 - - initIOTimerChannel(io_timers, {Timer::Timer8, Timer::Channel1}, {GPIO::PortC, GPIO::Pin6}), //Motor 7 - initIOTimerChannel(io_timers, {Timer::Timer8, Timer::Channel2}, {GPIO::PortC, GPIO::Pin7}), //Motor 8 - - -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); - diff --git a/boards/spracing/h7extreme/src/usb.c b/boards/spracing/h7extreme/src/usb.c deleted file mode 100644 index 6d42476..0000000 --- a/boards/spracing/h7extreme/src/usb.c +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2016 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. - * - ****************************************************************************/ - -/** - * @file px4fmu_usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#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_STM32H7_OTGFS - stm32_configgpio(GPIO_OTGFS_VBUS); -#endif -} - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} diff --git a/boards/thepeach/k1/default.px4board b/boards/thepeach/k1/default.px4board deleted file mode 100644 index b2c6588..0000000 --- a/boards/thepeach/k1/default.px4board +++ /dev/null @@ -1,99 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS3" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS2" -CONFIG_BOARD_SERIAL_TEL4="/dev/ttyS6" -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_COMMON_BAROMETERS=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU9250=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_PWM_INPUT=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_PX4IO=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_BOARD_UAVCAN_INTERFACES=1 -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UUV_ATT_CONTROL=y -CONFIG_MODULES_UUV_POS_CONTROL=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BL_UPDATE=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SERIAL_TEST=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_FAKE_GPS=y diff --git a/boards/thepeach/k1/extras/px4_io-v2_default.bin b/boards/thepeach/k1/extras/px4_io-v2_default.bin deleted file mode 100755 index 957f0f1..0000000 Binary files a/boards/thepeach/k1/extras/px4_io-v2_default.bin and /dev/null differ diff --git a/boards/thepeach/k1/extras/thepeach_k1_bootloader.bin b/boards/thepeach/k1/extras/thepeach_k1_bootloader.bin deleted file mode 100755 index 33f6c9b..0000000 Binary files a/boards/thepeach/k1/extras/thepeach_k1_bootloader.bin and /dev/null differ diff --git a/boards/thepeach/k1/firmware.prototype b/boards/thepeach/k1/firmware.prototype deleted file mode 100644 index 24b74c7..0000000 --- a/boards/thepeach/k1/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 212, - "magic": "PX4FWv1", - "description": "Firmware for the ThePeach K1 board", - "image": "", - "build_time": 0, - "summary": "ThePeach K1", - "version": "0.1", - "image_size": 0, - "image_maxsize": 2080768, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/thepeach/k1/init/rc.board_defaults b/boards/thepeach/k1/init/rc.board_defaults deleted file mode 100644 index 5d8a3c1..0000000 --- a/boards/thepeach/k1/init/rc.board_defaults +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 18.1 -param set-default BAT1_A_PER_V 36.367515152 - -param set-default SYS_USE_IO 1 diff --git a/boards/thepeach/k1/init/rc.board_sensors b/boards/thepeach/k1/init/rc.board_sensors deleted file mode 100644 index 730efee..0000000 --- a/boards/thepeach/k1/init/rc.board_sensors +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# -# Board specific sensors init -#------------------------------------------------------------------------------ -board_adc start - -# SPI1 -ms5611 -s -b 1 start - -icm20602 -s -b 1 -R 8 start -mpu9250 -s -b 1 -R 8 -M start diff --git a/boards/thepeach/k1/nuttx-config/include/board.h b/boards/thepeach/k1/nuttx-config/include/board.h deleted file mode 100644 index 45134d8..0000000 --- a/boards/thepeach/k1/nuttx-config/include/board.h +++ /dev/null @@ -1,271 +0,0 @@ -/************************************************************************************ - * board.h - * include/arch/board/board.h - * - * Copyright (C) 2009, 2016, 2022 Gregory Nutt. All rights reserved. - * Authors: Gregory Nutt - * David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ - -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ -#include "board_dma_map.h" - -#include -#ifndef __ASSEMBLY__ -# include -#endif - -#include - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The ThePeach FCC-K1 uses a 24MHz crystal connected to the HSE. - * - * This is the "standard" configuration as set up by arch/arm/src/stm32f40xx_rcc.c: - * System Clock source : PLL (HSE) - * SYSCLK(Hz) : 168000000 Determined by PLL configuration - * HCLK(Hz) : 168000000 (STM32_RCC_CFGR_HPRE) - * AHB Prescaler : 1 (STM32_RCC_CFGR_HPRE) - * APB1 Prescaler : 4 (STM32_RCC_CFGR_PPRE1) - * APB2 Prescaler : 2 (STM32_RCC_CFGR_PPRE2) - * HSE Frequency(Hz) : 24000000 (STM32_BOARD_XTAL) - * PLLM : 24 (STM32_PLLCFG_PLLM) - * PLLN : 336 (STM32_PLLCFG_PLLN) - * PLLP : 2 (STM32_PLLCFG_PLLP) - * PLLQ : 7 (STM32_PLLCFG_PPQ) - * Main regulator output voltage : Scale1 mode Needed for high speed SYSCLK - * Flash Latency(WS) : 5 - * Prefetch Buffer : OFF - * Instruction cache : ON - * Data cache : ON - * Require 48MHz for USB OTG FS, : Enabled - * SDIO and RNG clock - */ - -/* HSI - 16 MHz RC factory-trimmed - * LSI - 32 KHz RC - * HSE - On-board crystal frequency is 24MHz - * LSE - not installed - */ - -#define STM32_BOARD_XTAL 24000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -//#define STM32_LSE_FREQUENCY 32768 - -/* Main PLL Configuration. - * - * PLL source is HSE - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * = (25,000,000 / 25) * 336 - * = 336,000,000 - * SYSCLK = PLL_VCO / PLLP - * = 336,000,000 / 2 = 168,000,000 - * USB OTG FS, SDIO and RNG Clock - * = PLL_VCO / PLLQ - * = 48,000,000 - */ - -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(24) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(336) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(7) - -#define STM32_SYSCLK_FREQUENCY 168000000ul - -/* AHB clock (HCLK) is SYSCLK (168MHz) */ - -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (42MHz) */ - -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (84MHz) */ - -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx - * otherwise frequency is 2xAPBx. - * Note: TIM1,8-11 are on APB2, others on APB1 - */ - -#define BOARD_TIM1_FREQUENCY STM32_APB2_TIM1_CLKIN -#define BOARD_TIM2_FREQUENCY STM32_APB1_TIM2_CLKIN -#define BOARD_TIM3_FREQUENCY STM32_APB1_TIM3_CLKIN -#define BOARD_TIM4_FREQUENCY STM32_APB1_TIM4_CLKIN -#define BOARD_TIM5_FREQUENCY STM32_APB1_TIM5_CLKIN -#define BOARD_TIM6_FREQUENCY STM32_APB1_TIM6_CLKIN -#define BOARD_TIM7_FREQUENCY STM32_APB1_TIM7_CLKIN -#define BOARD_TIM8_FREQUENCY STM32_APB2_TIM8_CLKIN -#define BOARD_TIM9_FREQUENCY STM32_APB2_TIM9_CLKIN -#define BOARD_TIM10_FREQUENCY STM32_APB2_TIM10_CLKIN -#define BOARD_TIM11_FREQUENCY STM32_APB2_TIM11_CLKIN -#define BOARD_TIM12_FREQUENCY STM32_APB1_TIM12_CLKIN -#define BOARD_TIM13_FREQUENCY STM32_APB1_TIM13_CLKIN -#define BOARD_TIM14_FREQUENCY STM32_APB1_TIM14_CLKIN - -/* SDIO dividers. Note that slower clocking is required when DMA is disabled - * in order to avoid RX overrun/TX underrun errors due to delayed responses - * to service FIFOs in interrupt driven mode. These values have not been - * tuned!!! - * - * SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(118+2)=400 KHz - */ - -#define SDIO_INIT_CLKDIV (118 << SDIO_CLKCR_CLKDIV_SHIFT) - -/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz - * DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32_SDIO_DMA -# define SDIO_MMCXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) -#else -# define SDIO_MMCXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) -#endif - -/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz - * DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32_SDIO_DMA -# define SDIO_SDXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) -#else -# define SDIO_SDXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) -#endif - -/* Alternate function pin selections ************************************************/ - -/* UARTs */ - -#define GPIO_USART1_RX GPIO_USART1_RX_1 /* Console in from IO */ -#define GPIO_USART1_TX 0 /* USART1 is RX-only */ - -#define GPIO_USART2_RX GPIO_USART2_RX_2 -#define GPIO_USART2_TX GPIO_USART2_TX_2 -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 -#define GPIO_USART2_CTS GPIO_USART2_CTS_2 - -#define GPIO_USART3_RX GPIO_USART3_RX_3 -#define GPIO_USART3_TX GPIO_USART3_TX_3 -#define GPIO_USART3_RTS GPIO_USART3_RTS_2 -#define GPIO_USART3_CTS GPIO_USART3_CTS_2 - -#define GPIO_UART4_RX GPIO_UART4_RX_1 -#define GPIO_UART4_TX GPIO_UART4_TX_1 - -#define GPIO_USART6_RX GPIO_USART6_RX_1 -#define GPIO_USART6_TX GPIO_USART6_TX_1 - -#define GPIO_UART7_RX GPIO_UART7_RX_1 -#define GPIO_UART7_TX GPIO_UART7_TX_1 - -/* UART8 has no alternate pin config */ - -/* CAN - * - * CAN1 is routed to the onboard transceiver. - */ - -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 - -/* I2C - * - * The optional _GPIO configurations allow the I2C driver to manually - * reset the bus to clear stuck slaves. They match the pin configuration, - * but are normally-high GPIOs. - */ - -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN8) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN9) - -#define GPIO_I2C2_SCL GPIO_I2C2_SCL_1 -#define GPIO_I2C2_SDA GPIO_I2C2_SDA_1 -#define GPIO_I2C2_SCL_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN10) -#define GPIO_I2C2_SDA_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN11) - -/* SPI - * - * There are sensors on SPI1, and SPI2 is connected to the FRAM. - */ - -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 - -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_2 - -#define GPIO_SPI4_MISO GPIO_SPI4_MISO_1 -#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_1 -#define GPIO_SPI4_SCK GPIO_SPI4_SCK_1 - - -#endif /* __ARCH_BOARD_BOARD_H */ diff --git a/boards/thepeach/k1/nuttx-config/include/board_dma_map.h b/boards/thepeach/k1/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 96a4c81..0000000 --- a/boards/thepeach/k1/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/* -| DMA1 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | SPI3_RX_1 | - | SPI3_RX_2 | SPI2_RX | SPI2_TX | SPI3_TX_1 | - | SPI3_TX_2 | -| Channel 1 | I2C1_RX | - | TIM7_UP_1 | - | TIM7_UP_2 | I2C1_RX_1 | I2C1_TX | I2C1_TX_1 | -| Channel 2 | TIM4_CH1 | - | I2C4_RX | TIM4_CH2 | - | I2C4_RX | TIM4_UP | TIM4_CH3 | -| Channel 3 | - | TIM2_UP_1 | I2C3_RX_1 | I2C2_EXT_RX | I2C3_TX | TIM2_CH1 | TIM2_CH2 | TIM2_UP_2 | -| | | TIM2_CH3 | | | | | TIM2_CH4_1 | TIM2_CH4_2 | -| Channel 4 | UART5_RX | USART3_RX | UART4_RX | USART3_TX_1 | UART4_TX | USART2_RX | USART2_TX | UART5_TX | -| Channel 5 | UART8_TX | UART7_TX | TIM3_CH4 | UART7_RX | TIM3_CH1 | TIM3_CH2 | UART8_RX | TIM3_CH3 | -| | | | TIM3_UP | | TIM3_TRIG | | | | -| Channel 6 | TIM5_CH3 | TIM5_CH4_1 | TIM5_CH1 | TIM5_CH4_2 | TIM5_CH2 | - | TIM5_UP_2 | - | -| | TIM5_UP_1 | TIM5_TRIG_1 | | TIM5_TRIG_2 | | | | | -| Channel 7 | - | TIM6_UP | I2C2_RX | I2C2_RX_1 | USART3_TX_2 | DAC1 | DAC2 | I2C2_TX | -| | | | | | | | | | -| Usage | | USART3_RX | UART4_RX | UART7_RX | | USART2_RX | TIM4_UP | | - - -| DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | ADC1_1 | SAI1_A | TIM8_CH1_1 | SAI1_A_1 | ADC1_2 | SAI1_B_1 | TIM1_CH1_1 | - | -| | | | TIM8_CH2_1 | | | | TIM1_CH2_1 | | -| | | | TIM8_CH3_1 | | | | TIM1_CH3_1 | | -| Channel 1 | - | DCMI_1 | ADC2_1 | ADC2_2 | SAI1_B | SPI6_TX | SPI6_RX | DCMI_2 | -| Channel 2 | ADC3_1 | ADC3_2 | - | SPI5_RX_1 | SPI5_TX_1 | CRYP_OUT | CRYP_IN | HASH_IN | -| Channel 3 | SPI1_RX_1 | - | SPI1_RX_2 | SPI1_TX_1 | - | SPI1_TX_2 | - | QUADSPI | -| Channel 4 | SPI4_RX_1 | SPI4_TX_1 | USART1_RX_1 | SDIO | - | USART1_RX_2 | SDIO | USART1_TX | -| Channel 5 | - | USART6_RX_1 | USART6_RX_2 | SPI4_RX_2 | SPI4_TX_2 | - | USART6_TX_1 | USART6_TX_2 | -| Channel 6 | TIM1_TRIG_1 | TIM1_CH1_2 | TIM1_CH2_2 | TIM1_CH1 | TIM1_CH4 | TIM1_UP | TIM1_CH3_2 | - | -| | | | | | TIM1_TRIG_2 | | | | -| | | | | | TIM1_COM | | | | -| Channel 7 | - | TIM8_UP | TIM8_CH1_2 | TIM8_CH2_2 | TIM8_CH3_2 | SPI5_RX_2 | SPI5_TX_2 | TIM8_CH4 | -| | | | | | | | | TIM8_TRIG | -| | | | | | | | | TIM8_COM | -| | | | | | | | | | -| Usage | | USART6_RX_1 | SPI1_RX_2 | SPI1_TX_1 | | TIM1_UP | SDIO | USART6_TX_2 | - */ - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// DMAMAP_USART3_RX // DMA1, Stream 1, Channel 4 -// DMAMAP_UART4_RX // DMA1, Stream 2, Channel 4 -// DMAMAP_UART7_RX // DMA1, Stream 3, Channel 5 -// AVAILABLE // DMA1, Stream 4 -// DMAMAP_USART2_RX // DMA1, Stream 5, Channel 4 -// DMAMAP_TIM4_UP // DMA1, Stream 6, Channel 2 (DSHOT) - - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// AVAILABLE // DMA2, Stream 0 -#define DMAMAP_USART6_RX DMAMAP_USART6_RX_1 // DMA2, Stream 1, Channel 4 (PX4IO RX) -#define DMACHAN_SPI1_RX DMAMAP_SPI1_RX_2 // DMA2, Stream 2, Channel 3 (SPI1 sensors RX) -#define DMACHAN_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 3, Channel 3 (SPI1 sensors TX) -// AVAILABLE // DMA2, Stream 4 -// DMAMAP_TIM1_UP // DMA2, Stream 5, Channel 6 (DSHOT) -#define DMAMAP_SDIO DMAMAP_SDIO_2 // DMA2, Stream 6, Channel 4 -#define DMAMAP_USART6_TX DMAMAP_USART6_TX_2 // DMA2, Stream 7, Channel 5 (PX4IO TX) diff --git a/boards/thepeach/k1/nuttx-config/nsh/defconfig b/boards/thepeach/k1/nuttx-config/nsh/defconfig deleted file mode 100644 index 3a63ed0..0000000 --- a/boards/thepeach/k1/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,254 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_STM32_CCMEXCLUDE is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/thepeach/k1/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F427V=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0001 -CONFIG_CDCACM_PRODUCTSTR="FCC-K1" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=2000 -CONFIG_CDCACM_VENDORID=0x35a7 -CONFIG_CDCACM_VENDORSTR="ThePeach" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXAMPLES_CALIB_UDELAY=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=2 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDIO_BLOCKSETUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32_ADC1=y -CONFIG_STM32_BBSRAM=y -CONFIG_STM32_BBSRAM_FILES=5 -CONFIG_STM32_BKPSRAM=y -CONFIG_STM32_CCMDATARAM=y -CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y -CONFIG_STM32_DMA1=y -CONFIG_STM32_DMA2=y -CONFIG_STM32_FLASH_CONFIG_I=y -CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_STM32_I2C1=y -CONFIG_STM32_I2C2=y -CONFIG_STM32_I2CTIMEOMS=10 -CONFIG_STM32_I2CTIMEOTICKS=10 -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_OTGFS=y -CONFIG_STM32_PWR=y -CONFIG_STM32_RTC=y -CONFIG_STM32_RTC_HSECLOCK=y -CONFIG_STM32_RTC_MAGIC=0xfacefeee -CONFIG_STM32_RTC_MAGIC_REG=1 -CONFIG_STM32_RTC_MAGIC_TIME_SET=0xfacefeef -CONFIG_STM32_SAVE_CRASHDUMP=y -CONFIG_STM32_SDIO=y -CONFIG_STM32_SDIO_CARD=y -CONFIG_STM32_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32_SPI1=y -CONFIG_STM32_SPI1_DMA=y -CONFIG_STM32_SPI1_DMA_BUFFER=512 -CONFIG_STM32_SPI2=y -CONFIG_STM32_SPI_DMATHRESHOLD=8 -CONFIG_STM32_TIM10=y -CONFIG_STM32_TIM11=y -CONFIG_STM32_TIM3=y -CONFIG_STM32_TIM9=y -CONFIG_STM32_UART4=y -CONFIG_STM32_UART7=y -CONFIG_STM32_UART8=y -CONFIG_STM32_USART1=y -CONFIG_STM32_USART2=y -CONFIG_STM32_USART3=y -CONFIG_STM32_USART6=y -CONFIG_STM32_USART_BREAKS=y -CONFIG_STM32_USART_SINGLEWIRE=y -CONFIG_STM32_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=300 -CONFIG_UART4_RXDMA=y -CONFIG_UART4_TXBUFSIZE=300 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=300 -CONFIG_UART7_RXDMA=y -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=300 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=300 -CONFIG_UART8_TXBUFSIZE=300 -CONFIG_USART1_RXBUFSIZE=128 -CONFIG_USART1_TXBUFSIZE=32 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=1100 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=300 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=600 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=300 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/thepeach/k1/nuttx-config/scripts/script.ld b/boards/thepeach/k1/nuttx-config/scripts/script.ld deleted file mode 100644 index 6d92733..0000000 --- a/boards/thepeach/k1/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************************** - * scripts/ld.script - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F427 has 2048Kb of FLASH beginning at address 0x0800:0000 and - * 256Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of SRAM beginning at address 0x2002:0000 - * 4) 64Kb of TCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 0x4000 of flash is reserved for the bootloader. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08004000, LENGTH = 2032K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 192K - ccsram (rwx) : ORIGIN = 0x10000000, LENGTH = 64K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/thepeach/k1/src/CMakeLists.txt b/boards/thepeach/k1/src/CMakeLists.txt deleted file mode 100644 index a7db459..0000000 --- a/boards/thepeach/k1/src/CMakeLists.txt +++ /dev/null @@ -1,50 +0,0 @@ -############################################################################ -# -# Copyright (c) 2015 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. -# -############################################################################ - -add_library(drivers_board - can.c - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - usb.c -) -target_link_libraries(drivers_board - PRIVATE - arch_spi - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer -) diff --git a/boards/thepeach/k1/src/board_config.h b/boards/thepeach/k1/src/board_config.h deleted file mode 100644 index 4b1542e..0000000 --- a/boards/thepeach/k1/src/board_config.h +++ /dev/null @@ -1,182 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013-2016 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * ThePeach K1 internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ -/* Configuration ************************************************************************************/ - -/* PX4IO connection configuration */ -#define BOARD_USES_PX4IO_VERSION 2 -#define PX4IO_SERIAL_DEVICE "/dev/ttyS4" -#define PX4IO_SERIAL_TX_GPIO GPIO_USART6_TX -#define PX4IO_SERIAL_RX_GPIO GPIO_USART6_RX -#define PX4IO_SERIAL_BASE STM32_USART6_BASE /* hardwired on the board */ -#define PX4IO_SERIAL_VECTOR STM32_IRQ_USART6 -#define PX4IO_SERIAL_TX_DMAMAP DMAMAP_USART6_TX -#define PX4IO_SERIAL_RX_DMAMAP DMAMAP_USART6_RX -#define PX4IO_SERIAL_RCC_REG STM32_RCC_APB2ENR -#define PX4IO_SERIAL_RCC_EN RCC_APB2ENR_USART6EN -#define PX4IO_SERIAL_CLOCK STM32_PCLK2_FREQUENCY -#define PX4IO_SERIAL_BITRATE 1500000 /* 1.5Mbps -> max rate for IO */ - - -/* PX4FMU GPIOs ***********************************************************************************/ -/* LEDs */ - -#define GPIO_LED1 (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN12) -#define BOARD_OVERLOAD_LED LED_RED - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that can be used by the Px4 Firmware in the adc driver - */ -#define ADC_CHANNELS (1 << 2) | (1 << 3) | (1 << 4) | (1 << 13) | (1 << 14) | (1 << 15) - -// ADC defines to be used in sensors.cpp to read from a particular channel -#define ADC_BATTERY_VOLTAGE_CHANNEL 2 -#define ADC_BATTERY_CURRENT_CHANNEL 3 -#define ADC_5V_RAIL_SENSE 4 -#define ADC_AIRSPEED_VOLTAGE_CHANNEL 15 - -/* Power supply control and monitoring GPIOs */ -// Signal is not connected -#define GPIO_VDD_5V_PERIPH_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN8) -#define GPIO_VDD_BRICK_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5) -#define GPIO_VDD_3V3_SENSORS_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN3) -#define GPIO_VDD_5V_PERIPH_OC (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN15) - -/* Tone alarm output */ -#define TONE_ALARM_TIMER 2 /* timer 2 */ -#define TONE_ALARM_CHANNEL 1 /* channel 1 */ -#define GPIO_TONE_ALARM_IDLE (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) -#define GPIO_TONE_ALARM (GPIO_ALT|GPIO_AF1|GPIO_SPEED_2MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN15) - -/* PWM - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 5 - -/* USB OTG FS - * - * PA9 OTG_FS_VBUS VBUS sensing (also connected to the green LED) - */ -#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 8 /* use timer8 for the HRT */ -#define HRT_TIMER_CHANNEL 1 /* use capture/compare channel */ - -/* PWM input driver. Use FMU AUX5 pins attached to timer4 channel 2 */ -#define PWMIN_TIMER 4 -#define PWMIN_TIMER_CHANNEL 2 -#define GPIO_PWM_IN GPIO_TIM4_CH2IN_2 - -/* By Providing BOARD_ADC_USB_CONNECTED this board support the ADC - * system_power interface, and therefore provides the true logic - * GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_BRICK_VALID (!px4_arch_gpioread(GPIO_VDD_BRICK_VALID)) -#define BOARD_ADC_SERVO_VALID (1) -#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_VDD_5V_PERIPH_OC)) -#define BOARD_ADC_HIPOWER_5V_OC (0) - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ - -#define BOARD_HAS_ON_RESET 1 - -#define BOARD_HAS_STATIC_MANIFEST 1 - -__BEGIN_DECLS - -/**************************************************************************************************** - * Public Types - ****************************************************************************************************/ - -/**************************************************************************************************** - * Public data - ****************************************************************************************************/ - -#ifndef __ASSEMBLY__ - -/**************************************************************************************************** - * Public Functions - ****************************************************************************************************/ - -extern void board_peripheral_reset(int ms); - -/**************************************************************************************************** - * Name: stm32_usbinitialize - * - * Description: - * Called to configure USB IO. - * - ****************************************************************************************************/ - -extern void stm32_usbinitialize(void); - -/**************************************************************************************************** - * Name: stm32_spiinitialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the PX4FMU board. - * - ****************************************************************************************************/ - -extern void stm32_spiinitialize(void); - -#include - -#endif /* __ASSEMBLY__ */ -__END_DECLS diff --git a/boards/thepeach/k1/src/can.c b/boards/thepeach/k1/src/can.c deleted file mode 100644 index 89b8ba2..0000000 --- a/boards/thepeach/k1/src/can.c +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file can.c - * - * Board-specific CAN functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include - -#include -#include - -#include "chip.h" -#include "arm_internal.h" - -#include "stm32.h" -#include "stm32_can.h" -#include "board_config.h" - -#ifdef CONFIG_CAN - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) -# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." -# undef CONFIG_STM32_CAN2 -#endif - -#ifdef CONFIG_STM32_CAN1 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); - -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} - -#endif diff --git a/boards/thepeach/k1/src/i2c.cpp b/boards/thepeach/k1/src/i2c.cpp deleted file mode 100644 index 63ec5a5..0000000 --- a/boards/thepeach/k1/src/i2c.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), - initI2CBusExternal(2), - -}; diff --git a/boards/thepeach/k1/src/init.c b/boards/thepeach/k1/src/init.c deleted file mode 100644 index 1073128..0000000 --- a/boards/thepeach/k1/src/init.c +++ /dev/null @@ -1,318 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * PX4FMU-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include "board_config.h" -#include - -#include - -#include -#include - -#include - -#include -#include -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/**************************************************************************** - * Protected Functions - ****************************************************************************/ -/**************************************************************************** - * Public Functions - ****************************************************************************/ -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(io_timer_channel_get_gpio_output(i)); - } - - /** - * On resets invoked from system (not boot) insure we establish a low - * output state (discharge the pins) on PWM pins before they become inputs. - */ - - if (status >= 0) { - up_mdelay(400); - } -} - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - /* set the peripheral rails off */ - stm32_configgpio(GPIO_VDD_5V_PERIPH_EN); - stm32_gpiowrite(GPIO_VDD_5V_PERIPH_EN, 1); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ - stm32_gpiowrite(GPIO_VDD_5V_PERIPH_EN, 0); -} - -/************************************************************************************ - * Name: stm32_boardinitialize - * - * Description: - * All STM32 architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. - * - ************************************************************************************/ - -__EXPORT void -stm32_boardinitialize(void) -{ - // Reset all PWM to Low outputs. - - board_on_reset(-1); - - /* configure LEDs */ - - board_autoled_initialize(); - - /* configure ADC pins */ - - px4_arch_configgpio(GPIO_ADC1_IN2); /* BATT_VOLTAGE_SENS */ - px4_arch_configgpio(GPIO_ADC1_IN3); /* BATT_CURRENT_SENS */ - px4_arch_configgpio(GPIO_ADC1_IN4); /* VDD_5V_SENS */ - px4_arch_configgpio(GPIO_ADC1_IN13); /* FMU_AUX_ADC_1 */ - px4_arch_configgpio(GPIO_ADC1_IN14); /* FMU_AUX_ADC_2 */ - px4_arch_configgpio(GPIO_ADC1_IN15); /* PRESSURE_SENS */ - - /* configure power supply control/sense pins */ - px4_arch_configgpio(GPIO_VDD_5V_PERIPH_EN); - px4_arch_configgpio(GPIO_VDD_3V3_SENSORS_EN); - px4_arch_configgpio(GPIO_VDD_BRICK_VALID); - px4_arch_configgpio(GPIO_VDD_5V_PERIPH_OC); - - /* configure CAN interface */ - - stm32_configgpio(GPIO_CAN1_RX); - stm32_configgpio(GPIO_CAN1_TX); - - /* configure SPI interfaces */ - - stm32_spiinitialize(); - - /* configure USB interface */ - - stm32_usbinitialize(); - -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - - -static struct spi_dev_s *spi1; -static struct spi_dev_s *spi2; -static struct sdio_dev_s *sdio; - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - - px4_platform_init(); - - /* configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_AMBER); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_AMBER); - } - - /* Configure SPI-based devices */ - - spi1 = px4_spibus_initialize(1); - - if (!spi1) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 1\n"); - led_on(LED_AMBER); - } - - /* Default SPI1 to 1MHz and de-assert the known chip selects. */ - SPI_SETFREQUENCY(spi1, 10000000); - SPI_SETBITS(spi1, 8); - SPI_SETMODE(spi1, SPIDEV_MODE3); - up_udelay(20); - - /* Get the SPI port for the FRAM */ - - spi2 = px4_spibus_initialize(2); - - if (!spi2) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 2\n"); - led_on(LED_AMBER); - } - - /* Default SPI2 to 37.5 MHz (40 MHz rounded to nearest valid divider, F4 max) - * and de-assert the known chip selects. */ - - // XXX start with 10.4 MHz in FRAM usage and go up to 37.5 once validated - SPI_SETFREQUENCY(spi2, 12 * 1000 * 1000); - SPI_SETBITS(spi2, 8); - SPI_SETMODE(spi2, SPIDEV_MODE3); - SPI_SELECT(spi2, SPIDEV_FLASH(0), false); - - -#ifdef CONFIG_MMCSD - /* First, get an instance of the SDIO interface */ - sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO); - - if (!sdio) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", CONFIG_NSH_MMCSDSLOTNO); - led_on(LED_AMBER); - } - - /* Now bind the SDIO interface to the MMC/SD driver */ - int ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio); - - if (ret != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); - led_on(LED_AMBER); - } - - /* Then let's guess and say that there is a card in the slot. There is no card detect GPIO. */ - sdio_mediachange(sdio, true); - -#endif - - /* Configure the HW based on the manifest */ - px4_platform_configure(); - - return OK; -} diff --git a/boards/thepeach/k1/src/led.c b/boards/thepeach/k1/src/led.c deleted file mode 100644 index 8a70a4c..0000000 --- a/boards/thepeach/k1/src/led.c +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * LED backend. - */ - -#include - -#include - -#include "stm32.h" -#include - -#include "board_config.h" - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -__EXPORT void led_init() -{ - /* Configure LED1 GPIO for output */ - - px4_arch_configgpio(GPIO_LED1); -} - -__EXPORT void led_on(int led) -{ - if (led == 1) { - /* Pull down to switch on */ - px4_arch_gpiowrite(GPIO_LED1, false); - } -} - -__EXPORT void led_off(int led) -{ - if (led == 1) { - /* Pull up to switch off */ - px4_arch_gpiowrite(GPIO_LED1, true); - } -} - -__EXPORT void led_toggle(int led) -{ - if (led == 1) { - if (px4_arch_gpioread(GPIO_LED1)) { - px4_arch_gpiowrite(GPIO_LED1, false); - - } else { - px4_arch_gpiowrite(GPIO_LED1, true); - } - } -} diff --git a/boards/thepeach/k1/src/spi.cpp b/boards/thepeach/k1/src/spi.cpp deleted file mode 100644 index 77d0c37..0000000 --- a/boards/thepeach/k1/src/spi.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortC, GPIO::Pin15}, SPI::DRDY{GPIO::PortC, GPIO::Pin14}), - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortD, GPIO::Pin7}), - initSPIDevice(DRV_IMU_DEVTYPE_MPU9250, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), - }), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/thepeach/k1/src/timer_config.cpp b/boards/thepeach/k1/src/timer_config.cpp deleted file mode 100644 index c96e7c5..0000000 --- a/boards/thepeach/k1/src/timer_config.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1), - initIOTimer(Timer::Timer4), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortE, GPIO::Pin13}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/thepeach/k1/src/usb.c b/boards/thepeach/k1/src/usb.c deleted file mode 100644 index eed7869..0000000 --- a/boards/thepeach/k1/src/usb.c +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include - -#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_STM32_OTGFS - px4_arch_configgpio(GPIO_OTGFS_VBUS); - /* XXX We only support device mode - px4_arch_configgpio(GPIO_OTGFS_PWRON); - px4_arch_configgpio(GPIO_OTGFS_OVER); - */ -#endif -} - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - //ulldbg("resume: %d\n", resume); -} diff --git a/boards/thepeach/r1/default.px4board b/boards/thepeach/r1/default.px4board deleted file mode 100644 index b2c6588..0000000 --- a/boards/thepeach/r1/default.px4board +++ /dev/null @@ -1,99 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS3" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS2" -CONFIG_BOARD_SERIAL_TEL4="/dev/ttyS6" -CONFIG_DRIVERS_ADC_ADS1115=y -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_COMMON_BAROMETERS=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU9250=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_COMMON_LIGHT=y -CONFIG_COMMON_MAGNETOMETER=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PCA9685_PWM_OUT=y -CONFIG_DRIVERS_PWM_INPUT=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_PX4IO=y -CONFIG_DRIVERS_SMART_BATTERY_BATMON=y -CONFIG_COMMON_TELEMETRY=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_BOARD_UAVCAN_INTERFACES=1 -CONFIG_MODULES_AIRSPEED_SELECTOR=y -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_ESC_BATTERY=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_FW_ATT_CONTROL=y -CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_FW_POS_CONTROL=y -CONFIG_MODULES_FW_RATE_CONTROL=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_ROVER_POS_CONTROL=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_MODULES_UUV_ATT_CONTROL=y -CONFIG_MODULES_UUV_POS_CONTROL=y -CONFIG_MODULES_VTOL_ATT_CONTROL=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BL_UPDATE=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SERIAL_TEST=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_FAKE_GPS=y diff --git a/boards/thepeach/r1/extras/px4_io-v2_default.bin b/boards/thepeach/r1/extras/px4_io-v2_default.bin deleted file mode 100755 index 957f0f1..0000000 Binary files a/boards/thepeach/r1/extras/px4_io-v2_default.bin and /dev/null differ diff --git a/boards/thepeach/r1/extras/thepeach_r1_bootloader.bin b/boards/thepeach/r1/extras/thepeach_r1_bootloader.bin deleted file mode 100755 index cdae810..0000000 Binary files a/boards/thepeach/r1/extras/thepeach_r1_bootloader.bin and /dev/null differ diff --git a/boards/thepeach/r1/firmware.prototype b/boards/thepeach/r1/firmware.prototype deleted file mode 100644 index 5db240d..0000000 --- a/boards/thepeach/r1/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 213, - "magic": "PX4FWv1", - "description": "Firmware for the ThePeach R1 board", - "image": "", - "build_time": 0, - "summary": "ThePeach R1", - "version": "0.1", - "image_size": 0, - "image_maxsize": 2080768, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/thepeach/r1/init/rc.board_defaults b/boards/thepeach/r1/init/rc.board_defaults deleted file mode 100644 index 5d8a3c1..0000000 --- a/boards/thepeach/r1/init/rc.board_defaults +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 18.1 -param set-default BAT1_A_PER_V 36.367515152 - -param set-default SYS_USE_IO 1 diff --git a/boards/thepeach/r1/init/rc.board_sensors b/boards/thepeach/r1/init/rc.board_sensors deleted file mode 100644 index fb2d1c3..0000000 --- a/boards/thepeach/r1/init/rc.board_sensors +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# -# Board specific sensors init -#------------------------------------------------------------------------------ -board_adc start - -# SPI1 -ms5611 -s -b 1 start -icm20602 -s -b 1 -R 0 start -mpu9250 -s -b 1 -R 0 -M start diff --git a/boards/thepeach/r1/nuttx-config/include/board.h b/boards/thepeach/r1/nuttx-config/include/board.h deleted file mode 100644 index 79c1f6d..0000000 --- a/boards/thepeach/r1/nuttx-config/include/board.h +++ /dev/null @@ -1,266 +0,0 @@ -/************************************************************************************ - * board.h - * include/arch/board/board.h - * - * Copyright (C) 2009, 2016, 2022 Gregory Nutt. All rights reserved. - * Authors: Gregory Nutt - * David Sidrane - * - * 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 NuttX 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. - * - ************************************************************************************/ - -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ -#include "board_dma_map.h" - -#include -#ifndef __ASSEMBLY__ -# include -#endif - -#include - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The ThePeach FCC-R1 uses a 24MHz crystal connected to the HSE. - * - * This is the "standard" configuration as set up by arch/arm/src/stm32f40xx_rcc.c: - * System Clock source : PLL (HSE) - * SYSCLK(Hz) : 168000000 Determined by PLL configuration - * HCLK(Hz) : 168000000 (STM32_RCC_CFGR_HPRE) - * AHB Prescaler : 1 (STM32_RCC_CFGR_HPRE) - * APB1 Prescaler : 4 (STM32_RCC_CFGR_PPRE1) - * APB2 Prescaler : 2 (STM32_RCC_CFGR_PPRE2) - * HSE Frequency(Hz) : 24000000 (STM32_BOARD_XTAL) - * PLLM : 24 (STM32_PLLCFG_PLLM) - * PLLN : 336 (STM32_PLLCFG_PLLN) - * PLLP : 2 (STM32_PLLCFG_PLLP) - * PLLQ : 7 (STM32_PLLCFG_PPQ) - * Main regulator output voltage : Scale1 mode Needed for high speed SYSCLK - * Flash Latency(WS) : 5 - * Prefetch Buffer : OFF - * Instruction cache : ON - * Data cache : ON - * Require 48MHz for USB OTG FS, : Enabled - * SDIO and RNG clock - */ - -/* HSI - 16 MHz RC factory-trimmed - * LSI - 32 KHz RC - * HSE - On-board crystal frequency is 24MHz - * LSE - not installed - */ - -#define STM32_BOARD_XTAL 24000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -//#define STM32_LSE_FREQUENCY 32768 - -/* Main PLL Configuration. - * - * PLL source is HSE - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * = (25,000,000 / 25) * 336 - * = 336,000,000 - * SYSCLK = PLL_VCO / PLLP - * = 336,000,000 / 2 = 168,000,000 - * USB OTG FS, SDIO and RNG Clock - * = PLL_VCO / PLLQ - * = 48,000,000 - */ - -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(24) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(336) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(7) - -#define STM32_SYSCLK_FREQUENCY 168000000ul - -/* AHB clock (HCLK) is SYSCLK (168MHz) */ - -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (42MHz) */ - -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (84MHz) */ - -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx - * otherwise frequency is 2xAPBx. - * Note: TIM1,8-11 are on APB2, others on APB1 - */ - -#define BOARD_TIM1_FREQUENCY STM32_APB2_TIM1_CLKIN -#define BOARD_TIM2_FREQUENCY STM32_APB1_TIM2_CLKIN -#define BOARD_TIM3_FREQUENCY STM32_APB1_TIM3_CLKIN -#define BOARD_TIM4_FREQUENCY STM32_APB1_TIM4_CLKIN -#define BOARD_TIM5_FREQUENCY STM32_APB1_TIM5_CLKIN -#define BOARD_TIM6_FREQUENCY STM32_APB1_TIM6_CLKIN -#define BOARD_TIM7_FREQUENCY STM32_APB1_TIM7_CLKIN -#define BOARD_TIM8_FREQUENCY STM32_APB2_TIM8_CLKIN -#define BOARD_TIM9_FREQUENCY STM32_APB2_TIM9_CLKIN -#define BOARD_TIM10_FREQUENCY STM32_APB2_TIM10_CLKIN -#define BOARD_TIM11_FREQUENCY STM32_APB2_TIM11_CLKIN -#define BOARD_TIM12_FREQUENCY STM32_APB1_TIM12_CLKIN -#define BOARD_TIM13_FREQUENCY STM32_APB1_TIM13_CLKIN -#define BOARD_TIM14_FREQUENCY STM32_APB1_TIM14_CLKIN - -/* SDIO dividers. Note that slower clocking is required when DMA is disabled - * in order to avoid RX overrun/TX underrun errors due to delayed responses - * to service FIFOs in interrupt driven mode. These values have not been - * tuned!!! - * - * SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(118+2)=400 KHz - */ - -#define SDIO_INIT_CLKDIV (118 << SDIO_CLKCR_CLKDIV_SHIFT) - -/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz - * DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32_SDIO_DMA -# define SDIO_MMCXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) -#else -# define SDIO_MMCXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) -#endif - -/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz - * DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32_SDIO_DMA -# define SDIO_SDXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) -#else -# define SDIO_SDXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) -#endif - -/* Alternate function pin selections ************************************************/ - -/* UARTs */ - -#define GPIO_USART1_RX GPIO_USART1_RX_1 /* Console in from IO */ -#define GPIO_USART1_TX 0 /* USART1 is RX-only */ - -#define GPIO_USART2_RX GPIO_USART2_RX_2 -#define GPIO_USART2_TX GPIO_USART2_TX_2 -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 -#define GPIO_USART2_CTS GPIO_USART2_CTS_2 - -#define GPIO_USART3_RX GPIO_USART3_RX_3 -#define GPIO_USART3_TX GPIO_USART3_TX_3 -#define GPIO_USART3_RTS GPIO_USART3_RTS_2 -#define GPIO_USART3_CTS GPIO_USART3_CTS_2 - -#define GPIO_UART4_RX GPIO_UART4_RX_1 -#define GPIO_UART4_TX GPIO_UART4_TX_1 - -#define GPIO_USART6_RX GPIO_USART6_RX_1 -#define GPIO_USART6_TX GPIO_USART6_TX_1 - -#define GPIO_UART7_RX GPIO_UART7_RX_1 -#define GPIO_UART7_TX GPIO_UART7_TX_1 - -/* UART8 has no alternate pin config */ - -/* CAN - * - * CAN1 is routed to the onboard transceiver. - */ - -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 - -/* I2C - * - * The optional _GPIO configurations allow the I2C driver to manually - * reset the bus to clear stuck slaves. They match the pin configuration, - * but are normally-high GPIOs. - */ - -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN8) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN9) - -/* SPI - * - * There are sensors on SPI1, and SPI2 is connected to the FRAM. - */ - -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 - -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_2 - -#define GPIO_SPI4_MISO GPIO_SPI4_MISO_1 -#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_1 -#define GPIO_SPI4_SCK GPIO_SPI4_SCK_1 - - -#endif /* __ARCH_BOARD_BOARD_H */ diff --git a/boards/thepeach/r1/nuttx-config/include/board_dma_map.h b/boards/thepeach/r1/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 96a4c81..0000000 --- a/boards/thepeach/r1/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/* -| DMA1 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | SPI3_RX_1 | - | SPI3_RX_2 | SPI2_RX | SPI2_TX | SPI3_TX_1 | - | SPI3_TX_2 | -| Channel 1 | I2C1_RX | - | TIM7_UP_1 | - | TIM7_UP_2 | I2C1_RX_1 | I2C1_TX | I2C1_TX_1 | -| Channel 2 | TIM4_CH1 | - | I2C4_RX | TIM4_CH2 | - | I2C4_RX | TIM4_UP | TIM4_CH3 | -| Channel 3 | - | TIM2_UP_1 | I2C3_RX_1 | I2C2_EXT_RX | I2C3_TX | TIM2_CH1 | TIM2_CH2 | TIM2_UP_2 | -| | | TIM2_CH3 | | | | | TIM2_CH4_1 | TIM2_CH4_2 | -| Channel 4 | UART5_RX | USART3_RX | UART4_RX | USART3_TX_1 | UART4_TX | USART2_RX | USART2_TX | UART5_TX | -| Channel 5 | UART8_TX | UART7_TX | TIM3_CH4 | UART7_RX | TIM3_CH1 | TIM3_CH2 | UART8_RX | TIM3_CH3 | -| | | | TIM3_UP | | TIM3_TRIG | | | | -| Channel 6 | TIM5_CH3 | TIM5_CH4_1 | TIM5_CH1 | TIM5_CH4_2 | TIM5_CH2 | - | TIM5_UP_2 | - | -| | TIM5_UP_1 | TIM5_TRIG_1 | | TIM5_TRIG_2 | | | | | -| Channel 7 | - | TIM6_UP | I2C2_RX | I2C2_RX_1 | USART3_TX_2 | DAC1 | DAC2 | I2C2_TX | -| | | | | | | | | | -| Usage | | USART3_RX | UART4_RX | UART7_RX | | USART2_RX | TIM4_UP | | - - -| DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | ADC1_1 | SAI1_A | TIM8_CH1_1 | SAI1_A_1 | ADC1_2 | SAI1_B_1 | TIM1_CH1_1 | - | -| | | | TIM8_CH2_1 | | | | TIM1_CH2_1 | | -| | | | TIM8_CH3_1 | | | | TIM1_CH3_1 | | -| Channel 1 | - | DCMI_1 | ADC2_1 | ADC2_2 | SAI1_B | SPI6_TX | SPI6_RX | DCMI_2 | -| Channel 2 | ADC3_1 | ADC3_2 | - | SPI5_RX_1 | SPI5_TX_1 | CRYP_OUT | CRYP_IN | HASH_IN | -| Channel 3 | SPI1_RX_1 | - | SPI1_RX_2 | SPI1_TX_1 | - | SPI1_TX_2 | - | QUADSPI | -| Channel 4 | SPI4_RX_1 | SPI4_TX_1 | USART1_RX_1 | SDIO | - | USART1_RX_2 | SDIO | USART1_TX | -| Channel 5 | - | USART6_RX_1 | USART6_RX_2 | SPI4_RX_2 | SPI4_TX_2 | - | USART6_TX_1 | USART6_TX_2 | -| Channel 6 | TIM1_TRIG_1 | TIM1_CH1_2 | TIM1_CH2_2 | TIM1_CH1 | TIM1_CH4 | TIM1_UP | TIM1_CH3_2 | - | -| | | | | | TIM1_TRIG_2 | | | | -| | | | | | TIM1_COM | | | | -| Channel 7 | - | TIM8_UP | TIM8_CH1_2 | TIM8_CH2_2 | TIM8_CH3_2 | SPI5_RX_2 | SPI5_TX_2 | TIM8_CH4 | -| | | | | | | | | TIM8_TRIG | -| | | | | | | | | TIM8_COM | -| | | | | | | | | | -| Usage | | USART6_RX_1 | SPI1_RX_2 | SPI1_TX_1 | | TIM1_UP | SDIO | USART6_TX_2 | - */ - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// DMAMAP_USART3_RX // DMA1, Stream 1, Channel 4 -// DMAMAP_UART4_RX // DMA1, Stream 2, Channel 4 -// DMAMAP_UART7_RX // DMA1, Stream 3, Channel 5 -// AVAILABLE // DMA1, Stream 4 -// DMAMAP_USART2_RX // DMA1, Stream 5, Channel 4 -// DMAMAP_TIM4_UP // DMA1, Stream 6, Channel 2 (DSHOT) - - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// AVAILABLE // DMA2, Stream 0 -#define DMAMAP_USART6_RX DMAMAP_USART6_RX_1 // DMA2, Stream 1, Channel 4 (PX4IO RX) -#define DMACHAN_SPI1_RX DMAMAP_SPI1_RX_2 // DMA2, Stream 2, Channel 3 (SPI1 sensors RX) -#define DMACHAN_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 3, Channel 3 (SPI1 sensors TX) -// AVAILABLE // DMA2, Stream 4 -// DMAMAP_TIM1_UP // DMA2, Stream 5, Channel 6 (DSHOT) -#define DMAMAP_SDIO DMAMAP_SDIO_2 // DMA2, Stream 6, Channel 4 -#define DMAMAP_USART6_TX DMAMAP_USART6_TX_2 // DMA2, Stream 7, Channel 5 (PX4IO TX) diff --git a/boards/thepeach/r1/nuttx-config/nsh/defconfig b/boards/thepeach/r1/nuttx-config/nsh/defconfig deleted file mode 100644 index 51a9be2..0000000 --- a/boards/thepeach/r1/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,253 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_STM32_CCMEXCLUDE is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/thepeach/r1/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F427V=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ARM_MPU_EARLY_RESET=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0002 -CONFIG_CDCACM_PRODUCTSTR="FCC-R1" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=2000 -CONFIG_CDCACM_VENDORID=0x35a7 -CONFIG_CDCACM_VENDORSTR="ThePeach" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_EXAMPLES_CALIB_UDELAY=y -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=2 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDIO_BLOCKSETUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32_ADC1=y -CONFIG_STM32_BBSRAM=y -CONFIG_STM32_BBSRAM_FILES=5 -CONFIG_STM32_BKPSRAM=y -CONFIG_STM32_CCMDATARAM=y -CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y -CONFIG_STM32_DMA1=y -CONFIG_STM32_DMA2=y -CONFIG_STM32_FLASH_CONFIG_I=y -CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_STM32_I2C1=y -CONFIG_STM32_I2CTIMEOMS=10 -CONFIG_STM32_I2CTIMEOTICKS=10 -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_OTGFS=y -CONFIG_STM32_PWR=y -CONFIG_STM32_RTC=y -CONFIG_STM32_RTC_HSECLOCK=y -CONFIG_STM32_RTC_MAGIC=0xfacefeee -CONFIG_STM32_RTC_MAGIC_REG=1 -CONFIG_STM32_RTC_MAGIC_TIME_SET=0xfacefeef -CONFIG_STM32_SAVE_CRASHDUMP=y -CONFIG_STM32_SDIO=y -CONFIG_STM32_SDIO_CARD=y -CONFIG_STM32_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32_SPI1=y -CONFIG_STM32_SPI1_DMA=y -CONFIG_STM32_SPI1_DMA_BUFFER=512 -CONFIG_STM32_SPI2=y -CONFIG_STM32_SPI_DMATHRESHOLD=8 -CONFIG_STM32_TIM10=y -CONFIG_STM32_TIM11=y -CONFIG_STM32_TIM3=y -CONFIG_STM32_TIM9=y -CONFIG_STM32_UART4=y -CONFIG_STM32_UART7=y -CONFIG_STM32_UART8=y -CONFIG_STM32_USART1=y -CONFIG_STM32_USART2=y -CONFIG_STM32_USART3=y -CONFIG_STM32_USART6=y -CONFIG_STM32_USART_BREAKS=y -CONFIG_STM32_USART_SINGLEWIRE=y -CONFIG_STM32_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=300 -CONFIG_UART4_RXDMA=y -CONFIG_UART4_TXBUFSIZE=300 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=300 -CONFIG_UART7_RXDMA=y -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=300 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=300 -CONFIG_UART8_TXBUFSIZE=300 -CONFIG_USART1_RXBUFSIZE=128 -CONFIG_USART1_TXBUFSIZE=32 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=1100 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=300 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=600 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=300 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/thepeach/r1/nuttx-config/scripts/script.ld b/boards/thepeach/r1/nuttx-config/scripts/script.ld deleted file mode 100644 index 6d92733..0000000 --- a/boards/thepeach/r1/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************************** - * scripts/ld.script - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F427 has 2048Kb of FLASH beginning at address 0x0800:0000 and - * 256Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of SRAM beginning at address 0x2002:0000 - * 4) 64Kb of TCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 0x4000 of flash is reserved for the bootloader. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08004000, LENGTH = 2032K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 192K - ccsram (rwx) : ORIGIN = 0x10000000, LENGTH = 64K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/thepeach/r1/src/CMakeLists.txt b/boards/thepeach/r1/src/CMakeLists.txt deleted file mode 100644 index a7db459..0000000 --- a/boards/thepeach/r1/src/CMakeLists.txt +++ /dev/null @@ -1,50 +0,0 @@ -############################################################################ -# -# Copyright (c) 2015 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. -# -############################################################################ - -add_library(drivers_board - can.c - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - usb.c -) -target_link_libraries(drivers_board - PRIVATE - arch_spi - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer -) diff --git a/boards/thepeach/r1/src/board_config.h b/boards/thepeach/r1/src/board_config.h deleted file mode 100644 index e828478..0000000 --- a/boards/thepeach/r1/src/board_config.h +++ /dev/null @@ -1,182 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013-2016 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * ThePeach R1 internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ -/* Configuration ************************************************************************************/ - -/* PX4IO connection configuration */ -#define BOARD_USES_PX4IO_VERSION 2 -#define PX4IO_SERIAL_DEVICE "/dev/ttyS4" -#define PX4IO_SERIAL_TX_GPIO GPIO_USART6_TX -#define PX4IO_SERIAL_RX_GPIO GPIO_USART6_RX -#define PX4IO_SERIAL_BASE STM32_USART6_BASE /* hardwired on the board */ -#define PX4IO_SERIAL_VECTOR STM32_IRQ_USART6 -#define PX4IO_SERIAL_TX_DMAMAP DMAMAP_USART6_TX -#define PX4IO_SERIAL_RX_DMAMAP DMAMAP_USART6_RX -#define PX4IO_SERIAL_RCC_REG STM32_RCC_APB2ENR -#define PX4IO_SERIAL_RCC_EN RCC_APB2ENR_USART6EN -#define PX4IO_SERIAL_CLOCK STM32_PCLK2_FREQUENCY -#define PX4IO_SERIAL_BITRATE 1500000 /* 1.5Mbps -> max rate for IO */ - - -/* PX4FMU GPIOs ***********************************************************************************/ -/* LEDs */ - -#define GPIO_LED1 (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN12) -#define BOARD_OVERLOAD_LED LED_RED - -/* - * ADC channels - * - * These are the channel numbers of the ADCs of the microcontroller that can be used by the Px4 Firmware in the adc driver - */ -#define ADC_CHANNELS (1 << 2) | (1 << 3) | (1 << 4) | (1 << 13) | (1 << 14) | (1 << 15) - -// ADC defines to be used in sensors.cpp to read from a particular channel -#define ADC_BATTERY_VOLTAGE_CHANNEL 2 -#define ADC_BATTERY_CURRENT_CHANNEL 3 -#define ADC_5V_RAIL_SENSE 4 -#define ADC_AIRSPEED_VOLTAGE_CHANNEL 15 - -/* Power supply control and monitoring GPIOs */ -// Signal is not connected -#define GPIO_VDD_5V_PERIPH_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN8) -#define GPIO_VDD_BRICK_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5) -#define GPIO_VDD_3V3_SENSORS_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN3) -#define GPIO_VDD_5V_PERIPH_OC (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN15) - -/* Tone alarm output */ -#define TONE_ALARM_TIMER 2 /* timer 2 */ -#define TONE_ALARM_CHANNEL 1 /* channel 1 */ -#define GPIO_TONE_ALARM_IDLE (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) -#define GPIO_TONE_ALARM (GPIO_ALT|GPIO_AF1|GPIO_SPEED_2MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN15) - -/* PWM - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 6 - -/* USB OTG FS - * - * PA9 OTG_FS_VBUS VBUS sensing (also connected to the green LED) - */ -#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 8 /* use timer8 for the HRT */ -#define HRT_TIMER_CHANNEL 1 /* use capture/compare channel */ - -/* PWM input driver. Use FMU AUX5 pins attached to timer4 channel 2 */ -#define PWMIN_TIMER 4 -#define PWMIN_TIMER_CHANNEL 2 -#define GPIO_PWM_IN GPIO_TIM4_CH2IN_2 - -/* By Providing BOARD_ADC_USB_CONNECTED this board support the ADC - * system_power interface, and therefore provides the true logic - * GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_BRICK_VALID (!px4_arch_gpioread(GPIO_VDD_BRICK_VALID)) -#define BOARD_ADC_SERVO_VALID (1) -#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_VDD_5V_PERIPH_OC)) -#define BOARD_ADC_HIPOWER_5V_OC (0) - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -/* This board provides the board_on_reset interface */ - -#define BOARD_HAS_ON_RESET 1 - -#define BOARD_HAS_STATIC_MANIFEST 1 - -__BEGIN_DECLS - -/**************************************************************************************************** - * Public Types - ****************************************************************************************************/ - -/**************************************************************************************************** - * Public data - ****************************************************************************************************/ - -#ifndef __ASSEMBLY__ - -/**************************************************************************************************** - * Public Functions - ****************************************************************************************************/ - -extern void board_peripheral_reset(int ms); - -/**************************************************************************************************** - * Name: stm32_usbinitialize - * - * Description: - * Called to configure USB IO. - * - ****************************************************************************************************/ - -extern void stm32_usbinitialize(void); - -/**************************************************************************************************** - * Name: stm32_spiinitialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the PX4FMU board. - * - ****************************************************************************************************/ - -extern void stm32_spiinitialize(void); - -#include - -#endif /* __ASSEMBLY__ */ -__END_DECLS diff --git a/boards/thepeach/r1/src/can.c b/boards/thepeach/r1/src/can.c deleted file mode 100644 index 89b8ba2..0000000 --- a/boards/thepeach/r1/src/can.c +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file can.c - * - * Board-specific CAN functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include - -#include -#include - -#include "chip.h" -#include "arm_internal.h" - -#include "stm32.h" -#include "stm32_can.h" -#include "board_config.h" - -#ifdef CONFIG_CAN - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) -# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." -# undef CONFIG_STM32_CAN2 -#endif - -#ifdef CONFIG_STM32_CAN1 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); - -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} - -#endif diff --git a/boards/thepeach/r1/src/i2c.cpp b/boards/thepeach/r1/src/i2c.cpp deleted file mode 100644 index e9f26f9..0000000 --- a/boards/thepeach/r1/src/i2c.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), -}; diff --git a/boards/thepeach/r1/src/init.c b/boards/thepeach/r1/src/init.c deleted file mode 100644 index 1073128..0000000 --- a/boards/thepeach/r1/src/init.c +++ /dev/null @@ -1,318 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * PX4FMU-specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include "board_config.h" -#include - -#include - -#include -#include - -#include - -#include -#include -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/**************************************************************************** - * Protected Functions - ****************************************************************************/ -/**************************************************************************** - * Public Functions - ****************************************************************************/ -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(io_timer_channel_get_gpio_output(i)); - } - - /** - * On resets invoked from system (not boot) insure we establish a low - * output state (discharge the pins) on PWM pins before they become inputs. - */ - - if (status >= 0) { - up_mdelay(400); - } -} - -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - /* set the peripheral rails off */ - stm32_configgpio(GPIO_VDD_5V_PERIPH_EN); - stm32_gpiowrite(GPIO_VDD_5V_PERIPH_EN, 1); - - /* wait for the peripheral rail to reach GND */ - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - /* re-enable power */ - - /* switch the peripheral rail back on */ - stm32_gpiowrite(GPIO_VDD_5V_PERIPH_EN, 0); -} - -/************************************************************************************ - * Name: stm32_boardinitialize - * - * Description: - * All STM32 architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. - * - ************************************************************************************/ - -__EXPORT void -stm32_boardinitialize(void) -{ - // Reset all PWM to Low outputs. - - board_on_reset(-1); - - /* configure LEDs */ - - board_autoled_initialize(); - - /* configure ADC pins */ - - px4_arch_configgpio(GPIO_ADC1_IN2); /* BATT_VOLTAGE_SENS */ - px4_arch_configgpio(GPIO_ADC1_IN3); /* BATT_CURRENT_SENS */ - px4_arch_configgpio(GPIO_ADC1_IN4); /* VDD_5V_SENS */ - px4_arch_configgpio(GPIO_ADC1_IN13); /* FMU_AUX_ADC_1 */ - px4_arch_configgpio(GPIO_ADC1_IN14); /* FMU_AUX_ADC_2 */ - px4_arch_configgpio(GPIO_ADC1_IN15); /* PRESSURE_SENS */ - - /* configure power supply control/sense pins */ - px4_arch_configgpio(GPIO_VDD_5V_PERIPH_EN); - px4_arch_configgpio(GPIO_VDD_3V3_SENSORS_EN); - px4_arch_configgpio(GPIO_VDD_BRICK_VALID); - px4_arch_configgpio(GPIO_VDD_5V_PERIPH_OC); - - /* configure CAN interface */ - - stm32_configgpio(GPIO_CAN1_RX); - stm32_configgpio(GPIO_CAN1_TX); - - /* configure SPI interfaces */ - - stm32_spiinitialize(); - - /* configure USB interface */ - - stm32_usbinitialize(); - -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - - -static struct spi_dev_s *spi1; -static struct spi_dev_s *spi2; -static struct sdio_dev_s *sdio; - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - - px4_platform_init(); - - /* configure the DMA allocator */ - - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - /* initial LED state */ - drv_led_start(); - led_off(LED_AMBER); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_AMBER); - } - - /* Configure SPI-based devices */ - - spi1 = px4_spibus_initialize(1); - - if (!spi1) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 1\n"); - led_on(LED_AMBER); - } - - /* Default SPI1 to 1MHz and de-assert the known chip selects. */ - SPI_SETFREQUENCY(spi1, 10000000); - SPI_SETBITS(spi1, 8); - SPI_SETMODE(spi1, SPIDEV_MODE3); - up_udelay(20); - - /* Get the SPI port for the FRAM */ - - spi2 = px4_spibus_initialize(2); - - if (!spi2) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 2\n"); - led_on(LED_AMBER); - } - - /* Default SPI2 to 37.5 MHz (40 MHz rounded to nearest valid divider, F4 max) - * and de-assert the known chip selects. */ - - // XXX start with 10.4 MHz in FRAM usage and go up to 37.5 once validated - SPI_SETFREQUENCY(spi2, 12 * 1000 * 1000); - SPI_SETBITS(spi2, 8); - SPI_SETMODE(spi2, SPIDEV_MODE3); - SPI_SELECT(spi2, SPIDEV_FLASH(0), false); - - -#ifdef CONFIG_MMCSD - /* First, get an instance of the SDIO interface */ - sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO); - - if (!sdio) { - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", CONFIG_NSH_MMCSDSLOTNO); - led_on(LED_AMBER); - } - - /* Now bind the SDIO interface to the MMC/SD driver */ - int ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio); - - if (ret != OK) { - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); - led_on(LED_AMBER); - } - - /* Then let's guess and say that there is a card in the slot. There is no card detect GPIO. */ - sdio_mediachange(sdio, true); - -#endif - - /* Configure the HW based on the manifest */ - px4_platform_configure(); - - return OK; -} diff --git a/boards/thepeach/r1/src/led.c b/boards/thepeach/r1/src/led.c deleted file mode 100644 index 8a70a4c..0000000 --- a/boards/thepeach/r1/src/led.c +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * LED backend. - */ - -#include - -#include - -#include "stm32.h" -#include - -#include "board_config.h" - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - -__EXPORT void led_init() -{ - /* Configure LED1 GPIO for output */ - - px4_arch_configgpio(GPIO_LED1); -} - -__EXPORT void led_on(int led) -{ - if (led == 1) { - /* Pull down to switch on */ - px4_arch_gpiowrite(GPIO_LED1, false); - } -} - -__EXPORT void led_off(int led) -{ - if (led == 1) { - /* Pull up to switch off */ - px4_arch_gpiowrite(GPIO_LED1, true); - } -} - -__EXPORT void led_toggle(int led) -{ - if (led == 1) { - if (px4_arch_gpioread(GPIO_LED1)) { - px4_arch_gpiowrite(GPIO_LED1, false); - - } else { - px4_arch_gpiowrite(GPIO_LED1, true); - } - } -} diff --git a/boards/thepeach/r1/src/spi.cpp b/boards/thepeach/r1/src/spi.cpp deleted file mode 100644 index 77d0c37..0000000 --- a/boards/thepeach/r1/src/spi.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortC, GPIO::Pin15}, SPI::DRDY{GPIO::PortC, GPIO::Pin14}), - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortD, GPIO::Pin7}), - initSPIDevice(DRV_IMU_DEVTYPE_MPU9250, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), - }), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10}), - }), -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); diff --git a/boards/thepeach/r1/src/timer_config.cpp b/boards/thepeach/r1/src/timer_config.cpp deleted file mode 100644 index 7bf538a..0000000 --- a/boards/thepeach/r1/src/timer_config.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1), - initIOTimer(Timer::Timer4), -}; - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortE, GPIO::Pin13}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannelOutputClear(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/thepeach/r1/src/usb.c b/boards/thepeach/r1/src/usb.c deleted file mode 100644 index eed7869..0000000 --- a/boards/thepeach/r1/src/usb.c +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * Board-specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include - -#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_STM32_OTGFS - px4_arch_configgpio(GPIO_OTGFS_VBUS); - /* XXX We only support device mode - px4_arch_configgpio(GPIO_OTGFS_PWRON); - px4_arch_configgpio(GPIO_OTGFS_OVER); - */ -#endif -} - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - //ulldbg("resume: %d\n", resume); -} diff --git a/boards/uvify/core/default.px4board b/boards/uvify/core/default.px4board deleted file mode 100644 index bdc591a..0000000 --- a/boards/uvify/core/default.px4board +++ /dev/null @@ -1,87 +0,0 @@ -CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" -CONFIG_BOARD_ARCHITECTURE="cortex-m4" -CONFIG_BOARD_CONSTRAINED_MEMORY=y -CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS3" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS1" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS2" -CONFIG_BOARD_SERIAL_TEL3="/dev/ttyS6" -CONFIG_DRIVERS_ADC_BOARD_ADC=y -CONFIG_DRIVERS_BAROMETER_MS5611=y -CONFIG_DRIVERS_BATT_SMBUS=y -CONFIG_DRIVERS_CAMERA_CAPTURE=y -CONFIG_DRIVERS_CAMERA_TRIGGER=y -CONFIG_COMMON_DISTANCE_SENSOR=y -CONFIG_DRIVERS_DSHOT=y -CONFIG_DRIVERS_GPS=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y -CONFIG_DRIVERS_IMU_INVENSENSE_ICM20608G=y -CONFIG_DRIVERS_IMU_INVENSENSE_MPU9250=y -CONFIG_DRIVERS_IRLOCK=y -CONFIG_DRIVERS_LIGHTS_RGBLED_NCP5623C=y -CONFIG_DRIVERS_MAGNETOMETER_BOSCH_BMM150=y -CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8310=y -CONFIG_DRIVERS_MAGNETOMETER_LIS3MDL=y -CONFIG_COMMON_OPTICAL_FLOW=y -CONFIG_DRIVERS_PWM_INPUT=y -CONFIG_DRIVERS_PWM_OUT=y -CONFIG_DRIVERS_RC_INPUT=y -CONFIG_DRIVERS_TONE_ALARM=y -CONFIG_DRIVERS_UAVCAN=y -CONFIG_BOARD_UAVCAN_INTERFACES=1 -CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y -CONFIG_MODULES_BATTERY_STATUS=y -CONFIG_MODULES_CAMERA_FEEDBACK=y -CONFIG_MODULES_COMMANDER=y -CONFIG_MODULES_CONTROL_ALLOCATOR=y -CONFIG_MODULES_DATAMAN=y -CONFIG_MODULES_EKF2=y -CONFIG_MODULES_EVENTS=y -CONFIG_MODULES_FLIGHT_MODE_MANAGER=y -CONFIG_MODULES_GIMBAL=y -CONFIG_MODULES_GYRO_CALIBRATION=y -CONFIG_MODULES_GYRO_FFT=y -CONFIG_MODULES_LAND_DETECTOR=y -CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y -CONFIG_MODULES_LOAD_MON=y -CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y -CONFIG_MODULES_LOGGER=y -CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y -CONFIG_MODULES_MANUAL_CONTROL=y -CONFIG_MODULES_MAVLINK=y -CONFIG_MODULES_MC_ATT_CONTROL=y -CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y -CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y -CONFIG_MODULES_MC_POS_CONTROL=y -CONFIG_MODULES_MC_RATE_CONTROL=y -CONFIG_MODULES_NAVIGATOR=y -CONFIG_MODULES_RC_UPDATE=y -CONFIG_MODULES_SENSORS=y -CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y -CONFIG_MODULES_TEMPERATURE_COMPENSATION=y -CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y -CONFIG_SYSTEMCMDS_BL_UPDATE=y -CONFIG_SYSTEMCMDS_BSONDUMP=y -CONFIG_SYSTEMCMDS_DMESG=y -CONFIG_SYSTEMCMDS_DUMPFILE=y -CONFIG_SYSTEMCMDS_GPIO=y -CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y -CONFIG_SYSTEMCMDS_I2CDETECT=y -CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MTD=y -CONFIG_SYSTEMCMDS_NSHTERM=y -CONFIG_SYSTEMCMDS_PARAM=y -CONFIG_SYSTEMCMDS_PERF=y -CONFIG_SYSTEMCMDS_REBOOT=y -CONFIG_SYSTEMCMDS_REFLECT=y -CONFIG_SYSTEMCMDS_SD_BENCH=y -CONFIG_SYSTEMCMDS_SD_STRESS=y -CONFIG_SYSTEMCMDS_SERIAL_TEST=y -CONFIG_SYSTEMCMDS_SYSTEM_TIME=y -CONFIG_SYSTEMCMDS_TOP=y -CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y -CONFIG_SYSTEMCMDS_TUNE_CONTROL=y -CONFIG_SYSTEMCMDS_UORB=y -CONFIG_SYSTEMCMDS_USB_CONNECTED=y -CONFIG_SYSTEMCMDS_VER=y -CONFIG_SYSTEMCMDS_WORK_QUEUE=y diff --git a/boards/uvify/core/extras/uvify_core_bootloader.bin b/boards/uvify/core/extras/uvify_core_bootloader.bin deleted file mode 100644 index 990cfaf..0000000 Binary files a/boards/uvify/core/extras/uvify_core_bootloader.bin and /dev/null differ diff --git a/boards/uvify/core/firmware.prototype b/boards/uvify/core/firmware.prototype deleted file mode 100644 index 88971ff..0000000 --- a/boards/uvify/core/firmware.prototype +++ /dev/null @@ -1,13 +0,0 @@ -{ - "board_id": 20, - "magic": "UVFYCORE", - "description": "Firmware for the UVify Core flight controller", - "image": "", - "build_time": 0, - "summary": "UVify Core", - "version": "0.1", - "image_size": 0, - "image_maxsize": 2080768, - "git_identity": "", - "board_revision": 0 -} diff --git a/boards/uvify/core/init/rc.board_defaults b/boards/uvify/core/init/rc.board_defaults deleted file mode 100644 index fedd27a..0000000 --- a/boards/uvify/core/init/rc.board_defaults +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# -# board specific defaults -#------------------------------------------------------------------------------ - -param set-default BAT1_V_DIV 10.14 -param set-default BAT1_A_PER_V 18.18 - -# don't probe external I2C -param set-default SENS_EXT_I2C_PRB 0 diff --git a/boards/uvify/core/init/rc.board_extras b/boards/uvify/core/init/rc.board_extras deleted file mode 100644 index 2acb1c1..0000000 --- a/boards/uvify/core/init/rc.board_extras +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# -# UVify UVF4 specific board extras init -#------------------------------------------------------------------------------ - - -# IFO -if param compare SYS_AUTOSTART 4071 -then - # IFO has only external i2c barometer. - # It does not start EKF2 in the beginning which is strange behaviour. but 3 seconds hack. - # We intentionally put this initialization to here for delayed initialization. - sleep 4 - if ! ms5611 -T 5607 -X start - then - ms5611 -X start - fi -fi diff --git a/boards/uvify/core/init/rc.board_sensors b/boards/uvify/core/init/rc.board_sensors deleted file mode 100644 index 88f8463..0000000 --- a/boards/uvify/core/init/rc.board_sensors +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# UVify UVF4 specific board sensors init -#------------------------------------------------------------------------------ - -board_adc start - -# Internal SPI -if ! ms5611 -T 5607 -s start -then - ms5611 -s start -fi - -# Draco-R -if param compare SYS_AUTOSTART 6002 -then - # GPS LED - rgbled_ncp5623c start -X -a 0x38 - - #icm20608g -s -R 10 start - mpu9250 start -s -R 10 - - # Default GNSS with LIS3MDL magnetometer with external i2c. - lis3mdl start -R 2 -X -fi - -# Draco -if param compare SYS_AUTOSTART 4072 -then - mpu9250 start -s -R 8 -fi - -# IFO -if param compare SYS_AUTOSTART 4071 -then - # IFO GPS LED - rgbled_ncp5623c start -X -a 0x38 - - mpu9250 start -s -R 8 - lis3mdl start -R 2 -X -fi - -# IFO-S -if param compare SYS_AUTOSTART 4073 -then - # IFO GPS LED - rgbled_ncp5623c start -X -a 0x38 - - # IMU - mpu9250 start -s -R 8 - lis3mdl start -R 2 -X - - # FLOW on SPI2 - pmw3901 start -s -b 2 -fi diff --git a/boards/uvify/core/nuttx-config/include/board.h b/boards/uvify/core/nuttx-config/include/board.h deleted file mode 100644 index 1baed6c..0000000 --- a/boards/uvify/core/nuttx-config/include/board.h +++ /dev/null @@ -1,299 +0,0 @@ -/************************************************************************************ - * configs/px4fmu/include/board.h - * include/arch/board/board.h - * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ************************************************************************************/ - -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H - -/************************************************************************************ - * Included Files - ************************************************************************************/ -#include "board_dma_map.h" - -#include -#ifndef __ASSEMBLY__ -# include -#endif - -#include - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/* Clocking *************************************************************************/ -/* The UVify Core uses a 24MHz crystal connected to the HSE. - * - * This is the "standard" configuration as set up by arch/arm/src/stm32f40xx_rcc.c: - * System Clock source : PLL (HSE) - * SYSCLK(Hz) : 168000000 Determined by PLL configuration - * HCLK(Hz) : 168000000 (STM32_RCC_CFGR_HPRE) - * AHB Prescaler : 1 (STM32_RCC_CFGR_HPRE) - * APB1 Prescaler : 4 (STM32_RCC_CFGR_PPRE1) - * APB2 Prescaler : 2 (STM32_RCC_CFGR_PPRE2) - * HSE Frequency(Hz) : 24000000 (STM32_BOARD_XTAL) - * PLLM : 24 (STM32_PLLCFG_PLLM) - * PLLN : 336 (STM32_PLLCFG_PLLN) - * PLLP : 2 (STM32_PLLCFG_PLLP) - * PLLQ : 7 (STM32_PLLCFG_PPQ) - * Main regulator output voltage : Scale1 mode Needed for high speed SYSCLK - * Flash Latency(WS) : 5 - * Prefetch Buffer : OFF - * Instruction cache : ON - * Data cache : ON - * Require 48MHz for USB OTG FS, : Enabled - * SDIO and RNG clock - */ - -/* HSI - 16 MHz RC factory-trimmed - * LSI - 32 KHz RC - * HSE - On-board crystal frequency is 24MHz - * LSE - not installed - */ - -#define STM32_BOARD_XTAL 24000000ul - -#define STM32_HSI_FREQUENCY 16000000ul -#define STM32_LSI_FREQUENCY 32000 -#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL -//#define STM32_LSE_FREQUENCY 32768 - -/* Main PLL Configuration. - * - * PLL source is HSE - * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN - * = (25,000,000 / 25) * 336 - * = 336,000,000 - * SYSCLK = PLL_VCO / PLLP - * = 336,000,000 / 2 = 168,000,000 - * USB OTG FS, SDIO and RNG Clock - * = PLL_VCO / PLLQ - * = 48,000,000 - */ - -#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(24) -#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(336) -#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_2 -#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(7) - -#define STM32_SYSCLK_FREQUENCY 168000000ul - -/* AHB clock (HCLK) is SYSCLK (168MHz) */ - -#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */ -#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY -#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */ - -/* APB1 clock (PCLK1) is HCLK/4 (42MHz) */ - -#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd4 /* PCLK1 = HCLK / 4 */ -#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/4) - -/* Timers driven from APB1 will be twice PCLK1 */ - -#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY) -#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY) - -/* APB2 clock (PCLK2) is HCLK/2 (84MHz) */ - -#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */ -#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2) - -/* Timers driven from APB2 will be twice PCLK2 */ - -#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM9_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) -#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) - -/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx - * otherwise frequency is 2xAPBx. - * Note: TIM1,8-11 are on APB2, others on APB1 - */ - -#define BOARD_TIM1_FREQUENCY STM32_APB2_TIM1_CLKIN -#define BOARD_TIM2_FREQUENCY STM32_APB1_TIM2_CLKIN -#define BOARD_TIM3_FREQUENCY STM32_APB1_TIM3_CLKIN -#define BOARD_TIM4_FREQUENCY STM32_APB1_TIM4_CLKIN -#define BOARD_TIM5_FREQUENCY STM32_APB1_TIM5_CLKIN -#define BOARD_TIM6_FREQUENCY STM32_APB1_TIM6_CLKIN -#define BOARD_TIM7_FREQUENCY STM32_APB1_TIM7_CLKIN -#define BOARD_TIM8_FREQUENCY STM32_APB2_TIM8_CLKIN -#define BOARD_TIM9_FREQUENCY STM32_APB2_TIM9_CLKIN -#define BOARD_TIM10_FREQUENCY STM32_APB2_TIM10_CLKIN -#define BOARD_TIM11_FREQUENCY STM32_APB2_TIM11_CLKIN -#define BOARD_TIM12_FREQUENCY STM32_APB1_TIM12_CLKIN -#define BOARD_TIM13_FREQUENCY STM32_APB1_TIM13_CLKIN -#define BOARD_TIM14_FREQUENCY STM32_APB1_TIM14_CLKIN - -/* SDIO dividers. Note that slower clocking is required when DMA is disabled - * in order to avoid RX overrun/TX underrun errors due to delayed responses - * to service FIFOs in interrupt driven mode. These values have not been - * tuned!!! - * - * SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(118+2)=400 KHz - */ - -#define SDIO_INIT_CLKDIV (118 << SDIO_CLKCR_CLKDIV_SHIFT) - -/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz - * DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32_SDIO_DMA -# define SDIO_MMCXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) -#else -# define SDIO_MMCXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) -#endif - -/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz - * DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz - */ - -#ifdef CONFIG_STM32_SDIO_DMA -# define SDIO_SDXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) -#else -# define SDIO_SDXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) -#endif - -/* Alternate function pin selections ************************************************/ - -/* - * UARTs. - */ -#define GPIO_USART1_RX GPIO_USART1_RX_2 /* ESP8266 */ -#define GPIO_USART1_TX GPIO_USART1_TX_2 - -#define GPIO_USART2_RX GPIO_USART2_RX_2 -#define GPIO_USART2_TX GPIO_USART2_TX_2 -#define GPIO_USART2_RTS GPIO_USART2_RTS_2 -#define GPIO_USART2_CTS GPIO_USART2_CTS_2 - -#define GPIO_USART3_RX GPIO_USART3_RX_3 -#define GPIO_USART3_TX GPIO_USART3_TX_3 -#define GPIO_USART3_RTS GPIO_USART3_RTS_2 -#define GPIO_USART3_CTS GPIO_USART3_CTS_2 - -#define GPIO_UART4_RX GPIO_UART4_RX_1 -#define GPIO_UART4_TX GPIO_UART4_TX_1 - -#define GPIO_USART6_RX GPIO_USART6_RX_1 /* RC_INPUT */ -#define GPIO_USART6_TX GPIO_USART6_TX_1 - -#define GPIO_UART7_RX GPIO_UART7_RX_1 -#define GPIO_UART7_TX GPIO_UART7_TX_1 - -/* UART8 has no alternate pin config */ - - -/* - * CAN - * - * CAN1 is routed to the onboard transceiver. - */ -#define GPIO_CAN1_RX GPIO_CAN1_RX_3 -#define GPIO_CAN1_TX GPIO_CAN1_TX_3 - -/* - * I2C - * - * The optional _GPIO configurations allow the I2C driver to manually - * reset the bus to clear stuck slaves. They match the pin configuration, - * but are normally-high GPIOs. - */ -#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2 -#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2 -#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN8) -#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN9) - - -/* - * SPI - * - * There are sensors on SPI1, and SPI2 is connected to the FRAM. - */ -#define GPIO_SPI1_MISO (GPIO_SPI1_MISO_1|GPIO_SPEED_50MHz) -#define GPIO_SPI1_MOSI (GPIO_SPI1_MOSI_1|GPIO_SPEED_50MHz) -#define GPIO_SPI1_SCK (GPIO_SPI1_SCK_1|GPIO_SPEED_50MHz) - -#define GPIO_SPI2_MISO (GPIO_SPI2_MISO_1|GPIO_SPEED_50MHz) -#define GPIO_SPI2_MOSI (GPIO_SPI2_MOSI_1|GPIO_SPEED_50MHz) -#define GPIO_SPI2_SCK (GPIO_SPI2_SCK_1|GPIO_SPEED_50MHz) - -#if defined(CONFIG_STM32_SPI4) -# define GPIO_SPI4_MISO (GPIO_SPI4_MISO_1|GPIO_SPEED_50MHz) -# define GPIO_SPI4_MOSI (GPIO_SPI4_MOSI_1|GPIO_SPEED_50MHz) -# define GPIO_SPI4_SCK (GPIO_SPI4_SCK_1|GPIO_SPEED_50MHz) -#endif - -/* Board provides GPIO or other Hardware for signaling to timing analyzer */ - -#if defined(CONFIG_BOARD_USE_PROBES) -# define PROBE_N(n) (1<<((n)-1)) -# define PROBE_1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN14) -# define PROBE_2 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN13) -# define PROBE_3 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN11) -# define PROBE_4 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN9) -# define PROBE_5 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN13) -# define PROBE_6 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN14) - -# define PROBE_INIT(mask) \ - do { \ - if ((mask)& PROBE_N(1)) { stm32_configgpio(PROBE_1); } \ - if ((mask)& PROBE_N(2)) { stm32_configgpio(PROBE_2); } \ - if ((mask)& PROBE_N(3)) { stm32_configgpio(PROBE_3); } \ - if ((mask)& PROBE_N(4)) { stm32_configgpio(PROBE_4); } \ - if ((mask)& PROBE_N(5)) { stm32_configgpio(PROBE_5); } \ - if ((mask)& PROBE_N(6)) { stm32_configgpio(PROBE_6); } \ - } while(0) - -# define PROBE(n,s) do {stm32_gpiowrite(PROBE_##n,(s));}while(0) -# define PROBE_MARK(n) PROBE(n,false);PROBE(n,true) -#else -# define PROBE_INIT(mask) -# define PROBE(n,s) -# define PROBE_MARK(n) -#endif - - -#endif /* __ARCH_BOARD_BOARD_H */ diff --git a/boards/uvify/core/nuttx-config/include/board_dma_map.h b/boards/uvify/core/nuttx-config/include/board_dma_map.h deleted file mode 100644 index 19437b7..0000000 --- a/boards/uvify/core/nuttx-config/include/board_dma_map.h +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2020 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. - * - ****************************************************************************/ - -#pragma once - -/* -| DMA1 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | SPI3_RX_1 | - | SPI3_RX_2 | SPI2_RX | SPI2_TX | SPI3_TX_1 | - | SPI3_TX_2 | -| Channel 1 | I2C1_RX | - | TIM7_UP_1 | - | TIM7_UP_2 | I2C1_RX_1 | I2C1_TX | I2C1_TX_1 | -| Channel 2 | TIM4_CH1 | - | I2C4_RX | TIM4_CH2 | - | I2C4_RX | TIM4_UP | TIM4_CH3 | -| Channel 3 | - | TIM2_UP_1 | I2C3_RX_1 | I2C2_EXT_RX | I2C3_TX | TIM2_CH1 | TIM2_CH2 | TIM2_UP_2 | -| | | TIM2_CH3 | | | | | TIM2_CH4_1 | TIM2_CH4_2 | -| Channel 4 | UART5_RX | USART3_RX | UART4_RX | USART3_TX_1 | UART4_TX | USART2_RX | USART2_TX | UART5_TX | -| Channel 5 | UART8_TX | UART7_TX | TIM3_CH4 | UART7_RX | TIM3_CH1 | TIM3_CH2 | UART8_RX | TIM3_CH3 | -| | | | TIM3_UP | | TIM3_TRIG | | | | -| Channel 6 | TIM5_CH3 | TIM5_CH4_1 | TIM5_CH1 | TIM5_CH4_2 | TIM5_CH2 | - | TIM5_UP_2 | - | -| | TIM5_UP_1 | TIM5_TRIG_1 | | TIM5_TRIG_2 | | | | | -| Channel 7 | - | TIM6_UP | I2C2_RX | I2C2_RX_1 | USART3_TX_2 | DAC1 | DAC2 | I2C2_TX | -| | | | | | | | | | -| Usage | | USART3_RX | UART4_RX | UART7_RX | USART3_TX_2 | USART2_RX | TIM4_UP | | - - -| DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | -|------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------|------------------| -| Channel 0 | ADC1_1 | SAI1_A | TIM8_CH1_1 | SAI1_A_1 | ADC1_2 | SAI1_B_1 | TIM1_CH1_1 | - | -| | | | TIM8_CH2_1 | | | | TIM1_CH2_1 | | -| | | | TIM8_CH3_1 | | | | TIM1_CH3_1 | | -| Channel 1 | - | DCMI_1 | ADC2_1 | ADC2_2 | SAI1_B | SPI6_TX | SPI6_RX | DCMI_2 | -| Channel 2 | ADC3_1 | ADC3_2 | - | SPI5_RX_1 | SPI5_TX_1 | CRYP_OUT | CRYP_IN | HASH_IN | -| Channel 3 | SPI1_RX_1 | - | SPI1_RX_2 | SPI1_TX_1 | - | SPI1_TX_2 | - | QUADSPI | -| Channel 4 | SPI4_RX_1 | SPI4_TX_1 | USART1_RX_1 | SDIO | - | USART1_RX_2 | SDIO | USART1_TX | -| Channel 5 | - | USART6_RX_1 | USART6_RX_2 | SPI4_RX_2 | SPI4_TX_2 | - | USART6_TX_1 | USART6_TX_2 | -| Channel 6 | TIM1_TRIG_1 | TIM1_CH1_2 | TIM1_CH2_2 | TIM1_CH1 | TIM1_CH4 | TIM1_UP | TIM1_CH3_2 | - | -| | | | | | TIM1_TRIG_2 | | | | -| | | | | | TIM1_COM | | | | -| Channel 7 | - | TIM8_UP | TIM8_CH1_2 | TIM8_CH2_2 | TIM8_CH3_2 | SPI5_RX_2 | SPI5_TX_2 | TIM8_CH4 | -| | | | | | | | | TIM8_TRIG | -| | | | | | | | | TIM8_COM | -| | | | | | | | | | -| Usage | SPI1_RX_1 | USART6_RX_1 | USART1_RX_1 | SPI1_TX_1 | | TIM1_UP | SDIO | | - */ - -// DMA1 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -// DMAMAP_USART3_RX // DMA1, Stream 1, Channel 4 -// DMAMAP_UART4_RX // DMA1, Stream 2, Channel 4 -// DMAMAP_UART7_RX // DMA1, Stream 3, Channel 5 -#define DMAMAP_USART3_TX DMAMAP_USART3_TX_2 // DMA1, Stream 4, Channel 7 (TELEM2 TX) -// DMAMAP_USART2_RX // DMA1, Stream 5, Channel 4 -// DMAMAP_TIM4_UP // DMA1, Stream 6, Channel 2 (DSHOT) - - -// DMA2 Channel/Stream Selections -//--------------------------------------------//---------------------------//---------------- -#define DMACHAN_SPI1_RX DMAMAP_SPI1_RX_1 // DMA2, Stream 0, Channel 3 (SPI sensors RX) -#define DMAMAP_USART6_RX DMAMAP_USART6_RX_1 // DMA2, Stream 1, Channel 4 -#define DMAMAP_USART1_RX DMAMAP_USART1_RX_1 // DMA2, Stream 2, Channel 4 -#define DMACHAN_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 3, Channel 3 (SPI sensors TX) -// AVAILABLE // DMA2, Stream 4 -// DMAMAP_TIM1_UP // DMA2, Stream 5, Channel 6 (DSHOT) -#define DMAMAP_SDIO DMAMAP_SDIO_2 // DMA2, Stream 6, Channel 4 diff --git a/boards/uvify/core/nuttx-config/nsh/defconfig b/boards/uvify/core/nuttx-config/nsh/defconfig deleted file mode 100644 index 0dcb89b..0000000 --- a/boards/uvify/core/nuttx-config/nsh/defconfig +++ /dev/null @@ -1,253 +0,0 @@ -# -# This file is autogenerated: PLEASE DO NOT EDIT IT. -# -# You can use "make menuconfig" to make any modifications to the installed .config file. -# You can then do "make savedefconfig" to generate a new defconfig file that includes your -# modifications. -# -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_MMCSD_HAVE_CARDDETECT is not set -# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set -# CONFIG_MMCSD_MMCSUPPORT is not set -# CONFIG_MMCSD_SPI is not set -# CONFIG_NSH_DISABLEBG is not set -# CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set -# CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set -# CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set -# CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set -# CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set -# CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_USLEEP is not set -# CONFIG_STM32_CCMEXCLUDE is not set -CONFIG_ARCH="arm" -CONFIG_ARCH_BOARD_CUSTOM=y -CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/uvify/core/nuttx-config" -CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y -CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" -CONFIG_ARCH_CHIP="stm32" -CONFIG_ARCH_CHIP_STM32=y -CONFIG_ARCH_CHIP_STM32F427V=y -CONFIG_ARCH_INTERRUPTSTACK=768 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARMV7M_MEMCPY=y -CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 -CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=16717 -CONFIG_BOARD_RESET_ON_ASSERT=2 -CONFIG_BUILTIN=y -CONFIG_CDCACM=y -CONFIG_CDCACM_IFLOWCONTROL=y -CONFIG_CDCACM_PRODUCTID=0x0012 -CONFIG_CDCACM_PRODUCTSTR="PX4 FMU UVify Core" -CONFIG_CDCACM_RXBUFSIZE=600 -CONFIG_CDCACM_TXBUFSIZE=2000 -CONFIG_CDCACM_VENDORID=0x26ac -CONFIG_CDCACM_VENDORSTR="UVify" -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_HARDFAULT_ALERT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DEBUG_TCBINFO=y -CONFIG_DEFAULT_SMALL=y -CONFIG_DEV_FIFO_SIZE=0 -CONFIG_DEV_PIPE_MAXSIZE=1024 -CONFIG_DEV_PIPE_SIZE=70 -CONFIG_FAT_DMAMEMORY=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_LFN_ALIAS_HASH=y -CONFIG_FDCLONE_STDIO=y -CONFIG_FS_BINFS=y -CONFIG_FS_CROMFS=y -CONFIG_FS_FAT=y -CONFIG_FS_FATTIME=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_GRAN=y -CONFIG_GRAN_INTR=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_I2C=y -CONFIG_I2C_RESET=y -CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_MAX_EXITFUNS=1 -CONFIG_LIBC_STRERROR=y -CONFIG_MEMSET_64BIT=y -CONFIG_MEMSET_OPTSPEED=y -CONFIG_MMCSD=y -CONFIG_MMCSD_SDIO=y -CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE=y -CONFIG_MM_REGIONS=2 -CONFIG_MTD=y -CONFIG_MTD_BYTE_WRITE=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=40 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_ARGCAT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_CMDPARMS=y -CONFIG_NSH_CROMFSETC=y -CONFIG_NSH_LINELEN=128 -CONFIG_NSH_MAXARGUMENTS=15 -CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_QUOTE=y -CONFIG_NSH_ROMFSETC=y -CONFIG_NSH_ROMFSSECTSIZE=128 -CONFIG_NSH_STRERROR=y -CONFIG_NSH_VARS=y -CONFIG_PIPES=y -CONFIG_PREALLOC_TIMERS=50 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_PTHREAD_MUTEX_ROBUST=y -CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAMTRON_SETSPEED=y -CONFIG_RAM_SIZE=262144 -CONFIG_RAM_START=0x20000000 -CONFIG_RAW_BINARY=y -CONFIG_RTC_DATETIME=y -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=249 -CONFIG_SCHED_HPWORKSTACKSIZE=1280 -CONFIG_SCHED_INSTRUMENTATION=y -CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y -CONFIG_SCHED_INSTRUMENTATION_SWITCH=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKSTACKSIZE=1632 -CONFIG_SCHED_WAITPID=y -CONFIG_SDIO_BLOCKSETUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 -CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y -CONFIG_SERIAL_TERMIOS=y -CONFIG_SIG_DEFAULT=y -CONFIG_SIG_SIGALRM_ACTION=y -CONFIG_SIG_SIGUSR1_ACTION=y -CONFIG_SIG_SIGUSR2_ACTION=y -CONFIG_SIG_SIGWORK=4 -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_STDIO_BUFFER_SIZE=32 -CONFIG_STM32_ADC1=y -CONFIG_STM32_BBSRAM=y -CONFIG_STM32_BBSRAM_FILES=5 -CONFIG_STM32_BKPSRAM=y -CONFIG_STM32_CCMDATARAM=y -CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y -CONFIG_STM32_DMA1=y -CONFIG_STM32_DMA2=y -CONFIG_STM32_FLASH_CONFIG_I=y -CONFIG_STM32_FLOWCONTROL_BROKEN=y -CONFIG_STM32_I2C1=y -CONFIG_STM32_I2CTIMEOMS=10 -CONFIG_STM32_I2CTIMEOTICKS=10 -CONFIG_STM32_JTAG_SW_ENABLE=y -CONFIG_STM32_OTGFS=y -CONFIG_STM32_PWR=y -CONFIG_STM32_RTC=y -CONFIG_STM32_RTC_HSECLOCK=y -CONFIG_STM32_RTC_MAGIC=0xfacefeee -CONFIG_STM32_RTC_MAGIC_REG=1 -CONFIG_STM32_RTC_MAGIC_TIME_SET=0xfacefeef -CONFIG_STM32_SAVE_CRASHDUMP=y -CONFIG_STM32_SDIO=y -CONFIG_STM32_SDIO_CARD=y -CONFIG_STM32_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32_SERIAL_DISABLE_REORDERING=y -CONFIG_STM32_SPI1=y -CONFIG_STM32_SPI1_DMA=y -CONFIG_STM32_SPI1_DMA_BUFFER=512 -CONFIG_STM32_SPI2=y -CONFIG_STM32_SPI_DMATHRESHOLD=8 -CONFIG_STM32_TIM10=y -CONFIG_STM32_TIM11=y -CONFIG_STM32_TIM8=y -CONFIG_STM32_TIM9=y -CONFIG_STM32_UART4=y -CONFIG_STM32_UART7=y -CONFIG_STM32_UART8=y -CONFIG_STM32_USART1=y -CONFIG_STM32_USART2=y -CONFIG_STM32_USART3=y -CONFIG_STM32_USART6=y -CONFIG_STM32_USART_BREAKS=y -CONFIG_STM32_USART_SINGLEWIRE=y -CONFIG_STM32_WWDG=y -CONFIG_SYSTEM_CDCACM=y -CONFIG_SYSTEM_NSH=y -CONFIG_TASK_NAME_SIZE=24 -CONFIG_UART4_BAUD=57600 -CONFIG_UART4_RXBUFSIZE=300 -CONFIG_UART4_RXDMA=y -CONFIG_UART4_TXBUFSIZE=300 -CONFIG_UART7_BAUD=57600 -CONFIG_UART7_RXBUFSIZE=300 -CONFIG_UART7_RXDMA=y -CONFIG_UART7_SERIAL_CONSOLE=y -CONFIG_UART7_TXBUFSIZE=300 -CONFIG_UART8_BAUD=57600 -CONFIG_UART8_RXBUFSIZE=300 -CONFIG_UART8_TXBUFSIZE=300 -CONFIG_USART1_RXBUFSIZE=600 -CONFIG_USART1_RXDMA=y -CONFIG_USART1_TXBUFSIZE=2500 -CONFIG_USART2_BAUD=57600 -CONFIG_USART2_IFLOWCONTROL=y -CONFIG_USART2_OFLOWCONTROL=y -CONFIG_USART2_RXBUFSIZE=600 -CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=1100 -CONFIG_USART3_BAUD=57600 -CONFIG_USART3_IFLOWCONTROL=y -CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=1200 -CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=900 -CONFIG_USART6_BAUD=57600 -CONFIG_USART6_RXBUFSIZE=300 -CONFIG_USART6_RXDMA=y -CONFIG_USART6_TXBUFSIZE=300 -CONFIG_USBDEV=y -CONFIG_USBDEV_BUSPOWERED=y -CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/uvify/core/nuttx-config/scripts/script.ld b/boards/uvify/core/nuttx-config/scripts/script.ld deleted file mode 100644 index 6d92733..0000000 --- a/boards/uvify/core/nuttx-config/scripts/script.ld +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************************** - * scripts/ld.script - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/* The STM32F427 has 2048Kb of FLASH beginning at address 0x0800:0000 and - * 256Kb of SRAM. SRAM is split up into three blocks: - * - * 1) 112Kb of SRAM beginning at address 0x2000:0000 - * 2) 16Kb of SRAM beginning at address 0x2001:c000 - * 3) 64Kb of SRAM beginning at address 0x2002:0000 - * 4) 64Kb of TCM SRAM beginning at address 0x1000:0000 - * - * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000 - * where the code expects to begin execution by jumping to the entry point in - * the 0x0800:0000 address range. - * - * The first 0x4000 of flash is reserved for the bootloader. - */ - -MEMORY -{ - flash (rx) : ORIGIN = 0x08004000, LENGTH = 2032K - sram (rwx) : ORIGIN = 0x20000000, LENGTH = 192K - ccsram (rwx) : ORIGIN = 0x10000000, LENGTH = 64K -} - -OUTPUT_ARCH(arm) - -ENTRY(__start) /* treat __start as the anchor for dead code stripping */ -EXTERN(_vectors) /* force the vectors to be included in the output */ - -/* - * Ensure that abort() is present in the final object. The exception handling - * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). - */ -EXTERN(abort) -EXTERN(_bootdelay_signature) - -SECTIONS -{ - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - . = ALIGN(32); - /* - This signature provides the bootloader with a way to delay booting - */ - _bootdelay_signature = ABSOLUTE(.); - FILL(0xffecc2925d7d05c5) - . += 8; - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - - } > flash - - /* - * Init functions (static constructors and the like) - */ - .init_section : { - _sinit = ABSOLUTE(.); - KEEP(*(.init_array .init_array.*)) - _einit = ABSOLUTE(.); - } > flash - - - .ARM.extab : { - *(.ARM.extab*) - } > flash - - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); - - _eronly = ABSOLUTE(.); - - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash - - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN(4); - _ebss = ABSOLUTE(.); - } > sram - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} diff --git a/boards/uvify/core/src/CMakeLists.txt b/boards/uvify/core/src/CMakeLists.txt deleted file mode 100644 index 8e470f2..0000000 --- a/boards/uvify/core/src/CMakeLists.txt +++ /dev/null @@ -1,51 +0,0 @@ -############################################################################ -# -# Copyright (c) 2019 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. -# -############################################################################ - -add_library(drivers_board - can.c - i2c.cpp - init.c - led.c - spi.cpp - timer_config.cpp - usb.c -) - -target_link_libraries(drivers_board - PRIVATE - arch_spi - drivers__led # drv_led_start - nuttx_arch # sdio - nuttx_drivers # sdio - px4_layer -) diff --git a/boards/uvify/core/src/board_config.h b/boards/uvify/core/src/board_config.h deleted file mode 100644 index 22708b2..0000000 --- a/boards/uvify/core/src/board_config.h +++ /dev/null @@ -1,219 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019 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. - * - ****************************************************************************/ - -/** - * @file board_config.h - * - * UVify Core internal definitions - */ - -#pragma once - -/**************************************************************************************************** - * Included Files - ****************************************************************************************************/ - -#include -#include -#include - -/**************************************************************************************************** - * Definitions - ****************************************************************************************************/ -/* Configuration ************************************************************************************/ - -/* UVify Core GPIOs ***********************************************************************************/ -/* LEDs */ -#define GPIO_LED1 (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN11) -#define GPIO_LED2 (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN1) -#define GPIO_LED3 (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN3) - -#define GPIO_LED_RED GPIO_LED1 -#define GPIO_LED_GREEN GPIO_LED2 -#define GPIO_LED_BLUE GPIO_LED3 - -#define BOARD_HAS_CONTROL_STATUS_LEDS 1 -#define BOARD_OVERLOAD_LED LED_RED -#define BOARD_ARMED_LED LED_BLUE -#define BOARD_ARMED_STATE_LED LED_GREEN - -#ifdef CONFIG_STM32_SPI4 -# define BOARD_HAS_BUS_MANIFEST 1 // We support a bus manifest because spi 4 is optional -#endif /* CONFIG_STM32_SPI4 */ - -/** - * ADC channels: - * These are the channel numbers of the ADCs of the microcontroller that can be used by the Px4 Firmware in the adc driver. - */ -#define ADC_CHANNELS (1 << 2) | (1 << 3) | (1 << 4) | (1 << 10) | (1 << 11) | (1 << 12) | (1 << 13) | (1 << 14) - -/* ADC defines to be used in sensors.cpp to read from a particular channel. */ -#define ADC_BATTERY_VOLTAGE_CHANNEL 2 -#define ADC_BATTERY_CURRENT_CHANNEL 3 -#define ADC_5V_RAIL_SENSE 4 -#define ADC_RC_RSSI_CHANNEL 11 - -/* Power supply control and monitoring GPIOs. */ -#define GPIO_VDD_BRICK_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5) -#define GPIO_VDD_USB_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN0) - -/* Tone alarm output. */ -#define TONE_ALARM_TIMER 2 /* timer 2 */ -#define TONE_ALARM_CHANNEL 1 /* channel 1 */ -#define GPIO_TONE_ALARM_IDLE (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15) -#define GPIO_TONE_ALARM (GPIO_ALT|GPIO_AF1|GPIO_SPEED_2MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN15) - -/* - * PWM - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 6 - -/** - * USB OTG FS: - * PA9 OTG_FS_VBUS VBUS sensing. - */ -#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN9) - -/* High-resolution timer */ -#define HRT_TIMER 3 /* use timer 3 for the HRT */ -#define HRT_TIMER_CHANNEL 4 /* use capture/compare channel 4 */ - -#define HRT_PPM_CHANNEL 3 /* use capture/compare channel 3 */ -#define GPIO_PPM_IN (GPIO_ALT|GPIO_AF2|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN0) - -/* RC Serial port */ - -#define RC_SERIAL_PORT "/dev/ttyS4" - -/* PWM input driver. Use FMU AUX5 pins attached to timer4 channel 2. */ -#define PWMIN_TIMER 4 -#define PWMIN_TIMER_CHANNEL 2 -#define GPIO_PWM_IN GPIO_TIM4_CH2IN_2 - -#define GPIO_RSSI_IN (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN1) -#define GPIO_LED_SAFETY (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN3) -#define GPIO_BTN_SAFETY (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN4) -#define GPIO_PERIPH_3V3_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN5) - -/* For,this signal is active high. */ -#define GPIO_SBUS_INV (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN13) -#define RC_INVERT_INPUT(_invert_true) px4_arch_gpiowrite(GPIO_SBUS_INV, _invert_true) - -#define GPIO_SPEKTRUM_PWR_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN4) - -/* GPIOs */ -#define GPIO_PE2 (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN2) -#define GPIO_PB4 (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN4) -#define GPIO_PE5 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN5) -#define GPIO_PE6 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN6) - -/* Heater pins (reserved) */ -#define GPIO_HEATER_INPUT (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTC|GPIO_PIN6) -#define GPIO_HEATER_OUTPUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN6) -#define HEATER_OUTPUT_EN(on_true) px4_arch_gpiowrite(GPIO_HEATER_OUTPUT, (on_true)) - -/* Power switch controls */ - -#define SPEKTRUM_POWER(_on_true) px4_arch_gpiowrite(GPIO_SPEKTRUM_PWR_EN, (!_on_true)) - -/** - * UVify Core has separate RC_IN - * - * GPIO PPM_IN on PB0 T3C3 - * SPEKTRUM_RX (it's TX or RX in Bind) on UART6 PC7 - * Inversion is possible via the 74LVC2G86 controlled by the FMU - * The FMU can drive GPIO PPM_IN as an output - */ - -#define GPIO_PPM_IN_AS_OUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN0) -#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_PPM_IN_AS_OUT) -#define SPEKTRUM_RX_AS_UART() /* Can be left as uart */ -#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true)) - -/** - * By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction) - * this board support the ADC system_power interface, and therefore - * provides the true logic GPIO BOARD_ADC_xxxx macros. - */ -#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS)) -#define BOARD_ADC_BRICK_VALID (px4_arch_gpioread(GPIO_VDD_BRICK_VALID)) -#define BOARD_ADC_USB_VALID (px4_arch_gpioread(GPIO_VDD_USB_VALID)) -#define BOARD_ADC_SERVO_VALID (1) -#define BOARD_ADC_PERIPH_5V_OC (0) -#define BOARD_ADC_HIPOWER_5V_OC (0) - - -/* This board provides a DMA pool and APIs */ -#define BOARD_DMA_ALLOC_POOL_SIZE 5120 - -#define BOARD_HAS_ON_RESET 1 - - -#define BOARD_ENABLE_CONSOLE_BUFFER -#define BOARD_CONSOLE_BUFFER_SIZE (1024*3) - -__BEGIN_DECLS - -/**************************************************************************************************** - * Public Types - ****************************************************************************************************/ - -/**************************************************************************************************** - * Public data - ****************************************************************************************************/ - -#ifndef __ASSEMBLY__ - -/**************************************************************************************************** - * Public Functions - ****************************************************************************************************/ - -/**************************************************************************************************** - * 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 - -#endif /* __ASSEMBLY__ */ - -__END_DECLS diff --git a/boards/uvify/core/src/can.c b/boards/uvify/core/src/can.c deleted file mode 100644 index f35924d..0000000 --- a/boards/uvify/core/src/can.c +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2019 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. - * - ****************************************************************************/ - -/** - * @file can.c - * - * Board-specific CAN functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include - -#include -#include - -#include "chip.h" -#include "arm_internal.h" - -#include "stm32.h" -#include "stm32_can.h" -#include "board_config.h" - -#ifdef CONFIG_CAN - -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ - -#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2) -# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." -# undef CONFIG_STM32_CAN2 -#endif - -#ifdef CONFIG_STM32_CAN1 -# define CAN_PORT 1 -#else -# define CAN_PORT 2 -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ -int can_devinit(void); - -/************************************************************************************ - * Name: can_devinit - * - * Description: - * All STM32 architectures must provide the following interface to work with - * examples/can. - * - ************************************************************************************/ - -int can_devinit(void) -{ - static bool initialized = false; - struct can_dev_s *can; - int ret; - - /* Check if we have already initialized */ - - if (!initialized) { - /* Call stm32_caninitialize() to get an instance of the CAN interface */ - - can = stm32_caninitialize(CAN_PORT); - - if (can == NULL) { - canerr("ERROR: Failed to get CAN interface\n"); - return -ENODEV; - } - - /* Register the CAN driver at "/dev/can0" */ - - ret = can_register("/dev/can0", can); - - if (ret < 0) { - canerr("ERROR: can_register failed: %d\n", ret); - return ret; - } - - /* Now we are initialized */ - - initialized = true; - } - - return OK; -} - -#endif diff --git a/boards/uvify/core/src/i2c.cpp b/boards/uvify/core/src/i2c.cpp deleted file mode 100644 index e9f26f9..0000000 --- a/boards/uvify/core/src/i2c.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 - -constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { - initI2CBusExternal(1), -}; diff --git a/boards/uvify/core/src/init.c b/boards/uvify/core/src/init.c deleted file mode 100644 index 6fb6034..0000000 --- a/boards/uvify/core/src/init.c +++ /dev/null @@ -1,371 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019 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. - * - ****************************************************************************/ - -/** - * @file init.c - * - * UVify Core specific early startup code. This file implements the - * board_app_initialize() function that is called early by nsh during startup. - * - * Code here is run before the rcS script is invoked; it should start required - * subsystems and perform board-specific initialization. - */ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include "board_config.h" -#include - -#include - -#include -#include - -#include - -#include -#include - -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/** - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -__END_DECLS - -/**************************************************************************** - * Protected Functions - ****************************************************************************/ -/**************************************************************************** - * Public Functions - ****************************************************************************/ -/************************************************************************************ - * Name: board_peripheral_reset - * - * Description: - * - ************************************************************************************/ -__EXPORT void board_peripheral_reset(int ms) -{ - // Set the peripheral rails off. - stm32_configgpio(GPIO_PERIPH_3V3_EN); - - stm32_gpiowrite(GPIO_PERIPH_3V3_EN, 0); - - bool last = stm32_gpioread(GPIO_SPEKTRUM_PWR_EN); - // Keep Spektum on to discharge rail. - stm32_gpiowrite(GPIO_SPEKTRUM_PWR_EN, 1); - - // Wait for the peripheral rail to reach GND. - usleep(ms * 1000); - syslog(LOG_DEBUG, "reset done, %d ms\n", ms); - - // Re-enable power. - // Switch the peripheral rail back on. - stm32_gpiowrite(GPIO_SPEKTRUM_PWR_EN, last); - stm32_gpiowrite(GPIO_PERIPH_3V3_EN, 1); - -} - -/************************************************************************************ - * Name: board_on_reset - * - * Description: - * Optionally provided function called on entry to board_system_reset - * It should perform any house keeping prior to the rest. - * - * status - 1 if resetting to boot loader - * 0 if just resetting - * - ************************************************************************************/ -__EXPORT void board_on_reset(int status) -{ - // Configure the GPIO pins to outputs and keep them low. - for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) { - px4_arch_configgpio(io_timer_channel_get_gpio_output(i)); - } - - /** - * On resets invoked from system (not boot) insure we establish a low - * output state (discharge the pins) on PWM pins before they become inputs. - */ - - if (status >= 0) { - up_mdelay(400); - } -} - -/************************************************************************************ - * 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 all PWM to Low outputs. - board_on_reset(-1); - - // Configure LEDs. - board_autoled_initialize(); - - - // Configure ADC pins. - stm32_configgpio(GPIO_ADC1_IN2); /* BATT_VOLTAGE_SENS */ - stm32_configgpio(GPIO_ADC1_IN3); /* BATT_CURRENT_SENS */ - stm32_configgpio(GPIO_ADC1_IN4); /* VDD_5V_SENS */ - stm32_configgpio(GPIO_ADC1_IN11); /* RSSI analog in */ - - // Configure CAN interface - stm32_configgpio(GPIO_CAN1_RX); - stm32_configgpio(GPIO_CAN1_TX); - - // Configure power supply control/sense pins. - stm32_configgpio(GPIO_PERIPH_3V3_EN); - stm32_configgpio(GPIO_VDD_BRICK_VALID); - stm32_configgpio(GPIO_VDD_USB_VALID); - - stm32_configgpio(GPIO_SBUS_INV); - stm32_configgpio(GPIO_SPEKTRUM_PWR_EN); - - stm32_configgpio(GPIO_PB4); - stm32_configgpio(GPIO_PE2); - - // Safety - led on in led driver. - stm32_configgpio(GPIO_BTN_SAFETY); - stm32_configgpio(GPIO_PPM_IN); - -#if defined(CONFIG_STM32_SPI4) - - /* We have SPI4 is GPIO_PB4 pin 3 Low */ - if (stm32_gpioread(GPIO_PB4) != 0) { -#endif /* CONFIG_STM32_SPI4 */ - - stm32_configgpio(GPIO_PE5); - stm32_configgpio(GPIO_PE6); - -#if defined(CONFIG_STM32_SPI4) - } - -#endif /* CONFIG_STM32_SPI4 */ - - // Configure SPI all interfaces GPIO & enable power. - stm32_spiinitialize(); - - // Configure heater GPIO. - stm32_configgpio(GPIO_HEATER_INPUT); - stm32_configgpio(GPIO_HEATER_OUTPUT); -} - -/**************************************************************************** - * Name: board_app_initialize - * - * 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_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initalization logic and the the - * matching application logic. The value cold be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -static struct spi_dev_s *spi1; -static struct spi_dev_s *spi2; -static struct sdio_dev_s *sdio; -#if defined(CONFIG_STM32_SPI4) -static struct spi_dev_s *spi4; -#endif - -__EXPORT int board_app_initialize(uintptr_t arg) -{ - px4_platform_init(); - - // Configure the DMA allocator. - if (board_dma_alloc_init() < 0) { - syslog(LOG_ERR, "DMA alloc FAILED\n"); - } - -#if defined(SERIAL_HAVE_RXDMA) - // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event. - static struct hrt_call serial_dma_call; - hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL); -#endif - - // Initial LED state. - drv_led_start(); - led_off(LED_RED); - led_off(LED_GREEN); - led_off(LED_BLUE); - - if (board_hardfault_init(2, true) != 0) { - led_on(LED_RED); - } - - // Power down the heater. - stm32_gpiowrite(GPIO_HEATER_OUTPUT, 0); - - // Configure SPI-based devices. - spi1 = stm32_spibus_initialize(1); - - if (!spi1) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 1\n"); - led_on(LED_RED); - } - - - // Default SPI1 to 1MHz and de-assert the known chip selects. - SPI_SETFREQUENCY(spi1, 10000000); - SPI_SETBITS(spi1, 8); - SPI_SETMODE(spi1, SPIDEV_MODE3); - up_udelay(20); - - // Get the SPI port for the FRAM. - spi2 = stm32_spibus_initialize(2); - - if (!spi2) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 2\n"); - led_on(LED_RED); - } - - /** - * Default SPI2 to 12MHz and de-assert the known chip selects. - * MS5611 has max SPI clock speed of 20MHz. - */ - - // XXX start with 10.4 MHz and go up to 20 once validated. - SPI_SETFREQUENCY(spi2, 20 * 1000 * 1000); - SPI_SETBITS(spi2, 8); - SPI_SETMODE(spi2, SPIDEV_MODE3); - -#if defined(CONFIG_STM32_SPI4) - - if (stm32_gpioread(GPIO_PB4) == 0) { - syslog(LOG_INFO, "[boot] GPIO_PB4 - Low Initialize SPI port 4 \n"); - - // Configure SPI-based devices. - spi4 = stm32_spibus_initialize(4); - - if (!spi4) { - syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 4\n"); - - } else { - // Default SPI4 to 20 MHz and de-assert the known chip selects. - SPI_SETFREQUENCY(spi4, 20 * 1000 * 1000); - SPI_SETBITS(spi4, 8); - SPI_SETMODE(spi4, SPIDEV_MODE3); - } - } - -#endif /* defined(CONFIG_STM32_SPI4) */ - - -#ifdef CONFIG_MMCSD - - // First, get an instance of the SDIO interface. - sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO); - - if (!sdio) { - led_on(LED_RED); - syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", CONFIG_NSH_MMCSDSLOTNO); - } - - // Now bind the SDIO interface to the MMC/SD driver. - int ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio); - - if (ret != OK) { - led_on(LED_RED); - syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); - } - - // Then let's guess and say that there is a card in the slot. There is no card detect GPIO. - sdio_mediachange(sdio, true); - -#endif - - /* Configure the HW based on the manifest */ - - px4_platform_configure(); - - return OK; -} diff --git a/boards/uvify/core/src/led.c b/boards/uvify/core/src/led.c deleted file mode 100644 index 3f6e1d0..0000000 --- a/boards/uvify/core/src/led.c +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2019 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. - * - ****************************************************************************/ - -/** - * @file led.c - * - * UVify Core LED backend. - */ - -#include - -#include - -#include "stm32.h" -#include "board_config.h" - -#include - -/* - * Ideally we'd be able to get these from arm_internal.h, - * but since we want to be able to disable the NuttX use - * of leds for system indication at will and there is no - * separate switch, we need to build independent of the - * CONFIG_ARCH_LEDS configuration switch. - */ -__BEGIN_DECLS -extern void led_init(void); -extern void led_on(int led); -extern void led_off(int led); -extern void led_toggle(int led); -__END_DECLS - - - -static uint32_t g_ledmap[] = { - GPIO_LED_BLUE, // Indexed by LED_BLUE - GPIO_LED_RED, // Indexed by LED_RED, LED_AMBER - GPIO_LED_SAFETY, // Indexed by LED_SAFETY - GPIO_LED_GREEN, // Indexed by LED_GREEN -}; - -__EXPORT void led_init(void) -{ - /* Configure LED GPIOs for output */ - for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) { - stm32_configgpio(g_ledmap[l]); - } -} - -static void phy_set_led(int led, bool state) -{ - /* Pull Down to switch on */ - stm32_gpiowrite(g_ledmap[led], !state); -} - -static bool phy_get_led(int led) -{ - - return !stm32_gpioread(g_ledmap[led]); -} - -__EXPORT void led_on(int led) -{ - phy_set_led(led, true); -} - -__EXPORT void led_off(int led) -{ - phy_set_led(led, false); -} - -__EXPORT void led_toggle(int led) -{ - - phy_set_led(led, !phy_get_led(led)); -} diff --git a/boards/uvify/core/src/spi.cpp b/boards/uvify/core/src/spi.cpp deleted file mode 100644 index 5b867f4..0000000 --- a/boards/uvify/core/src/spi.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2020 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 -#include -#include - -constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_MPU9250, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortC, GPIO::Pin15}, SPI::DRDY{GPIO::PortC, GPIO::Pin14}), - initSPIDevice(DRV_IMU_DEVTYPE_ICM20608G, SPI::CS{GPIO::PortC, GPIO::Pin15}, SPI::DRDY{GPIO::PortC, GPIO::Pin14}), - initSPIDevice(DRV_MAG_DEVTYPE_HMC5883, SPI::CS{GPIO::PortE, GPIO::Pin15}, SPI::DRDY{GPIO::PortE, GPIO::Pin12}), // hmc5983 - }, {GPIO::PortE, GPIO::Pin3}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10}), - initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortD, GPIO::Pin7}), - initSPIDevice(DRV_BARO_DEVTYPE_MS5607, SPI::CS{GPIO::PortD, GPIO::Pin7}), - initSPIDevice(DRV_FLOW_DEVTYPE_PMW3901, SPI::CS{GPIO::PortB, GPIO::Pin12}) - }) -}; - -static constexpr bool unused = validateSPIConfig(px4_spi_buses); - -#if defined(BOARD_HAS_BUS_MANIFEST) -__EXPORT bool board_has_bus(enum board_bus_types type, uint32_t bus) -{ - bool rv = true; - - switch (type) { - case BOARD_SPI_BUS: -#ifdef CONFIG_STM32_SPI4 - rv = bus != 4 || (stm32_gpioread(GPIO_PB4) == 0); -#endif /* CONFIG_STM32_SPI4 */ - break; - - case BOARD_I2C_BUS: - break; - - default: break; - } - - return rv; -} -#endif diff --git a/boards/uvify/core/src/timer_config.cpp b/boards/uvify/core/src/timer_config.cpp deleted file mode 100644 index 4b13297..0000000 --- a/boards/uvify/core/src/timer_config.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2019 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 - -constexpr io_timers_t io_timers[MAX_IO_TIMERS] = { - initIOTimer(Timer::Timer1, DMA{DMA::Index2, DMA::Stream5, DMA::Channel6}), - initIOTimer(Timer::Timer4, DMA{DMA::Index1, DMA::Stream6, DMA::Channel2}), -}; - -static inline constexpr timer_io_channels_t initIOTimerChannelPulldown(const io_timers_t io_timers_conf[MAX_IO_TIMERS], - Timer::TimerChannel timer, GPIO::GPIOPin pin) -{ - timer_io_channels_t ret = initIOTimerChannel(io_timers_conf, timer, pin); - ret.gpio_out |= GPIO_OUTPUT_CLEAR | GPIO_PULLDOWN; - return ret; -} - -constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { - initIOTimerChannelPulldown(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), - initIOTimerChannelPulldown(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortE, GPIO::Pin13}), - initIOTimerChannelPulldown(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), - initIOTimerChannelPulldown(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), - initIOTimerChannelPulldown(io_timers, {Timer::Timer4, Timer::Channel2}, {GPIO::PortD, GPIO::Pin13}), - initIOTimerChannelPulldown(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortD, GPIO::Pin14}), -}; - -constexpr io_timers_channel_mapping_t io_timers_channel_mapping = - initIOTimerChannelMapping(io_timers, timer_io_channels); diff --git a/boards/uvify/core/src/usb.c b/boards/uvify/core/src/usb.c deleted file mode 100644 index 32f853b..0000000 --- a/boards/uvify/core/src/usb.c +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2019 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. - * - ****************************************************************************/ - -/** - * @file usb.c - * - * UVify Core specific USB functions. - */ - -/************************************************************************************ - * Included Files - ************************************************************************************/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#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_STM32_OTGFS - stm32_configgpio(GPIO_OTGFS_VBUS); - /* XXX We only support device mode - stm32_configgpio(GPIO_OTGFS_PWRON); - stm32_configgpio(GPIO_OTGFS_OVER); - */ -#endif -} - -/************************************************************************************ - * Name: stm32_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. - * - ************************************************************************************/ - -__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - uinfo("resume: %d\n", resume); -} - diff --git a/flash_fw.sh b/flash_fw.sh index f263f39..4dbb0fd 100755 --- a/flash_fw.sh +++ b/flash_fw.sh @@ -1,6 +1,6 @@ #!/bin/bash -xe # flash firmware - +./build_mfts.sh #st-flash write build/px4_fts-can_default/px4_fts-can_default.bin 0x08020000 st-flash write build/px4_fts-proto_default/px4_fts-proto_default.bin 0x08020000 \ No newline at end of file diff --git a/src/modules/mavlink/mavlink_nimbus b/src/modules/mavlink/mavlink_nimbus new file mode 160000 index 0000000..5e769e0 --- /dev/null +++ b/src/modules/mavlink/mavlink_nimbus @@ -0,0 +1 @@ +Subproject commit 5e769e0b6f5c4173b08786f6f0943cdfd929e907