diff options
46 files changed, 5355 insertions, 2471 deletions
| diff --git a/demos/TIVA/RT-TM4C123G-LAUNCHPAD/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch b/demos/TIVA/RT-TM4C123G-LAUNCHPAD/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch deleted file mode 100644 index 0af6b44..0000000 --- a/demos/TIVA/RT-TM4C123G-LAUNCHPAD/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"> -<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> -<listEntry value="org.eclipse.ui.externaltools.launchGroup"/> -</listAttribute> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${eclipse_home}\..\tools\openocd\bin\openocd.exe"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-c "telnet_port 4444" -f "interface/ti-icdi.cfg" -f "${file_prompt}""/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${eclipse_home}\..\tools\openocd\scripts\"/> -</launchConfiguration> diff --git a/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch b/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch deleted file mode 100644 index b75efdd..0000000 --- a/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"> -<stringAttribute key="bad_container_name" value="\RT-TM4C1294-LAUNCHPAD-\debug"/> -<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> -<listEntry value="org.eclipse.ui.externaltools.launchGroup"/> -</listAttribute> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${eclipse_home}\..\tools\openocd\bin\openocd.exe"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-c "telnet_port 4444" -f "interface/ti-icdi.cfg" -f "${file_prompt}""/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${eclipse_home}\..\tools\openocd\scripts\"/> -</launchConfiguration> diff --git a/demos/TIVA/RT-TM4C1294-LAUNCHPAD/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch b/demos/TIVA/RT-TM4C1294-LAUNCHPAD/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch deleted file mode 100644 index 51c985f..0000000 --- a/demos/TIVA/RT-TM4C1294-LAUNCHPAD/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"> -<stringAttribute key="bad_container_name" value="\RT-TM4C129-LAUNCHPAD\debug"/> -<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> -<listEntry value="org.eclipse.ui.externaltools.launchGroup"/> -</listAttribute> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${eclipse_home}\..\tools\openocd\bin\openocd.exe"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-c "telnet_port 4444" -f "interface/ti-icdi.cfg" -f "${file_prompt}""/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${eclipse_home}\..\tools\openocd\scripts\"/> -</launchConfiguration> diff --git a/os/common/ext/CMSIS/KINETIS/k20xx.h b/os/common/ext/CMSIS/KINETIS/k20xx.h index 38855aa..8218b3c 100644 --- a/os/common/ext/CMSIS/KINETIS/k20xx.h +++ b/os/common/ext/CMSIS/KINETIS/k20xx.h @@ -2242,7 +2242,7 @@ typedef struct  /******** Bits definition for USBx_CTL register *****************/  #define USBx_CTL_JSTATE              ((uint8_t)0x80) /*!< Live USB differential receiver JSTATE signal */  #define USBx_CTL_SE0                 ((uint8_t)0x40) /*!< Live USB single ended zero signal */ -#define USBx_CTL_TXSUSPENDTOKENBUS   ((uint8_t)0x20) /*!<  */ +#define USBx_CTL_TXSUSPENDTOKENBUSY  ((uint8_t)0x20) /*!<  */  #define USBx_CTL_RESET               ((uint8_t)0x10) /*!< Generates an USB reset signal (host mode) */  #define USBx_CTL_HOSTMODEEN          ((uint8_t)0x08) /*!< Operate in Host mode */  #define USBx_CTL_RESUME              ((uint8_t)0x04) /*!< Executes resume signaling */ diff --git a/os/hal/boards/ST_STM32F0308_DISCOVERY/board.c b/os/hal/boards/ST_STM32F0308_DISCOVERY/board.c index dc058f6..3412452 100644 --- a/os/hal/boards/ST_STM32F0308_DISCOVERY/board.c +++ b/os/hal/boards/ST_STM32F0308_DISCOVERY/board.c @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006-2014 Giovanni Di Sirio
 +    ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
 @@ -14,15 +14,76 @@      limitations under the License.
  */
 +/*
 + * This file has been automatically generated using ChibiStudio board
 + * generator plugin. Do not edit manually.
 + */
 +
  #include "hal.h"
 +#include "stm32_gpio.h"
 +
 +/*===========================================================================*/
 +/* Driver local definitions.                                                 */
 +/*===========================================================================*/
 +
 +/*===========================================================================*/
 +/* Driver exported variables.                                                */
 +/*===========================================================================*/
 +
 +/*===========================================================================*/
 +/* Driver local variables and types.                                         */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Type of STM32 GPIO port setup.
 + */
 +typedef struct {
 +  uint32_t              moder;
 +  uint32_t              otyper;
 +  uint32_t              ospeedr;
 +  uint32_t              pupdr;
 +  uint32_t              odr;
 +  uint32_t              afrl;
 +  uint32_t              afrh;
 +} gpio_setup_t;
 +
 +/**
 + * @brief   Type of STM32 GPIO initialization data.
 + */
 +typedef struct {
 +#if STM32_HAS_GPIOA || defined(__DOXYGEN__)
 +  gpio_setup_t          PAData;
 +#endif
 +#if STM32_HAS_GPIOB || defined(__DOXYGEN__)
 +  gpio_setup_t          PBData;
 +#endif
 +#if STM32_HAS_GPIOC || defined(__DOXYGEN__)
 +  gpio_setup_t          PCData;
 +#endif
 +#if STM32_HAS_GPIOD || defined(__DOXYGEN__)
 +  gpio_setup_t          PDData;
 +#endif
 +#if STM32_HAS_GPIOE || defined(__DOXYGEN__)
 +  gpio_setup_t          PEData;
 +#endif
 +#if STM32_HAS_GPIOF || defined(__DOXYGEN__)
 +  gpio_setup_t          PFData;
 +#endif
 +#if STM32_HAS_GPIOG || defined(__DOXYGEN__)
 +  gpio_setup_t          PGData;
 +#endif
 +#if STM32_HAS_GPIOH || defined(__DOXYGEN__)
 +  gpio_setup_t          PHData;
 +#endif
 +#if STM32_HAS_GPIOI || defined(__DOXYGEN__)
 +  gpio_setup_t          PIData;
 +#endif
 +} gpio_config_t;
 -#if HAL_USE_PAL || defined(__DOXYGEN__)
  /**
 - * @brief   PAL setup.
 - * @details Digital I/O ports static configuration as defined in @p board.h.
 - *          This variable is used by the HAL when initializing the PAL driver.
 + * @brief   STM32 GPIO static initialization data.
   */
 -const PALConfig pal_default_config = {
 +static const gpio_config_t gpio_default_config = {
  #if STM32_HAS_GPIOA
    {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR,
     VAL_GPIOA_ODR,   VAL_GPIOA_AFRL,   VAL_GPIOA_AFRH},
 @@ -57,21 +118,103 @@ const PALConfig pal_default_config = {  #endif
  #if STM32_HAS_GPIOI
    {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR,
 -   VAL_GPIOI_ODR,   VAL_GPIOI_AFRL,   VAL_GPIOI_AFRH}
 +   VAL_GPIOI_ODR,   VAL_GPIOI_AFRL,   VAL_GPIOI_AFRH},
  #endif
  };
 +
 +/*===========================================================================*/
 +/* Driver local functions.                                                   */
 +/*===========================================================================*/
 +
 +static void gpio_init(stm32_gpio_t *gpiop, const gpio_setup_t *config) {
 +
 +  gpiop->OTYPER  = config->otyper;
 +  gpiop->OSPEEDR = config->ospeedr;
 +  gpiop->PUPDR   = config->pupdr;
 +  gpiop->ODR     = config->odr;
 +  gpiop->AFRL    = config->afrl;
 +  gpiop->AFRH    = config->afrh;
 +  gpiop->MODER   = config->moder;
 +}
 +
 +static void stm32_gpio_init(void) {
 +
 +  /* Enabling GPIO-related clocks, the mask comes from the
 +     registry header file.*/
 +  rccResetAHB(STM32_GPIO_EN_MASK);
 +  rccEnableAHB(STM32_GPIO_EN_MASK, true);
 +
 +  /* Initializing all the defined GPIO ports.*/
 +#if STM32_HAS_GPIOA
 +  gpio_init(GPIOA, &gpio_default_config.PAData);
 +#endif
 +#if STM32_HAS_GPIOB
 +  gpio_init(GPIOB, &gpio_default_config.PBData);
  #endif
 +#if STM32_HAS_GPIOC
 +  gpio_init(GPIOC, &gpio_default_config.PCData);
 +#endif
 +#if STM32_HAS_GPIOD
 +  gpio_init(GPIOD, &gpio_default_config.PDData);
 +#endif
 +#if STM32_HAS_GPIOE
 +  gpio_init(GPIOE, &gpio_default_config.PEData);
 +#endif
 +#if STM32_HAS_GPIOF
 +  gpio_init(GPIOF, &gpio_default_config.PFData);
 +#endif
 +#if STM32_HAS_GPIOG
 +  gpio_init(GPIOG, &gpio_default_config.PGData);
 +#endif
 +#if STM32_HAS_GPIOH
 +  gpio_init(GPIOH, &gpio_default_config.PHData);
 +#endif
 +#if STM32_HAS_GPIOI
 +  gpio_init(GPIOI, &gpio_default_config.PIData);
 +#endif
 +}
 +
 +/*===========================================================================*/
 +/* Driver interrupt handlers.                                                */
 +/*===========================================================================*/
 +
 +/*===========================================================================*/
 +/* Driver exported functions.                                                */
 +/*===========================================================================*/
  /**
   * @brief   Early initialization code.
 - * @details This initialization must be performed just after stack setup
 - *          and before any other initialization.
 + * @details GPIO ports and system clocks are initialized before everything
 + *          else.
   */
  void __early_init(void) {
 +  stm32_gpio_init();
    stm32_clock_init();
  }
 +#if HAL_USE_SDC || defined(__DOXYGEN__)
 +/**
 + * @brief   SDC card detection.
 + */
 +bool sdc_lld_is_card_inserted(SDCDriver *sdcp) {
 +
 +  (void)sdcp;
 +  /* TODO: Fill the implementation.*/
 +  return true;
 +}
 +
 +/**
 + * @brief   SDC card write protection detection.
 + */
 +bool sdc_lld_is_write_protected(SDCDriver *sdcp) {
 +
 +  (void)sdcp;
 +  /* TODO: Fill the implementation.*/
 +  return false;
 +}
 +#endif /* HAL_USE_SDC */
 +
  #if HAL_USE_MMC_SPI || defined(__DOXYGEN__)
  /**
   * @brief   MMC_SPI card detection.
 @@ -99,4 +242,5 @@ bool mmc_lld_is_write_protected(MMCDriver *mmcp) {   * @todo    Add your board-specific code, if any.
   */
  void boardInit(void) {
 +
  }
 diff --git a/os/hal/ports/KINETIS/LLD/hal_sdc_lld.c b/os/hal/ports/KINETIS/LLD/hal_sdc_lld.c new file mode 100644 index 0000000..1b19a90 --- /dev/null +++ b/os/hal/ports/KINETIS/LLD/hal_sdc_lld.c @@ -0,0 +1,977 @@ +/*
 +    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
 +              Copyright (C) 2017..2018 Wim Lewis
 +
 +    Licensed 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.
 +*/
 +
 +/**
 + * @file    hal_sdc_lld.c
 + * @brief   Kinetis SDC subsystem low level driver.
 + *
 + * This driver provides a single SDC driver based on the Kinetis
 + * "Secured Digital Host Controller (SDHC)" peripheral.
 + *
 + * In order to use this driver, other peripherals must also be configured:
 + *
 + * The MPU must either be disabled (CESR=0), or it must be configured
 + * to allow the SDHC peripheral DMA access to any data buffers (read
 + * or write).
 + *
 + * The SDHC signals must be routed to the desired pins, and pullups/pulldowns
 + * configured. + *
 + * @addtogroup SDC
 + * @{
 + */
 +
 +#include "hal.h"
 +
 +#if (HAL_USE_SDC == TRUE) || defined(__DOXYGEN__)
 +
 +#include "hal_mmcsd.h"
 +
 +/*===========================================================================*/
 +/* Driver local definitions.                                                 */
 +/*===========================================================================*/
 +
 +/* We configure the SDHC block to use the system clock */
 +#define KINETIS_SDHC_PERIPHERAL_FREQUENCY KINETIS_SYSCLK_FREQUENCY
 +
 +#ifndef KINETIS_SDHC_PRIORITY
 +#define KINETIS_SDHC_PRIORITY 12 /* TODO? Default IRQ priority for SDHC */
 +#endif
 +
 +/* The DTOC value (data timeout counter) controls how long the SDHC
 +   will wait for a data transfer before indicating a timeout to
 +   us. The card can tell us how long that should be, but various SDHC
 +   documentation suggests that we should always allow around 500 msec
 +   even if the card says it will finish sooner. This only comes into
 +   play if there's a malfunction or something, so it's not critical to
 +   get it exactly right.
 +
 +   It controls the ratio between the SDCLK frequency and the
 +   timeout, so we have a different DTOCV for each bus clock
 +   frequency.
 +*/
 +#define DTOCV_300ms_400kHz    4  /* 4  -> 2^17 -> 328 msec */
 +#define DTOCV_700ms_25MHz    11  /* 11 -> 2^24 -> 671 msec */
 +#define DTOCV_700ms_50MHz    12  /* 12 -> 2^25 -> 671 msec */
 +
 +#if 0
 +#define TRACE(t, val)   chDbgWriteTrace ((void *)t, (void *)(uintptr_t)(val))
 +#define TRACEI(t, val)  chDbgWriteTraceI((void *)t, (void *)(uintptr_t)(val))
 +#else
 +#define TRACE(t, val)
 +#define TRACEI(t, val)
 +#endif
 +
 +#define DIV_RND_UP(a, b) ( ((a)+(b)-1) / (b) )
 +
 +/* Error bits from the SD / MMC Card Status response word. */
 +/* TODO: These really belong in a HLD, not here. */
 +#define MMC_ERR_OUT_OF_RANGE            (1U << 31)
 +#define MMC_ERR_ADDRESS                 (1U << 30)
 +#define MMC_ERR_BLOCK_LEN               (1U << 29)
 +#define MMC_ERR_ERASE_SEQ               (1U << 28)
 +#define MMC_ERR_ERASE_PARAM             (1U << 27)
 +#define MMC_ERR_WP                      (1U << 26)
 +#define MMC_ERR_CARD_IS_LOCKED          (1U << 25)
 +#define MMC_ERR_LOCK_UNLOCK_FAILED      (1U << 24)
 +#define MMC_ERR_COM_CRC_ERROR           (1U << 23)
 +#define MMC_ERR_ILLEGAL_COMMAND         (1U << 22)
 +#define MMC_ERR_CARD_ECC_FAILED         (1U << 21)
 +#define MMC_ERR_CARD_CONTROLLER         (1U << 20)
 +#define MMC_ERR_ERROR                   (1U << 19)
 +#define MMC_ERR_CSD_OVERWRITE           (1U << 16)
 +#define MMC_ERR_AKE_SEQ                 (1U << 3)
 +
 +/*===========================================================================*/
 +/* Driver exported variables.                                                */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   SDCD1 driver identifier.
 + */
 +#if (PLATFORM_SDC_USE_SDC1 == TRUE) || defined(__DOXYGEN__)
 +SDCDriver SDCD1;
 +#else
 +#error HAL_USE_SDC is true but PLATFORM_SDC_USE_SDC1 is false
 +#endif
 +
 +/*===========================================================================*/
 +/* Driver local variables and types.                                         */
 +/*===========================================================================*/
 +
 +/*===========================================================================*/
 +/* Driver local functions.                                                   */
 +/*===========================================================================*/
 +
 +static void recover_after_botched_transfer(SDCDriver *);
 +static msg_t wait_interrupt(SDCDriver *, uint32_t);
 +static bool sdc_lld_transfer(SDCDriver *, uint32_t, uintptr_t, uint32_t, uint32_t);
 +
 +/**
 + * Compute the SDCLKFS and DVS values for a given SDCLK divisor.
 + *
 + * Note that in the current code, this function is always called with
 + * a constant argument (there are only a handful of valid SDCLK
 + * frequencies), and so GCC computes the results at compile time and
 + * does not actually emit this function into the output at all unless
 + * you're compiling with optimizations turned off.
 + *
 + * However if someone compiles with a KINETIS_SDHC_PERIPHERAL_FREQUENCY
 + * that is not a compile-time constant, this function would get emitted.
 + */
 +static uint32_t divisor_settings(unsigned divisor)
 +{
 +  /* First, handle all the special cases */
 +  if (divisor <= 1) {
 +    /* Pass through */
 +    return SDHC_SYSCTL_SDCLKFS(0) | SDHC_SYSCTL_DVS(0);
 +  }
 +  if (divisor <= 16 && (divisor & 0x01)) {
 +    /* Disable the prescaler, just use the divider. */
 +    return SDHC_SYSCTL_SDCLKFS(0) | SDHC_SYSCTL_DVS(divisor - 1);
 +  }
 +  if (divisor <= 32 && !(divisor & 0x01)) {
 +    /* Prescale by 2, but do the rest with the divider */
 +    return SDHC_SYSCTL_SDCLKFS(0x01) | SDHC_SYSCTL_DVS((divisor >> 1) - 1);
 +  }
 +  if (divisor >= 0x1000) {
 +    /* It's not possible to divide by more than 2^12. If we're asked to,
 +       just do the best we can. */
 +    return SDHC_SYSCTL_SDCLKFS(0x80) | SDHC_SYSCTL_DVS(0xF);
 +  }
 +
 +  /* The bit position in SDCLKFS provides a power-of-two prescale
 +     factor, and the four bits in DVS allow division by up to 16
 +     (division by DVS+1). We want to approximate `divisor` using these
 +     terms, but we want to round up --- it's OK to run the card a
 +     little bit too slow, but not OK to run it a little bit too
 +     fast. */
 +
 +  unsigned shift = (8 * sizeof(unsigned int) - 4) - __builtin_clz(divisor);
 +
 +  /* Shift the divisor value right so that it only occupies the four
 +     lowest bits. Subtract one because that's how the DVS circuit
 +     works. Add one if we shifted any 1-bits off the bottom, so that
 +     we always round up. */
 +  unsigned dvs = (divisor >> shift) - ((divisor & ((1 << shift)-1))? 0 : 1);
 +
 +  return SDHC_SYSCTL_SDCLKFS(1 << (shift-1)) | SDHC_SYSCTL_DVS(dvs);
 +}
 +
 +/**
 + * @brief Enable the SDHC clock when stable.
 + *
 + * Waits for the clock divider in the SDHC block to stabilize, then
 + * enables the SD clock.
 + */
 +static void enable_clock_when_stable(uint32_t new_sysctl)
 +{
 +  SDHC->SYSCTL = new_sysctl;
 +  
 +  /* Wait for clock divider to stabilize */
 +  while(!(SDHC->PRSSTAT & SDHC_PRSSTAT_SDSTB)) {
 +    osalThreadSleepMilliseconds(1);
 +  }
 +
 +  /* Restart the clock */
 +  SDHC->SYSCTL = new_sysctl | SDHC_SYSCTL_SDCLKEN;
 +}
 +
 +/**
 + * Translate error bits from a CMD transaction to the HAL's error flag set.
 + */
 +static sdcflags_t translate_cmd_error(uint32_t status) {
 +  /* Translate the failure into the flags understood by the top half */
 +
 +  sdcflags_t errors = 0;
 +
 +  if (status & SDHC_IRQSTAT_CTOE || !(status & SDHC_IRQSTAT_CC)) {
 +    errors |= SDC_COMMAND_TIMEOUT;
 +  }
 +  if (status & SDHC_IRQSTAT_CCE) {
 +    errors |= SDC_CMD_CRC_ERROR;
 +  }
 +
 +  /* If CTOE and CCE are both set, this indicates that the Kinetis
 +     SDHC peripheral has detected a CMD line conflict in a
 +     multi-master scenario. There's no specific code for that, so just
 +     pass it through as a combined timeout+CRC failure. */
 +
 +  /* Translate any other framing and protocol errors into CRC errors. */
 +  if (status & ~(SDHC_IRQSTAT_CCE|SDHC_IRQSTAT_CTOE|SDHC_IRQSTAT_CC)) {
 +    errors |= SDC_CMD_CRC_ERROR;
 +  }
 +
 +  return errors;
 +}
 +
 +/**
 + * Translate error bits from a card's R1 response word into the HAL's
 + * error flag set.
 + *
 + * This function should probably be in the HLD, not here.
 + */
 +static sdcflags_t translate_mmcsd_error(uint32_t cardstatus) {
 +  sdcflags_t errors = 0;
 +
 +  cardstatus &= MMCSD_R1_ERROR_MASK;
 +
 +  if (cardstatus & MMC_ERR_COM_CRC_ERROR)
 +    errors |= SDC_CMD_CRC_ERROR;
 +
 +  if (cardstatus & MMC_ERR_CARD_ECC_FAILED)
 +    errors |= SDC_DATA_CRC_ERROR;
 +
 +  /* TODO: Extend the HLD error codes at least enough to distinguish
 +     between invalid command/parameter errors (card is OK, but
 +     retrying w/o change won't help) and other errors */
 +  if (cardstatus & ~(MMC_ERR_COM_CRC_ERROR|MMC_ERR_CARD_ECC_FAILED))
 +    errors |= SDC_UNHANDLED_ERROR;
 +
 +  return errors;
 +}
 +
 +/**
 + * @brief Perform one CMD transaction on the SD bus.
 + */
 +static bool send_and_wait_cmd(SDCDriver *sdcp, uint32_t cmd) {
 +  /* SDCLKEN (CMD clock enabled) should be true;
 +   * SDSTB (clock stable) should be true;
 +   * CIHB (command inhibit / busy) should be false */
 +  osalDbgAssert((SDHC->PRSSTAT & (SDHC_PRSSTAT_SDSTB|SDHC_PRSSTAT_CIHB)) == SDHC_PRSSTAT_SDSTB, "Not in expected state");
 +  osalDbgAssert(SDHC->SYSCTL & SDHC_SYSCTL_SDCLKEN, "Clock disabled");
 +  osalDbgCheck((cmd & SDHC_XFERTYP_DPSEL) == 0);
 +  osalDbgCheck((SDHC->IRQSTAT & (SDHC_IRQSTAT_CIE | SDHC_IRQSTAT_CEBE | SDHC_IRQSTAT_CCE |
 +                                 SDHC_IRQSTAT_CTOE | SDHC_IRQSTAT_CC)) == 0);
 +
 +  /* This initiates the CMD transaction */
 +  TRACE(1, cmd);
 +  SDHC->XFERTYP = cmd;
 +
 +  uint32_t events =
 +    SDHC_IRQSTAT_CIE | SDHC_IRQSTAT_CEBE | SDHC_IRQSTAT_CCE |
 +    SDHC_IRQSTAT_CTOE | /* SDHC_IRQSTAT_CRM | */ SDHC_IRQSTAT_CC;
 +  wait_interrupt(sdcp, SDHC_IRQSTAT_CTOE | SDHC_IRQSTAT_CC);
 +  uint32_t status = SDHC->IRQSTAT & events;
 +
 +  /* These bits are write-1-to-clear (w1c) */
 +  SDHC->IRQSTAT = status;
 +
 +  /* In the normal case, the CC (command complete) bit is set but none
 +     of the others are */
 +  if (status == SDHC_IRQSTAT_CC)
 +    return HAL_SUCCESS;
 +
 +  /* Translate the failure into the flags understood by the top half */
 +  sdcp->errors |= translate_cmd_error(status);
 +
 +  TRACE(9, SDHC->PRSSTAT);
 +
 +  /* Issue a reset to the CMD portion of the SDHC peripheral to clear the
 +     error bits and enable subsequent commands */
 +  SDHC->SYSCTL |= SDHC_SYSCTL_RSTC;
 +
 +  return HAL_FAILED;
 +}
 +
 +/**
 + * @brief Perform one data transaction on the SD bus.
 + */
 +static bool send_and_wait_transfer(SDCDriver *sdcp, uint32_t cmd) {
 +
 +  osalDbgCheck(cmd & SDHC_XFERTYP_DPSEL);
 +  osalDbgCheck(cmd & SDHC_XFERTYP_DMAEN);
 +
 +  const uint32_t cmd_end_bits =
 +    SDHC_IRQSTAT_CIE | SDHC_IRQSTAT_CEBE | SDHC_IRQSTAT_CCE |
 +    SDHC_IRQSTAT_CTOE | /* SDHC_IRQSTAT_CRM | */ SDHC_IRQSTAT_CC;
 +
 +  const uint32_t transfer_end_bits =
 +    SDHC_IRQSTAT_DMAE | SDHC_IRQSTAT_AC12E | SDHC_IRQSTAT_DEBE |
 +    SDHC_IRQSTAT_DCE | SDHC_IRQSTAT_DTOE | SDHC_IRQSTAT_TC;
 +
 +  TRACE(3, cmd);
 +
 +  osalSysLock();
 +  osalDbgCheck(sdcp->thread == NULL);
 +
 +  /* Clear anything pending from an earlier transfer */
 +  SDHC->IRQSTAT = cmd_end_bits | transfer_end_bits | SDHC_IRQSTAT_DINT;
 +
 +  /* Enable interrupts on completions or failures */
 +  uint32_t old_staten = SDHC->IRQSTATEN;
 +  SDHC->IRQSTATEN = (old_staten & ~(SDHC_IRQSTAT_BRR|SDHC_IRQSTAT_BWR)) | (cmd_end_bits | transfer_end_bits | SDHC_IRQSTAT_DINT);
 +  SDHC->IRQSIGEN = SDHC_IRQSTAT_CTOE | SDHC_IRQSTAT_CC;
 +
 +  /* Start the transfer */
 +  SDHC->XFERTYP = cmd;
 +
 +  /* Await an interrupt */
 +  osalThreadSuspendS(&sdcp->thread);
 +  osalSysUnlock();
 +
 +  /* Retrieve the flags and clear them */
 +  uint32_t cmdstat = SDHC->IRQSTAT & cmd_end_bits;
 +  SDHC->IRQSTAT = cmdstat;
 +  TRACE(2, cmdstat);
 +
 +  /* If the command failed, the transfer won't happen */
 +  if (cmdstat != SDHC_IRQSTAT_CC) {
 +    /* The command couldn't be sent, or wasn't acknowledged */
 +    sdcp->errors |= translate_cmd_error(cmdstat);
 +
 +    /* Clear the error status */
 +    SDHC->SYSCTL |= SDHC_SYSCTL_RSTC;
 +
 +    if (cmdstat == (SDHC_IRQSTAT_CCE|SDHC_IRQSTAT_CTOE)) {
 +      /* A CMD-line conflict is unlikely, but doesn't require further recovery */
 +    } else {
 +      /* For most error situations, we don't know whether the command
 +	 failed to send or we got line noise while receiving. Make sure
 +	 we're in a sane state by resetting the connection. */
 +      recover_after_botched_transfer(sdcp);
 +    }
 +
 +    return HAL_FAILED;
 +  }
 +
 +  uint32_t cmdresp = SDHC->CMDRSP[0];
 +  TRACE(11, cmdresp);
 +  if (cmdresp & MMCSD_R1_ERROR_MASK) {
 +    /* The command was sent, and the card responded with an error indication */
 +    sdcp->errors |= translate_mmcsd_error(cmdresp);
 +    return HAL_FAILED;
 +  }
 +
 +  /* Check for end of data transfer phase */
 +  uint32_t datastat;
 +  for (;;) {
 +    datastat = SDHC->IRQSTAT & (transfer_end_bits | SDHC_IRQSTAT_DINT);
 +    if (datastat & transfer_end_bits)
 +      break;
 +    wait_interrupt(sdcp, transfer_end_bits);
 +  }
 +  TRACE(6, datastat);
 +  SDHC->IRQSTAT = datastat;
 +
 +  /* Handle data transfer errors */
 +  if ((datastat & ~(SDHC_IRQSTAT_DINT)) != SDHC_IRQSTAT_TC) {
 +    bool should_cancel = false;
 +
 +    /* Data phase errors */
 +    if (datastat & (SDHC_IRQSTAT_DCE|SDHC_IRQSTAT_DEBE)) {
 +      sdcp->errors |= SDC_DATA_CRC_ERROR;
 +      should_cancel = true;
 +    }
 +    if (datastat & SDHC_IRQSTAT_DTOE) {
 +      sdcp->errors |= SDC_DATA_TIMEOUT;
 +      should_cancel = true;
 +    }
 +
 +    /* Internal DMA error */
 +    if (datastat & SDHC_IRQSTAT_DMAE) {
 +      sdcp->errors |= SDC_UNHANDLED_ERROR;
 +      if (!(datastat & SDHC_IRQSTAT_TC))
 +	should_cancel = true;
 +    }
 +
 +    if (datastat & SDHC_IRQSTAT_AC12E) {
 +      uint32_t cmd12error = SDHC->AC12ERR;
 +
 +      /* We don't know if CMD12 was successfully executed */
 +      should_cancel = true;
 +
 +      if (cmd12error & SDHC_AC12ERR_AC12NE) {
 +	sdcp->errors |= SDC_UNHANDLED_ERROR;
 +      } else {
 +	if (cmd12error & SDHC_AC12ERR_AC12TOE)
 +	  sdcp->errors |= SDC_COMMAND_TIMEOUT;
 +	if (cmd12error & (SDHC_AC12ERR_AC12CE|SDHC_AC12ERR_AC12EBE))
 +	  sdcp->errors |= SDC_CMD_CRC_ERROR;
 +      }
 +    }
 +
 +    if (should_cancel) {
 +      recover_after_botched_transfer(sdcp);
 +    }
 +
 +    return HAL_FAILED;
 +  }
 +
 +  /* For a read transfer, make sure the DMA has finished transferring
 +   * to host memory. (For a write transfer, the DMA necessarily finishes
 +   * before the transfer does, so we don't need to wait for it
 +   * specially.) */
 +  if (!(datastat & SDHC_IRQSTAT_DINT)) {
 +    for(;;) {
 +      datastat = SDHC->IRQSTAT & (SDHC_IRQSTAT_DINT|SDHC_IRQSTAT_DMAE);
 +      if (datastat) {
 +	SDHC->IRQSTAT = datastat;
 +	TRACE(7, datastat);
 +	break;
 +      }
 +      /* ...?? */
 +    }
 +  }
 +
 +  SDHC->IRQSTATEN = old_staten;
 +
 +  return HAL_SUCCESS;
 +}
 +
 +/**
 + * @brief Wait for an interrupt from the SDHC peripheral.
 + *
 + * @param[in] mask    Bits to enable in IRQSIGEN.
 + *
 + * @return            MSG_OK
 + */
 +static msg_t wait_interrupt(SDCDriver *sdcp, uint32_t mask) {
 +  osalSysLock();
 +  SDHC->IRQSIGEN = mask;
 +  msg_t wakeup = osalThreadSuspendS(&sdcp->thread);
 +  osalSysUnlock();
 +  return wakeup;
 +}
 +
 +static void recover_after_botched_transfer(SDCDriver *sdcp) {
 +
 +  /* Query the card state */
 +  uint32_t cardstatus;
 +  if (sdc_lld_send_cmd_short_crc(sdcp,
 +                                 MMCSD_CMD_SEND_STATUS,
 +                                 sdcp->rca, &cardstatus) == HAL_SUCCESS) {
 +    sdcp->errors |= translate_mmcsd_error(cardstatus);
 +    uint32_t state = MMCSD_R1_STS(cardstatus);
 +    if (state == MMCSD_STS_DATA) {
 +
 +      /* Send a CMD12 to make sure the card isn't still transferring anything */
 +      SDHC->CMDARG = 0;
 +      send_and_wait_cmd(sdcp,
 +                        SDHC_XFERTYP_CMDINX(MMCSD_CMD_STOP_TRANSMISSION) |
 +                        SDHC_XFERTYP_CMDTYP_ABORT |
 +                        /* TODO: Should we set CICEN and CCCEN here? */
 +                        SDHC_XFERTYP_CICEN | SDHC_XFERTYP_CCCEN |
 +                        SDHC_XFERTYP_RSPTYP_48b);
 +    }
 +  }
 +
 +  /* And reset the data block of the SDHC peripheral */
 +  SDHC->SYSCTL |= SDHC_SYSCTL_RSTD;
 +}
 +
 +/**
 + * @brief Perform one data transfer command
 + *
 + * Sends a command to the card and waits for the corresponding data transfer
 + * (either a read or write) to complete.
 + */
 +static bool sdc_lld_transfer(SDCDriver *sdcp, uint32_t startblk,
 +			     uintptr_t buf, uint32_t n,
 +			     uint32_t cmdx) {
 +
 +  osalDbgCheck(n > 0);
 +  osalDbgCheck((buf & 0x03) == 0);  /* Must be 32-bit aligned */
 +
 +  osalDbgAssert((SDHC->PRSSTAT & (SDHC_PRSSTAT_DLA|SDHC_PRSSTAT_CDIHB|SDHC_PRSSTAT_CIHB)) == 0,
 +		"SDHC interface not ready");
 +
 +  /* We always operate in terms of 512-byte blocks; the upper-layer
 +     driver doesn't change the block size. The SDHC spec suggests that
 +     only low-capacity cards support block sizes other than 512 bytes
 +     anyway (SDHC "Physical Layer Simplified Specification" ver 6.0) */
 +
 +  if (sdcp->cardmode & SDC_MODE_HIGH_CAPACITY) {
 +    SDHC->CMDARG = startblk;
 +  } else {
 +    SDHC->CMDARG = startblk * MMCSD_BLOCK_SIZE;
 +  }
 +
 +  /* Store the DMA start address */
 +  SDHC->DSADDR = buf;
 +
 +  uint32_t xfer;
 +  /* For data transfers, we need to set some extra bits in XFERTYP according to the
 +     transfer we're starting:
 +     DPSEL -> enable data transfer
 +     DTDSEL -> 1 for a read (card-to-host) transfer
 +     MSBSEL, BCEN -> multiple block transfer using BLKATTR_BLKCNT
 +     AC12EN -> Automatically issue MMCSD_CMD_STOP_TRANSMISSION at end of transfer
 +
 +     Setting BLKCOUNT to 1 seems to be necessary even if MSBSEL+BCEN
 +     is not set, despite the datasheet suggesting otherwise. I'm not
 +     sure if this is a silicon bug or if I'm misunderstanding the
 +     datasheet.
 +  */
 +  SDHC->BLKATTR =
 +    SDHC_BLKATTR_BLKCNT(n) |
 +    SDHC_BLKATTR_BLKSIZE(MMCSD_BLOCK_SIZE);
 +  if (n == 1) {
 +    xfer =
 +      cmdx |
 +      SDHC_XFERTYP_CMDTYP_NORMAL |
 +      SDHC_XFERTYP_CICEN | SDHC_XFERTYP_CCCEN |
 +      SDHC_XFERTYP_RSPTYP_48b |
 +      SDHC_XFERTYP_DPSEL | SDHC_XFERTYP_DMAEN;
 +  } else {
 +    xfer =
 +      cmdx |
 +      SDHC_XFERTYP_CMDTYP_NORMAL |
 +      SDHC_XFERTYP_CICEN | SDHC_XFERTYP_CCCEN |
 +      SDHC_XFERTYP_RSPTYP_48b |
 +      SDHC_XFERTYP_MSBSEL | SDHC_XFERTYP_BCEN | SDHC_XFERTYP_AC12EN |
 +      SDHC_XFERTYP_DPSEL | SDHC_XFERTYP_DMAEN;
 +  }
 +
 +  return send_and_wait_transfer(sdcp, xfer);
 +}
 +
 +/*===========================================================================*/
 +/* Driver interrupt handlers.                                                */
 +/*===========================================================================*/
 +
 +#if (PLATFORM_SDC_USE_SDC1 == TRUE) || defined(__DOXYGEN__)
 +OSAL_IRQ_HANDLER(KINETIS_SDHC_IRQ_VECTOR) {
 +  OSAL_IRQ_PROLOGUE();
 +  osalSysLockFromISR();
 +
 +  TRACEI(4, SDHC->IRQSTAT);
 +
 +  /* We disable the interrupts, and wake up the usermode task to read
 +   * the flags from IRQSTAT.
 +   */
 +  SDHC->IRQSIGEN = 0;
 +
 +  osalThreadResumeI(&SDCD1.thread, MSG_OK);
 +
 +  osalSysUnlockFromISR();
 +  OSAL_IRQ_EPILOGUE();
 +}
 +#endif
 +
 +/*===========================================================================*/
 +/* Driver exported functions.                                                */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Low level SDC driver initialization.
 + *
 + * @notapi
 + */
 +void sdc_lld_init(void) {
 +#if PLATFORM_SDC_USE_SDC1 == TRUE
 +  sdcObjectInit(&SDCD1);
 +#endif
 +}
 +
 +
 +/**
 + * @brief   Configures and activates the SDC peripheral.
 + *
 + * @param[in] sdcp      pointer to the @p SDCDriver object
 + *
 + * @notapi
 + */
 +void sdc_lld_start(SDCDriver *sdcp) {
 +
 +  if (sdcp->state == BLK_STOP) {
 +    SIM->SOPT2 =
 +      (SIM->SOPT2 & ~SIM_SOPT2_SDHCSRC_MASK) |
 +      SIM_SOPT2_SDHCSRC(0);  /* SDHC clock source 0: Core/system clock. */
 +    SIM->SCGC3 |= SIM_SCGC3_SDHC; /* Enable clock to SDHC peripheral */
 +
 +    /* Reset the SDHC block */
 +    SDHC->SYSCTL |= SDHC_SYSCTL_RSTA;
 +    while(SDHC->SYSCTL & SDHC_SYSCTL_RSTA) {
 +      osalThreadSleepMilliseconds(1);
 +    }
 +
 +    SDHC->IRQSIGEN = 0;
 +    nvicEnableVector(SDHC_IRQn, KINETIS_SDHC_PRIORITY);
 +  }
 +}
 +
 +/**
 + * @brief   Deactivates the SDC peripheral.
 + *
 + * @param[in] sdcp      pointer to the @p SDCDriver object
 + *
 + * @notapi
 + */
 +void sdc_lld_stop(SDCDriver *sdcp) {
 +
 +  if (sdcp->state != BLK_STOP) {
 +    /* TODO: Should we perform a reset (RSTA) before putting the
 +       peripheral to sleep? */
 +
 +    /* Disable the card clock */
 +    SDHC->SYSCTL &= ~( SDHC_SYSCTL_SDCLKEN );
 +
 +    /* Turn off interrupts */
 +    nvicDisableVector(SDHC_IRQn);
 +    SDHC->IRQSIGEN = 0;
 +    SDHC->IRQSTATEN &= ~( SDHC_IRQSTATEN_CINTSEN |
 +			  SDHC_IRQSTATEN_CINSEN |
 +			  SDHC_IRQSTATEN_CRMSEN );
 +
 +    /* Disable the clock to the SDHC peripheral block */
 +    SIM->SCGC3 &= ~( SIM_SCGC3_SDHC );
 +  }
 +}
 +
 +/**
 + * @brief   Starts the SDIO clock and sets it to init mode (400kHz or less).
 + *
 + * @param[in] sdcp      pointer to the @p SDCDriver object
 + *
 + * @notapi
 + */
 +void sdc_lld_start_clk(SDCDriver *sdcp) {
 +
 +  (void)sdcp;
 +
 +  /* Stop the card clock (it should already be stopped) */
 +  SDHC->SYSCTL &= ~( SDHC_SYSCTL_SDCLKEN );
 +
 +  /* Change the divisor and DTOCV for a 400kHz card closk */
 +  uint32_t sysctl =
 +    SDHC_SYSCTL_DTOCV(DTOCV_300ms_400kHz) |
 +    divisor_settings(DIV_RND_UP(KINETIS_SDHC_PERIPHERAL_FREQUENCY, 400000));
 +
 +  /* Restart the clock */
 +  enable_clock_when_stable(sysctl);
 +
 +  /* Reset any protocol machinery; this also runs the clock for 80
 +     cycles without any data bits to help initalize the card's state
 +     (the Kinetis peripheral docs say that this is required after card
 +     insertion or power-on, but the abridged SDHC specifications I
 +     have don't seem to mention it) */
 +  SDHC->SYSCTL |= SDHC_SYSCTL_INITA;
 +
 +  TRACE(9, SDHC->PRSSTAT);
 +}
 +
 +/**
 + * @brief   Sets the SDIO clock to data mode (25MHz or less).
 + *
 + * @param[in] sdcp      pointer to the @p SDCDriver object
 + * @param[in] clk       the clock mode
 + *
 + * @notapi
 + */
 +void sdc_lld_set_data_clk(SDCDriver *sdcp, sdcbusclk_t clk) {
 +
 +  (void)sdcp;
 +
 +  /* Stop the card clock */
 +  SDHC->SYSCTL &= ~( SDHC_SYSCTL_SDCLKEN );
 +
 +  /* Change the divisor */
 +  uint32_t ctl;
 +  switch (clk) {
 +  default:
 +  case SDC_CLK_25MHz:
 +    ctl =
 +      SDHC_SYSCTL_DTOCV(DTOCV_700ms_25MHz) |
 +      divisor_settings(DIV_RND_UP(KINETIS_SDHC_PERIPHERAL_FREQUENCY, 25000000));
 +    break;
 +  case SDC_CLK_50MHz:
 +    ctl =
 +      SDHC_SYSCTL_DTOCV(DTOCV_700ms_50MHz) |
 +      divisor_settings(DIV_RND_UP(KINETIS_SDHC_PERIPHERAL_FREQUENCY, 50000000));
 +    break;
 +  }
 +
 +  /* Restart the clock */
 +  enable_clock_when_stable(ctl);
 +}
 +
 +/**
 + * @brief   Stops the SDIO clock.
 + *
 + * @param[in] sdcp      pointer to the @p SDCDriver object
 + *
 + * @notapi
 + */
 +void sdc_lld_stop_clk(SDCDriver *sdcp) {
 +  (void)sdcp;
 +  SDHC->SYSCTL &= ~( SDHC_SYSCTL_SDCLKEN );
 +}
 +
 +/**
 + * @brief   Switches the bus to 4 bit or 8 bit mode.
 + *
 + * @param[in] sdcp      pointer to the @p SDCDriver object
 + * @param[in] mode      bus mode
 + *
 + * @notapi
 + */
 +void sdc_lld_set_bus_mode(SDCDriver *sdcp, sdcbusmode_t mode) {
 +  (void)sdcp;
 +  uint32_t proctl = SDHC->PROCTL & ~( SDHC_PROCTL_DTW_MASK );
 +
 +  switch (mode) {
 +  case SDC_MODE_1BIT:
 +    proctl |= SDHC_PROCTL_DTW_1BIT;
 +    break;
 +  case SDC_MODE_4BIT:
 +    proctl |= SDHC_PROCTL_DTW_4BIT;
 +    break;
 +  case SDC_MODE_8BIT:
 +    proctl |= SDHC_PROCTL_DTW_8BIT;
 +    break;
 +  default:
 +    osalDbgAssert(false, "invalid bus mode");
 +    break;
 +  }
 +
 +  SDHC->PROCTL = proctl;
 +}
 +
 +/**
 + * @brief   Sends an SDIO command with no response expected.
 + *
 + * @param[in] sdcp      pointer to the @p SDCDriver object
 + * @param[in] cmd       card command
 + * @param[in] arg       command argument
 + *
 + * @notapi
 + */
 +void sdc_lld_send_cmd_none(SDCDriver *sdcp, uint8_t cmd, uint32_t arg) {
 +  SDHC->CMDARG = arg;
 +  uint32_t xfer =
 +    SDHC_XFERTYP_CMDINX(cmd) |
 +    SDHC_XFERTYP_CMDTYP_NORMAL |
 +    /* DPSEL=0, CICEN=0, CCCEN=0 */
 +    SDHC_XFERTYP_RSPTYP_NONE;
 +
 +  send_and_wait_cmd(sdcp, xfer);
 +}
 +
 +/**
 + * @brief   Sends an SDIO command with a short response expected.
 + * @note    The CRC is not verified.
 + *
 + * @param[in] sdcp      pointer to the @p SDCDriver object
 + * @param[in] cmd       card command
 + * @param[in] arg       command argument
 + * @param[out] resp     pointer to the response buffer (one word)
 + *
 + * @return              The operation status.
 + * @retval HAL_SUCCESS  operation succeeded.
 + * @retval HAL_FAILED   operation failed.
 + *
 + * @notapi
 + */
 +bool sdc_lld_send_cmd_short(SDCDriver *sdcp, uint8_t cmd, uint32_t arg,
 +                            uint32_t *resp) {
 +  SDHC->CMDARG = arg;
 +  uint32_t xfer =
 +    SDHC_XFERTYP_CMDINX(cmd) |
 +    SDHC_XFERTYP_CMDTYP_NORMAL |
 +    /* DPSEL=0, CICEN=0, CCCEN=0 */
 +    SDHC_XFERTYP_RSPTYP_48;
 +
 +  bool waited = send_and_wait_cmd(sdcp, xfer);
 +
 +  *resp = SDHC->CMDRSP[0];
 +
 +  return waited;
 +}
 +
 +/**
 + * @brief   Sends an SDIO command with a short response expected and CRC.
 + *
 + * @param[in] sdcp      pointer to the @p SDCDriver object
 + * @param[in] cmd       card command
 + * @param[in] arg       command argument
 + * @param[out] resp     pointer to the response buffer (one word)
 + *
 + * @return              The operation status.
 + * @retval HAL_SUCCESS  operation succeeded.
 + * @retval HAL_FAILED   operation failed.
 + *
 + * @notapi
 + */
 +bool sdc_lld_send_cmd_short_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg,
 +                                uint32_t *resp) {
 +  SDHC->CMDARG = arg;
 +  uint32_t xfer =
 +    SDHC_XFERTYP_CMDINX(cmd) |
 +    SDHC_XFERTYP_CMDTYP_NORMAL |
 +    /* DPSEL=0, CICEN=1, CCCEN=1 */
 +    SDHC_XFERTYP_CICEN | SDHC_XFERTYP_CCCEN |
 +    SDHC_XFERTYP_RSPTYP_48;
 +
 +  bool waited = send_and_wait_cmd(sdcp, xfer);
 +
 +  *resp = SDHC->CMDRSP[0];
 +  TRACE(11, *resp);
 +
 +  return waited;
 +}
 +
 +/**
 + * @brief   Sends an SDIO command with a long response expected and CRC.
 + *
 + * @param[in] sdcp      pointer to the @p SDCDriver object
 + * @param[in] cmd       card command
 + * @param[in] arg       command argument
 + * @param[out] resp     pointer to the response buffer (four words)
 + *
 + * @return              The operation status.
 + * @retval HAL_SUCCESS  operation succeeded.
 + * @retval HAL_FAILED   operation failed.
 + *
 + * @notapi
 + */
 +bool sdc_lld_send_cmd_long_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg,
 +                               uint32_t *resp) {
 +
 +  /* In response format R2 (the 136-bit or "long" response) the CRC7
 +     field is valid, but the command index field is set to all 1s, so
 +     we need to disable the command index check function (CICEN=0). */
 +  
 +  SDHC->CMDARG = arg;
 +  uint32_t xfer =
 +    SDHC_XFERTYP_CMDINX(cmd) |
 +    SDHC_XFERTYP_CMDTYP_NORMAL |
 +    /* DPSEL=0, CICEN=0, CCCEN=1 */
 +    SDHC_XFERTYP_CCCEN |
 +    SDHC_XFERTYP_RSPTYP_136;
 +
 +  bool waited = send_and_wait_cmd(sdcp, xfer);
 +
 +  resp[0] = SDHC->CMDRSP[0];
 +  resp[1] = SDHC->CMDRSP[1];
 +  resp[2] = SDHC->CMDRSP[2];
 +  resp[3] = SDHC->CMDRSP[3];
 +
 +  return waited;
 +}
 +
 +/**
 + * @brief   Reads one or more blocks.
 + *
 + * @param[in] sdcp      pointer to the @p SDCDriver object
 + * @param[in] startblk  first block to read
 + * @param[out] buf      pointer to the read buffer
 + * @param[in] n         number of blocks to read
 + *
 + * @return              The operation status.
 + * @retval HAL_SUCCESS  operation succeeded.
 + * @retval HAL_FAILED   operation failed.
 + *
 + * @notapi
 + */
 +
 +bool sdc_lld_read(SDCDriver *sdcp, uint32_t startblk,
 +		  uint8_t *buf, uint32_t n) {
 +  uint32_t cmdx = (n == 1)?
 +    SDHC_XFERTYP_CMDINX(MMCSD_CMD_READ_SINGLE_BLOCK) :
 +    SDHC_XFERTYP_CMDINX(MMCSD_CMD_READ_MULTIPLE_BLOCK);
 +  cmdx |= SDHC_XFERTYP_DTDSEL;
 +
 +  return sdc_lld_transfer(sdcp, startblk, (uintptr_t)buf, n, cmdx);
 +}
 +
 +/**
 + * @brief   Writes one or more blocks.
 + *
 + * @param[in] sdcp      pointer to the @p SDCDriver object
 + * @param[in] startblk  first block to write
 + * @param[out] buf      pointer to the write buffer
 + * @param[in] n         number of blocks to write
 + *
 + * @return              The operation status.
 + * @retval HAL_SUCCESS operation succeeded.
 + * @retval HAL_FAILED   operation failed.
 + *
 + * @notapi
 + */
 +bool sdc_lld_write(SDCDriver *sdcp, uint32_t startblk,
 +                   const uint8_t *buf, uint32_t n) {
 +  uint32_t cmdx = (n == 1)?
 +    SDHC_XFERTYP_CMDINX(MMCSD_CMD_WRITE_BLOCK) :
 +    SDHC_XFERTYP_CMDINX(MMCSD_CMD_WRITE_MULTIPLE_BLOCK);
 +
 +  return sdc_lld_transfer(sdcp, startblk, (uintptr_t)buf, n, cmdx);
 +}
 +
 +/**
 + * @brief   Waits for card idle condition.
 + *
 + * @param[in] sdcp      pointer to the @p SDCDriver object
 + *
 + * @return              The operation status.
 + * @retval HAL_SUCCESS  the operation succeeded.
 + * @retval HAL_FAILED   the operation failed.
 + *
 + * @api
 + */
 +bool sdc_lld_sync(SDCDriver *sdcp) {
 +
 +  (void)sdcp;
 +
 +  return HAL_SUCCESS;
 +}
 +
 +bool sdc_lld_read_special(SDCDriver *sdcp, uint8_t *buf, size_t bytes,
 +			  uint8_t cmd, uint32_t argument) {
 +  uintptr_t bufaddr = (uintptr_t)buf;
 +
 +  osalDbgCheck((bufaddr & 0x03) == 0);  /* Must be 32-bit aligned */
 +  osalDbgCheck(bytes > 0);
 +  osalDbgCheck(bytes < 4096);
 +
 +  osalDbgAssert((SDHC->PRSSTAT & (SDHC_PRSSTAT_DLA|SDHC_PRSSTAT_CDIHB|SDHC_PRSSTAT_CIHB)) == 0,
 +		"SDHC interface not ready");
 +
 +  TRACE(5, argument);
 +
 +  /* Store the cmd argument and DMA start address */
 +  SDHC->CMDARG = argument;
 +  SDHC->DSADDR = bufaddr;
 +
 +  /* We're reading one block, of a (possibly) nonstandard size */
 +  SDHC->BLKATTR = SDHC_BLKATTR_BLKSIZE(bytes);
 +
 +  uint32_t xfer =
 +    SDHC_XFERTYP_CMDINX(cmd) |    /* the command */
 +    SDHC_XFERTYP_DTDSEL |         /* read transfer (card -> host) */
 +    SDHC_XFERTYP_CMDTYP_NORMAL |
 +    SDHC_XFERTYP_CICEN | SDHC_XFERTYP_CCCEN |
 +    SDHC_XFERTYP_RSPTYP_48 |
 +    SDHC_XFERTYP_DPSEL | SDHC_XFERTYP_DMAEN;  /* DMA-assisted data transfer */
 +
 +  return send_and_wait_transfer(sdcp, xfer);
 +}
 +
 +bool sdc_lld_is_card_inserted(SDCDriver *sdcp) {
 +  (void)sdcp;
 +
 +  return ( SDHC->PRSSTAT & SDHC_PRSSTAT_CLSL )? true : false;
 +}
 +
 +bool sdc_lld_is_write_protected(SDCDriver *sdcp) {
 +  (void)sdcp;
 +  return false;
 +}
 +
 +#endif /* HAL_USE_SDC == TRUE */
 +
 +/** @} */
 diff --git a/os/hal/ports/KINETIS/LLD/hal_sdc_lld.h b/os/hal/ports/KINETIS/LLD/hal_sdc_lld.h new file mode 100644 index 0000000..9f77bf6 --- /dev/null +++ b/os/hal/ports/KINETIS/LLD/hal_sdc_lld.h @@ -0,0 +1,202 @@ +/*
 +    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
 +              Copyright (C) 2017 Wim Lewis
 +
 +    Licensed 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.
 +*/
 +
 +/**
 + * @file    hal_sdc_lld.h
 + * @brief   PLATFORM SDC subsystem low level driver header.
 + *
 + * @addtogroup SDC
 + * @{
 + */
 +
 +#ifndef HAL_SDC_LLD_H
 +#define HAL_SDC_LLD_H
 +
 +#if (HAL_USE_SDC == TRUE) || defined(__DOXYGEN__)
 +
 +/*===========================================================================*/
 +/* Driver constants.                                                         */
 +/*===========================================================================*/
 +
 +#define SDHC_XFERTYP_CMDTYP_NORMAL	SDHC_XFERTYP_CMDTYP(0)
 +#define SDHC_XFERTYP_CMDTYP_SUSPEND	SDHC_XFERTYP_CMDTYP(1)
 +#define SDHC_XFERTYP_CMDTYP_RESUME	SDHC_XFERTYP_CMDTYP(2)
 +#define SDHC_XFERTYP_CMDTYP_ABORT	SDHC_XFERTYP_CMDTYP(3)
 +
 +#define SDHC_XFERTYP_RSPTYP_NONE	SDHC_XFERTYP_RSPTYP(0)  /* no response */
 +#define SDHC_XFERTYP_RSPTYP_136		SDHC_XFERTYP_RSPTYP(1)	/* 136-bit response */
 +#define SDHC_XFERTYP_RSPTYP_48		SDHC_XFERTYP_RSPTYP(2)	/* 48-bit response */
 +#define SDHC_XFERTYP_RSPTYP_48b		SDHC_XFERTYP_RSPTYP(3)	/* 48-bit plus busy */
 +
 +#define SDHC_PROCTL_DTW_1BIT            SDHC_PROCTL_DTW(0)
 +#define SDHC_PROCTL_DTW_4BIT            SDHC_PROCTL_DTW(1)
 +#define SDHC_PROCTL_DTW_8BIT            SDHC_PROCTL_DTW(2)
 +
 +/*===========================================================================*/
 +/* Driver pre-compile time settings.                                         */
 +/*===========================================================================*/
 +
 +/**
 + * @name    PLATFORM configuration options
 + * @{
 + */
 +/**
 + * @brief   SDC1 driver enable switch.
 + * @details If set to @p TRUE the support for SDC1 is included.
 + * @note    The default is @p TRUE if HAL_USE_SDC is set.
 + */
 +#if !defined(PLATFORM_SDC_USE_SDC1) || defined(__DOXYGEN__)
 +#define PLATFORM_SDC_USE_SDC1                  TRUE
 +#endif
 +/** @} */
 +
 +/*===========================================================================*/
 +/* Derived constants and error checks.                                       */
 +/*===========================================================================*/
 +
 +/*===========================================================================*/
 +/* Driver data structures and types.                                         */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Type of card flags.
 + */
 +typedef uint32_t sdcmode_t;
 +
 +/**
 + * @brief   SDC Driver condition flags type.
 + */
 +typedef uint32_t sdcflags_t;
 +
 +/**
 + * @brief   Type of a structure representing an SDC driver.
 + */
 +typedef struct SDCDriver SDCDriver;
 +
 +/**
 + * @brief   Driver configuration structure.
 + * @note    It could be empty on some architectures.
 + */
 +typedef struct {
 +  /**
 +   * @brief   Working area for memory consuming operations.
 +   * @note    It is mandatory for detecting MMC cards bigger than 2GB else it
 +   *          can be @p NULL.
 +   * @note    Memory pointed by this buffer is only used by @p sdcConnect(),
 +   *          afterward it can be reused for other purposes.
 +   */
 +  uint8_t       *scratchpad;
 +  /**
 +   * @brief   Bus width.
 +   */
 +  sdcbusmode_t  bus_width;
 +  /* End of the mandatory fields.*/
 +} SDCConfig;
 +
 +/**
 + * @brief   @p SDCDriver specific methods.
 + */
 +#define _sdc_driver_methods                                                 \
 +  _mmcsd_block_device_methods
 +
 +/**
 + * @extends MMCSDBlockDeviceVMT
 + *
 + * @brief   @p SDCDriver virtual methods table.
 + */
 +struct SDCDriverVMT {
 +  _sdc_driver_methods
 +};
 +
 +/**
 + * @brief   Structure representing an SDC driver.
 + */
 +struct SDCDriver {
 +  /**
 +   * @brief Virtual Methods Table.
 +   */
 +  const struct SDCDriverVMT *vmt;
 +  _mmcsd_block_device_data
 +  /**
 +   * @brief Current configuration data.
 +   */
 +  const SDCConfig           *config;
 +  /**
 +   * @brief Various flags regarding the mounted card.
 +   */
 +  sdcmode_t                 cardmode;
 +  /**
 +   * @brief Errors flags.
 +   */
 +  sdcflags_t                errors;
 +  /**
 +   * @brief Card RCA.
 +   */
 +  uint32_t                  rca;
 +  /* End of the mandatory fields.*/
 +
 +  /* Platform specific fields */
 +  thread_reference_t        thread;
 +};
 +
 +/*===========================================================================*/
 +/* Driver macros.                                                            */
 +/*===========================================================================*/
 +
 +/*===========================================================================*/
 +/* External declarations.                                                    */
 +/*===========================================================================*/
 +
 +#if (PLATFORM_SDC_USE_SDC1 == TRUE) && !defined(__DOXYGEN__)
 +extern SDCDriver SDCD1;
 +#endif
 +
 +#ifdef __cplusplus
 +extern "C" {
 +#endif
 +  void sdc_lld_init(void);
 +  void sdc_lld_start(SDCDriver *sdcp);
 +  void sdc_lld_stop(SDCDriver *sdcp);
 +  void sdc_lld_start_clk(SDCDriver *sdcp);
 +  void sdc_lld_set_data_clk(SDCDriver *sdcp, sdcbusclk_t clk);
 +  void sdc_lld_stop_clk(SDCDriver *sdcp);
 +  void sdc_lld_set_bus_mode(SDCDriver *sdcp, sdcbusmode_t mode);
 +  void sdc_lld_send_cmd_none(SDCDriver *sdcp, uint8_t cmd, uint32_t arg);
 +  bool sdc_lld_send_cmd_short(SDCDriver *sdcp, uint8_t cmd, uint32_t arg,
 +                              uint32_t *resp);
 +  bool sdc_lld_send_cmd_short_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg,
 +                                  uint32_t *resp);
 +  bool sdc_lld_send_cmd_long_crc(SDCDriver *sdcp, uint8_t cmd, uint32_t arg,
 +                                 uint32_t *resp);
 +  bool sdc_lld_read_special(SDCDriver *sdcp, uint8_t *buf, size_t bytes,
 +                            uint8_t cmd, uint32_t argument);
 +  bool sdc_lld_read(SDCDriver *sdcp, uint32_t startblk,
 +                    uint8_t *buf, uint32_t n);
 +  bool sdc_lld_write(SDCDriver *sdcp, uint32_t startblk,
 +                     const uint8_t *buf, uint32_t n);
 +  bool sdc_lld_sync(SDCDriver *sdcp);
 +  bool sdc_lld_is_card_inserted(SDCDriver *sdcp);
 +  bool sdc_lld_is_write_protected(SDCDriver *sdcp);
 +#ifdef __cplusplus
 +}
 +#endif
 +
 +#endif /* HAL_USE_SDC == TRUE */
 +
 +#endif /* HAL_SDC_LLD_H */
 +
 +/** @} */
 diff --git a/os/hal/ports/KINETIS/LLD/hal_serial_lld.c b/os/hal/ports/KINETIS/LLD/hal_serial_lld.c index c80cf22..c92fa5c 100644 --- a/os/hal/ports/KINETIS/LLD/hal_serial_lld.c +++ b/os/hal/ports/KINETIS/LLD/hal_serial_lld.c @@ -1,5 +1,6 @@  /*
      ChibiOS - Copyright (C) 2013-2015 Fabio Utzig
 +              Copyright (C) 2017 Wim Lewis
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
 @@ -50,6 +51,18 @@ SerialDriver SD2;  SerialDriver SD3;
  #endif
 +#if KINETIS_SERIAL_USE_UART3 || defined(__DOXYGEN__)
 +SerialDriver SD4;
 +#endif
 +
 +#if KINETIS_SERIAL_USE_UART4 || defined(__DOXYGEN__)
 +SerialDriver SD5;
 +#endif
 +
 +#if KINETIS_SERIAL_USE_UART5 || defined(__DOXYGEN__)
 +SerialDriver SD6;
 +#endif
 +
  /*===========================================================================*/
  /* Driver local variables and types.                                         */
  /*===========================================================================*/
 @@ -95,33 +108,37 @@ static void serve_error_interrupt(SerialDriver *sdp) {    UART_w_TypeDef *u = &(sdp->uart);
    uint8_t s1 = *(u->s1_p);
 -  /* S1 bits are write-1-to-clear for UART0 on KL2x. */
 -  /* Clearing on K20x and KL2x/UART>0 is done by reading S1 and
 +  /* Clearing on K20x, K60x, and KL2x/UART>0 is done by reading S1 and
     * then reading D.*/
 -#if defined(KL2x) && KINETIS_SERIAL_USE_UART0
 -  if(sdp == &SD1) {
 -    if(s1 & UARTx_S1_IDLE) {
 -      *(u->s1_p) |= UARTx_S1_IDLE;
 -    }
 +  if(s1 & UARTx_S1_IDLE) {
 +    (void)*(u->d_p);
 +  }
 -    if(s1 & (UARTx_S1_OR | UARTx_S1_NF | UARTx_S1_FE | UARTx_S1_PF)) {
 -      set_error(sdp, s1);
 -      *(u->s1_p) |= UARTx_S1_OR | UARTx_S1_NF | UARTx_S1_FE | UARTx_S1_PF;
 -    }
 -    return;
 +  if(s1 & (UARTx_S1_OR | UARTx_S1_NF | UARTx_S1_FE | UARTx_S1_PF)) {
 +    set_error(sdp, s1);
 +    (void)*(u->d_p);
    }
 -#endif /* KL2x && KINETIS_SERIAL_USE_UART0 */
 +}
 +
 +#if defined(KL2x) && KINETIS_SERIAL_USE_UART0
 +static void serve_error_interrupt_uart0(void) {
 +  SerialDriver *sdp = &SD1;
 +  UART_w_TypeDef *u = &(sdp->uart);
 +  uint8_t s1 = *(u->s1_p);
 +
 +  /* S1 bits are write-1-to-clear for UART0 on KL2x. */
    if(s1 & UARTx_S1_IDLE) {
 -    (void)*(u->d_p);
 +    *(u->s1_p) |= UARTx_S1_IDLE;
    }
    if(s1 & (UARTx_S1_OR | UARTx_S1_NF | UARTx_S1_FE | UARTx_S1_PF)) {
      set_error(sdp, s1);
 -    (void)*(u->d_p);
 +    *(u->s1_p) |= UARTx_S1_OR | UARTx_S1_NF | UARTx_S1_FE | UARTx_S1_PF;
    }
  }
 +#endif /* KL2x && KINETIS_SERIAL_USE_UART0 */
  /**
   * @brief   Common IRQ handler.
 @@ -161,6 +178,12 @@ static void serve_interrupt(SerialDriver *sdp) {      }
    }
 +#if defined(KL2x) && KINETIS_SERIAL_USE_UART0
 +  if (sdp == &SD1) {
 +    serve_error_interrupt_uart0();
 +    return;
 +  }
 +#endif
    serve_error_interrupt(sdp);
  }
 @@ -184,29 +207,28 @@ static void preload(SerialDriver *sdp) {  /**
   * @brief   Driver output notification.
   */
 -#if KINETIS_SERIAL_USE_UART0 || defined(__DOXYGEN__)
 -static void notify1(io_queue_t *qp)
 +static void notify(io_queue_t *qp)
  {
 -  (void)qp;
 -  preload(&SD1);
 +  preload(qp->q_link);
  }
 -#endif
 -#if KINETIS_SERIAL_USE_UART1 || defined(__DOXYGEN__)
 -static void notify2(io_queue_t *qp)
 -{
 -  (void)qp;
 -  preload(&SD2);
 -}
 -#endif
 -
 -#if KINETIS_SERIAL_USE_UART2 || defined(__DOXYGEN__)
 -static void notify3(io_queue_t *qp)
 -{
 -  (void)qp;
 -  preload(&SD3);
 +/**
 + * @brief   Common driver initialization, except LP.
 + */
 +static void sd_lld_init_driver(SerialDriver *SDn, UART_TypeDef *UARTn) {
 +  /* Driver initialization.*/
 +  sdObjectInit(SDn, NULL, notify);
 +  SDn->uart.bdh_p = &(UARTn->BDH);
 +  SDn->uart.bdl_p = &(UARTn->BDL);
 +  SDn->uart.c1_p =  &(UARTn->C1);
 +  SDn->uart.c2_p =  &(UARTn->C2);
 +  SDn->uart.c3_p =  &(UARTn->C3);
 +  SDn->uart.c4_p =  &(UARTn->C4);
 +  SDn->uart.s1_p =  (volatile uint8_t *)&(UARTn->S1);
 +  SDn->uart.s2_p =  &(UARTn->S2);
 +  SDn->uart.d_p =   &(UARTn->D);
 +  SDn->uart.uart_p = UARTn;
  }
 -#endif
  /**
   * @brief   Common UART configuration.
 @@ -240,9 +262,9 @@ static void configure_uart(SerialDriver *sdp, const SerialConfig *config) {    }
  #endif /* KINETIS_SERIAL_USE_UART0 */
 -#elif defined(K20x) /* KL2x */
 +#elif defined(K20x) || defined(K60x) /* KL2x */
 -  /* UARTs 0 and 1 are clocked from SYSCLK, others from BUSCLK on K20x. */
 +  /* UARTs 0 and 1 are clocked from SYSCLK, others from BUSCLK on K20x and K60x. */
  #if KINETIS_SERIAL_USE_UART0
    if(sdp == &SD1)
      divisor = KINETIS_SYSCLK_FREQUENCY;
 @@ -260,9 +282,9 @@ static void configure_uart(SerialDriver *sdp, const SerialConfig *config) {    *(uart->bdh_p) = UARTx_BDH_SBR(divisor >> 13) | (*(uart->bdh_p) & ~UARTx_BDH_SBR_MASK);
    *(uart->bdl_p) = UARTx_BDL_SBR(divisor >> 5);
 -#if defined(K20x)
 +#if defined(K20x) || defined(K60x)
    *(uart->c4_p) = UARTx_C4_BRFA(divisor) | (*(uart->c4_p) & ~UARTx_C4_BRFA_MASK);
 -#endif /* K20x */
 +#endif /* K20x, K60x */
    /* Line settings. */
    *(uart->c1_p) = 0;
 @@ -300,12 +322,40 @@ OSAL_IRQ_HANDLER(KINETIS_SERIAL2_IRQ_VECTOR) {  }
  #endif
 +#if KINETIS_SERIAL_USE_UART3 || defined(__DOXYGEN__)
 +OSAL_IRQ_HANDLER(KINETIS_SERIAL3_IRQ_VECTOR) {
 +  OSAL_IRQ_PROLOGUE();
 +  serve_interrupt(&SD4);
 +  OSAL_IRQ_EPILOGUE();
 +}
 +#endif
 +
 +#if KINETIS_SERIAL_USE_UART4 || defined(__DOXYGEN__)
 +OSAL_IRQ_HANDLER(KINETIS_SERIAL4_IRQ_VECTOR) {
 +  OSAL_IRQ_PROLOGUE();
 +  serve_interrupt(&SD5);
 +  OSAL_IRQ_EPILOGUE();
 +}
 +#endif
 +
 +#if KINETIS_SERIAL_USE_UART5 || defined(__DOXYGEN__)
 +OSAL_IRQ_HANDLER(KINETIS_SERIAL5_IRQ_VECTOR) {
 +  OSAL_IRQ_PROLOGUE();
 +  serve_interrupt(&SD6);
 +  OSAL_IRQ_EPILOGUE();
 +}
 +#endif
 +
  #if KINETIS_HAS_SERIAL_ERROR_IRQ
  #if KINETIS_SERIAL_USE_UART0 || defined(__DOXYGEN__)
  OSAL_IRQ_HANDLER(KINETIS_SERIAL0_ERROR_IRQ_VECTOR) {
    OSAL_IRQ_PROLOGUE();
 +#if defined(KL2x)
 +  serve_error_interrupt_uart0();
 +#else
    serve_error_interrupt(&SD1);
 +#endif
    OSAL_IRQ_EPILOGUE();
  }
  #endif
 @@ -326,6 +376,30 @@ OSAL_IRQ_HANDLER(KINETIS_SERIAL2_ERROR_IRQ_VECTOR) {  }
  #endif
 +#if KINETIS_SERIAL_USE_UART3 || defined(__DOXYGEN__)
 +OSAL_IRQ_HANDLER(KINETIS_SERIAL3_ERROR_IRQ_VECTOR) {
 +  OSAL_IRQ_PROLOGUE();
 +  serve_error_interrupt(&SD4);
 +  OSAL_IRQ_EPILOGUE();
 +}
 +#endif
 +
 +#if KINETIS_SERIAL_USE_UART4 || defined(__DOXYGEN__)
 +OSAL_IRQ_HANDLER(KINETIS_SERIAL4_ERROR_IRQ_VECTOR) {
 +  OSAL_IRQ_PROLOGUE();
 +  serve_error_interrupt(&SD5);
 +  OSAL_IRQ_EPILOGUE();
 +}
 +#endif
 +
 +#if KINETIS_SERIAL_USE_UART5 || defined(__DOXYGEN__)
 +OSAL_IRQ_HANDLER(KINETIS_SERIAL5_ERROR_IRQ_VECTOR) {
 +  OSAL_IRQ_PROLOGUE();
 +  serve_error_interrupt(&SD6);
 +  OSAL_IRQ_EPILOGUE();
 +}
 +#endif
 +
  #endif /* KINETIS_HAS_SERIAL_ERROR_IRQ */
  /*===========================================================================*/
 @@ -341,19 +415,11 @@ void sd_lld_init(void) {  #if KINETIS_SERIAL_USE_UART0
    /* Driver initialization.*/
 -  sdObjectInit(&SD1, NULL, notify1);
  #if ! KINETIS_SERIAL0_IS_LPUART
 -  SD1.uart.bdh_p = &(UART0->BDH);
 -  SD1.uart.bdl_p = &(UART0->BDL);
 -  SD1.uart.c1_p =  &(UART0->C1);
 -  SD1.uart.c2_p =  &(UART0->C2);
 -  SD1.uart.c3_p =  &(UART0->C3);
 -  SD1.uart.c4_p =  &(UART0->C4);
 -  SD1.uart.s1_p =  (volatile uint8_t *)&(UART0->S1);
 -  SD1.uart.s2_p =  &(UART0->S2);
 -  SD1.uart.d_p =   &(UART0->D);
 +  sd_lld_init_driver(&SD1, UART0);
  #else /* ! KINETIS_SERIAL0_IS_LPUART */
    /* little endian! */
 +  sdObjectInit(&SD1, NULL, notify);
    SD1.uart.bdh_p = ((uint8_t *)&(LPUART0->BAUD)) + 1; /* BDH: BAUD, byte 3 */
    SD1.uart.bdl_p = ((uint8_t *)&(LPUART0->BAUD)) + 0; /* BDL: BAUD, byte 4 */
    SD1.uart.c1_p =  ((uint8_t *)&(LPUART0->CTRL)) + 0; /* C1: CTRL, byte 4 */
 @@ -377,20 +443,11 @@ void sd_lld_init(void) {  #if KINETIS_SERIAL_USE_UART1
    /* Driver initialization.*/
 -  sdObjectInit(&SD2, NULL, notify2);
  #if ! KINETIS_SERIAL1_IS_LPUART
 -  SD2.uart.bdh_p = &(UART1->BDH);
 -  SD2.uart.bdl_p = &(UART1->BDL);
 -  SD2.uart.c1_p =  &(UART1->C1);
 -  SD2.uart.c2_p =  &(UART1->C2);
 -  SD2.uart.c3_p =  &(UART1->C3);
 -  SD2.uart.c4_p =  &(UART1->C4);
 -  SD2.uart.s1_p =  (volatile uint8_t *)&(UART1->S1);
 -  SD2.uart.s2_p =  &(UART1->S2);
 -  SD2.uart.d_p =   &(UART1->D);
 -  SD2.uart.uart_p = UART1;
 +  sd_lld_init_driver(&SD2, UART1);
  #else /* ! KINETIS_SERIAL1_IS_LPUART */
    /* little endian! */
 +  sdObjectInit(&SD2, NULL, notify);
    SD2.uart.bdh_p = ((uint8_t *)&(LPUART1->BAUD)) + 1; /* BDH: BAUD, byte 3 */
    SD2.uart.bdl_p = ((uint8_t *)&(LPUART1->BAUD)) + 0; /* BDL: BAUD, byte 4 */
    SD2.uart.c1_p =  ((uint8_t *)&(LPUART1->CTRL)) + 0; /* C1: CTRL, byte 4 */
 @@ -406,19 +463,20 @@ void sd_lld_init(void) {  #endif /* KINETIS_SERIAL_USE_UART1 */
  #if KINETIS_SERIAL_USE_UART2
 -  /* Driver initialization.*/
 -  sdObjectInit(&SD3, NULL, notify3);
 -  SD3.uart.bdh_p = &(UART2->BDH);
 -  SD3.uart.bdl_p = &(UART2->BDL);
 -  SD3.uart.c1_p =  &(UART2->C1);
 -  SD3.uart.c2_p =  &(UART2->C2);
 -  SD3.uart.c3_p =  &(UART2->C3);
 -  SD3.uart.c4_p =  &(UART2->C4);
 -  SD3.uart.s1_p =  (volatile uint8_t *)&(UART2->S1);
 -  SD3.uart.s2_p =  &(UART2->S2);
 -  SD3.uart.d_p =   &(UART2->D);
 -  SD3.uart.uart_p = UART2;
 +  sd_lld_init_driver(&SD3, UART2);
  #endif /* KINETIS_SERIAL_USE_UART2 */
 +
 +#if KINETIS_SERIAL_USE_UART3
 +  sd_lld_init_driver(&SD4, UART3);
 +#endif /* KINETIS_SERIAL_USE_UART3 */
 +
 +#if KINETIS_SERIAL_USE_UART4
 +  sd_lld_init_driver(&SD5, UART4);
 +#endif /* KINETIS_SERIAL_USE_UART4 */
 +
 +#if KINETIS_SERIAL_USE_UART5
 +  sd_lld_init_driver(&SD6, UART5);
 +#endif /* KINETIS_SERIAL_USE_UART5 */
  }
  /**
 @@ -505,6 +563,33 @@ void sd_lld_start(SerialDriver *sdp, const SerialConfig *config) {      }
  #endif /* KINETIS_SERIAL_USE_UART2 */
 +#if KINETIS_SERIAL_USE_UART3
 +    if (sdp == &SD4) {
 +      SIM->SCGC4 |= SIM_SCGC4_UART3;
 +      configure_uart(sdp, config);
 +      nvicEnableVector(UART3Status_IRQn, KINETIS_SERIAL_UART3_PRIORITY);
 +      nvicEnableVector(UART3Error_IRQn, KINETIS_SERIAL_UART3_PRIORITY);
 +    }
 +#endif /* KINETIS_SERIAL_USE_UART3 */
 +
 +#if KINETIS_SERIAL_USE_UART4
 +    if (sdp == &SD5) {
 +      SIM->SCGC1 |= SIM_SCGC1_UART4;
 +      configure_uart(sdp, config);
 +      nvicEnableVector(UART4Status_IRQn, KINETIS_SERIAL_UART4_PRIORITY);
 +      nvicEnableVector(UART4Error_IRQn, KINETIS_SERIAL_UART4_PRIORITY);
 +    }
 +#endif /* KINETIS_SERIAL_USE_UART4 */
 +
 +#if KINETIS_SERIAL_USE_UART5
 +    if (sdp == &SD6) {
 +      SIM->SCGC1 |= SIM_SCGC1_UART5;
 +      configure_uart(sdp, config);
 +      nvicEnableVector(UART5Status_IRQn, KINETIS_SERIAL_UART5_PRIORITY);
 +      nvicEnableVector(UART5Error_IRQn, KINETIS_SERIAL_UART5_PRIORITY);
 +    }
 +#endif /* KINETIS_SERIAL_USE_UART5 */
 +
    }
    /* Configures the peripheral.*/
 @@ -575,6 +660,30 @@ void sd_lld_stop(SerialDriver *sdp) {        SIM->SCGC4 &= ~SIM_SCGC4_UART2;
      }
  #endif
 +
 +#if KINETIS_SERIAL_USE_UART3
 +    if (sdp == &SD4) {
 +      nvicDisableVector(UART3Status_IRQn);
 +      nvicDisableVector(UART3Error_IRQn);
 +      SIM->SCGC4 &= ~SIM_SCGC4_UART3;
 +    }
 +#endif
 +
 +#if KINETIS_SERIAL_USE_UART4
 +    if (sdp == &SD5) {
 +      nvicDisableVector(UART4Status_IRQn);
 +      nvicDisableVector(UART4Error_IRQn);
 +      SIM->SCGC1 &= ~SIM_SCGC1_UART4;
 +    }
 +#endif
 +
 +#if KINETIS_SERIAL_USE_UART5
 +    if (sdp == &SD6) {
 +      nvicDisableVector(UART5Status_IRQn);
 +      nvicDisableVector(UART5Error_IRQn);
 +      SIM->SCGC1 &= ~SIM_SCGC1_UART5;
 +    }
 +#endif
    }
  }
 diff --git a/os/hal/ports/KINETIS/LLD/hal_serial_lld.h b/os/hal/ports/KINETIS/LLD/hal_serial_lld.h index f11c063..3cb6d2b 100644 --- a/os/hal/ports/KINETIS/LLD/hal_serial_lld.h +++ b/os/hal/ports/KINETIS/LLD/hal_serial_lld.h @@ -60,6 +60,27 @@  #if !defined(KINETIS_SERIAL_USE_UART2) || defined(__DOXYGEN__)
  #define KINETIS_SERIAL_USE_UART2             FALSE
  #endif
 +/**
 + * @brief   SD4 driver enable switch.
 + * @details If set to @p TRUE the support for SD4 is included.
 + */
 +#if !defined(KINETIS_SERIAL_USE_UART3) || defined(__DOXYGEN__)
 +#define KINETIS_SERIAL_USE_UART3             FALSE
 +#endif
 +/**
 + * @brief   SD5 driver enable switch.
 + * @details If set to @p TRUE the support for SD5 is included.
 + */
 +#if !defined(KINETIS_SERIAL_USE_UART4) || defined(__DOXYGEN__)
 +#define KINETIS_SERIAL_USE_UART4             FALSE
 +#endif
 +/**
 + * @brief   SD6 driver enable switch.
 + * @details If set to @p TRUE the support for SD6 is included.
 + */
 +#if !defined(KINETIS_SERIAL_USE_UART5) || defined(__DOXYGEN__)
 +#define KINETIS_SERIAL_USE_UART5             FALSE
 +#endif
  /**
   * @brief   UART0 interrupt priority level setting.
 @@ -83,6 +104,27 @@  #endif
  /**
 + * @brief   UART3 interrupt priority level setting.
 + */
 +#if !defined(KINETIS_SERIAL_UART3_PRIORITY) || defined(__DOXYGEN__)
 +#define KINETIS_SERIAL_UART3_PRIORITY        12
 +#endif
 +
 +/**
 + * @brief   UART4 interrupt priority level setting.
 + */
 +#if !defined(KINETIS_SERIAL_UART4_PRIORITY) || defined(__DOXYGEN__)
 +#define KINETIS_SERIAL_UART4_PRIORITY        12
 +#endif
 +
 +/**
 + * @brief   UART5 interrupt priority level setting.
 + */
 +#if !defined(KINETIS_SERIAL_UART5_PRIORITY) || defined(__DOXYGEN__)
 +#define KINETIS_SERIAL_UART5_PRIORITY        12
 +#endif
 +
 +/**
   * @brief   UART0 clock source.
   */
  #if !defined(KINETIS_UART0_CLOCK_SRC) || defined(__DOXYGEN__)
 @@ -115,8 +157,21 @@  #error "UART2 not present in the selected device"
  #endif
 +#if KINETIS_SERIAL_USE_UART3 && !KINETIS_HAS_SERIAL3
 +#error "UART3 not present in the selected device"
 +#endif
 +
 +#if KINETIS_SERIAL_USE_UART4 && !KINETIS_HAS_SERIAL4
 +#error "UART4 not present in the selected device"
 +#endif
 +
 +#if KINETIS_SERIAL_USE_UART5 && !KINETIS_HAS_SERIAL5
 +#error "UART5 not present in the selected device"
 +#endif
 +
  #if !(KINETIS_SERIAL_USE_UART0 || KINETIS_SERIAL_USE_UART1 || \
 -      KINETIS_SERIAL_USE_UART2)
 +      KINETIS_SERIAL_USE_UART2 || KINETIS_SERIAL_USE_UART3 || \
 +      KINETIS_SERIAL_USE_UART4 || KINETIS_SERIAL_USE_UART5)
  #error "Serial driver activated but no UART peripheral assigned"
  #endif
 @@ -203,6 +258,18 @@ extern SerialDriver SD2;  extern SerialDriver SD3;
  #endif
 +#if KINETIS_SERIAL_USE_UART3 && !defined(__DOXYGEN__)
 +extern SerialDriver SD4;
 +#endif
 +
 +#if KINETIS_SERIAL_USE_UART4 && !defined(__DOXYGEN__)
 +extern SerialDriver SD5;
 +#endif
 +
 +#if KINETIS_SERIAL_USE_UART5 && !defined(__DOXYGEN__)
 +extern SerialDriver SD6;
 +#endif
 +
  #ifdef __cplusplus
  extern "C" {
  #endif
 diff --git a/os/hal/ports/KINETIS/LLD/hal_usb_lld.c b/os/hal/ports/KINETIS/LLD/hal_usb_lld.c index e8d9778..ba91d24 100644 --- a/os/hal/ports/KINETIS/LLD/hal_usb_lld.c +++ b/os/hal/ports/KINETIS/LLD/hal_usb_lld.c @@ -158,7 +158,7 @@ void usb_packet_transmit(USBDriver *usbp, usbep_t ep, size_t n)    USBInEndpointState *isp = epc->in_state;
    bd_t *bd = (bd_t *)&_bdt[BDT_INDEX(ep, TX, isp->odd_even)];
 -  
 +
    if (n > (size_t)epc->in_maxsize)
      n = (size_t)epc->in_maxsize;
 @@ -244,19 +244,16 @@ OSAL_IRQ_HANDLER(KINETIS_USB_IRQ_VECTOR) {      {
        case BDT_PID_SETUP:                                              // SETUP
        {
 -        /* Clear any pending IN stuff */
 -        _bdt[BDT_INDEX(ep, TX, EVEN)].desc = 0;
 -        _bdt[BDT_INDEX(ep, TX,  ODD)].desc = 0;
 -        /* Also in the chibios state machine */
 +        /* Clear receiving in the chibios state machine */
          (usbp)->receiving &= ~1;
 -        /* After a SETUP, IN is always DATA1 */
 -        usbp->epc[ep]->in_state->data_bank = DATA1;
 -
 -        /* Call SETUP function (ChibiOS core), which sends back stuff */
 +        /* Call SETUP function (ChibiOS core), which prepares
 +         * for send or receive and releases the buffer
 +         */
          _usb_isr_invoke_setup_cb(usbp, ep);
 -        /* Buffer is released by the above callback. */
 -        /* from Paul: "unfreeze the USB, now that we're ready" */
 -        USB0->CTL = USBx_CTL_USBENSOFEN;
 +        /* When a setup packet is received, tx is suspended,
 +         * so it needs to be resumed here.
 +         */
 +        USB0->CTL &= ~USBx_CTL_TXSUSPENDTOKENBUSY;
        } break;
        case BDT_PID_IN:                                                 // IN
        {
 @@ -728,9 +725,23 @@ void usb_lld_read_setup(USBDriver *usbp, usbep_t ep, uint8_t *buf) {    }
    /* Release the buffer
     * Setup packet is always DATA0
 -   * Initialize buffers so current expects DATA0 & opposite DATA1 */
 +   * Release the current DATA0 buffer
 +   */
    bd->desc = BDT_DESC(usbp->epc[ep]->out_maxsize,DATA0);
 -  _bdt[BDT_INDEX(ep, RX, os->odd_even^ODD)].desc = BDT_DESC(usbp->epc[ep]->out_maxsize,DATA1);
 +  /* If DATA1 was expected, then the states are out of sync.
 +   * So reset the other buffer too, and set it as DATA1.
 +   * This should not happen in normal cases, but is possible in
 +   * error situations. NOTE: it's possible that this is too late
 +   * and the next packet has already been received and dropped, but
 +   * there's nothing that we can do about that anymore at this point.
 +   */
 +  if (os->data_bank == DATA1)
 +  {
 +    bd_t *bd_next = (bd_t*)&_bdt[BDT_INDEX(ep, RX, os->odd_even^ODD)];
 +    bd_next->desc = BDT_DESC(usbp->epc[ep]->out_maxsize,DATA1);
 +  }
 +  /* After a SETUP, both in and out are always DATA1 */
 +  usbp->epc[ep]->in_state->data_bank = DATA1;
    os->data_bank = DATA1;
  }
 @@ -762,8 +773,22 @@ void usb_lld_start_out(USBDriver *usbp, usbep_t ep) {   * @notapi
   */
  void usb_lld_start_in(USBDriver *usbp, usbep_t ep) {
 -  (void)usbp;
 -  (void)ep;
 +  if (ep == 0 && usbp->ep0state == USB_EP0_IN_SENDING_STS) {
 +    /* When a status packet is about to be sent on endpoint 0 the
 +     * next packet will be a setup packet, which means that the
 +     * buffer we expect after this should be DATA0, and the following
 +     * DATA1. Since no out packets should be in flight at this time
 +     * it's safe to initialize the buffers according to the expectations
 +     * here.
 +     */
 +    const USBEndpointConfig* epc = usbp->epc[ep];
 +    bd_t * bd = (bd_t*)&_bdt[BDT_INDEX(ep, RX, epc->out_state->odd_even)];
 +    bd_t *bd_next = (bd_t*)&_bdt[BDT_INDEX(ep, RX, epc->out_state->odd_even^ODD)];
 +
 +    bd->desc = BDT_DESC(usbp->epc[ep]->out_maxsize,DATA1);
 +    bd_next->desc = BDT_DESC(usbp->epc[ep]->out_maxsize,DATA0);
 +    epc->out_state->data_bank = DATA0;
 +  }
    usb_packet_transmit(usbp,ep,usbp->epc[ep]->in_state->txsize);
  }
 diff --git a/os/hal/ports/KINETIS/LLD/hal_usb_lld.h b/os/hal/ports/KINETIS/LLD/hal_usb_lld.h index 961490e..bd4eb39 100644 --- a/os/hal/ports/KINETIS/LLD/hal_usb_lld.h +++ b/os/hal/ports/KINETIS/LLD/hal_usb_lld.h @@ -76,6 +76,13 @@    #define KINETIS_USB_ENDPOINTS USB_MAX_ENDPOINTS+1
  #endif
 +/**
 + * @brief   Host wake-up procedure duration.
 + */
 +#if !defined(USB_HOST_WAKEUP_DURATION) || defined(__DOXYGEN__)
 +#define USB_HOST_WAKEUP_DURATION            2
 +#endif
 +
  /*===========================================================================*/
  /* Derived constants and error checks.                                       */
  /*===========================================================================*/
 @@ -97,6 +104,10 @@  #error "KINETIS_USB_IRQ_VECTOR not defined"
  #endif
 +#if (USB_HOST_WAKEUP_DURATION < 2) || (USB_HOST_WAKEUP_DURATION > 15)
 +#error "invalid USB_HOST_WAKEUP_DURATION setting, it must be between 2 and 15"
 +#endif
 +
  /*===========================================================================*/
  /* Driver data structures and types.                                         */
  /*===========================================================================*/
 @@ -394,6 +405,18 @@ struct USBDriver {  #endif /* KINETIS_USB0_IS_USBOTG */
  #endif
 +/**
 + * @brief   Start of host wake-up procedure.
 + *
 + * @notapi
 + */
 +#define usb_lld_wakeup_host(usbp)                                     \
 +  do{                                                                 \
 +    USB0->CTL |= USBx_CTL_RESUME;                                     \
 +    osalThreadSleepMilliseconds(USB_HOST_WAKEUP_DURATION);            \
 +    USB0->CTL &= ~USBx_CTL_RESUME;                                    \
 +  } while (false)
 +
  /*===========================================================================*/
  /* External declarations.                                                    */
  /*===========================================================================*/
 diff --git a/os/hal/ports/STM32/LLD/CRCv1/hal_crc_lld.c b/os/hal/ports/STM32/LLD/CRCv1/hal_crc_lld.c index a2cf026..701b87d 100755 --- a/os/hal/ports/STM32/LLD/CRCv1/hal_crc_lld.c +++ b/os/hal/ports/STM32/LLD/CRCv1/hal_crc_lld.c @@ -155,7 +155,7 @@ void crc_lld_start(CRCDriver *crcp) {    if (crcp->config == NULL)      crcp->config = &default_config; -  rccEnableCRC(FALSE); +  rccEnableCRC();  #if STM32_CRC_PROGRAMMABLE == TRUE    crcp->crc->INIT = crcp->config->initial_val; @@ -234,7 +234,7 @@ void crc_lld_stop(CRCDriver *crcp) {  #else    (void)crcp;  #endif -  rccDisableCRC(FALSE); +  rccDisableCRC();  }  /** diff --git a/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc.c b/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc.c index b4c2938..500b2e7 100644 --- a/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc.c +++ b/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc.c @@ -97,7 +97,10 @@ void fsmc_init(void) {  #if (defined(STM32F427xx) || defined(STM32F437xx) || \       defined(STM32F429xx) || defined(STM32F439xx) || \ -     defined(STM32F7)) +     defined(STM32F745xx) || defined(STM32F746xx) || \ +     defined(STM32F756xx) || defined(STM32F767xx) || \ +     defined(STM32F769xx) || defined(STM32F777xx) || \ +     defined(STM32F779xx))    #if STM32_USE_FSMC_SDRAM      FSMCD1.sdram = (FSMC_SDRAM_TypeDef *)FSMC_Bank5_6_R_BASE;    #endif diff --git a/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc.h b/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc.h index 51b9428..80c5d26 100644 --- a/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc.h +++ b/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc.h @@ -36,7 +36,10 @@   */  #if (defined(STM32F427xx) || defined(STM32F437xx) || \       defined(STM32F429xx) || defined(STM32F439xx) || \ -     defined(STM32F7)) +     defined(STM32F745xx) || defined(STM32F746xx) || \ +     defined(STM32F756xx) || defined(STM32F767xx) || \ +     defined(STM32F769xx) || defined(STM32F777xx) || \ +     defined(STM32F779xx))    #if !defined(FSMC_Bank1_R_BASE)    #define FSMC_Bank1_R_BASE               (FMC_R_BASE + 0x0000)    #endif diff --git a/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sdram.c b/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sdram.c index ac83477..6d727c8 100644 --- a/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sdram.c +++ b/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sdram.c @@ -28,7 +28,11 @@  #include "hal.h"  #if (defined(STM32F427xx) || defined(STM32F437xx) || \ -     defined(STM32F429xx) || defined(STM32F439xx)) +     defined(STM32F429xx) || defined(STM32F439xx) || \ +     defined(STM32F745xx) || defined(STM32F746xx) || \ +     defined(STM32F756xx) || defined(STM32F767xx) || \ +     defined(STM32F769xx) || defined(STM32F777xx) || \ +     defined(STM32F779xx))  #if (STM32_USE_FSMC_SDRAM == TRUE) || defined(__DOXYGEN__) diff --git a/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sdram.h b/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sdram.h index b419168..c9f9de0 100644 --- a/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sdram.h +++ b/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sdram.h @@ -29,7 +29,11 @@  #define HAL_FMC_SDRAM_H_  #if (defined(STM32F427xx) || defined(STM32F437xx) || \ -     defined(STM32F429xx) || defined(STM32F439xx)) +     defined(STM32F429xx) || defined(STM32F439xx) || \ +     defined(STM32F745xx) || defined(STM32F746xx) || \ +     defined(STM32F756xx) || defined(STM32F767xx) || \ +     defined(STM32F769xx) || defined(STM32F777xx) || \ +     defined(STM32F779xx))  #include "hal_fsmc.h" diff --git a/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sram.c b/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sram.c index fbd6f56..da13ca5 100644 --- a/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sram.c +++ b/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sram.c @@ -148,7 +148,10 @@ void fsmcSramStop(SRAMDriver *sramp) {      uint32_t mask = FSMC_BCR_MBKEN;  #if (defined(STM32F427xx) || defined(STM32F437xx) || \       defined(STM32F429xx) || defined(STM32F439xx) || \ -     defined(STM32F7)) +     defined(STM32F745xx) || defined(STM32F746xx) || \ +     defined(STM32F756xx) || defined(STM32F767xx) || \ +     defined(STM32F769xx) || defined(STM32F777xx) || \ +     defined(STM32F779xx))      mask |= FSMC_BCR_CCLKEN;  #endif      sramp->sram->BCR &= ~mask; diff --git a/os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.c b/os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.c index 6138481..cef015e 100644 --- a/os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.c +++ b/os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.c @@ -157,38 +157,38 @@ void qei_lld_start(QEIDriver *qeip) {      /* Clock activation and timer reset.*/
  #if STM32_QEI_USE_TIM1
      if (&QEID1 == qeip) {
 -      rccEnableTIM1(FALSE);
 +      rccEnableTIM1();
        rccResetTIM1();
      }
  #endif
  #if STM32_QEI_USE_TIM2
      if (&QEID2 == qeip) {
 -      rccEnableTIM2(FALSE);
 +      rccEnableTIM2();
        rccResetTIM2();
      }
  #endif
  #if STM32_QEI_USE_TIM3
      if (&QEID3 == qeip) {
 -      rccEnableTIM3(FALSE);
 +      rccEnableTIM3();
        rccResetTIM3();
      }
  #endif
  #if STM32_QEI_USE_TIM4
      if (&QEID4 == qeip) {
 -      rccEnableTIM4(FALSE);
 +      rccEnableTIM4();
        rccResetTIM4();
      }
  #endif
  #if STM32_QEI_USE_TIM5
      if (&QEID5 == qeip) {
 -      rccEnableTIM5(FALSE);
 +      rccEnableTIM5();
        rccResetTIM5();
      }
  #endif
  #if STM32_QEI_USE_TIM8
      if (&QEID8 == qeip) {
 -      rccEnableTIM8(FALSE);
 +      rccEnableTIM8();
        rccResetTIM8();
      }
  #endif
 @@ -235,33 +235,33 @@ void qei_lld_stop(QEIDriver *qeip) {      /* Clock deactivation.*/
  #if STM32_QEI_USE_TIM1
      if (&QEID1 == qeip) {
 -      rccDisableTIM1(FALSE);
 +      rccDisableTIM1();
      }
  #endif
  #if STM32_QEI_USE_TIM2
      if (&QEID2 == qeip) {
 -      rccDisableTIM2(FALSE);
 +      rccDisableTIM2();
      }
  #endif
  #if STM32_QEI_USE_TIM3
      if (&QEID3 == qeip) {
 -      rccDisableTIM3(FALSE);
 +      rccDisableTIM3();
      }
  #endif
  #if STM32_QEI_USE_TIM4
      if (&QEID4 == qeip) {
 -      rccDisableTIM4(FALSE);
 +      rccDisableTIM4();
      }
  #endif
  #if STM32_QEI_USE_TIM5
      if (&QEID5 == qeip) {
 -      rccDisableTIM5(FALSE);
 +      rccDisableTIM5();
      }
  #endif
    }
  #if STM32_QEI_USE_TIM8
      if (&QEID8 == qeip) {
 -      rccDisableTIM8(FALSE);
 +      rccDisableTIM8();
      }
  #endif
  }
 diff --git a/testhal/STM32/STM32F0xx/crc/chconf.h b/testhal/STM32/STM32F0xx/crc/chconf.h index 6a187da..53bd676 100644 --- a/testhal/STM32/STM32F0xx/crc/chconf.h +++ b/testhal/STM32/STM32F0xx/crc/chconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
 +    ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
 @@ -52,6 +52,18 @@  #define CH_CFG_ST_FREQUENCY                 10000
  /**
 + * @brief   Time intervals data size.
 + * @note    Allowed values are 16, 32 or 64 bits.
 + */
 +#define CH_CFG_INTERVALS_SIZE               32
 +
 +/**
 + * @brief   Time types data size.
 + * @note    Allowed values are 16 or 32 bits.
 + */
 +#define CH_CFG_TIME_TYPES_SIZE              32
 +
 +/**
   * @brief   Time delta constant for the tick-less mode.
   * @note    If this value is zero then the system uses the classic
   *          periodic tick. This value represents the minimum number
 @@ -296,6 +308,15 @@  #define CH_CFG_USE_MEMPOOLS                 TRUE
  /**
 + * @brief  Objects FIFOs APIs.
 + * @details If enabled then the objects FIFOs APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_OBJ_FIFOS                TRUE
 +
 +/**
   * @brief   Dynamic Threads APIs.
   * @details If enabled then the dynamic threads creation APIs are included
   *          in the kernel.
 @@ -310,6 +331,56 @@  /*===========================================================================*/
  /**
 + * @name Objects factory options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Objects Factory APIs.
 + * @details If enabled then the objects factory APIs are included in the
 + *          kernel.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_CFG_USE_FACTORY                  TRUE
 +
 +/**
 + * @brief   Maximum length for object names.
 + * @details If the specified length is zero then the name is stored by
 + *          pointer but this could have unintended side effects.
 + */
 +#define CH_CFG_FACTORY_MAX_NAMES_LENGTH     8
 +
 +/**
 + * @brief   Enables the registry of generic objects.
 + */
 +#define CH_CFG_FACTORY_OBJECTS_REGISTRY     TRUE
 +
 +/**
 + * @brief   Enables factory for generic buffers.
 + */
 +#define CH_CFG_FACTORY_GENERIC_BUFFERS      TRUE
 +
 +/**
 + * @brief   Enables factory for semaphores.
 + */
 +#define CH_CFG_FACTORY_SEMAPHORES           TRUE
 +
 +/**
 + * @brief   Enables factory for mailboxes.
 + */
 +#define CH_CFG_FACTORY_MAILBOXES            TRUE
 +
 +/**
 + * @brief   Enables factory for objects FIFOs.
 + */
 +#define CH_CFG_FACTORY_OBJ_FIFOS            TRUE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
   * @name Debug options
   * @{
   */
 @@ -408,6 +479,22 @@  /*===========================================================================*/
  /**
 + * @brief   System structure extension.
 + * @details User fields added to the end of the @p ch_system_t structure.
 + */
 +#define CH_CFG_SYSTEM_EXTRA_FIELDS                                          \
 +  /* Add threads custom fields here.*/
 +
 +/**
 + * @brief   System initialization hook.
 + * @details User initialization code added to the @p chSysInit() function
 + *          just before interrupts are enabled globally.
 + */
 +#define CH_CFG_SYSTEM_INIT_HOOK(tp) {                                       \
 +  /* Add threads initialization code here.*/                                \
 +}
 +
 +/**
   * @brief   Threads descriptor structure extension.
   * @details User fields added to the end of the @p thread_t structure.
   */
 @@ -416,9 +503,9 @@  /**
   * @brief   Threads initialization hook.
 - * @details User initialization code added to the @p chThdInit() API.
 + * @details User initialization code added to the @p _thread_init() function.
   *
 - * @note    It is invoked from within @p chThdInit() and implicitly from all
 + * @note    It is invoked from within @p _thread_init() and implicitly from all
   *          the threads creation APIs.
   */
  #define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \
 diff --git a/testhal/STM32/STM32F0xx/crc/halconf.h b/testhal/STM32/STM32F0xx/crc/halconf.h index 6e2d3c7..ef429c4 100644 --- a/testhal/STM32/STM32F0xx/crc/halconf.h +++ b/testhal/STM32/STM32F0xx/crc/halconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2015 Michael D. Spradling
 +    ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
 @@ -25,8 +25,8 @@   * @{
   */
 -#ifndef _HALCONF_H_
 -#define _HALCONF_H_
 +#ifndef HALCONF_H
 +#define HALCONF_H
  #include "mcuconf.h"
 @@ -52,6 +52,13 @@  #endif
  /**
 + * @brief   Enables the cryptographic subsystem.
 + */
 +#if !defined(HAL_USE_CRY) || defined(__DOXYGEN__)
 +#define HAL_USE_CRY                 FALSE
 +#endif
 +
 +/**
   * @brief   Enables the DAC subsystem.
   */
  #if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
 @@ -115,6 +122,13 @@  #endif
  /**
 + * @brief   Enables the QSPI subsystem.
 + */
 +#if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__)
 +#define HAL_USE_QSPI                FALSE
 +#endif
 +
 +/**
   * @brief   Enables the RTC subsystem.
   */
  #if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
 @@ -202,6 +216,28 @@  #endif
  /*===========================================================================*/
 +/* CRY driver related settings.                                              */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Enables the SW fall-back of the cryptographic driver.
 + * @details When enabled, this option, activates a fall-back software
 + *          implementation for algorithms not supported by the underlying
 + *          hardware.
 + * @note    Fall-back implementations may not be present for all algorithms.
 + */
 +#if !defined(HAL_CRY_USE_FALLBACK) || defined(__DOXYGEN__)
 +#define HAL_CRY_USE_FALLBACK                FALSE
 +#endif
 +
 +/**
 + * @brief   Makes the driver forcibly use the fall-back implementations.
 + */
 +#if !defined(HAL_CRY_ENFORCE_FALLBACK) || defined(__DOXYGEN__)
 +#define HAL_CRY_ENFORCE_FALLBACK            FALSE
 +#endif
 +
 +/*===========================================================================*/
  /* I2C driver related settings.                                              */
  /*===========================================================================*/
 @@ -294,7 +330,7 @@   * @brief   Serial buffers size.
   * @details Configuration parameter, you can change the depth of the queue
   *          buffers depending on the requirements of your application.
 - * @note    The default is 64 bytes for both the transmission and receive
 + * @note    The default is 16 bytes for both the transmission and receive
   *          buffers.
   */
  #if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
 @@ -309,13 +345,21 @@   * @brief   Serial over USB buffers size.
   * @details Configuration parameter, the buffer size must be a multiple of
   *          the USB data endpoint maximum packet size.
 - * @note    The default is 64 bytes for both the transmission and receive
 + * @note    The default is 256 bytes for both the transmission and receive
   *          buffers.
   */
  #if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
  #define SERIAL_USB_BUFFERS_SIZE     256
  #endif
 +/**
 + * @brief   Serial over USB number of buffers.
 + * @note    The default is 2 buffers.
 + */
 +#if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__)
 +#define SERIAL_USB_BUFFERS_NUMBER   2
 +#endif
 +
  /*===========================================================================*/
  /* SPI driver related settings.                                              */
  /*===========================================================================*/
 @@ -337,11 +381,43 @@  #endif
  /*===========================================================================*/
 +/* UART driver related settings.                                             */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Enables synchronous APIs.
 + * @note    Disabling this option saves both code and data space.
 + */
 +#if !defined(UART_USE_WAIT) || defined(__DOXYGEN__)
 +#define UART_USE_WAIT               FALSE
 +#endif
 +
 +/**
 + * @brief   Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs.
 + * @note    Disabling this option saves both code and data space.
 + */
 +#if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
 +#define UART_USE_MUTUAL_EXCLUSION   FALSE
 +#endif
 +
 +/*===========================================================================*/
 +/* USB driver related settings.                                              */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Enables synchronous APIs.
 + * @note    Disabling this option saves both code and data space.
 + */
 +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
 +#define USB_USE_WAIT                FALSE
 +#endif
 +
 +/*===========================================================================*/
  /* Community drivers's includes                                              */
  /*===========================================================================*/
  #include "halconf_community.h"
 -#endif /* _HALCONF_H_ */
 +#endif /* HALCONF_H */
  /** @} */
 diff --git a/testhal/STM32/STM32F0xx/crc/halconf_community.h b/testhal/STM32/STM32F0xx/crc/halconf_community.h index 31ac01e..1f45ee5 100644 --- a/testhal/STM32/STM32F0xx/crc/halconf_community.h +++ b/testhal/STM32/STM32F0xx/crc/halconf_community.h @@ -93,26 +93,6 @@   */
  #define ONEWIRE_USE_SEARCH_ROM      TRUE
 -/*===========================================================================*/
 -/* CRC driver settings.                                                      */
 -/*===========================================================================*/
 -
 -/**
 - * @brief   Enables DMA engine when performing CRC transactions.
 - * @note    Enabling this option also enables asynchronous API.
 - */
 -#if !defined(CRC_USE_DMA) || defined(__DOXYGEN__)
 -#define CRC_USE_DMA                 FALSE
 -#endif
 -
 -/**
 - * @brief   Enables the @p crcAcquireUnit() and @p crcReleaseUnit() APIs.
 - * @note    Disabling this option saves both code and data space.
 - */
 -#if !defined(CRC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
 -#define CRC_USE_MUTUAL_EXCLUSION    TRUE
 -#endif
 -
  #endif /* HALCONF_COMMUNITY_H */
  /** @} */
 diff --git a/testhal/STM32/STM32F0xx/crc/mcuconf.h b/testhal/STM32/STM32F0xx/crc/mcuconf.h index ad184cd..98a9e21 100644 --- a/testhal/STM32/STM32F0xx/crc/mcuconf.h +++ b/testhal/STM32/STM32F0xx/crc/mcuconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2015 Michael D. Spradling
 +    ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
 @@ -14,8 +14,8 @@      limitations under the License.
  */
 -#ifndef _MCUCONF_H_
 -#define _MCUCONF_H_
 +#ifndef MCUCONF_H
 +#define MCUCONF_H
  /*
   * STM32F0xx drivers configuration.
 @@ -50,32 +50,33 @@  #define STM32_PLLMUL_VALUE                  12
  #define STM32_HPRE                          STM32_HPRE_DIV1
  #define STM32_PPRE                          STM32_PPRE_DIV1
 -#define STM32_ADCSW                         STM32_ADCSW_HSI14
 -#define STM32_ADCPRE                        STM32_ADCPRE_DIV4
  #define STM32_MCOSEL                        STM32_MCOSEL_NOCLOCK
 -#define STM32_ADCPRE                        STM32_ADCPRE_DIV4
 -#define STM32_ADCSW                         STM32_ADCSW_HSI14
 +#define STM32_MCOPRE                        STM32_MCOPRE_DIV1
 +#define STM32_PLLNODIV                      STM32_PLLNODIV_DIV2
 +#define STM32_USBSW                         STM32_USBSW_HSI48
  #define STM32_CECSW                         STM32_CECSW_HSI
  #define STM32_I2C1SW                        STM32_I2C1SW_HSI
  #define STM32_USART1SW                      STM32_USART1SW_PCLK
  #define STM32_RTCSEL                        STM32_RTCSEL_LSI
  /*
 - * ADC driver system settings.
 + * IRQ system settings.
   */
 -#define STM32_ADC_USE_ADC1                  FALSE
 -#define STM32_ADC_ADC1_DMA_PRIORITY         2
 -#define STM32_ADC_IRQ_PRIORITY              2
 -#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY     2
 +#define STM32_IRQ_EXTI0_1_IRQ_PRIORITY      3
 +#define STM32_IRQ_EXTI2_3_IRQ_PRIORITY      3
 +#define STM32_IRQ_EXTI4_15_IRQ_PRIORITY     3
 +#define STM32_IRQ_EXTI16_IRQ_PRIORITY       3
 +#define STM32_IRQ_EXTI17_20_IRQ_PRIORITY    3
 +#define STM32_IRQ_EXTI21_22_IRQ_PRIORITY    3
  /*
 - * EXT driver system settings.
 + * ADC driver system settings.
   */
 -#define STM32_EXT_EXTI0_1_IRQ_PRIORITY      3
 -#define STM32_EXT_EXTI2_3_IRQ_PRIORITY      3
 -#define STM32_EXT_EXTI4_15_IRQ_PRIORITY     3
 -#define STM32_EXT_EXTI16_IRQ_PRIORITY       3
 -#define STM32_EXT_EXTI17_IRQ_PRIORITY       3
 +#define STM32_ADC_USE_ADC1                  TRUE
 +#define STM32_ADC_ADC1_CKMODE               STM32_ADC_CKMODE_ADCCLK
 +#define STM32_ADC_ADC1_DMA_PRIORITY         2
 +#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY     2
 +#define STM32_ADC_ADC1_DMA_STREAM           STM32_DMA_STREAM_ID(1, 1)
  /*
   * GPT driver system settings.
 @@ -100,9 +101,32 @@  #define STM32_I2C_USE_DMA                   TRUE
  #define STM32_I2C_I2C1_DMA_PRIORITY         1
  #define STM32_I2C_I2C2_DMA_PRIORITY         1
 +#define STM32_I2C_I2C1_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 3)
 +#define STM32_I2C_I2C1_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 2)
 +#define STM32_I2C_I2C2_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 5)
 +#define STM32_I2C_I2C2_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 4)
  #define STM32_I2C_DMA_ERROR_HOOK(i2cp)      osalSysHalt("DMA failure")
  /*
 + * I2S driver system settings.
 + */
 +#define STM32_I2S_USE_SPI1                  FALSE
 +#define STM32_I2S_USE_SPI2                  FALSE
 +#define STM32_I2S_SPI1_MODE                 (STM32_I2S_MODE_MASTER |        \
 +                                             STM32_I2S_MODE_RX)
 +#define STM32_I2S_SPI2_MODE                 (STM32_I2S_MODE_MASTER |        \
 +                                             STM32_I2S_MODE_RX)
 +#define STM32_I2S_SPI1_IRQ_PRIORITY         2
 +#define STM32_I2S_SPI2_IRQ_PRIORITY         2
 +#define STM32_I2S_SPI1_DMA_PRIORITY         1
 +#define STM32_I2S_SPI2_DMA_PRIORITY         1
 +#define STM32_I2S_SPI1_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 2)
 +#define STM32_I2S_SPI1_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 3)
 +#define STM32_I2S_SPI2_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 4)
 +#define STM32_I2S_SPI2_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 5)
 +#define STM32_I2S_DMA_ERROR_HOOK(i2sp)      osalSysHalt("DMA failure")
 +
 +/*
   * ICU driver system settings.
   */
  #define STM32_ICU_USE_TIM1                  FALSE
 @@ -140,6 +164,10 @@  #define STM32_SPI_SPI2_DMA_PRIORITY         1
  #define STM32_SPI_SPI1_IRQ_PRIORITY         2
  #define STM32_SPI_SPI2_IRQ_PRIORITY         2
 +#define STM32_SPI_SPI1_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 2)
 +#define STM32_SPI_SPI1_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 3)
 +#define STM32_SPI_SPI2_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 4)
 +#define STM32_SPI_SPI2_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 5)
  #define STM32_SPI_DMA_ERROR_HOOK(spip)      osalSysHalt("DMA failure")
  /*
 @@ -157,10 +185,20 @@  #define STM32_UART_USART2_IRQ_PRIORITY      3
  #define STM32_UART_USART1_DMA_PRIORITY      0
  #define STM32_UART_USART2_DMA_PRIORITY      0
 +#define STM32_UART_USART1_RX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 3)
 +#define STM32_UART_USART1_TX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 2)
 +#define STM32_UART_USART2_RX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 5)
 +#define STM32_UART_USART2_TX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 4)
  #define STM32_UART_DMA_ERROR_HOOK(uartp)    osalSysHalt("DMA failure")
  /*
 + * WDG driver system settings.
 + */
 +#define STM32_WDG_USE_IWDG                  FALSE
 +
 +/*
   * header for community drivers.
   */
  #include "mcuconf_community.h"
 -#endif /* _MCUCONF_H_ */
 +
 +#endif /* MCUCONF_H */
 diff --git a/testhal/STM32/STM32F0xx/onewire/chconf.h b/testhal/STM32/STM32F0xx/onewire/chconf.h index 4b2d922..9339775 100644 --- a/testhal/STM32/STM32F0xx/onewire/chconf.h +++ b/testhal/STM32/STM32F0xx/onewire/chconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
 +    ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
 @@ -42,14 +42,26 @@   * @brief   System time counter resolution.
   * @note    Allowed values are 16 or 32 bits.
   */
 -#define CH_CFG_ST_RESOLUTION                32
 +#define CH_CFG_ST_RESOLUTION                16
  /**
   * @brief   System tick frequency.
   * @details Frequency of the system timer that drives the system ticks. This
   *          setting also defines the system tick time unit.
   */
 -#define CH_CFG_ST_FREQUENCY                 1000
 +#define CH_CFG_ST_FREQUENCY                 10000
 +
 +/**
 + * @brief   Time intervals data size.
 + * @note    Allowed values are 16, 32 or 64 bits.
 + */
 +#define CH_CFG_INTERVALS_SIZE               16
 +
 +/**
 + * @brief   Time types data size.
 + * @note    Allowed values are 16 or 32 bits.
 + */
 +#define CH_CFG_TIME_TYPES_SIZE              16
  /**
   * @brief   Time delta constant for the tick-less mode.
 @@ -296,6 +308,15 @@  #define CH_CFG_USE_MEMPOOLS                 TRUE
  /**
 + * @brief  Objects FIFOs APIs.
 + * @details If enabled then the objects FIFOs APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_OBJ_FIFOS                TRUE
 +
 +/**
   * @brief   Dynamic Threads APIs.
   * @details If enabled then the dynamic threads creation APIs are included
   *          in the kernel.
 @@ -310,6 +331,56 @@  /*===========================================================================*/
  /**
 + * @name Objects factory options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Objects Factory APIs.
 + * @details If enabled then the objects factory APIs are included in the
 + *          kernel.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_CFG_USE_FACTORY                  TRUE
 +
 +/**
 + * @brief   Maximum length for object names.
 + * @details If the specified length is zero then the name is stored by
 + *          pointer but this could have unintended side effects.
 + */
 +#define CH_CFG_FACTORY_MAX_NAMES_LENGTH     8
 +
 +/**
 + * @brief   Enables the registry of generic objects.
 + */
 +#define CH_CFG_FACTORY_OBJECTS_REGISTRY     TRUE
 +
 +/**
 + * @brief   Enables factory for generic buffers.
 + */
 +#define CH_CFG_FACTORY_GENERIC_BUFFERS      TRUE
 +
 +/**
 + * @brief   Enables factory for semaphores.
 + */
 +#define CH_CFG_FACTORY_SEMAPHORES           TRUE
 +
 +/**
 + * @brief   Enables factory for mailboxes.
 + */
 +#define CH_CFG_FACTORY_MAILBOXES            TRUE
 +
 +/**
 + * @brief   Enables factory for objects FIFOs.
 + */
 +#define CH_CFG_FACTORY_OBJ_FIFOS            TRUE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
   * @name Debug options
   * @{
   */
 @@ -408,6 +479,22 @@  /*===========================================================================*/
  /**
 + * @brief   System structure extension.
 + * @details User fields added to the end of the @p ch_system_t structure.
 + */
 +#define CH_CFG_SYSTEM_EXTRA_FIELDS                                          \
 +  /* Add threads custom fields here.*/
 +
 +/**
 + * @brief   System initialization hook.
 + * @details User initialization code added to the @p chSysInit() function
 + *          just before interrupts are enabled globally.
 + */
 +#define CH_CFG_SYSTEM_INIT_HOOK(tp) {                                       \
 +  /* Add threads initialization code here.*/                                \
 +}
 +
 +/**
   * @brief   Threads descriptor structure extension.
   * @details User fields added to the end of the @p thread_t structure.
   */
 @@ -416,9 +503,9 @@  /**
   * @brief   Threads initialization hook.
 - * @details User initialization code added to the @p chThdInit() API.
 + * @details User initialization code added to the @p _thread_init() function.
   *
 - * @note    It is invoked from within @p chThdInit() and implicitly from all
 + * @note    It is invoked from within @p _thread_init() and implicitly from all
   *          the threads creation APIs.
   */
  #define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \
 diff --git a/testhal/STM32/STM32F0xx/onewire/halconf.h b/testhal/STM32/STM32F0xx/onewire/halconf.h index 64811a5..35b4ed5 100644 --- a/testhal/STM32/STM32F0xx/onewire/halconf.h +++ b/testhal/STM32/STM32F0xx/onewire/halconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
 +    ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
 @@ -52,6 +52,13 @@  #endif
  /**
 + * @brief   Enables the cryptographic subsystem.
 + */
 +#if !defined(HAL_USE_CRY) || defined(__DOXYGEN__)
 +#define HAL_USE_CRY                 FALSE
 +#endif
 +
 +/**
   * @brief   Enables the DAC subsystem.
   */
  #if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
 @@ -115,6 +122,13 @@  #endif
  /**
 + * @brief   Enables the QSPI subsystem.
 + */
 +#if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__)
 +#define HAL_USE_QSPI                FALSE
 +#endif
 +
 +/**
   * @brief   Enables the RTC subsystem.
   */
  #if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
 @@ -202,6 +216,28 @@  #endif
  /*===========================================================================*/
 +/* CRY driver related settings.                                              */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Enables the SW fall-back of the cryptographic driver.
 + * @details When enabled, this option, activates a fall-back software
 + *          implementation for algorithms not supported by the underlying
 + *          hardware.
 + * @note    Fall-back implementations may not be present for all algorithms.
 + */
 +#if !defined(HAL_CRY_USE_FALLBACK) || defined(__DOXYGEN__)
 +#define HAL_CRY_USE_FALLBACK                FALSE
 +#endif
 +
 +/**
 + * @brief   Makes the driver forcibly use the fall-back implementations.
 + */
 +#if !defined(HAL_CRY_ENFORCE_FALLBACK) || defined(__DOXYGEN__)
 +#define HAL_CRY_ENFORCE_FALLBACK            FALSE
 +#endif
 +
 +/*===========================================================================*/
  /* I2C driver related settings.                                              */
  /*===========================================================================*/
 diff --git a/testhal/STM32/STM32F0xx/onewire/mcuconf.h b/testhal/STM32/STM32F0xx/onewire/mcuconf.h index 7773406..e09937d 100644 --- a/testhal/STM32/STM32F0xx/onewire/mcuconf.h +++ b/testhal/STM32/STM32F0xx/onewire/mcuconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
 +    ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
 @@ -50,42 +50,41 @@  #define STM32_PLLMUL_VALUE                  12
  #define STM32_HPRE                          STM32_HPRE_DIV1
  #define STM32_PPRE                          STM32_PPRE_DIV1
 -#define STM32_ADCSW                         STM32_ADCSW_HSI14
 -#define STM32_ADCPRE                        STM32_ADCPRE_DIV4
  #define STM32_MCOSEL                        STM32_MCOSEL_NOCLOCK
 -#define STM32_ADCPRE                        STM32_ADCPRE_DIV4
 -#define STM32_ADCSW                         STM32_ADCSW_HSI14
 +#define STM32_MCOPRE                        STM32_MCOPRE_DIV1
 +#define STM32_PLLNODIV                      STM32_PLLNODIV_DIV2
 +#define STM32_USBSW                         STM32_USBSW_HSI48
  #define STM32_CECSW                         STM32_CECSW_HSI
  #define STM32_I2C1SW                        STM32_I2C1SW_HSI
  #define STM32_USART1SW                      STM32_USART1SW_PCLK
  #define STM32_RTCSEL                        STM32_RTCSEL_LSI
  /*
 - * ADC driver system settings.
 + * IRQ system settings.
   */
 -#define STM32_ADC_USE_ADC1                  FALSE
 -#define STM32_ADC_ADC1_DMA_PRIORITY         2
 -#define STM32_ADC_IRQ_PRIORITY              2
 -#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY     2
 +#define STM32_IRQ_EXTI0_1_IRQ_PRIORITY      3
 +#define STM32_IRQ_EXTI2_3_IRQ_PRIORITY      3
 +#define STM32_IRQ_EXTI4_15_IRQ_PRIORITY     3
 +#define STM32_IRQ_EXTI16_IRQ_PRIORITY       3
 +#define STM32_IRQ_EXTI17_20_IRQ_PRIORITY    3
 +#define STM32_IRQ_EXTI21_22_IRQ_PRIORITY    3
  /*
 - * EXT driver system settings.
 + * ADC driver system settings.
   */
 -#define STM32_EXT_EXTI0_1_IRQ_PRIORITY      3
 -#define STM32_EXT_EXTI2_3_IRQ_PRIORITY      3
 -#define STM32_EXT_EXTI4_15_IRQ_PRIORITY     3
 -#define STM32_EXT_EXTI16_IRQ_PRIORITY       3
 -#define STM32_EXT_EXTI17_IRQ_PRIORITY       3
 +#define STM32_ADC_USE_ADC1                  TRUE
 +#define STM32_ADC_ADC1_CKMODE               STM32_ADC_CKMODE_ADCCLK
 +#define STM32_ADC_ADC1_DMA_PRIORITY         2
 +#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY     2
 +#define STM32_ADC_ADC1_DMA_STREAM           STM32_DMA_STREAM_ID(1, 1)
  /*
   * 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_TIM14                 FALSE
  #define STM32_GPT_TIM1_IRQ_PRIORITY         2
 -#define STM32_GPT_TIM2_IRQ_PRIORITY         2
  #define STM32_GPT_TIM3_IRQ_PRIORITY         2
  #define STM32_GPT_TIM14_IRQ_PRIORITY        2
 @@ -97,18 +96,40 @@  #define STM32_I2C_BUSY_TIMEOUT              50
  #define STM32_I2C_I2C1_IRQ_PRIORITY         3
  #define STM32_I2C_I2C2_IRQ_PRIORITY         3
 +#define STM32_I2C_USE_DMA                   TRUE
  #define STM32_I2C_I2C1_DMA_PRIORITY         1
  #define STM32_I2C_I2C2_DMA_PRIORITY         1
 +#define STM32_I2C_I2C1_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 3)
 +#define STM32_I2C_I2C1_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 2)
 +#define STM32_I2C_I2C2_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 5)
 +#define STM32_I2C_I2C2_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 4)
  #define STM32_I2C_DMA_ERROR_HOOK(i2cp)      osalSysHalt("DMA failure")
  /*
 + * I2S driver system settings.
 + */
 +#define STM32_I2S_USE_SPI1                  FALSE
 +#define STM32_I2S_USE_SPI2                  FALSE
 +#define STM32_I2S_SPI1_MODE                 (STM32_I2S_MODE_MASTER |        \
 +                                             STM32_I2S_MODE_RX)
 +#define STM32_I2S_SPI2_MODE                 (STM32_I2S_MODE_MASTER |        \
 +                                             STM32_I2S_MODE_RX)
 +#define STM32_I2S_SPI1_IRQ_PRIORITY         2
 +#define STM32_I2S_SPI2_IRQ_PRIORITY         2
 +#define STM32_I2S_SPI1_DMA_PRIORITY         1
 +#define STM32_I2S_SPI2_DMA_PRIORITY         1
 +#define STM32_I2S_SPI1_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 2)
 +#define STM32_I2S_SPI1_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 3)
 +#define STM32_I2S_SPI2_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 4)
 +#define STM32_I2S_SPI2_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 5)
 +#define STM32_I2S_DMA_ERROR_HOOK(i2sp)      osalSysHalt("DMA failure")
 +
 +/*
   * 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_TIM1_IRQ_PRIORITY         3
 -#define STM32_ICU_TIM2_IRQ_PRIORITY         3
  #define STM32_ICU_TIM3_IRQ_PRIORITY         3
  /*
 @@ -116,11 +137,9 @@   */
  #define STM32_PWM_USE_ADVANCED              FALSE
  #define STM32_PWM_USE_TIM1                  FALSE
 -#define STM32_PWM_USE_TIM2                  FALSE
  #define STM32_PWM_USE_TIM3                  TRUE
  #define STM32_PWM_TIM1_IRQ_PRIORITY         3
 -#define STM32_PWM_TIM2_IRQ_PRIORITY         3
 -#define STM32_PWM_TIM3_IRQ_PRIORITY         0
 +#define STM32_PWM_TIM3_IRQ_PRIORITY         3
  /*
   * SERIAL driver system settings.
 @@ -139,6 +158,10 @@  #define STM32_SPI_SPI2_DMA_PRIORITY         1
  #define STM32_SPI_SPI1_IRQ_PRIORITY         2
  #define STM32_SPI_SPI2_IRQ_PRIORITY         2
 +#define STM32_SPI_SPI1_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 2)
 +#define STM32_SPI_SPI1_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 3)
 +#define STM32_SPI_SPI2_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 4)
 +#define STM32_SPI_SPI2_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 5)
  #define STM32_SPI_DMA_ERROR_HOOK(spip)      osalSysHalt("DMA failure")
  /*
 @@ -156,6 +179,10 @@  #define STM32_UART_USART2_IRQ_PRIORITY      3
  #define STM32_UART_USART1_DMA_PRIORITY      0
  #define STM32_UART_USART2_DMA_PRIORITY      0
 +#define STM32_UART_USART1_RX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 3)
 +#define STM32_UART_USART1_TX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 2)
 +#define STM32_UART_USART2_RX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 5)
 +#define STM32_UART_USART2_TX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 4)
  #define STM32_UART_DMA_ERROR_HOOK(uartp)    osalSysHalt("DMA failure")
  /*
 diff --git a/testhal/STM32/STM32F0xx/qei/chconf.h b/testhal/STM32/STM32F0xx/qei/chconf.h index b3260d4..53bd676 100644 --- a/testhal/STM32/STM32F0xx/qei/chconf.h +++ b/testhal/STM32/STM32F0xx/qei/chconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
 +    ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
 @@ -42,7 +42,7 @@   * @brief   System time counter resolution.
   * @note    Allowed values are 16 or 32 bits.
   */
 -#define CH_CFG_ST_RESOLUTION                16
 +#define CH_CFG_ST_RESOLUTION                32
  /**
   * @brief   System tick frequency.
 @@ -52,6 +52,18 @@  #define CH_CFG_ST_FREQUENCY                 10000
  /**
 + * @brief   Time intervals data size.
 + * @note    Allowed values are 16, 32 or 64 bits.
 + */
 +#define CH_CFG_INTERVALS_SIZE               32
 +
 +/**
 + * @brief   Time types data size.
 + * @note    Allowed values are 16 or 32 bits.
 + */
 +#define CH_CFG_TIME_TYPES_SIZE              32
 +
 +/**
   * @brief   Time delta constant for the tick-less mode.
   * @note    If this value is zero then the system uses the classic
   *          periodic tick. This value represents the minimum number
 @@ -296,6 +308,15 @@  #define CH_CFG_USE_MEMPOOLS                 TRUE
  /**
 + * @brief  Objects FIFOs APIs.
 + * @details If enabled then the objects FIFOs APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_OBJ_FIFOS                TRUE
 +
 +/**
   * @brief   Dynamic Threads APIs.
   * @details If enabled then the dynamic threads creation APIs are included
   *          in the kernel.
 @@ -310,6 +331,56 @@  /*===========================================================================*/
  /**
 + * @name Objects factory options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Objects Factory APIs.
 + * @details If enabled then the objects factory APIs are included in the
 + *          kernel.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_CFG_USE_FACTORY                  TRUE
 +
 +/**
 + * @brief   Maximum length for object names.
 + * @details If the specified length is zero then the name is stored by
 + *          pointer but this could have unintended side effects.
 + */
 +#define CH_CFG_FACTORY_MAX_NAMES_LENGTH     8
 +
 +/**
 + * @brief   Enables the registry of generic objects.
 + */
 +#define CH_CFG_FACTORY_OBJECTS_REGISTRY     TRUE
 +
 +/**
 + * @brief   Enables factory for generic buffers.
 + */
 +#define CH_CFG_FACTORY_GENERIC_BUFFERS      TRUE
 +
 +/**
 + * @brief   Enables factory for semaphores.
 + */
 +#define CH_CFG_FACTORY_SEMAPHORES           TRUE
 +
 +/**
 + * @brief   Enables factory for mailboxes.
 + */
 +#define CH_CFG_FACTORY_MAILBOXES            TRUE
 +
 +/**
 + * @brief   Enables factory for objects FIFOs.
 + */
 +#define CH_CFG_FACTORY_OBJ_FIFOS            TRUE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
   * @name Debug options
   * @{
   */
 @@ -329,7 +400,7 @@   *
   * @note    The default is @p FALSE.
   */
 -#define CH_DBG_SYSTEM_STATE_CHECK           FALSE
 +#define CH_DBG_SYSTEM_STATE_CHECK           TRUE
  /**
   * @brief   Debug option, parameters checks.
 @@ -338,7 +409,7 @@   *
   * @note    The default is @p FALSE.
   */
 -#define CH_DBG_ENABLE_CHECKS                FALSE
 +#define CH_DBG_ENABLE_CHECKS                TRUE
  /**
   * @brief   Debug option, consistency checks.
 @@ -348,7 +419,7 @@   *
   * @note    The default is @p FALSE.
   */
 -#define CH_DBG_ENABLE_ASSERTS               FALSE
 +#define CH_DBG_ENABLE_ASSERTS               TRUE
  /**
   * @brief   Debug option, trace buffer.
 @@ -356,7 +427,7 @@   *
   * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.
   */
 -#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_DISABLED
 +#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_ALL
  /**
   * @brief   Trace buffer entries.
 @@ -375,7 +446,7 @@   * @note    The default failure mode is to halt the system with the global
   *          @p panic_msg variable set to @p NULL.
   */
 -#define CH_DBG_ENABLE_STACK_CHECK           FALSE
 +#define CH_DBG_ENABLE_STACK_CHECK           TRUE
  /**
   * @brief   Debug option, stacks initialization.
 @@ -385,7 +456,7 @@   *
   * @note    The default is @p FALSE.
   */
 -#define CH_DBG_FILL_THREADS                 FALSE
 +#define CH_DBG_FILL_THREADS                 TRUE
  /**
   * @brief   Debug option, threads profiling.
 @@ -408,6 +479,22 @@  /*===========================================================================*/
  /**
 + * @brief   System structure extension.
 + * @details User fields added to the end of the @p ch_system_t structure.
 + */
 +#define CH_CFG_SYSTEM_EXTRA_FIELDS                                          \
 +  /* Add threads custom fields here.*/
 +
 +/**
 + * @brief   System initialization hook.
 + * @details User initialization code added to the @p chSysInit() function
 + *          just before interrupts are enabled globally.
 + */
 +#define CH_CFG_SYSTEM_INIT_HOOK(tp) {                                       \
 +  /* Add threads initialization code here.*/                                \
 +}
 +
 +/**
   * @brief   Threads descriptor structure extension.
   * @details User fields added to the end of the @p thread_t structure.
   */
 @@ -416,9 +503,9 @@  /**
   * @brief   Threads initialization hook.
 - * @details User initialization code added to the @p chThdInit() API.
 + * @details User initialization code added to the @p _thread_init() function.
   *
 - * @note    It is invoked from within @p chThdInit() and implicitly from all
 + * @note    It is invoked from within @p _thread_init() and implicitly from all
   *          the threads creation APIs.
   */
  #define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \
 diff --git a/testhal/STM32/STM32F0xx/qei/halconf.h b/testhal/STM32/STM32F0xx/qei/halconf.h index 93cc713..ef429c4 100644 --- a/testhal/STM32/STM32F0xx/qei/halconf.h +++ b/testhal/STM32/STM32F0xx/qei/halconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
 +    ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
 @@ -52,6 +52,13 @@  #endif
  /**
 + * @brief   Enables the cryptographic subsystem.
 + */
 +#if !defined(HAL_USE_CRY) || defined(__DOXYGEN__)
 +#define HAL_USE_CRY                 FALSE
 +#endif
 +
 +/**
   * @brief   Enables the DAC subsystem.
   */
  #if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
 @@ -115,6 +122,13 @@  #endif
  /**
 + * @brief   Enables the QSPI subsystem.
 + */
 +#if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__)
 +#define HAL_USE_QSPI                FALSE
 +#endif
 +
 +/**
   * @brief   Enables the RTC subsystem.
   */
  #if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
 @@ -202,6 +216,28 @@  #endif
  /*===========================================================================*/
 +/* CRY driver related settings.                                              */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Enables the SW fall-back of the cryptographic driver.
 + * @details When enabled, this option, activates a fall-back software
 + *          implementation for algorithms not supported by the underlying
 + *          hardware.
 + * @note    Fall-back implementations may not be present for all algorithms.
 + */
 +#if !defined(HAL_CRY_USE_FALLBACK) || defined(__DOXYGEN__)
 +#define HAL_CRY_USE_FALLBACK                FALSE
 +#endif
 +
 +/**
 + * @brief   Makes the driver forcibly use the fall-back implementations.
 + */
 +#if !defined(HAL_CRY_ENFORCE_FALLBACK) || defined(__DOXYGEN__)
 +#define HAL_CRY_ENFORCE_FALLBACK            FALSE
 +#endif
 +
 +/*===========================================================================*/
  /* I2C driver related settings.                                              */
  /*===========================================================================*/
 diff --git a/testhal/STM32/STM32F0xx/qei/mcuconf.h b/testhal/STM32/STM32F0xx/qei/mcuconf.h index 6fb24b0..98a9e21 100644 --- a/testhal/STM32/STM32F0xx/qei/mcuconf.h +++ b/testhal/STM32/STM32F0xx/qei/mcuconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
 +    ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
 @@ -50,38 +50,33 @@  #define STM32_PLLMUL_VALUE                  12
  #define STM32_HPRE                          STM32_HPRE_DIV1
  #define STM32_PPRE                          STM32_PPRE_DIV1
 -#define STM32_ADCSW                         STM32_ADCSW_HSI14
 -#define STM32_ADCPRE                        STM32_ADCPRE_DIV4
  #define STM32_MCOSEL                        STM32_MCOSEL_NOCLOCK
 -#define STM32_ADCPRE                        STM32_ADCPRE_DIV4
 -#define STM32_ADCSW                         STM32_ADCSW_HSI14
 +#define STM32_MCOPRE                        STM32_MCOPRE_DIV1
 +#define STM32_PLLNODIV                      STM32_PLLNODIV_DIV2
 +#define STM32_USBSW                         STM32_USBSW_HSI48
  #define STM32_CECSW                         STM32_CECSW_HSI
  #define STM32_I2C1SW                        STM32_I2C1SW_HSI
  #define STM32_USART1SW                      STM32_USART1SW_PCLK
  #define STM32_RTCSEL                        STM32_RTCSEL_LSI
  /*
 - * ADC driver system settings.
 + * IRQ system settings.
   */
 -#define STM32_ADC_USE_ADC1                  FALSE
 -#define STM32_ADC_ADC1_DMA_PRIORITY         2
 -#define STM32_ADC_IRQ_PRIORITY              2
 -#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY     2
 +#define STM32_IRQ_EXTI0_1_IRQ_PRIORITY      3
 +#define STM32_IRQ_EXTI2_3_IRQ_PRIORITY      3
 +#define STM32_IRQ_EXTI4_15_IRQ_PRIORITY     3
 +#define STM32_IRQ_EXTI16_IRQ_PRIORITY       3
 +#define STM32_IRQ_EXTI17_20_IRQ_PRIORITY    3
 +#define STM32_IRQ_EXTI21_22_IRQ_PRIORITY    3
  /*
 - * CAN driver system settings.
 - */
 -#define STM32_CAN_USE_CAN1                  FALSE
 -#define STM32_CAN_CAN1_IRQ_PRIORITY         11
 -
 -/*
 - * EXT driver system settings.
 + * ADC driver system settings.
   */
 -#define STM32_EXT_EXTI0_1_IRQ_PRIORITY      3
 -#define STM32_EXT_EXTI2_3_IRQ_PRIORITY      3
 -#define STM32_EXT_EXTI4_15_IRQ_PRIORITY     3
 -#define STM32_EXT_EXTI16_IRQ_PRIORITY       3
 -#define STM32_EXT_EXTI17_IRQ_PRIORITY       3
 +#define STM32_ADC_USE_ADC1                  TRUE
 +#define STM32_ADC_ADC1_CKMODE               STM32_ADC_CKMODE_ADCCLK
 +#define STM32_ADC_ADC1_DMA_PRIORITY         2
 +#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY     2
 +#define STM32_ADC_ADC1_DMA_STREAM           STM32_DMA_STREAM_ID(1, 1)
  /*
   * GPT driver system settings.
 @@ -106,9 +101,32 @@  #define STM32_I2C_USE_DMA                   TRUE
  #define STM32_I2C_I2C1_DMA_PRIORITY         1
  #define STM32_I2C_I2C2_DMA_PRIORITY         1
 +#define STM32_I2C_I2C1_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 3)
 +#define STM32_I2C_I2C1_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 2)
 +#define STM32_I2C_I2C2_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 5)
 +#define STM32_I2C_I2C2_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 4)
  #define STM32_I2C_DMA_ERROR_HOOK(i2cp)      osalSysHalt("DMA failure")
  /*
 + * I2S driver system settings.
 + */
 +#define STM32_I2S_USE_SPI1                  FALSE
 +#define STM32_I2S_USE_SPI2                  FALSE
 +#define STM32_I2S_SPI1_MODE                 (STM32_I2S_MODE_MASTER |        \
 +                                             STM32_I2S_MODE_RX)
 +#define STM32_I2S_SPI2_MODE                 (STM32_I2S_MODE_MASTER |        \
 +                                             STM32_I2S_MODE_RX)
 +#define STM32_I2S_SPI1_IRQ_PRIORITY         2
 +#define STM32_I2S_SPI2_IRQ_PRIORITY         2
 +#define STM32_I2S_SPI1_DMA_PRIORITY         1
 +#define STM32_I2S_SPI2_DMA_PRIORITY         1
 +#define STM32_I2S_SPI1_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 2)
 +#define STM32_I2S_SPI1_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 3)
 +#define STM32_I2S_SPI2_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 4)
 +#define STM32_I2S_SPI2_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 5)
 +#define STM32_I2S_DMA_ERROR_HOOK(i2sp)      osalSysHalt("DMA failure")
 +
 +/*
   * ICU driver system settings.
   */
  #define STM32_ICU_USE_TIM1                  FALSE
 @@ -130,11 +148,6 @@  #define STM32_PWM_TIM3_IRQ_PRIORITY         3
  /*
 - * RTC driver system settings.
 - */
 -#define STM32_RTC_IRQ_PRIORITY              15
 -
 -/*
   * SERIAL driver system settings.
   */
  #define STM32_SERIAL_USE_USART1             FALSE
 @@ -151,6 +164,10 @@  #define STM32_SPI_SPI2_DMA_PRIORITY         1
  #define STM32_SPI_SPI1_IRQ_PRIORITY         2
  #define STM32_SPI_SPI2_IRQ_PRIORITY         2
 +#define STM32_SPI_SPI1_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 2)
 +#define STM32_SPI_SPI1_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 3)
 +#define STM32_SPI_SPI2_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 4)
 +#define STM32_SPI_SPI2_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 5)
  #define STM32_SPI_DMA_ERROR_HOOK(spip)      osalSysHalt("DMA failure")
  /*
 @@ -168,20 +185,16 @@  #define STM32_UART_USART2_IRQ_PRIORITY      3
  #define STM32_UART_USART1_DMA_PRIORITY      0
  #define STM32_UART_USART2_DMA_PRIORITY      0
 +#define STM32_UART_USART1_RX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 3)
 +#define STM32_UART_USART1_TX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 2)
 +#define STM32_UART_USART2_RX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 5)
 +#define STM32_UART_USART2_TX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 4)
  #define STM32_UART_DMA_ERROR_HOOK(uartp)    osalSysHalt("DMA failure")
  /*
 - * USB driver system settings.
 - */
 -#define STM32_USB_USE_USB1                  FALSE
 -#define STM32_USB_LOW_POWER_ON_SUSPEND      FALSE
 -#define STM32_USB_USB1_HP_IRQ_PRIORITY      13
 -#define STM32_USB_USB1_LP_IRQ_PRIORITY      14
 -
 -/*
   * WDG driver system settings.
   */
 -#define STM32_WDG_USE_IWDG                  TRUE
 +#define STM32_WDG_USE_IWDG                  FALSE
  /*
   * header for community drivers.
 diff --git a/testhal/STM32/STM32F1xx/onewire/chconf.h b/testhal/STM32/STM32F1xx/onewire/chconf.h index b38dfa3..42ee69b 100644 --- a/testhal/STM32/STM32F1xx/onewire/chconf.h +++ b/testhal/STM32/STM32F1xx/onewire/chconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
 +    ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
 @@ -52,6 +52,18 @@  #define CH_CFG_ST_FREQUENCY                 10000
  /**
 + * @brief   Time intervals data size.
 + * @note    Allowed values are 16, 32 or 64 bits.
 + */
 +#define CH_CFG_INTERVALS_SIZE               32
 +
 +/**
 + * @brief   Time types data size.
 + * @note    Allowed values are 16 or 32 bits.
 + */
 +#define CH_CFG_TIME_TYPES_SIZE              32
 +
 +/**
   * @brief   Time delta constant for the tick-less mode.
   * @note    If this value is zero then the system uses the classic
   *          periodic tick. This value represents the minimum number
 @@ -141,7 +153,7 @@   *
   * @note    The default is @p TRUE.
   */
 -#define CH_CFG_USE_TM                       TRUE
 +#define CH_CFG_USE_TM                       FALSE
  /**
   * @brief   Threads registry APIs.
 @@ -296,6 +308,15 @@  #define CH_CFG_USE_MEMPOOLS                 TRUE
  /**
 + * @brief  Objects FIFOs APIs.
 + * @details If enabled then the objects FIFOs APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_OBJ_FIFOS                TRUE
 +
 +/**
   * @brief   Dynamic Threads APIs.
   * @details If enabled then the dynamic threads creation APIs are included
   *          in the kernel.
 @@ -310,6 +331,56 @@  /*===========================================================================*/
  /**
 + * @name Objects factory options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Objects Factory APIs.
 + * @details If enabled then the objects factory APIs are included in the
 + *          kernel.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_CFG_USE_FACTORY                  TRUE
 +
 +/**
 + * @brief   Maximum length for object names.
 + * @details If the specified length is zero then the name is stored by
 + *          pointer but this could have unintended side effects.
 + */
 +#define CH_CFG_FACTORY_MAX_NAMES_LENGTH     8
 +
 +/**
 + * @brief   Enables the registry of generic objects.
 + */
 +#define CH_CFG_FACTORY_OBJECTS_REGISTRY     TRUE
 +
 +/**
 + * @brief   Enables factory for generic buffers.
 + */
 +#define CH_CFG_FACTORY_GENERIC_BUFFERS      TRUE
 +
 +/**
 + * @brief   Enables factory for semaphores.
 + */
 +#define CH_CFG_FACTORY_SEMAPHORES           TRUE
 +
 +/**
 + * @brief   Enables factory for mailboxes.
 + */
 +#define CH_CFG_FACTORY_MAILBOXES            TRUE
 +
 +/**
 + * @brief   Enables factory for objects FIFOs.
 + */
 +#define CH_CFG_FACTORY_OBJ_FIFOS            TRUE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
   * @name Debug options
   * @{
   */
 @@ -408,6 +479,22 @@  /*===========================================================================*/
  /**
 + * @brief   System structure extension.
 + * @details User fields added to the end of the @p ch_system_t structure.
 + */
 +#define CH_CFG_SYSTEM_EXTRA_FIELDS                                          \
 +  /* Add threads custom fields here.*/
 +
 +/**
 + * @brief   System initialization hook.
 + * @details User initialization code added to the @p chSysInit() function
 + *          just before interrupts are enabled globally.
 + */
 +#define CH_CFG_SYSTEM_INIT_HOOK(tp) {                                       \
 +  /* Add threads initialization code here.*/                                \
 +}
 +
 +/**
   * @brief   Threads descriptor structure extension.
   * @details User fields added to the end of the @p thread_t structure.
   */
 @@ -416,9 +503,9 @@  /**
   * @brief   Threads initialization hook.
 - * @details User initialization code added to the @p chThdInit() API.
 + * @details User initialization code added to the @p _thread_init() function.
   *
 - * @note    It is invoked from within @p chThdInit() and implicitly from all
 + * @note    It is invoked from within @p _thread_init() and implicitly from all
   *          the threads creation APIs.
   */
  #define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \
 diff --git a/testhal/STM32/STM32F1xx/qei/chconf.h b/testhal/STM32/STM32F1xx/qei/chconf.h index b3260d4..42ee69b 100644 --- a/testhal/STM32/STM32F1xx/qei/chconf.h +++ b/testhal/STM32/STM32F1xx/qei/chconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
 +    ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
 @@ -52,6 +52,18 @@  #define CH_CFG_ST_FREQUENCY                 10000
  /**
 + * @brief   Time intervals data size.
 + * @note    Allowed values are 16, 32 or 64 bits.
 + */
 +#define CH_CFG_INTERVALS_SIZE               32
 +
 +/**
 + * @brief   Time types data size.
 + * @note    Allowed values are 16 or 32 bits.
 + */
 +#define CH_CFG_TIME_TYPES_SIZE              32
 +
 +/**
   * @brief   Time delta constant for the tick-less mode.
   * @note    If this value is zero then the system uses the classic
   *          periodic tick. This value represents the minimum number
 @@ -296,6 +308,15 @@  #define CH_CFG_USE_MEMPOOLS                 TRUE
  /**
 + * @brief  Objects FIFOs APIs.
 + * @details If enabled then the objects FIFOs APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_OBJ_FIFOS                TRUE
 +
 +/**
   * @brief   Dynamic Threads APIs.
   * @details If enabled then the dynamic threads creation APIs are included
   *          in the kernel.
 @@ -310,6 +331,56 @@  /*===========================================================================*/
  /**
 + * @name Objects factory options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Objects Factory APIs.
 + * @details If enabled then the objects factory APIs are included in the
 + *          kernel.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_CFG_USE_FACTORY                  TRUE
 +
 +/**
 + * @brief   Maximum length for object names.
 + * @details If the specified length is zero then the name is stored by
 + *          pointer but this could have unintended side effects.
 + */
 +#define CH_CFG_FACTORY_MAX_NAMES_LENGTH     8
 +
 +/**
 + * @brief   Enables the registry of generic objects.
 + */
 +#define CH_CFG_FACTORY_OBJECTS_REGISTRY     TRUE
 +
 +/**
 + * @brief   Enables factory for generic buffers.
 + */
 +#define CH_CFG_FACTORY_GENERIC_BUFFERS      TRUE
 +
 +/**
 + * @brief   Enables factory for semaphores.
 + */
 +#define CH_CFG_FACTORY_SEMAPHORES           TRUE
 +
 +/**
 + * @brief   Enables factory for mailboxes.
 + */
 +#define CH_CFG_FACTORY_MAILBOXES            TRUE
 +
 +/**
 + * @brief   Enables factory for objects FIFOs.
 + */
 +#define CH_CFG_FACTORY_OBJ_FIFOS            TRUE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
   * @name Debug options
   * @{
   */
 @@ -329,7 +400,7 @@   *
   * @note    The default is @p FALSE.
   */
 -#define CH_DBG_SYSTEM_STATE_CHECK           FALSE
 +#define CH_DBG_SYSTEM_STATE_CHECK           TRUE
  /**
   * @brief   Debug option, parameters checks.
 @@ -338,7 +409,7 @@   *
   * @note    The default is @p FALSE.
   */
 -#define CH_DBG_ENABLE_CHECKS                FALSE
 +#define CH_DBG_ENABLE_CHECKS                TRUE
  /**
   * @brief   Debug option, consistency checks.
 @@ -348,7 +419,7 @@   *
   * @note    The default is @p FALSE.
   */
 -#define CH_DBG_ENABLE_ASSERTS               FALSE
 +#define CH_DBG_ENABLE_ASSERTS               TRUE
  /**
   * @brief   Debug option, trace buffer.
 @@ -356,7 +427,7 @@   *
   * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.
   */
 -#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_DISABLED
 +#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_ALL
  /**
   * @brief   Trace buffer entries.
 @@ -375,7 +446,7 @@   * @note    The default failure mode is to halt the system with the global
   *          @p panic_msg variable set to @p NULL.
   */
 -#define CH_DBG_ENABLE_STACK_CHECK           FALSE
 +#define CH_DBG_ENABLE_STACK_CHECK           TRUE
  /**
   * @brief   Debug option, stacks initialization.
 @@ -385,7 +456,7 @@   *
   * @note    The default is @p FALSE.
   */
 -#define CH_DBG_FILL_THREADS                 FALSE
 +#define CH_DBG_FILL_THREADS                 TRUE
  /**
   * @brief   Debug option, threads profiling.
 @@ -408,6 +479,22 @@  /*===========================================================================*/
  /**
 + * @brief   System structure extension.
 + * @details User fields added to the end of the @p ch_system_t structure.
 + */
 +#define CH_CFG_SYSTEM_EXTRA_FIELDS                                          \
 +  /* Add threads custom fields here.*/
 +
 +/**
 + * @brief   System initialization hook.
 + * @details User initialization code added to the @p chSysInit() function
 + *          just before interrupts are enabled globally.
 + */
 +#define CH_CFG_SYSTEM_INIT_HOOK(tp) {                                       \
 +  /* Add threads initialization code here.*/                                \
 +}
 +
 +/**
   * @brief   Threads descriptor structure extension.
   * @details User fields added to the end of the @p thread_t structure.
   */
 @@ -416,9 +503,9 @@  /**
   * @brief   Threads initialization hook.
 - * @details User initialization code added to the @p chThdInit() API.
 + * @details User initialization code added to the @p _thread_init() function.
   *
 - * @note    It is invoked from within @p chThdInit() and implicitly from all
 + * @note    It is invoked from within @p _thread_init() and implicitly from all
   *          the threads creation APIs.
   */
  #define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \
 diff --git a/testhal/STM32/STM32F3xx/COMP/chconf.h b/testhal/STM32/STM32F3xx/COMP/chconf.h index 894f737..53bd676 100644 --- a/testhal/STM32/STM32F3xx/COMP/chconf.h +++ b/testhal/STM32/STM32F3xx/COMP/chconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
 +    ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
 @@ -52,6 +52,18 @@  #define CH_CFG_ST_FREQUENCY                 10000
  /**
 + * @brief   Time intervals data size.
 + * @note    Allowed values are 16, 32 or 64 bits.
 + */
 +#define CH_CFG_INTERVALS_SIZE               32
 +
 +/**
 + * @brief   Time types data size.
 + * @note    Allowed values are 16 or 32 bits.
 + */
 +#define CH_CFG_TIME_TYPES_SIZE              32
 +
 +/**
   * @brief   Time delta constant for the tick-less mode.
   * @note    If this value is zero then the system uses the classic
   *          periodic tick. This value represents the minimum number
 @@ -141,7 +153,7 @@   *
   * @note    The default is @p TRUE.
   */
 -#define CH_CFG_USE_TM                       TRUE
 +#define CH_CFG_USE_TM                       FALSE
  /**
   * @brief   Threads registry APIs.
 @@ -296,6 +308,15 @@  #define CH_CFG_USE_MEMPOOLS                 TRUE
  /**
 + * @brief  Objects FIFOs APIs.
 + * @details If enabled then the objects FIFOs APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_OBJ_FIFOS                TRUE
 +
 +/**
   * @brief   Dynamic Threads APIs.
   * @details If enabled then the dynamic threads creation APIs are included
   *          in the kernel.
 @@ -310,6 +331,56 @@  /*===========================================================================*/
  /**
 + * @name Objects factory options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Objects Factory APIs.
 + * @details If enabled then the objects factory APIs are included in the
 + *          kernel.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_CFG_USE_FACTORY                  TRUE
 +
 +/**
 + * @brief   Maximum length for object names.
 + * @details If the specified length is zero then the name is stored by
 + *          pointer but this could have unintended side effects.
 + */
 +#define CH_CFG_FACTORY_MAX_NAMES_LENGTH     8
 +
 +/**
 + * @brief   Enables the registry of generic objects.
 + */
 +#define CH_CFG_FACTORY_OBJECTS_REGISTRY     TRUE
 +
 +/**
 + * @brief   Enables factory for generic buffers.
 + */
 +#define CH_CFG_FACTORY_GENERIC_BUFFERS      TRUE
 +
 +/**
 + * @brief   Enables factory for semaphores.
 + */
 +#define CH_CFG_FACTORY_SEMAPHORES           TRUE
 +
 +/**
 + * @brief   Enables factory for mailboxes.
 + */
 +#define CH_CFG_FACTORY_MAILBOXES            TRUE
 +
 +/**
 + * @brief   Enables factory for objects FIFOs.
 + */
 +#define CH_CFG_FACTORY_OBJ_FIFOS            TRUE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
   * @name Debug options
   * @{
   */
 @@ -408,6 +479,22 @@  /*===========================================================================*/
  /**
 + * @brief   System structure extension.
 + * @details User fields added to the end of the @p ch_system_t structure.
 + */
 +#define CH_CFG_SYSTEM_EXTRA_FIELDS                                          \
 +  /* Add threads custom fields here.*/
 +
 +/**
 + * @brief   System initialization hook.
 + * @details User initialization code added to the @p chSysInit() function
 + *          just before interrupts are enabled globally.
 + */
 +#define CH_CFG_SYSTEM_INIT_HOOK(tp) {                                       \
 +  /* Add threads initialization code here.*/                                \
 +}
 +
 +/**
   * @brief   Threads descriptor structure extension.
   * @details User fields added to the end of the @p thread_t structure.
   */
 @@ -416,9 +503,9 @@  /**
   * @brief   Threads initialization hook.
 - * @details User initialization code added to the @p chThdInit() API.
 + * @details User initialization code added to the @p _thread_init() function.
   *
 - * @note    It is invoked from within @p chThdInit() and implicitly from all
 + * @note    It is invoked from within @p _thread_init() and implicitly from all
   *          the threads creation APIs.
   */
  #define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \
 diff --git a/testhal/STM32/STM32F3xx/EEProm/chconf.h b/testhal/STM32/STM32F3xx/EEProm/chconf.h index 894f737..53bd676 100644 --- a/testhal/STM32/STM32F3xx/EEProm/chconf.h +++ b/testhal/STM32/STM32F3xx/EEProm/chconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
 +    ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
 @@ -52,6 +52,18 @@  #define CH_CFG_ST_FREQUENCY                 10000
  /**
 + * @brief   Time intervals data size.
 + * @note    Allowed values are 16, 32 or 64 bits.
 + */
 +#define CH_CFG_INTERVALS_SIZE               32
 +
 +/**
 + * @brief   Time types data size.
 + * @note    Allowed values are 16 or 32 bits.
 + */
 +#define CH_CFG_TIME_TYPES_SIZE              32
 +
 +/**
   * @brief   Time delta constant for the tick-less mode.
   * @note    If this value is zero then the system uses the classic
   *          periodic tick. This value represents the minimum number
 @@ -141,7 +153,7 @@   *
   * @note    The default is @p TRUE.
   */
 -#define CH_CFG_USE_TM                       TRUE
 +#define CH_CFG_USE_TM                       FALSE
  /**
   * @brief   Threads registry APIs.
 @@ -296,6 +308,15 @@  #define CH_CFG_USE_MEMPOOLS                 TRUE
  /**
 + * @brief  Objects FIFOs APIs.
 + * @details If enabled then the objects FIFOs APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_OBJ_FIFOS                TRUE
 +
 +/**
   * @brief   Dynamic Threads APIs.
   * @details If enabled then the dynamic threads creation APIs are included
   *          in the kernel.
 @@ -310,6 +331,56 @@  /*===========================================================================*/
  /**
 + * @name Objects factory options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Objects Factory APIs.
 + * @details If enabled then the objects factory APIs are included in the
 + *          kernel.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_CFG_USE_FACTORY                  TRUE
 +
 +/**
 + * @brief   Maximum length for object names.
 + * @details If the specified length is zero then the name is stored by
 + *          pointer but this could have unintended side effects.
 + */
 +#define CH_CFG_FACTORY_MAX_NAMES_LENGTH     8
 +
 +/**
 + * @brief   Enables the registry of generic objects.
 + */
 +#define CH_CFG_FACTORY_OBJECTS_REGISTRY     TRUE
 +
 +/**
 + * @brief   Enables factory for generic buffers.
 + */
 +#define CH_CFG_FACTORY_GENERIC_BUFFERS      TRUE
 +
 +/**
 + * @brief   Enables factory for semaphores.
 + */
 +#define CH_CFG_FACTORY_SEMAPHORES           TRUE
 +
 +/**
 + * @brief   Enables factory for mailboxes.
 + */
 +#define CH_CFG_FACTORY_MAILBOXES            TRUE
 +
 +/**
 + * @brief   Enables factory for objects FIFOs.
 + */
 +#define CH_CFG_FACTORY_OBJ_FIFOS            TRUE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
   * @name Debug options
   * @{
   */
 @@ -408,6 +479,22 @@  /*===========================================================================*/
  /**
 + * @brief   System structure extension.
 + * @details User fields added to the end of the @p ch_system_t structure.
 + */
 +#define CH_CFG_SYSTEM_EXTRA_FIELDS                                          \
 +  /* Add threads custom fields here.*/
 +
 +/**
 + * @brief   System initialization hook.
 + * @details User initialization code added to the @p chSysInit() function
 + *          just before interrupts are enabled globally.
 + */
 +#define CH_CFG_SYSTEM_INIT_HOOK(tp) {                                       \
 +  /* Add threads initialization code here.*/                                \
 +}
 +
 +/**
   * @brief   Threads descriptor structure extension.
   * @details User fields added to the end of the @p thread_t structure.
   */
 @@ -416,9 +503,9 @@  /**
   * @brief   Threads initialization hook.
 - * @details User initialization code added to the @p chThdInit() API.
 + * @details User initialization code added to the @p _thread_init() function.
   *
 - * @note    It is invoked from within @p chThdInit() and implicitly from all
 + * @note    It is invoked from within @p _thread_init() and implicitly from all
   *          the threads creation APIs.
   */
  #define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \
 diff --git a/testhal/STM32/STM32F3xx/TIMCAP/chconf.h b/testhal/STM32/STM32F3xx/TIMCAP/chconf.h index 894f737..53bd676 100644 --- a/testhal/STM32/STM32F3xx/TIMCAP/chconf.h +++ b/testhal/STM32/STM32F3xx/TIMCAP/chconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
 +    ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
 @@ -52,6 +52,18 @@  #define CH_CFG_ST_FREQUENCY                 10000
  /**
 + * @brief   Time intervals data size.
 + * @note    Allowed values are 16, 32 or 64 bits.
 + */
 +#define CH_CFG_INTERVALS_SIZE               32
 +
 +/**
 + * @brief   Time types data size.
 + * @note    Allowed values are 16 or 32 bits.
 + */
 +#define CH_CFG_TIME_TYPES_SIZE              32
 +
 +/**
   * @brief   Time delta constant for the tick-less mode.
   * @note    If this value is zero then the system uses the classic
   *          periodic tick. This value represents the minimum number
 @@ -141,7 +153,7 @@   *
   * @note    The default is @p TRUE.
   */
 -#define CH_CFG_USE_TM                       TRUE
 +#define CH_CFG_USE_TM                       FALSE
  /**
   * @brief   Threads registry APIs.
 @@ -296,6 +308,15 @@  #define CH_CFG_USE_MEMPOOLS                 TRUE
  /**
 + * @brief  Objects FIFOs APIs.
 + * @details If enabled then the objects FIFOs APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_OBJ_FIFOS                TRUE
 +
 +/**
   * @brief   Dynamic Threads APIs.
   * @details If enabled then the dynamic threads creation APIs are included
   *          in the kernel.
 @@ -310,6 +331,56 @@  /*===========================================================================*/
  /**
 + * @name Objects factory options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Objects Factory APIs.
 + * @details If enabled then the objects factory APIs are included in the
 + *          kernel.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_CFG_USE_FACTORY                  TRUE
 +
 +/**
 + * @brief   Maximum length for object names.
 + * @details If the specified length is zero then the name is stored by
 + *          pointer but this could have unintended side effects.
 + */
 +#define CH_CFG_FACTORY_MAX_NAMES_LENGTH     8
 +
 +/**
 + * @brief   Enables the registry of generic objects.
 + */
 +#define CH_CFG_FACTORY_OBJECTS_REGISTRY     TRUE
 +
 +/**
 + * @brief   Enables factory for generic buffers.
 + */
 +#define CH_CFG_FACTORY_GENERIC_BUFFERS      TRUE
 +
 +/**
 + * @brief   Enables factory for semaphores.
 + */
 +#define CH_CFG_FACTORY_SEMAPHORES           TRUE
 +
 +/**
 + * @brief   Enables factory for mailboxes.
 + */
 +#define CH_CFG_FACTORY_MAILBOXES            TRUE
 +
 +/**
 + * @brief   Enables factory for objects FIFOs.
 + */
 +#define CH_CFG_FACTORY_OBJ_FIFOS            TRUE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
   * @name Debug options
   * @{
   */
 @@ -408,6 +479,22 @@  /*===========================================================================*/
  /**
 + * @brief   System structure extension.
 + * @details User fields added to the end of the @p ch_system_t structure.
 + */
 +#define CH_CFG_SYSTEM_EXTRA_FIELDS                                          \
 +  /* Add threads custom fields here.*/
 +
 +/**
 + * @brief   System initialization hook.
 + * @details User initialization code added to the @p chSysInit() function
 + *          just before interrupts are enabled globally.
 + */
 +#define CH_CFG_SYSTEM_INIT_HOOK(tp) {                                       \
 +  /* Add threads initialization code here.*/                                \
 +}
 +
 +/**
   * @brief   Threads descriptor structure extension.
   * @details User fields added to the end of the @p thread_t structure.
   */
 @@ -416,9 +503,9 @@  /**
   * @brief   Threads initialization hook.
 - * @details User initialization code added to the @p chThdInit() API.
 + * @details User initialization code added to the @p _thread_init() function.
   *
 - * @note    It is invoked from within @p chThdInit() and implicitly from all
 + * @note    It is invoked from within @p _thread_init() and implicitly from all
   *          the threads creation APIs.
   */
  #define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \
 diff --git a/testhal/STM32/STM32F4xx/EICU/chconf.h b/testhal/STM32/STM32F4xx/EICU/chconf.h index 736770d..53bd676 100644 --- a/testhal/STM32/STM32F4xx/EICU/chconf.h +++ b/testhal/STM32/STM32F4xx/EICU/chconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
 +    ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
 @@ -52,6 +52,18 @@  #define CH_CFG_ST_FREQUENCY                 10000
  /**
 + * @brief   Time intervals data size.
 + * @note    Allowed values are 16, 32 or 64 bits.
 + */
 +#define CH_CFG_INTERVALS_SIZE               32
 +
 +/**
 + * @brief   Time types data size.
 + * @note    Allowed values are 16 or 32 bits.
 + */
 +#define CH_CFG_TIME_TYPES_SIZE              32
 +
 +/**
   * @brief   Time delta constant for the tick-less mode.
   * @note    If this value is zero then the system uses the classic
   *          periodic tick. This value represents the minimum number
 @@ -141,7 +153,7 @@   *
   * @note    The default is @p TRUE.
   */
 -#define CH_CFG_USE_TM                       TRUE
 +#define CH_CFG_USE_TM                       FALSE
  /**
   * @brief   Threads registry APIs.
 @@ -296,6 +308,15 @@  #define CH_CFG_USE_MEMPOOLS                 TRUE
  /**
 + * @brief  Objects FIFOs APIs.
 + * @details If enabled then the objects FIFOs APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_OBJ_FIFOS                TRUE
 +
 +/**
   * @brief   Dynamic Threads APIs.
   * @details If enabled then the dynamic threads creation APIs are included
   *          in the kernel.
 @@ -310,6 +331,56 @@  /*===========================================================================*/
  /**
 + * @name Objects factory options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Objects Factory APIs.
 + * @details If enabled then the objects factory APIs are included in the
 + *          kernel.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_CFG_USE_FACTORY                  TRUE
 +
 +/**
 + * @brief   Maximum length for object names.
 + * @details If the specified length is zero then the name is stored by
 + *          pointer but this could have unintended side effects.
 + */
 +#define CH_CFG_FACTORY_MAX_NAMES_LENGTH     8
 +
 +/**
 + * @brief   Enables the registry of generic objects.
 + */
 +#define CH_CFG_FACTORY_OBJECTS_REGISTRY     TRUE
 +
 +/**
 + * @brief   Enables factory for generic buffers.
 + */
 +#define CH_CFG_FACTORY_GENERIC_BUFFERS      TRUE
 +
 +/**
 + * @brief   Enables factory for semaphores.
 + */
 +#define CH_CFG_FACTORY_SEMAPHORES           TRUE
 +
 +/**
 + * @brief   Enables factory for mailboxes.
 + */
 +#define CH_CFG_FACTORY_MAILBOXES            TRUE
 +
 +/**
 + * @brief   Enables factory for objects FIFOs.
 + */
 +#define CH_CFG_FACTORY_OBJ_FIFOS            TRUE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
   * @name Debug options
   * @{
   */
 @@ -329,7 +400,7 @@   *
   * @note    The default is @p FALSE.
   */
 -#define CH_DBG_SYSTEM_STATE_CHECK           FALSE
 +#define CH_DBG_SYSTEM_STATE_CHECK           TRUE
  /**
   * @brief   Debug option, parameters checks.
 @@ -338,7 +409,7 @@   *
   * @note    The default is @p FALSE.
   */
 -#define CH_DBG_ENABLE_CHECKS                FALSE
 +#define CH_DBG_ENABLE_CHECKS                TRUE
  /**
   * @brief   Debug option, consistency checks.
 @@ -348,7 +419,7 @@   *
   * @note    The default is @p FALSE.
   */
 -#define CH_DBG_ENABLE_ASSERTS               FALSE
 +#define CH_DBG_ENABLE_ASSERTS               TRUE
  /**
   * @brief   Debug option, trace buffer.
 @@ -356,7 +427,7 @@   *
   * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.
   */
 -#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_DISABLED
 +#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_ALL
  /**
   * @brief   Trace buffer entries.
 @@ -375,7 +446,7 @@   * @note    The default failure mode is to halt the system with the global
   *          @p panic_msg variable set to @p NULL.
   */
 -#define CH_DBG_ENABLE_STACK_CHECK           FALSE
 +#define CH_DBG_ENABLE_STACK_CHECK           TRUE
  /**
   * @brief   Debug option, stacks initialization.
 @@ -385,7 +456,7 @@   *
   * @note    The default is @p FALSE.
   */
 -#define CH_DBG_FILL_THREADS                 FALSE
 +#define CH_DBG_FILL_THREADS                 TRUE
  /**
   * @brief   Debug option, threads profiling.
 @@ -408,6 +479,22 @@  /*===========================================================================*/
  /**
 + * @brief   System structure extension.
 + * @details User fields added to the end of the @p ch_system_t structure.
 + */
 +#define CH_CFG_SYSTEM_EXTRA_FIELDS                                          \
 +  /* Add threads custom fields here.*/
 +
 +/**
 + * @brief   System initialization hook.
 + * @details User initialization code added to the @p chSysInit() function
 + *          just before interrupts are enabled globally.
 + */
 +#define CH_CFG_SYSTEM_INIT_HOOK(tp) {                                       \
 +  /* Add threads initialization code here.*/                                \
 +}
 +
 +/**
   * @brief   Threads descriptor structure extension.
   * @details User fields added to the end of the @p thread_t structure.
   */
 @@ -416,9 +503,9 @@  /**
   * @brief   Threads initialization hook.
 - * @details User initialization code added to the @p chThdInit() API.
 + * @details User initialization code added to the @p _thread_init() function.
   *
 - * @note    It is invoked from within @p chThdInit() and implicitly from all
 + * @note    It is invoked from within @p _thread_init() and implicitly from all
   *          the threads creation APIs.
   */
  #define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \
 diff --git a/testhal/STM32/STM32F4xx/FSMC_NAND/chconf.h b/testhal/STM32/STM32F4xx/FSMC_NAND/chconf.h index cf950cd..53bd676 100644 --- a/testhal/STM32/STM32F4xx/FSMC_NAND/chconf.h +++ b/testhal/STM32/STM32F4xx/FSMC_NAND/chconf.h @@ -1,521 +1,608 @@ -/* -    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - -    Licensed 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. -*/ - -/** - * @file    templates/chconf.h - * @brief   Configuration file template. - * @details A copy of this file must be placed in each project directory, it - *          contains the application specific kernel settings. - * - * @addtogroup config - * @details Kernel related settings and hooks. - * @{ - */ - -#ifndef CHCONF_H -#define CHCONF_H - -#define _CHIBIOS_RT_CONF_ -#define _CHIBIOS_RT_CONF_VER_5_0_ - -/*===========================================================================*/ -/** - * @name System timers settings - * @{ - */ -/*===========================================================================*/ - -/** - * @brief   System time counter resolution. - * @note    Allowed values are 16 or 32 bits. - */ -#define CH_CFG_ST_RESOLUTION                32 - -/** - * @brief   System tick frequency. - * @details Frequency of the system timer that drives the system ticks. This - *          setting also defines the system tick time unit. - */ -#define CH_CFG_ST_FREQUENCY                 10000 - -/** - * @brief   Time delta constant for the tick-less mode. - * @note    If this value is zero then the system uses the classic - *          periodic tick. This value represents the minimum number - *          of ticks that is safe to specify in a timeout directive. - *          The value one is not valid, timeouts are rounded up to - *          this value. - */ -#define CH_CFG_ST_TIMEDELTA                 2 - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel parameters and options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief   Round robin interval. - * @details This constant is the number of system ticks allowed for the - *          threads before preemption occurs. Setting this value to zero - *          disables the preemption for threads with equal priority and the - *          round robin becomes cooperative. Note that higher priority - *          threads can still preempt, the kernel is always preemptive. - * @note    Disabling the round robin preemption makes the kernel more compact - *          and generally faster. - * @note    The round robin preemption is not supported in tickless mode and - *          must be set to zero in that case. - */ -#define CH_CFG_TIME_QUANTUM                 0 - -/** - * @brief   Managed RAM size. - * @details Size of the RAM area to be managed by the OS. If set to zero - *          then the whole available RAM is used. The core memory is made - *          available to the heap allocator and/or can be used directly through - *          the simplified core memory allocator. - * - * @note    In order to let the OS manage the whole RAM the linker script must - *          provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note    Requires @p CH_CFG_USE_MEMCORE. - */ -#define CH_CFG_MEMCORE_SIZE                 0 - -/** - * @brief   Idle thread automatic spawn suppression. - * @details When this option is activated the function @p chSysInit() - *          does not spawn the idle thread. The application @p main() - *          function becomes the idle thread and must implement an - *          infinite loop. - */ -#define CH_CFG_NO_IDLE_THREAD               FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Performance options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief   OS optimization. - * @details If enabled then time efficient rather than space efficient code - *          is used when two possible implementations exist. - * - * @note    This is not related to the compiler optimization options. - * @note    The default is @p TRUE. - */ -#define CH_CFG_OPTIMIZE_SPEED               TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Subsystem options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief   Time Measurement APIs. - * @details If enabled then the time measurement APIs are included in - *          the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_TM                       TRUE - -/** - * @brief   Threads registry APIs. - * @details If enabled then the registry APIs are included in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_REGISTRY                 TRUE - -/** - * @brief   Threads synchronization APIs. - * @details If enabled then the @p chThdWait() function is included in - *          the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_WAITEXIT                 TRUE - -/** - * @brief   Semaphores APIs. - * @details If enabled then the Semaphores APIs are included in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_SEMAPHORES               TRUE - -/** - * @brief   Semaphores queuing mode. - * @details If enabled then the threads are enqueued on semaphores by - *          priority rather than in FIFO order. - * - * @note    The default is @p FALSE. Enable this if you have special - *          requirements. - * @note    Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_SEMAPHORES_PRIORITY      FALSE - -/** - * @brief   Mutexes APIs. - * @details If enabled then the mutexes APIs are included in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_MUTEXES                  TRUE - -/** - * @brief   Enables recursive behavior on mutexes. - * @note    Recursive mutexes are heavier and have an increased - *          memory footprint. - * - * @note    The default is @p FALSE. - * @note    Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_MUTEXES_RECURSIVE        FALSE - -/** - * @brief   Conditional Variables APIs. - * @details If enabled then the conditional variables APIs are included - *          in the kernel. - * - * @note    The default is @p TRUE. - * @note    Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_CONDVARS                 TRUE - -/** - * @brief   Conditional Variables APIs with timeout. - * @details If enabled then the conditional variables APIs with timeout - *          specification are included in the kernel. - * - * @note    The default is @p TRUE. - * @note    Requires @p CH_CFG_USE_CONDVARS. - */ -#define CH_CFG_USE_CONDVARS_TIMEOUT         TRUE - -/** - * @brief   Events Flags APIs. - * @details If enabled then the event flags APIs are included in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_EVENTS                   TRUE - -/** - * @brief   Events Flags APIs with timeout. - * @details If enabled then the events APIs with timeout specification - *          are included in the kernel. - * - * @note    The default is @p TRUE. - * @note    Requires @p CH_CFG_USE_EVENTS. - */ -#define CH_CFG_USE_EVENTS_TIMEOUT           TRUE - -/** - * @brief   Synchronous Messages APIs. - * @details If enabled then the synchronous messages APIs are included - *          in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_MESSAGES                 TRUE - -/** - * @brief   Synchronous Messages queuing mode. - * @details If enabled then messages are served by priority rather than in - *          FIFO order. - * - * @note    The default is @p FALSE. Enable this if you have special - *          requirements. - * @note    Requires @p CH_CFG_USE_MESSAGES. - */ -#define CH_CFG_USE_MESSAGES_PRIORITY        FALSE - -/** - * @brief   Mailboxes APIs. - * @details If enabled then the asynchronous messages (mailboxes) APIs are - *          included in the kernel. - * - * @note    The default is @p TRUE. - * @note    Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_MAILBOXES                TRUE - -/** - * @brief   Core Memory Manager APIs. - * @details If enabled then the core memory manager APIs are included - *          in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_MEMCORE                  TRUE - -/** - * @brief   Heap Allocator APIs. - * @details If enabled then the memory heap allocator APIs are included - *          in the kernel. - * - * @note    The default is @p TRUE. - * @note    Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or - *          @p CH_CFG_USE_SEMAPHORES. - * @note    Mutexes are recommended. - */ -#define CH_CFG_USE_HEAP                     TRUE - -/** - * @brief   Memory Pools Allocator APIs. - * @details If enabled then the memory pools allocator APIs are included - *          in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_MEMPOOLS                 TRUE - -/** - * @brief   Dynamic Threads APIs. - * @details If enabled then the dynamic threads creation APIs are included - *          in the kernel. - * - * @note    The default is @p TRUE. - * @note    Requires @p CH_CFG_USE_WAITEXIT. - * @note    Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. - */ -#define CH_CFG_USE_DYNAMIC                  TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Debug options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief   Debug option, kernel statistics. - * - * @note    The default is @p FALSE. - */ -#define CH_DBG_STATISTICS                   FALSE - -/** - * @brief   Debug option, system state check. - * @details If enabled the correct call protocol for system APIs is checked - *          at runtime. - * - * @note    The default is @p FALSE. - */ -#define CH_DBG_SYSTEM_STATE_CHECK           FALSE - -/** - * @brief   Debug option, parameters checks. - * @details If enabled then the checks on the API functions input - *          parameters are activated. - * - * @note    The default is @p FALSE. - */ -#define CH_DBG_ENABLE_CHECKS                FALSE - -/** - * @brief   Debug option, consistency checks. - * @details If enabled then all the assertions in the kernel code are - *          activated. This includes consistency checks inside the kernel, - *          runtime anomalies and port-defined checks. - * - * @note    The default is @p FALSE. - */ -#define CH_DBG_ENABLE_ASSERTS               FALSE - -/** - * @brief   Debug option, trace buffer. - * @details If enabled then the trace buffer is activated. - * - * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED. - */ -#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_DISABLED - -/** - * @brief   Trace buffer entries. - * @note    The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is - *          different from @p CH_DBG_TRACE_MASK_DISABLED. - */ -#define CH_DBG_TRACE_BUFFER_SIZE            128 - -/** - * @brief   Debug option, stack checks. - * @details If enabled then a runtime stack check is performed. - * - * @note    The default is @p FALSE. - * @note    The stack check is performed in a architecture/port dependent way. - *          It may not be implemented or some ports. - * @note    The default failure mode is to halt the system with the global - *          @p panic_msg variable set to @p NULL. - */ -#define CH_DBG_ENABLE_STACK_CHECK           FALSE - -/** - * @brief   Debug option, stacks initialization. - * @details If enabled then the threads working area is filled with a byte - *          value when a thread is created. This can be useful for the - *          runtime measurement of the used stack. - * - * @note    The default is @p FALSE. - */ -#define CH_DBG_FILL_THREADS                 FALSE - -/** - * @brief   Debug option, threads profiling. - * @details If enabled then a field is added to the @p thread_t structure that - *          counts the system ticks occurred while executing the thread. - * - * @note    The default is @p FALSE. - * @note    This debug option is not currently compatible with the - *          tickless mode. - */ -#define CH_DBG_THREADS_PROFILING            FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel hooks - * @{ - */ -/*===========================================================================*/ - -/** - * @brief   Threads descriptor structure extension. - * @details User fields added to the end of the @p thread_t structure. - */ -#define CH_CFG_THREAD_EXTRA_FIELDS                                          \ -  /* Add threads custom fields here.*/ - -/** - * @brief   Threads initialization hook. - * @details User initialization code added to the @p chThdInit() API. - * - * @note    It is invoked from within @p chThdInit() and implicitly from all - *          the threads creation APIs. - */ -#define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \ -  /* Add threads initialization code here.*/                                \ -} - -/** - * @brief   Threads finalization hook. - * @details User finalization code added to the @p chThdExit() API. - */ -#define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \ -  /* Add threads finalization code here.*/                                  \ -} - -/** - * @brief   Context switch hook. - * @details This hook is invoked just before switching between threads. - */ -#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) {                              \ -  /* Context switch code here.*/                                            \ -} - -/** - * @brief   ISR enter hook. - */ -#define CH_CFG_IRQ_PROLOGUE_HOOK() {                                        \ -  /* IRQ prologue code here.*/                                              \ -} - -/** - * @brief   ISR exit hook. - */ -#define CH_CFG_IRQ_EPILOGUE_HOOK() {                                        \ -  /* IRQ epilogue code here.*/                                              \ -} - -/** - * @brief   Idle thread enter hook. - * @note    This hook is invoked within a critical zone, no OS functions - *          should be invoked from here. - * @note    This macro can be used to activate a power saving mode. - */ -#define CH_CFG_IDLE_ENTER_HOOK() {                                          \ -  /* Idle-enter code here.*/                                                \ -} - -/** - * @brief   Idle thread leave hook. - * @note    This hook is invoked within a critical zone, no OS functions - *          should be invoked from here. - * @note    This macro can be used to deactivate a power saving mode. - */ -#define CH_CFG_IDLE_LEAVE_HOOK() {                                          \ -  /* Idle-leave code here.*/                                                \ -} - -/** - * @brief   Idle Loop hook. - * @details This hook is continuously invoked by the idle thread loop. - */ -#define CH_CFG_IDLE_LOOP_HOOK() {                                           \ -  /* Idle loop code here.*/                                                 \ -} - -/** - * @brief   System tick event hook. - * @details This hook is invoked in the system tick handler immediately - *          after processing the virtual timers queue. - */ -#define CH_CFG_SYSTEM_TICK_HOOK() {                                         \ -  /* System tick event code here.*/                                         \ -} - -/** - * @brief   System halt hook. - * @details This hook is invoked in case to a system halting error before - *          the system is halted. - */ -#define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \ -  /* System halt code here.*/                                               \ -} - -/** - * @brief   Trace hook. - * @details This hook is invoked each time a new record is written in the - *          trace buffer. - */ -#define CH_CFG_TRACE_HOOK(tep) {                                            \ -  /* Trace code here.*/                                                     \ -} - -/** @} */ - -/*===========================================================================*/ -/* Port-specific settings (override port settings defaulted in chcore.h).    */ -/*===========================================================================*/ - -#endif  /* CHCONF_H */ - -/** @} */ +/*
 +    ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
 +
 +    Licensed 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.
 +*/
 +
 +/**
 + * @file    templates/chconf.h
 + * @brief   Configuration file template.
 + * @details A copy of this file must be placed in each project directory, it
 + *          contains the application specific kernel settings.
 + *
 + * @addtogroup config
 + * @details Kernel related settings and hooks.
 + * @{
 + */
 +
 +#ifndef CHCONF_H
 +#define CHCONF_H
 +
 +#define _CHIBIOS_RT_CONF_
 +#define _CHIBIOS_RT_CONF_VER_5_0_
 +
 +/*===========================================================================*/
 +/**
 + * @name System timers settings
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   System time counter resolution.
 + * @note    Allowed values are 16 or 32 bits.
 + */
 +#define CH_CFG_ST_RESOLUTION                32
 +
 +/**
 + * @brief   System tick frequency.
 + * @details Frequency of the system timer that drives the system ticks. This
 + *          setting also defines the system tick time unit.
 + */
 +#define CH_CFG_ST_FREQUENCY                 10000
 +
 +/**
 + * @brief   Time intervals data size.
 + * @note    Allowed values are 16, 32 or 64 bits.
 + */
 +#define CH_CFG_INTERVALS_SIZE               32
 +
 +/**
 + * @brief   Time types data size.
 + * @note    Allowed values are 16 or 32 bits.
 + */
 +#define CH_CFG_TIME_TYPES_SIZE              32
 +
 +/**
 + * @brief   Time delta constant for the tick-less mode.
 + * @note    If this value is zero then the system uses the classic
 + *          periodic tick. This value represents the minimum number
 + *          of ticks that is safe to specify in a timeout directive.
 + *          The value one is not valid, timeouts are rounded up to
 + *          this value.
 + */
 +#define CH_CFG_ST_TIMEDELTA                 2
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
 + * @name Kernel parameters and options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Round robin interval.
 + * @details This constant is the number of system ticks allowed for the
 + *          threads before preemption occurs. Setting this value to zero
 + *          disables the preemption for threads with equal priority and the
 + *          round robin becomes cooperative. Note that higher priority
 + *          threads can still preempt, the kernel is always preemptive.
 + * @note    Disabling the round robin preemption makes the kernel more compact
 + *          and generally faster.
 + * @note    The round robin preemption is not supported in tickless mode and
 + *          must be set to zero in that case.
 + */
 +#define CH_CFG_TIME_QUANTUM                 0
 +
 +/**
 + * @brief   Managed RAM size.
 + * @details Size of the RAM area to be managed by the OS. If set to zero
 + *          then the whole available RAM is used. The core memory is made
 + *          available to the heap allocator and/or can be used directly through
 + *          the simplified core memory allocator.
 + *
 + * @note    In order to let the OS manage the whole RAM the linker script must
 + *          provide the @p __heap_base__ and @p __heap_end__ symbols.
 + * @note    Requires @p CH_CFG_USE_MEMCORE.
 + */
 +#define CH_CFG_MEMCORE_SIZE                 0
 +
 +/**
 + * @brief   Idle thread automatic spawn suppression.
 + * @details When this option is activated the function @p chSysInit()
 + *          does not spawn the idle thread. The application @p main()
 + *          function becomes the idle thread and must implement an
 + *          infinite loop.
 + */
 +#define CH_CFG_NO_IDLE_THREAD               FALSE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
 + * @name Performance options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   OS optimization.
 + * @details If enabled then time efficient rather than space efficient code
 + *          is used when two possible implementations exist.
 + *
 + * @note    This is not related to the compiler optimization options.
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_OPTIMIZE_SPEED               TRUE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
 + * @name Subsystem options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Time Measurement APIs.
 + * @details If enabled then the time measurement APIs are included in
 + *          the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_TM                       FALSE
 +
 +/**
 + * @brief   Threads registry APIs.
 + * @details If enabled then the registry APIs are included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_REGISTRY                 TRUE
 +
 +/**
 + * @brief   Threads synchronization APIs.
 + * @details If enabled then the @p chThdWait() function is included in
 + *          the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_WAITEXIT                 TRUE
 +
 +/**
 + * @brief   Semaphores APIs.
 + * @details If enabled then the Semaphores APIs are included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_SEMAPHORES               TRUE
 +
 +/**
 + * @brief   Semaphores queuing mode.
 + * @details If enabled then the threads are enqueued on semaphores by
 + *          priority rather than in FIFO order.
 + *
 + * @note    The default is @p FALSE. Enable this if you have special
 + *          requirements.
 + * @note    Requires @p CH_CFG_USE_SEMAPHORES.
 + */
 +#define CH_CFG_USE_SEMAPHORES_PRIORITY      FALSE
 +
 +/**
 + * @brief   Mutexes APIs.
 + * @details If enabled then the mutexes APIs are included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_MUTEXES                  TRUE
 +
 +/**
 + * @brief   Enables recursive behavior on mutexes.
 + * @note    Recursive mutexes are heavier and have an increased
 + *          memory footprint.
 + *
 + * @note    The default is @p FALSE.
 + * @note    Requires @p CH_CFG_USE_MUTEXES.
 + */
 +#define CH_CFG_USE_MUTEXES_RECURSIVE        FALSE
 +
 +/**
 + * @brief   Conditional Variables APIs.
 + * @details If enabled then the conditional variables APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + * @note    Requires @p CH_CFG_USE_MUTEXES.
 + */
 +#define CH_CFG_USE_CONDVARS                 TRUE
 +
 +/**
 + * @brief   Conditional Variables APIs with timeout.
 + * @details If enabled then the conditional variables APIs with timeout
 + *          specification are included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + * @note    Requires @p CH_CFG_USE_CONDVARS.
 + */
 +#define CH_CFG_USE_CONDVARS_TIMEOUT         TRUE
 +
 +/**
 + * @brief   Events Flags APIs.
 + * @details If enabled then the event flags APIs are included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_EVENTS                   TRUE
 +
 +/**
 + * @brief   Events Flags APIs with timeout.
 + * @details If enabled then the events APIs with timeout specification
 + *          are included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + * @note    Requires @p CH_CFG_USE_EVENTS.
 + */
 +#define CH_CFG_USE_EVENTS_TIMEOUT           TRUE
 +
 +/**
 + * @brief   Synchronous Messages APIs.
 + * @details If enabled then the synchronous messages APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_MESSAGES                 TRUE
 +
 +/**
 + * @brief   Synchronous Messages queuing mode.
 + * @details If enabled then messages are served by priority rather than in
 + *          FIFO order.
 + *
 + * @note    The default is @p FALSE. Enable this if you have special
 + *          requirements.
 + * @note    Requires @p CH_CFG_USE_MESSAGES.
 + */
 +#define CH_CFG_USE_MESSAGES_PRIORITY        FALSE
 +
 +/**
 + * @brief   Mailboxes APIs.
 + * @details If enabled then the asynchronous messages (mailboxes) APIs are
 + *          included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + * @note    Requires @p CH_CFG_USE_SEMAPHORES.
 + */
 +#define CH_CFG_USE_MAILBOXES                TRUE
 +
 +/**
 + * @brief   Core Memory Manager APIs.
 + * @details If enabled then the core memory manager APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_MEMCORE                  TRUE
 +
 +/**
 + * @brief   Heap Allocator APIs.
 + * @details If enabled then the memory heap allocator APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + * @note    Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
 + *          @p CH_CFG_USE_SEMAPHORES.
 + * @note    Mutexes are recommended.
 + */
 +#define CH_CFG_USE_HEAP                     TRUE
 +
 +/**
 + * @brief   Memory Pools Allocator APIs.
 + * @details If enabled then the memory pools allocator APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_MEMPOOLS                 TRUE
 +
 +/**
 + * @brief  Objects FIFOs APIs.
 + * @details If enabled then the objects FIFOs APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_OBJ_FIFOS                TRUE
 +
 +/**
 + * @brief   Dynamic Threads APIs.
 + * @details If enabled then the dynamic threads creation APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + * @note    Requires @p CH_CFG_USE_WAITEXIT.
 + * @note    Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
 + */
 +#define CH_CFG_USE_DYNAMIC                  TRUE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
 + * @name Objects factory options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Objects Factory APIs.
 + * @details If enabled then the objects factory APIs are included in the
 + *          kernel.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_CFG_USE_FACTORY                  TRUE
 +
 +/**
 + * @brief   Maximum length for object names.
 + * @details If the specified length is zero then the name is stored by
 + *          pointer but this could have unintended side effects.
 + */
 +#define CH_CFG_FACTORY_MAX_NAMES_LENGTH     8
 +
 +/**
 + * @brief   Enables the registry of generic objects.
 + */
 +#define CH_CFG_FACTORY_OBJECTS_REGISTRY     TRUE
 +
 +/**
 + * @brief   Enables factory for generic buffers.
 + */
 +#define CH_CFG_FACTORY_GENERIC_BUFFERS      TRUE
 +
 +/**
 + * @brief   Enables factory for semaphores.
 + */
 +#define CH_CFG_FACTORY_SEMAPHORES           TRUE
 +
 +/**
 + * @brief   Enables factory for mailboxes.
 + */
 +#define CH_CFG_FACTORY_MAILBOXES            TRUE
 +
 +/**
 + * @brief   Enables factory for objects FIFOs.
 + */
 +#define CH_CFG_FACTORY_OBJ_FIFOS            TRUE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
 + * @name Debug options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Debug option, kernel statistics.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_DBG_STATISTICS                   FALSE
 +
 +/**
 + * @brief   Debug option, system state check.
 + * @details If enabled the correct call protocol for system APIs is checked
 + *          at runtime.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_DBG_SYSTEM_STATE_CHECK           TRUE
 +
 +/**
 + * @brief   Debug option, parameters checks.
 + * @details If enabled then the checks on the API functions input
 + *          parameters are activated.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_DBG_ENABLE_CHECKS                TRUE
 +
 +/**
 + * @brief   Debug option, consistency checks.
 + * @details If enabled then all the assertions in the kernel code are
 + *          activated. This includes consistency checks inside the kernel,
 + *          runtime anomalies and port-defined checks.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_DBG_ENABLE_ASSERTS               TRUE
 +
 +/**
 + * @brief   Debug option, trace buffer.
 + * @details If enabled then the trace buffer is activated.
 + *
 + * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.
 + */
 +#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_ALL
 +
 +/**
 + * @brief   Trace buffer entries.
 + * @note    The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
 + *          different from @p CH_DBG_TRACE_MASK_DISABLED.
 + */
 +#define CH_DBG_TRACE_BUFFER_SIZE            128
 +
 +/**
 + * @brief   Debug option, stack checks.
 + * @details If enabled then a runtime stack check is performed.
 + *
 + * @note    The default is @p FALSE.
 + * @note    The stack check is performed in a architecture/port dependent way.
 + *          It may not be implemented or some ports.
 + * @note    The default failure mode is to halt the system with the global
 + *          @p panic_msg variable set to @p NULL.
 + */
 +#define CH_DBG_ENABLE_STACK_CHECK           TRUE
 +
 +/**
 + * @brief   Debug option, stacks initialization.
 + * @details If enabled then the threads working area is filled with a byte
 + *          value when a thread is created. This can be useful for the
 + *          runtime measurement of the used stack.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_DBG_FILL_THREADS                 TRUE
 +
 +/**
 + * @brief   Debug option, threads profiling.
 + * @details If enabled then a field is added to the @p thread_t structure that
 + *          counts the system ticks occurred while executing the thread.
 + *
 + * @note    The default is @p FALSE.
 + * @note    This debug option is not currently compatible with the
 + *          tickless mode.
 + */
 +#define CH_DBG_THREADS_PROFILING            FALSE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
 + * @name Kernel hooks
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   System structure extension.
 + * @details User fields added to the end of the @p ch_system_t structure.
 + */
 +#define CH_CFG_SYSTEM_EXTRA_FIELDS                                          \
 +  /* Add threads custom fields here.*/
 +
 +/**
 + * @brief   System initialization hook.
 + * @details User initialization code added to the @p chSysInit() function
 + *          just before interrupts are enabled globally.
 + */
 +#define CH_CFG_SYSTEM_INIT_HOOK(tp) {                                       \
 +  /* Add threads initialization code here.*/                                \
 +}
 +
 +/**
 + * @brief   Threads descriptor structure extension.
 + * @details User fields added to the end of the @p thread_t structure.
 + */
 +#define CH_CFG_THREAD_EXTRA_FIELDS                                          \
 +  /* Add threads custom fields here.*/
 +
 +/**
 + * @brief   Threads initialization hook.
 + * @details User initialization code added to the @p _thread_init() function.
 + *
 + * @note    It is invoked from within @p _thread_init() and implicitly from all
 + *          the threads creation APIs.
 + */
 +#define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \
 +  /* Add threads initialization code here.*/                                \
 +}
 +
 +/**
 + * @brief   Threads finalization hook.
 + * @details User finalization code added to the @p chThdExit() API.
 + */
 +#define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \
 +  /* Add threads finalization code here.*/                                  \
 +}
 +
 +/**
 + * @brief   Context switch hook.
 + * @details This hook is invoked just before switching between threads.
 + */
 +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) {                              \
 +  /* Context switch code here.*/                                            \
 +}
 +
 +/**
 + * @brief   ISR enter hook.
 + */
 +#define CH_CFG_IRQ_PROLOGUE_HOOK() {                                        \
 +  /* IRQ prologue code here.*/                                              \
 +}
 +
 +/**
 + * @brief   ISR exit hook.
 + */
 +#define CH_CFG_IRQ_EPILOGUE_HOOK() {                                        \
 +  /* IRQ epilogue code here.*/                                              \
 +}
 +
 +/**
 + * @brief   Idle thread enter hook.
 + * @note    This hook is invoked within a critical zone, no OS functions
 + *          should be invoked from here.
 + * @note    This macro can be used to activate a power saving mode.
 + */
 +#define CH_CFG_IDLE_ENTER_HOOK() {                                          \
 +  /* Idle-enter code here.*/                                                \
 +}
 +
 +/**
 + * @brief   Idle thread leave hook.
 + * @note    This hook is invoked within a critical zone, no OS functions
 + *          should be invoked from here.
 + * @note    This macro can be used to deactivate a power saving mode.
 + */
 +#define CH_CFG_IDLE_LEAVE_HOOK() {                                          \
 +  /* Idle-leave code here.*/                                                \
 +}
 +
 +/**
 + * @brief   Idle Loop hook.
 + * @details This hook is continuously invoked by the idle thread loop.
 + */
 +#define CH_CFG_IDLE_LOOP_HOOK() {                                           \
 +  /* Idle loop code here.*/                                                 \
 +}
 +
 +/**
 + * @brief   System tick event hook.
 + * @details This hook is invoked in the system tick handler immediately
 + *          after processing the virtual timers queue.
 + */
 +#define CH_CFG_SYSTEM_TICK_HOOK() {                                         \
 +  /* System tick event code here.*/                                         \
 +}
 +
 +/**
 + * @brief   System halt hook.
 + * @details This hook is invoked in case to a system halting error before
 + *          the system is halted.
 + */
 +#define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \
 +  /* System halt code here.*/                                               \
 +}
 +
 +/**
 + * @brief   Trace hook.
 + * @details This hook is invoked each time a new record is written in the
 + *          trace buffer.
 + */
 +#define CH_CFG_TRACE_HOOK(tep) {                                            \
 +  /* Trace code here.*/                                                     \
 +}
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/* Port-specific settings (override port settings defaulted in chcore.h).    */
 +/*===========================================================================*/
 +
 +#endif  /* CHCONF_H */
 +
 +/** @} */
 diff --git a/testhal/STM32/STM32F4xx/FSMC_SDRAM/chconf.h b/testhal/STM32/STM32F4xx/FSMC_SDRAM/chconf.h index cf950cd..53bd676 100644 --- a/testhal/STM32/STM32F4xx/FSMC_SDRAM/chconf.h +++ b/testhal/STM32/STM32F4xx/FSMC_SDRAM/chconf.h @@ -1,521 +1,608 @@ -/* -    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - -    Licensed 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. -*/ - -/** - * @file    templates/chconf.h - * @brief   Configuration file template. - * @details A copy of this file must be placed in each project directory, it - *          contains the application specific kernel settings. - * - * @addtogroup config - * @details Kernel related settings and hooks. - * @{ - */ - -#ifndef CHCONF_H -#define CHCONF_H - -#define _CHIBIOS_RT_CONF_ -#define _CHIBIOS_RT_CONF_VER_5_0_ - -/*===========================================================================*/ -/** - * @name System timers settings - * @{ - */ -/*===========================================================================*/ - -/** - * @brief   System time counter resolution. - * @note    Allowed values are 16 or 32 bits. - */ -#define CH_CFG_ST_RESOLUTION                32 - -/** - * @brief   System tick frequency. - * @details Frequency of the system timer that drives the system ticks. This - *          setting also defines the system tick time unit. - */ -#define CH_CFG_ST_FREQUENCY                 10000 - -/** - * @brief   Time delta constant for the tick-less mode. - * @note    If this value is zero then the system uses the classic - *          periodic tick. This value represents the minimum number - *          of ticks that is safe to specify in a timeout directive. - *          The value one is not valid, timeouts are rounded up to - *          this value. - */ -#define CH_CFG_ST_TIMEDELTA                 2 - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel parameters and options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief   Round robin interval. - * @details This constant is the number of system ticks allowed for the - *          threads before preemption occurs. Setting this value to zero - *          disables the preemption for threads with equal priority and the - *          round robin becomes cooperative. Note that higher priority - *          threads can still preempt, the kernel is always preemptive. - * @note    Disabling the round robin preemption makes the kernel more compact - *          and generally faster. - * @note    The round robin preemption is not supported in tickless mode and - *          must be set to zero in that case. - */ -#define CH_CFG_TIME_QUANTUM                 0 - -/** - * @brief   Managed RAM size. - * @details Size of the RAM area to be managed by the OS. If set to zero - *          then the whole available RAM is used. The core memory is made - *          available to the heap allocator and/or can be used directly through - *          the simplified core memory allocator. - * - * @note    In order to let the OS manage the whole RAM the linker script must - *          provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note    Requires @p CH_CFG_USE_MEMCORE. - */ -#define CH_CFG_MEMCORE_SIZE                 0 - -/** - * @brief   Idle thread automatic spawn suppression. - * @details When this option is activated the function @p chSysInit() - *          does not spawn the idle thread. The application @p main() - *          function becomes the idle thread and must implement an - *          infinite loop. - */ -#define CH_CFG_NO_IDLE_THREAD               FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Performance options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief   OS optimization. - * @details If enabled then time efficient rather than space efficient code - *          is used when two possible implementations exist. - * - * @note    This is not related to the compiler optimization options. - * @note    The default is @p TRUE. - */ -#define CH_CFG_OPTIMIZE_SPEED               TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Subsystem options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief   Time Measurement APIs. - * @details If enabled then the time measurement APIs are included in - *          the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_TM                       TRUE - -/** - * @brief   Threads registry APIs. - * @details If enabled then the registry APIs are included in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_REGISTRY                 TRUE - -/** - * @brief   Threads synchronization APIs. - * @details If enabled then the @p chThdWait() function is included in - *          the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_WAITEXIT                 TRUE - -/** - * @brief   Semaphores APIs. - * @details If enabled then the Semaphores APIs are included in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_SEMAPHORES               TRUE - -/** - * @brief   Semaphores queuing mode. - * @details If enabled then the threads are enqueued on semaphores by - *          priority rather than in FIFO order. - * - * @note    The default is @p FALSE. Enable this if you have special - *          requirements. - * @note    Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_SEMAPHORES_PRIORITY      FALSE - -/** - * @brief   Mutexes APIs. - * @details If enabled then the mutexes APIs are included in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_MUTEXES                  TRUE - -/** - * @brief   Enables recursive behavior on mutexes. - * @note    Recursive mutexes are heavier and have an increased - *          memory footprint. - * - * @note    The default is @p FALSE. - * @note    Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_MUTEXES_RECURSIVE        FALSE - -/** - * @brief   Conditional Variables APIs. - * @details If enabled then the conditional variables APIs are included - *          in the kernel. - * - * @note    The default is @p TRUE. - * @note    Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_CONDVARS                 TRUE - -/** - * @brief   Conditional Variables APIs with timeout. - * @details If enabled then the conditional variables APIs with timeout - *          specification are included in the kernel. - * - * @note    The default is @p TRUE. - * @note    Requires @p CH_CFG_USE_CONDVARS. - */ -#define CH_CFG_USE_CONDVARS_TIMEOUT         TRUE - -/** - * @brief   Events Flags APIs. - * @details If enabled then the event flags APIs are included in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_EVENTS                   TRUE - -/** - * @brief   Events Flags APIs with timeout. - * @details If enabled then the events APIs with timeout specification - *          are included in the kernel. - * - * @note    The default is @p TRUE. - * @note    Requires @p CH_CFG_USE_EVENTS. - */ -#define CH_CFG_USE_EVENTS_TIMEOUT           TRUE - -/** - * @brief   Synchronous Messages APIs. - * @details If enabled then the synchronous messages APIs are included - *          in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_MESSAGES                 TRUE - -/** - * @brief   Synchronous Messages queuing mode. - * @details If enabled then messages are served by priority rather than in - *          FIFO order. - * - * @note    The default is @p FALSE. Enable this if you have special - *          requirements. - * @note    Requires @p CH_CFG_USE_MESSAGES. - */ -#define CH_CFG_USE_MESSAGES_PRIORITY        FALSE - -/** - * @brief   Mailboxes APIs. - * @details If enabled then the asynchronous messages (mailboxes) APIs are - *          included in the kernel. - * - * @note    The default is @p TRUE. - * @note    Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_MAILBOXES                TRUE - -/** - * @brief   Core Memory Manager APIs. - * @details If enabled then the core memory manager APIs are included - *          in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_MEMCORE                  TRUE - -/** - * @brief   Heap Allocator APIs. - * @details If enabled then the memory heap allocator APIs are included - *          in the kernel. - * - * @note    The default is @p TRUE. - * @note    Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or - *          @p CH_CFG_USE_SEMAPHORES. - * @note    Mutexes are recommended. - */ -#define CH_CFG_USE_HEAP                     TRUE - -/** - * @brief   Memory Pools Allocator APIs. - * @details If enabled then the memory pools allocator APIs are included - *          in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_MEMPOOLS                 TRUE - -/** - * @brief   Dynamic Threads APIs. - * @details If enabled then the dynamic threads creation APIs are included - *          in the kernel. - * - * @note    The default is @p TRUE. - * @note    Requires @p CH_CFG_USE_WAITEXIT. - * @note    Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. - */ -#define CH_CFG_USE_DYNAMIC                  TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Debug options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief   Debug option, kernel statistics. - * - * @note    The default is @p FALSE. - */ -#define CH_DBG_STATISTICS                   FALSE - -/** - * @brief   Debug option, system state check. - * @details If enabled the correct call protocol for system APIs is checked - *          at runtime. - * - * @note    The default is @p FALSE. - */ -#define CH_DBG_SYSTEM_STATE_CHECK           FALSE - -/** - * @brief   Debug option, parameters checks. - * @details If enabled then the checks on the API functions input - *          parameters are activated. - * - * @note    The default is @p FALSE. - */ -#define CH_DBG_ENABLE_CHECKS                FALSE - -/** - * @brief   Debug option, consistency checks. - * @details If enabled then all the assertions in the kernel code are - *          activated. This includes consistency checks inside the kernel, - *          runtime anomalies and port-defined checks. - * - * @note    The default is @p FALSE. - */ -#define CH_DBG_ENABLE_ASSERTS               FALSE - -/** - * @brief   Debug option, trace buffer. - * @details If enabled then the trace buffer is activated. - * - * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED. - */ -#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_DISABLED - -/** - * @brief   Trace buffer entries. - * @note    The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is - *          different from @p CH_DBG_TRACE_MASK_DISABLED. - */ -#define CH_DBG_TRACE_BUFFER_SIZE            128 - -/** - * @brief   Debug option, stack checks. - * @details If enabled then a runtime stack check is performed. - * - * @note    The default is @p FALSE. - * @note    The stack check is performed in a architecture/port dependent way. - *          It may not be implemented or some ports. - * @note    The default failure mode is to halt the system with the global - *          @p panic_msg variable set to @p NULL. - */ -#define CH_DBG_ENABLE_STACK_CHECK           FALSE - -/** - * @brief   Debug option, stacks initialization. - * @details If enabled then the threads working area is filled with a byte - *          value when a thread is created. This can be useful for the - *          runtime measurement of the used stack. - * - * @note    The default is @p FALSE. - */ -#define CH_DBG_FILL_THREADS                 FALSE - -/** - * @brief   Debug option, threads profiling. - * @details If enabled then a field is added to the @p thread_t structure that - *          counts the system ticks occurred while executing the thread. - * - * @note    The default is @p FALSE. - * @note    This debug option is not currently compatible with the - *          tickless mode. - */ -#define CH_DBG_THREADS_PROFILING            FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel hooks - * @{ - */ -/*===========================================================================*/ - -/** - * @brief   Threads descriptor structure extension. - * @details User fields added to the end of the @p thread_t structure. - */ -#define CH_CFG_THREAD_EXTRA_FIELDS                                          \ -  /* Add threads custom fields here.*/ - -/** - * @brief   Threads initialization hook. - * @details User initialization code added to the @p chThdInit() API. - * - * @note    It is invoked from within @p chThdInit() and implicitly from all - *          the threads creation APIs. - */ -#define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \ -  /* Add threads initialization code here.*/                                \ -} - -/** - * @brief   Threads finalization hook. - * @details User finalization code added to the @p chThdExit() API. - */ -#define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \ -  /* Add threads finalization code here.*/                                  \ -} - -/** - * @brief   Context switch hook. - * @details This hook is invoked just before switching between threads. - */ -#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) {                              \ -  /* Context switch code here.*/                                            \ -} - -/** - * @brief   ISR enter hook. - */ -#define CH_CFG_IRQ_PROLOGUE_HOOK() {                                        \ -  /* IRQ prologue code here.*/                                              \ -} - -/** - * @brief   ISR exit hook. - */ -#define CH_CFG_IRQ_EPILOGUE_HOOK() {                                        \ -  /* IRQ epilogue code here.*/                                              \ -} - -/** - * @brief   Idle thread enter hook. - * @note    This hook is invoked within a critical zone, no OS functions - *          should be invoked from here. - * @note    This macro can be used to activate a power saving mode. - */ -#define CH_CFG_IDLE_ENTER_HOOK() {                                          \ -  /* Idle-enter code here.*/                                                \ -} - -/** - * @brief   Idle thread leave hook. - * @note    This hook is invoked within a critical zone, no OS functions - *          should be invoked from here. - * @note    This macro can be used to deactivate a power saving mode. - */ -#define CH_CFG_IDLE_LEAVE_HOOK() {                                          \ -  /* Idle-leave code here.*/                                                \ -} - -/** - * @brief   Idle Loop hook. - * @details This hook is continuously invoked by the idle thread loop. - */ -#define CH_CFG_IDLE_LOOP_HOOK() {                                           \ -  /* Idle loop code here.*/                                                 \ -} - -/** - * @brief   System tick event hook. - * @details This hook is invoked in the system tick handler immediately - *          after processing the virtual timers queue. - */ -#define CH_CFG_SYSTEM_TICK_HOOK() {                                         \ -  /* System tick event code here.*/                                         \ -} - -/** - * @brief   System halt hook. - * @details This hook is invoked in case to a system halting error before - *          the system is halted. - */ -#define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \ -  /* System halt code here.*/                                               \ -} - -/** - * @brief   Trace hook. - * @details This hook is invoked each time a new record is written in the - *          trace buffer. - */ -#define CH_CFG_TRACE_HOOK(tep) {                                            \ -  /* Trace code here.*/                                                     \ -} - -/** @} */ - -/*===========================================================================*/ -/* Port-specific settings (override port settings defaulted in chcore.h).    */ -/*===========================================================================*/ - -#endif  /* CHCONF_H */ - -/** @} */ +/*
 +    ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
 +
 +    Licensed 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.
 +*/
 +
 +/**
 + * @file    templates/chconf.h
 + * @brief   Configuration file template.
 + * @details A copy of this file must be placed in each project directory, it
 + *          contains the application specific kernel settings.
 + *
 + * @addtogroup config
 + * @details Kernel related settings and hooks.
 + * @{
 + */
 +
 +#ifndef CHCONF_H
 +#define CHCONF_H
 +
 +#define _CHIBIOS_RT_CONF_
 +#define _CHIBIOS_RT_CONF_VER_5_0_
 +
 +/*===========================================================================*/
 +/**
 + * @name System timers settings
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   System time counter resolution.
 + * @note    Allowed values are 16 or 32 bits.
 + */
 +#define CH_CFG_ST_RESOLUTION                32
 +
 +/**
 + * @brief   System tick frequency.
 + * @details Frequency of the system timer that drives the system ticks. This
 + *          setting also defines the system tick time unit.
 + */
 +#define CH_CFG_ST_FREQUENCY                 10000
 +
 +/**
 + * @brief   Time intervals data size.
 + * @note    Allowed values are 16, 32 or 64 bits.
 + */
 +#define CH_CFG_INTERVALS_SIZE               32
 +
 +/**
 + * @brief   Time types data size.
 + * @note    Allowed values are 16 or 32 bits.
 + */
 +#define CH_CFG_TIME_TYPES_SIZE              32
 +
 +/**
 + * @brief   Time delta constant for the tick-less mode.
 + * @note    If this value is zero then the system uses the classic
 + *          periodic tick. This value represents the minimum number
 + *          of ticks that is safe to specify in a timeout directive.
 + *          The value one is not valid, timeouts are rounded up to
 + *          this value.
 + */
 +#define CH_CFG_ST_TIMEDELTA                 2
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
 + * @name Kernel parameters and options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Round robin interval.
 + * @details This constant is the number of system ticks allowed for the
 + *          threads before preemption occurs. Setting this value to zero
 + *          disables the preemption for threads with equal priority and the
 + *          round robin becomes cooperative. Note that higher priority
 + *          threads can still preempt, the kernel is always preemptive.
 + * @note    Disabling the round robin preemption makes the kernel more compact
 + *          and generally faster.
 + * @note    The round robin preemption is not supported in tickless mode and
 + *          must be set to zero in that case.
 + */
 +#define CH_CFG_TIME_QUANTUM                 0
 +
 +/**
 + * @brief   Managed RAM size.
 + * @details Size of the RAM area to be managed by the OS. If set to zero
 + *          then the whole available RAM is used. The core memory is made
 + *          available to the heap allocator and/or can be used directly through
 + *          the simplified core memory allocator.
 + *
 + * @note    In order to let the OS manage the whole RAM the linker script must
 + *          provide the @p __heap_base__ and @p __heap_end__ symbols.
 + * @note    Requires @p CH_CFG_USE_MEMCORE.
 + */
 +#define CH_CFG_MEMCORE_SIZE                 0
 +
 +/**
 + * @brief   Idle thread automatic spawn suppression.
 + * @details When this option is activated the function @p chSysInit()
 + *          does not spawn the idle thread. The application @p main()
 + *          function becomes the idle thread and must implement an
 + *          infinite loop.
 + */
 +#define CH_CFG_NO_IDLE_THREAD               FALSE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
 + * @name Performance options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   OS optimization.
 + * @details If enabled then time efficient rather than space efficient code
 + *          is used when two possible implementations exist.
 + *
 + * @note    This is not related to the compiler optimization options.
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_OPTIMIZE_SPEED               TRUE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
 + * @name Subsystem options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Time Measurement APIs.
 + * @details If enabled then the time measurement APIs are included in
 + *          the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_TM                       FALSE
 +
 +/**
 + * @brief   Threads registry APIs.
 + * @details If enabled then the registry APIs are included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_REGISTRY                 TRUE
 +
 +/**
 + * @brief   Threads synchronization APIs.
 + * @details If enabled then the @p chThdWait() function is included in
 + *          the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_WAITEXIT                 TRUE
 +
 +/**
 + * @brief   Semaphores APIs.
 + * @details If enabled then the Semaphores APIs are included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_SEMAPHORES               TRUE
 +
 +/**
 + * @brief   Semaphores queuing mode.
 + * @details If enabled then the threads are enqueued on semaphores by
 + *          priority rather than in FIFO order.
 + *
 + * @note    The default is @p FALSE. Enable this if you have special
 + *          requirements.
 + * @note    Requires @p CH_CFG_USE_SEMAPHORES.
 + */
 +#define CH_CFG_USE_SEMAPHORES_PRIORITY      FALSE
 +
 +/**
 + * @brief   Mutexes APIs.
 + * @details If enabled then the mutexes APIs are included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_MUTEXES                  TRUE
 +
 +/**
 + * @brief   Enables recursive behavior on mutexes.
 + * @note    Recursive mutexes are heavier and have an increased
 + *          memory footprint.
 + *
 + * @note    The default is @p FALSE.
 + * @note    Requires @p CH_CFG_USE_MUTEXES.
 + */
 +#define CH_CFG_USE_MUTEXES_RECURSIVE        FALSE
 +
 +/**
 + * @brief   Conditional Variables APIs.
 + * @details If enabled then the conditional variables APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + * @note    Requires @p CH_CFG_USE_MUTEXES.
 + */
 +#define CH_CFG_USE_CONDVARS                 TRUE
 +
 +/**
 + * @brief   Conditional Variables APIs with timeout.
 + * @details If enabled then the conditional variables APIs with timeout
 + *          specification are included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + * @note    Requires @p CH_CFG_USE_CONDVARS.
 + */
 +#define CH_CFG_USE_CONDVARS_TIMEOUT         TRUE
 +
 +/**
 + * @brief   Events Flags APIs.
 + * @details If enabled then the event flags APIs are included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_EVENTS                   TRUE
 +
 +/**
 + * @brief   Events Flags APIs with timeout.
 + * @details If enabled then the events APIs with timeout specification
 + *          are included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + * @note    Requires @p CH_CFG_USE_EVENTS.
 + */
 +#define CH_CFG_USE_EVENTS_TIMEOUT           TRUE
 +
 +/**
 + * @brief   Synchronous Messages APIs.
 + * @details If enabled then the synchronous messages APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_MESSAGES                 TRUE
 +
 +/**
 + * @brief   Synchronous Messages queuing mode.
 + * @details If enabled then messages are served by priority rather than in
 + *          FIFO order.
 + *
 + * @note    The default is @p FALSE. Enable this if you have special
 + *          requirements.
 + * @note    Requires @p CH_CFG_USE_MESSAGES.
 + */
 +#define CH_CFG_USE_MESSAGES_PRIORITY        FALSE
 +
 +/**
 + * @brief   Mailboxes APIs.
 + * @details If enabled then the asynchronous messages (mailboxes) APIs are
 + *          included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + * @note    Requires @p CH_CFG_USE_SEMAPHORES.
 + */
 +#define CH_CFG_USE_MAILBOXES                TRUE
 +
 +/**
 + * @brief   Core Memory Manager APIs.
 + * @details If enabled then the core memory manager APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_MEMCORE                  TRUE
 +
 +/**
 + * @brief   Heap Allocator APIs.
 + * @details If enabled then the memory heap allocator APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + * @note    Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
 + *          @p CH_CFG_USE_SEMAPHORES.
 + * @note    Mutexes are recommended.
 + */
 +#define CH_CFG_USE_HEAP                     TRUE
 +
 +/**
 + * @brief   Memory Pools Allocator APIs.
 + * @details If enabled then the memory pools allocator APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_MEMPOOLS                 TRUE
 +
 +/**
 + * @brief  Objects FIFOs APIs.
 + * @details If enabled then the objects FIFOs APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_OBJ_FIFOS                TRUE
 +
 +/**
 + * @brief   Dynamic Threads APIs.
 + * @details If enabled then the dynamic threads creation APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + * @note    Requires @p CH_CFG_USE_WAITEXIT.
 + * @note    Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
 + */
 +#define CH_CFG_USE_DYNAMIC                  TRUE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
 + * @name Objects factory options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Objects Factory APIs.
 + * @details If enabled then the objects factory APIs are included in the
 + *          kernel.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_CFG_USE_FACTORY                  TRUE
 +
 +/**
 + * @brief   Maximum length for object names.
 + * @details If the specified length is zero then the name is stored by
 + *          pointer but this could have unintended side effects.
 + */
 +#define CH_CFG_FACTORY_MAX_NAMES_LENGTH     8
 +
 +/**
 + * @brief   Enables the registry of generic objects.
 + */
 +#define CH_CFG_FACTORY_OBJECTS_REGISTRY     TRUE
 +
 +/**
 + * @brief   Enables factory for generic buffers.
 + */
 +#define CH_CFG_FACTORY_GENERIC_BUFFERS      TRUE
 +
 +/**
 + * @brief   Enables factory for semaphores.
 + */
 +#define CH_CFG_FACTORY_SEMAPHORES           TRUE
 +
 +/**
 + * @brief   Enables factory for mailboxes.
 + */
 +#define CH_CFG_FACTORY_MAILBOXES            TRUE
 +
 +/**
 + * @brief   Enables factory for objects FIFOs.
 + */
 +#define CH_CFG_FACTORY_OBJ_FIFOS            TRUE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
 + * @name Debug options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Debug option, kernel statistics.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_DBG_STATISTICS                   FALSE
 +
 +/**
 + * @brief   Debug option, system state check.
 + * @details If enabled the correct call protocol for system APIs is checked
 + *          at runtime.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_DBG_SYSTEM_STATE_CHECK           TRUE
 +
 +/**
 + * @brief   Debug option, parameters checks.
 + * @details If enabled then the checks on the API functions input
 + *          parameters are activated.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_DBG_ENABLE_CHECKS                TRUE
 +
 +/**
 + * @brief   Debug option, consistency checks.
 + * @details If enabled then all the assertions in the kernel code are
 + *          activated. This includes consistency checks inside the kernel,
 + *          runtime anomalies and port-defined checks.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_DBG_ENABLE_ASSERTS               TRUE
 +
 +/**
 + * @brief   Debug option, trace buffer.
 + * @details If enabled then the trace buffer is activated.
 + *
 + * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.
 + */
 +#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_ALL
 +
 +/**
 + * @brief   Trace buffer entries.
 + * @note    The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
 + *          different from @p CH_DBG_TRACE_MASK_DISABLED.
 + */
 +#define CH_DBG_TRACE_BUFFER_SIZE            128
 +
 +/**
 + * @brief   Debug option, stack checks.
 + * @details If enabled then a runtime stack check is performed.
 + *
 + * @note    The default is @p FALSE.
 + * @note    The stack check is performed in a architecture/port dependent way.
 + *          It may not be implemented or some ports.
 + * @note    The default failure mode is to halt the system with the global
 + *          @p panic_msg variable set to @p NULL.
 + */
 +#define CH_DBG_ENABLE_STACK_CHECK           TRUE
 +
 +/**
 + * @brief   Debug option, stacks initialization.
 + * @details If enabled then the threads working area is filled with a byte
 + *          value when a thread is created. This can be useful for the
 + *          runtime measurement of the used stack.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_DBG_FILL_THREADS                 TRUE
 +
 +/**
 + * @brief   Debug option, threads profiling.
 + * @details If enabled then a field is added to the @p thread_t structure that
 + *          counts the system ticks occurred while executing the thread.
 + *
 + * @note    The default is @p FALSE.
 + * @note    This debug option is not currently compatible with the
 + *          tickless mode.
 + */
 +#define CH_DBG_THREADS_PROFILING            FALSE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
 + * @name Kernel hooks
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   System structure extension.
 + * @details User fields added to the end of the @p ch_system_t structure.
 + */
 +#define CH_CFG_SYSTEM_EXTRA_FIELDS                                          \
 +  /* Add threads custom fields here.*/
 +
 +/**
 + * @brief   System initialization hook.
 + * @details User initialization code added to the @p chSysInit() function
 + *          just before interrupts are enabled globally.
 + */
 +#define CH_CFG_SYSTEM_INIT_HOOK(tp) {                                       \
 +  /* Add threads initialization code here.*/                                \
 +}
 +
 +/**
 + * @brief   Threads descriptor structure extension.
 + * @details User fields added to the end of the @p thread_t structure.
 + */
 +#define CH_CFG_THREAD_EXTRA_FIELDS                                          \
 +  /* Add threads custom fields here.*/
 +
 +/**
 + * @brief   Threads initialization hook.
 + * @details User initialization code added to the @p _thread_init() function.
 + *
 + * @note    It is invoked from within @p _thread_init() and implicitly from all
 + *          the threads creation APIs.
 + */
 +#define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \
 +  /* Add threads initialization code here.*/                                \
 +}
 +
 +/**
 + * @brief   Threads finalization hook.
 + * @details User finalization code added to the @p chThdExit() API.
 + */
 +#define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \
 +  /* Add threads finalization code here.*/                                  \
 +}
 +
 +/**
 + * @brief   Context switch hook.
 + * @details This hook is invoked just before switching between threads.
 + */
 +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) {                              \
 +  /* Context switch code here.*/                                            \
 +}
 +
 +/**
 + * @brief   ISR enter hook.
 + */
 +#define CH_CFG_IRQ_PROLOGUE_HOOK() {                                        \
 +  /* IRQ prologue code here.*/                                              \
 +}
 +
 +/**
 + * @brief   ISR exit hook.
 + */
 +#define CH_CFG_IRQ_EPILOGUE_HOOK() {                                        \
 +  /* IRQ epilogue code here.*/                                              \
 +}
 +
 +/**
 + * @brief   Idle thread enter hook.
 + * @note    This hook is invoked within a critical zone, no OS functions
 + *          should be invoked from here.
 + * @note    This macro can be used to activate a power saving mode.
 + */
 +#define CH_CFG_IDLE_ENTER_HOOK() {                                          \
 +  /* Idle-enter code here.*/                                                \
 +}
 +
 +/**
 + * @brief   Idle thread leave hook.
 + * @note    This hook is invoked within a critical zone, no OS functions
 + *          should be invoked from here.
 + * @note    This macro can be used to deactivate a power saving mode.
 + */
 +#define CH_CFG_IDLE_LEAVE_HOOK() {                                          \
 +  /* Idle-leave code here.*/                                                \
 +}
 +
 +/**
 + * @brief   Idle Loop hook.
 + * @details This hook is continuously invoked by the idle thread loop.
 + */
 +#define CH_CFG_IDLE_LOOP_HOOK() {                                           \
 +  /* Idle loop code here.*/                                                 \
 +}
 +
 +/**
 + * @brief   System tick event hook.
 + * @details This hook is invoked in the system tick handler immediately
 + *          after processing the virtual timers queue.
 + */
 +#define CH_CFG_SYSTEM_TICK_HOOK() {                                         \
 +  /* System tick event code here.*/                                         \
 +}
 +
 +/**
 + * @brief   System halt hook.
 + * @details This hook is invoked in case to a system halting error before
 + *          the system is halted.
 + */
 +#define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \
 +  /* System halt code here.*/                                               \
 +}
 +
 +/**
 + * @brief   Trace hook.
 + * @details This hook is invoked each time a new record is written in the
 + *          trace buffer.
 + */
 +#define CH_CFG_TRACE_HOOK(tep) {                                            \
 +  /* Trace code here.*/                                                     \
 +}
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/* Port-specific settings (override port settings defaulted in chcore.h).    */
 +/*===========================================================================*/
 +
 +#endif  /* CHCONF_H */
 +
 +/** @} */
 diff --git a/testhal/STM32/STM32F4xx/FSMC_SRAM/chconf.h b/testhal/STM32/STM32F4xx/FSMC_SRAM/chconf.h index cf950cd..53bd676 100644 --- a/testhal/STM32/STM32F4xx/FSMC_SRAM/chconf.h +++ b/testhal/STM32/STM32F4xx/FSMC_SRAM/chconf.h @@ -1,521 +1,608 @@ -/* -    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - -    Licensed 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. -*/ - -/** - * @file    templates/chconf.h - * @brief   Configuration file template. - * @details A copy of this file must be placed in each project directory, it - *          contains the application specific kernel settings. - * - * @addtogroup config - * @details Kernel related settings and hooks. - * @{ - */ - -#ifndef CHCONF_H -#define CHCONF_H - -#define _CHIBIOS_RT_CONF_ -#define _CHIBIOS_RT_CONF_VER_5_0_ - -/*===========================================================================*/ -/** - * @name System timers settings - * @{ - */ -/*===========================================================================*/ - -/** - * @brief   System time counter resolution. - * @note    Allowed values are 16 or 32 bits. - */ -#define CH_CFG_ST_RESOLUTION                32 - -/** - * @brief   System tick frequency. - * @details Frequency of the system timer that drives the system ticks. This - *          setting also defines the system tick time unit. - */ -#define CH_CFG_ST_FREQUENCY                 10000 - -/** - * @brief   Time delta constant for the tick-less mode. - * @note    If this value is zero then the system uses the classic - *          periodic tick. This value represents the minimum number - *          of ticks that is safe to specify in a timeout directive. - *          The value one is not valid, timeouts are rounded up to - *          this value. - */ -#define CH_CFG_ST_TIMEDELTA                 2 - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel parameters and options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief   Round robin interval. - * @details This constant is the number of system ticks allowed for the - *          threads before preemption occurs. Setting this value to zero - *          disables the preemption for threads with equal priority and the - *          round robin becomes cooperative. Note that higher priority - *          threads can still preempt, the kernel is always preemptive. - * @note    Disabling the round robin preemption makes the kernel more compact - *          and generally faster. - * @note    The round robin preemption is not supported in tickless mode and - *          must be set to zero in that case. - */ -#define CH_CFG_TIME_QUANTUM                 0 - -/** - * @brief   Managed RAM size. - * @details Size of the RAM area to be managed by the OS. If set to zero - *          then the whole available RAM is used. The core memory is made - *          available to the heap allocator and/or can be used directly through - *          the simplified core memory allocator. - * - * @note    In order to let the OS manage the whole RAM the linker script must - *          provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note    Requires @p CH_CFG_USE_MEMCORE. - */ -#define CH_CFG_MEMCORE_SIZE                 0 - -/** - * @brief   Idle thread automatic spawn suppression. - * @details When this option is activated the function @p chSysInit() - *          does not spawn the idle thread. The application @p main() - *          function becomes the idle thread and must implement an - *          infinite loop. - */ -#define CH_CFG_NO_IDLE_THREAD               FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Performance options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief   OS optimization. - * @details If enabled then time efficient rather than space efficient code - *          is used when two possible implementations exist. - * - * @note    This is not related to the compiler optimization options. - * @note    The default is @p TRUE. - */ -#define CH_CFG_OPTIMIZE_SPEED               TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Subsystem options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief   Time Measurement APIs. - * @details If enabled then the time measurement APIs are included in - *          the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_TM                       TRUE - -/** - * @brief   Threads registry APIs. - * @details If enabled then the registry APIs are included in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_REGISTRY                 TRUE - -/** - * @brief   Threads synchronization APIs. - * @details If enabled then the @p chThdWait() function is included in - *          the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_WAITEXIT                 TRUE - -/** - * @brief   Semaphores APIs. - * @details If enabled then the Semaphores APIs are included in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_SEMAPHORES               TRUE - -/** - * @brief   Semaphores queuing mode. - * @details If enabled then the threads are enqueued on semaphores by - *          priority rather than in FIFO order. - * - * @note    The default is @p FALSE. Enable this if you have special - *          requirements. - * @note    Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_SEMAPHORES_PRIORITY      FALSE - -/** - * @brief   Mutexes APIs. - * @details If enabled then the mutexes APIs are included in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_MUTEXES                  TRUE - -/** - * @brief   Enables recursive behavior on mutexes. - * @note    Recursive mutexes are heavier and have an increased - *          memory footprint. - * - * @note    The default is @p FALSE. - * @note    Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_MUTEXES_RECURSIVE        FALSE - -/** - * @brief   Conditional Variables APIs. - * @details If enabled then the conditional variables APIs are included - *          in the kernel. - * - * @note    The default is @p TRUE. - * @note    Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_CONDVARS                 TRUE - -/** - * @brief   Conditional Variables APIs with timeout. - * @details If enabled then the conditional variables APIs with timeout - *          specification are included in the kernel. - * - * @note    The default is @p TRUE. - * @note    Requires @p CH_CFG_USE_CONDVARS. - */ -#define CH_CFG_USE_CONDVARS_TIMEOUT         TRUE - -/** - * @brief   Events Flags APIs. - * @details If enabled then the event flags APIs are included in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_EVENTS                   TRUE - -/** - * @brief   Events Flags APIs with timeout. - * @details If enabled then the events APIs with timeout specification - *          are included in the kernel. - * - * @note    The default is @p TRUE. - * @note    Requires @p CH_CFG_USE_EVENTS. - */ -#define CH_CFG_USE_EVENTS_TIMEOUT           TRUE - -/** - * @brief   Synchronous Messages APIs. - * @details If enabled then the synchronous messages APIs are included - *          in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_MESSAGES                 TRUE - -/** - * @brief   Synchronous Messages queuing mode. - * @details If enabled then messages are served by priority rather than in - *          FIFO order. - * - * @note    The default is @p FALSE. Enable this if you have special - *          requirements. - * @note    Requires @p CH_CFG_USE_MESSAGES. - */ -#define CH_CFG_USE_MESSAGES_PRIORITY        FALSE - -/** - * @brief   Mailboxes APIs. - * @details If enabled then the asynchronous messages (mailboxes) APIs are - *          included in the kernel. - * - * @note    The default is @p TRUE. - * @note    Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_MAILBOXES                TRUE - -/** - * @brief   Core Memory Manager APIs. - * @details If enabled then the core memory manager APIs are included - *          in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_MEMCORE                  TRUE - -/** - * @brief   Heap Allocator APIs. - * @details If enabled then the memory heap allocator APIs are included - *          in the kernel. - * - * @note    The default is @p TRUE. - * @note    Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or - *          @p CH_CFG_USE_SEMAPHORES. - * @note    Mutexes are recommended. - */ -#define CH_CFG_USE_HEAP                     TRUE - -/** - * @brief   Memory Pools Allocator APIs. - * @details If enabled then the memory pools allocator APIs are included - *          in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_MEMPOOLS                 TRUE - -/** - * @brief   Dynamic Threads APIs. - * @details If enabled then the dynamic threads creation APIs are included - *          in the kernel. - * - * @note    The default is @p TRUE. - * @note    Requires @p CH_CFG_USE_WAITEXIT. - * @note    Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. - */ -#define CH_CFG_USE_DYNAMIC                  TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Debug options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief   Debug option, kernel statistics. - * - * @note    The default is @p FALSE. - */ -#define CH_DBG_STATISTICS                   FALSE - -/** - * @brief   Debug option, system state check. - * @details If enabled the correct call protocol for system APIs is checked - *          at runtime. - * - * @note    The default is @p FALSE. - */ -#define CH_DBG_SYSTEM_STATE_CHECK           FALSE - -/** - * @brief   Debug option, parameters checks. - * @details If enabled then the checks on the API functions input - *          parameters are activated. - * - * @note    The default is @p FALSE. - */ -#define CH_DBG_ENABLE_CHECKS                FALSE - -/** - * @brief   Debug option, consistency checks. - * @details If enabled then all the assertions in the kernel code are - *          activated. This includes consistency checks inside the kernel, - *          runtime anomalies and port-defined checks. - * - * @note    The default is @p FALSE. - */ -#define CH_DBG_ENABLE_ASSERTS               FALSE - -/** - * @brief   Debug option, trace buffer. - * @details If enabled then the trace buffer is activated. - * - * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED. - */ -#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_DISABLED - -/** - * @brief   Trace buffer entries. - * @note    The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is - *          different from @p CH_DBG_TRACE_MASK_DISABLED. - */ -#define CH_DBG_TRACE_BUFFER_SIZE            128 - -/** - * @brief   Debug option, stack checks. - * @details If enabled then a runtime stack check is performed. - * - * @note    The default is @p FALSE. - * @note    The stack check is performed in a architecture/port dependent way. - *          It may not be implemented or some ports. - * @note    The default failure mode is to halt the system with the global - *          @p panic_msg variable set to @p NULL. - */ -#define CH_DBG_ENABLE_STACK_CHECK           FALSE - -/** - * @brief   Debug option, stacks initialization. - * @details If enabled then the threads working area is filled with a byte - *          value when a thread is created. This can be useful for the - *          runtime measurement of the used stack. - * - * @note    The default is @p FALSE. - */ -#define CH_DBG_FILL_THREADS                 FALSE - -/** - * @brief   Debug option, threads profiling. - * @details If enabled then a field is added to the @p thread_t structure that - *          counts the system ticks occurred while executing the thread. - * - * @note    The default is @p FALSE. - * @note    This debug option is not currently compatible with the - *          tickless mode. - */ -#define CH_DBG_THREADS_PROFILING            FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel hooks - * @{ - */ -/*===========================================================================*/ - -/** - * @brief   Threads descriptor structure extension. - * @details User fields added to the end of the @p thread_t structure. - */ -#define CH_CFG_THREAD_EXTRA_FIELDS                                          \ -  /* Add threads custom fields here.*/ - -/** - * @brief   Threads initialization hook. - * @details User initialization code added to the @p chThdInit() API. - * - * @note    It is invoked from within @p chThdInit() and implicitly from all - *          the threads creation APIs. - */ -#define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \ -  /* Add threads initialization code here.*/                                \ -} - -/** - * @brief   Threads finalization hook. - * @details User finalization code added to the @p chThdExit() API. - */ -#define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \ -  /* Add threads finalization code here.*/                                  \ -} - -/** - * @brief   Context switch hook. - * @details This hook is invoked just before switching between threads. - */ -#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) {                              \ -  /* Context switch code here.*/                                            \ -} - -/** - * @brief   ISR enter hook. - */ -#define CH_CFG_IRQ_PROLOGUE_HOOK() {                                        \ -  /* IRQ prologue code here.*/                                              \ -} - -/** - * @brief   ISR exit hook. - */ -#define CH_CFG_IRQ_EPILOGUE_HOOK() {                                        \ -  /* IRQ epilogue code here.*/                                              \ -} - -/** - * @brief   Idle thread enter hook. - * @note    This hook is invoked within a critical zone, no OS functions - *          should be invoked from here. - * @note    This macro can be used to activate a power saving mode. - */ -#define CH_CFG_IDLE_ENTER_HOOK() {                                          \ -  /* Idle-enter code here.*/                                                \ -} - -/** - * @brief   Idle thread leave hook. - * @note    This hook is invoked within a critical zone, no OS functions - *          should be invoked from here. - * @note    This macro can be used to deactivate a power saving mode. - */ -#define CH_CFG_IDLE_LEAVE_HOOK() {                                          \ -  /* Idle-leave code here.*/                                                \ -} - -/** - * @brief   Idle Loop hook. - * @details This hook is continuously invoked by the idle thread loop. - */ -#define CH_CFG_IDLE_LOOP_HOOK() {                                           \ -  /* Idle loop code here.*/                                                 \ -} - -/** - * @brief   System tick event hook. - * @details This hook is invoked in the system tick handler immediately - *          after processing the virtual timers queue. - */ -#define CH_CFG_SYSTEM_TICK_HOOK() {                                         \ -  /* System tick event code here.*/                                         \ -} - -/** - * @brief   System halt hook. - * @details This hook is invoked in case to a system halting error before - *          the system is halted. - */ -#define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \ -  /* System halt code here.*/                                               \ -} - -/** - * @brief   Trace hook. - * @details This hook is invoked each time a new record is written in the - *          trace buffer. - */ -#define CH_CFG_TRACE_HOOK(tep) {                                            \ -  /* Trace code here.*/                                                     \ -} - -/** @} */ - -/*===========================================================================*/ -/* Port-specific settings (override port settings defaulted in chcore.h).    */ -/*===========================================================================*/ - -#endif  /* CHCONF_H */ - -/** @} */ +/*
 +    ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
 +
 +    Licensed 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.
 +*/
 +
 +/**
 + * @file    templates/chconf.h
 + * @brief   Configuration file template.
 + * @details A copy of this file must be placed in each project directory, it
 + *          contains the application specific kernel settings.
 + *
 + * @addtogroup config
 + * @details Kernel related settings and hooks.
 + * @{
 + */
 +
 +#ifndef CHCONF_H
 +#define CHCONF_H
 +
 +#define _CHIBIOS_RT_CONF_
 +#define _CHIBIOS_RT_CONF_VER_5_0_
 +
 +/*===========================================================================*/
 +/**
 + * @name System timers settings
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   System time counter resolution.
 + * @note    Allowed values are 16 or 32 bits.
 + */
 +#define CH_CFG_ST_RESOLUTION                32
 +
 +/**
 + * @brief   System tick frequency.
 + * @details Frequency of the system timer that drives the system ticks. This
 + *          setting also defines the system tick time unit.
 + */
 +#define CH_CFG_ST_FREQUENCY                 10000
 +
 +/**
 + * @brief   Time intervals data size.
 + * @note    Allowed values are 16, 32 or 64 bits.
 + */
 +#define CH_CFG_INTERVALS_SIZE               32
 +
 +/**
 + * @brief   Time types data size.
 + * @note    Allowed values are 16 or 32 bits.
 + */
 +#define CH_CFG_TIME_TYPES_SIZE              32
 +
 +/**
 + * @brief   Time delta constant for the tick-less mode.
 + * @note    If this value is zero then the system uses the classic
 + *          periodic tick. This value represents the minimum number
 + *          of ticks that is safe to specify in a timeout directive.
 + *          The value one is not valid, timeouts are rounded up to
 + *          this value.
 + */
 +#define CH_CFG_ST_TIMEDELTA                 2
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
 + * @name Kernel parameters and options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Round robin interval.
 + * @details This constant is the number of system ticks allowed for the
 + *          threads before preemption occurs. Setting this value to zero
 + *          disables the preemption for threads with equal priority and the
 + *          round robin becomes cooperative. Note that higher priority
 + *          threads can still preempt, the kernel is always preemptive.
 + * @note    Disabling the round robin preemption makes the kernel more compact
 + *          and generally faster.
 + * @note    The round robin preemption is not supported in tickless mode and
 + *          must be set to zero in that case.
 + */
 +#define CH_CFG_TIME_QUANTUM                 0
 +
 +/**
 + * @brief   Managed RAM size.
 + * @details Size of the RAM area to be managed by the OS. If set to zero
 + *          then the whole available RAM is used. The core memory is made
 + *          available to the heap allocator and/or can be used directly through
 + *          the simplified core memory allocator.
 + *
 + * @note    In order to let the OS manage the whole RAM the linker script must
 + *          provide the @p __heap_base__ and @p __heap_end__ symbols.
 + * @note    Requires @p CH_CFG_USE_MEMCORE.
 + */
 +#define CH_CFG_MEMCORE_SIZE                 0
 +
 +/**
 + * @brief   Idle thread automatic spawn suppression.
 + * @details When this option is activated the function @p chSysInit()
 + *          does not spawn the idle thread. The application @p main()
 + *          function becomes the idle thread and must implement an
 + *          infinite loop.
 + */
 +#define CH_CFG_NO_IDLE_THREAD               FALSE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
 + * @name Performance options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   OS optimization.
 + * @details If enabled then time efficient rather than space efficient code
 + *          is used when two possible implementations exist.
 + *
 + * @note    This is not related to the compiler optimization options.
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_OPTIMIZE_SPEED               TRUE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
 + * @name Subsystem options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Time Measurement APIs.
 + * @details If enabled then the time measurement APIs are included in
 + *          the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_TM                       FALSE
 +
 +/**
 + * @brief   Threads registry APIs.
 + * @details If enabled then the registry APIs are included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_REGISTRY                 TRUE
 +
 +/**
 + * @brief   Threads synchronization APIs.
 + * @details If enabled then the @p chThdWait() function is included in
 + *          the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_WAITEXIT                 TRUE
 +
 +/**
 + * @brief   Semaphores APIs.
 + * @details If enabled then the Semaphores APIs are included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_SEMAPHORES               TRUE
 +
 +/**
 + * @brief   Semaphores queuing mode.
 + * @details If enabled then the threads are enqueued on semaphores by
 + *          priority rather than in FIFO order.
 + *
 + * @note    The default is @p FALSE. Enable this if you have special
 + *          requirements.
 + * @note    Requires @p CH_CFG_USE_SEMAPHORES.
 + */
 +#define CH_CFG_USE_SEMAPHORES_PRIORITY      FALSE
 +
 +/**
 + * @brief   Mutexes APIs.
 + * @details If enabled then the mutexes APIs are included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_MUTEXES                  TRUE
 +
 +/**
 + * @brief   Enables recursive behavior on mutexes.
 + * @note    Recursive mutexes are heavier and have an increased
 + *          memory footprint.
 + *
 + * @note    The default is @p FALSE.
 + * @note    Requires @p CH_CFG_USE_MUTEXES.
 + */
 +#define CH_CFG_USE_MUTEXES_RECURSIVE        FALSE
 +
 +/**
 + * @brief   Conditional Variables APIs.
 + * @details If enabled then the conditional variables APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + * @note    Requires @p CH_CFG_USE_MUTEXES.
 + */
 +#define CH_CFG_USE_CONDVARS                 TRUE
 +
 +/**
 + * @brief   Conditional Variables APIs with timeout.
 + * @details If enabled then the conditional variables APIs with timeout
 + *          specification are included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + * @note    Requires @p CH_CFG_USE_CONDVARS.
 + */
 +#define CH_CFG_USE_CONDVARS_TIMEOUT         TRUE
 +
 +/**
 + * @brief   Events Flags APIs.
 + * @details If enabled then the event flags APIs are included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_EVENTS                   TRUE
 +
 +/**
 + * @brief   Events Flags APIs with timeout.
 + * @details If enabled then the events APIs with timeout specification
 + *          are included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + * @note    Requires @p CH_CFG_USE_EVENTS.
 + */
 +#define CH_CFG_USE_EVENTS_TIMEOUT           TRUE
 +
 +/**
 + * @brief   Synchronous Messages APIs.
 + * @details If enabled then the synchronous messages APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_MESSAGES                 TRUE
 +
 +/**
 + * @brief   Synchronous Messages queuing mode.
 + * @details If enabled then messages are served by priority rather than in
 + *          FIFO order.
 + *
 + * @note    The default is @p FALSE. Enable this if you have special
 + *          requirements.
 + * @note    Requires @p CH_CFG_USE_MESSAGES.
 + */
 +#define CH_CFG_USE_MESSAGES_PRIORITY        FALSE
 +
 +/**
 + * @brief   Mailboxes APIs.
 + * @details If enabled then the asynchronous messages (mailboxes) APIs are
 + *          included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + * @note    Requires @p CH_CFG_USE_SEMAPHORES.
 + */
 +#define CH_CFG_USE_MAILBOXES                TRUE
 +
 +/**
 + * @brief   Core Memory Manager APIs.
 + * @details If enabled then the core memory manager APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_MEMCORE                  TRUE
 +
 +/**
 + * @brief   Heap Allocator APIs.
 + * @details If enabled then the memory heap allocator APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + * @note    Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
 + *          @p CH_CFG_USE_SEMAPHORES.
 + * @note    Mutexes are recommended.
 + */
 +#define CH_CFG_USE_HEAP                     TRUE
 +
 +/**
 + * @brief   Memory Pools Allocator APIs.
 + * @details If enabled then the memory pools allocator APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_MEMPOOLS                 TRUE
 +
 +/**
 + * @brief  Objects FIFOs APIs.
 + * @details If enabled then the objects FIFOs APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_OBJ_FIFOS                TRUE
 +
 +/**
 + * @brief   Dynamic Threads APIs.
 + * @details If enabled then the dynamic threads creation APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + * @note    Requires @p CH_CFG_USE_WAITEXIT.
 + * @note    Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
 + */
 +#define CH_CFG_USE_DYNAMIC                  TRUE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
 + * @name Objects factory options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Objects Factory APIs.
 + * @details If enabled then the objects factory APIs are included in the
 + *          kernel.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_CFG_USE_FACTORY                  TRUE
 +
 +/**
 + * @brief   Maximum length for object names.
 + * @details If the specified length is zero then the name is stored by
 + *          pointer but this could have unintended side effects.
 + */
 +#define CH_CFG_FACTORY_MAX_NAMES_LENGTH     8
 +
 +/**
 + * @brief   Enables the registry of generic objects.
 + */
 +#define CH_CFG_FACTORY_OBJECTS_REGISTRY     TRUE
 +
 +/**
 + * @brief   Enables factory for generic buffers.
 + */
 +#define CH_CFG_FACTORY_GENERIC_BUFFERS      TRUE
 +
 +/**
 + * @brief   Enables factory for semaphores.
 + */
 +#define CH_CFG_FACTORY_SEMAPHORES           TRUE
 +
 +/**
 + * @brief   Enables factory for mailboxes.
 + */
 +#define CH_CFG_FACTORY_MAILBOXES            TRUE
 +
 +/**
 + * @brief   Enables factory for objects FIFOs.
 + */
 +#define CH_CFG_FACTORY_OBJ_FIFOS            TRUE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
 + * @name Debug options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Debug option, kernel statistics.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_DBG_STATISTICS                   FALSE
 +
 +/**
 + * @brief   Debug option, system state check.
 + * @details If enabled the correct call protocol for system APIs is checked
 + *          at runtime.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_DBG_SYSTEM_STATE_CHECK           TRUE
 +
 +/**
 + * @brief   Debug option, parameters checks.
 + * @details If enabled then the checks on the API functions input
 + *          parameters are activated.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_DBG_ENABLE_CHECKS                TRUE
 +
 +/**
 + * @brief   Debug option, consistency checks.
 + * @details If enabled then all the assertions in the kernel code are
 + *          activated. This includes consistency checks inside the kernel,
 + *          runtime anomalies and port-defined checks.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_DBG_ENABLE_ASSERTS               TRUE
 +
 +/**
 + * @brief   Debug option, trace buffer.
 + * @details If enabled then the trace buffer is activated.
 + *
 + * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.
 + */
 +#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_ALL
 +
 +/**
 + * @brief   Trace buffer entries.
 + * @note    The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
 + *          different from @p CH_DBG_TRACE_MASK_DISABLED.
 + */
 +#define CH_DBG_TRACE_BUFFER_SIZE            128
 +
 +/**
 + * @brief   Debug option, stack checks.
 + * @details If enabled then a runtime stack check is performed.
 + *
 + * @note    The default is @p FALSE.
 + * @note    The stack check is performed in a architecture/port dependent way.
 + *          It may not be implemented or some ports.
 + * @note    The default failure mode is to halt the system with the global
 + *          @p panic_msg variable set to @p NULL.
 + */
 +#define CH_DBG_ENABLE_STACK_CHECK           TRUE
 +
 +/**
 + * @brief   Debug option, stacks initialization.
 + * @details If enabled then the threads working area is filled with a byte
 + *          value when a thread is created. This can be useful for the
 + *          runtime measurement of the used stack.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_DBG_FILL_THREADS                 TRUE
 +
 +/**
 + * @brief   Debug option, threads profiling.
 + * @details If enabled then a field is added to the @p thread_t structure that
 + *          counts the system ticks occurred while executing the thread.
 + *
 + * @note    The default is @p FALSE.
 + * @note    This debug option is not currently compatible with the
 + *          tickless mode.
 + */
 +#define CH_DBG_THREADS_PROFILING            FALSE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
 + * @name Kernel hooks
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   System structure extension.
 + * @details User fields added to the end of the @p ch_system_t structure.
 + */
 +#define CH_CFG_SYSTEM_EXTRA_FIELDS                                          \
 +  /* Add threads custom fields here.*/
 +
 +/**
 + * @brief   System initialization hook.
 + * @details User initialization code added to the @p chSysInit() function
 + *          just before interrupts are enabled globally.
 + */
 +#define CH_CFG_SYSTEM_INIT_HOOK(tp) {                                       \
 +  /* Add threads initialization code here.*/                                \
 +}
 +
 +/**
 + * @brief   Threads descriptor structure extension.
 + * @details User fields added to the end of the @p thread_t structure.
 + */
 +#define CH_CFG_THREAD_EXTRA_FIELDS                                          \
 +  /* Add threads custom fields here.*/
 +
 +/**
 + * @brief   Threads initialization hook.
 + * @details User initialization code added to the @p _thread_init() function.
 + *
 + * @note    It is invoked from within @p _thread_init() and implicitly from all
 + *          the threads creation APIs.
 + */
 +#define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \
 +  /* Add threads initialization code here.*/                                \
 +}
 +
 +/**
 + * @brief   Threads finalization hook.
 + * @details User finalization code added to the @p chThdExit() API.
 + */
 +#define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \
 +  /* Add threads finalization code here.*/                                  \
 +}
 +
 +/**
 + * @brief   Context switch hook.
 + * @details This hook is invoked just before switching between threads.
 + */
 +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) {                              \
 +  /* Context switch code here.*/                                            \
 +}
 +
 +/**
 + * @brief   ISR enter hook.
 + */
 +#define CH_CFG_IRQ_PROLOGUE_HOOK() {                                        \
 +  /* IRQ prologue code here.*/                                              \
 +}
 +
 +/**
 + * @brief   ISR exit hook.
 + */
 +#define CH_CFG_IRQ_EPILOGUE_HOOK() {                                        \
 +  /* IRQ epilogue code here.*/                                              \
 +}
 +
 +/**
 + * @brief   Idle thread enter hook.
 + * @note    This hook is invoked within a critical zone, no OS functions
 + *          should be invoked from here.
 + * @note    This macro can be used to activate a power saving mode.
 + */
 +#define CH_CFG_IDLE_ENTER_HOOK() {                                          \
 +  /* Idle-enter code here.*/                                                \
 +}
 +
 +/**
 + * @brief   Idle thread leave hook.
 + * @note    This hook is invoked within a critical zone, no OS functions
 + *          should be invoked from here.
 + * @note    This macro can be used to deactivate a power saving mode.
 + */
 +#define CH_CFG_IDLE_LEAVE_HOOK() {                                          \
 +  /* Idle-leave code here.*/                                                \
 +}
 +
 +/**
 + * @brief   Idle Loop hook.
 + * @details This hook is continuously invoked by the idle thread loop.
 + */
 +#define CH_CFG_IDLE_LOOP_HOOK() {                                           \
 +  /* Idle loop code here.*/                                                 \
 +}
 +
 +/**
 + * @brief   System tick event hook.
 + * @details This hook is invoked in the system tick handler immediately
 + *          after processing the virtual timers queue.
 + */
 +#define CH_CFG_SYSTEM_TICK_HOOK() {                                         \
 +  /* System tick event code here.*/                                         \
 +}
 +
 +/**
 + * @brief   System halt hook.
 + * @details This hook is invoked in case to a system halting error before
 + *          the system is halted.
 + */
 +#define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \
 +  /* System halt code here.*/                                               \
 +}
 +
 +/**
 + * @brief   Trace hook.
 + * @details This hook is invoked each time a new record is written in the
 + *          trace buffer.
 + */
 +#define CH_CFG_TRACE_HOOK(tep) {                                            \
 +  /* Trace code here.*/                                                     \
 +}
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/* Port-specific settings (override port settings defaulted in chcore.h).    */
 +/*===========================================================================*/
 +
 +#endif  /* CHCONF_H */
 +
 +/** @} */
 diff --git a/testhal/STM32/STM32F4xx/USB_HOST/chconf.h b/testhal/STM32/STM32F4xx/USB_HOST/chconf.h index e112daf..53bd676 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/chconf.h +++ b/testhal/STM32/STM32F4xx/USB_HOST/chconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
 +    ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
 @@ -49,7 +49,19 @@   * @details Frequency of the system timer that drives the system ticks. This
   *          setting also defines the system tick time unit.
   */
 -#define CH_CFG_ST_FREQUENCY                 1000
 +#define CH_CFG_ST_FREQUENCY                 10000
 +
 +/**
 + * @brief   Time intervals data size.
 + * @note    Allowed values are 16, 32 or 64 bits.
 + */
 +#define CH_CFG_INTERVALS_SIZE               32
 +
 +/**
 + * @brief   Time types data size.
 + * @note    Allowed values are 16 or 32 bits.
 + */
 +#define CH_CFG_TIME_TYPES_SIZE              32
  /**
   * @brief   Time delta constant for the tick-less mode.
 @@ -59,7 +71,7 @@   *          The value one is not valid, timeouts are rounded up to
   *          this value.
   */
 -#define CH_CFG_ST_TIMEDELTA                 0
 +#define CH_CFG_ST_TIMEDELTA                 2
  /** @} */
 @@ -141,7 +153,7 @@   *
   * @note    The default is @p TRUE.
   */
 -#define CH_CFG_USE_TM                       TRUE
 +#define CH_CFG_USE_TM                       FALSE
  /**
   * @brief   Threads registry APIs.
 @@ -296,6 +308,15 @@  #define CH_CFG_USE_MEMPOOLS                 TRUE
  /**
 + * @brief  Objects FIFOs APIs.
 + * @details If enabled then the objects FIFOs APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_OBJ_FIFOS                TRUE
 +
 +/**
   * @brief   Dynamic Threads APIs.
   * @details If enabled then the dynamic threads creation APIs are included
   *          in the kernel.
 @@ -310,6 +331,56 @@  /*===========================================================================*/
  /**
 + * @name Objects factory options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Objects Factory APIs.
 + * @details If enabled then the objects factory APIs are included in the
 + *          kernel.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_CFG_USE_FACTORY                  TRUE
 +
 +/**
 + * @brief   Maximum length for object names.
 + * @details If the specified length is zero then the name is stored by
 + *          pointer but this could have unintended side effects.
 + */
 +#define CH_CFG_FACTORY_MAX_NAMES_LENGTH     8
 +
 +/**
 + * @brief   Enables the registry of generic objects.
 + */
 +#define CH_CFG_FACTORY_OBJECTS_REGISTRY     TRUE
 +
 +/**
 + * @brief   Enables factory for generic buffers.
 + */
 +#define CH_CFG_FACTORY_GENERIC_BUFFERS      TRUE
 +
 +/**
 + * @brief   Enables factory for semaphores.
 + */
 +#define CH_CFG_FACTORY_SEMAPHORES           TRUE
 +
 +/**
 + * @brief   Enables factory for mailboxes.
 + */
 +#define CH_CFG_FACTORY_MAILBOXES            TRUE
 +
 +/**
 + * @brief   Enables factory for objects FIFOs.
 + */
 +#define CH_CFG_FACTORY_OBJ_FIFOS            TRUE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
   * @name Debug options
   * @{
   */
 @@ -356,7 +427,7 @@   *
   * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.
   */
 -#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_DISABLED
 +#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_ALL
  /**
   * @brief   Trace buffer entries.
 @@ -408,6 +479,22 @@  /*===========================================================================*/
  /**
 + * @brief   System structure extension.
 + * @details User fields added to the end of the @p ch_system_t structure.
 + */
 +#define CH_CFG_SYSTEM_EXTRA_FIELDS                                          \
 +  /* Add threads custom fields here.*/
 +
 +/**
 + * @brief   System initialization hook.
 + * @details User initialization code added to the @p chSysInit() function
 + *          just before interrupts are enabled globally.
 + */
 +#define CH_CFG_SYSTEM_INIT_HOOK(tp) {                                       \
 +  /* Add threads initialization code here.*/                                \
 +}
 +
 +/**
   * @brief   Threads descriptor structure extension.
   * @details User fields added to the end of the @p thread_t structure.
   */
 @@ -416,9 +503,9 @@  /**
   * @brief   Threads initialization hook.
 - * @details User initialization code added to the @p chThdInit() API.
 + * @details User initialization code added to the @p _thread_init() function.
   *
 - * @note    It is invoked from within @p chThdInit() and implicitly from all
 + * @note    It is invoked from within @p _thread_init() and implicitly from all
   *          the threads creation APIs.
   */
  #define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \
 @@ -499,8 +586,6 @@   */
  #define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \
    /* System halt code here.*/                                               \
 -  void usbDbgSystemHalted(void); \
 -  usbDbgSystemHalted(); \
  }
  /**
 diff --git a/testhal/STM32/STM32F4xx/onewire/chconf.h b/testhal/STM32/STM32F4xx/onewire/chconf.h index cf950cd..53bd676 100644 --- a/testhal/STM32/STM32F4xx/onewire/chconf.h +++ b/testhal/STM32/STM32F4xx/onewire/chconf.h @@ -1,521 +1,608 @@ -/* -    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - -    Licensed 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. -*/ - -/** - * @file    templates/chconf.h - * @brief   Configuration file template. - * @details A copy of this file must be placed in each project directory, it - *          contains the application specific kernel settings. - * - * @addtogroup config - * @details Kernel related settings and hooks. - * @{ - */ - -#ifndef CHCONF_H -#define CHCONF_H - -#define _CHIBIOS_RT_CONF_ -#define _CHIBIOS_RT_CONF_VER_5_0_ - -/*===========================================================================*/ -/** - * @name System timers settings - * @{ - */ -/*===========================================================================*/ - -/** - * @brief   System time counter resolution. - * @note    Allowed values are 16 or 32 bits. - */ -#define CH_CFG_ST_RESOLUTION                32 - -/** - * @brief   System tick frequency. - * @details Frequency of the system timer that drives the system ticks. This - *          setting also defines the system tick time unit. - */ -#define CH_CFG_ST_FREQUENCY                 10000 - -/** - * @brief   Time delta constant for the tick-less mode. - * @note    If this value is zero then the system uses the classic - *          periodic tick. This value represents the minimum number - *          of ticks that is safe to specify in a timeout directive. - *          The value one is not valid, timeouts are rounded up to - *          this value. - */ -#define CH_CFG_ST_TIMEDELTA                 2 - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel parameters and options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief   Round robin interval. - * @details This constant is the number of system ticks allowed for the - *          threads before preemption occurs. Setting this value to zero - *          disables the preemption for threads with equal priority and the - *          round robin becomes cooperative. Note that higher priority - *          threads can still preempt, the kernel is always preemptive. - * @note    Disabling the round robin preemption makes the kernel more compact - *          and generally faster. - * @note    The round robin preemption is not supported in tickless mode and - *          must be set to zero in that case. - */ -#define CH_CFG_TIME_QUANTUM                 0 - -/** - * @brief   Managed RAM size. - * @details Size of the RAM area to be managed by the OS. If set to zero - *          then the whole available RAM is used. The core memory is made - *          available to the heap allocator and/or can be used directly through - *          the simplified core memory allocator. - * - * @note    In order to let the OS manage the whole RAM the linker script must - *          provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note    Requires @p CH_CFG_USE_MEMCORE. - */ -#define CH_CFG_MEMCORE_SIZE                 0 - -/** - * @brief   Idle thread automatic spawn suppression. - * @details When this option is activated the function @p chSysInit() - *          does not spawn the idle thread. The application @p main() - *          function becomes the idle thread and must implement an - *          infinite loop. - */ -#define CH_CFG_NO_IDLE_THREAD               FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Performance options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief   OS optimization. - * @details If enabled then time efficient rather than space efficient code - *          is used when two possible implementations exist. - * - * @note    This is not related to the compiler optimization options. - * @note    The default is @p TRUE. - */ -#define CH_CFG_OPTIMIZE_SPEED               TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Subsystem options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief   Time Measurement APIs. - * @details If enabled then the time measurement APIs are included in - *          the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_TM                       TRUE - -/** - * @brief   Threads registry APIs. - * @details If enabled then the registry APIs are included in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_REGISTRY                 TRUE - -/** - * @brief   Threads synchronization APIs. - * @details If enabled then the @p chThdWait() function is included in - *          the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_WAITEXIT                 TRUE - -/** - * @brief   Semaphores APIs. - * @details If enabled then the Semaphores APIs are included in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_SEMAPHORES               TRUE - -/** - * @brief   Semaphores queuing mode. - * @details If enabled then the threads are enqueued on semaphores by - *          priority rather than in FIFO order. - * - * @note    The default is @p FALSE. Enable this if you have special - *          requirements. - * @note    Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_SEMAPHORES_PRIORITY      FALSE - -/** - * @brief   Mutexes APIs. - * @details If enabled then the mutexes APIs are included in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_MUTEXES                  TRUE - -/** - * @brief   Enables recursive behavior on mutexes. - * @note    Recursive mutexes are heavier and have an increased - *          memory footprint. - * - * @note    The default is @p FALSE. - * @note    Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_MUTEXES_RECURSIVE        FALSE - -/** - * @brief   Conditional Variables APIs. - * @details If enabled then the conditional variables APIs are included - *          in the kernel. - * - * @note    The default is @p TRUE. - * @note    Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_CONDVARS                 TRUE - -/** - * @brief   Conditional Variables APIs with timeout. - * @details If enabled then the conditional variables APIs with timeout - *          specification are included in the kernel. - * - * @note    The default is @p TRUE. - * @note    Requires @p CH_CFG_USE_CONDVARS. - */ -#define CH_CFG_USE_CONDVARS_TIMEOUT         TRUE - -/** - * @brief   Events Flags APIs. - * @details If enabled then the event flags APIs are included in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_EVENTS                   TRUE - -/** - * @brief   Events Flags APIs with timeout. - * @details If enabled then the events APIs with timeout specification - *          are included in the kernel. - * - * @note    The default is @p TRUE. - * @note    Requires @p CH_CFG_USE_EVENTS. - */ -#define CH_CFG_USE_EVENTS_TIMEOUT           TRUE - -/** - * @brief   Synchronous Messages APIs. - * @details If enabled then the synchronous messages APIs are included - *          in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_MESSAGES                 TRUE - -/** - * @brief   Synchronous Messages queuing mode. - * @details If enabled then messages are served by priority rather than in - *          FIFO order. - * - * @note    The default is @p FALSE. Enable this if you have special - *          requirements. - * @note    Requires @p CH_CFG_USE_MESSAGES. - */ -#define CH_CFG_USE_MESSAGES_PRIORITY        FALSE - -/** - * @brief   Mailboxes APIs. - * @details If enabled then the asynchronous messages (mailboxes) APIs are - *          included in the kernel. - * - * @note    The default is @p TRUE. - * @note    Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_MAILBOXES                TRUE - -/** - * @brief   Core Memory Manager APIs. - * @details If enabled then the core memory manager APIs are included - *          in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_MEMCORE                  TRUE - -/** - * @brief   Heap Allocator APIs. - * @details If enabled then the memory heap allocator APIs are included - *          in the kernel. - * - * @note    The default is @p TRUE. - * @note    Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or - *          @p CH_CFG_USE_SEMAPHORES. - * @note    Mutexes are recommended. - */ -#define CH_CFG_USE_HEAP                     TRUE - -/** - * @brief   Memory Pools Allocator APIs. - * @details If enabled then the memory pools allocator APIs are included - *          in the kernel. - * - * @note    The default is @p TRUE. - */ -#define CH_CFG_USE_MEMPOOLS                 TRUE - -/** - * @brief   Dynamic Threads APIs. - * @details If enabled then the dynamic threads creation APIs are included - *          in the kernel. - * - * @note    The default is @p TRUE. - * @note    Requires @p CH_CFG_USE_WAITEXIT. - * @note    Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. - */ -#define CH_CFG_USE_DYNAMIC                  TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Debug options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief   Debug option, kernel statistics. - * - * @note    The default is @p FALSE. - */ -#define CH_DBG_STATISTICS                   FALSE - -/** - * @brief   Debug option, system state check. - * @details If enabled the correct call protocol for system APIs is checked - *          at runtime. - * - * @note    The default is @p FALSE. - */ -#define CH_DBG_SYSTEM_STATE_CHECK           FALSE - -/** - * @brief   Debug option, parameters checks. - * @details If enabled then the checks on the API functions input - *          parameters are activated. - * - * @note    The default is @p FALSE. - */ -#define CH_DBG_ENABLE_CHECKS                FALSE - -/** - * @brief   Debug option, consistency checks. - * @details If enabled then all the assertions in the kernel code are - *          activated. This includes consistency checks inside the kernel, - *          runtime anomalies and port-defined checks. - * - * @note    The default is @p FALSE. - */ -#define CH_DBG_ENABLE_ASSERTS               FALSE - -/** - * @brief   Debug option, trace buffer. - * @details If enabled then the trace buffer is activated. - * - * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED. - */ -#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_DISABLED - -/** - * @brief   Trace buffer entries. - * @note    The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is - *          different from @p CH_DBG_TRACE_MASK_DISABLED. - */ -#define CH_DBG_TRACE_BUFFER_SIZE            128 - -/** - * @brief   Debug option, stack checks. - * @details If enabled then a runtime stack check is performed. - * - * @note    The default is @p FALSE. - * @note    The stack check is performed in a architecture/port dependent way. - *          It may not be implemented or some ports. - * @note    The default failure mode is to halt the system with the global - *          @p panic_msg variable set to @p NULL. - */ -#define CH_DBG_ENABLE_STACK_CHECK           FALSE - -/** - * @brief   Debug option, stacks initialization. - * @details If enabled then the threads working area is filled with a byte - *          value when a thread is created. This can be useful for the - *          runtime measurement of the used stack. - * - * @note    The default is @p FALSE. - */ -#define CH_DBG_FILL_THREADS                 FALSE - -/** - * @brief   Debug option, threads profiling. - * @details If enabled then a field is added to the @p thread_t structure that - *          counts the system ticks occurred while executing the thread. - * - * @note    The default is @p FALSE. - * @note    This debug option is not currently compatible with the - *          tickless mode. - */ -#define CH_DBG_THREADS_PROFILING            FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel hooks - * @{ - */ -/*===========================================================================*/ - -/** - * @brief   Threads descriptor structure extension. - * @details User fields added to the end of the @p thread_t structure. - */ -#define CH_CFG_THREAD_EXTRA_FIELDS                                          \ -  /* Add threads custom fields here.*/ - -/** - * @brief   Threads initialization hook. - * @details User initialization code added to the @p chThdInit() API. - * - * @note    It is invoked from within @p chThdInit() and implicitly from all - *          the threads creation APIs. - */ -#define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \ -  /* Add threads initialization code here.*/                                \ -} - -/** - * @brief   Threads finalization hook. - * @details User finalization code added to the @p chThdExit() API. - */ -#define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \ -  /* Add threads finalization code here.*/                                  \ -} - -/** - * @brief   Context switch hook. - * @details This hook is invoked just before switching between threads. - */ -#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) {                              \ -  /* Context switch code here.*/                                            \ -} - -/** - * @brief   ISR enter hook. - */ -#define CH_CFG_IRQ_PROLOGUE_HOOK() {                                        \ -  /* IRQ prologue code here.*/                                              \ -} - -/** - * @brief   ISR exit hook. - */ -#define CH_CFG_IRQ_EPILOGUE_HOOK() {                                        \ -  /* IRQ epilogue code here.*/                                              \ -} - -/** - * @brief   Idle thread enter hook. - * @note    This hook is invoked within a critical zone, no OS functions - *          should be invoked from here. - * @note    This macro can be used to activate a power saving mode. - */ -#define CH_CFG_IDLE_ENTER_HOOK() {                                          \ -  /* Idle-enter code here.*/                                                \ -} - -/** - * @brief   Idle thread leave hook. - * @note    This hook is invoked within a critical zone, no OS functions - *          should be invoked from here. - * @note    This macro can be used to deactivate a power saving mode. - */ -#define CH_CFG_IDLE_LEAVE_HOOK() {                                          \ -  /* Idle-leave code here.*/                                                \ -} - -/** - * @brief   Idle Loop hook. - * @details This hook is continuously invoked by the idle thread loop. - */ -#define CH_CFG_IDLE_LOOP_HOOK() {                                           \ -  /* Idle loop code here.*/                                                 \ -} - -/** - * @brief   System tick event hook. - * @details This hook is invoked in the system tick handler immediately - *          after processing the virtual timers queue. - */ -#define CH_CFG_SYSTEM_TICK_HOOK() {                                         \ -  /* System tick event code here.*/                                         \ -} - -/** - * @brief   System halt hook. - * @details This hook is invoked in case to a system halting error before - *          the system is halted. - */ -#define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \ -  /* System halt code here.*/                                               \ -} - -/** - * @brief   Trace hook. - * @details This hook is invoked each time a new record is written in the - *          trace buffer. - */ -#define CH_CFG_TRACE_HOOK(tep) {                                            \ -  /* Trace code here.*/                                                     \ -} - -/** @} */ - -/*===========================================================================*/ -/* Port-specific settings (override port settings defaulted in chcore.h).    */ -/*===========================================================================*/ - -#endif  /* CHCONF_H */ - -/** @} */ +/*
 +    ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
 +
 +    Licensed 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.
 +*/
 +
 +/**
 + * @file    templates/chconf.h
 + * @brief   Configuration file template.
 + * @details A copy of this file must be placed in each project directory, it
 + *          contains the application specific kernel settings.
 + *
 + * @addtogroup config
 + * @details Kernel related settings and hooks.
 + * @{
 + */
 +
 +#ifndef CHCONF_H
 +#define CHCONF_H
 +
 +#define _CHIBIOS_RT_CONF_
 +#define _CHIBIOS_RT_CONF_VER_5_0_
 +
 +/*===========================================================================*/
 +/**
 + * @name System timers settings
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   System time counter resolution.
 + * @note    Allowed values are 16 or 32 bits.
 + */
 +#define CH_CFG_ST_RESOLUTION                32
 +
 +/**
 + * @brief   System tick frequency.
 + * @details Frequency of the system timer that drives the system ticks. This
 + *          setting also defines the system tick time unit.
 + */
 +#define CH_CFG_ST_FREQUENCY                 10000
 +
 +/**
 + * @brief   Time intervals data size.
 + * @note    Allowed values are 16, 32 or 64 bits.
 + */
 +#define CH_CFG_INTERVALS_SIZE               32
 +
 +/**
 + * @brief   Time types data size.
 + * @note    Allowed values are 16 or 32 bits.
 + */
 +#define CH_CFG_TIME_TYPES_SIZE              32
 +
 +/**
 + * @brief   Time delta constant for the tick-less mode.
 + * @note    If this value is zero then the system uses the classic
 + *          periodic tick. This value represents the minimum number
 + *          of ticks that is safe to specify in a timeout directive.
 + *          The value one is not valid, timeouts are rounded up to
 + *          this value.
 + */
 +#define CH_CFG_ST_TIMEDELTA                 2
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
 + * @name Kernel parameters and options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Round robin interval.
 + * @details This constant is the number of system ticks allowed for the
 + *          threads before preemption occurs. Setting this value to zero
 + *          disables the preemption for threads with equal priority and the
 + *          round robin becomes cooperative. Note that higher priority
 + *          threads can still preempt, the kernel is always preemptive.
 + * @note    Disabling the round robin preemption makes the kernel more compact
 + *          and generally faster.
 + * @note    The round robin preemption is not supported in tickless mode and
 + *          must be set to zero in that case.
 + */
 +#define CH_CFG_TIME_QUANTUM                 0
 +
 +/**
 + * @brief   Managed RAM size.
 + * @details Size of the RAM area to be managed by the OS. If set to zero
 + *          then the whole available RAM is used. The core memory is made
 + *          available to the heap allocator and/or can be used directly through
 + *          the simplified core memory allocator.
 + *
 + * @note    In order to let the OS manage the whole RAM the linker script must
 + *          provide the @p __heap_base__ and @p __heap_end__ symbols.
 + * @note    Requires @p CH_CFG_USE_MEMCORE.
 + */
 +#define CH_CFG_MEMCORE_SIZE                 0
 +
 +/**
 + * @brief   Idle thread automatic spawn suppression.
 + * @details When this option is activated the function @p chSysInit()
 + *          does not spawn the idle thread. The application @p main()
 + *          function becomes the idle thread and must implement an
 + *          infinite loop.
 + */
 +#define CH_CFG_NO_IDLE_THREAD               FALSE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
 + * @name Performance options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   OS optimization.
 + * @details If enabled then time efficient rather than space efficient code
 + *          is used when two possible implementations exist.
 + *
 + * @note    This is not related to the compiler optimization options.
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_OPTIMIZE_SPEED               TRUE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
 + * @name Subsystem options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Time Measurement APIs.
 + * @details If enabled then the time measurement APIs are included in
 + *          the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_TM                       FALSE
 +
 +/**
 + * @brief   Threads registry APIs.
 + * @details If enabled then the registry APIs are included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_REGISTRY                 TRUE
 +
 +/**
 + * @brief   Threads synchronization APIs.
 + * @details If enabled then the @p chThdWait() function is included in
 + *          the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_WAITEXIT                 TRUE
 +
 +/**
 + * @brief   Semaphores APIs.
 + * @details If enabled then the Semaphores APIs are included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_SEMAPHORES               TRUE
 +
 +/**
 + * @brief   Semaphores queuing mode.
 + * @details If enabled then the threads are enqueued on semaphores by
 + *          priority rather than in FIFO order.
 + *
 + * @note    The default is @p FALSE. Enable this if you have special
 + *          requirements.
 + * @note    Requires @p CH_CFG_USE_SEMAPHORES.
 + */
 +#define CH_CFG_USE_SEMAPHORES_PRIORITY      FALSE
 +
 +/**
 + * @brief   Mutexes APIs.
 + * @details If enabled then the mutexes APIs are included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_MUTEXES                  TRUE
 +
 +/**
 + * @brief   Enables recursive behavior on mutexes.
 + * @note    Recursive mutexes are heavier and have an increased
 + *          memory footprint.
 + *
 + * @note    The default is @p FALSE.
 + * @note    Requires @p CH_CFG_USE_MUTEXES.
 + */
 +#define CH_CFG_USE_MUTEXES_RECURSIVE        FALSE
 +
 +/**
 + * @brief   Conditional Variables APIs.
 + * @details If enabled then the conditional variables APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + * @note    Requires @p CH_CFG_USE_MUTEXES.
 + */
 +#define CH_CFG_USE_CONDVARS                 TRUE
 +
 +/**
 + * @brief   Conditional Variables APIs with timeout.
 + * @details If enabled then the conditional variables APIs with timeout
 + *          specification are included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + * @note    Requires @p CH_CFG_USE_CONDVARS.
 + */
 +#define CH_CFG_USE_CONDVARS_TIMEOUT         TRUE
 +
 +/**
 + * @brief   Events Flags APIs.
 + * @details If enabled then the event flags APIs are included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_EVENTS                   TRUE
 +
 +/**
 + * @brief   Events Flags APIs with timeout.
 + * @details If enabled then the events APIs with timeout specification
 + *          are included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + * @note    Requires @p CH_CFG_USE_EVENTS.
 + */
 +#define CH_CFG_USE_EVENTS_TIMEOUT           TRUE
 +
 +/**
 + * @brief   Synchronous Messages APIs.
 + * @details If enabled then the synchronous messages APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_MESSAGES                 TRUE
 +
 +/**
 + * @brief   Synchronous Messages queuing mode.
 + * @details If enabled then messages are served by priority rather than in
 + *          FIFO order.
 + *
 + * @note    The default is @p FALSE. Enable this if you have special
 + *          requirements.
 + * @note    Requires @p CH_CFG_USE_MESSAGES.
 + */
 +#define CH_CFG_USE_MESSAGES_PRIORITY        FALSE
 +
 +/**
 + * @brief   Mailboxes APIs.
 + * @details If enabled then the asynchronous messages (mailboxes) APIs are
 + *          included in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + * @note    Requires @p CH_CFG_USE_SEMAPHORES.
 + */
 +#define CH_CFG_USE_MAILBOXES                TRUE
 +
 +/**
 + * @brief   Core Memory Manager APIs.
 + * @details If enabled then the core memory manager APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_MEMCORE                  TRUE
 +
 +/**
 + * @brief   Heap Allocator APIs.
 + * @details If enabled then the memory heap allocator APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + * @note    Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
 + *          @p CH_CFG_USE_SEMAPHORES.
 + * @note    Mutexes are recommended.
 + */
 +#define CH_CFG_USE_HEAP                     TRUE
 +
 +/**
 + * @brief   Memory Pools Allocator APIs.
 + * @details If enabled then the memory pools allocator APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_MEMPOOLS                 TRUE
 +
 +/**
 + * @brief  Objects FIFOs APIs.
 + * @details If enabled then the objects FIFOs APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + */
 +#define CH_CFG_USE_OBJ_FIFOS                TRUE
 +
 +/**
 + * @brief   Dynamic Threads APIs.
 + * @details If enabled then the dynamic threads creation APIs are included
 + *          in the kernel.
 + *
 + * @note    The default is @p TRUE.
 + * @note    Requires @p CH_CFG_USE_WAITEXIT.
 + * @note    Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
 + */
 +#define CH_CFG_USE_DYNAMIC                  TRUE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
 + * @name Objects factory options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Objects Factory APIs.
 + * @details If enabled then the objects factory APIs are included in the
 + *          kernel.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_CFG_USE_FACTORY                  TRUE
 +
 +/**
 + * @brief   Maximum length for object names.
 + * @details If the specified length is zero then the name is stored by
 + *          pointer but this could have unintended side effects.
 + */
 +#define CH_CFG_FACTORY_MAX_NAMES_LENGTH     8
 +
 +/**
 + * @brief   Enables the registry of generic objects.
 + */
 +#define CH_CFG_FACTORY_OBJECTS_REGISTRY     TRUE
 +
 +/**
 + * @brief   Enables factory for generic buffers.
 + */
 +#define CH_CFG_FACTORY_GENERIC_BUFFERS      TRUE
 +
 +/**
 + * @brief   Enables factory for semaphores.
 + */
 +#define CH_CFG_FACTORY_SEMAPHORES           TRUE
 +
 +/**
 + * @brief   Enables factory for mailboxes.
 + */
 +#define CH_CFG_FACTORY_MAILBOXES            TRUE
 +
 +/**
 + * @brief   Enables factory for objects FIFOs.
 + */
 +#define CH_CFG_FACTORY_OBJ_FIFOS            TRUE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
 + * @name Debug options
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   Debug option, kernel statistics.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_DBG_STATISTICS                   FALSE
 +
 +/**
 + * @brief   Debug option, system state check.
 + * @details If enabled the correct call protocol for system APIs is checked
 + *          at runtime.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_DBG_SYSTEM_STATE_CHECK           TRUE
 +
 +/**
 + * @brief   Debug option, parameters checks.
 + * @details If enabled then the checks on the API functions input
 + *          parameters are activated.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_DBG_ENABLE_CHECKS                TRUE
 +
 +/**
 + * @brief   Debug option, consistency checks.
 + * @details If enabled then all the assertions in the kernel code are
 + *          activated. This includes consistency checks inside the kernel,
 + *          runtime anomalies and port-defined checks.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_DBG_ENABLE_ASSERTS               TRUE
 +
 +/**
 + * @brief   Debug option, trace buffer.
 + * @details If enabled then the trace buffer is activated.
 + *
 + * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.
 + */
 +#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_ALL
 +
 +/**
 + * @brief   Trace buffer entries.
 + * @note    The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
 + *          different from @p CH_DBG_TRACE_MASK_DISABLED.
 + */
 +#define CH_DBG_TRACE_BUFFER_SIZE            128
 +
 +/**
 + * @brief   Debug option, stack checks.
 + * @details If enabled then a runtime stack check is performed.
 + *
 + * @note    The default is @p FALSE.
 + * @note    The stack check is performed in a architecture/port dependent way.
 + *          It may not be implemented or some ports.
 + * @note    The default failure mode is to halt the system with the global
 + *          @p panic_msg variable set to @p NULL.
 + */
 +#define CH_DBG_ENABLE_STACK_CHECK           TRUE
 +
 +/**
 + * @brief   Debug option, stacks initialization.
 + * @details If enabled then the threads working area is filled with a byte
 + *          value when a thread is created. This can be useful for the
 + *          runtime measurement of the used stack.
 + *
 + * @note    The default is @p FALSE.
 + */
 +#define CH_DBG_FILL_THREADS                 TRUE
 +
 +/**
 + * @brief   Debug option, threads profiling.
 + * @details If enabled then a field is added to the @p thread_t structure that
 + *          counts the system ticks occurred while executing the thread.
 + *
 + * @note    The default is @p FALSE.
 + * @note    This debug option is not currently compatible with the
 + *          tickless mode.
 + */
 +#define CH_DBG_THREADS_PROFILING            FALSE
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/**
 + * @name Kernel hooks
 + * @{
 + */
 +/*===========================================================================*/
 +
 +/**
 + * @brief   System structure extension.
 + * @details User fields added to the end of the @p ch_system_t structure.
 + */
 +#define CH_CFG_SYSTEM_EXTRA_FIELDS                                          \
 +  /* Add threads custom fields here.*/
 +
 +/**
 + * @brief   System initialization hook.
 + * @details User initialization code added to the @p chSysInit() function
 + *          just before interrupts are enabled globally.
 + */
 +#define CH_CFG_SYSTEM_INIT_HOOK(tp) {                                       \
 +  /* Add threads initialization code here.*/                                \
 +}
 +
 +/**
 + * @brief   Threads descriptor structure extension.
 + * @details User fields added to the end of the @p thread_t structure.
 + */
 +#define CH_CFG_THREAD_EXTRA_FIELDS                                          \
 +  /* Add threads custom fields here.*/
 +
 +/**
 + * @brief   Threads initialization hook.
 + * @details User initialization code added to the @p _thread_init() function.
 + *
 + * @note    It is invoked from within @p _thread_init() and implicitly from all
 + *          the threads creation APIs.
 + */
 +#define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \
 +  /* Add threads initialization code here.*/                                \
 +}
 +
 +/**
 + * @brief   Threads finalization hook.
 + * @details User finalization code added to the @p chThdExit() API.
 + */
 +#define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \
 +  /* Add threads finalization code here.*/                                  \
 +}
 +
 +/**
 + * @brief   Context switch hook.
 + * @details This hook is invoked just before switching between threads.
 + */
 +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) {                              \
 +  /* Context switch code here.*/                                            \
 +}
 +
 +/**
 + * @brief   ISR enter hook.
 + */
 +#define CH_CFG_IRQ_PROLOGUE_HOOK() {                                        \
 +  /* IRQ prologue code here.*/                                              \
 +}
 +
 +/**
 + * @brief   ISR exit hook.
 + */
 +#define CH_CFG_IRQ_EPILOGUE_HOOK() {                                        \
 +  /* IRQ epilogue code here.*/                                              \
 +}
 +
 +/**
 + * @brief   Idle thread enter hook.
 + * @note    This hook is invoked within a critical zone, no OS functions
 + *          should be invoked from here.
 + * @note    This macro can be used to activate a power saving mode.
 + */
 +#define CH_CFG_IDLE_ENTER_HOOK() {                                          \
 +  /* Idle-enter code here.*/                                                \
 +}
 +
 +/**
 + * @brief   Idle thread leave hook.
 + * @note    This hook is invoked within a critical zone, no OS functions
 + *          should be invoked from here.
 + * @note    This macro can be used to deactivate a power saving mode.
 + */
 +#define CH_CFG_IDLE_LEAVE_HOOK() {                                          \
 +  /* Idle-leave code here.*/                                                \
 +}
 +
 +/**
 + * @brief   Idle Loop hook.
 + * @details This hook is continuously invoked by the idle thread loop.
 + */
 +#define CH_CFG_IDLE_LOOP_HOOK() {                                           \
 +  /* Idle loop code here.*/                                                 \
 +}
 +
 +/**
 + * @brief   System tick event hook.
 + * @details This hook is invoked in the system tick handler immediately
 + *          after processing the virtual timers queue.
 + */
 +#define CH_CFG_SYSTEM_TICK_HOOK() {                                         \
 +  /* System tick event code here.*/                                         \
 +}
 +
 +/**
 + * @brief   System halt hook.
 + * @details This hook is invoked in case to a system halting error before
 + *          the system is halted.
 + */
 +#define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \
 +  /* System halt code here.*/                                               \
 +}
 +
 +/**
 + * @brief   Trace hook.
 + * @details This hook is invoked each time a new record is written in the
 + *          trace buffer.
 + */
 +#define CH_CFG_TRACE_HOOK(tep) {                                            \
 +  /* Trace code here.*/                                                     \
 +}
 +
 +/** @} */
 +
 +/*===========================================================================*/
 +/* Port-specific settings (override port settings defaulted in chcore.h).    */
 +/*===========================================================================*/
 +
 +#endif  /* CHCONF_H */
 +
 +/** @} */
 diff --git a/testhal/TIVA/TM4C123x/ADC/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch b/testhal/TIVA/TM4C123x/ADC/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch deleted file mode 100644 index 0af6b44..0000000 --- a/testhal/TIVA/TM4C123x/ADC/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"> -<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> -<listEntry value="org.eclipse.ui.externaltools.launchGroup"/> -</listAttribute> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${eclipse_home}\..\tools\openocd\bin\openocd.exe"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-c "telnet_port 4444" -f "interface/ti-icdi.cfg" -f "${file_prompt}""/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${eclipse_home}\..\tools\openocd\scripts\"/> -</launchConfiguration> diff --git a/testhal/TIVA/TM4C123x/GPT/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch b/testhal/TIVA/TM4C123x/GPT/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch deleted file mode 100644 index 0af6b44..0000000 --- a/testhal/TIVA/TM4C123x/GPT/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"> -<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> -<listEntry value="org.eclipse.ui.externaltools.launchGroup"/> -</listAttribute> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${eclipse_home}\..\tools\openocd\bin\openocd.exe"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-c "telnet_port 4444" -f "interface/ti-icdi.cfg" -f "${file_prompt}""/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${eclipse_home}\..\tools\openocd\scripts\"/> -</launchConfiguration> diff --git a/testhal/TIVA/TM4C123x/I2C/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch b/testhal/TIVA/TM4C123x/I2C/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch deleted file mode 100644 index 0af6b44..0000000 --- a/testhal/TIVA/TM4C123x/I2C/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"> -<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> -<listEntry value="org.eclipse.ui.externaltools.launchGroup"/> -</listAttribute> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${eclipse_home}\..\tools\openocd\bin\openocd.exe"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-c "telnet_port 4444" -f "interface/ti-icdi.cfg" -f "${file_prompt}""/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${eclipse_home}\..\tools\openocd\scripts\"/> -</launchConfiguration> diff --git a/testhal/TIVA/TM4C123x/PWM/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch b/testhal/TIVA/TM4C123x/PWM/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch deleted file mode 100644 index 0af6b44..0000000 --- a/testhal/TIVA/TM4C123x/PWM/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"> -<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> -<listEntry value="org.eclipse.ui.externaltools.launchGroup"/> -</listAttribute> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${eclipse_home}\..\tools\openocd\bin\openocd.exe"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-c "telnet_port 4444" -f "interface/ti-icdi.cfg" -f "${file_prompt}""/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${eclipse_home}\..\tools\openocd\scripts\"/> -</launchConfiguration> diff --git a/testhal/TIVA/TM4C123x/SPI/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch b/testhal/TIVA/TM4C123x/SPI/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch deleted file mode 100644 index 0af6b44..0000000 --- a/testhal/TIVA/TM4C123x/SPI/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"> -<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> -<listEntry value="org.eclipse.ui.externaltools.launchGroup"/> -</listAttribute> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${eclipse_home}\..\tools\openocd\bin\openocd.exe"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-c "telnet_port 4444" -f "interface/ti-icdi.cfg" -f "${file_prompt}""/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${eclipse_home}\..\tools\openocd\scripts\"/> -</launchConfiguration> diff --git a/testhal/TIVA/TM4C123x/UART/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch b/testhal/TIVA/TM4C123x/UART/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch deleted file mode 100644 index 0af6b44..0000000 --- a/testhal/TIVA/TM4C123x/UART/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"> -<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> -<listEntry value="org.eclipse.ui.externaltools.launchGroup"/> -</listAttribute> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${eclipse_home}\..\tools\openocd\bin\openocd.exe"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-c "telnet_port 4444" -f "interface/ti-icdi.cfg" -f "${file_prompt}""/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${eclipse_home}\..\tools\openocd\scripts\"/> -</launchConfiguration> diff --git a/testhal/TIVA/TM4C123x/WDG/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch b/testhal/TIVA/TM4C123x/WDG/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch deleted file mode 100644 index 0af6b44..0000000 --- a/testhal/TIVA/TM4C123x/WDG/debug/OpenOCD on ICDI (prompts for .cfg target configuration).launch +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"> -<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> -<listEntry value="org.eclipse.ui.externaltools.launchGroup"/> -</listAttribute> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${eclipse_home}\..\tools\openocd\bin\openocd.exe"/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-c "telnet_port 4444" -f "interface/ti-icdi.cfg" -f "${file_prompt}""/> -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${eclipse_home}\..\tools\openocd\scripts\"/> -</launchConfiguration> | 
