mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Add support for the STM32VL-Discovery board. Contributed by Alan Carvalho de Assis
This commit is contained in:
@@ -678,6 +678,15 @@ config ARCH_BOARD_STM32L_DISCOVERY
|
|||||||
---help---
|
---help---
|
||||||
STMicro STM32L-Discovery board based on the STMicro STM32L152RB MCU.
|
STMicro STM32L-Discovery board based on the STMicro STM32L152RB MCU.
|
||||||
|
|
||||||
|
config ARCH_BOARD_STM32VL_DISCOVERY
|
||||||
|
bool "STMicro STM32VL-Discovery board"
|
||||||
|
depends on ARCH_CHIP_STM32F100RB
|
||||||
|
select ARCH_HAVE_LEDS
|
||||||
|
select ARCH_HAVE_BUTTONS
|
||||||
|
select ARCH_HAVE_IRQBUTTONS
|
||||||
|
---help---
|
||||||
|
STMicro STM32VL-Discovery board based on the STMicro STM32F100RB MCU.
|
||||||
|
|
||||||
config ARCH_BOARD_MIKROE_STM32F4
|
config ARCH_BOARD_MIKROE_STM32F4
|
||||||
bool "MikroElektronika Mikromedia for STM32F4 board"
|
bool "MikroElektronika Mikromedia for STM32F4 board"
|
||||||
depends on ARCH_CHIP_STM32F407VG
|
depends on ARCH_CHIP_STM32F407VG
|
||||||
@@ -909,6 +918,7 @@ config ARCH_BOARD
|
|||||||
default "stm32f4discovery" if ARCH_BOARD_STM32F4_DISCOVERY
|
default "stm32f4discovery" if ARCH_BOARD_STM32F4_DISCOVERY
|
||||||
default "stm32f429i-disco" if ARCH_BOARD_STM32F429I_DISCO
|
default "stm32f429i-disco" if ARCH_BOARD_STM32F429I_DISCO
|
||||||
default "stm32ldiscovery" if ARCH_BOARD_STM32L_DISCOVERY
|
default "stm32ldiscovery" if ARCH_BOARD_STM32L_DISCOVERY
|
||||||
|
default "stm32vldiscovery" if ARCH_BOARD_STM32VL_DISCOVERY
|
||||||
default "mikroe-stm32f4" if ARCH_BOARD_MIKROE_STM32F4
|
default "mikroe-stm32f4" if ARCH_BOARD_MIKROE_STM32F4
|
||||||
default "sure-pic32mx" if ARCH_BOARD_SUREPIC32MX
|
default "sure-pic32mx" if ARCH_BOARD_SUREPIC32MX
|
||||||
default "teensy" if ARCH_BOARD_TEENSY
|
default "teensy" if ARCH_BOARD_TEENSY
|
||||||
@@ -1180,6 +1190,9 @@ endif
|
|||||||
if ARCH_BOARD_STM32L_DISCOVERY
|
if ARCH_BOARD_STM32L_DISCOVERY
|
||||||
source "configs/stm32ldiscovery/Kconfig"
|
source "configs/stm32ldiscovery/Kconfig"
|
||||||
endif
|
endif
|
||||||
|
if ARCH_BOARD_STM32VL_DISCOVERY
|
||||||
|
source "configs/stm32vldiscovery/Kconfig"
|
||||||
|
endif
|
||||||
if ARCH_BOARD_SUREPIC32MX
|
if ARCH_BOARD_SUREPIC32MX
|
||||||
source "configs/sure-pic32mx/Kconfig"
|
source "configs/sure-pic32mx/Kconfig"
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -522,6 +522,12 @@ configs/stm32f4discovery
|
|||||||
configs/stm32f429i-disco
|
configs/stm32f429i-disco
|
||||||
STMicro STM32F429I-Discovery board based on the STMicro STM32F429ZIT6 MCU.
|
STMicro STM32F429I-Discovery board based on the STMicro STM32F429ZIT6 MCU.
|
||||||
|
|
||||||
|
configs/stm32ldiscovery
|
||||||
|
STMicro STM32L-Discovery board based on the STMicro STM32L152RB MCU.
|
||||||
|
|
||||||
|
configs/stm32vldiscovery
|
||||||
|
STMicro STM32VL-Discovery board based on the STMicro STM32F100RB MCU.
|
||||||
|
|
||||||
configs/sure-pic32mx
|
configs/sure-pic32mx
|
||||||
The "Advanced USB Storage Demo Board," Model DB-DP11215, from Sure
|
The "Advanced USB Storage Demo Board," Model DB-DP11215, from Sure
|
||||||
Electronics (http://www.sureelectronics.net/). This board features
|
Electronics (http://www.sureelectronics.net/). This board features
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
#
|
||||||
|
# For a description of the syntax of this configuration file,
|
||||||
|
# see misc/tools/kconfig-language.txt.
|
||||||
|
#
|
||||||
|
|
||||||
|
if ARCH_BOARD_STM32VL_DISCOVERY
|
||||||
|
|
||||||
|
comment "STM32VL-Discovery Hardware Configuration"
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
@@ -0,0 +1,495 @@
|
|||||||
|
README
|
||||||
|
======
|
||||||
|
|
||||||
|
This README discusses issues unique to NuttX configurations for the STMicro
|
||||||
|
STM32VLDiscovery (Value Line Discovery) board.
|
||||||
|
|
||||||
|
Contents
|
||||||
|
========
|
||||||
|
|
||||||
|
- Development Environment
|
||||||
|
- GNU Toolchain Options
|
||||||
|
- IDEs
|
||||||
|
- NuttX EABI "buildroot" Toolchain
|
||||||
|
- NuttX OABI "buildroot" Toolchain
|
||||||
|
- NXFLAT Toolchain
|
||||||
|
- LEDs
|
||||||
|
- UARTs
|
||||||
|
- "STMicro STM32F100RC generic" specific Configuration Options
|
||||||
|
- Configurations
|
||||||
|
|
||||||
|
Development Environment
|
||||||
|
=======================
|
||||||
|
|
||||||
|
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||||
|
The source has been built only using the GNU toolchain (see below). Other
|
||||||
|
toolchains will likely cause problems.
|
||||||
|
|
||||||
|
GNU Toolchain Options
|
||||||
|
=====================
|
||||||
|
|
||||||
|
Toolchain Configurations
|
||||||
|
------------------------
|
||||||
|
The NuttX make system has been modified to support the following different
|
||||||
|
toolchain options.
|
||||||
|
|
||||||
|
1. The CodeSourcery GNU toolchain,
|
||||||
|
2. The Atollic Toolchain,
|
||||||
|
3. The devkitARM GNU toolchain,
|
||||||
|
4. Raisonance GNU toolchain, or
|
||||||
|
5. The NuttX buildroot Toolchain (see below).
|
||||||
|
|
||||||
|
All testing has been conducted using the CodeSourcery toolchain for Windows. To use
|
||||||
|
the Atollic, devkitARM, Raisonance GNU, or NuttX buildroot toolchain, you simply need to
|
||||||
|
add one of the following configuration options to your .config (or defconfig)
|
||||||
|
file:
|
||||||
|
|
||||||
|
CONFIG_STM32_CODESOURCERYW=y : CodeSourcery under Windows
|
||||||
|
CONFIG_STM32_CODESOURCERYL=y : CodeSourcery under Linux
|
||||||
|
CONFIG_STM32_ATOLLIC_LITE=y : The free, "Lite" version of Atollic toolchain under Windows
|
||||||
|
CONFIG_STM32_ATOLLIC_PRO=y : The paid, "Pro" version of Atollic toolchain under Windows
|
||||||
|
CONFIG_STM32_DEVKITARM=y : devkitARM under Windows
|
||||||
|
CONFIG_STM32_RAISONANCE=y : Raisonance RIDE7 under Windows
|
||||||
|
CONFIG_STM32_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||||
|
|
||||||
|
If you change the default toolchain, then you may also have to modify the PATH in
|
||||||
|
the setenv.sh file if your make cannot find the tools.
|
||||||
|
|
||||||
|
NOTE: the CodeSourcery (for Windows), Atollic, devkitARM, and Raisonance toolchains are
|
||||||
|
Windows native toolchains. The CodeSourcey (for Linux) and NuttX buildroot
|
||||||
|
toolchains are Cygwin and/or Linux native toolchains. There are several limitations
|
||||||
|
to using a Windows based toolchain in a Cygwin environment. The three biggest are:
|
||||||
|
|
||||||
|
1. The Windows toolchain cannot follow Cygwin paths. Path conversions are
|
||||||
|
performed automatically in the Cygwin makefiles using the 'cygpath' utility
|
||||||
|
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||||
|
|
||||||
|
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||||
|
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||||
|
problems for the Windows tools by copying directories instead of linking them.
|
||||||
|
But this can also cause some confusion for you: For example, you may edit
|
||||||
|
a file in a "linked" directory and find that your changes had no effect.
|
||||||
|
That is because you are building the copy of the file in the "fake" symbolic
|
||||||
|
directory. If you use a Windows toolchain, you should get in the habit of
|
||||||
|
making like this:
|
||||||
|
|
||||||
|
make clean_context all
|
||||||
|
|
||||||
|
An alias in your .bashrc file might make that less painful.
|
||||||
|
|
||||||
|
3. Dependencies are not made when using Windows versions of the GCC. This is
|
||||||
|
because the dependencies are generated using Windows pathes which do not
|
||||||
|
work with the Cygwin make.
|
||||||
|
|
||||||
|
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
|
||||||
|
|
||||||
|
The CodeSourcery Toolchain (2009q1)
|
||||||
|
-----------------------------------
|
||||||
|
The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||||
|
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||||
|
-Os.
|
||||||
|
|
||||||
|
The Atollic "Pro" and "Lite" Toolchain
|
||||||
|
--------------------------------------
|
||||||
|
One problem that I had with the Atollic toolchains is that the provide a gcc.exe
|
||||||
|
and g++.exe in the same bin/ file as their ARM binaries. If the Atollic bin/ path
|
||||||
|
appears in your PATH variable before /usr/bin, then you will get the wrong gcc
|
||||||
|
when you try to build host executables. This will cause to strange, uninterpretable
|
||||||
|
errors build some host binaries in tools/ when you first make.
|
||||||
|
|
||||||
|
The Atollic "Lite" Toolchain
|
||||||
|
----------------------------
|
||||||
|
The free, "Lite" version of the Atollic toolchain does not support C++ nor
|
||||||
|
does it support ar, nm, objdump, or objdcopy. If you use the Atollic "Lite"
|
||||||
|
toolchain, you will have to set:
|
||||||
|
|
||||||
|
CONFIG_HAVE_CXX=n
|
||||||
|
|
||||||
|
In order to compile successfully. Otherwise, you will get errors like:
|
||||||
|
|
||||||
|
"C++ Compiler only available in TrueSTUDIO Professional"
|
||||||
|
|
||||||
|
The make may then fail in some of the post link processing because of some of
|
||||||
|
the other missing tools. The Make.defs file replaces the ar and nm with
|
||||||
|
the default system x86 tool versions and these seem to work okay. Disable all
|
||||||
|
of the following to avoid using objcopy:
|
||||||
|
|
||||||
|
CONFIG_RRLOAD_BINARY=n
|
||||||
|
CONFIG_INTELHEX_BINARY=n
|
||||||
|
CONFIG_MOTOROLA_SREC=n
|
||||||
|
CONFIG_RAW_BINARY=n
|
||||||
|
|
||||||
|
devkitARM
|
||||||
|
---------
|
||||||
|
The devkitARM toolchain includes a version of MSYS make. Make sure that the
|
||||||
|
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||||
|
path or will get the wrong version of make.
|
||||||
|
|
||||||
|
IDEs
|
||||||
|
====
|
||||||
|
|
||||||
|
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||||
|
effort will be required to create the project.
|
||||||
|
|
||||||
|
Makefile Build
|
||||||
|
--------------
|
||||||
|
Under Eclipse, it is pretty easy to set up an "empty makefile project" and
|
||||||
|
simply use the NuttX makefile to build the system. That is almost for free
|
||||||
|
under Linux. Under Windows, you will need to set up the "Cygwin GCC" empty
|
||||||
|
makefile project in order to work with Windows (Google for "Eclipse Cygwin" -
|
||||||
|
there is a lot of help on the internet).
|
||||||
|
|
||||||
|
Native Build
|
||||||
|
------------
|
||||||
|
Here are a few tips before you start that effort:
|
||||||
|
|
||||||
|
1) Select the toolchain that you will be using in your .config file
|
||||||
|
2) Start the NuttX build at least one time from the Cygwin command line
|
||||||
|
before trying to create your project. This is necessary to create
|
||||||
|
certain auto-generated files and directories that will be needed.
|
||||||
|
3) Set up include pathes: You will need include/, arch/arm/src/stm32,
|
||||||
|
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||||
|
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||||
|
on the command line.
|
||||||
|
|
||||||
|
Startup files will probably cause you some headaches. The NuttX startup file
|
||||||
|
is arch/arm/src/stm32/stm32_vectors.S. With RIDE, I have to build NuttX
|
||||||
|
one time from the Cygwin command line in order to obtain the pre-built
|
||||||
|
startup object needed by RIDE.
|
||||||
|
|
||||||
|
NuttX EABI "buildroot" Toolchain
|
||||||
|
================================
|
||||||
|
|
||||||
|
A GNU GCC-based toolchain is assumed. The files */setenv.sh should
|
||||||
|
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||||
|
different from the default in your PATH variable).
|
||||||
|
|
||||||
|
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||||
|
SourceForge download site (https://sourceforge.net/projects/nuttx/files/buildroot/).
|
||||||
|
This GNU toolchain builds and executes in the Linux or Cygwin environment.
|
||||||
|
|
||||||
|
1. You must have already configured Nuttx in <some-dir>/nuttx.
|
||||||
|
|
||||||
|
cd tools
|
||||||
|
./configure.sh stm32f100rc_generic/<sub-dir>
|
||||||
|
|
||||||
|
2. Download the latest buildroot package into <some-dir>
|
||||||
|
|
||||||
|
3. unpack the buildroot tarball. The resulting directory may
|
||||||
|
have versioning information on it like buildroot-x.y.z. If so,
|
||||||
|
rename <some-dir>/buildroot-x.y.z to <some-dir>/buildroot.
|
||||||
|
|
||||||
|
4. cd <some-dir>/buildroot
|
||||||
|
|
||||||
|
5. cp configs/cortexm3-eabi-defconfig-4.6.3 .config
|
||||||
|
|
||||||
|
6. make oldconfig
|
||||||
|
|
||||||
|
7. make
|
||||||
|
|
||||||
|
8. Edit setenv.h, if necessary, so that the PATH variable includes
|
||||||
|
the path to the newly built binaries.
|
||||||
|
|
||||||
|
See the file configs/README.txt in the buildroot source tree. That has more
|
||||||
|
details PLUS some special instructions that you will need to follow if you are
|
||||||
|
building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||||
|
|
||||||
|
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||||
|
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||||
|
more information about this problem. If you plan to use NXFLAT, please do not
|
||||||
|
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||||
|
See instructions below.
|
||||||
|
|
||||||
|
NuttX OABI "buildroot" Toolchain
|
||||||
|
================================
|
||||||
|
|
||||||
|
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||||
|
toolchain:
|
||||||
|
|
||||||
|
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||||
|
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||||
|
configuration such as cortexm3-defconfig-4.3.3
|
||||||
|
|
||||||
|
2. Modify the Make.defs file to use the OABI conventions:
|
||||||
|
|
||||||
|
+CROSSDEV = arm-nuttx-elf-
|
||||||
|
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||||
|
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||||
|
-CROSSDEV = arm-nuttx-eabi-
|
||||||
|
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||||
|
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||||
|
|
||||||
|
NXFLAT Toolchain
|
||||||
|
================
|
||||||
|
|
||||||
|
If you are *not* using the NuttX buildroot toolchain and you want to use
|
||||||
|
the NXFLAT tools, then you will still have to build a portion of the buildroot
|
||||||
|
tools -- just the NXFLAT tools. The buildroot with the NXFLAT tools can
|
||||||
|
be downloaded from the NuttX SourceForge download site
|
||||||
|
(https://sourceforge.net/projects/nuttx/files/).
|
||||||
|
|
||||||
|
This GNU toolchain builds and executes in the Linux or Cygwin environment.
|
||||||
|
|
||||||
|
1. You must have already configured Nuttx in <some-dir>/nuttx.
|
||||||
|
|
||||||
|
cd tools
|
||||||
|
./configure.sh lpcxpresso-lpc1768/<sub-dir>
|
||||||
|
|
||||||
|
2. Download the latest buildroot package into <some-dir>
|
||||||
|
|
||||||
|
3. unpack the buildroot tarball. The resulting directory may
|
||||||
|
have versioning information on it like buildroot-x.y.z. If so,
|
||||||
|
rename <some-dir>/buildroot-x.y.z to <some-dir>/buildroot.
|
||||||
|
|
||||||
|
4. cd <some-dir>/buildroot
|
||||||
|
|
||||||
|
5. cp configs/cortexm3-defconfig-nxflat .config
|
||||||
|
|
||||||
|
6. make oldconfig
|
||||||
|
|
||||||
|
7. make
|
||||||
|
|
||||||
|
8. Edit setenv.h, if necessary, so that the PATH variable includes
|
||||||
|
the path to the newly builtNXFLAT binaries.
|
||||||
|
|
||||||
|
LEDs
|
||||||
|
====
|
||||||
|
|
||||||
|
It is asumed that STMicro STM32F100RC generic board board has one LED on PA0.
|
||||||
|
You should configure the port and pin number in
|
||||||
|
configs/stm32f100rc_generic/src/stm32f100rc_internal.h. This LED is not used by
|
||||||
|
the board port unless CONFIG_ARCH_LEDS is defined. In that case, the usage by
|
||||||
|
the board port is defined in include/board.h and src/up_leds.c. The LED is used
|
||||||
|
to encode OS-related events as follows:
|
||||||
|
|
||||||
|
SYMBOL Meaning LED1*
|
||||||
|
green
|
||||||
|
------------------- ----------------------- -------
|
||||||
|
LED_STARTED NuttX has been started ON
|
||||||
|
LED_HEAPALLOCATE Heap has been allocated ON
|
||||||
|
LED_IRQSENABLED Interrupts enabled ON
|
||||||
|
LED_STACKCREATED Idle stack created ON
|
||||||
|
LED_INIRQ In an interrupt ON
|
||||||
|
LED_SIGNAL In a signal handler ON
|
||||||
|
LED_ASSERTION An assertion failed OFF
|
||||||
|
LED_PANIC The system has crashed OFF
|
||||||
|
|
||||||
|
So basically if the LED is off it means that there is a problem.
|
||||||
|
|
||||||
|
UART
|
||||||
|
====
|
||||||
|
|
||||||
|
Default USART/UART Configuration
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
USART1 is enabled in all configurations (see */defconfig). RX and TX are
|
||||||
|
configured on pins PA10 and PA9, respectively. Then connect the RX pin of
|
||||||
|
your USB/Serial adapter to TX pin (PA9) and the TX pin of your adapter to
|
||||||
|
RX pin (PA10) of your board besides, of course, the GND pin.
|
||||||
|
|
||||||
|
"STMicro STM32F100RC generic" specific Configuration Options
|
||||||
|
============================================================
|
||||||
|
|
||||||
|
CONFIG_ARCH - Identifies the arch/ subdirectory. This should
|
||||||
|
be set to:
|
||||||
|
|
||||||
|
CONFIG_ARCH=arm
|
||||||
|
|
||||||
|
CONFIG_ARCH_family - For use in C code:
|
||||||
|
|
||||||
|
CONFIG_ARCH_ARM=y
|
||||||
|
|
||||||
|
CONFIG_ARCH_architecture - For use in C code:
|
||||||
|
|
||||||
|
CONFIG_ARCH_CORTEXM3=y
|
||||||
|
|
||||||
|
CONFIG_ARCH_CHIP - Identifies the arch/*/chip subdirectory
|
||||||
|
|
||||||
|
CONFIG_ARCH_CHIP=stm32
|
||||||
|
|
||||||
|
CONFIG_ARCH_CHIP_name - For use in C code to identify the exact
|
||||||
|
chip:
|
||||||
|
|
||||||
|
CONFIG_ARCH_CHIP_STM32F100RB=y
|
||||||
|
|
||||||
|
CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG - Enables special STM32 clock
|
||||||
|
configuration features.
|
||||||
|
|
||||||
|
CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG=n
|
||||||
|
|
||||||
|
CONFIG_ARCH_BOARD - Identifies the configs subdirectory and
|
||||||
|
hence, the board that supports the particular chip or SoC.
|
||||||
|
|
||||||
|
CONFIG_ARCH_BOARD=stm32vldiscovery
|
||||||
|
|
||||||
|
CONFIG_ARCH_BOARD_name - For use in C code
|
||||||
|
|
||||||
|
CONFIG_ARCH_BOARD_STM32VL_DISCOVERY=y
|
||||||
|
|
||||||
|
CONFIG_ARCH_LOOPSPERMSEC - Must be calibrated for correct operation
|
||||||
|
of delay loops
|
||||||
|
|
||||||
|
CONFIG_ENDIAN_BIG - define if big endian (default is little
|
||||||
|
endian)
|
||||||
|
|
||||||
|
CONFIG_RAM_SIZE - Describes the installed DRAM (SRAM in this case):
|
||||||
|
|
||||||
|
CONFIG_RAM_SIZE=24576 (24kB)
|
||||||
|
|
||||||
|
CONFIG_RAM_START - The start address of installed DRAM
|
||||||
|
|
||||||
|
CONFIG_RAM_START=0x20000000
|
||||||
|
|
||||||
|
CONFIG_ARCH_IRQPRIO - STM32F100RC chip supports interrupt prioritization
|
||||||
|
|
||||||
|
CONFIG_ARCH_IRQPRIO=y
|
||||||
|
|
||||||
|
CONFIG_ARCH_LEDS - Use LED to show state. Unique to boards that have LED(s)
|
||||||
|
|
||||||
|
CONFIG_ARCH_INTERRUPTSTACK - This architecture supports an interrupt
|
||||||
|
stack. If defined, this symbol is the size of the interrupt
|
||||||
|
stack in bytes. If not defined, the user task stacks will be
|
||||||
|
used during interrupt handling.
|
||||||
|
|
||||||
|
CONFIG_ARCH_STACKDUMP - Do stack dumps after assertions
|
||||||
|
|
||||||
|
CONFIG_ARCH_CALIBRATION - when used togeter with CONFIG_DEBUG enables some
|
||||||
|
build in instrumentation that cause a 100 second delay during boot-up.
|
||||||
|
This 100 second delay serves no purpose other than it allows you to
|
||||||
|
calibratre CONFIG_ARCH_LOOPSPERMSEC. You simply use a stop watch to
|
||||||
|
measure the 100 second delay then adjust CONFIG_ARCH_LOOPSPERMSEC until
|
||||||
|
the delay actually is 100 seconds.
|
||||||
|
|
||||||
|
Individual subsystems can be enabled:
|
||||||
|
|
||||||
|
AHB
|
||||||
|
----
|
||||||
|
CONFIG_STM32_CRC
|
||||||
|
CONFIG_STM32_DMA1
|
||||||
|
CONFIG_STM32_DMA2
|
||||||
|
|
||||||
|
APB1
|
||||||
|
----
|
||||||
|
CONFIG_STM32_TIM2
|
||||||
|
CONFIG_STM32_TIM3
|
||||||
|
CONFIG_STM32_TIM4
|
||||||
|
CONFIG_STM32_TIM5
|
||||||
|
CONFIG_STM32_TIM6
|
||||||
|
CONFIG_STM32_TIM7
|
||||||
|
CONFIG_STM32_TIM12
|
||||||
|
CONFIG_STM32_TIM13
|
||||||
|
CONFIG_STM32_TIM14
|
||||||
|
CONFIG_STM32_RTC
|
||||||
|
CONFIG_STM32_WWDG
|
||||||
|
CONFIG_STM32_IWDG
|
||||||
|
CONFIG_STM32_SPI2
|
||||||
|
CONFIG_STM32_SPI3
|
||||||
|
CONFIG_STM32_USART2
|
||||||
|
CONFIG_STM32_USART3
|
||||||
|
CONFIG_STM32_UART4
|
||||||
|
CONFIG_STM32_UART5
|
||||||
|
CONFIG_STM32_I2C1
|
||||||
|
CONFIG_STM32_I2C2
|
||||||
|
CONFIG_STM32_PWR -- Required for RTC
|
||||||
|
CONFIG_STM32_BKP -- Required for RTC
|
||||||
|
CONFIG_STM32_DAC1
|
||||||
|
CONFIG_STM32_DAC2
|
||||||
|
CONFIG_STM32_CEC
|
||||||
|
|
||||||
|
APB2
|
||||||
|
----
|
||||||
|
CONFIG_STM32_ADC1
|
||||||
|
CONFIG_STM32_TIM1
|
||||||
|
CONFIG_STM32_SPI1
|
||||||
|
CONFIG_STM32_USART1
|
||||||
|
CONFIG_STM32_TIM15
|
||||||
|
CONFIG_STM32_TIM16
|
||||||
|
CONFIG_STM32_TIM17
|
||||||
|
|
||||||
|
Timer devices may be used for different purposes. One special purpose is
|
||||||
|
to generate modulated outputs for such things as motor control. If CONFIG_STM32_TIMn
|
||||||
|
is defined (as above) then the following may also be defined to indicate that
|
||||||
|
the timer is intended to be used for pulsed output modulation, ADC conversion,
|
||||||
|
or DAC conversion. Note that ADC/DAC require two definition: Not only do you have
|
||||||
|
to assign the timer (n) for used by the ADC or DAC, but then you also have to
|
||||||
|
configure which ADC or DAC (m) it is assigned to.
|
||||||
|
|
||||||
|
CONFIG_STM32_TIMn_PWM Reserve timer n for use by PWM, n=1,..,17
|
||||||
|
CONFIG_STM32_TIMn_ADC Reserve timer n for use by ADC, n=1,..,17
|
||||||
|
CONFIG_STM32_TIMn_ADC1 Reserve timer n to trigger ADCm, n=1,..,17
|
||||||
|
CONFIG_STM32_TIMn_DAC Reserve timer n for use by DAC, n=1,..,17
|
||||||
|
CONFIG_STM32_TIMn_DACm Reserve timer n to trigger DACm, n=1,..,17, m=1,..,2
|
||||||
|
|
||||||
|
For each timer that is enabled for PWM usage, we need the following additional
|
||||||
|
configuration settings:
|
||||||
|
|
||||||
|
CONFIG_STM32_TIMx_CHANNEL - Specifies the timer output channel {1,..,4}
|
||||||
|
|
||||||
|
NOTE: The STM32 timers are each capable of generating different signals on
|
||||||
|
each of the four channels with different duty cycles. That capability is
|
||||||
|
not supported by this driver: Only one output channel per timer.
|
||||||
|
|
||||||
|
JTAG Enable settings (by default full SWJ is enabled):
|
||||||
|
|
||||||
|
CONFIG_STM32_JTAG_FULL_ENABLE - Enables full SWJ (JTAG-DP + SW-DP)
|
||||||
|
CONFIG_STM32_JTAG_NOJNTRST_ENABLE - Enables full SWJ (JTAG-DP + SW-DP)
|
||||||
|
but without JNTRST.
|
||||||
|
CONFIG_STM32_JTAG_SW_ENABLE - Set JTAG-DP disabled and SW-DP enabled
|
||||||
|
|
||||||
|
STMicro STM32F100RC generic specific device driver settings
|
||||||
|
|
||||||
|
CONFIG_U[S]ARTn_SERIAL_CONSOLE - selects the USARTn (n=1,2,3) or UART
|
||||||
|
m (m=4,5) for the console and ttys0 (default is the USART1).
|
||||||
|
CONFIG_U[S]ARTn_RXBUFSIZE - Characters are buffered as received.
|
||||||
|
This specific the size of the receive buffer
|
||||||
|
CONFIG_U[S]ARTn_TXBUFSIZE - Characters are buffered before
|
||||||
|
being sent. This specific the size of the transmit buffer
|
||||||
|
CONFIG_U[S]ARTn_BAUD - The configure BAUD of the UART. Must be
|
||||||
|
CONFIG_U[S]ARTn_BITS - The number of bits. Must be either 7 or 8.
|
||||||
|
CONFIG_U[S]ARTn_PARTIY - 0=no parity, 1=odd parity, 2=even parity
|
||||||
|
CONFIG_U[S]ARTn_2STOP - Two stop bits
|
||||||
|
|
||||||
|
Configurations
|
||||||
|
==============
|
||||||
|
|
||||||
|
Each STMicro STM32F100RC generic configuration is maintained in a sub-directory
|
||||||
|
and can be selected as follow:
|
||||||
|
|
||||||
|
cd tools
|
||||||
|
./configure.sh stm32f100rc_generic/<subdir>
|
||||||
|
cd -
|
||||||
|
. ./setenv.sh
|
||||||
|
|
||||||
|
Where <subdir> is one of the following:
|
||||||
|
|
||||||
|
ostest:
|
||||||
|
------
|
||||||
|
This configuration directory, performs a simple OS test using
|
||||||
|
apps/examples/ostest.
|
||||||
|
|
||||||
|
NOTES:
|
||||||
|
|
||||||
|
1. This configuration uses the mconf-based configuration tool. To
|
||||||
|
change this configuration using that tool, you should:
|
||||||
|
|
||||||
|
a. Build and install the mconf tool. See nuttx/README.txt and
|
||||||
|
misc/tools/
|
||||||
|
|
||||||
|
b. Execute 'make menuconfig' in nuttx/ in order to start the
|
||||||
|
reconfiguration process.
|
||||||
|
|
||||||
|
2. Default toolchain:
|
||||||
|
|
||||||
|
CONFIG_STM32_CODESOURCERYL=y : CodeSourcery under Linux / Mac OS X
|
||||||
|
|
||||||
|
3. By default, this project assumes that you are *NOT* using the DFU
|
||||||
|
bootloader.
|
||||||
|
|
||||||
|
nsh:
|
||||||
|
---
|
||||||
|
Configures the NuttShell (nsh) located at apps/examples/nsh. The
|
||||||
|
Configuration enables only the serial NSH interfaces.
|
||||||
|
|
||||||
|
Default toolchain:
|
||||||
|
|
||||||
|
CONFIG_STM32_CODESOURCERYL=y : CodeSourcery under Linux / Mac OS X
|
||||||
@@ -0,0 +1,224 @@
|
|||||||
|
/************************************************************************************
|
||||||
|
* configs/stm32vldiscovery/include/board.h
|
||||||
|
*
|
||||||
|
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||||
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
* Freddie Chopin <freddie_chopin@op.pl>
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||||
|
* used to endorse or promote products derived from this software
|
||||||
|
* without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
************************************************************************************/
|
||||||
|
|
||||||
|
#ifndef __CONFIG_STM32VLDISCOVERY_INCLUDE_BOARD_H
|
||||||
|
#define __CONFIG_STM32VLDISCOVERY_INCLUDE_BOARD_H
|
||||||
|
|
||||||
|
/************************************************************************************
|
||||||
|
* Included Files
|
||||||
|
************************************************************************************/
|
||||||
|
|
||||||
|
#include <nuttx/config.h>
|
||||||
|
#ifndef __ASSEMBLY__
|
||||||
|
# include <stdint.h>
|
||||||
|
#endif
|
||||||
|
#include "stm32_rcc.h"
|
||||||
|
#include "stm32.h"
|
||||||
|
|
||||||
|
/************************************************************************************
|
||||||
|
* Definitions
|
||||||
|
************************************************************************************/
|
||||||
|
|
||||||
|
/* Clocking *************************************************************************/
|
||||||
|
|
||||||
|
/* On-board crystal frequency is 8MHz (HSE) */
|
||||||
|
|
||||||
|
#define STM32_BOARD_XTAL 8000000ul
|
||||||
|
|
||||||
|
/* PLL source is HSE / 1, PLL multiplier is 3: PLL output frequency is 8MHz (XTAL) x 3 = 24MHz */
|
||||||
|
|
||||||
|
#define STM32_CFGR2_PREDIV1 RCC_CFGR2_PREDIV1d1
|
||||||
|
#define STM32_CFGR_PLLSRC RCC_CFGR_PLLSRC
|
||||||
|
#define STM32_CFGR_PLLXTPRE 0
|
||||||
|
#define STM32_CFGR_PLLMUL RCC_CFGR_PLLMUL_CLKx3
|
||||||
|
#define STM32_PLL_FREQUENCY (3 * STM32_BOARD_XTAL)
|
||||||
|
|
||||||
|
/* Use the PLL and set the SYSCLK source to be the PLL */
|
||||||
|
|
||||||
|
#define STM32_SYSCLK_SW RCC_CFGR_SW_PLL
|
||||||
|
#define STM32_SYSCLK_SWS RCC_CFGR_SWS_PLL
|
||||||
|
#define STM32_SYSCLK_FREQUENCY STM32_PLL_FREQUENCY
|
||||||
|
|
||||||
|
/* AHB clock (HCLK) is SYSCLK (24MHz) */
|
||||||
|
|
||||||
|
#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK
|
||||||
|
#define STM32_HCLK_FREQUENCY STM32_PLL_FREQUENCY
|
||||||
|
|
||||||
|
/* APB2 clock (PCLK2) is HCLK (24MHz) */
|
||||||
|
|
||||||
|
#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLK
|
||||||
|
#define STM32_PCLK2_FREQUENCY STM32_HCLK_FREQUENCY
|
||||||
|
|
||||||
|
/* APB2 timers (1, 15-17) will receive PCLK2. */
|
||||||
|
|
||||||
|
#define STM32_APB2_TIM1_CLKIN STM32_PCLK2_FREQUENCY
|
||||||
|
#define STM32_APB2_TIM15_CLKIN STM32_PCLK2_FREQUENCY
|
||||||
|
#define STM32_APB2_TIM16_CLKIN STM32_PCLK2_FREQUENCY
|
||||||
|
#define STM32_APB2_TIM17_CLKIN STM32_PCLK2_FREQUENCY
|
||||||
|
|
||||||
|
/* APB1 clock (PCLK1) is HCLK (24MHz) */
|
||||||
|
|
||||||
|
#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLK
|
||||||
|
#define STM32_PCLK1_FREQUENCY STM32_HCLK_FREQUENCY
|
||||||
|
|
||||||
|
/* APB1 timers (2-7, 12-14) will receive PCLK1. */
|
||||||
|
|
||||||
|
#define STM32_APB1_TIM2_CLKIN STM32_PCLK1_FREQUENCY
|
||||||
|
#define STM32_APB1_TIM3_CLKIN STM32_PCLK1_FREQUENCY
|
||||||
|
#define STM32_APB1_TIM4_CLKIN STM32_PCLK1_FREQUENCY
|
||||||
|
#define STM32_APB1_TIM5_CLKIN STM32_PCLK1_FREQUENCY
|
||||||
|
#define STM32_APB1_TIM6_CLKIN STM32_PCLK1_FREQUENCY
|
||||||
|
#define STM32_APB1_TIM7_CLKIN STM32_PCLK1_FREQUENCY
|
||||||
|
#define STM32_APB1_TIM12_CLKIN STM32_PCLK1_FREQUENCY
|
||||||
|
#define STM32_APB1_TIM13_CLKIN STM32_PCLK1_FREQUENCY
|
||||||
|
#define STM32_APB1_TIM14_CLKIN STM32_PCLK1_FREQUENCY
|
||||||
|
|
||||||
|
/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx
|
||||||
|
* otherwise frequency is 2xAPBx.
|
||||||
|
* Note: TIM1,15-17 are on APB2, others on APB1 */
|
||||||
|
|
||||||
|
#define STM32_TIM18_FREQUENCY STM32_HCLK_FREQUENCY
|
||||||
|
#define STM32_TIM27_FREQUENCY STM32_HCLK_FREQUENCY
|
||||||
|
|
||||||
|
/* LED definitions ******************************************************************/
|
||||||
|
|
||||||
|
/* It is assumed that a generic board has 1 LED. Thus only two different states
|
||||||
|
* can be shown. Statuses defined as "1" will light the LED, the ones defined as
|
||||||
|
* "0" will turn the LED off. */
|
||||||
|
|
||||||
|
#define LED_STARTED 1
|
||||||
|
#define LED_HEAPALLOCATE 1
|
||||||
|
#define LED_IRQSENABLED 1
|
||||||
|
#define LED_STACKCREATED 1
|
||||||
|
#define LED_INIRQ 1
|
||||||
|
#define LED_SIGNAL 1
|
||||||
|
#define LED_ASSERTION 0
|
||||||
|
#define LED_PANIC 0
|
||||||
|
|
||||||
|
/* Button definitions ***************************************************************/
|
||||||
|
|
||||||
|
/* It is assumed that a generic board has 1 button. */
|
||||||
|
|
||||||
|
#define BUTTON_0 0
|
||||||
|
|
||||||
|
#define NUM_BUTTONS 1
|
||||||
|
|
||||||
|
#define BUTTON_0_BIT (1 << BUTTON_0)
|
||||||
|
|
||||||
|
/************************************************************************************
|
||||||
|
* Public Data
|
||||||
|
************************************************************************************/
|
||||||
|
|
||||||
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
|
#undef EXTERN
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
#define EXTERN extern "C"
|
||||||
|
extern "C"
|
||||||
|
{
|
||||||
|
#else
|
||||||
|
#define EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/************************************************************************************
|
||||||
|
* Public Function Prototypes
|
||||||
|
************************************************************************************/
|
||||||
|
/************************************************************************************
|
||||||
|
* Name: stm32_boardinitialize
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* All STM32 architectures must provide the following entry point. This entry point
|
||||||
|
* is called early in the intitialization -- after all memory has been configured
|
||||||
|
* and mapped but before any devices have been initialized.
|
||||||
|
*
|
||||||
|
************************************************************************************/
|
||||||
|
|
||||||
|
void stm32_boardinitialize(void);
|
||||||
|
|
||||||
|
/************************************************************************************
|
||||||
|
* Name: stm32_ledinit, stm32_setled, and stm32_setleds
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board LEDs. If
|
||||||
|
* CONFIG_ARCH_LEDS is not defined, then the following interfacesare available to
|
||||||
|
* control the LEDs from user applications.
|
||||||
|
*
|
||||||
|
************************************************************************************/
|
||||||
|
|
||||||
|
#ifndef CONFIG_ARCH_LEDS
|
||||||
|
void stm32_ledinit(void);
|
||||||
|
void stm32_setled(int led, bool ledon);
|
||||||
|
void stm32_setleds(uint8_t ledset);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/************************************************************************************
|
||||||
|
* Button support.
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* up_buttoninit() must be called to initialize button resources. After
|
||||||
|
* that, up_buttons() may be called to collect the current state of all
|
||||||
|
* buttons or up_irqbutton() may be called to register button interrupt
|
||||||
|
* handlers.
|
||||||
|
*
|
||||||
|
* After up_buttoninit() has been called, up_buttons() may be called to
|
||||||
|
* collect the state of all buttons. up_buttons() returns an 8-bit bit set
|
||||||
|
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
|
||||||
|
* definitions in board.h for the meaning of each bit.
|
||||||
|
*
|
||||||
|
* up_irqbutton() may be called to register an interrupt handler that will
|
||||||
|
* be called when a button is depressed or released. The ID value is a
|
||||||
|
* button enumeration value that uniquely identifies a button resource. See the
|
||||||
|
* BUTTON_* and JOYSTICK_* definitions in board.h for the meaning of enumeration
|
||||||
|
* value. The previous interrupt handler address is returned (so that it may
|
||||||
|
* restored, if so desired).
|
||||||
|
*
|
||||||
|
************************************************************************************/
|
||||||
|
|
||||||
|
#ifdef CONFIG_ARCH_BUTTONS
|
||||||
|
void up_buttoninit(void);
|
||||||
|
uint8_t up_buttons(void);
|
||||||
|
#ifdef CONFIG_ARCH_IRQBUTTONS
|
||||||
|
xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#undef EXTERN
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __ASSEMBLY__ */
|
||||||
|
#endif /* __CONFIG_STM32VLDISCOVERY_INCLUDE_BOARD_H */
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
############################################################################
|
||||||
|
# configs/stm32vldiscovery/nsh/Make.defs
|
||||||
|
#
|
||||||
|
# Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||||
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
# Freddie Chopin <freddie_chopin@op.pl>
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions
|
||||||
|
# are met:
|
||||||
|
#
|
||||||
|
# 1. Redistributions of source code must retain the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer.
|
||||||
|
# 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer in
|
||||||
|
# the documentation and/or other materials provided with the
|
||||||
|
# distribution.
|
||||||
|
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||||
|
# used to endorse or promote products derived from this software
|
||||||
|
# without specific prior written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
|
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
|
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
#
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
include ${TOPDIR}/.config
|
||||||
|
include ${TOPDIR}/tools/Config.mk
|
||||||
|
include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs
|
||||||
|
|
||||||
|
LDSCRIPT = ld.script
|
||||||
|
|
||||||
|
ifeq ($(WINTOOL),y)
|
||||||
|
# Windows-native toolchains
|
||||||
|
DIRLINK = $(TOPDIR)/tools/copydir.sh
|
||||||
|
DIRUNLINK = $(TOPDIR)/tools/unlink.sh
|
||||||
|
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
|
||||||
|
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
|
||||||
|
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
|
||||||
|
ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}"
|
||||||
|
MAXOPTIMIZATION = -O2
|
||||||
|
else
|
||||||
|
# Linux/Cygwin-native toolchain
|
||||||
|
MKDEP = $(TOPDIR)/tools/mkdeps.sh
|
||||||
|
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
|
||||||
|
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
|
||||||
|
ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)
|
||||||
|
endif
|
||||||
|
|
||||||
|
CC = $(CROSSDEV)gcc
|
||||||
|
CXX = $(CROSSDEV)g++
|
||||||
|
CPP = $(CROSSDEV)gcc -E
|
||||||
|
LD = $(CROSSDEV)ld
|
||||||
|
AR = $(CROSSDEV)ar rcs
|
||||||
|
NM = $(CROSSDEV)nm
|
||||||
|
OBJCOPY = $(CROSSDEV)objcopy
|
||||||
|
OBJDUMP = $(CROSSDEV)objdump
|
||||||
|
|
||||||
|
ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'}
|
||||||
|
ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1}
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||||
|
ARCHOPTIMIZATION = -g
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_DEBUG_NOOPT),y)
|
||||||
|
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
|
||||||
|
endif
|
||||||
|
|
||||||
|
ARCHCFLAGS = -fno-builtin
|
||||||
|
ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fno-rtti
|
||||||
|
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
|
||||||
|
ARCHWARNINGSXX = -Wall -Wshadow
|
||||||
|
ARCHDEFINES =
|
||||||
|
ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
|
||||||
|
|
||||||
|
CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
|
||||||
|
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
|
||||||
|
CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
|
||||||
|
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
|
||||||
|
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
|
||||||
|
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
|
||||||
|
|
||||||
|
NXFLATLDFLAGS1 = -r -d -warn-common
|
||||||
|
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||||
|
LDNXFLATFLAGS = -e main -s 2048
|
||||||
|
|
||||||
|
OBJEXT = .o
|
||||||
|
LIBEXT = .a
|
||||||
|
EXEEXT =
|
||||||
|
|
||||||
|
ifneq ($(CROSSDEV),arm-nuttx-elf-)
|
||||||
|
LDFLAGS = -nostartfiles -nodefaultlibs
|
||||||
|
endif
|
||||||
|
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||||
|
LDFLAGS = -g
|
||||||
|
endif
|
||||||
|
|
||||||
|
HOSTCC = gcc
|
||||||
|
HOSTINCLUDES = -I.
|
||||||
|
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
|
||||||
|
HOSTLDFLAGS =
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,76 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# configs/stm32vldiscovery/nsh/setenv.sh
|
||||||
|
#
|
||||||
|
# Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||||
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
# Freddie Chopin <freddie_chopin@op.pl>
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions
|
||||||
|
# are met:
|
||||||
|
#
|
||||||
|
# 1. Redistributions of source code must retain the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer.
|
||||||
|
# 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer in
|
||||||
|
# the documentation and/or other materials provided with the
|
||||||
|
# distribution.
|
||||||
|
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||||
|
# used to endorse or promote products derived from this software
|
||||||
|
# without specific prior written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
|
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
|
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
#
|
||||||
|
|
||||||
|
if [ "$_" = "$0" ] ; then
|
||||||
|
echo "You must source this script, not run it!" 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
WD=`pwd`
|
||||||
|
if [ ! -x "setenv.sh" ]; then
|
||||||
|
echo "This script must be executed from the top-level NuttX build directory"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "${PATH_ORIG}" ]; then
|
||||||
|
export PATH_ORIG="${PATH}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# This is the Cygwin path to the location where I installed the RIDE
|
||||||
|
# toolchain under windows. You will also have to edit this if you install
|
||||||
|
# the RIDE toolchain in any other location
|
||||||
|
#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Raisonance/Ride/arm-gcc/bin"
|
||||||
|
|
||||||
|
# This is the Cygwin path to the location where I installed the CodeSourcery
|
||||||
|
# toolchain under windows. You will also have to edit this if you install
|
||||||
|
# the CodeSourcery toolchain in any other location
|
||||||
|
export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin"
|
||||||
|
|
||||||
|
# These are the Cygwin paths to the locations where I installed the Atollic
|
||||||
|
# toolchain under windows. You will also have to edit this if you install
|
||||||
|
# the Atollic toolchain in any other location. /usr/bin is added before
|
||||||
|
# the Atollic bin path because there is are binaries named gcc.exe and g++.exe
|
||||||
|
# at those locations as well.
|
||||||
|
#export TOOLCHAIN_BIN="/usr/bin:/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for ARM Pro 2.3.0/ARMTools/bin"
|
||||||
|
#export TOOLCHAIN_BIN="/usr/bin:/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for STMicroelectronics STM32 Lite 2.3.0/ARMTools/bin"
|
||||||
|
|
||||||
|
# This is the Cygwin path to the location where I build the buildroot
|
||||||
|
# toolchain.
|
||||||
|
#export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin"
|
||||||
|
|
||||||
|
# Add the path to the toolchain to the PATH varialble
|
||||||
|
export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}"
|
||||||
|
|
||||||
|
echo "PATH : ${PATH}"
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
############################################################################
|
||||||
|
# configs/stm32vldiscovery/ostest/Make.defs
|
||||||
|
#
|
||||||
|
# Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||||
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
# Freddie Chopin <freddie_chopin@op.pl>
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions
|
||||||
|
# are met:
|
||||||
|
#
|
||||||
|
# 1. Redistributions of source code must retain the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer.
|
||||||
|
# 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer in
|
||||||
|
# the documentation and/or other materials provided with the
|
||||||
|
# distribution.
|
||||||
|
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||||
|
# used to endorse or promote products derived from this software
|
||||||
|
# without specific prior written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
|
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
|
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
#
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
include ${TOPDIR}/.config
|
||||||
|
include ${TOPDIR}/tools/Config.mk
|
||||||
|
include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs
|
||||||
|
|
||||||
|
LDSCRIPT = ld.script
|
||||||
|
|
||||||
|
ifeq ($(WINTOOL),y)
|
||||||
|
# Windows-native toolchains
|
||||||
|
DIRLINK = $(TOPDIR)/tools/copydir.sh
|
||||||
|
DIRUNLINK = $(TOPDIR)/tools/unlink.sh
|
||||||
|
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
|
||||||
|
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
|
||||||
|
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
|
||||||
|
ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}"
|
||||||
|
MAXOPTIMIZATION = -O2
|
||||||
|
else
|
||||||
|
# Linux/Cygwin-native toolchain
|
||||||
|
MKDEP = $(TOPDIR)/tools/mkdeps.sh
|
||||||
|
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
|
||||||
|
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
|
||||||
|
ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)
|
||||||
|
endif
|
||||||
|
|
||||||
|
CC = $(CROSSDEV)gcc
|
||||||
|
CXX = $(CROSSDEV)g++
|
||||||
|
CPP = $(CROSSDEV)gcc -E
|
||||||
|
LD = $(CROSSDEV)ld
|
||||||
|
AR = $(CROSSDEV)ar rcs
|
||||||
|
NM = $(CROSSDEV)nm
|
||||||
|
OBJCOPY = $(CROSSDEV)objcopy
|
||||||
|
OBJDUMP = $(CROSSDEV)objdump
|
||||||
|
|
||||||
|
ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'}
|
||||||
|
ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1}
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||||
|
ARCHOPTIMIZATION = -g
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_DEBUG_NOOPT),y)
|
||||||
|
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
|
||||||
|
endif
|
||||||
|
|
||||||
|
ARCHCFLAGS = -fno-builtin
|
||||||
|
ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fno-rtti
|
||||||
|
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
|
||||||
|
ARCHWARNINGSXX = -Wall -Wshadow
|
||||||
|
ARCHDEFINES =
|
||||||
|
ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
|
||||||
|
|
||||||
|
CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
|
||||||
|
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
|
||||||
|
CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
|
||||||
|
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
|
||||||
|
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
|
||||||
|
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
|
||||||
|
|
||||||
|
NXFLATLDFLAGS1 = -r -d -warn-common
|
||||||
|
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||||
|
LDNXFLATFLAGS = -e main -s 2048
|
||||||
|
|
||||||
|
OBJEXT = .o
|
||||||
|
LIBEXT = .a
|
||||||
|
EXEEXT =
|
||||||
|
|
||||||
|
ifneq ($(CROSSDEV),arm-nuttx-elf-)
|
||||||
|
LDFLAGS = -nostartfiles -nodefaultlibs
|
||||||
|
endif
|
||||||
|
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||||
|
LDFLAGS = -g
|
||||||
|
endif
|
||||||
|
|
||||||
|
HOSTCC = gcc
|
||||||
|
HOSTINCLUDES = -I.
|
||||||
|
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
|
||||||
|
HOSTLDFLAGS =
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,76 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# configs/stm32vldiscovery/ostest/setenv.sh
|
||||||
|
#
|
||||||
|
# Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||||
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
# Freddie Chopin <freddie_chopin@op.pl>
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions
|
||||||
|
# are met:
|
||||||
|
#
|
||||||
|
# 1. Redistributions of source code must retain the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer.
|
||||||
|
# 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer in
|
||||||
|
# the documentation and/or other materials provided with the
|
||||||
|
# distribution.
|
||||||
|
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||||
|
# used to endorse or promote products derived from this software
|
||||||
|
# without specific prior written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
|
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
|
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
#
|
||||||
|
|
||||||
|
if [ "$_" = "$0" ] ; then
|
||||||
|
echo "You must source this script, not run it!" 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
WD=`pwd`
|
||||||
|
if [ ! -x "setenv.sh" ]; then
|
||||||
|
echo "This script must be executed from the top-level NuttX build directory"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "${PATH_ORIG}" ]; then
|
||||||
|
export PATH_ORIG="${PATH}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# This is the Cygwin path to the location where I installed the RIDE
|
||||||
|
# toolchain under windows. You will also have to edit this if you install
|
||||||
|
# the RIDE toolchain in any other location
|
||||||
|
#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Raisonance/Ride/arm-gcc/bin"
|
||||||
|
|
||||||
|
# This is the Cygwin path to the location where I installed the CodeSourcery
|
||||||
|
# toolchain under windows. You will also have to edit this if you install
|
||||||
|
# the CodeSourcery toolchain in any other location
|
||||||
|
export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin"
|
||||||
|
|
||||||
|
# These are the Cygwin paths to the locations where I installed the Atollic
|
||||||
|
# toolchain under windows. You will also have to edit this if you install
|
||||||
|
# the Atollic toolchain in any other location. /usr/bin is added before
|
||||||
|
# the Atollic bin path because there is are binaries named gcc.exe and g++.exe
|
||||||
|
# at those locations as well.
|
||||||
|
#export TOOLCHAIN_BIN="/usr/bin:/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for ARM Pro 2.3.0/ARMTools/bin"
|
||||||
|
#export TOOLCHAIN_BIN="/usr/bin:/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for STMicroelectronics STM32 Lite 2.3.0/ARMTools/bin"
|
||||||
|
|
||||||
|
# This is the Cygwin path to the location where I build the buildroot
|
||||||
|
# toolchain.
|
||||||
|
#export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin"
|
||||||
|
|
||||||
|
# Add the path to the toolchain to the PATH varialble
|
||||||
|
export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}"
|
||||||
|
|
||||||
|
echo "PATH : ${PATH}"
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* configs/stm32vldiscovery/scripts/ld.script
|
||||||
|
*
|
||||||
|
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||||
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
* Freddie Chopin <freddie_chopin@op.pl>
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||||
|
* used to endorse or promote products derived from this software
|
||||||
|
* without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/* The STM32F100RC has 256kB of FLASH beginning at address 0x08000000 and 24kB
|
||||||
|
* of SRAM beginning at address 0x20000000. When booting from FLASH, FLASH
|
||||||
|
* memory is aliased to address 0x00000000 where the code expects to begin
|
||||||
|
* execution by jumping to the entry point in the 0x08000000 address range.
|
||||||
|
*/
|
||||||
|
|
||||||
|
MEMORY
|
||||||
|
{
|
||||||
|
flash (rx) : ORIGIN = 0x08000000, LENGTH = 256K
|
||||||
|
sram (rwx) : ORIGIN = 0x20000000, LENGTH = 24K
|
||||||
|
}
|
||||||
|
|
||||||
|
OUTPUT_ARCH(arm)
|
||||||
|
EXTERN(_vectors)
|
||||||
|
ENTRY(_stext)
|
||||||
|
|
||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
.text : {
|
||||||
|
_stext = ABSOLUTE(.);
|
||||||
|
*(.vectors)
|
||||||
|
*(.text .text.*)
|
||||||
|
*(.fixup)
|
||||||
|
*(.gnu.warning)
|
||||||
|
*(.rodata .rodata.*)
|
||||||
|
*(.gnu.linkonce.t.*)
|
||||||
|
*(.glue_7)
|
||||||
|
*(.glue_7t)
|
||||||
|
*(.got)
|
||||||
|
*(.gcc_except_table)
|
||||||
|
*(.gnu.linkonce.r.*)
|
||||||
|
_etext = ABSOLUTE(.);
|
||||||
|
} > flash
|
||||||
|
|
||||||
|
.init_section : {
|
||||||
|
_sinit = ABSOLUTE(.);
|
||||||
|
*(.init_array .init_array.*)
|
||||||
|
_einit = ABSOLUTE(.);
|
||||||
|
} > flash
|
||||||
|
|
||||||
|
.ARM.extab : {
|
||||||
|
*(.ARM.extab*)
|
||||||
|
} > flash
|
||||||
|
|
||||||
|
__exidx_start = ABSOLUTE(.);
|
||||||
|
.ARM.exidx : {
|
||||||
|
*(.ARM.exidx*)
|
||||||
|
} > flash
|
||||||
|
__exidx_end = ABSOLUTE(.);
|
||||||
|
|
||||||
|
_eronly = ABSOLUTE(.);
|
||||||
|
|
||||||
|
.data : {
|
||||||
|
_sdata = ABSOLUTE(.);
|
||||||
|
*(.data .data.*)
|
||||||
|
*(.gnu.linkonce.d.*)
|
||||||
|
CONSTRUCTORS
|
||||||
|
_edata = ABSOLUTE(.);
|
||||||
|
} > sram AT > flash
|
||||||
|
|
||||||
|
.bss : {
|
||||||
|
_sbss = ABSOLUTE(.);
|
||||||
|
*(.bss .bss.*)
|
||||||
|
*(.gnu.linkonce.b.*)
|
||||||
|
*(COMMON)
|
||||||
|
_ebss = ABSOLUTE(.);
|
||||||
|
} > sram
|
||||||
|
|
||||||
|
/* Stabs debugging sections. */
|
||||||
|
.stab 0 : { *(.stab) }
|
||||||
|
.stabstr 0 : { *(.stabstr) }
|
||||||
|
.stab.excl 0 : { *(.stab.excl) }
|
||||||
|
.stab.exclstr 0 : { *(.stab.exclstr) }
|
||||||
|
.stab.index 0 : { *(.stab.index) }
|
||||||
|
.stab.indexstr 0 : { *(.stab.indexstr) }
|
||||||
|
.comment 0 : { *(.comment) }
|
||||||
|
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||||
|
.debug_info 0 : { *(.debug_info) }
|
||||||
|
.debug_line 0 : { *(.debug_line) }
|
||||||
|
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||||
|
.debug_aranges 0 : { *(.debug_aranges) }
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
/.depend
|
||||||
|
/Make.dep
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
############################################################################
|
||||||
|
# configs/stm32vldiscovery/src/Makefile
|
||||||
|
#
|
||||||
|
# Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||||
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
# Freddie Chopin <freddie_chopin@op.pl>
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions
|
||||||
|
# are met:
|
||||||
|
#
|
||||||
|
# 1. Redistributions of source code must retain the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer.
|
||||||
|
# 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer in
|
||||||
|
# the documentation and/or other materials provided with the
|
||||||
|
# distribution.
|
||||||
|
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||||
|
# used to endorse or promote products derived from this software
|
||||||
|
# without specific prior written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
|
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
|
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
#
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
-include $(TOPDIR)/Make.defs
|
||||||
|
|
||||||
|
ASRCS =
|
||||||
|
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
||||||
|
|
||||||
|
CSRCS = stm32_boot.c stm32_leds.c stm32_buttons.c
|
||||||
|
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||||
|
|
||||||
|
SRCS = $(ASRCS) $(CSRCS)
|
||||||
|
OBJS = $(AOBJS) $(COBJS)
|
||||||
|
|
||||||
|
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
|
||||||
|
ifeq ($(WINTOOL),y)
|
||||||
|
CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \
|
||||||
|
-I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \
|
||||||
|
-I "${shell cygpath -w $(ARCH_SRCDIR)/armv7-m}"
|
||||||
|
else
|
||||||
|
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/armv7-m
|
||||||
|
endif
|
||||||
|
|
||||||
|
all: libboard$(LIBEXT)
|
||||||
|
|
||||||
|
$(AOBJS): %$(OBJEXT): %.S
|
||||||
|
$(call ASSEMBLE, $<, $@)
|
||||||
|
|
||||||
|
$(COBJS) $(LINKOBJS): %$(OBJEXT): %.c
|
||||||
|
$(call COMPILE, $<, $@)
|
||||||
|
|
||||||
|
libboard$(LIBEXT): $(OBJS)
|
||||||
|
$(call ARCHIVE, $@, $(OBJS))
|
||||||
|
|
||||||
|
.depend: Makefile $(SRCS)
|
||||||
|
$(Q) $(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||||
|
$(Q) touch $@
|
||||||
|
|
||||||
|
depend: .depend
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(call DELFILE, libboard$(LIBEXT))
|
||||||
|
$(call CLEAN)
|
||||||
|
|
||||||
|
distclean: clean
|
||||||
|
$(call DELFILE, Make.dep)
|
||||||
|
$(call DELFILE, .depend)
|
||||||
|
|
||||||
|
-include Make.dep
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
/************************************************************************************
|
||||||
|
* configs/stm32vldiscovery/src/stm32_boot.c
|
||||||
|
*
|
||||||
|
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||||
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
* Freddie Chopin <freddie_chopin@op.pl>
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||||
|
* used to endorse or promote products derived from this software
|
||||||
|
* without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
************************************************************************************/
|
||||||
|
|
||||||
|
/************************************************************************************
|
||||||
|
* Included Files
|
||||||
|
************************************************************************************/
|
||||||
|
|
||||||
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <debug.h>
|
||||||
|
|
||||||
|
#include <arch/board/board.h>
|
||||||
|
|
||||||
|
#include "up_arch.h"
|
||||||
|
#include "stm32vldiscovery.h"
|
||||||
|
|
||||||
|
/************************************************************************************
|
||||||
|
* Public Functions
|
||||||
|
************************************************************************************/
|
||||||
|
|
||||||
|
/************************************************************************************
|
||||||
|
* Name: stm32_boardinitialize
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* All STM32 architectures must provide the following entry point. This entry point
|
||||||
|
* is called early in the initialization -- after all memory has been configured
|
||||||
|
* and mapped but before any devices have been initialized.
|
||||||
|
*
|
||||||
|
************************************************************************************/
|
||||||
|
|
||||||
|
void stm32_boardinitialize(void)
|
||||||
|
{
|
||||||
|
/* Configure on-board LEDs if LED support has been selected. */
|
||||||
|
|
||||||
|
#ifdef CONFIG_ARCH_LEDS
|
||||||
|
stm32_ledinit();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* configs/stm32vldiscovery/src/stm32_buttons.c
|
||||||
|
*
|
||||||
|
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||||
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
* Freddie Chopin <freddie_chopin@op.pl>
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||||
|
* used to endorse or promote products derived from this software
|
||||||
|
* without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Included Files
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include <arch/board/board.h>
|
||||||
|
#include "stm32vldiscovery.h"
|
||||||
|
|
||||||
|
#ifdef CONFIG_ARCH_BUTTONS
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: up_buttoninit
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* up_buttoninit() must be called to initialize button resources. After
|
||||||
|
* that, up_buttons() may be called to collect the current state of all
|
||||||
|
* buttons or up_irqbutton() may be called to register button interrupt
|
||||||
|
* handlers.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
void up_buttoninit(void)
|
||||||
|
{
|
||||||
|
stm32_configgpio(GPIO_BTN_0); /* Configure the GPIO pins as inputs. */
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: up_buttons
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
uint8_t up_buttons(void)
|
||||||
|
{
|
||||||
|
uint8_t ret = 0;
|
||||||
|
|
||||||
|
ret = (stm32_gpioread(g_buttons[i]) == false ? 1 : 0);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/************************************************************************************
|
||||||
|
* Button support.
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* up_buttoninit() must be called to initialize button resources. After
|
||||||
|
* that, up_buttons() may be called to collect the current state of all
|
||||||
|
* buttons or up_irqbutton() may be called to register button interrupt
|
||||||
|
* handlers.
|
||||||
|
*
|
||||||
|
* After up_buttoninit() has been called, up_buttons() may be called to
|
||||||
|
* collect the state of all buttons. up_buttons() returns an 8-bit bit set
|
||||||
|
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
|
||||||
|
* definitions in board.h for the meaning of each bit.
|
||||||
|
*
|
||||||
|
* up_irqbutton() may be called to register an interrupt handler that will
|
||||||
|
* be called when a button is depressed or released. The ID value is a
|
||||||
|
* button enumeration value that uniquely identifies a button resource. See the
|
||||||
|
* BUTTON_* and JOYSTICK_* definitions in board.h for the meaning of enumeration
|
||||||
|
* value. The previous interrupt handler address is returned (so that it may
|
||||||
|
* restored, if so desired).
|
||||||
|
*
|
||||||
|
************************************************************************************/
|
||||||
|
|
||||||
|
#ifdef CONFIG_ARCH_IRQBUTTONS
|
||||||
|
xcpt_t up_irqbutton(int id, xcpt_t irqhandler)
|
||||||
|
{
|
||||||
|
xcpt_t oldhandler = NULL;
|
||||||
|
|
||||||
|
if (id == 0)
|
||||||
|
oldhandler = stm32_gpiosetevent(GPIO_BTN_0, true, true, true, irqhandler);
|
||||||
|
|
||||||
|
return oldhandler;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif /* CONFIG_ARCH_BUTTONS */
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* configs/stm32vldiscovery/src/stm32_leds.c
|
||||||
|
*
|
||||||
|
* Copyright (C) 2012-2013 Gregory Nutt. All rights reserved.
|
||||||
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
* Freddie Chopin <freddie_chopin@op.pl>
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||||
|
* used to endorse or promote products derived from this software
|
||||||
|
* without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Included Files
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <debug.h>
|
||||||
|
|
||||||
|
#include <arch/board/board.h>
|
||||||
|
#include <nuttx/power/pm.h>
|
||||||
|
|
||||||
|
#include "chip.h"
|
||||||
|
#include "up_arch.h"
|
||||||
|
#include "up_internal.h"
|
||||||
|
#include "stm32.h"
|
||||||
|
#include "stm32vldiscovery.h"
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Pre-processor Definitions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/* CONFIG_DEBUG_LEDS enables debug output from this file (needs CONFIG_DEBUG
|
||||||
|
* with CONFIG_DEBUG_VERBOSE too)
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef CONFIG_DEBUG_LEDS
|
||||||
|
# define leddbg lldbg
|
||||||
|
# define ledvdbg llvdbg
|
||||||
|
#else
|
||||||
|
# define leddbg(x...)
|
||||||
|
# define ledvdbg(x...)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: stm32_ledinit
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef CONFIG_ARCH_LEDS
|
||||||
|
void stm32_ledinit(void)
|
||||||
|
{
|
||||||
|
stm32_configgpio(GPIO_LED1); /* Configure LED1 GPIO for output */
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: up_ledon
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
void up_ledon(int led)
|
||||||
|
{
|
||||||
|
if (led == 1)
|
||||||
|
{
|
||||||
|
stm32_gpiowrite(GPIO_LED1, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: up_ledoff
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
void up_ledoff(int led)
|
||||||
|
{
|
||||||
|
if (led == 0)
|
||||||
|
{
|
||||||
|
stm32_gpiowrite(GPIO_LED1, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* CONFIG_ARCH_LEDS */
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* configs/stm32vldiscovery/src/stm32vldiscovery.h
|
||||||
|
*
|
||||||
|
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||||
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
* Freddie Chopin <freddie_chopin@op.pl>
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||||
|
* used to endorse or promote products derived from this software
|
||||||
|
* without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef __CONFIGS_STM32VL_DISCOVERY_SRC_STM32VLDISCOVERY_H
|
||||||
|
#define __CONFIGS_STM32VL_DISCOVERY_SRC_STM32VLDISCOVERY_H
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* Pre-processor Definitions
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
/* LED - assume it is on PC8 */
|
||||||
|
|
||||||
|
#define GPIO_LED1 (GPIO_OUTPUT | GPIO_CNF_OUTPP | GPIO_MODE_50MHz | \
|
||||||
|
GPIO_OUTPUT_CLEAR | GPIO_PORTC | GPIO_PIN8)
|
||||||
|
|
||||||
|
/* BUTTON - assume it is on PA0 */
|
||||||
|
|
||||||
|
#define MIN_IRQBUTTON BUTTON_0
|
||||||
|
#define MAX_IRQBUTTON BUTTON_0
|
||||||
|
#define NUM_IRQBUTTONS 1
|
||||||
|
|
||||||
|
#define GPIO_BTN_0 (GPIO_INPUT | GPIO_CNF_INFLOAT | GPIO_MODE_INPUT | \
|
||||||
|
GPIO_PORTA | GPIO_PIN0)
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef CONFIG_ARCH_LEDS
|
||||||
|
void stm32_ledinit(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __CONFIGS_STM32VL_DISCOVERY_SRC_STM32VLDISCOVERY_H */
|
||||||
Reference in New Issue
Block a user