From b94c000dd86448ce81f1a33fa41cc8a98207e1a9 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sun, 28 Feb 2016 12:47:21 +0000 Subject: Added more STM32L4xx demos. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8991 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32/STM32L4xx/GPT-ADC/Makefile | 8 ++--- testhal/STM32/STM32L4xx/GPT-ADC/chconf.h | 54 +++++++++++++++++++++++------- testhal/STM32/STM32L4xx/GPT-ADC/mcuconf.h | 2 +- testhal/STM32/STM32L4xx/GPT-ADC/readme.txt | 1 + 4 files changed, 48 insertions(+), 17 deletions(-) (limited to 'testhal/STM32/STM32L4xx/GPT-ADC') diff --git a/testhal/STM32/STM32L4xx/GPT-ADC/Makefile b/testhal/STM32/STM32L4xx/GPT-ADC/Makefile index 6a6704a36..2d650478b 100644 --- a/testhal/STM32/STM32L4xx/GPT-ADC/Makefile +++ b/testhal/STM32/STM32L4xx/GPT-ADC/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 @@ -88,7 +88,7 @@ PROJECT = ch # Imported source files and paths CHIBIOS = ../../../.. # Startup files. -include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32l4xx.mk +include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32l4xx.mk # HAL-OSAL files (optional). include $(CHIBIOS)/os/hal/hal.mk include $(CHIBIOS)/os/hal/ports/STM32/STM32L4xx/platform.mk @@ -96,7 +96,7 @@ include $(CHIBIOS)/os/hal/boards/ST_NUCLEO_L476RG/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 @@ -212,5 +212,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/STM32L4xx/GPT-ADC/chconf.h b/testhal/STM32/STM32L4xx/GPT-ADC/chconf.h index 405149b3b..a554d3957 100644 --- a/testhal/STM32/STM32L4xx/GPT-ADC/chconf.h +++ b/testhal/STM32/STM32L4xx/GPT-ADC/chconf.h @@ -28,6 +28,8 @@ #ifndef _CHCONF_H_ #define _CHCONF_H_ +#define _CHIBIOS_RT_CONF_ + /*===========================================================================*/ /** * @name System timers settings @@ -325,7 +327,7 @@ * * @note The default is @p FALSE. */ -#define CH_DBG_STATISTICS TRUE +#define CH_DBG_STATISTICS FALSE /** * @brief Debug option, system state check. @@ -334,7 +336,7 @@ * * @note The default is @p FALSE. */ -#define CH_DBG_SYSTEM_STATE_CHECK TRUE +#define CH_DBG_SYSTEM_STATE_CHECK FALSE /** * @brief Debug option, parameters checks. @@ -343,7 +345,7 @@ * * @note The default is @p FALSE. */ -#define CH_DBG_ENABLE_CHECKS TRUE +#define CH_DBG_ENABLE_CHECKS FALSE /** * @brief Debug option, consistency checks. @@ -353,16 +355,23 @@ * * @note The default is @p FALSE. */ -#define CH_DBG_ENABLE_ASSERTS TRUE +#define CH_DBG_ENABLE_ASSERTS FALSE /** * @brief Debug option, trace buffer. * @details If enabled then the context switch circular trace buffer is * activated. * - * @note The default is @p FALSE. + * @note The default is @p CH_DBG_TRACE_MASK_NONE. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_NONE + +/** + * @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. */ -#define CH_DBG_ENABLE_TRACE TRUE +#define CH_DBG_TRACE_BUFFER_SIZE 128 /** * @brief Debug option, stack checks. @@ -374,7 +383,7 @@ * @note The default failure mode is to halt the system with the global * @p panic_msg variable set to @p NULL. */ -#define CH_DBG_ENABLE_STACK_CHECK TRUE +#define CH_DBG_ENABLE_STACK_CHECK FALSE /** * @brief Debug option, stacks initialization. @@ -384,7 +393,7 @@ * * @note The default is @p FALSE. */ -#define CH_DBG_FILL_THREADS TRUE +#define CH_DBG_FILL_THREADS FALSE /** * @brief Debug option, threads profiling. @@ -427,10 +436,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.*/ \ @@ -444,6 +449,20 @@ /* Context switch code here.*/ \ } +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + /** * @brief Idle thread enter hook. * @note This hook is invoked within a critical zone, no OS functions @@ -451,6 +470,7 @@ * @note This macro can be used to activate a power saving mode. */ #define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ } /** @@ -460,6 +480,7 @@ * @note This macro can be used to deactivate a power saving mode. */ #define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ } /** @@ -488,6 +509,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.*/ \ +} + /** @} */ /*===========================================================================*/ diff --git a/testhal/STM32/STM32L4xx/GPT-ADC/mcuconf.h b/testhal/STM32/STM32L4xx/GPT-ADC/mcuconf.h index 106034d7f..0ecca706b 100644 --- a/testhal/STM32/STM32L4xx/GPT-ADC/mcuconf.h +++ b/testhal/STM32/STM32L4xx/GPT-ADC/mcuconf.h @@ -141,7 +141,7 @@ #define STM32_EXT_EXTI4_IRQ_PRIORITY 6 #define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 #define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 -#define STM32_EXT_EXTI16_IRQ_PRIORITYv 6 +#define STM32_EXT_EXTI1635_38_IRQ_PRIORITY 6 #define STM32_EXT_EXTI18_IRQ_PRIORITY 6 #define STM32_EXT_EXTI19_IRQ_PRIORITY 6 #define STM32_EXT_EXTI20_IRQ_PRIORITY 6 diff --git a/testhal/STM32/STM32L4xx/GPT-ADC/readme.txt b/testhal/STM32/STM32L4xx/GPT-ADC/readme.txt index 4f4823957..79d9c27ec 100644 --- a/testhal/STM32/STM32L4xx/GPT-ADC/readme.txt +++ b/testhal/STM32/STM32L4xx/GPT-ADC/readme.txt @@ -8,6 +8,7 @@ The demo runs on an ST NUCLEO-L476RG board. ** The Demo ** +The application demonstrates the use of the STM32L4xx ADC driver triggered by GPT. ** Build Procedure ** -- cgit v1.2.3