From e6505005c5a65701813ec46d7d5792368da484ec Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Thu, 26 Apr 2018 17:21:32 +0300 Subject: [PATCH 1/2] STM32 example application removed --- .travis.yml | 2 +- libuavcan_drivers/stm32/README.md | 11 + .../stm32/test_stm32f107/.gitignore | 2 - .../stm32/test_stm32f107/Makefile | 61 ----- .../stm32/test_stm32f107/README.md | 4 - .../stm32/test_stm32f107/src/board/board.cpp | 99 -------- .../stm32/test_stm32f107/src/board/board.hpp | 25 -- .../stm32/test_stm32f107/src/dummy.cpp | 0 .../stm32/test_stm32f107/src/main.cpp | 215 ------------------ .../stm32/test_stm32f107/src/sys/board.h | 77 ------- .../stm32/test_stm32f107/src/sys/chconf.h | 29 --- .../stm32/test_stm32f107/src/sys/halconf.h | 32 --- .../stm32/test_stm32f107/src/sys/mcuconf.h | 191 ---------------- 13 files changed, 12 insertions(+), 736 deletions(-) create mode 100644 libuavcan_drivers/stm32/README.md delete mode 100644 libuavcan_drivers/stm32/test_stm32f107/.gitignore delete mode 100644 libuavcan_drivers/stm32/test_stm32f107/Makefile delete mode 100644 libuavcan_drivers/stm32/test_stm32f107/README.md delete mode 100644 libuavcan_drivers/stm32/test_stm32f107/src/board/board.cpp delete mode 100644 libuavcan_drivers/stm32/test_stm32f107/src/board/board.hpp delete mode 100644 libuavcan_drivers/stm32/test_stm32f107/src/dummy.cpp delete mode 100644 libuavcan_drivers/stm32/test_stm32f107/src/main.cpp delete mode 100644 libuavcan_drivers/stm32/test_stm32f107/src/sys/board.h delete mode 100644 libuavcan_drivers/stm32/test_stm32f107/src/sys/chconf.h delete mode 100644 libuavcan_drivers/stm32/test_stm32f107/src/sys/halconf.h delete mode 100644 libuavcan_drivers/stm32/test_stm32f107/src/sys/mcuconf.h diff --git a/.travis.yml b/.travis.yml index 3cb219ae1b..4206e45d43 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,4 +31,4 @@ before_script: "mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Debug -DC script: - if [ "${COVERITY_SCAN_BRANCH}" != 1 ] && [ "${TARGET}" == "native" ]; then make ; fi - if [ "${COVERITY_SCAN_BRANCH}" != 1 ] && [ "${TARGET}" == "lpc11c24" ]; then cd "$TRAVIS_BUILD_DIR/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24" && make all ; fi - - if [ "${COVERITY_SCAN_BRANCH}" != 1 ] && [ "${TARGET}" == "stm32" ]; then cd "$TRAVIS_BUILD_DIR/libuavcan_drivers/stm32/test_stm32f107" && git clone "https://github.com/Zubax/zubax_chibios" && cd zubax_chibios && git checkout stable_v1 && git submodule update --init --recursive && cd .. && make ; fi + - if [ "${COVERITY_SCAN_BRANCH}" != 1 ] && [ "${TARGET}" == "stm32" ]; then echo "TODO STM32 test environment is not configured"; fi diff --git a/libuavcan_drivers/stm32/README.md b/libuavcan_drivers/stm32/README.md new file mode 100644 index 0000000000..4837b2b4ae --- /dev/null +++ b/libuavcan_drivers/stm32/README.md @@ -0,0 +1,11 @@ +STM32 platform drivers +====================== + +The directory `driver` contains the STM32 platform driver for Libuavcan. + +A dedicated example application may be added later here. +For now, please consider the following open source projects as a reference: + +- https://github.com/PX4/sapog +- https://github.com/Zubax/zubax_gnss +- https://github.com/PX4/Firmware diff --git a/libuavcan_drivers/stm32/test_stm32f107/.gitignore b/libuavcan_drivers/stm32/test_stm32f107/.gitignore deleted file mode 100644 index 72b20378f6..0000000000 --- a/libuavcan_drivers/stm32/test_stm32f107/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Nested repository, we don't need to submodule it -zubax_chibios diff --git a/libuavcan_drivers/stm32/test_stm32f107/Makefile b/libuavcan_drivers/stm32/test_stm32f107/Makefile deleted file mode 100644 index dd7fb36a2f..0000000000 --- a/libuavcan_drivers/stm32/test_stm32f107/Makefile +++ /dev/null @@ -1,61 +0,0 @@ -# -# Copyright (C) 2014 Pavel Kirienko -# - -PROJECT = uavcan_test_stm32f107 - -# -# Test application -# - -MAIN ?= main.cpp - -CPPSRC = src/$(MAIN) \ - src/dummy.cpp \ - src/board/board.cpp - -# -# UAVCAN library -# - -export LIBUAVCAN_REPO_ROOT := $(abspath ../../..) - -UDEFS = -DUAVCAN_STM32_CHIBIOS=1 \ - -DUAVCAN_STM32_TIMER_NUMBER=6 \ - -DUAVCAN_TINY=1 \ - -DUAVCAN_STM32_NUM_IFACES=2 \ - -DUAVCAN_MEM_POOL_BLOCK_SIZE=48 - -include $(LIBUAVCAN_REPO_ROOT)/libuavcan/include.mk -CPPSRC += $(LIBUAVCAN_SRC) -UINCDIR += $(LIBUAVCAN_INC) - -include $(LIBUAVCAN_REPO_ROOT)/libuavcan_drivers/stm32/driver/include.mk -CPPSRC += $(LIBUAVCAN_STM32_SRC) -UINCDIR += $(LIBUAVCAN_STM32_INC) - -$(info $(shell $(LIBUAVCAN_DSDLC) $(UAVCAN_DSDL_DIR))) -UINCDIR += dsdlc_generated - -# -# Git commit hash -# - -GIT_HASH := $(shell git rev-parse --short HEAD) -UDEFS += -DGIT_HASH=0x$(GIT_HASH) - -# -# Platform -# - -UINCDIR += src/sys - -SERIAL_CLI_PORT_NUMBER = 2 - -CPPWARN := -Wundef -Wno-error=undef - -RELEASE_OPT = -Os -fomit-frame-pointer -DEBUG_OPT = -Os -g3 -#USE_OPT = -flto - -include zubax_chibios/rules_stm32f105_107.mk diff --git a/libuavcan_drivers/stm32/test_stm32f107/README.md b/libuavcan_drivers/stm32/test_stm32f107/README.md deleted file mode 100644 index 691eea57a0..0000000000 --- a/libuavcan_drivers/stm32/test_stm32f107/README.md +++ /dev/null @@ -1,4 +0,0 @@ -UAVCAN test project for STM32 ------------------------------ - -Please checkout/symlink https://github.com/Zubax/zubax_chibios, branch `stable_v1`, into subdirectory `zubax_chibios`; then follow instructions in `zubax_chibios/README.md`. diff --git a/libuavcan_drivers/stm32/test_stm32f107/src/board/board.cpp b/libuavcan_drivers/stm32/test_stm32f107/src/board/board.cpp deleted file mode 100644 index 2bcf3ee70c..0000000000 --- a/libuavcan_drivers/stm32/test_stm32f107/src/board/board.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (C) 2015 Pavel Kirienko - */ - -#include "board.hpp" -#include -#include -#include -#include -#include -#include - -/** - * GPIO config for ChibiOS PAL driver - */ -const PALConfig pal_default_config = -{ - { VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH }, - { VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH }, - { VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH }, - { VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH }, - { VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH } -}; - -namespace board -{ - -void init() -{ - halInit(); - - chibios_rt::System::init(); - - sdStart(&STDOUT_SD, nullptr); -} - -__attribute__((noreturn)) -void die(int error) -{ - lowsyslog("Fatal error %i\n", error); - while (1) - { - setLed(false); - ::sleep(1); - setLed(true); - ::sleep(1); - } -} - -void setLed(bool state) -{ - palWritePad(GPIO_PORT_LED, GPIO_PIN_LED, state); -} - -void restart() -{ - NVIC_SystemReset(); -} - -void readUniqueID(std::uint8_t bytes[UniqueIDSize]) -{ - std::memcpy(bytes, reinterpret_cast(0x1FFFF7E8), UniqueIDSize); -} - -} - -/* - * Early init from ChibiOS - */ -extern "C" -{ - -void __early_init(void) -{ - stm32_clock_init(); -} - -void boardInit(void) -{ - AFIO->MAPR |= - AFIO_MAPR_CAN_REMAP_REMAP3 | - AFIO_MAPR_CAN2_REMAP | - AFIO_MAPR_USART2_REMAP; - - /* - * Enabling the CAN controllers, then configuring GPIO functions for CAN_TX. - * Order matters, otherwise the CAN_TX pins will twitch, disturbing the CAN bus. - * This is why we can't perform this initialization using ChibiOS GPIO configuration. - */ - RCC->APB1ENR |= RCC_APB1ENR_CAN1EN; - palSetPadMode(GPIOD, 1, PAL_MODE_STM32_ALTERNATE_PUSHPULL); - -#if UAVCAN_STM32_NUM_IFACES > 1 - RCC->APB1ENR |= RCC_APB1ENR_CAN2EN; - palSetPadMode(GPIOB, 6, PAL_MODE_STM32_ALTERNATE_PUSHPULL); -#endif -} - -} diff --git a/libuavcan_drivers/stm32/test_stm32f107/src/board/board.hpp b/libuavcan_drivers/stm32/test_stm32f107/src/board/board.hpp deleted file mode 100644 index 8b69596455..0000000000 --- a/libuavcan_drivers/stm32/test_stm32f107/src/board/board.hpp +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2015 Pavel Kirienko - */ - -#pragma once - -#include - -namespace board -{ - -void init(); - -__attribute__((noreturn)) -void die(int error); - -void setLed(bool state); - -void restart(); - -constexpr unsigned UniqueIDSize = 12; - -void readUniqueID(std::uint8_t bytes[UniqueIDSize]); - -} diff --git a/libuavcan_drivers/stm32/test_stm32f107/src/dummy.cpp b/libuavcan_drivers/stm32/test_stm32f107/src/dummy.cpp deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/libuavcan_drivers/stm32/test_stm32f107/src/main.cpp b/libuavcan_drivers/stm32/test_stm32f107/src/main.cpp deleted file mode 100644 index 5cf2921c9a..0000000000 --- a/libuavcan_drivers/stm32/test_stm32f107/src/main.cpp +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Copyright (C) 2014 Pavel Kirienko - */ - -#include -#include -#include -#include -#include -#include "board/board.hpp" - -namespace app -{ -namespace -{ - -uavcan_stm32::CanInitHelper<128> can; - -constexpr unsigned NodePoolSize = 16384; - -uavcan::Node& getNode() -{ - static uavcan::Node node(can.driver, uavcan_stm32::SystemClock::instance()); - return node; -} - -void init() -{ - board::init(); - - /* - * CAN auto bit rate detection. - * Automatic bit rate detection requires that the bus has at least one other CAN node publishing some - * frames periodically. - * Auto bit rate detection can be bypassed byif the desired bit rate is passed directly to can.init(), e.g.: - * can.init(1000000); - */ - int res = 0; - do - { - ::sleep(1); - ::lowsyslog("CAN auto bit rate detection...\n"); - - std::uint32_t bitrate = 0; - res = can.init([]() { ::usleep(can.getRecommendedListeningDelay().toUSec()); }, bitrate); - if (res >= 0) - { - ::lowsyslog("CAN inited at %u bps\n", unsigned(bitrate)); - } - } - while (res < 0); -} - -class : public chibios_rt::BaseStaticThread<8192> -{ - void configureNodeInfo() - { - getNode().setName("org.uavcan.stm32_test_stm32f107"); - - /* - * Software version - * TODO: Fill other fields too - */ - uavcan::protocol::SoftwareVersion swver; - - swver.vcs_commit = GIT_HASH; - swver.optional_field_flags = swver.OPTIONAL_FIELD_FLAG_VCS_COMMIT; - - getNode().setSoftwareVersion(swver); - - lowsyslog("Git commit hash: 0x%08x\n", GIT_HASH); - - /* - * Hardware version - * TODO: Fill other fields too - */ - uavcan::protocol::HardwareVersion hwver; - - std::uint8_t uid[board::UniqueIDSize] = {}; - board::readUniqueID(uid); - std::copy(std::begin(uid), std::end(uid), std::begin(hwver.unique_id)); - - getNode().setHardwareVersion(hwver); - - lowsyslog("UDID:"); - for (auto b : hwver.unique_id) - { - lowsyslog(" %02x", unsigned(b)); - } - lowsyslog("\n"); - } - - void performDynamicNodeIDAllocation() - { - uavcan::DynamicNodeIDClient client(getNode()); - - const int client_start_res = client.start(getNode().getHardwareVersion().unique_id); - if (client_start_res < 0) - { - board::die(client_start_res); - } - - lowsyslog("Waiting for dynamic node ID allocation...\n"); - while (!client.isAllocationComplete()) - { - const int spin_res = getNode().spin(uavcan::MonotonicDuration::fromMSec(100)); - if (spin_res < 0) - { - lowsyslog("Spin failure: %i\n", spin_res); - } - } - - lowsyslog("Dynamic node ID %d allocated by %d\n", - int(client.getAllocatedNodeID().get()), - int(client.getAllocatorNodeID().get())); - - getNode().setNodeID(client.getAllocatedNodeID()); - } - -public: - msg_t main() - { - /* - * Setting up the node parameters - */ - configureNodeInfo(); - - /* - * Initializing the UAVCAN node - */ - const int node_init_res = getNode().start(); - if (node_init_res < 0) - { - board::die(node_init_res); - } - - /* - * Waiting for a dynamic node ID allocation - */ - performDynamicNodeIDAllocation(); - - /* - * Time synchronizer - */ - static uavcan::GlobalTimeSyncSlave time_sync_slave(getNode()); - { - const int res = time_sync_slave.start(); - if (res < 0) - { - board::die(res); - } - } - - /* - * Main loop - */ - lowsyslog("UAVCAN node started\n"); - getNode().setModeOperational(); - while (true) - { - const int spin_res = getNode().spin(uavcan::MonotonicDuration::fromMSec(5000)); - if (spin_res < 0) - { - lowsyslog("Spin failure: %i\n", spin_res); - } - - lowsyslog("Time sync master: %u\n", unsigned(time_sync_slave.getMasterNodeID().get())); - - lowsyslog("Memory usage: free=%u used=%u worst=%u\n", - getNode().getAllocator().getNumFreeBlocks(), - getNode().getAllocator().getNumUsedBlocks(), - getNode().getAllocator().getPeakNumUsedBlocks()); - - lowsyslog("CAN errors: %lu %lu\n", - static_cast(can.driver.getIface(0)->getErrorCount()), - static_cast(can.driver.getIface(1)->getErrorCount())); - -#if !UAVCAN_TINY - node.getLogger().setLevel(uavcan::protocol::debug::LogLevel::INFO); - node.logInfo("app", "UTC %* sec, %* corr, %* jumps", - uavcan_stm32::clock::getUtc().toMSec() / 1000, - uavcan_stm32::clock::getUtcSpeedCorrectionPPM(), - uavcan_stm32::clock::getUtcAjdustmentJumpCount()); -#endif - } - return msg_t(); - } -} uavcan_node_thread; - -} -} - -int main() -{ - app::init(); - - lowsyslog("Starting the UAVCAN thread\n"); - app::uavcan_node_thread.start(LOWPRIO); - - while (true) - { - for (int i = 0; i < 200; i++) - { - board::setLed(app::can.driver.hadActivity()); - ::usleep(25000); - } - - const uavcan::UtcTime utc = uavcan_stm32::clock::getUtc(); - lowsyslog("UTC %lu sec Rate corr: %fPPM Jumps: %lu Locked: %i\n", - static_cast(utc.toMSec() / 1000), - uavcan_stm32::clock::getUtcRateCorrectionPPM(), - uavcan_stm32::clock::getUtcJumpCount(), - int(uavcan_stm32::clock::isUtcLocked())); - } -} diff --git a/libuavcan_drivers/stm32/test_stm32f107/src/sys/board.h b/libuavcan_drivers/stm32/test_stm32f107/src/sys/board.h deleted file mode 100644 index c0608f24c1..0000000000 --- a/libuavcan_drivers/stm32/test_stm32f107/src/sys/board.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2014 Pavel Kirienko - */ - -#pragma once - -/// Assert is needed for STM32 SPL (if it is being used, that is) -#include -#define assert_param(x) assert(x) - -#define STM32_LSECLK 32768 -#define STM32_HSECLK 25000000 - -#define STM32F10X_CL - -/* - * GPIO - */ -// LED -#define GPIO_PORT_LED GPIOB -#define GPIO_PIN_LED 9 - -// GPIOD 10 is configured as OUTPUT, it is used as board reboot monitor. - -/* - * I/O ports initial setup, this configuration is established soon after reset - * in the initialization code. - * - * The digits have the following meaning: - * 0 - Analog input. - * 1 - Push Pull output 10MHz. - * 2 - Push Pull output 2MHz. - * 3 - Push Pull output 50MHz. - * 4 - Digital input. - * 5 - Open Drain output 10MHz. - * 6 - Open Drain output 2MHz. - * 7 - Open Drain output 50MHz. - * 8 - Digital input with PullUp or PullDown resistor depending on ODR. - * 9 - Alternate Push Pull output 10MHz. - * A - Alternate Push Pull output 2MHz. - * B - Alternate Push Pull output 50MHz. - * C - Reserved. - * D - Alternate Open Drain output 10MHz. - * E - Alternate Open Drain output 2MHz. - * F - Alternate Open Drain output 50MHz. - * Please refer to the STM32 Reference Manual for details. - */ - -#define VAL_GPIOACRL 0x88888888 // 7..0 -#define VAL_GPIOACRH 0x88888888 // 15..8 -#define VAL_GPIOAODR 0x00000000 - -#define VAL_GPIOBCRL 0x84488888 // CAN2 TX initialized as INPUT, it must be configured later! -#define VAL_GPIOBCRH 0x88888828 -#define VAL_GPIOBODR 0x00000000 - -#define VAL_GPIOCCRL 0x88888888 -#define VAL_GPIOCCRH 0x88888888 -#define VAL_GPIOCODR 0x00000000 - -#define VAL_GPIODCRL 0x88b88844 // CAN1 TX initialized as INPUT, it must be configured later! -#define VAL_GPIODCRH 0x88888288 -#define VAL_GPIODODR ((1 << 10)) - -#define VAL_GPIOECRL 0x88888888 -#define VAL_GPIOECRH 0x88888888 -#define VAL_GPIOEODR 0x00000000 - -#if !defined(_FROM_ASM_) -#ifdef __cplusplus -extern "C" { -#endif - void boardInit(void); -#ifdef __cplusplus -} -#endif -#endif /* _FROM_ASM_ */ diff --git a/libuavcan_drivers/stm32/test_stm32f107/src/sys/chconf.h b/libuavcan_drivers/stm32/test_stm32f107/src/sys/chconf.h deleted file mode 100644 index 8ef09b83f5..0000000000 --- a/libuavcan_drivers/stm32/test_stm32f107/src/sys/chconf.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2014 Pavel Kirienko - */ - -#pragma once - -#define CH_FREQUENCY 1000 - -#define CH_USE_HEAP TRUE -#define CH_USE_DYNAMIC FALSE - -#if defined(DEBUG_BUILD) && DEBUG_BUILD -# define CH_OPTIMIZE_SPEED FALSE -# define CH_DBG_SYSTEM_STATE_CHECK TRUE -# define CH_DBG_ENABLE_CHECKS TRUE -# define CH_DBG_ENABLE_ASSERTS TRUE -# define CH_DBG_ENABLE_STACK_CHECK TRUE -# define CH_DBG_FILL_THREADS TRUE -# define CH_DBG_THREADS_PROFILING TRUE -#elif defined(RELEASE_BUILD) && RELEASE_BUILD -# define CH_DBG_THREADS_PROFILING FALSE -#else -# error "Invalid configuration: Either DEBUG_BUILD or RELEASE_BUILD must be true" -#endif - -#define PORT_IDLE_THREAD_STACK_SIZE 64 -#define PORT_INT_REQUIRED_STACK 256 - -#include diff --git a/libuavcan_drivers/stm32/test_stm32f107/src/sys/halconf.h b/libuavcan_drivers/stm32/test_stm32f107/src/sys/halconf.h deleted file mode 100644 index 7ba0fd82d9..0000000000 --- a/libuavcan_drivers/stm32/test_stm32f107/src/sys/halconf.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2014 Pavel Kirienko - */ - -#pragma once - -#include "mcuconf.h" - -#define HAL_USE_TM TRUE -#define HAL_USE_PAL TRUE -#define HAL_USE_ADC FALSE -#define HAL_USE_CAN FALSE -#define HAL_USE_DAC FALSE -#define HAL_USE_EXT FALSE -#define HAL_USE_GPT FALSE -#define HAL_USE_I2C FALSE -#define HAL_USE_ICU FALSE -#define HAL_USE_MAC FALSE -#define HAL_USE_MMC_SPI FALSE -#define HAL_USE_PWM FALSE -#define HAL_USE_RTC FALSE -#define HAL_USE_SDC FALSE -#define HAL_USE_SERIAL TRUE -#define HAL_USE_SERIAL_USB FALSE -#define HAL_USE_SPI FALSE -#define HAL_USE_UART FALSE -#define HAL_USE_USB FALSE - -#define SERIAL_DEFAULT_BITRATE 115200 -#define SERIAL_BUFFERS_SIZE 128 - -#include diff --git a/libuavcan_drivers/stm32/test_stm32f107/src/sys/mcuconf.h b/libuavcan_drivers/stm32/test_stm32f107/src/sys/mcuconf.h deleted file mode 100644 index af2f21f399..0000000000 --- a/libuavcan_drivers/stm32/test_stm32f107/src/sys/mcuconf.h +++ /dev/null @@ -1,191 +0,0 @@ -/* - * STM32F107 drivers configuration. - * The following settings override the default settings present in - * the various device driver implementation headers. - * Note that the settings for each driver only have effect if the whole - * driver is enabled in halconf.h. - * - * IRQ priorities: - * 15...0 Lowest...Highest. - * - * DMA priorities: - * 0...3 Lowest...Highest. - */ - -#define STM32F107_MCUCONF - -/* - * HAL driver system settings. - */ -#define STM32_NO_INIT FALSE -#define STM32_HSI_ENABLED TRUE -#define STM32_LSI_ENABLED TRUE -#define STM32_HSE_ENABLED TRUE -#define STM32_LSE_ENABLED FALSE -#define STM32_SW STM32_SW_PLL -#define STM32_PLLSRC STM32_PLLSRC_PREDIV1 -#define STM32_PREDIV1SRC STM32_PREDIV1SRC_PLL2 -#define STM32_PREDIV1_VALUE 5 -#define STM32_PLLMUL_VALUE 9 -#define STM32_PREDIV2_VALUE 5 -#define STM32_PLL2MUL_VALUE 8 -#define STM32_PLL3MUL_VALUE 10 -#define STM32_HPRE STM32_HPRE_DIV1 -#define STM32_PPRE1 STM32_PPRE1_DIV2 -#define STM32_PPRE2 STM32_PPRE2_DIV2 -#define STM32_ADCPRE STM32_ADCPRE_DIV4 -#define STM32_OTG_CLOCK_REQUIRED FALSE -#define STM32_OTGFSPRE STM32_OTGFSPRE_DIV3 -#define STM32_I2S_CLOCK_REQUIRED FALSE -#define STM32_MCOSEL STM32_MCOSEL_PLL3 -#define STM32_RTCSEL STM32_RTCSEL_HSEDIV -#define STM32_PVD_ENABLE FALSE -#define STM32_PLS STM32_PLS_LEV0 - -/* - * ADC driver system settings. - */ -#define STM32_ADC_USE_ADC1 FALSE -#define STM32_ADC_ADC1_DMA_PRIORITY 2 -#define STM32_ADC_ADC1_IRQ_PRIORITY 6 - -/* - * CAN driver system settings. - */ -#define STM32_CAN_USE_CAN1 FALSE -#define STM32_CAN_USE_CAN2 FALSE -#define STM32_CAN_CAN1_IRQ_PRIORITY 4 -#define STM32_CAN_CAN2_IRQ_PRIORITY 4 - -/* - * EXT driver system settings. - */ -#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI17_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 - -/* - * GPT driver system settings. - */ -#define STM32_GPT_USE_TIM1 FALSE -#define STM32_GPT_USE_TIM2 FALSE -#define STM32_GPT_USE_TIM3 FALSE -#define STM32_GPT_USE_TIM4 FALSE -#define STM32_GPT_USE_TIM5 FALSE -#define STM32_GPT_USE_TIM8 FALSE -#define STM32_GPT_TIM1_IRQ_PRIORITY 7 -#define STM32_GPT_TIM2_IRQ_PRIORITY 7 -#define STM32_GPT_TIM3_IRQ_PRIORITY 7 -#define STM32_GPT_TIM4_IRQ_PRIORITY 7 -#define STM32_GPT_TIM5_IRQ_PRIORITY 7 -#define STM32_GPT_TIM8_IRQ_PRIORITY 7 - -/* - * I2C driver system settings. - */ -#define STM32_I2C_USE_I2C1 FALSE -#define STM32_I2C_USE_I2C2 FALSE -#define STM32_I2C_I2C1_IRQ_PRIORITY 5 -#define STM32_I2C_I2C2_IRQ_PRIORITY 5 -#define STM32_I2C_I2C1_DMA_PRIORITY 3 -#define STM32_I2C_I2C2_DMA_PRIORITY 3 -#define STM32_I2C_I2C1_DMA_ERROR_HOOK() chSysHalt() -#define STM32_I2C_I2C2_DMA_ERROR_HOOK() chSysHalt() - -/* - * ICU driver system settings. - */ -#define STM32_ICU_USE_TIM1 FALSE -#define STM32_ICU_USE_TIM2 FALSE -#define STM32_ICU_USE_TIM3 FALSE -#define STM32_ICU_USE_TIM4 FALSE -#define STM32_ICU_USE_TIM5 FALSE -#define STM32_ICU_USE_TIM8 FALSE -#define STM32_ICU_TIM1_IRQ_PRIORITY 7 -#define STM32_ICU_TIM2_IRQ_PRIORITY 7 -#define STM32_ICU_TIM3_IRQ_PRIORITY 7 -#define STM32_ICU_TIM4_IRQ_PRIORITY 7 -#define STM32_ICU_TIM5_IRQ_PRIORITY 7 -#define STM32_ICU_TIM8_IRQ_PRIORITY 7 - -/* - * PWM driver system settings. - */ -#define STM32_PWM_USE_ADVANCED FALSE -#define STM32_PWM_USE_TIM1 TRUE -#define STM32_PWM_USE_TIM2 FALSE -#define STM32_PWM_USE_TIM3 FALSE -#define STM32_PWM_USE_TIM4 FALSE -#define STM32_PWM_USE_TIM5 FALSE -#define STM32_PWM_USE_TIM8 FALSE -#define STM32_PWM_TIM1_IRQ_PRIORITY 7 -#define STM32_PWM_TIM2_IRQ_PRIORITY 7 -#define STM32_PWM_TIM3_IRQ_PRIORITY 7 -#define STM32_PWM_TIM4_IRQ_PRIORITY 7 -#define STM32_PWM_TIM5_IRQ_PRIORITY 7 -#define STM32_PWM_TIM8_IRQ_PRIORITY 7 - -/* - * RTC driver system settings. - */ -#define STM32_RTC_IRQ_PRIORITY 15 - -/* - * SERIAL driver system settings. - */ -#define STM32_SERIAL_USE_USART1 FALSE -#define STM32_SERIAL_USE_USART2 TRUE -#define STM32_SERIAL_USE_USART3 FALSE -#define STM32_SERIAL_USE_UART4 FALSE -#define STM32_SERIAL_USE_UART5 FALSE -#define STM32_SERIAL_USART1_PRIORITY 12 -#define STM32_SERIAL_USART2_PRIORITY 12 -#define STM32_SERIAL_USART3_PRIORITY 12 -#define STM32_SERIAL_UART4_PRIORITY 12 -#define STM32_SERIAL_UART5_PRIORITY 12 - -/* - * SPI driver system settings. - */ -#define STM32_SPI_USE_SPI1 FALSE -#define STM32_SPI_USE_SPI2 FALSE -#define STM32_SPI_USE_SPI3 FALSE -#define STM32_SPI_SPI1_DMA_PRIORITY 1 -#define STM32_SPI_SPI2_DMA_PRIORITY 1 -#define STM32_SPI_SPI3_DMA_PRIORITY 1 -#define STM32_SPI_SPI1_IRQ_PRIORITY 10 -#define STM32_SPI_SPI2_IRQ_PRIORITY 10 -#define STM32_SPI_SPI3_IRQ_PRIORITY 10 -#define STM32_SPI_DMA_ERROR_HOOK(spip) chSysHalt() - -/* - * UART driver system settings. - */ -#define STM32_UART_USE_USART1 FALSE -#define STM32_UART_USE_USART2 FALSE -#define STM32_UART_USE_USART3 FALSE -#define STM32_UART_USART1_IRQ_PRIORITY 12 -#define STM32_UART_USART2_IRQ_PRIORITY 12 -#define STM32_UART_USART3_IRQ_PRIORITY 12 -#define STM32_UART_USART1_DMA_PRIORITY 0 -#define STM32_UART_USART2_DMA_PRIORITY 0 -#define STM32_UART_USART3_DMA_PRIORITY 0 -#define STM32_UART_DMA_ERROR_HOOK(uartp) chSysHalt() - -/* - * USB driver system settings. - */ -#define STM32_USB_USE_OTG1 FALSE -#define STM32_USB_OTG1_IRQ_PRIORITY 14 -#define STM32_USB_OTG1_RX_FIFO_SIZE 512 -#define STM32_USB_OTG_THREAD_PRIO LOWPRIO -#define STM32_USB_OTG_THREAD_STACK_SIZE 128 -#define STM32_USB_OTGFIFO_FILL_BASEPRI 0 From 06a994384e26eb62984aaa2efc7c54ad27740dab Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Thu, 26 Apr 2018 17:23:11 +0300 Subject: [PATCH 2/2] Typo --- libuavcan_drivers/stm32/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libuavcan_drivers/stm32/README.md b/libuavcan_drivers/stm32/README.md index 4837b2b4ae..11cf01662f 100644 --- a/libuavcan_drivers/stm32/README.md +++ b/libuavcan_drivers/stm32/README.md @@ -1,5 +1,5 @@ -STM32 platform drivers -====================== +STM32 platform driver +===================== The directory `driver` contains the STM32 platform driver for Libuavcan.