mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Updates for STM3210E-EVAL SRAM
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4579 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -16,6 +16,7 @@ Contents
|
|||||||
- LEDs
|
- LEDs
|
||||||
- Temperature Sensor
|
- Temperature Sensor
|
||||||
- RTC
|
- RTC
|
||||||
|
- FSMC SRAM
|
||||||
- STM3210E-EVAL-specific Configuration Options
|
- STM3210E-EVAL-specific Configuration Options
|
||||||
- Configurations
|
- Configurations
|
||||||
|
|
||||||
@@ -350,6 +351,21 @@ RTC
|
|||||||
overflow interrupt may be lost even if the STM32 is powered down only momentarily.
|
overflow interrupt may be lost even if the STM32 is powered down only momentarily.
|
||||||
Therefore hi-res solution is only useful in systems where the power is always on.
|
Therefore hi-res solution is only useful in systems where the power is always on.
|
||||||
|
|
||||||
|
FSMC SRAM
|
||||||
|
=========
|
||||||
|
|
||||||
|
The 8-Mbit SRAM is connected to the STM32 at PG10 which will be FSMC_NE3, Bank1
|
||||||
|
SRAM3. This memory will appear at address 0x68000000.
|
||||||
|
|
||||||
|
The on-board SRAM can be configured by setting
|
||||||
|
|
||||||
|
CONFIG_STM32_FSMC=y : Enables the FSMC
|
||||||
|
CONFIG_STM32_FSMC_SRAM=y : Enable external SRAM support
|
||||||
|
CONFIG_HEAP2_BASE=0x68000000 : SRAM will be located at 0x680000000
|
||||||
|
CONFIG_HEAP2_END=(0x68000000+(1*1024*1024)) : The size of the SRAM is 1Mbyte
|
||||||
|
CONFIG_MM_REGIONS=2 : There will be two memory regions
|
||||||
|
: in the heap
|
||||||
|
|
||||||
STM3210E-EVAL-specific Configuration Options
|
STM3210E-EVAL-specific Configuration Options
|
||||||
============================================
|
============================================
|
||||||
|
|
||||||
|
|||||||
@@ -144,6 +144,14 @@
|
|||||||
# define SDIO_SDXFR_CLKDIV (3 << SDIO_CLKCR_CLKDIV_SHIFT)
|
# define SDIO_SDXFR_CLKDIV (3 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* SRAM definitions *****************************************************************/
|
||||||
|
/* The 8 Mbit SRAM is provided on the PT3 board using the FSMC_NE3 chip select. */
|
||||||
|
|
||||||
|
/* This is the Bank1 SRAM3 address: */
|
||||||
|
|
||||||
|
#define BOARD_SRAM_BASE 0x68000000 /* Bank2 SRAM3 base address */
|
||||||
|
#define BOARD_SRAM_SIZE (1*1024*1024) /* 8-Mbit = 1-Mbyte */
|
||||||
|
|
||||||
/* LED definitions ******************************************************************/
|
/* LED definitions ******************************************************************/
|
||||||
|
|
||||||
/* The STM3210E-EVAL board has 4 LEDs that we will encode as: */
|
/* The STM3210E-EVAL board has 4 LEDs that we will encode as: */
|
||||||
|
|||||||
+108
-102
@@ -1,102 +1,108 @@
|
|||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* configs/stm3210e-eval/src/up_boot.c
|
* configs/stm3210e-eval/src/up_boot.c
|
||||||
* arch/arm/src/board/up_boot.c
|
* arch/arm/src/board/up_boot.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer.
|
* notice, this list of conditions and the following disclaimer.
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in
|
* notice, this list of conditions and the following disclaimer in
|
||||||
* the documentation and/or other materials provided with the
|
* the documentation and/or other materials provided with the
|
||||||
* distribution.
|
* distribution.
|
||||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||||
* used to endorse or promote products derived from this software
|
* used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
#include <arch/board/board.h>
|
#include <arch/board/board.h>
|
||||||
|
|
||||||
#include "up_arch.h"
|
#include "up_arch.h"
|
||||||
#include "stm3210e-internal.h"
|
#include "stm3210e-internal.h"
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Definitions
|
* Definitions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: stm32_boardinitialize
|
* Name: stm32_boardinitialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* All STM32 architectures must provide the following entry point. This entry point
|
* 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 intitialization -- after all memory has been configured
|
||||||
* and mapped but before any devices have been initialized.
|
* and mapped but before any devices have been initialized.
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
void stm32_boardinitialize(void)
|
void stm32_boardinitialize(void)
|
||||||
{
|
{
|
||||||
/* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function
|
/* If the FSMC and FSMC_SRAM are selected, then enable SRAM access */
|
||||||
* stm32_spiinitialize() has been brought into the link.
|
|
||||||
*/
|
#if defined(CONFIG_STM32_FSMC) && defined(CONFIG_STM32_FSMC_SRAM)
|
||||||
|
stm32_selectsram();
|
||||||
#if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2)
|
#endif
|
||||||
if (stm32_spiinitialize)
|
|
||||||
{
|
/* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function
|
||||||
stm32_spiinitialize();
|
* stm32_spiinitialize() has been brought into the link.
|
||||||
}
|
*/
|
||||||
#endif
|
|
||||||
|
#if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2)
|
||||||
/* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not
|
if (stm32_spiinitialize)
|
||||||
* disabled, and 3) the weak function stm32_usbinitialize() has been brought
|
{
|
||||||
* into the build.
|
stm32_spiinitialize();
|
||||||
*/
|
}
|
||||||
|
#endif
|
||||||
#if defined(CONFIG_USBDEV) && defined(CONFIG_STM32_USB)
|
|
||||||
if (stm32_usbinitialize)
|
/* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not
|
||||||
{
|
* disabled, and 3) the weak function stm32_usbinitialize() has been brought
|
||||||
stm32_usbinitialize();
|
* into the build.
|
||||||
}
|
*/
|
||||||
#endif
|
|
||||||
|
#if defined(CONFIG_USBDEV) && defined(CONFIG_STM32_USB)
|
||||||
/* Configure on-board LEDs if LED support has been selected. */
|
if (stm32_usbinitialize)
|
||||||
|
{
|
||||||
#ifdef CONFIG_ARCH_LEDS
|
stm32_usbinitialize();
|
||||||
up_ledinit();
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
/* Configure on-board LEDs if LED support has been selected. */
|
||||||
|
|
||||||
|
#ifdef CONFIG_ARCH_LEDS
|
||||||
|
up_ledinit();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user