summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-09-13 07:28:14 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-09-13 07:28:14 -0600
commit4a49cbdf3a7bb804bd7e4a4bd25776b6e8ed43dd (patch)
treec64182169b1b880750461bb1334fd7f0ec2f2430
parenta1b0818673cff7d293ab28bf32ca830682638f1c (diff)
downloadnuttx-4a49cbdf3a7bb804bd7e4a4bd25776b6e8ed43dd.tar.gz
nuttx-4a49cbdf3a7bb804bd7e4a4bd25776b6e8ed43dd.tar.bz2
nuttx-4a49cbdf3a7bb804bd7e4a4bd25776b6e8ed43dd.zip
Add STM32F4Discovery configuration with the STM32F4DIS-BB base board
-rw-r--r--nuttx/configs/stm32f4discovery/Kconfig21
-rw-r--r--nuttx/configs/stm32f4discovery/README.txt7
-rw-r--r--nuttx/configs/stm32f4discovery/include/board.h56
3 files changed, 70 insertions, 14 deletions
diff --git a/nuttx/configs/stm32f4discovery/Kconfig b/nuttx/configs/stm32f4discovery/Kconfig
index 7ea87512b..124783605 100644
--- a/nuttx/configs/stm32f4discovery/Kconfig
+++ b/nuttx/configs/stm32f4discovery/Kconfig
@@ -5,8 +5,15 @@
if ARCH_BOARD_STM32F4_DISCOVERY
+config STM32F4DISBB
+ bool "STM32F4DIS-BB base board"
+ default n
+ ---help---
+ Select if you are using the STM32F4DIS-BB base board with the
+ STM32F4Discovery.
+
config PM_BUTTONS
- bool "PM Button support"
+ bool "PM button support"
default n
depends on PM && ARCH_IRQBUTTONS
---help---
@@ -17,21 +24,24 @@ config PM_BUTTON_ACTIVITY
default 10
depends on PM_BUTTONS
---help---
- The activity weight to report to the power management subsystem when a button is pressed.
+ The activity weight to report to the power management subsystem when
+ a button is pressed.
config PM_ALARM_SEC
int "PM_STANDBY delay (seconds)"
default 15
depends on PM && RTC_ALARM
---help---
- Number of seconds to wait in PM_STANDBY before going to PM_STANDBY mode.
+ Number of seconds to wait in PM_STANDBY before going to PM_STANDBY
+ mode.
config PM_ALARM_NSEC
int "PM_STANDBY delay (nanoseconds)"
default 0
depends on PM && RTC_ALARM
---help---
- Number of additional nanoseconds to wait in PM_STANDBY before going to PM_STANDBY mode.
+ Number of additional nanoseconds to wait in PM_STANDBY before going
+ to PM_STANDBY mode.
config PM_SLEEP_WAKEUP
bool "PM_SLEEP wake-up alarm"
@@ -52,6 +62,7 @@ config PM_SLEEP_WAKEUP_NSEC
default 0
depends on PM && RTC_ALARM
---help---
- Number of additional nanoseconds to wait in PM_SLEEP before going to PM_STANDBY mode.
+ Number of additional nanoseconds to wait in PM_SLEEP before going to
+ PM_STANDBY mode.
endif
diff --git a/nuttx/configs/stm32f4discovery/README.txt b/nuttx/configs/stm32f4discovery/README.txt
index ce312d3ca..e4f135c0d 100644
--- a/nuttx/configs/stm32f4discovery/README.txt
+++ b/nuttx/configs/stm32f4discovery/README.txt
@@ -356,9 +356,14 @@ USART6
Default USART/UART Configuration
--------------------------------
-USART2 is enabled in all configurations (see */defconfig). RX and TX are
+USART2 is enabled in most configurations (see */defconfig). RX and TX are
configured on pins PA3 and PA2, respectively (see include/board.h).
+These pins selections, however, conflict with Ethernet pin usage on the
+STM32F4DIS-BB base board. The STM32F4DIS-BB base board provides RS-232
+drivers and a DB9 connector for USART6. USART6 is the preferred serial
+console for use with the STM32F4DIS-BB.
+
Timer Inputs/Outputs
====================
diff --git a/nuttx/configs/stm32f4discovery/include/board.h b/nuttx/configs/stm32f4discovery/include/board.h
index f3c583187..6795ab52e 100644
--- a/nuttx/configs/stm32f4discovery/include/board.h
+++ b/nuttx/configs/stm32f4discovery/include/board.h
@@ -1,8 +1,7 @@
/************************************************************************************
* configs/stm32f4discovery/include/board.h
- * include/arch/board/board.h
*
- * Copyright (C) 2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -209,12 +208,27 @@
/* UART2:
*
* The STM32F4 Discovery has no on-board serial devices, but the console is
- * brought out to PA2 (TX) and PA3 (RX) for connection to an external serial device.
- * (See the README.txt file for other options)
+ * brought out to PA2 (TX) and PA3 (RX) for connection to an external serial
+ * device. (See the README.txt file for other options)
+ *
+ * These pins selections, however, conflict with pin usage on the STM32F4DIS-BB.
*/
-#define GPIO_USART2_RX GPIO_USART2_RX_1
-#define GPIO_USART2_TX GPIO_USART2_TX_1
+#ifdef CONFIG_STM32F4DISBB
+# define GPIO_USART2_RX GPIO_USART2_RX_1
+# define GPIO_USART2_TX GPIO_USART2_TX_1
+#endif
+
+/* UART6:
+ *
+ * The STM32F4DIS-BB base board provides RS-232 drivers and a DB9 connector
+ * for USART6. This is the preferred serial console for use with the STM32F4DIS-BB.
+ */
+
+#ifdef CONFIG_STM32F4DISBB
+# define GPIO_USART6_RX GPIO_USART6_RX_1
+# define GPIO_USART6_TX GPIO_USART6_TX_1
+#endif
/* PWM
*
@@ -238,6 +252,31 @@
#define GPIO_TIM8_CH1IN GPIO_TIM8_CH1IN_1
#define GPIO_TIM8_CH2IN GPIO_TIM8_CH2IN_1
+/* Ethernet *************************************************************************/
+
+
+#if defined(CONFIG_STM32F4DISBB) && defined(CONFIG_STM32_ETHMAC)
+ /* RMII interface to the LAN8720 PHY */
+
+# ifndef CONFIG_STM32_RMII
+# error CONFIG_STM32_RMII must be defined
+# endif
+
+ /* Clocking is provided by an external 25Mhz XTAL */
+
+# ifndef CONFIG_STM32_RMII_EXTCLK
+# error CONFIG_STM32_RMII_EXTCLK must be defined
+# endif
+
+ /* Pin disambiguation */
+
+# define GPIO_ETH_RMII_TX_EN GPIO_ETH_RMII_TX_EN_1
+# define GPIO_ETH_RMII_TXD0 GPIO_ETH_RMII_TXD0_1
+# define GPIO_ETH_RMII_TXD1 GPIO_ETH_RMII_TXD1_1
+# define GPIO_ETH_PPS_OUT GPIO_ETH_PPS_OUT_1
+
+#endif
+
/************************************************************************************
* Public Data
************************************************************************************/
@@ -247,7 +286,8 @@
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
-extern "C" {
+extern "C"
+{
#else
#define EXTERN extern
#endif
@@ -260,7 +300,7 @@ extern "C" {
*
* Description:
* All STM32 architectures must provide the following entry point. This entry point
- * is called early in the intitialization -- after all memory has been configured
+ * is called early in the initialization -- after all memory has been configured
* and mapped but before any devices have been initialized.
*
************************************************************************************/