Added support for the Olimex STM32 P207 board. From Martin Lederhilger

This commit is contained in:
Gregory Nutt 2013-10-24 08:48:04 -06:00
parent ec84f19454
commit 21c59c0aa7
17 changed files with 134 additions and 94 deletions

View File

@ -5866,3 +5866,9 @@
* arch/arm/include/stm32/chip.h and arch/arm/src/stm32/Kconfig:
Add support for the STM32F207ZE chip. From Martin Lederhilger
(2013-10-24).
* arch/arm/src/stm32/stm32_adc.c and stm32_pwm.c: Fix some bits
that should have been cleared in a register. From Martin Lederhilger
(2013-10-24).
* configs/olimex-stm32-p207 and other files: Support for the Olimex
STM32 P207 board added by Martin Lederhilger (2017-10-24).

View File

@ -8,7 +8,7 @@
<tr align="center" bgcolor="#e4e4e4">
<td>
<h1><big><font color="#3c34ec"><i>NuttX README Files</i></font></big></h1>
<p>Last Updated: August 31, 2013</p>
<p>Last Updated: October 24, 2013</p>
</td>
</tr>
</table>
@ -131,6 +131,8 @@
| | | `- <a href="http://sourceforge.net/p/nuttx/git/ci/master/tree/nuttx/configs/olimex-lpc1766stk/README.txt"><b><i>README.txt</i></b></a>
| | |- olimex-lpc2378/
| | | `- <a href="http://sourceforge.net/p/nuttx/git/ci/master/tree/nuttx/configs/olimex-lpc2378/README.txt"><b><i>README.txt</i></b></a>
| | |- olimex-stm32-p207/
| | | `- <a href="http://sourceforge.net/p/nuttx/git/ci/master/tree/nuttx/configs/olimex-stm32-p207/README.txt"><b><i>README.txt</i></b></a>
| | |- olimex-strp711/
| | | `- <a href="http://sourceforge.net/p/nuttx/git/ci/master/tree/nuttx/configs/olimex-strp711/README.txt"><b><i>README.txt</i></b></a>
| | |- open1788/

View File

@ -1059,6 +1059,8 @@ nuttx
| | `- README.txt
| |- olimex-lpc2378/
| | `- README.txt
| |- olimex-stm32-p207/
| | `- README.txt
| |- olimex-strp711/
| | `- README.txt
| |- open1788/

View File

@ -57,7 +57,7 @@ config ARCH_BOARD_CLOUDCTRL
bool "Darcy's CloudController stm32f10x board"
depends on ARCH_CHIP_STM32F107VC
---help---
Small network relay development board. Based on the Shenzhou IV development
Small network relay development board. Based on the Shenzhou IV development
board design.
config ARCH_BOARD_COMPALE86
@ -359,7 +359,7 @@ config ARCH_BOARD_NUTINY_NUC120
depends on ARCH_CHIP_NUC120LE3AN
select ARCH_HAVE_LEDS
---help---
This is the port to the Nuvoton NuTiny EVB 120 board. This board uses a
This is the port to the Nuvoton NuTiny EVB 120 board. This board uses a
Nuvoton NUC120 chip, specifically the NUC120LE3AN. See http://www.nuvoton.com/
for further information.
@ -391,6 +391,17 @@ config ARCH_BOARD_OLIMEX_STM32P107
Linux or Cygwin. See the http://www.olimex.com for further information. This
board features the STMicro STM32F107VC MCU
config ARCH_BOARD_OLIMEX_STM32P207
bool "Olimex STM32 P207 board"
depends on ARCH_CHIP_STM32F207ZE
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
---help---
This port uses the Olimex STM32 P207 board and a GNU arm-nuttx-elf toolchain* under
Linux or Cygwin. See the http://www.olimex.com for further information. This
board features the STMicro STM32F207ZE MCU
config ARCH_BOARD_OPEN1788
bool "Wave Share Open1788"
depends on ARCH_CHIP_LPC1788
@ -829,6 +840,7 @@ config ARCH_BOARD
default "olimex-lpc1766stk" if ARCH_BOARD_LPC1766STK
default "olimex-lpc2378" if ARCH_BOARD_OLIMEXLPC2378
default "olimex-stm32-p107" if ARCH_BOARD_OLIMEX_STM32P107
default "olimex-stm32-p207" if ARCH_BOARD_OLIMEX_STM32P207
default "olimex-strp711" if ARCH_BOARD_OLIMEX_STRP711
default "open1788" if ARCH_BOARD_OPEN1788
default "p112" if ARCH_BOARD_P112
@ -1043,6 +1055,9 @@ endif
if ARCH_BOARD_OLIMEX_STM32P107
source "configs/olimex-stm32-p107/Kconfig"
endif
if ARCH_BOARD_OLIMEX_STM32P207
source "configs/olimex-stm32-p207/Kconfig"
endif
if ARCH_BOARD_OLIMEX_STRP711
source "configs/olimex-strp711/Kconfig"
endif

