summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-11-12 12:50:09 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-11-12 12:50:09 -0600
commitb31a3a443ee0c91e81889ce7f49549df08781d1c (patch)
treedead99f77637ca4008d2611ca1b12d3d7bd26eaa
parent437b11196dd4e23974a8bf2afbc5c9da06934f86 (diff)
downloadnuttx-b31a3a443ee0c91e81889ce7f49549df08781d1c.tar.gz
nuttx-b31a3a443ee0c91e81889ce7f49549df08781d1c.tar.bz2
nuttx-b31a3a443ee0c91e81889ce7f49549df08781d1c.zip
EFM32: Tweaks to get EFM32GG-STK3700 running NSH over LEUART0
-rw-r--r--nuttx/arch/arm/src/efm32/efm32_clockconfig.c4
-rw-r--r--nuttx/configs/efm32-g8xx-stk/README.txt6
-rw-r--r--nuttx/configs/efm32gg-stk3700/README.txt68
-rw-r--r--nuttx/configs/efm32gg-stk3700/include/board.h14
-rw-r--r--nuttx/configs/efm32gg-stk3700/nsh/defconfig1
5 files changed, 75 insertions, 18 deletions
diff --git a/nuttx/arch/arm/src/efm32/efm32_clockconfig.c b/nuttx/arch/arm/src/efm32/efm32_clockconfig.c
index 014642939..1ba2c6e9d 100644
--- a/nuttx/arch/arm/src/efm32/efm32_clockconfig.c
+++ b/nuttx/arch/arm/src/efm32/efm32_clockconfig.c
@@ -436,7 +436,7 @@ static inline uint32_t efm32_hfclk_config(uint32_t hfclksel, uint32_t hfclkdiv)
frequency = BOARD_HFXO_FREQUENCY;
#ifdef CMU_CTRL_HFLE
-#if BOARD_LFXO_FREQUENCY > CMU_MAX_FREQ_HFLE
+#if BOARD_HFXO_FREQUENCY > CMU_MAX_FREQ_HFLE
/* Adjust HFXO buffer current for high crystal frequencies, enable HFLE
* for frequencies above CMU_MAX_FREQ_HFLE.
*
@@ -452,7 +452,7 @@ static inline uint32_t efm32_hfclk_config(uint32_t hfclksel, uint32_t hfclkdiv)
* enabled.
*/
- if ((CMU->HFCORECLKEN0 & CMU_HFCORECLKEN0_LE) != 0)
+ if ((getreg32(EFM32_CMU_HFCORECLKEN0) & CMU_HFCORECLKEN0_LE) != 0)
{
regval = getreg32(EFM32_CMU_HFCORECLKDIV);
regval |= CMU_HFCORECLKDIV_HFCORECLKLEDIV_DIV4;
diff --git a/nuttx/configs/efm32-g8xx-stk/README.txt b/nuttx/configs/efm32-g8xx-stk/README.txt
index 958e35c0f..7999d248c 100644
--- a/nuttx/configs/efm32-g8xx-stk/README.txt
+++ b/nuttx/configs/efm32-g8xx-stk/README.txt
@@ -179,7 +179,7 @@ SERIAL CONSOLE
USING THE J-LINK GDB SERVER
===========================
- 1. Star the J-Link GDB server. You should see the start-up confiration
+ 1. Star the J-Link GDB server. You should see the start-up configuration
window. SelectL
a. Target device = EFM32G880F128
@@ -192,9 +192,9 @@ USING THE J-LINK GDB SERVER
arm-none-eabi-gdb
- 4. Connect to the J-Link GDB serer:
+ 4. Connect to the J-Link GDB server:
- (gdb) target remote local host
+ (gdb) target remote localhost:2331
5. Load and run nuttx
diff --git a/nuttx/configs/efm32gg-stk3700/README.txt b/nuttx/configs/efm32gg-stk3700/README.txt
index 524f00579..8d54a697a 100644
--- a/nuttx/configs/efm32gg-stk3700/README.txt
+++ b/nuttx/configs/efm32gg-stk3700/README.txt
@@ -84,12 +84,12 @@ LEDs and Buttons
are connected to the EFM32, and are debounced by RC filters with a time
constant of 1ms. The buttons are connected to pins PB9 and PB10:
- ------------------------------------- --------------------
- EFM32 PIN BOARD SIGNALS
- ------------------------------------- --------------------
- B9/EBI_A03/U1_TX #2 MCU_PB9 UIF_PB0
- B10/EBI_A04/U1_RX #2 MCU_PB10 UIF_PB1
- ------------------------------------- --------------------
+ ------------------------------------- --------------------
+ EFM32 PIN BOARD SIGNALS
+ ------------------------------------- --------------------
+ B9/EBI_A03/U1_TX #2 MCU_PB9 UIF_PB0
+ B10/EBI_A04/U1_RX #2 MCU_PB10 UIF_PB1
+ ------------------------------------- --------------------
Buttons are connected to ground so they will read low when closed.
@@ -103,6 +103,13 @@ Serial Console
and the documentation claims that 9600 baud is possible (although
I am not sure how).
+ ---------- ---- ----------- -----------
+ SIGNAL PGIO EXP Header Test Point
+ ---------- ---- ----------- -----------
+ LEUART0_TX PD4 Pin 12 TPJ122
+ LEUART0_RX PD5 Pin 14 TPJ123
+ ---------- ---- ----------- -----------
+
It should also be possible to use UART0 is configured at 115200 8N1
on pins PE0 and PE1.
@@ -115,6 +122,55 @@ Serial Console
setting the EFM_BC_EN (PF7) line high, and using the lines EFM_BC_TX
(PE0) and EFM_BC_RX (PE1) for communicating.
+USING THE J-LINK GDB SERVER
+===========================
+
+ 1. Star the J-Link GDB server. You should see the start-up configuration
+ window. SelectL
+
+ a. Target device = EFM32GG990F1024
+ b. Select Target interface = SWD
+
+ 2. Press OK. The GDB server should start and the last message in the Log
+ output should be "Waiting for GDB connection".
+
+ 3. In a terminal window, start GDB:
+
+ arm-none-eabi-gdb
+
+ 4. Connect to the J-Link GDB server:
+
+ (gdb) target remote localhost:2331
+
+ 5. Load and run nuttx
+
+ (gdb) mon halt
+ (gdb) load nuttx
+ (gdb) mon reset go
+
+ I had to tinker with the setup a few times repeating the same steps above
+ before things finally began to work. Don't know why.
+
+ To debug code already burned into FLASH:
+
+ 1. Start the GDB server as above.
+
+ 2. In a terminal window, start GDB:
+
+ arm-none-eabi-gdb
+
+ 3. Connect to the J-Link GDB serer:
+
+ (gdb) target remote local host
+
+ 3. Load the nuttx symbol file, reset, and debug
+
+ (gdb) mon halt
+ (gdb) file nuttx
+ (gdb) mon reset
+ (gdb) s
+ ...
+
Configurations
==============
Each EFM32 Giant Gecko Starter Kit configuration is maintained in a sub-
diff --git a/nuttx/configs/efm32gg-stk3700/include/board.h b/nuttx/configs/efm32gg-stk3700/include/board.h
index 1482553ae..a1c4e74f7 100644
--- a/nuttx/configs/efm32gg-stk3700/include/board.h
+++ b/nuttx/configs/efm32gg-stk3700/include/board.h
@@ -251,18 +251,18 @@
* U0_RX #1 PE1 MCU_PE1, UART0_TX #1, EFM_BC_TX, BC_UART_TX
*/
-#define BOARD_UART0_RX_GPIO (GPIO_PORTE|GPIO_PIN1)
-#define BOARD_UART0_TX_GPIO (GPIO_PORTE|GPIO_PIN0)
-#define BOARD_UART0_ROUTE_LOCATION _USART_ROUTE_LOCATION_LOC1
+#define BOARD_UART0_RX_GPIO (GPIO_PORTE|GPIO_PIN1)
+#define BOARD_UART0_TX_GPIO (GPIO_PORTE|GPIO_PIN0)
+#define BOARD_UART0_ROUTE_LOCATION _USART_ROUTE_LOCATION_LOC1
/* LEUART0:
*
- * LEU0_RX #0 PD4 Available on TP121 and EXP pin 12
- * LEU0_TX #0 PD5 Available on TP122 and EXP pin 14
+ * LEU0_TX #0 PD4 Available on TP122 and EXP pin 12
+ * LEU0_RX #0 PD5 Available on TP123 and EXP pin 14
*/
-#define BOARD_LEUART0_RX_GPIO (GPIO_PORTD|GPIO_PIN4)
-#define BOARD_LEUART0_TX_GPIO (GPIO_PORTD|GPIO_PIN5)
+#define BOARD_LEUART0_RX_GPIO (GPIO_PORTD|GPIO_PIN5)
+#define BOARD_LEUART0_TX_GPIO (GPIO_PORTD|GPIO_PIN4)
#define BOARD_LEUART0_ROUTE_LOCATION _LEUART_ROUTE_LOCATION_LOC0
/****************************************************************************
diff --git a/nuttx/configs/efm32gg-stk3700/nsh/defconfig b/nuttx/configs/efm32gg-stk3700/nsh/defconfig
index b3da56050..3b1ce7a67 100644
--- a/nuttx/configs/efm32gg-stk3700/nsh/defconfig
+++ b/nuttx/configs/efm32gg-stk3700/nsh/defconfig
@@ -140,6 +140,7 @@ CONFIG_EFM32_HAVE_USART2=y
CONFIG_EFM32_HAVE_UART0=y
CONFIG_EFM32_HAVE_UART1=y
CONFIG_EFM32_HAVE_LEUART1=y
+CONFIG_EFM32_HAVE_OTGFS=y
# CONFIG_EFM32_USART_ISUART is not set
# CONFIG_EFM32_USART_ISSPI is not set
# CONFIG_EFM32_UART is not set