diff options
60 files changed, 1278 insertions, 515 deletions
| diff --git a/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/Makefile b/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/Makefile index 256c0a4..894fe9d 100644 --- a/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/Makefile +++ b/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/Makefile @@ -69,7 +69,7 @@ ifeq ($(USE_EXCEPTIONS_STACKSIZE),)    USE_EXCEPTIONS_STACKSIZE = 0x400
  endif
 -# Enables the use of FPU on Cortex-M4 (no, softfp, hard).
 +# Enables the use of FPU (no, softfp, hard).
  ifeq ($(USE_FPU),)
    USE_FPU = no
  endif
 @@ -89,7 +89,7 @@ PROJECT = ch  CHIBIOS = ../../../../ChibiOS-RT
  CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib
  # Startup files.
 -include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk
 +include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk
  # HAL-OSAL files (optional).
  include $(CHIBIOS_CONTRIB)/os/hal/hal.mk
  include $(CHIBIOS_CONTRIB)/os/hal/ports/STM32/STM32F4xx/platform.mk
 @@ -97,9 +97,11 @@ include $(CHIBIOS)/os/hal/boards/ST_STM32F429I_DISCOVERY/board.mk  include $(CHIBIOS)/os/hal/osal/rt/osal.mk
  # RTOS files (optional).
  include $(CHIBIOS)/os/rt/rt.mk
 -include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
 +include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
  # Other files (optional).
  include $(CHIBIOS)/test/rt/test.mk
 +include $(CHIBIOS)/os/hal/lib/streams/streams.mk
 +include $(CHIBIOS)/os/various/shell/shell.mk
  # Define linker script file here
  LDSCRIPT = STM32F429xI_SDRAM.ld
 @@ -114,14 +116,12 @@ CSRC = $(STARTUPSRC) \         $(PLATFORMSRC) \
         $(BOARDSRC) \
         $(TESTSRC) \
 -       $(CHIBIOS)/os/various/shell.c \
 -       $(CHIBIOS)/os/hal/lib/streams/memstreams.c \
 -       $(CHIBIOS)/os/hal/lib/streams/chprintf.c \
 +       $(STREAMSSRC) \
 +       $(SHELLSRC) \
         $(CHIBIOS_CONTRIB)/os/various/devices_lib/lcd/ili9341.c \
 -       ./main.c \
 -       ./wolf3d_palette.c \
 -       ./res/wolf3d_vgagraph_chunk87.c \
 -       # eol
 +       main.c \
 +       wolf3d_palette.c \
 +       res/wolf3d_vgagraph_chunk87.c
  # C++ sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
 @@ -154,11 +154,10 @@ ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)  INCDIR = $(CHIBIOS)/os/license \
           $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
           $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
 +         $(STREAMSINC) $(SHELLINC) \
           $(CHIBIOS)/os/various \
 -         $(CHIBIOS)/os/hal/lib/streams \
           $(CHIBIOS_CONTRIB)/os/various/devices_lib/lcd \
 -         ./res \
 -         # eol
 +         res
  #
  # Project, sources and paths
 @@ -194,10 +193,10 @@ AOPT =  TOPT = -mthumb -DTHUMB
  # Define C warning options here
 -CWARN = -Wall -Wextra -Wstrict-prototypes
 +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes
  # Define C++ warning options here
 -CPPWARN = -Wall -Wextra
 +CPPWARN = -Wall -Wextra -Wundef
  #
  # Compiler settings
 @@ -226,5 +225,5 @@ ULIBS =  # End of user defines
  ##############################################################################
 -RULESPATH = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC
 +RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC
  include $(RULESPATH)/rules.mk
 diff --git a/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/STM32F429xI_SDRAM.ld b/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/STM32F429xI_SDRAM.ld index 26bed86..ae5c084 100644 --- a/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/STM32F429xI_SDRAM.ld +++ b/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/STM32F429xI_SDRAM.ld @@ -1,20 +1,17 @@  /*
 -    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio.
 +    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
 -    This file is part of ChibiOS.
 +    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
 -    ChibiOS is free software; you can redistribute it and/or modify
 -    it under the terms of the GNU General Public License as published by
 -    the Free Software Foundation; either version 3 of the License, or
 -    (at your option) any later version.
 +        http://www.apache.org/licenses/LICENSE-2.0
 -    ChibiOS is distributed in the hope that it will be useful,
 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 -    GNU General Public License for more details.
 -
 -    You should have received a copy of the GNU General Public License
 -    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 +    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.
  */
  /*
 @@ -23,19 +20,52 @@   */
  MEMORY
  {
 -    flash : org = 0x08000000, len = 2M
 -    ram0  : org = 0x20000000, len = 192k    /* SRAM1 + SRAM2 + SRAM3 */
 -    ram1  : org = 0x20000000, len = 112k    /* SRAM1 */
 -    ram2  : org = 0x2001C000, len = 16k     /* SRAM2 */
 -    ram3  : org = 0x20020000, len = 64k     /* SRAM3 */
 -    ram4  : org = 0x10000000, len = 64k     /* CCM SRAM */
 -    ram5  : org = 0x40024000, len = 4k      /* BCKP SRAM */
 -    ram6  : org = 0x00000000, len = 0
 -    ram7  : org = 0xD0000000, len = 8M      /* SDRAM */
 +    flash0 : org = 0x08000000, len = 2M
 +    flash1  : org = 0x00000000, len = 0
 +    flash2  : org = 0x00000000, len = 0
 +    flash3  : org = 0x00000000, len = 0
 +    flash4  : org = 0x00000000, len = 0
 +    flash5  : org = 0x00000000, len = 0
 +    flash6  : org = 0x00000000, len = 0
 +    flash7  : org = 0x00000000, len = 0
 +    ram0    : org = 0x20000000, len = 192k    /* SRAM1 + SRAM2 + SRAM3 */
 +    ram1    : org = 0x20000000, len = 112k    /* SRAM1 */
 +    ram2    : org = 0x2001C000, len = 16k     /* SRAM2 */
 +    ram3    : org = 0x20020000, len = 64k     /* SRAM3 */
 +    ram4    : org = 0x10000000, len = 64k     /* CCM SRAM */
 +    ram5    : org = 0x40024000, len = 4k      /* BCKP SRAM */
 +    ram6    : org = 0x00000000, len = 0
 +    ram7    : org = 0xD0000000, len = 8M      /* SDRAM */
  }
 +/* For each data/text section two region are defined, a virtual region
 +   and a load region (_LMA suffix).*/
 +
 +/* Flash region to be used for exception vectors.*/
 +REGION_ALIAS("VECTORS_FLASH", flash0);
 +REGION_ALIAS("VECTORS_FLASH_LMA", flash0);
 +
 +/* Flash region to be used for constructors and destructors.*/
 +REGION_ALIAS("XTORS_FLASH", flash0);
 +REGION_ALIAS("XTORS_FLASH_LMA", flash0);
 +
 +/* Flash region to be used for code text.*/
 +REGION_ALIAS("TEXT_FLASH", flash0);
 +REGION_ALIAS("TEXT_FLASH_LMA", flash0);
 +
 +/* Flash region to be used for read only data.*/
 +REGION_ALIAS("RODATA_FLASH", flash0);
 +REGION_ALIAS("RODATA_FLASH_LMA", flash0);
 +
 +/* Flash region to be used for various.*/
 +REGION_ALIAS("VARIOUS_FLASH", flash0);
 +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0);
 +
 +/* Flash region to be used for RAM(n) initialization data.*/
 +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0);
 +
  /* RAM region to be used for Main stack. This stack accommodates the processing
 -   of all exceptions and interrupts*/
 +   of all exceptions and interrupts.*/
  REGION_ALIAS("MAIN_STACK_RAM", ram0);
  /* RAM region to be used for the process stack. This is the stack used by
 @@ -44,14 +74,16 @@ REGION_ALIAS("PROCESS_STACK_RAM", ram0);  /* RAM region to be used for data segment.*/
  REGION_ALIAS("DATA_RAM", ram0);
 +REGION_ALIAS("DATA_RAM_LMA", flash0);
  /* RAM region to be used for BSS segment.*/
  REGION_ALIAS("BSS_RAM", ram0);
 -/* RAM region to be used for BSS segment.*/
 +/* RAM region to be used for the default heap.*/
  REGION_ALIAS("HEAP_RAM", ram0);
  /* RAM region to be used for SDRAM segment.*/
  REGION_ALIAS("SDRAM_RAM", ram7);
 +/* Generic rules inclusion.*/
  INCLUDE rules.ld
 diff --git a/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/chconf.h b/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/chconf.h index 71e0cac..a0fc879 100644 --- a/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/chconf.h +++ b/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/chconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
 +    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.
 @@ -25,8 +25,10 @@   * @{
   */
 -#ifndef _CHCONF_H_
 -#define _CHCONF_H_
 +#ifndef CHCONF_H
 +#define CHCONF_H
 +
 +#define _CHIBIOS_RT_CONF_
  /*===========================================================================*/
  /**
 @@ -349,12 +351,18 @@  /**
   * @brief   Debug option, trace buffer.
 - * @details If enabled then the context switch circular trace buffer is
 - *          activated.
 + * @details If enabled then the trace buffer is activated.
   *
 - * @note    The default is @p FALSE.
 + * @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_ENABLE_TRACE                 TRUE
 +#define CH_DBG_TRACE_BUFFER_SIZE            128
  /**
   * @brief   Debug option, stack checks.
 @@ -419,10 +427,6 @@  /**
   * @brief   Threads finalization hook.
   * @details User finalization code added to the @p chThdExit() API.
 - *
 - * @note    It is inserted into lock zone.
 - * @note    It is also invoked when the threads simply return in order to
 - *          terminate.
   */
  #define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \
    /* Add threads finalization code here.*/                                  \
 @@ -437,12 +441,27 @@  }
  /**
 + * @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.*/                                                \
  }
  /**
 @@ -452,6 +471,7 @@   * @note    This macro can be used to deactivate a power saving mode.
   */
  #define CH_CFG_IDLE_LEAVE_HOOK() {                                          \
 +  /* Idle-leave code here.*/                                                \
  }
  /**
 @@ -480,12 +500,21 @@    /* 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_ */
 +#endif  /* CHCONF_H */
  /** @} */
 diff --git a/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/halconf.h b/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/halconf.h index 389c09d..e9b1a23 100644 --- a/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/halconf.h +++ b/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/halconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
 +    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.
 @@ -25,8 +25,8 @@   * @{
   */
 -#ifndef _HALCONF_H_
 -#define _HALCONF_H_
 +#ifndef HALCONF_H
 +#define HALCONF_H
  #include "mcuconf.h"
 @@ -294,7 +294,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 +309,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 +345,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' includes                                               */
  /*===========================================================================*/
  #include "halconf_community.h"
 -#endif /* _HALCONF_H_ */
 +#endif /* HALCONF_H */
  /** @} */
 diff --git a/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/halconf_community.h b/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/halconf_community.h index b2376d4..24b3e4d 100644 --- a/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/halconf_community.h +++ b/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/halconf_community.h @@ -45,6 +45,28 @@  #define HAL_USE_ONEWIRE             FALSE  #endif +/** + * @brief   Enables the EICU subsystem. + */ +#if !defined(HAL_USE_EICU) || defined(__DOXYGEN__) +#define HAL_USE_EICU                FALSE +#endif + +/** + * @brief   Enables the CRC subsystem. + */ +#if !defined(HAL_USE_CRC) || defined(__DOXYGEN__) +#define HAL_USE_CRC                 FALSE +#endif + +/** + * @brief   Enables the RNG subsystem. + */ +#if !defined(HAL_USE_RNG) || defined(__DOXYGEN__) +#define HAL_USE_RNG                 FALSE +#endif + +  /*===========================================================================*/  /* FSMCNAND driver related settings.                                         */  /*===========================================================================*/ diff --git a/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/main.c b/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/main.c index d0b07d3..aa7ac10 100644 --- a/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/main.c +++ b/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/main.c @@ -16,18 +16,17 @@  #include "ch.h"
  #include "hal.h"
 -#include "test.h"
  #include "chprintf.h"
  #include "shell.h"
 -#if HAL_USE_SERIAL_USB
 +#if (HAL_USE_SERIAL_USB == TRUE)
  #include "usbcfg.h"
  #endif
 -#include "fsmc_sdram.h"
 +#include "hal_fsmc_sdram.h"
  #include "ili9341.h"
 -#include "stm32_ltdc.h"
 -#include "stm32_dma2d.h"
 +#include "hal_stm32_ltdc.h"
 +#include "hal_stm32_dma2d.h"
  #include "res/wolf3d_vgagraph_chunk87.h"
 @@ -474,7 +473,7 @@ static void dma2d_test(void) {  /* Command line related.                                                     */
  /*===========================================================================*/
 -#if HAL_USE_SERIAL_USB
 +#if (HAL_USE_SERIAL_USB == TRUE)
  /* Virtual serial port over USB.*/
  SerialUSBDriver SDU1;
  #endif
 @@ -482,57 +481,6 @@ SerialUSBDriver SDU1;  #define SHELL_WA_SIZE   THD_WORKING_AREA_SIZE(2048)
  #define TEST_WA_SIZE    THD_WORKING_AREA_SIZE(256)
 -static void cmd_mem(BaseSequentialStream *chp, int argc, char *argv[]) {
 -  size_t n, size;
 -
 -  (void)argv;
 -  if (argc > 0) {
 -    chprintf(chp, "Usage: mem\r\n");
 -    return;
 -  }
 -  n = chHeapStatus(NULL, &size);
 -  chprintf(chp, "core free memory : %u bytes\r\n", chCoreGetStatusX());
 -  chprintf(chp, "heap fragments   : %u\r\n", n);
 -  chprintf(chp, "heap free total  : %u bytes\r\n", size);
 -}
 -
 -static void cmd_threads(BaseSequentialStream *chp, int argc, char *argv[]) {
 -  static const char *states[] = {CH_STATE_NAMES};
 -  thread_t *tp;
 -
 -  (void)argv;
 -  if (argc > 0) {
 -    chprintf(chp, "Usage: threads\r\n");
 -    return;
 -  }
 -  chprintf(chp, "    addr    stack prio refs     state time\r\n");
 -  tp = chRegFirstThread();
 -  do {
 -    chprintf(chp, "%08lx %08lx %4lu %4lu %9s\r\n",
 -            (uint32_t)tp, (uint32_t)tp->p_ctx.r13,
 -            (uint32_t)tp->p_prio, (uint32_t)(tp->p_refs - 1),
 -            states[tp->p_state]);
 -    tp = chRegNextThread(tp);
 -  } while (tp != NULL);
 -}
 -
 -static void cmd_test(BaseSequentialStream *chp, int argc, char *argv[]) {
 -  thread_t *tp;
 -
 -  (void)argv;
 -  if (argc > 0) {
 -    chprintf(chp, "Usage: test\r\n");
 -    return;
 -  }
 -  tp = chThdCreateFromHeap(NULL, TEST_WA_SIZE, chThdGetPriorityX(),
 -                           TestThread, chp);
 -  if (tp == NULL) {
 -    chprintf(chp, "out of memory\r\n");
 -    return;
 -  }
 -  chThdWait(tp);
 -}
 -
  static void cmd_reset(BaseSequentialStream *chp, int argc, char *argv[]) {
    (void)argv;
    if (argc > 0) {
 @@ -546,15 +494,12 @@ static void cmd_reset(BaseSequentialStream *chp, int argc, char *argv[]) {  }
  static const ShellCommand commands[] = {
 -  {"mem", cmd_mem},
 -  {"threads", cmd_threads},
 -  {"test", cmd_test},
    {"reset", cmd_reset},
    {NULL, NULL}
  };
  static const ShellConfig shell_cfg1 = {
 -#if HAL_USE_SERIAL_USB
 +#if (HAL_USE_SERIAL_USB == TRUE)
    (BaseSequentialStream *)&SDU1,
  #else
    (BaseSequentialStream *)&SD1,
 @@ -587,7 +532,7 @@ int main(void) {     */
    shellInit();
 -#if HAL_USE_SERIAL_USB
 +#if (HAL_USE_SERIAL_USB == TRUE)
    /*
     * Initializes a serial-over-USB CDC driver.
     */
 @@ -648,13 +593,13 @@ int main(void) {     */
    while (true) {
      if (!shelltp) {
 -#if HAL_USE_SERIAL_USB
 +#if (HAL_USE_SERIAL_USB == TRUE)
        if (SDU1.config->usbp->state == USB_ACTIVE) {
          /* Spawns a new shell.*/
 -        shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO);
 +        shelltp = chThdCreateFromHeap(NULL, SHELL_WA_SIZE, "shell", NORMALPRIO, shellThread, (void *) &shell_cfg1);
        }
  #else
 -      shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO);
 +        shelltp = chThdCreateFromHeap(NULL, SHELL_WA_SIZE, "shell", NORMALPRIO, shellThread, (void *) &shell_cfg1);
  #endif
      }
      else {
 diff --git a/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/mcuconf.h b/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/mcuconf.h index 7aab0c4..817ed59 100644 --- a/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/mcuconf.h +++ b/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/mcuconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
 +    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.
 @@ -14,8 +14,8 @@      limitations under the License.
  */
 -#ifndef _MCUCONF_H_
 -#define _MCUCONF_H_
 +#ifndef MCUCONF_H
 +#define MCUCONF_H
  /*
   * STM32F4xx drivers configuration.
 @@ -176,6 +176,21 @@  #define STM32_I2C_DMA_ERROR_HOOK(i2cp)      osalSysHalt("DMA failure")
  /*
 + * I2S driver system settings.
 + */
 +#define STM32_I2S_USE_SPI2                  FALSE
 +#define STM32_I2S_USE_SPI3                  FALSE
 +#define STM32_I2S_SPI2_IRQ_PRIORITY         10
 +#define STM32_I2S_SPI3_IRQ_PRIORITY         10
 +#define STM32_I2S_SPI2_DMA_PRIORITY         1
 +#define STM32_I2S_SPI3_DMA_PRIORITY         1
 +#define STM32_I2S_SPI2_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 3)
 +#define STM32_I2S_SPI2_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 4)
 +#define STM32_I2S_SPI3_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 0)
 +#define STM32_I2S_SPI3_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 7)
 +#define STM32_I2S_DMA_ERROR_HOOK(i2sp)      osalSysHalt("DMA failure")
 +
 +/*
   * ICU driver system settings.
   */
  #define STM32_ICU_USE_TIM1                  FALSE
 @@ -340,6 +355,11 @@  #define STM32_USB_OTGFIFO_FILL_BASEPRI      0
  /*
 + * WDG driver system settings.
 + */
 +#define STM32_WDG_USE_IWDG                  FALSE
 +
 +/*
   * LTDC driver system settings.
   */
  #define STM32_LTDC_USE_LTDC                 TRUE
 @@ -357,4 +377,4 @@   */
  #include "mcuconf_community.h"
 -#endif /* _MCUCONF_H_ */
 +#endif /* MCUCONF_H */
 diff --git a/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/mcuconf_community.h b/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/mcuconf_community.h index 81c7e2c..e572973 100644 --- a/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/mcuconf_community.h +++ b/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/mcuconf_community.h @@ -21,8 +21,24 @@  #define STM32_FSMC_FSMC1_IRQ_PRIORITY       10  /* + * FSMC NAND driver system settings. + */ +#define STM32_NAND_USE_FSMC_NAND1           FALSE +#define STM32_NAND_USE_FSMC_NAND2           FALSE +#define STM32_NAND_USE_EXT_INT              FALSE + +/*   * FSMC SDRAM driver system settings.   */  #define STM32_USE_FSMC_SDRAM                TRUE  #define STM32_SDRAM_USE_FSMC_SDRAM1         FALSE  #define STM32_SDRAM_USE_FSMC_SDRAM2         TRUE + +/* + * FSMC SRAM driver system settings. + */ +#define STM32_USE_FSMC_SRAM                 FALSE +#define STM32_SRAM_USE_FSMC_SRAM1           FALSE +#define STM32_SRAM_USE_FSMC_SRAM2           FALSE +#define STM32_SRAM_USE_FSMC_SRAM3           FALSE +#define STM32_SRAM_USE_FSMC_SRAM4           FALSE diff --git a/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/wolf3d_palette.c b/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/wolf3d_palette.c index 666cbcb..ef84a1f 100644 --- a/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/wolf3d_palette.c +++ b/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/wolf3d_palette.c @@ -1,6 +1,6 @@  #include <ch.h>
  #include <hal.h>
 -#include <stm32_ltdc.h>
 +#include <hal_stm32_ltdc.h>
  const ltdc_color_t wolf3d_palette[256] __attribute__((aligned(4))) = {
    0xFF000000,   /* 0x00 */
 diff --git a/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/Makefile b/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/Makefile index d502e66..68fe855 100644 --- a/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/Makefile +++ b/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/Makefile @@ -69,7 +69,7 @@ ifeq ($(USE_EXCEPTIONS_STACKSIZE),)    USE_EXCEPTIONS_STACKSIZE = 0x400
  endif
 -# Enables the use of FPU on Cortex-M4 (no, softfp, hard).
 +# Enables the use of FPU (no, softfp, hard).
  ifeq ($(USE_FPU),)
    USE_FPU = no
  endif
 @@ -89,7 +89,7 @@ PROJECT = ch  CHIBIOS = ../../../../ChibiOS-RT
  CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib
  # Startup files.
 -include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk
 +include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk
  # HAL-OSAL files (optional).
  include $(CHIBIOS_CONTRIB)/os/hal/hal.mk
  include $(CHIBIOS_CONTRIB)/os/hal/ports/STM32/STM32F4xx/platform.mk
 @@ -97,9 +97,11 @@ include $(CHIBIOS)/os/hal/boards/ST_STM32F429I_DISCOVERY/board.mk  include $(CHIBIOS)/os/hal/osal/rt/osal.mk
  # RTOS files (optional).
  include $(CHIBIOS)/os/rt/rt.mk
 -include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
 +include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
  # Other files (optional).
  include $(CHIBIOS)/test/rt/test.mk
 +include $(CHIBIOS)/os/hal/lib/streams/streams.mk
 +include $(CHIBIOS)/os/various/shell/shell.mk
  # Define linker script file here
  LDSCRIPT = $(STARTUPLD)/STM32F429xI.ld
 @@ -114,13 +116,11 @@ CSRC = $(STARTUPSRC) \         $(PLATFORMSRC) \
         $(BOARDSRC) \
         $(TESTSRC) \
 -       $(CHIBIOS)/os/various/shell.c \
 -       $(CHIBIOS)/os/hal/lib/streams/memstreams.c \
 -       $(CHIBIOS)/os/hal/lib/streams/chprintf.c \
 +       $(STREAMSSRC) \
 +       $(SHELLSRC) \
         $(CHIBIOS_CONTRIB)/os/various/tribuf.c \
 -       ./usbcfg.c \
 -       ./main.c \
 -       # eol
 +       usbcfg.c \
 +       main.c
  # C++ sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
 @@ -153,10 +153,9 @@ ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)  INCDIR = $(CHIBIOS)/os/license \
           $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
           $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
 +         $(STREAMSINC) $(SHELLINC) \
           $(CHIBIOS)/os/various \
 -         $(CHIBIOS)/os/hal/lib/streams \
 -         $(CHIBIOS_CONTRIB)/os/various \
 -         # eol
 +         $(CHIBIOS_CONTRIB)/os/various
  #
  # Project, sources and paths
 @@ -192,10 +191,10 @@ AOPT =  TOPT = -mthumb -DTHUMB
  # Define C warning options here
 -CWARN = -Wall -Wextra -Wstrict-prototypes
 +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes
  # Define C++ warning options here
 -CPPWARN = -Wall -Wextra
 +CPPWARN = -Wall -Wextra -Wundef
  #
  # Compiler settings
 @@ -224,5 +223,5 @@ ULIBS =  # End of user defines
  ##############################################################################
 -RULESPATH = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC
 +RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC
  include $(RULESPATH)/rules.mk
 diff --git a/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/chconf.h b/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/chconf.h index ebc01e2..9a33ce5 100644 --- a/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/chconf.h +++ b/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/chconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
 +    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.
 @@ -25,8 +25,10 @@   * @{
   */
 -#ifndef _CHCONF_H_
 -#define _CHCONF_H_
 +#ifndef CHCONF_H
 +#define CHCONF_H
 +
 +#define _CHIBIOS_RT_CONF_
  /*===========================================================================*/
  /**
 @@ -349,12 +351,18 @@  /**
   * @brief   Debug option, trace buffer.
 - * @details If enabled then the context switch circular trace buffer is
 - *          activated.
 + * @details If enabled then the trace buffer is activated.
   *
 - * @note    The default is @p FALSE.
 + * @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_ENABLE_TRACE                 TRUE
 +#define CH_DBG_TRACE_BUFFER_SIZE            128
  /**
   * @brief   Debug option, stack checks.
 @@ -419,10 +427,6 @@  /**
   * @brief   Threads finalization hook.
   * @details User finalization code added to the @p chThdExit() API.
 - *
 - * @note    It is inserted into lock zone.
 - * @note    It is also invoked when the threads simply return in order to
 - *          terminate.
   */
  #define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \
    /* Add threads finalization code here.*/                                  \
 @@ -437,12 +441,27 @@  }
  /**
 + * @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.*/                                                \
  }
  /**
 @@ -452,6 +471,7 @@   * @note    This macro can be used to deactivate a power saving mode.
   */
  #define CH_CFG_IDLE_LEAVE_HOOK() {                                          \
 +  /* Idle-leave code here.*/                                                \
  }
  /**
 @@ -480,6 +500,15 @@    /* 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.*/                                                     \
 +}
 +
  /** @} */
  /*===========================================================================*/
 @@ -488,6 +517,6 @@  #define TRIBUF_USE_WAIT                     TRUE
 -#endif  /* _CHCONF_H_ */
 +#endif  /* CHCONF_H */
  /** @} */
 diff --git a/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/halconf.h b/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/halconf.h index bec24bd..ebe3af9 100644 --- a/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/halconf.h +++ b/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/halconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
 +    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.
 @@ -25,8 +25,8 @@   * @{
   */
 -#ifndef _HALCONF_H_
 -#define _HALCONF_H_
 +#ifndef HALCONF_H
 +#define HALCONF_H
  #include "mcuconf.h"
 @@ -294,7 +294,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 +309,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 +345,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' includes                                               */
  /*===========================================================================*/
  #include "halconf_community.h"
 -#endif /* _HALCONF_H_ */
 +#endif /* HALCONF_H */
  /** @} */
 diff --git a/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/halconf_community.h b/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/halconf_community.h index 4156dbf..cf1289f 100644 --- a/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/halconf_community.h +++ b/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/halconf_community.h @@ -45,6 +45,28 @@  #define HAL_USE_ONEWIRE             FALSE  #endif +/** + * @brief   Enables the EICU subsystem. + */ +#if !defined(HAL_USE_EICU) || defined(__DOXYGEN__) +#define HAL_USE_EICU                FALSE +#endif + +/** + * @brief   Enables the CRC subsystem. + */ +#if !defined(HAL_USE_CRC) || defined(__DOXYGEN__) +#define HAL_USE_CRC                 FALSE +#endif + +/** + * @brief   Enables the RNG subsystem. + */ +#if !defined(HAL_USE_RNG) || defined(__DOXYGEN__) +#define HAL_USE_RNG                 FALSE +#endif + +  /*===========================================================================*/  /* FSMCNAND driver related settings.                                         */  /*===========================================================================*/ diff --git a/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/main.c b/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/main.c index 25ffd87..a7a33f6 100644 --- a/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/main.c +++ b/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/main.c @@ -16,7 +16,6 @@  #include "ch.h"
  #include "hal.h"
 -#include "test.h"
  #include "chprintf.h"
  #include "shell.h"
 @@ -197,63 +196,6 @@ static THD_FUNCTION(writer_thread, arg) {  #define SHELL_WA_SIZE   THD_WORKING_AREA_SIZE(2048)
  #define TEST_WA_SIZE    THD_WORKING_AREA_SIZE(256)
 -static void cmd_mem(BaseSequentialStream *chp, int argc, char *argv[]) {
 -
 -  size_t n, size;
 -  (void)argv;
 -
 -  if (argc > 0) {
 -    chprintf(chp, "Usage: mem\r\n");
 -    return;
 -  }
 -
 -  n = chHeapStatus(NULL, &size);
 -  chprintf(chp, "core free memory : %u bytes\r\n", chCoreGetStatusX());
 -  chprintf(chp, "heap fragments   : %u\r\n", n);
 -  chprintf(chp, "heap free total  : %u bytes\r\n", size);
 -}
 -
 -static void cmd_threads(BaseSequentialStream *chp, int argc, char *argv[]) {
 -
 -  static const char *states[] = {CH_STATE_NAMES};
 -  thread_t *tp;
 -  (void)argv;
 -
 -  if (argc > 0) {
 -    chprintf(chp, "Usage: threads\r\n");
 -    return;
 -  }
 -
 -  chprintf(chp, "    addr    stack prio refs     state name\r\n");
 -  tp = chRegFirstThread();
 -  do {
 -    chprintf(chp, "%08lx %08lx %4lu %4lu %9s %s\r\n",
 -            (uint32_t)tp, (uint32_t)tp->p_ctx.r13,
 -            (uint32_t)tp->p_prio, (uint32_t)(tp->p_refs - 1),
 -            states[tp->p_state], tp->p_name);
 -    tp = chRegNextThread(tp);
 -  } while (tp != NULL);
 -}
 -
 -static void cmd_test(BaseSequentialStream *chp, int argc, char *argv[]) {
 -
 -  thread_t *tp;
 -  (void)argv;
 -
 -  if (argc > 0) {
 -    chprintf(chp, "Usage: test\r\n");
 -    return;
 -  }
 -
 -  tp = chThdCreateFromHeap(NULL, TEST_WA_SIZE, chThdGetPriorityX(),
 -                           TestThread, chp);
 -  if (tp == NULL) {
 -    chprintf(chp, "out of memory\r\n");
 -    return;
 -  }
 -  chThdWait(tp);
 -}
 -
  static void cmd_reset(BaseSequentialStream *chp, int argc, char *argv[]) {
    (void)argv;
 @@ -444,9 +386,6 @@ static void cmd_params(BaseSequentialStream *chp, int argc, char *argv[]) {  }
  static const ShellCommand commands[] = {
 -  {"mem", cmd_mem},
 -  {"threads", cmd_threads},
 -  {"test", cmd_test},
    {"reset", cmd_reset},
    {"run", cmd_run},
    {"stop", cmd_stop},
 @@ -530,10 +469,10 @@ int main(void) {  #if (HAL_USE_SERIAL_USB == TRUE)
        if (SDU1.config->usbp->state == USB_ACTIVE) {
          /* Spawns a new shell.*/
 -        shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO);
 +        shelltp = chThdCreateFromHeap(NULL, SHELL_WA_SIZE, "shell", NORMALPRIO, shellThread, (void *) &shell_cfg1);
        }
  #else
 -      shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO);
 +      shelltp = chThdCreateFromHeap(NULL, SHELL_WA_SIZE, "shell", NORMALPRIO, shellThread, (void *) &shell_cfg1);
  #endif
      }
      else {
 diff --git a/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/mcuconf.h b/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/mcuconf.h index 0438c01..ec65ff7 100644 --- a/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/mcuconf.h +++ b/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/mcuconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
 +    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.
 @@ -14,8 +14,8 @@      limitations under the License.
  */
 -#ifndef _MCUCONF_H_
 -#define _MCUCONF_H_
 +#ifndef MCUCONF_H
 +#define MCUCONF_H
  /*
   * STM32F4xx drivers configuration.
 @@ -176,6 +176,21 @@  #define STM32_I2C_DMA_ERROR_HOOK(i2cp)      osalSysHalt("DMA failure")
  /*
 + * I2S driver system settings.
 + */
 +#define STM32_I2S_USE_SPI2                  FALSE
 +#define STM32_I2S_USE_SPI3                  FALSE
 +#define STM32_I2S_SPI2_IRQ_PRIORITY         10
 +#define STM32_I2S_SPI3_IRQ_PRIORITY         10
 +#define STM32_I2S_SPI2_DMA_PRIORITY         1
 +#define STM32_I2S_SPI3_DMA_PRIORITY         1
 +#define STM32_I2S_SPI2_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 3)
 +#define STM32_I2S_SPI2_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 4)
 +#define STM32_I2S_SPI3_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 0)
 +#define STM32_I2S_SPI3_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 7)
 +#define STM32_I2S_DMA_ERROR_HOOK(i2sp)      osalSysHalt("DMA failure")
 +
 +/*
   * ICU driver system settings.
   */
  #define STM32_ICU_USE_TIM1                  FALSE
 @@ -340,8 +355,13 @@  #define STM32_USB_OTGFIFO_FILL_BASEPRI      0
  /*
 + * 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/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/mcuconf_community.h b/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/mcuconf_community.h index 5fd93fb..f9f7aa7 100644 --- a/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/mcuconf_community.h +++ b/demos/STM32/RT-STM32F429-DISCOVERY-TRIBUF/mcuconf_community.h @@ -26,3 +26,8 @@  #define STM32_USE_FSMC_SDRAM                FALSE  #define STM32_SDRAM_USE_FSMC_SDRAM1         FALSE  #define STM32_SDRAM_USE_FSMC_SDRAM2         FALSE + +/* + * FSMC SRAM driver system settings. + */ +#define STM32_USE_FSMC_SRAM                 FALSE diff --git a/os/hal/hal.mk b/os/hal/hal.mk index ec524ac..54414a0 100644 --- a/os/hal/hal.mk +++ b/os/hal/hal.mk @@ -13,7 +13,7 @@ HALSRC += ${CHIBIOS_CONTRIB}/os/hal/src/hal_community.c \            ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_msd.c \
            ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_ftdi.c \
            ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_uvc.c \
 -	      ${CHIBIOS_CONTRIB}/os/hal/src/hal_ee24xx.c \
 +          ${CHIBIOS_CONTRIB}/os/hal/src/hal_ee24xx.c \
            ${CHIBIOS_CONTRIB}/os/hal/src/hal_ee25xx.c \
            ${CHIBIOS_CONTRIB}/os/hal/src/hal_eeprom.c \
            ${CHIBIOS_CONTRIB}/os/hal/src/hal_timcap.c \
 diff --git a/os/hal/ports/STM32/STM32F4xx/platform.mk b/os/hal/ports/STM32/STM32F4xx/platform.mk index b78df83..bc18dc6 100644 --- a/os/hal/ports/STM32/STM32F4xx/platform.mk +++ b/os/hal/ports/STM32/STM32F4xx/platform.mk @@ -1,20 +1,20 @@  include ${CHIBIOS}/os/hal/ports/STM32/STM32F4xx/platform.mk
 -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/DMA2Dv1/hal_stm32_dma2d.c \
 +PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/CRCv1/hal_crc_lld.c \
 +               ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/DMA2Dv1/hal_stm32_dma2d.c \
                 ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc.c \
                 ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/hal_nand_lld.c \
                 ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sram.c \
                 ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/LTDCv1/hal_stm32_ltdc.c \
                 ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/hal_eicu_lld.c \
                 ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/hal_timcap_lld.c \
 -	           ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c \
 -               ${CHIBIOS_CONTRIB}/os/hal/src/hal_fsmc_sdram.c \
 -               ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/CRCv1/hal_crc_lld.c
 +               ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c \
 +               ${CHIBIOS_CONTRIB}/os/hal/src/hal_fsmc_sdram.c
 -PLATFORMINC += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/DMA2Dv1 \
 +PLATFORMINC += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/CRCv1 \
 +               ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/DMA2Dv1 \
                 ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1 \
                 ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/LTDCv1 \
                 ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1 \
 -	           ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/USBHv1 \
 -	           ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/CRCv1 \
 +               ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/USBHv1 \
                 ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD
 diff --git a/testhal/STM32/STM32F0xx/crc/chconf.h b/testhal/STM32/STM32F0xx/crc/chconf.h index 64394a2..c2d6f04 100644 --- a/testhal/STM32/STM32F0xx/crc/chconf.h +++ b/testhal/STM32/STM32F0xx/crc/chconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
 +    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.
 @@ -25,8 +25,8 @@   * @{
   */
 -#ifndef _CHCONF_H_
 -#define _CHCONF_H_
 +#ifndef CHCONF_H
 +#define CHCONF_H
  #define _CHIBIOS_RT_CONF_
 @@ -351,17 +351,16 @@  /**
   * @brief   Debug option, trace buffer.
 - * @details If enabled then the context switch circular trace buffer is
 - *          activated.
 + * @details If enabled then the trace buffer is activated.
   *
 - * @note    The default is @p CH_DBG_TRACE_MASK_NONE.
 + * @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_NONE.
 + *          different from @p CH_DBG_TRACE_MASK_DISABLED.
   */
  #define CH_DBG_TRACE_BUFFER_SIZE            128
 @@ -516,6 +515,6 @@  /* Port-specific settings (override port settings defaulted in chcore.h).    */
  /*===========================================================================*/
 -#endif  /* _CHCONF_H_ */
 +#endif  /* CHCONF_H */
  /** @} */
 diff --git a/testhal/STM32/STM32F0xx/crc/halconf_community.h b/testhal/STM32/STM32F0xx/crc/halconf_community.h index 9fa5c16..2bc41bf 100644 --- a/testhal/STM32/STM32F0xx/crc/halconf_community.h +++ b/testhal/STM32/STM32F0xx/crc/halconf_community.h @@ -23,6 +23,7 @@  #if !defined(HAL_USE_COMMUNITY) || defined(__DOXYGEN__)
  #define HAL_USE_COMMUNITY           TRUE
  #endif
 +
  /**
   * @brief   Enables the FSMC subsystem.
   */
 diff --git a/testhal/STM32/STM32F0xx/onewire/chconf.h b/testhal/STM32/STM32F0xx/onewire/chconf.h index 0b74391..724dc02 100644 --- a/testhal/STM32/STM32F0xx/onewire/chconf.h +++ b/testhal/STM32/STM32F0xx/onewire/chconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
 +    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.
 @@ -25,8 +25,8 @@   * @{
   */
 -#ifndef _CHCONF_H_
 -#define _CHCONF_H_
 +#ifndef CHCONF_H
 +#define CHCONF_H
  #define _CHIBIOS_RT_CONF_
 @@ -351,17 +351,16 @@  /**
   * @brief   Debug option, trace buffer.
 - * @details If enabled then the context switch circular trace buffer is
 - *          activated.
 + * @details If enabled then the trace buffer is activated.
   *
 - * @note    The default is @p CH_DBG_TRACE_MASK_NONE.
 + * @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_NONE.
 + *          different from @p CH_DBG_TRACE_MASK_DISABLED.
   */
  #define CH_DBG_TRACE_BUFFER_SIZE            128
 @@ -516,6 +515,6 @@  /* Port-specific settings (override port settings defaulted in chcore.h).    */
  /*===========================================================================*/
 -#endif  /* _CHCONF_H_ */
 +#endif  /* CHCONF_H */
  /** @} */
 diff --git a/testhal/STM32/STM32F1xx/onewire/chconf.h b/testhal/STM32/STM32F1xx/onewire/chconf.h index dba8354..ee20e3c 100644 --- a/testhal/STM32/STM32F1xx/onewire/chconf.h +++ b/testhal/STM32/STM32F1xx/onewire/chconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
 +    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.
 @@ -25,8 +25,8 @@   * @{
   */
 -#ifndef _CHCONF_H_
 -#define _CHCONF_H_
 +#ifndef CHCONF_H
 +#define CHCONF_H
  #define _CHIBIOS_RT_CONF_
 @@ -351,17 +351,16 @@  /**
   * @brief   Debug option, trace buffer.
 - * @details If enabled then the context switch circular trace buffer is
 - *          activated.
 + * @details If enabled then the trace buffer is activated.
   *
 - * @note    The default is @p CH_DBG_TRACE_MASK_NONE.
 + * @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_NONE.
 + *          different from @p CH_DBG_TRACE_MASK_DISABLED.
   */
  #define CH_DBG_TRACE_BUFFER_SIZE            128
 @@ -516,6 +515,6 @@  /* Port-specific settings (override port settings defaulted in chcore.h).    */
  /*===========================================================================*/
 -#endif  /* _CHCONF_H_ */
 +#endif  /* CHCONF_H */
  /** @} */
 diff --git a/testhal/STM32/STM32F3xx/EEProm/mcuconf_community.h b/testhal/STM32/STM32F3xx/EEProm/mcuconf_community.h index 4a13b56..7ca6e71 100644 --- a/testhal/STM32/STM32F3xx/EEProm/mcuconf_community.h +++ b/testhal/STM32/STM32F3xx/EEProm/mcuconf_community.h @@ -36,7 +36,7 @@  #define STM32_USE_FSMC_SRAM                 FALSE  #define STM32_SRAM_USE_FSMC_SRAM1           FALSE  #define STM32_SRAM_USE_FSMC_SRAM2           FALSE -#define STM32_SRAM_USE_FSMC_SRAM3           FLASE +#define STM32_SRAM_USE_FSMC_SRAM3           FALSE  #define STM32_SRAM_USE_FSMC_SRAM4           FALSE  /* diff --git a/testhal/STM32/STM32F3xx/TIMCAP/mcuconf_community.h b/testhal/STM32/STM32F3xx/TIMCAP/mcuconf_community.h index 95eb845..b115590 100644 --- a/testhal/STM32/STM32F3xx/TIMCAP/mcuconf_community.h +++ b/testhal/STM32/STM32F3xx/TIMCAP/mcuconf_community.h @@ -36,7 +36,7 @@  #define STM32_USE_FSMC_SRAM                 FALSE  #define STM32_SRAM_USE_FSMC_SRAM1           FALSE  #define STM32_SRAM_USE_FSMC_SRAM2           FALSE -#define STM32_SRAM_USE_FSMC_SRAM3           FLASE +#define STM32_SRAM_USE_FSMC_SRAM3           FALSE  #define STM32_SRAM_USE_FSMC_SRAM4           FALSE  /* @@ -62,4 +62,4 @@  #define STM32_TIMCAP_TIM8_IRQ_PRIORITY         3  #define STM32_TIMCAP_TIM9_IRQ_PRIORITY         3 - 
\ No newline at end of file +  diff --git a/testhal/STM32/STM32F4xx/EICU/Makefile b/testhal/STM32/STM32F4xx/EICU/Makefile index 92ad11b..db59af2 100644 --- a/testhal/STM32/STM32F4xx/EICU/Makefile +++ b/testhal/STM32/STM32F4xx/EICU/Makefile @@ -43,6 +43,12 @@ ifeq ($(USE_VERBOSE_COMPILE),)    USE_VERBOSE_COMPILE = no  endif +# If enabled, this option makes the build process faster by not compiling +# modules not used in the current configuration. +ifeq ($(USE_SMART_BUILD),) +  USE_SMART_BUILD = no +endif +  #  # Build global options  ############################################################################## @@ -63,7 +69,7 @@ ifeq ($(USE_EXCEPTIONS_STACKSIZE),)    USE_EXCEPTIONS_STACKSIZE = 0x400  endif -# Enables the use of FPU on Cortex-M4 (no, softfp, hard). +# Enables the use of FPU (no, softfp, hard).  ifeq ($(USE_FPU),)    USE_FPU = no  endif @@ -94,7 +100,7 @@ include $(CHIBIOS)/os/rt/rt.mk  include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk  # Define linker script file here -LDSCRIPT= $(STARTUPLD)/STM32F407xG.ld +LDSCRIPT = $(STARTUPLD)/STM32F407xG.ld  # C sources that can be compiled in ARM or THUMB mode depending on the global  # setting. @@ -107,7 +113,7 @@ CSRC = $(STARTUPSRC) \         $(BOARDSRC) \         $(TESTSRC) \         main.c -        +  # C++ sources that can be compiled in ARM or THUMB mode depending on the global  # setting.  CPPSRC = @@ -133,9 +139,11 @@ TCSRC =  TCPPSRC =  # List ASM source files here -ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) +ASMSRC = +ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) -INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ +INCDIR = $(CHIBIOS)/os/license \ +         $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \           $(HALINC) $(PLATFORMINC) $(BOARDINC) \           $(CHIBIOS)/os/various @@ -151,8 +159,8 @@ MCU  = cortex-m4  #TRGT = arm-elf-  TRGT = arm-none-eabi- -CC   = ccache $(TRGT)gcc -CPPC = ccache $(TRGT)g++ +CC   = $(TRGT)gcc +CPPC = $(TRGT)g++  # Enable loading with g++ only if you need C++ runtime support.  # NOTE: You can use C++ even without C++ support if you are careful. C++  #       runtime support makes code size explode. @@ -173,10 +181,10 @@ AOPT =  TOPT = -mthumb -DTHUMB  # Define C warning options here -CWARN = -Wall -Wextra -Wstrict-prototypes -Wundef +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes  # Define C++ warning options here -CPPWARN = -Wall -Wextra -Wundef +CPPWARN = -Wall -Wextra  #  # Compiler settings @@ -207,4 +215,3 @@ ULIBS =  RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC  include $(RULESPATH)/rules.mk - diff --git a/testhal/STM32/STM32F4xx/EICU/chconf.h b/testhal/STM32/STM32F4xx/EICU/chconf.h index c33aa31..ad6b53a 100644 --- a/testhal/STM32/STM32F4xx/EICU/chconf.h +++ b/testhal/STM32/STM32F4xx/EICU/chconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
 +    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.
 @@ -25,8 +25,8 @@   * @{
   */
 -#ifndef _CHCONF_H_
 -#define _CHCONF_H_
 +#ifndef CHCONF_H
 +#define CHCONF_H
  #define _CHIBIOS_RT_CONF_
 @@ -351,17 +351,16 @@  /**
   * @brief   Debug option, trace buffer.
 - * @details If enabled then the context switch circular trace buffer is
 - *          activated.
 + * @details If enabled then the trace buffer is activated.
   *
 - * @note    The default is @p CH_DBG_TRACE_MASK_NONE.
 + * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.
   */
 -#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_NONE
 +#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_NONE.
 + *          different from @p CH_DBG_TRACE_MASK_DISABLED.
   */
  #define CH_DBG_TRACE_BUFFER_SIZE            128
 @@ -516,6 +515,6 @@  /* Port-specific settings (override port settings defaulted in chcore.h).    */
  /*===========================================================================*/
 -#endif  /* _CHCONF_H_ */
 +#endif  /* CHCONF_H */
  /** @} */
 diff --git a/testhal/STM32/STM32F4xx/EICU/community b/testhal/STM32/STM32F4xx/EICU/community deleted file mode 120000 index 544599d..0000000 --- a/testhal/STM32/STM32F4xx/EICU/community +++ /dev/null @@ -1 +0,0 @@ -../../../../../community
\ No newline at end of file diff --git a/testhal/STM32/STM32F4xx/EICU/halconf.h b/testhal/STM32/STM32F4xx/EICU/halconf.h index cb573a0..93cc713 100644 --- a/testhal/STM32/STM32F4xx/EICU/halconf.h +++ b/testhal/STM32/STM32F4xx/EICU/halconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006-2014 Giovanni Di Sirio
 +    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.
 @@ -25,8 +25,8 @@   * @{
   */
 -#ifndef _HALCONF_H_
 -#define _HALCONF_H_
 +#ifndef HALCONF_H
 +#define HALCONF_H
  #include "mcuconf.h"
 @@ -45,17 +45,17 @@  #endif
  /**
 - * @brief   Enables the DAC subsystem.
 + * @brief   Enables the CAN subsystem.
   */
 -#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
 -#define HAL_USE_DAC                 FALSE
 +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
 +#define HAL_USE_CAN                 FALSE
  #endif
  /**
 - * @brief   Enables the CAN subsystem.
 + * @brief   Enables the DAC subsystem.
   */
 -#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
 -#define HAL_USE_CAN                 FALSE
 +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
 +#define HAL_USE_DAC                 FALSE
  #endif
  /**
 @@ -294,7 +294,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 +309,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 +345,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/STM32F4xx/EICU/mcuconf.h b/testhal/STM32/STM32F4xx/EICU/mcuconf.h index e67608f..c7671b7 100644 --- a/testhal/STM32/STM32F4xx/EICU/mcuconf.h +++ b/testhal/STM32/STM32F4xx/EICU/mcuconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006-2014 Giovanni Di Sirio
 +    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.
 @@ -14,6 +14,9 @@      limitations under the License.
  */
 +#ifndef MCUCONF_H
 +#define MCUCONF_H
 +
  /*
   * STM32F4xx drivers configuration.
   * The following settings override the default settings present in
 @@ -88,6 +91,19 @@  #define STM32_CAN_CAN2_IRQ_PRIORITY         11
  /*
 + * DAC driver system settings.
 + */
 +#define STM32_DAC_DUAL_MODE                 FALSE
 +#define STM32_DAC_USE_DAC1_CH1              FALSE
 +#define STM32_DAC_USE_DAC1_CH2              FALSE
 +#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY     10
 +#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY     10
 +#define STM32_DAC_DAC1_CH1_DMA_PRIORITY     2
 +#define STM32_DAC_DAC1_CH2_DMA_PRIORITY     2
 +#define STM32_DAC_DAC1_CH1_DMA_STREAM       STM32_DMA_STREAM_ID(1, 5)
 +#define STM32_DAC_DAC1_CH2_DMA_STREAM       STM32_DMA_STREAM_ID(1, 6)
 +
 +/*
   * EXT driver system settings.
   */
  #define STM32_EXT_EXTI0_IRQ_PRIORITY        6
 @@ -155,6 +171,21 @@  #define STM32_I2C_DMA_ERROR_HOOK(i2cp)      osalSysHalt("DMA failure")
  /*
 + * I2S driver system settings.
 + */
 +#define STM32_I2S_USE_SPI2                  FALSE
 +#define STM32_I2S_USE_SPI3                  FALSE
 +#define STM32_I2S_SPI2_IRQ_PRIORITY         10
 +#define STM32_I2S_SPI3_IRQ_PRIORITY         10
 +#define STM32_I2S_SPI2_DMA_PRIORITY         1
 +#define STM32_I2S_SPI3_DMA_PRIORITY         1
 +#define STM32_I2S_SPI2_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 3)
 +#define STM32_I2S_SPI2_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 4)
 +#define STM32_I2S_SPI3_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 0)
 +#define STM32_I2S_SPI3_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 7)
 +#define STM32_I2S_DMA_ERROR_HOOK(i2sp)      osalSysHalt("DMA failure")
 +
 +/*
   * ICU driver system settings.
   */
  #define STM32_ICU_USE_TIM1                  FALSE
 @@ -304,7 +335,13 @@  #define STM32_USB_OTGFIFO_FILL_BASEPRI      0
  /*
 + * WDG driver system settings.
 + */
 +#define STM32_WDG_USE_IWDG                  FALSE
 +
 +/*
   * header for community drivers.
   */
  #include "mcuconf_community.h"
 +#endif /* MCUCONF_H */
 diff --git a/testhal/STM32/STM32F4xx/EICU/mcuconf_community.h b/testhal/STM32/STM32F4xx/EICU/mcuconf_community.h index adc9d92..9d15f32 100644 --- a/testhal/STM32/STM32F4xx/EICU/mcuconf_community.h +++ b/testhal/STM32/STM32F4xx/EICU/mcuconf_community.h @@ -36,13 +36,13 @@  #define STM32_USE_FSMC_SRAM                 FALSE  #define STM32_SRAM_USE_FSMC_SRAM1           FALSE  #define STM32_SRAM_USE_FSMC_SRAM2           FALSE -#define STM32_SRAM_USE_FSMC_SRAM3           FLASE +#define STM32_SRAM_USE_FSMC_SRAM3           FALSE  #define STM32_SRAM_USE_FSMC_SRAM4           FALSE  /*   * FSMC PC card driver system settings.   */ -#define STM32_USE_FSMC_PCARD                FALSE +#define STM32_USE_FSMC_PCCARD               FALSE  /*   * FSMC SDRAM driver system settings. diff --git a/testhal/STM32/STM32F4xx/EICU/os b/testhal/STM32/STM32F4xx/EICU/os deleted file mode 120000 index 18fd3d9..0000000 --- a/testhal/STM32/STM32F4xx/EICU/os +++ /dev/null @@ -1 +0,0 @@ -../../../../../os
\ No newline at end of file diff --git a/testhal/STM32/STM32F4xx/FSMC_NAND/Makefile b/testhal/STM32/STM32F4xx/FSMC_NAND/Makefile index 6087197..6ad8126 100644 --- a/testhal/STM32/STM32F4xx/FSMC_NAND/Makefile +++ b/testhal/STM32/STM32F4xx/FSMC_NAND/Makefile @@ -43,6 +43,12 @@ ifeq ($(USE_VERBOSE_COMPILE),)    USE_VERBOSE_COMPILE = no  endif +# If enabled, this option makes the build process faster by not compiling +# modules not used in the current configuration. +ifeq ($(USE_SMART_BUILD),) +  USE_SMART_BUILD = no +endif +  #  # Build global options  ############################################################################## @@ -63,7 +69,7 @@ ifeq ($(USE_EXCEPTIONS_STACKSIZE),)    USE_EXCEPTIONS_STACKSIZE = 0x400  endif -# Enables the use of FPU on Cortex-M4 (no, softfp, hard). +# Enables the use of FPU (no, softfp, hard).  ifeq ($(USE_FPU),)    USE_FPU = no  endif @@ -94,7 +100,7 @@ include $(CHIBIOS)/os/rt/rt.mk  include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk  # Define linker script file here -LDSCRIPT= $(STARTUPLD)/STM32F407xG.ld +LDSCRIPT = $(STARTUPLD)/STM32F407xG.ld  # C sources that can be compiled in ARM or THUMB mode depending on the global  # setting. @@ -146,7 +152,6 @@ INCDIR = $(CHIBIOS)/os/license \           $(CHIBIOS)/os/various \           $(CHIBIOS_CONTRIB)/os/various -  #  # Project, sources and paths  ############################################################################## @@ -181,7 +186,7 @@ AOPT =  TOPT = -mthumb -DTHUMB  # Define C warning options here -CWARN = -Wall -Wextra -Wstrict-prototypes +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes  # Define C++ warning options here  CPPWARN = -Wall -Wextra diff --git a/testhal/STM32/STM32F4xx/FSMC_NAND/chconf.h b/testhal/STM32/STM32F4xx/FSMC_NAND/chconf.h index 01cc4a0..1065821 100644 --- a/testhal/STM32/STM32F4xx/FSMC_NAND/chconf.h +++ b/testhal/STM32/STM32F4xx/FSMC_NAND/chconf.h @@ -1,5 +1,5 @@  /* -    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio +    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. @@ -25,8 +25,8 @@   * @{   */ -#ifndef _CHCONF_H_ -#define _CHCONF_H_ +#ifndef CHCONF_H +#define CHCONF_H  #define _CHIBIOS_RT_CONF_ @@ -351,17 +351,16 @@  /**   * @brief   Debug option, trace buffer. - * @details If enabled then the context switch circular trace buffer is - *          activated. + * @details If enabled then the trace buffer is activated.   * - * @note    The default is @p CH_DBG_TRACE_MASK_NONE. + * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.   */ -#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_NONE +#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_NONE. + *          different from @p CH_DBG_TRACE_MASK_DISABLED.   */  #define CH_DBG_TRACE_BUFFER_SIZE            128 @@ -498,7 +497,7 @@   *          the system is halted.   */  #define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \ -  /* Halt code here.*/                                                      \ +  /* System halt code here.*/                                               \  }  /** @@ -516,6 +515,6 @@  /* Port-specific settings (override port settings defaulted in chcore.h).    */  /*===========================================================================*/ -#endif  /* _CHCONF_H_ */ +#endif  /* CHCONF_H */  /** @} */ diff --git a/testhal/STM32/STM32F4xx/FSMC_NAND/halconf.h b/testhal/STM32/STM32F4xx/FSMC_NAND/halconf.h index 726e673..e690d15 100644 --- a/testhal/STM32/STM32F4xx/FSMC_NAND/halconf.h +++ b/testhal/STM32/STM32F4xx/FSMC_NAND/halconf.h @@ -1,5 +1,5 @@  /* -    ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio +    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. @@ -25,8 +25,8 @@   * @{   */ -#ifndef _HALCONF_H_ -#define _HALCONF_H_ +#ifndef HALCONF_H +#define HALCONF_H  #include "mcuconf.h" @@ -45,17 +45,17 @@  #endif  /** - * @brief   Enables the DAC subsystem. + * @brief   Enables the CAN subsystem.   */ -#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) -#define HAL_USE_DAC                 FALSE +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN                 FALSE  #endif  /** - * @brief   Enables the CAN subsystem. + * @brief   Enables the DAC subsystem.   */ -#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) -#define HAL_USE_CAN                 FALSE +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC                 FALSE  #endif  /** @@ -294,7 +294,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__) @@ -302,6 +302,29 @@  #endif  /*===========================================================================*/ +/* SERIAL_USB driver related setting.                                        */ +/*===========================================================================*/ + +/** + * @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 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.                                              */  /*===========================================================================*/ @@ -322,11 +345,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/STM32F4xx/FSMC_NAND/halconf_community.h b/testhal/STM32/STM32F4xx/FSMC_NAND/halconf_community.h index 992a00a..f480707 100644 --- a/testhal/STM32/STM32F4xx/FSMC_NAND/halconf_community.h +++ b/testhal/STM32/STM32F4xx/FSMC_NAND/halconf_community.h @@ -59,6 +59,13 @@  #define HAL_USE_CRC                 FALSE
  #endif
 +/**
 + * @brief   Enables the RNG subsystem.
 + */
 +#if !defined(HAL_USE_RNG) || defined(__DOXYGEN__)
 +#define HAL_USE_RNG                 FALSE
 +#endif
 +
  /*===========================================================================*/
  /* FSMCNAND driver related settings.                                         */
  /*===========================================================================*/
 diff --git a/testhal/STM32/STM32F4xx/FSMC_NAND/mcuconf.h b/testhal/STM32/STM32F4xx/FSMC_NAND/mcuconf.h index 681de14..d2333ba 100644 --- a/testhal/STM32/STM32F4xx/FSMC_NAND/mcuconf.h +++ b/testhal/STM32/STM32F4xx/FSMC_NAND/mcuconf.h @@ -1,5 +1,5 @@  /* -    ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio +    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. @@ -14,6 +14,9 @@      limitations under the License.  */ +#ifndef MCUCONF_H +#define MCUCONF_H +  /*   * STM32F4xx drivers configuration.   * The following settings override the default settings present in @@ -88,6 +91,19 @@  #define STM32_CAN_CAN2_IRQ_PRIORITY         11  /* + * DAC driver system settings. + */ +#define STM32_DAC_DUAL_MODE                 FALSE +#define STM32_DAC_USE_DAC1_CH1              FALSE +#define STM32_DAC_USE_DAC1_CH2              FALSE +#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY     10 +#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY     10 +#define STM32_DAC_DAC1_CH1_DMA_PRIORITY     2 +#define STM32_DAC_DAC1_CH2_DMA_PRIORITY     2 +#define STM32_DAC_DAC1_CH1_DMA_STREAM       STM32_DMA_STREAM_ID(1, 5) +#define STM32_DAC_DAC1_CH2_DMA_STREAM       STM32_DMA_STREAM_ID(1, 6) + +/*   * EXT driver system settings.   */  #define STM32_EXT_EXTI0_IRQ_PRIORITY        6 @@ -155,6 +171,21 @@  #define STM32_I2C_DMA_ERROR_HOOK(i2cp)      osalSysHalt("DMA failure")  /* + * I2S driver system settings. + */ +#define STM32_I2S_USE_SPI2                  FALSE +#define STM32_I2S_USE_SPI3                  FALSE +#define STM32_I2S_SPI2_IRQ_PRIORITY         10 +#define STM32_I2S_SPI3_IRQ_PRIORITY         10 +#define STM32_I2S_SPI2_DMA_PRIORITY         1 +#define STM32_I2S_SPI3_DMA_PRIORITY         1 +#define STM32_I2S_SPI2_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 3) +#define STM32_I2S_SPI2_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 4) +#define STM32_I2S_SPI3_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 0) +#define STM32_I2S_SPI3_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 7) +#define STM32_I2S_DMA_ERROR_HOOK(i2sp)      osalSysHalt("DMA failure") + +/*   * ICU driver system settings.   */  #define STM32_ICU_USE_TIM1                  FALSE @@ -304,6 +335,13 @@  #define STM32_USB_OTGFIFO_FILL_BASEPRI      0  /* + * WDG driver system settings. + */ +#define STM32_WDG_USE_IWDG                  FALSE + +/*   * header for community drivers.   */  #include "mcuconf_community.h" + +#endif /* MCUCONF_H */ diff --git a/testhal/STM32/STM32F4xx/FSMC_SDRAM/Makefile b/testhal/STM32/STM32F4xx/FSMC_SDRAM/Makefile index 83f901c..c786de6 100644 --- a/testhal/STM32/STM32F4xx/FSMC_SDRAM/Makefile +++ b/testhal/STM32/STM32F4xx/FSMC_SDRAM/Makefile @@ -43,6 +43,12 @@ ifeq ($(USE_VERBOSE_COMPILE),)    USE_VERBOSE_COMPILE = no  endif +# If enabled, this option makes the build process faster by not compiling +# modules not used in the current configuration. +ifeq ($(USE_SMART_BUILD),) +  USE_SMART_BUILD = no +endif +  #  # Build global options  ############################################################################## @@ -63,7 +69,7 @@ ifeq ($(USE_EXCEPTIONS_STACKSIZE),)    USE_EXCEPTIONS_STACKSIZE = 0x400  endif -# Enables the use of FPU on Cortex-M4 (no, softfp, hard). +# Enables the use of FPU (no, softfp, hard).  ifeq ($(USE_FPU),)    USE_FPU = no  endif @@ -182,7 +188,7 @@ AOPT =  TOPT = -mthumb -DTHUMB  # Define C warning options here -CWARN = -Wall -Wextra -Wstrict-prototypes +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes  # Define C++ warning options here  CPPWARN = -Wall -Wextra diff --git a/testhal/STM32/STM32F4xx/FSMC_SDRAM/chconf.h b/testhal/STM32/STM32F4xx/FSMC_SDRAM/chconf.h index 01cc4a0..1065821 100644 --- a/testhal/STM32/STM32F4xx/FSMC_SDRAM/chconf.h +++ b/testhal/STM32/STM32F4xx/FSMC_SDRAM/chconf.h @@ -1,5 +1,5 @@  /* -    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio +    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. @@ -25,8 +25,8 @@   * @{   */ -#ifndef _CHCONF_H_ -#define _CHCONF_H_ +#ifndef CHCONF_H +#define CHCONF_H  #define _CHIBIOS_RT_CONF_ @@ -351,17 +351,16 @@  /**   * @brief   Debug option, trace buffer. - * @details If enabled then the context switch circular trace buffer is - *          activated. + * @details If enabled then the trace buffer is activated.   * - * @note    The default is @p CH_DBG_TRACE_MASK_NONE. + * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.   */ -#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_NONE +#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_NONE. + *          different from @p CH_DBG_TRACE_MASK_DISABLED.   */  #define CH_DBG_TRACE_BUFFER_SIZE            128 @@ -498,7 +497,7 @@   *          the system is halted.   */  #define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \ -  /* Halt code here.*/                                                      \ +  /* System halt code here.*/                                               \  }  /** @@ -516,6 +515,6 @@  /* Port-specific settings (override port settings defaulted in chcore.h).    */  /*===========================================================================*/ -#endif  /* _CHCONF_H_ */ +#endif  /* CHCONF_H */  /** @} */ diff --git a/testhal/STM32/STM32F4xx/FSMC_SDRAM/halconf.h b/testhal/STM32/STM32F4xx/FSMC_SDRAM/halconf.h index bc2b9e0..e690d15 100644 --- a/testhal/STM32/STM32F4xx/FSMC_SDRAM/halconf.h +++ b/testhal/STM32/STM32F4xx/FSMC_SDRAM/halconf.h @@ -1,5 +1,5 @@  /* -    ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio +    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. @@ -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 DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC                 FALSE +#endif + +/**   * @brief   Enables the EXT subsystem.   */  #if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) @@ -287,7 +294,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__) @@ -295,6 +302,29 @@  #endif  /*===========================================================================*/ +/* SERIAL_USB driver related setting.                                        */ +/*===========================================================================*/ + +/** + * @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 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.                                              */  /*===========================================================================*/ @@ -315,11 +345,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/STM32F4xx/FSMC_SDRAM/halconf_community.h b/testhal/STM32/STM32F4xx/FSMC_SDRAM/halconf_community.h index ecc275a..606fed4 100644 --- a/testhal/STM32/STM32F4xx/FSMC_SDRAM/halconf_community.h +++ b/testhal/STM32/STM32F4xx/FSMC_SDRAM/halconf_community.h @@ -45,6 +45,27 @@  #define HAL_USE_ONEWIRE             FALSE
  #endif
 +/**
 + * @brief   Enables the EICU subsystem.
 + */
 +#if !defined(HAL_USE_EICU) || defined(__DOXYGEN__)
 +#define HAL_USE_EICU                FALSE
 +#endif
 +
 +/**
 + * @brief   Enables the CRC subsystem.
 + */
 +#if !defined(HAL_USE_CRC) || defined(__DOXYGEN__)
 +#define HAL_USE_CRC                 FALSE
 +#endif
 +
 +/**
 + * @brief   Enables the RNG subsystem.
 + */
 +#if !defined(HAL_USE_RNG) || defined(__DOXYGEN__)
 +#define HAL_USE_RNG                 FALSE
 +#endif
 +
  /*===========================================================================*/
  /* FSMCNAND driver related settings.                                         */
  /*===========================================================================*/
 diff --git a/testhal/STM32/STM32F4xx/FSMC_SDRAM/mcuconf.h b/testhal/STM32/STM32F4xx/FSMC_SDRAM/mcuconf.h index 5589f94..4737002 100644 --- a/testhal/STM32/STM32F4xx/FSMC_SDRAM/mcuconf.h +++ b/testhal/STM32/STM32F4xx/FSMC_SDRAM/mcuconf.h @@ -1,5 +1,5 @@  /* -    ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio +    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. @@ -14,6 +14,9 @@      limitations under the License.  */ +#ifndef MCUCONF_H +#define MCUCONF_H +  /*   * STM32F4xx drivers configuration.   * The following settings override the default settings present in @@ -88,6 +91,19 @@  #define STM32_CAN_CAN2_IRQ_PRIORITY         11  /* + * DAC driver system settings. + */ +#define STM32_DAC_DUAL_MODE                 FALSE +#define STM32_DAC_USE_DAC1_CH1              FALSE +#define STM32_DAC_USE_DAC1_CH2              FALSE +#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY     10 +#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY     10 +#define STM32_DAC_DAC1_CH1_DMA_PRIORITY     2 +#define STM32_DAC_DAC1_CH2_DMA_PRIORITY     2 +#define STM32_DAC_DAC1_CH1_DMA_STREAM       STM32_DMA_STREAM_ID(1, 5) +#define STM32_DAC_DAC1_CH2_DMA_STREAM       STM32_DMA_STREAM_ID(1, 6) + +/*   * EXT driver system settings.   */  #define STM32_EXT_EXTI0_IRQ_PRIORITY        6 @@ -155,6 +171,21 @@  #define STM32_I2C_DMA_ERROR_HOOK(i2cp)      osalSysHalt("DMA failure")  /* + * I2S driver system settings. + */ +#define STM32_I2S_USE_SPI2                  FALSE +#define STM32_I2S_USE_SPI3                  FALSE +#define STM32_I2S_SPI2_IRQ_PRIORITY         10 +#define STM32_I2S_SPI3_IRQ_PRIORITY         10 +#define STM32_I2S_SPI2_DMA_PRIORITY         1 +#define STM32_I2S_SPI3_DMA_PRIORITY         1 +#define STM32_I2S_SPI2_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 3) +#define STM32_I2S_SPI2_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 4) +#define STM32_I2S_SPI3_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 0) +#define STM32_I2S_SPI3_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 7) +#define STM32_I2S_DMA_ERROR_HOOK(i2sp)      osalSysHalt("DMA failure") + +/*   * ICU driver system settings.   */  #define STM32_ICU_USE_TIM1                  FALSE @@ -304,6 +335,13 @@  #define STM32_USB_OTGFIFO_FILL_BASEPRI      0  /* + * WDG driver system settings. + */ +#define STM32_WDG_USE_IWDG                  FALSE + +/*   * header for community drivers.   */  #include "mcuconf_community.h" + +#endif /* MCUCONF_H */ diff --git a/testhal/STM32/STM32F4xx/FSMC_SDRAM/mcuconf_community.h b/testhal/STM32/STM32F4xx/FSMC_SDRAM/mcuconf_community.h index 81c7e2c..f60cbee 100644 --- a/testhal/STM32/STM32F4xx/FSMC_SDRAM/mcuconf_community.h +++ b/testhal/STM32/STM32F4xx/FSMC_SDRAM/mcuconf_community.h @@ -21,8 +21,28 @@  #define STM32_FSMC_FSMC1_IRQ_PRIORITY       10  /* + * FSMC NAND driver system settings. + */ +#define STM32_NAND_USE_FSMC_NAND1           FALSE +#define STM32_NAND_USE_FSMC_NAND2           FALSE + +/*   * FSMC SDRAM driver system settings.   */  #define STM32_USE_FSMC_SDRAM                TRUE  #define STM32_SDRAM_USE_FSMC_SDRAM1         FALSE  #define STM32_SDRAM_USE_FSMC_SDRAM2         TRUE + +/* + * FSMC SRAM driver system settings. + */ +#define STM32_USE_FSMC_SRAM                 FALSE +#define STM32_SRAM_USE_FSMC_SRAM1           FALSE +#define STM32_SRAM_USE_FSMC_SRAM2           FALSE +#define STM32_SRAM_USE_FSMC_SRAM3           FALSE +#define STM32_SRAM_USE_FSMC_SRAM4           FALSE + +/* + * FSMC PC card driver system settings. + */ +#define STM32_USE_FSMC_PCCARD               FALSE diff --git a/testhal/STM32/STM32F4xx/FSMC_SRAM/Makefile b/testhal/STM32/STM32F4xx/FSMC_SRAM/Makefile index d3aa087..c0db393 100644 --- a/testhal/STM32/STM32F4xx/FSMC_SRAM/Makefile +++ b/testhal/STM32/STM32F4xx/FSMC_SRAM/Makefile @@ -43,6 +43,12 @@ ifeq ($(USE_VERBOSE_COMPILE),)    USE_VERBOSE_COMPILE = no  endif +# If enabled, this option makes the build process faster by not compiling +# modules not used in the current configuration. +ifeq ($(USE_SMART_BUILD),) +  USE_SMART_BUILD = no +endif +  #  # Build global options  ############################################################################## @@ -63,7 +69,7 @@ ifeq ($(USE_EXCEPTIONS_STACKSIZE),)    USE_EXCEPTIONS_STACKSIZE = 0x400  endif -# Enables the use of FPU on Cortex-M4 (no, softfp, hard). +# Enables the use of FPU (no, softfp, hard).  ifeq ($(USE_FPU),)    USE_FPU = no  endif @@ -96,7 +102,7 @@ include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk  include $(CHIBIOS)/os/various/cpp_wrappers/chcpp.mk  # Define linker script file here -LDSCRIPT= $(STARTUPLD)/STM32F407xG.ld +LDSCRIPT = $(STARTUPLD)/STM32F407xG.ld  # C sources that can be compiled in ARM or THUMB mode depending on the global  # setting. @@ -182,7 +188,7 @@ AOPT =  TOPT = -mthumb -DTHUMB  # Define C warning options here -CWARN = -Wall -Wextra -Wstrict-prototypes +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes  # Define C++ warning options here  CPPWARN = -Wall -Wextra diff --git a/testhal/STM32/STM32F4xx/FSMC_SRAM/chconf.h b/testhal/STM32/STM32F4xx/FSMC_SRAM/chconf.h index 01cc4a0..1065821 100644 --- a/testhal/STM32/STM32F4xx/FSMC_SRAM/chconf.h +++ b/testhal/STM32/STM32F4xx/FSMC_SRAM/chconf.h @@ -1,5 +1,5 @@  /* -    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio +    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. @@ -25,8 +25,8 @@   * @{   */ -#ifndef _CHCONF_H_ -#define _CHCONF_H_ +#ifndef CHCONF_H +#define CHCONF_H  #define _CHIBIOS_RT_CONF_ @@ -351,17 +351,16 @@  /**   * @brief   Debug option, trace buffer. - * @details If enabled then the context switch circular trace buffer is - *          activated. + * @details If enabled then the trace buffer is activated.   * - * @note    The default is @p CH_DBG_TRACE_MASK_NONE. + * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.   */ -#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_NONE +#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_NONE. + *          different from @p CH_DBG_TRACE_MASK_DISABLED.   */  #define CH_DBG_TRACE_BUFFER_SIZE            128 @@ -498,7 +497,7 @@   *          the system is halted.   */  #define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \ -  /* Halt code here.*/                                                      \ +  /* System halt code here.*/                                               \  }  /** @@ -516,6 +515,6 @@  /* Port-specific settings (override port settings defaulted in chcore.h).    */  /*===========================================================================*/ -#endif  /* _CHCONF_H_ */ +#endif  /* CHCONF_H */  /** @} */ diff --git a/testhal/STM32/STM32F4xx/FSMC_SRAM/halconf.h b/testhal/STM32/STM32F4xx/FSMC_SRAM/halconf.h index 726e673..e690d15 100644 --- a/testhal/STM32/STM32F4xx/FSMC_SRAM/halconf.h +++ b/testhal/STM32/STM32F4xx/FSMC_SRAM/halconf.h @@ -1,5 +1,5 @@  /* -    ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio +    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. @@ -25,8 +25,8 @@   * @{   */ -#ifndef _HALCONF_H_ -#define _HALCONF_H_ +#ifndef HALCONF_H +#define HALCONF_H  #include "mcuconf.h" @@ -45,17 +45,17 @@  #endif  /** - * @brief   Enables the DAC subsystem. + * @brief   Enables the CAN subsystem.   */ -#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) -#define HAL_USE_DAC                 FALSE +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN                 FALSE  #endif  /** - * @brief   Enables the CAN subsystem. + * @brief   Enables the DAC subsystem.   */ -#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) -#define HAL_USE_CAN                 FALSE +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC                 FALSE  #endif  /** @@ -294,7 +294,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__) @@ -302,6 +302,29 @@  #endif  /*===========================================================================*/ +/* SERIAL_USB driver related setting.                                        */ +/*===========================================================================*/ + +/** + * @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 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.                                              */  /*===========================================================================*/ @@ -322,11 +345,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/STM32F4xx/FSMC_SRAM/halconf_community.h b/testhal/STM32/STM32F4xx/FSMC_SRAM/halconf_community.h index 8d24d02c..606fed4 100644 --- a/testhal/STM32/STM32F4xx/FSMC_SRAM/halconf_community.h +++ b/testhal/STM32/STM32F4xx/FSMC_SRAM/halconf_community.h @@ -59,6 +59,13 @@  #define HAL_USE_CRC                 FALSE
  #endif
 +/**
 + * @brief   Enables the RNG subsystem.
 + */
 +#if !defined(HAL_USE_RNG) || defined(__DOXYGEN__)
 +#define HAL_USE_RNG                 FALSE
 +#endif
 +
  /*===========================================================================*/
  /* FSMCNAND driver related settings.                                         */
  /*===========================================================================*/
 diff --git a/testhal/STM32/STM32F4xx/FSMC_SRAM/mcuconf.h b/testhal/STM32/STM32F4xx/FSMC_SRAM/mcuconf.h index 2368e1f..d2333ba 100644 --- a/testhal/STM32/STM32F4xx/FSMC_SRAM/mcuconf.h +++ b/testhal/STM32/STM32F4xx/FSMC_SRAM/mcuconf.h @@ -1,5 +1,5 @@  /* -    ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio +    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. @@ -14,6 +14,9 @@      limitations under the License.  */ +#ifndef MCUCONF_H +#define MCUCONF_H +  /*   * STM32F4xx drivers configuration.   * The following settings override the default settings present in @@ -88,6 +91,19 @@  #define STM32_CAN_CAN2_IRQ_PRIORITY         11  /* + * DAC driver system settings. + */ +#define STM32_DAC_DUAL_MODE                 FALSE +#define STM32_DAC_USE_DAC1_CH1              FALSE +#define STM32_DAC_USE_DAC1_CH2              FALSE +#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY     10 +#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY     10 +#define STM32_DAC_DAC1_CH1_DMA_PRIORITY     2 +#define STM32_DAC_DAC1_CH2_DMA_PRIORITY     2 +#define STM32_DAC_DAC1_CH1_DMA_STREAM       STM32_DMA_STREAM_ID(1, 5) +#define STM32_DAC_DAC1_CH2_DMA_STREAM       STM32_DMA_STREAM_ID(1, 6) + +/*   * EXT driver system settings.   */  #define STM32_EXT_EXTI0_IRQ_PRIORITY        6 @@ -155,6 +171,21 @@  #define STM32_I2C_DMA_ERROR_HOOK(i2cp)      osalSysHalt("DMA failure")  /* + * I2S driver system settings. + */ +#define STM32_I2S_USE_SPI2                  FALSE +#define STM32_I2S_USE_SPI3                  FALSE +#define STM32_I2S_SPI2_IRQ_PRIORITY         10 +#define STM32_I2S_SPI3_IRQ_PRIORITY         10 +#define STM32_I2S_SPI2_DMA_PRIORITY         1 +#define STM32_I2S_SPI3_DMA_PRIORITY         1 +#define STM32_I2S_SPI2_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 3) +#define STM32_I2S_SPI2_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 4) +#define STM32_I2S_SPI3_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 0) +#define STM32_I2S_SPI3_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 7) +#define STM32_I2S_DMA_ERROR_HOOK(i2sp)      osalSysHalt("DMA failure") + +/*   * ICU driver system settings.   */  #define STM32_ICU_USE_TIM1                  FALSE @@ -304,7 +335,13 @@  #define STM32_USB_OTGFIFO_FILL_BASEPRI      0  /* + * WDG driver system settings. + */ +#define STM32_WDG_USE_IWDG                  FALSE + +/*   * header for community drivers.   */  #include "mcuconf_community.h" +#endif /* MCUCONF_H */ diff --git a/testhal/STM32/STM32F4xx/FSMC_SRAM/mcuconf_community.h b/testhal/STM32/STM32F4xx/FSMC_SRAM/mcuconf_community.h index 3d0ae26..c439a31 100644 --- a/testhal/STM32/STM32F4xx/FSMC_SRAM/mcuconf_community.h +++ b/testhal/STM32/STM32F4xx/FSMC_SRAM/mcuconf_community.h @@ -37,13 +37,13 @@  #define STM32_USE_FSMC_SRAM                 TRUE  #define STM32_SRAM_USE_FSMC_SRAM1           FALSE  #define STM32_SRAM_USE_FSMC_SRAM2           FALSE -#define STM32_SRAM_USE_FSMC_SRAM3           FLASE +#define STM32_SRAM_USE_FSMC_SRAM3           FALSE  #define STM32_SRAM_USE_FSMC_SRAM4           TRUE  /*   * FSMC PC card driver system settings.   */ -#define STM32_USE_FSMC_PCARD                FALSE +#define STM32_USE_FSMC_PCCARD               FALSE  /*   * FSMC SDRAM driver system settings. diff --git a/testhal/STM32/STM32F4xx/USB_HOST/Makefile b/testhal/STM32/STM32F4xx/USB_HOST/Makefile index d1e5bc9..4946cba 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/Makefile +++ b/testhal/STM32/STM32F4xx/USB_HOST/Makefile @@ -10,7 +10,7 @@ endif  # C specific options here (added to USE_OPT).
  ifeq ($(USE_COPT),)
 -  USE_COPT = 
 +  USE_COPT =
  endif
  # C++ specific options here (added to USE_OPT).
 @@ -25,7 +25,7 @@ endif  # Linker extra options here.
  ifeq ($(USE_LDOPT),)
 -  USE_LDOPT = 
 +  USE_LDOPT =
  endif
  # Enable this if you want link time optimizations (LTO)
 @@ -69,7 +69,7 @@ ifeq ($(USE_EXCEPTIONS_STACKSIZE),)    USE_EXCEPTIONS_STACKSIZE = 0x800
  endif
 -# Enables the use of FPU on Cortex-M4 (no, softfp, hard).
 +# Enables the use of FPU (no, softfp, hard).
  ifeq ($(USE_FPU),)
    USE_FPU = no
  endif
 @@ -89,7 +89,7 @@ PROJECT = ch  CHIBIOS = ../../../../../ChibiOS-RT
  CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib
  # Startup files.
 -include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk
 +include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk
  # HAL-OSAL files (optional).
  include $(CHIBIOS_CONTRIB)/os/hal/hal.mk
  include $(CHIBIOS_CONTRIB)/os/hal/ports/STM32/STM32F4xx/platform.mk
 @@ -97,12 +97,15 @@ include $(CHIBIOS)/os/hal/boards/ST_STM32F4_DISCOVERY/board.mk  include $(CHIBIOS)/os/hal/osal/rt/osal.mk
  # RTOS files (optional).
  include $(CHIBIOS)/os/rt/rt.mk
 -include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
 +include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
  # Other files (optional).
  include $(CHIBIOS)/test/rt/test.mk
 +include $(CHIBIOS)/os/hal/lib/streams/streams.mk
 +include $(CHIBIOS)/os/various/shell/shell.mk
 +include $(CHIBIOS)/os/various/fatfs_bindings/fatfs.mk
  # Define linker script file here
 -LDSCRIPT= $(STARTUPLD)/STM32F407xG.ld
 +LDSCRIPT = $(STARTUPLD)/STM32F407xG.ld
  # C sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
 @@ -114,10 +117,10 @@ CSRC = $(STARTUPSRC) \         $(PLATFORMSRC) \
         $(BOARDSRC) \
         $(TESTSRC) \
 -       $(CHIBIOS)/os/various/shell.c \
 -       $(CHIBIOS)/os/hal/lib/streams/memstreams.c \
 -       $(CHIBIOS)/os/hal/lib/streams/chprintf.c \
 -       ff.c fatfs_diskio.c main.c
 +       $(FATFSSRC) \
 +       $(STREAMSSRC) \
 +       $(SHELLSRC) \
 +       main.c
  # C++ sources that can be compiled in ARM or THUMB mode depending on the global
  # setting.
 @@ -150,7 +153,7 @@ ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)  INCDIR = $(CHIBIOS)/os/license \
           $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
           $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
 -         $(CHIBIOS)/os/hal/lib/streams \
 +         $(STREAMSINC) $(SHELLINC) $(FATFSINC) \
           $(CHIBIOS)/os/various
  #
 @@ -219,5 +222,5 @@ ULIBS =  # End of user defines
  ##############################################################################
 -RULESPATH = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC
 +RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC
  include $(RULESPATH)/rules.mk
 diff --git a/testhal/STM32/STM32F4xx/USB_HOST/chconf.h b/testhal/STM32/STM32F4xx/USB_HOST/chconf.h index 75802f0..449cb3d 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..2015 Giovanni Di Sirio
 +    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.
 @@ -25,8 +25,10 @@   * @{
   */
 -#ifndef _CHCONF_H_
 -#define _CHCONF_H_
 +#ifndef CHCONF_H
 +#define CHCONF_H
 +
 +#define _CHIBIOS_RT_CONF_
  /*===========================================================================*/
  /**
 @@ -263,14 +265,6 @@  #define CH_CFG_USE_MAILBOXES                TRUE
  /**
 - * @brief   I/O Queues APIs.
 - * @details If enabled then the I/O queues APIs are included in the kernel.
 - *
 - * @note    The default is @p TRUE.
 - */
 -#define CH_CFG_USE_QUEUES                   TRUE
 -
 -/**
   * @brief   Core Memory Manager APIs.
   * @details If enabled then the core memory manager APIs are included
   *          in the kernel.
 @@ -357,12 +351,18 @@  /**
   * @brief   Debug option, trace buffer.
 - * @details If enabled then the context switch circular trace buffer is
 - *          activated.
 + * @details If enabled then the trace buffer is activated.
   *
 - * @note    The default is @p FALSE.
 + * @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_ENABLE_TRACE                 FALSE
 +#define CH_DBG_TRACE_BUFFER_SIZE            128
  /**
   * @brief   Debug option, stack checks.
 @@ -427,10 +427,6 @@  /**
   * @brief   Threads finalization hook.
   * @details User finalization code added to the @p chThdExit() API.
 - *
 - * @note    It is inserted into lock zone.
 - * @note    It is also invoked when the threads simply return in order to
 - *          terminate.
   */
  #define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \
    /* Add threads finalization code here.*/                                  \
 @@ -445,12 +441,27 @@  }
  /**
 + * @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.*/                                                \
  }
  /**
 @@ -460,6 +471,7 @@   * @note    This macro can be used to deactivate a power saving mode.
   */
  #define CH_CFG_IDLE_LEAVE_HOOK() {                                          \
 +  /* Idle-leave code here.*/                                                \
  }
  /**
 @@ -490,12 +502,21 @@    usbDbgSystemHalted(); \
  }
 +/**
 + * @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_ */
 +#endif  /* CHCONF_H */
  /** @} */
 diff --git a/testhal/STM32/STM32F4xx/USB_HOST/halconf.h b/testhal/STM32/STM32F4xx/USB_HOST/halconf.h index 332a95a..9ddbb1b 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/halconf.h +++ b/testhal/STM32/STM32F4xx/USB_HOST/halconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
 +    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.
 @@ -25,8 +25,8 @@   * @{
   */
 -#ifndef _HALCONF_H_
 -#define _HALCONF_H_
 +#ifndef HALCONF_H
 +#define HALCONF_H
  #include "mcuconf.h"
 @@ -309,13 +309,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.                                              */
  /*===========================================================================*/
 @@ -336,8 +344,44 @@  #define SPI_USE_MUTUAL_EXCLUSION    TRUE
  #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/STM32F4xx/USB_HOST/halconf_community.h b/testhal/STM32/STM32F4xx/USB_HOST/halconf_community.h index 7ea0e06..49db499 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/halconf_community.h +++ b/testhal/STM32/STM32F4xx/USB_HOST/halconf_community.h @@ -60,17 +60,17 @@  #endif
  /**
 - * @brief   Enables the IWDG subsystem.
 + * @brief   Enables the RNG subsystem.
   */
 -#if !defined(HAL_USE_IWDG) || defined(__DOXYGEN__)
 -#define HAL_USE_IWDG               FALSE
 +#if !defined(HAL_USE_RNG) || defined(__DOXYGEN__)
 +#define HAL_USE_RNG                 FALSE
  #endif
  /**
   * @brief   Enables the TIMCAP subsystem.
   */
  #if !defined(HAL_USE_TIMCAP) || defined(__DOXYGEN__)
 -#define HAL_USE_TIMCAP            FALSE
 +#define HAL_USE_TIMCAP              FALSE
  #endif
  /**
 @@ -82,86 +82,86 @@  /*===========================================================================*/
 -/* USBH driver related settings.                                         */
 +/* USBH driver related settings.                                             */
  /*===========================================================================*/
  /* main driver */
 -#define HAL_USBH_PORT_DEBOUNCE_TIME					200
 -#define HAL_USBH_PORT_RESET_TIMEOUT					500
 -#define HAL_USBH_DEVICE_ADDRESS_STABILIZATION		20
 +#define HAL_USBH_PORT_DEBOUNCE_TIME                   200
 +#define HAL_USBH_PORT_RESET_TIMEOUT                   500
 +#define HAL_USBH_DEVICE_ADDRESS_STABILIZATION         20
  /* MSD */
 -#define HAL_USBH_USE_MSD					1
 +#define HAL_USBH_USE_MSD                              1
 -#define HAL_USBHMSD_MAX_LUNS				1
 -#define HAL_USBHMSD_MAX_INSTANCES			1
 +#define HAL_USBHMSD_MAX_LUNS                          1
 +#define HAL_USBHMSD_MAX_INSTANCES                     1
  /* IAD */
 -#define HAL_USBH_USE_FTDI					1
 +#define HAL_USBH_USE_FTDI                             1
 -#define HAL_USBHFTDI_MAX_PORTS				1
 -#define HAL_USBHFTDI_MAX_INSTANCES			1
 -#define HAL_USBHFTDI_DEFAULT_SPEED			9600
 -#define HAL_USBHFTDI_DEFAULT_FRAMING		(USBHFTDI_FRAMING_DATABITS_8 | USBHFTDI_FRAMING_PARITY_NONE | USBHFTDI_FRAMING_STOP_BITS_1)
 -#define HAL_USBHFTDI_DEFAULT_HANDSHAKE		USBHFTDI_HANDSHAKE_NONE
 -#define HAL_USBHFTDI_DEFAULT_XON			0x11
 -#define HAL_USBHFTDI_DEFAULT_XOFF			0x13
 +#define HAL_USBHFTDI_MAX_PORTS                        1
 +#define HAL_USBHFTDI_MAX_INSTANCES                    1
 +#define HAL_USBHFTDI_DEFAULT_SPEED                    9600
 +#define HAL_USBHFTDI_DEFAULT_FRAMING                  (USBHFTDI_FRAMING_DATABITS_8 | USBHFTDI_FRAMING_PARITY_NONE | USBHFTDI_FRAMING_STOP_BITS_1)
 +#define HAL_USBHFTDI_DEFAULT_HANDSHAKE                USBHFTDI_HANDSHAKE_NONE
 +#define HAL_USBHFTDI_DEFAULT_XON                      0x11
 +#define HAL_USBHFTDI_DEFAULT_XOFF                     0x13
  /* IAD */
 -#define HAL_USBH_USE_IAD					0
 +#define HAL_USBH_USE_IAD                              0
  /* UVC */
 -#define HAL_USBH_USE_UVC					0
 +#define HAL_USBH_USE_UVC                              0
 -#define HAL_USBHUVC_MAX_INSTANCES			1
 -#define HAL_USBHUVC_MAX_MAILBOX_SZ			70
 -#define HAL_USBHUVC_WORK_RAM_SIZE			20000
 -#define HAL_USBHUVC_STATUS_PACKETS_COUNT	10
 +#define HAL_USBHUVC_MAX_INSTANCES                     1
 +#define HAL_USBHUVC_MAX_MAILBOX_SZ                    70
 +#define HAL_USBHUVC_WORK_RAM_SIZE                     20000
 +#define HAL_USBHUVC_STATUS_PACKETS_COUNT              10
  /* HUB */
 -#define HAL_USBH_USE_HUB					1
 +#define HAL_USBH_USE_HUB                              1
 -#define HAL_USBHHUB_MAX_INSTANCES			1
 -#define HAL_USBHHUB_MAX_PORTS				6
 +#define HAL_USBHHUB_MAX_INSTANCES                     1
 +#define HAL_USBHHUB_MAX_PORTS                         6
  /* debug */
 -#define USBH_DEBUG_ENABLE					1
 -#define USBH_DEBUG_USBHD					USBHD1
 -#define USBH_DEBUG_SD						SD2
 -#define USBH_DEBUG_BUFFER					25000
 -
 -#define USBH_DEBUG_ENABLE_TRACE				0
 -#define USBH_DEBUG_ENABLE_INFO				1
 -#define USBH_DEBUG_ENABLE_WARNINGS			1
 -#define USBH_DEBUG_ENABLE_ERRORS			1
 -
 -#define USBH_LLD_DEBUG_ENABLE_TRACE			0
 -#define USBH_LLD_DEBUG_ENABLE_INFO			1
 -#define USBH_LLD_DEBUG_ENABLE_WARNINGS		1
 -#define USBH_LLD_DEBUG_ENABLE_ERRORS		1
 -
 -#define USBHHUB_DEBUG_ENABLE_TRACE			0
 -#define USBHHUB_DEBUG_ENABLE_INFO			1
 -#define USBHHUB_DEBUG_ENABLE_WARNINGS		1
 -#define USBHHUB_DEBUG_ENABLE_ERRORS			1
 -
 -#define USBHMSD_DEBUG_ENABLE_TRACE			0
 -#define USBHMSD_DEBUG_ENABLE_INFO			1
 -#define USBHMSD_DEBUG_ENABLE_WARNINGS		1
 -#define USBHMSD_DEBUG_ENABLE_ERRORS			1
 -
 -#define USBHUVC_DEBUG_ENABLE_TRACE			0
 -#define USBHUVC_DEBUG_ENABLE_INFO			1
 -#define USBHUVC_DEBUG_ENABLE_WARNINGS		1
 -#define USBHUVC_DEBUG_ENABLE_ERRORS			1
 -
 -#define USBHFTDI_DEBUG_ENABLE_TRACE			0
 -#define USBHFTDI_DEBUG_ENABLE_INFO			1
 -#define USBHFTDI_DEBUG_ENABLE_WARNINGS		1
 -#define USBHFTDI_DEBUG_ENABLE_ERRORS		1
 +#define USBH_DEBUG_ENABLE                             1
 +#define USBH_DEBUG_USBHD                              USBHD1
 +#define USBH_DEBUG_SD                                 SD2
 +#define USBH_DEBUG_BUFFER                             25000
 +
 +#define USBH_DEBUG_ENABLE_TRACE                       0
 +#define USBH_DEBUG_ENABLE_INFO                        1
 +#define USBH_DEBUG_ENABLE_WARNINGS                    1
 +#define USBH_DEBUG_ENABLE_ERRORS                      1
 +
 +#define USBH_LLD_DEBUG_ENABLE_TRACE                   0
 +#define USBH_LLD_DEBUG_ENABLE_INFO                    1
 +#define USBH_LLD_DEBUG_ENABLE_WARNINGS                1
 +#define USBH_LLD_DEBUG_ENABLE_ERRORS                  1
 +
 +#define USBHHUB_DEBUG_ENABLE_TRACE                    0
 +#define USBHHUB_DEBUG_ENABLE_INFO                     1
 +#define USBHHUB_DEBUG_ENABLE_WARNINGS                 1
 +#define USBHHUB_DEBUG_ENABLE_ERRORS                   1
 +
 +#define USBHMSD_DEBUG_ENABLE_TRACE                    0
 +#define USBHMSD_DEBUG_ENABLE_INFO                     1
 +#define USBHMSD_DEBUG_ENABLE_WARNINGS                 1
 +#define USBHMSD_DEBUG_ENABLE_ERRORS                   1
 +
 +#define USBHUVC_DEBUG_ENABLE_TRACE                    0
 +#define USBHUVC_DEBUG_ENABLE_INFO                     1
 +#define USBHUVC_DEBUG_ENABLE_WARNINGS                 1
 +#define USBHUVC_DEBUG_ENABLE_ERRORS                   1
 +
 +#define USBHFTDI_DEBUG_ENABLE_TRACE                   0
 +#define USBHFTDI_DEBUG_ENABLE_INFO                    1
 +#define USBHFTDI_DEBUG_ENABLE_WARNINGS                1
 +#define USBHFTDI_DEBUG_ENABLE_ERRORS                  1
  /*===========================================================================*/
  /* FSMCNAND driver related settings.                                         */
 diff --git a/testhal/STM32/STM32F4xx/USB_HOST/mcuconf.h b/testhal/STM32/STM32F4xx/USB_HOST/mcuconf.h index 39a3ef6..c7671b7 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/mcuconf.h +++ b/testhal/STM32/STM32F4xx/USB_HOST/mcuconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
 +    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.
 @@ -14,8 +14,8 @@      limitations under the License.
  */
 -#ifndef _MCUCONF_H_
 -#define _MCUCONF_H_
 +#ifndef MCUCONF_H
 +#define MCUCONF_H
  /*
   * STM32F4xx drivers configuration.
 @@ -171,6 +171,21 @@  #define STM32_I2C_DMA_ERROR_HOOK(i2cp)      osalSysHalt("DMA failure")
  /*
 + * I2S driver system settings.
 + */
 +#define STM32_I2S_USE_SPI2                  FALSE
 +#define STM32_I2S_USE_SPI3                  FALSE
 +#define STM32_I2S_SPI2_IRQ_PRIORITY         10
 +#define STM32_I2S_SPI3_IRQ_PRIORITY         10
 +#define STM32_I2S_SPI2_DMA_PRIORITY         1
 +#define STM32_I2S_SPI3_DMA_PRIORITY         1
 +#define STM32_I2S_SPI2_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 3)
 +#define STM32_I2S_SPI2_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 4)
 +#define STM32_I2S_SPI3_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 0)
 +#define STM32_I2S_SPI3_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 7)
 +#define STM32_I2S_DMA_ERROR_HOOK(i2sp)      osalSysHalt("DMA failure")
 +
 +/*
   * ICU driver system settings.
   */
  #define STM32_ICU_USE_TIM1                  FALSE
 @@ -319,6 +334,14 @@  #define STM32_USB_OTG_THREAD_STACK_SIZE     128
  #define STM32_USB_OTGFIFO_FILL_BASEPRI      0
 +/*
 + * 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/STM32F4xx/USB_HOST/mcuconf_community.h b/testhal/STM32/STM32F4xx/USB_HOST/mcuconf_community.h index 888662f..56775af 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/mcuconf_community.h +++ b/testhal/STM32/STM32F4xx/USB_HOST/mcuconf_community.h @@ -36,7 +36,7 @@  #define STM32_USE_FSMC_SRAM                 FALSE  #define STM32_SRAM_USE_FSMC_SRAM1           FALSE  #define STM32_SRAM_USE_FSMC_SRAM2           FALSE -#define STM32_SRAM_USE_FSMC_SRAM3           FLASE +#define STM32_SRAM_USE_FSMC_SRAM3           FALSE  #define STM32_SRAM_USE_FSMC_SRAM4           FALSE  /* @@ -48,19 +48,19 @@  /*   * USBH driver system settings.   */ +#define STM32_OTG1_CHANNELS_NUMBER             8 +#define STM32_OTG2_CHANNELS_NUMBER             12 -#define STM32_OTG1_CHANNELS_NUMBER		8 -#define STM32_OTG2_CHANNELS_NUMBER		12 +#define STM32_USBH_USE_OTG1                    1 +#define STM32_OTG1_RXFIFO_SIZE                 1024 +#define STM32_OTG1_PTXFIFO_SIZE                128 +#define STM32_OTG1_NPTXFIFO_SIZE               128 -#define STM32_USBH_USE_OTG1				1 -#define STM32_OTG1_RXFIFO_SIZE			1024 -#define STM32_OTG1_PTXFIFO_SIZE			128 -#define STM32_OTG1_NPTXFIFO_SIZE		128 +#define STM32_USBH_USE_OTG2                    0 +#define STM32_OTG2_RXFIFO_SIZE                 2048 +#define STM32_OTG2_PTXFIFO_SIZE                1024 +#define STM32_OTG2_NPTXFIFO_SIZE               1024 -#define STM32_USBH_USE_OTG2				0 -#define STM32_OTG2_RXFIFO_SIZE			2048 -#define STM32_OTG2_PTXFIFO_SIZE			1024 -#define STM32_OTG2_NPTXFIFO_SIZE		1024 +#define STM32_USBH_MIN_QSPACE                  4 +#define STM32_USBH_CHANNELS_NP                 4 -#define STM32_USBH_MIN_QSPACE			4 -#define STM32_USBH_CHANNELS_NP 			4 diff --git a/testhal/STM32/STM32F4xx/onewire/Makefile b/testhal/STM32/STM32F4xx/onewire/Makefile index 4ed0f8d..02ab018 100644 --- a/testhal/STM32/STM32F4xx/onewire/Makefile +++ b/testhal/STM32/STM32F4xx/onewire/Makefile @@ -43,6 +43,12 @@ ifeq ($(USE_VERBOSE_COMPILE),)    USE_VERBOSE_COMPILE = no  endif +# If enabled, this option makes the build process faster by not compiling +# modules not used in the current configuration. +ifeq ($(USE_SMART_BUILD),) +  USE_SMART_BUILD = no +endif +  #  # Build global options  ############################################################################## @@ -63,7 +69,7 @@ ifeq ($(USE_EXCEPTIONS_STACKSIZE),)    USE_EXCEPTIONS_STACKSIZE = 0x400  endif -# Enables the use of FPU on Cortex-M4 (no, softfp, hard). +# Enables the use of FPU (no, softfp, hard).  ifeq ($(USE_FPU),)    USE_FPU = no  endif @@ -94,7 +100,7 @@ include $(CHIBIOS)/os/rt/rt.mk  include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk  # Define linker script file here -LDSCRIPT= $(STARTUPLD)/STM32F407xG.ld +LDSCRIPT = $(STARTUPLD)/STM32F407xG.ld  # C sources that can be compiled in ARM or THUMB mode depending on the global  # setting. @@ -176,10 +182,10 @@ AOPT =  TOPT = -mthumb -DTHUMB  # Define C warning options here -CWARN = -Wall -Wextra -Wstrict-prototypes -Wundef +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes  # Define C++ warning options here -CPPWARN = -Wall -Wextra -Wundef +CPPWARN = -Wall -Wextra  #  # Compiler settings diff --git a/testhal/STM32/STM32F4xx/onewire/chconf.h b/testhal/STM32/STM32F4xx/onewire/chconf.h index 01cc4a0..1065821 100644 --- a/testhal/STM32/STM32F4xx/onewire/chconf.h +++ b/testhal/STM32/STM32F4xx/onewire/chconf.h @@ -1,5 +1,5 @@  /* -    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio +    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. @@ -25,8 +25,8 @@   * @{   */ -#ifndef _CHCONF_H_ -#define _CHCONF_H_ +#ifndef CHCONF_H +#define CHCONF_H  #define _CHIBIOS_RT_CONF_ @@ -351,17 +351,16 @@  /**   * @brief   Debug option, trace buffer. - * @details If enabled then the context switch circular trace buffer is - *          activated. + * @details If enabled then the trace buffer is activated.   * - * @note    The default is @p CH_DBG_TRACE_MASK_NONE. + * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.   */ -#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_NONE +#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_NONE. + *          different from @p CH_DBG_TRACE_MASK_DISABLED.   */  #define CH_DBG_TRACE_BUFFER_SIZE            128 @@ -498,7 +497,7 @@   *          the system is halted.   */  #define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \ -  /* Halt code here.*/                                                      \ +  /* System halt code here.*/                                               \  }  /** @@ -516,6 +515,6 @@  /* Port-specific settings (override port settings defaulted in chcore.h).    */  /*===========================================================================*/ -#endif  /* _CHCONF_H_ */ +#endif  /* CHCONF_H */  /** @} */ diff --git a/testhal/STM32/STM32F4xx/onewire/halconf.h b/testhal/STM32/STM32F4xx/onewire/halconf.h index e6ce929..64811a5 100644 --- a/testhal/STM32/STM32F4xx/onewire/halconf.h +++ b/testhal/STM32/STM32F4xx/onewire/halconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006-2014 Giovanni Di Sirio
 +    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.
 @@ -25,8 +25,8 @@   * @{
   */
 -#ifndef _HALCONF_H_
 -#define _HALCONF_H_
 +#ifndef HALCONF_H
 +#define HALCONF_H
  #include "mcuconf.h"
 @@ -45,17 +45,17 @@  #endif
  /**
 - * @brief   Enables the DAC subsystem.
 + * @brief   Enables the CAN subsystem.
   */
 -#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
 -#define HAL_USE_DAC                 FALSE
 +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
 +#define HAL_USE_CAN                 FALSE
  #endif
  /**
 - * @brief   Enables the CAN subsystem.
 + * @brief   Enables the DAC subsystem.
   */
 -#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
 -#define HAL_USE_CAN                 FALSE
 +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
 +#define HAL_USE_DAC                 FALSE
  #endif
  /**
 @@ -294,7 +294,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 +309,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 +345,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/STM32F4xx/onewire/halconf_community.h b/testhal/STM32/STM32F4xx/onewire/halconf_community.h index 5e36946..91dbfbc 100644 --- a/testhal/STM32/STM32F4xx/onewire/halconf_community.h +++ b/testhal/STM32/STM32F4xx/onewire/halconf_community.h @@ -53,7 +53,7 @@  #endif
  /**
 - * @brief   Enables the community subsystem.
 + * @brief   Enables the CRC subsystem.
   */
  #if !defined(HAL_USE_CRC) || defined(__DOXYGEN__)
  #define HAL_USE_CRC                 FALSE
 diff --git a/testhal/STM32/STM32F4xx/onewire/mcuconf.h b/testhal/STM32/STM32F4xx/onewire/mcuconf.h index 793c925..2111433 100644 --- a/testhal/STM32/STM32F4xx/onewire/mcuconf.h +++ b/testhal/STM32/STM32F4xx/onewire/mcuconf.h @@ -1,5 +1,5 @@  /*
 -    ChibiOS - Copyright (C) 2006-2014 Giovanni Di Sirio
 +    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.
 @@ -14,6 +14,9 @@      limitations under the License.
  */
 +#ifndef MCUCONF_H
 +#define MCUCONF_H
 +
  /*
   * STM32F4xx drivers configuration.
   * The following settings override the default settings present in
 @@ -88,6 +91,19 @@  #define STM32_CAN_CAN2_IRQ_PRIORITY         11
  /*
 + * DAC driver system settings.
 + */
 +#define STM32_DAC_DUAL_MODE                 FALSE
 +#define STM32_DAC_USE_DAC1_CH1              FALSE
 +#define STM32_DAC_USE_DAC1_CH2              FALSE
 +#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY     10
 +#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY     10
 +#define STM32_DAC_DAC1_CH1_DMA_PRIORITY     2
 +#define STM32_DAC_DAC1_CH2_DMA_PRIORITY     2
 +#define STM32_DAC_DAC1_CH1_DMA_STREAM       STM32_DMA_STREAM_ID(1, 5)
 +#define STM32_DAC_DAC1_CH2_DMA_STREAM       STM32_DMA_STREAM_ID(1, 6)
 +
 +/*
   * EXT driver system settings.
   */
  #define STM32_EXT_EXTI0_IRQ_PRIORITY        6
 @@ -155,6 +171,21 @@  #define STM32_I2C_DMA_ERROR_HOOK(i2cp)      osalSysHalt("DMA failure")
  /*
 + * I2S driver system settings.
 + */
 +#define STM32_I2S_USE_SPI2                  FALSE
 +#define STM32_I2S_USE_SPI3                  FALSE
 +#define STM32_I2S_SPI2_IRQ_PRIORITY         10
 +#define STM32_I2S_SPI3_IRQ_PRIORITY         10
 +#define STM32_I2S_SPI2_DMA_PRIORITY         1
 +#define STM32_I2S_SPI3_DMA_PRIORITY         1
 +#define STM32_I2S_SPI2_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 3)
 +#define STM32_I2S_SPI2_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 4)
 +#define STM32_I2S_SPI3_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 0)
 +#define STM32_I2S_SPI3_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 7)
 +#define STM32_I2S_DMA_ERROR_HOOK(i2sp)      osalSysHalt("DMA failure")
 +
 +/*
   * ICU driver system settings.
   */
  #define STM32_ICU_USE_TIM1                  FALSE
 @@ -304,7 +335,13 @@  #define STM32_USB_OTGFIFO_FILL_BASEPRI      0
  /*
 + * WDG driver system settings.
 + */
 +#define STM32_WDG_USE_IWDG                  FALSE
 +
 +/*
   * header for community drivers.
   */
  #include "mcuconf_community.h"
 +#endif /* MCUCONF_H */
 diff --git a/testhal/STM32/STM32F4xx/onewire/mcuconf_community.h b/testhal/STM32/STM32F4xx/onewire/mcuconf_community.h index 4a13b56..7ca6e71 100644 --- a/testhal/STM32/STM32F4xx/onewire/mcuconf_community.h +++ b/testhal/STM32/STM32F4xx/onewire/mcuconf_community.h @@ -36,7 +36,7 @@  #define STM32_USE_FSMC_SRAM                 FALSE  #define STM32_SRAM_USE_FSMC_SRAM1           FALSE  #define STM32_SRAM_USE_FSMC_SRAM2           FALSE -#define STM32_SRAM_USE_FSMC_SRAM3           FLASE +#define STM32_SRAM_USE_FSMC_SRAM3           FALSE  #define STM32_SRAM_USE_FSMC_SRAM4           FALSE  /* | 