View File

@ -1892,8 +1892,12 @@ configs/olimex-lpc2378
configs/olimex-stm32-p107
This port uses the Olimex STM32-P107 board (STM32F107VC) and a GNU arm-nuttx-elf
toolchain* under Linux or Cygwin. See the https://www.olimex.com/dev/stm32-p107.html
for further information. Contributed by Max Holtzberg. STATUS: Configurations
for the basic OS test and NSH are available and verified.
for further information. Contributed by Max Holtzberg.
configs/olimex-stm32-p207
This port uses the Olimex STM32-P207 board (STM32F207ZE) and a GNU arm-nuttx-elf
toolchain* under Linux or Cygwin. See the https://www.olimex.com/dev/stm32-p207.html
for further information. Contributed by Martin Lederhilger.
configs/olimex-strp711
This port uses the Olimex STR-P711 board and a GNU arm-nuttx-elf toolchain* under

View File

@ -183,25 +183,25 @@
#define NUM_BUTTONS 7
#define BUTTON_TAMPER_BIT (1 << BUTTON_TAMPER)
#define BUTTON_WKUP_BIT (1 << BUTTON_WKUP)
#define BUTTON_RIGHT_BIT (1 << BUTTON_RIGHT)
#define BUTTON_UP_BIT (1 << BUTTON_UP)
#define BUTTON_LEFT_BIT (1 << BUTTON_LEFT)
#define BUTTON_DOWN_BIT (1 << BUTTON_DOWN)
#define BUTTON_CENTER_BIT (1 << BUTTON_CENTER)
#define BUTTON_TAMPER_BIT (1 << BUTTON_TAMPER)
#define BUTTON_WKUP_BIT (1 << BUTTON_WKUP)
#define BUTTON_RIGHT_BIT (1 << BUTTON_RIGHT)
#define BUTTON_UP_BIT (1 << BUTTON_UP)
#define BUTTON_LEFT_BIT (1 << BUTTON_LEFT)
#define BUTTON_DOWN_BIT (1 << BUTTON_DOWN)
#define BUTTON_CENTER_BIT (1 << BUTTON_CENTER)
/* Alternate function pin selections ************************************************/
//USART3:
#define GPIO_USART3_RX GPIO_USART3_RX_3 //PD9
#define GPIO_USART3_TX GPIO_USART3_TX_3 //PD8
#define GPIO_USART3_CTS GPIO_USART3_CTS_2 //PD11
#define GPIO_USART3_RTS GPIO_USART3_RTS_2 //PD12
#define GPIO_USART3_RX GPIO_USART3_RX_3 //PD9
#define GPIO_USART3_TX GPIO_USART3_TX_3 //PD8
#define GPIO_USART3_CTS GPIO_USART3_CTS_2 //PD11
#define GPIO_USART3_RTS GPIO_USART3_RTS_2 //PD12
//CAN:
#define GPIO_CAN1_RX GPIO_CAN1_RX_2 //PB8
#define GPIO_CAN1_TX GPIO_CAN1_TX_2 //PB9
#define GPIO_CAN1_RX GPIO_CAN1_RX_2 //PB8
#define GPIO_CAN1_TX GPIO_CAN1_TX_2 //PB9
//Ethernet:
/*
@ -266,7 +266,7 @@ extern "C" {
*
************************************************************************************/
EXTERN void stm32_boardinitialize(void);
void stm32_boardinitialize(void);
/************************************************************************************
* Name: stm32_ledinit, stm32_setled, and stm32_setleds

View File

@ -103,9 +103,7 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g
endif
HOSTCC = gcc
HOSTINCLUDES = -I.
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
HOSTLDFLAGS =

View File

@ -1,5 +1,5 @@
/******************************************************************************
* configs/olimex-stm32-p107/src/p207-internal.h
* configs/olimex-stm32-p107/src/olimex-stm32-p207.h
*
* Copyright (C) 2013 Max Holtzberg. All rights reserved.
* Author: Max Holtzberg <mholtzberg@uvc-ingenieure.de>
@ -32,6 +32,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************/
#ifndef __CONFIGS_OLIMEX_STM32_P207_SRC_INTERNAL_H
#define __CONFIGS_OLIMEX_STM32_P207_SRC_INTERNAL_H
@ -47,7 +48,7 @@
* Definitions
******************************************************************************/
/* Olimex-STM32-P207 GPIOs **************************************************************************/
/* Olimex-STM32-P207 GPIOs ****************************************************/
/* LEDs */
#define GPIO_LED1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\
@ -58,7 +59,7 @@
GPIO_OUTPUT_CLEAR|GPIO_PORTF|GPIO_PIN8)
#define GPIO_LED4 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\
GPIO_OUTPUT_CLEAR|GPIO_PORTF|GPIO_PIN9)
/* BUTTONS -- NOTE that all have EXTI interrupts configured */
#define MIN_IRQBUTTON BUTTON_TAMPER
@ -96,33 +97,34 @@
* Public Functions
************************************************************************************/
/****************************************************************************************************
/************************************************************************************
* Name: stm32_usbinitialize
*
* Description:
* Called from stm32_usbinitialize very early in inialization to setup USB-related
* GPIO pins for the STM32F4Discovery board.
*
****************************************************************************************************/
************************************************************************************/
#ifdef CONFIG_STM32_OTGFS
void weak_function stm32_usbinitialize(void);
#endif
/****************************************************************************************************
/************************************************************************************
* Name: stm32_usbhost_initialize
*
* Description:
* Called at application startup time to initialize the USB host functionality. This function will
* start a thread that will monitor for device connection/disconnection events.
* Called at application startup time to initialize the USB host functionality.
* This function will start a thread that will monitor for device connection/
* disconnection events.
*
****************************************************************************************************/
************************************************************************************/
#if defined(CONFIG_STM32_OTGFS) && defined(CONFIG_USBHOST)
int stm32_usbhost_initialize(void);
#endif
/****************************************************************************
/************************************************************************************
* Name: nsh_archinitialize
*
* Description:
@ -135,32 +137,31 @@ int stm32_usbhost_initialize(void);
* CONFIG_NSH_ARCHINIT=n :
* Called from board_initialize().
*
****************************************************************************/
************************************************************************************/
#ifdef CONFIG_NSH_LIBRARY
int nsh_archinitialize(void);
#endif
/****************************************************************************************************
/************************************************************************************
* Name: stm32_adc_initialize
*
* Description:
* Called at application startup time to initialize the ADC functionality.
*
****************************************************************************************************/
************************************************************************************/
#ifdef CONFIG_ADC
int stm32_adc_initialize(void);
#endif
/****************************************************************************************************
/************************************************************************************
* Name: stm32_can_initialize
*
* Description:
* Called at application startup time to initialize the CAN functionality.
*
****************************************************************************************************/
************************************************************************************/
#if defined(CONFIG_CAN) && (defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2))
int stm32_can_initialize(void);

