EFM32: Tweaks to get EFM32GG-STK3700 running NSH over LEUART0
This commit is contained in:
parent
d287e7036d
commit
9160054188
@ -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;
|
||||
|
@ -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
|
||||
|
||||
|
@ -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-
|
||||
|
@ -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
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user