summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-10-22 14:27:05 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-10-22 14:27:05 -0600
commit34b7967851fc7ae4adb3e46207f962abf77c7b91 (patch)
tree6e23fbe62c4d616bcd608540961d122268e8bdc0
parentcf543ef1c5df5de9da5212e6da9388b68929ca0c (diff)
downloadnuttx-34b7967851fc7ae4adb3e46207f962abf77c7b91.tar.gz
nuttx-34b7967851fc7ae4adb3e46207f962abf77c7b91.tar.bz2
nuttx-34b7967851fc7ae4adb3e46207f962abf77c7b91.zip
Add logic to manage BC_EN signal
-rw-r--r--nuttx/configs/efm32-g8xx-stk/Kconfig12
-rw-r--r--nuttx/configs/efm32-g8xx-stk/README.txt18
-rw-r--r--nuttx/configs/efm32-g8xx-stk/nsh/defconfig6
-rw-r--r--nuttx/configs/efm32-g8xx-stk/src/efm32-g8xx-stk.h16
-rw-r--r--nuttx/configs/efm32-g8xx-stk/src/efm32_boot.c13
5 files changed, 54 insertions, 11 deletions
diff --git a/nuttx/configs/efm32-g8xx-stk/Kconfig b/nuttx/configs/efm32-g8xx-stk/Kconfig
index ef346141e..8f6559c91 100644
--- a/nuttx/configs/efm32-g8xx-stk/Kconfig
+++ b/nuttx/configs/efm32-g8xx-stk/Kconfig
@@ -5,6 +5,16 @@
if ARCH_BOARD_EFM32G8XXSTK
-#comment "EFM32 G8XX STK Hardware Configuration"
+comment "EFM32 G8XX STK Hardware Configuration"
+
+config EFM32G8STK_BCEN
+ bool "Enable BC_EN"
+ default n
+ ---help---
+ The control MCU acts as a board controller (BC). There is a UART
+ connection between the EFM and the BC. The connection is made by
+ setting the EFM_BC_EN (PD13) line high. The EFM can then use the
+ BSP to send commands to the BC. When EFM_BC_EN is low, EFM_BC_TX
+ and EFM_BC_RX can be used by other applications.
endif # ARCH_BOARD_EFM32G8XXSTK
diff --git a/nuttx/configs/efm32-g8xx-stk/README.txt b/nuttx/configs/efm32-g8xx-stk/README.txt
index e8cadd287..2ce5d1718 100644
--- a/nuttx/configs/efm32-g8xx-stk/README.txt
+++ b/nuttx/configs/efm32-g8xx-stk/README.txt
@@ -5,8 +5,8 @@ README
Gecko Starter Kit (EFM32-G8XX-STK). The Gecko Starter Kit features:
• EFM32G890F128 MCU with 128 kB flash and 16 kB RAM
- • 32.768 kHz crystal
- • 32 MHz crystal
+ • 32.768 kHz crystal (LXFO)
+ • 32 MHz crystal (HXFO)
• Advanced Energy Monitoring
• Touch slider
• 4x40 LCD
@@ -14,7 +14,7 @@ README
• 2 pushbutton switches
• Reset button and a switch to disconnect the battery.
• On-board SEGGER J-Link USB emulator
- • ARM 20 pin JTAG/SWD standard Debug in/out connector
+ • ARM 20 pin JTAG/SWD standard Debug in/out connector
STATUS
======
@@ -129,13 +129,13 @@ Serial Console
------------------------------------------
The control MCU acts as a board controller (BC). There is a UART
connection between the EFM and the BC. The connection is made by
- setting the BC_EN line high. The EFM can then use the BSP to send
- commands to the BC. When BC_EN is low, BC_TX and BC_RX can be used
- by other applications.
+ setting the EFM_BC_EN (PD13) line high. The EFM can then use the BSP to
+ send commands to the BC. When EFM_BC_EN is low, EFM_BC_TX and EFM_BC_RX
+ can be used by other applications.
Configurations
==============
- Each EFM32 Gecko Starter Kit configuration is maintained in a sub-director
+ Each EFM32 Gecko Starter Kit configuration is maintained in a sub-directory
and can be selected as follow:
cd tools
@@ -154,8 +154,8 @@ Configurations
---
Configures the NuttShell (nsh) located at apps/examples/nsh. The
Configuration enables the serial interfaces on UART0. Support for
- builtin applications is enabled, but in the base configuration no
- builtin applications are selected (see NOTES below).
+ built-in applications is enabled, but in the base configuration no
+ built-in applications are selected (see NOTES below).
NOTES:
diff --git a/nuttx/configs/efm32-g8xx-stk/nsh/defconfig b/nuttx/configs/efm32-g8xx-stk/nsh/defconfig
index 746f23db5..2aded2041 100644
--- a/nuttx/configs/efm32-g8xx-stk/nsh/defconfig
+++ b/nuttx/configs/efm32-g8xx-stk/nsh/defconfig
@@ -119,6 +119,7 @@ CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y
# CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL is not set
# CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIW is not set
# CONFIG_ARMV7M_TOOLCHAIN_RAISONANCE is not set
+# CONFIG_ARMV7M_ITMSYSLOG is not set
#
# EFM32 Configuration Options
@@ -225,6 +226,11 @@ CONFIG_NSH_MMCSDMINOR=0
#
#
+# EFM32 G8XX STK Hardware Configuration
+#
+# CONFIG_EFM32G8STK_BCEN is not set
+
+#
# RTOS Features
#
CONFIG_DISABLE_OS_API=y
diff --git a/nuttx/configs/efm32-g8xx-stk/src/efm32-g8xx-stk.h b/nuttx/configs/efm32-g8xx-stk/src/efm32-g8xx-stk.h
index 0526cdac0..aa4876007 100644
--- a/nuttx/configs/efm32-g8xx-stk/src/efm32-g8xx-stk.h
+++ b/nuttx/configs/efm32-g8xx-stk/src/efm32-g8xx-stk.h
@@ -43,6 +43,22 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
+ /* UART0
+ *
+ * The control MCU acts as a board controller (BC). There is a UART
+ * connection between the EFM and the BC. The connection is made by
+ * setting the EFM_BC_EN (PD13) line high. The EFM can then use the BSP to
+ * send commands to the BC. When EFM_BC_EN is low, EFM_BC_TX and EFM_BC_RX
+ * can be used by other applications.
+ */
+
+#ifdef CONFIG_EFM32G8STK_BCEN
+# define GPIO_BC_EN (GPIO_OUTPUT_PUSHPULL|GPIO_OUTPUT_SET|\
+ GPIO_PORTD|GPIO_PIN13)
+#else
+# define GPIO_BC_EN (GPIO_OUTPUT_PUSHPULL|GPIO_OUTPUT_CLEAR|\
+ GPIO_PORTD|GPIO_PIN13)
+#endif
/* LEDs
*
diff --git a/nuttx/configs/efm32-g8xx-stk/src/efm32_boot.c b/nuttx/configs/efm32-g8xx-stk/src/efm32_boot.c
index bfb4022f8..771842b04 100644
--- a/nuttx/configs/efm32-g8xx-stk/src/efm32_boot.c
+++ b/nuttx/configs/efm32-g8xx-stk/src/efm32_boot.c
@@ -39,8 +39,8 @@
#include <nuttx/config.h>
+#include "efm32_gpio.h"
#include "efm32_start.h"
-
#include "efm32-g8xx-stk.h"
/****************************************************************************
@@ -59,6 +59,17 @@
void efm32_boardinitialize(void)
{
+#ifdef CONFIG_EFM32_UART0
+ /* The control MCU acts as a board controller (BC). There is a UART
+ * connection between the EFM and the BC. The connection is made by
+ * setting the EFM_BC_EN (PD13) line high. The EFM can then use the BSP to
+ * send commands to the BC. When EFM_BC_EN is low, EFM_BC_TX and EFM_BC_RX
+ * can be used by other applications.
+ */
+
+ efm32_configgpio(GPIO_BC_EN);
+#endif
+
#ifdef CONFIG_ARCH_LEDS
/* Configure on-board LEDs if LED support has been selected. */