View File

@ -46,7 +46,7 @@
#include <arch/board/board.h>
#include "chip.h"
#include "stm32_adc.h"
#include "p207-internal.h"
#include "olimex-stm32-p207.h"
#ifdef CONFIG_ADC
@ -54,7 +54,7 @@
* Definitions
************************************************************************************/
/* Configuration ************************************************************/
/* Configuration ********************************************************************/
/* Up to 3 ADC interfaces are supported */
#if STM32_NADC < 3
@ -81,7 +81,7 @@
/************************************************************************************
* Private Data
************************************************************************************/
/* The Olimex STM32-P207 has a 10 Kohm potentiometer AN_TR connected to PC0
/* The Olimex STM32-P207 has a 10 Kohm potentiometer AN_TR connected to PC0
* ADC123_IN10
*/
@ -117,13 +117,13 @@ int adc_devinit(void)
return stm32_adc_initialize();
}
/****************************************************************************************************
/************************************************************************************
* Name: stm32_adc_initialize
*
* Description:
* Called at application startup time to initialize the ADC functionality.
*
****************************************************************************************************/
************************************************************************************/
int stm32_adc_initialize(void)
{

View File

@ -45,7 +45,7 @@
#include <debug.h>
#include <arch/board/board.h>
#include "stm32.h"
#include "p207-internal.h"
#include "olimex-stm32-p207.h"
#ifdef CONFIG_ARCH_LEDS

View File

@ -42,7 +42,7 @@
#include <nuttx/arch.h>
#include <debug.h>
#include <arch/board/board.h>
#include "p207-internal.h"
#include "olimex-stm32-p207.h"
/************************************************************************************
* Definitions
@ -69,7 +69,7 @@
void stm32_boardinitialize(void)
{
/* Initialize USB if the 1) OTG FS controller is in the configuration and 2)
* disabled, and 3) the weak function stm32_usbinitialize() has been brought
* disabled, and 3) the weak function stm32_usbinitialize() has been brought
* into the build. Presumeably either CONFIG_USBDEV or CONFIG_USBHOST is also
* selected.
*/
@ -86,13 +86,12 @@ void stm32_boardinitialize(void)
#ifdef CONFIG_ARCH_LEDS
up_ledinit();
#endif
/* Configure on-board BUTTONs if BUTTON support has been selected. */
#ifdef CONFIG_ARCH_BUTTONS
up_buttoninit();
#endif
}
/****************************************************************************
@ -119,7 +118,5 @@ void board_initialize(void)
#if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_NSH_ARCHINIT)
nsh_archinitialize();
#endif
}
#endif

View File

@ -41,12 +41,12 @@
#include <stdint.h>
#include <arch/board/board.h>
#include "p207-internal.h"
#include "olimex-stm32-p207.h"
#ifdef CONFIG_ARCH_BUTTONS
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
@ -91,7 +91,7 @@ void up_buttoninit(void)
{
int i;
/* Configure the GPIO pins as inputs. NOTE that EXTI interrupts are
/* Configure the GPIO pins as inputs. NOTE that EXTI interrupts are
* configured for all pins.
*/
@ -108,23 +108,44 @@ void up_buttoninit(void)
uint8_t up_buttons(void)
{
uint8_t ret = 0;
/* Check that state of each key */
if(!stm32_gpioread(g_buttons[BUTTON_TAMPER]))
ret |= BUTTON_TAMPER_BIT;
if(stm32_gpioread(g_buttons[BUTTON_WKUP]))
ret |= BUTTON_WKUP_BIT;
if(stm32_gpioread(g_buttons[BUTTON_RIGHT]))
ret |= BUTTON_RIGHT_BIT;
if(stm32_gpioread(g_buttons[BUTTON_UP]))
ret |= BUTTON_UP_BIT;
if(stm32_gpioread(g_buttons[BUTTON_LEFT]))
ret |= BUTTON_LEFT_BIT;
if(stm32_gpioread(g_buttons[BUTTON_DOWN]))
ret |= BUTTON_DOWN_BIT;
if(stm32_gpioread(g_buttons[BUTTON_CENTER]))
ret |= BUTTON_CENTER_BIT;
if (!stm32_gpioread(g_buttons[BUTTON_TAMPER]))
{
ret |= BUTTON_TAMPER_BIT;
}
if (stm32_gpioread(g_buttons[BUTTON_WKUP]))
{
ret |= BUTTON_WKUP_BIT;
}
if (stm32_gpioread(g_buttons[BUTTON_RIGHT]))
{
ret |= BUTTON_RIGHT_BIT;
}
if (stm32_gpioread(g_buttons[BUTTON_UP]))
{
ret |= BUTTON_UP_BIT;
}
if (stm32_gpioread(g_buttons[BUTTON_LEFT]))
{
ret |= BUTTON_LEFT_BIT;
}
if (stm32_gpioread(g_buttons[BUTTON_DOWN]))
{
ret |= BUTTON_DOWN_BIT;
}
if (stm32_gpioread(g_buttons[BUTTON_CENTER]))
{
ret |= BUTTON_CENTER_BIT;
}
return ret;
}
@ -162,6 +183,7 @@ xcpt_t up_irqbutton(int id, xcpt_t irqhandler)
{
oldhandler = stm32_gpiosetevent(g_buttons[id], true, true, true, irqhandler);
}
return oldhandler;
}
#endif

