aboutsummaryrefslogtreecommitdiffstats
path: root/demos/ARMCM4-STM32F407-DISCOVERY
diff options
context:
space:
mode:
Diffstat (limited to 'demos/ARMCM4-STM32F407-DISCOVERY')
-rw-r--r--demos/ARMCM4-STM32F407-DISCOVERY/Makefile15
-rw-r--r--demos/ARMCM4-STM32F407-DISCOVERY/chconf.h4
-rw-r--r--demos/ARMCM4-STM32F407-DISCOVERY/halconf.h2
-rw-r--r--demos/ARMCM4-STM32F407-DISCOVERY/main.c4
-rw-r--r--demos/ARMCM4-STM32F407-DISCOVERY/readme.txt2
5 files changed, 19 insertions, 8 deletions
diff --git a/demos/ARMCM4-STM32F407-DISCOVERY/Makefile b/demos/ARMCM4-STM32F407-DISCOVERY/Makefile
index 975e5f999..0f32eeceb 100644
--- a/demos/ARMCM4-STM32F407-DISCOVERY/Makefile
+++ b/demos/ARMCM4-STM32F407-DISCOVERY/Makefile
@@ -5,7 +5,7 @@
# Compiler options here.
ifeq ($(USE_OPT),)
- USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 -mhard-float -mfpu=fpv4-sp-d16 -fsingle-precision-constant
+ USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16
endif
# C specific options here (added to USE_OPT).
@@ -41,6 +41,12 @@ endif
# Architecture or project specific options
#
+# Enables the use of FPU on Cortex-M4.
+# Enable this if you really want to use the STM FWLib.
+ifeq ($(USE_FPU),)
+ USE_FPU = no
+endif
+
# Enable this if you really want to use the STM FWLib.
ifeq ($(USE_FWLIB),)
USE_FWLIB = no
@@ -200,6 +206,13 @@ ULIBS =
# End of user defines
##############################################################################
+ifeq ($(USE_FPU),yes)
+ USE_OPT += -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -fsingle-precision-constant
+ DDEFS += -DCORTEX_USE_FPU=TRUE
+else
+ DDEFS += -DCORTEX_USE_FPU=FALSE
+endif
+
ifeq ($(USE_FWLIB),yes)
include $(CHIBIOS)/ext/stm32lib/stm32lib.mk
CSRC += $(STM32SRC)
diff --git a/demos/ARMCM4-STM32F407-DISCOVERY/chconf.h b/demos/ARMCM4-STM32F407-DISCOVERY/chconf.h
index 53f742da0..b1f2cd62c 100644
--- a/demos/ARMCM4-STM32F407-DISCOVERY/chconf.h
+++ b/demos/ARMCM4-STM32F407-DISCOVERY/chconf.h
@@ -459,7 +459,7 @@
* @brief Threads initialization hook.
* @details User initialization code added to the @p chThdInit() API.
*
- * @note It is invoked from within @p chThdInit() and implicitily from all
+ * @note It is invoked from within @p chThdInit() and implicitly from all
* the threads creation APIs.
*/
#if !defined(THREAD_EXT_INIT_HOOK) || defined(__DOXYGEN__)
@@ -530,8 +530,6 @@
/* Port-specific settings (override port settings defaulted in chcore.h). */
/*===========================================================================*/
-#define CORTEX_USE_FPU FALSE
-
#endif /* _CHCONF_H_ */
/** @} */
diff --git a/demos/ARMCM4-STM32F407-DISCOVERY/halconf.h b/demos/ARMCM4-STM32F407-DISCOVERY/halconf.h
index 0a636d3ca..390f4b23e 100644
--- a/demos/ARMCM4-STM32F407-DISCOVERY/halconf.h
+++ b/demos/ARMCM4-STM32F407-DISCOVERY/halconf.h
@@ -268,7 +268,7 @@
/**
* @brief Number of initialization attempts before rejecting the card.
- * @note Attempts are performed at 10mS intevals.
+ * @note Attempts are performed at 10mS intervals.
*/
#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
#define SDC_INIT_RETRY 100
diff --git a/demos/ARMCM4-STM32F407-DISCOVERY/main.c b/demos/ARMCM4-STM32F407-DISCOVERY/main.c
index f7c7e7fa1..101c1a4df 100644
--- a/demos/ARMCM4-STM32F407-DISCOVERY/main.c
+++ b/demos/ARMCM4-STM32F407-DISCOVERY/main.c
@@ -66,7 +66,7 @@ static const ADCConversionGroup adcgrpcfg = {
* the active state is a logic one.
*/
static PWMConfig pwmcfg = {
- 10000, /* 10KHz PWM clock frequency. */
+ 10000, /* 10kHz PWM clock frequency. */
10000, /* PWM period 1S (in ticks). */
pwmpcb,
{
@@ -231,7 +231,7 @@ int main(void) {
/*
* Initializes the ADC driver 1 and enable the thermal sensor.
- * The pin PC0 on the port GPIOC is programmed as analog input.
+ * The pin PC1 on the port GPIOC is programmed as analog input.
*/
adcStart(&ADCD1, NULL);
adcSTM32EnableTSVREFE();
diff --git a/demos/ARMCM4-STM32F407-DISCOVERY/readme.txt b/demos/ARMCM4-STM32F407-DISCOVERY/readme.txt
index b82983548..7cd1132ec 100644
--- a/demos/ARMCM4-STM32F407-DISCOVERY/readme.txt
+++ b/demos/ARMCM4-STM32F407-DISCOVERY/readme.txt
@@ -1,5 +1,5 @@
*****************************************************************************
-** ChibiOS/RT port for ARM-Cortex-M3 STM32F100xB. **
+** ChibiOS/RT port for ARM-Cortex-M4 STM32F407. **
*****************************************************************************
** TARGET **