View File

@ -46,7 +46,7 @@
#include <arch/board/board.h>
#include "stm32.h"
#include "stm32_can.h"
#include "p207-internal.h"
#include "olimex-stm32-p207.h"
#if defined(CONFIG_CAN) && (defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2))

View File

@ -152,4 +152,3 @@ void up_cxxinitialize(void)
}
#endif /* CONFIG_HAVE_CXX && CONFIG_HAVE_CXXINITIALIZE */

View File

@ -54,7 +54,7 @@
#endif
#include "stm32.h"
#include "p207-internal.h"
#include "olimex-stm32-p207.h"
/****************************************************************************
* Pre-Processor Definitions
@ -133,20 +133,20 @@ int nsh_archinitialize(void)
#if defined(HAVE_USBHOST) || defined(HAVE_USBMONITOR) || defined(CONFIG_ADC)
int ret;
#endif
#if defined(CONFIG_CAN) && (defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2))
/* Configure on-board CAN if CAN support has been selected. */
ret = stm32_can_initialize();
if (ret != OK)
{
message("nsh_archinitialize: Failed to initialize CAN: %d\n", ret);
}
#endif
#ifdef CONFIG_ADC
/* Configure on-board ADCs if ADC support has been selected. */
ret = stm32_adc_initialize();
if (ret != OK)
{

View File

@ -51,7 +51,7 @@
#include <nuttx/usb/usbdev_trace.h>
#include "stm32.h"
#include "stm32_otgfs.h"
#include "p207-internal.h"
#include "olimex-stm32-p207.h"
#ifdef CONFIG_STM32_OTGFS
@ -229,14 +229,14 @@ xcpt_t stm32_setup_overcurrent(xcpt_t handler)
* Enable/disable driving of VBUS 5V output. This function must be provided be
* each platform that implements the STM32 OTG FS host interface
*
* "On-chip 5 V VBUS generation is not supported. For this reason, a charge pump
* or, if 5 V are available on the application board, a basic power switch, must
* be added externally to drive the 5 V VBUS line. The external charge pump can
* be driven by any GPIO output. When the application decides to power on VBUS
* using the chosen GPIO, it must also set the port power bit in the host port
* "On-chip 5 V VBUS generation is not supported. For this reason, a charge pump
* or, if 5 V are available on the application board, a basic power switch, must
* be added externally to drive the 5 V VBUS line. The external charge pump can
* be driven by any GPIO output. When the application decides to power on VBUS
* using the chosen GPIO, it must also set the port power bit in the host port
* control and status register (PPWR bit in OTG_FS_HPRT).
*
* "The application uses this field to control power to this port, and the core
* "The application uses this field to control power to this port, and the core
* clears this bit on an overcurrent condition."
*
* Input Parameters:
@ -252,7 +252,7 @@ xcpt_t stm32_setup_overcurrent(xcpt_t handler)
void stm32_usbhost_vbusdrive(int iface, bool enable)
{
DEBUGASSERT(iface == 0);
if (enable)
{
/* Enable the Power Switch by driving the enable pin low */
@ -260,9 +260,9 @@ void stm32_usbhost_vbusdrive(int iface, bool enable)
stm32_gpiowrite(GPIO_OTGFS_PWRON, false);
}
else
{
{
/* Disable the Power Switch by driving the enable pin high */
stm32_gpiowrite(GPIO_OTGFS_PWRON, true);
}
}
@ -287,6 +287,3 @@ void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume)
#endif
#endif /* CONFIG_STM32_OTGFS */

View File

@ -45,7 +45,7 @@
#include <debug.h>
#include <arch/board/board.h>
#include "stm32.h"
#include "p207-internal.h"
#include "olimex-stm32-p207.h"
#ifndef CONFIG_ARCH_LEDS
@ -70,7 +70,7 @@
****************************************************************************/
/* This array maps an LED number to GPIO pin configuration */
static uint32_t g_ledcfg[BOARD_NLEDS] =
static uint32_t g_ledcfg[BOARD_NLEDS] =
{
GPIO_LED1, GPIO_LED2, GPIO_LED3, GPIO_LED4
};
@ -79,17 +79,14 @@ static uint32_t g_ledcfg[BOARD_NLEDS] =
* Private Function Protototypes
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/