ET-STM32 Stamp: An STM32F103RET6 target for NuttX
This commit is contained in:
parent
6c40185985
commit
9f9ecffe2e
@ -250,6 +250,12 @@ config ARCH_BOARD_ESP32C3_DEVKIT
|
|||||||
The ESP32-C3-DevKitM-1 version contains the ESP32-C3-MINI-1 module and the
|
The ESP32-C3-DevKitM-1 version contains the ESP32-C3-MINI-1 module and the
|
||||||
ESP32-C3-DevKitC-02 version the ESP32-C3-WROOM-02.
|
ESP32-C3-DevKitC-02 version the ESP32-C3-WROOM-02.
|
||||||
|
|
||||||
|
config ARCH_BOARD_ET_STM32_STAMP
|
||||||
|
bool "Futurlec: ET-STM32 Stamp"
|
||||||
|
depends on ARCH_CHIP_STM32F103RE
|
||||||
|
---help---
|
||||||
|
The ET-STM32 Stamp features the STM32F103RET6 (Cortex M3) microcontroller.
|
||||||
|
For board details, see: https://www.futurlec.com/ET-STM32_Stamp.shtml
|
||||||
|
|
||||||
config ARCH_BOARD_EZ80F910200KITG
|
config ARCH_BOARD_EZ80F910200KITG
|
||||||
bool "ZiLOG ez80f910200kitg development kit"
|
bool "ZiLOG ez80f910200kitg development kit"
|
||||||
@ -2285,6 +2291,7 @@ config ARCH_BOARD
|
|||||||
default "esp32-ethernet-kit" if ARCH_BOARD_ESP32_ETHERNETKIT
|
default "esp32-ethernet-kit" if ARCH_BOARD_ESP32_ETHERNETKIT
|
||||||
default "esp32-wrover-kit" if ARCH_BOARD_ESP32_WROVERKIT
|
default "esp32-wrover-kit" if ARCH_BOARD_ESP32_WROVERKIT
|
||||||
default "esp32c3-devkit" if ARCH_BOARD_ESP32C3_DEVKIT
|
default "esp32c3-devkit" if ARCH_BOARD_ESP32C3_DEVKIT
|
||||||
|
default "et-stm32-stamp" if ARCH_BOARD_ET_STM32_STAMP
|
||||||
default "ez80f910200kitg" if ARCH_BOARD_EZ80F910200KITG
|
default "ez80f910200kitg" if ARCH_BOARD_EZ80F910200KITG
|
||||||
default "ez80f910200zco" if ARCH_BOARD_EZ80F910200ZCO
|
default "ez80f910200zco" if ARCH_BOARD_EZ80F910200ZCO
|
||||||
default "fire-stm32v2" if ARCH_BOARD_FIRE_STM32
|
default "fire-stm32v2" if ARCH_BOARD_FIRE_STM32
|
||||||
@ -2884,6 +2891,9 @@ endif
|
|||||||
if ARCH_BOARD_MAPLE
|
if ARCH_BOARD_MAPLE
|
||||||
source "boards/arm/stm32/maple/Kconfig"
|
source "boards/arm/stm32/maple/Kconfig"
|
||||||
endif
|
endif
|
||||||
|
if ARCH_BOARD_ET_STM32_STAMP
|
||||||
|
source "boards/arm/stm32/et-stm32-stamp/Kconfig"
|
||||||
|
endif
|
||||||
if ARCH_BOARD_MIKROE_STM32F4
|
if ARCH_BOARD_MIKROE_STM32F4
|
||||||
source "boards/arm/stm32/mikroe-stm32f4/Kconfig"
|
source "boards/arm/stm32/mikroe-stm32f4/Kconfig"
|
||||||
endif
|
endif
|
||||||
|
26
boards/arm/stm32/et-stm32-stamp/Kconfig
Normal file
26
boards/arm/stm32/et-stm32-stamp/Kconfig
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#
|
||||||
|
# For a description of the syntax of this configuration file,
|
||||||
|
# see the file kconfig-language.txt in the NuttX tools repository.
|
||||||
|
#
|
||||||
|
|
||||||
|
if ARCH_BOARD_ET_STM32_STAMP
|
||||||
|
|
||||||
|
choice
|
||||||
|
prompt "Select board type"
|
||||||
|
default ET_STM32_STAMP if ARCH_CHIP_STM32F103RE
|
||||||
|
---help---
|
||||||
|
Select the board hosting the architecture. You must first select the
|
||||||
|
exact MCU part number, then the boards supporting that part will
|
||||||
|
be available for selection. Use ARCH_BOARD_CUSTOM to create a new
|
||||||
|
board configuration.
|
||||||
|
|
||||||
|
config ET_STM32_STAMP
|
||||||
|
bool "ET-STM32 Stamp"
|
||||||
|
depends on ARCH_CHIP_STM32F103RE
|
||||||
|
---help---
|
||||||
|
This version is the standard ET-STM32 Stamp board from Futurlec, with
|
||||||
|
the STM32F103RET6 microcontroller.
|
||||||
|
|
||||||
|
endchoice
|
||||||
|
|
||||||
|
endif
|
120
boards/arm/stm32/et-stm32-stamp/README.txt
Normal file
120
boards/arm/stm32/et-stm32-stamp/README.txt
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
README
|
||||||
|
======
|
||||||
|
|
||||||
|
This README discusses issues/thoughts unique to NuttX configuration(s) for the
|
||||||
|
ET-STM32 Stamp board from Futurlec (https://www.futurlec.com/ET-STM32_Stamp.shtml).
|
||||||
|
|
||||||
|
Microprocessor: 32-bit ARM Cortex M3 at 72MHz STM32F103RET6
|
||||||
|
Memory: 512 KB Flash and 64 KB SRAM
|
||||||
|
I/O Pins Out: 48
|
||||||
|
ADCs: 16 (at 12-bit resolution)
|
||||||
|
DACs: 2 (at 12-bit resolution)
|
||||||
|
Peripherals: RTC, 4 timers, 2 I2Cs, 3 SPI ports, 1 on-board UART (upto 5 channels)
|
||||||
|
Other: Sleep, stop, and standby modes; serial wire debug and JTAG interfaces
|
||||||
|
|
||||||
|
Please see link below for board specific details:
|
||||||
|
|
||||||
|
https://www.futurlec.com/ET-STM32_Stamp_Technical.shtml
|
||||||
|
|
||||||
|
This configuration supports the ET-STM32 Stamp module.
|
||||||
|
|
||||||
|
Contents
|
||||||
|
========
|
||||||
|
|
||||||
|
- Development Environment
|
||||||
|
- Flashing/Programming
|
||||||
|
- Configurations
|
||||||
|
|
||||||
|
Development Environment
|
||||||
|
=======================
|
||||||
|
|
||||||
|
Either Linux (recommended), Mac or Cygwin on Windows can be used for the development
|
||||||
|
environment. The source has been built only using the GNU (Cortex M) toolchain.
|
||||||
|
Other toolchains will likely cause problems.
|
||||||
|
|
||||||
|
WSL (Windows Subsystem for Linux) was used to develop, compile and test the NuttX
|
||||||
|
build for the ET-STM32 Stamp platform.
|
||||||
|
|
||||||
|
Flashing/Programming
|
||||||
|
====================
|
||||||
|
|
||||||
|
Prerequisites:
|
||||||
|
|
||||||
|
1. The ET-STM32 Stamp module from Futurlec.
|
||||||
|
|
||||||
|
2. An RS232 connection cable such as the one in this link: (Part code: RS232CONN):
|
||||||
|
https://www.futurlec.com/DevBoardAccessories.shtml
|
||||||
|
|
||||||
|
It has a 4-pin connection header on one end and an RS-232 (DB9) female connector on
|
||||||
|
the other. The 4-pin connector can be directly plugged onto the Stamp module.
|
||||||
|
|
||||||
|
3. An RS232 to USB converter cable. Ensure that a suitable driver is installed for
|
||||||
|
the converter cable. When the cable is plugged in (for example), my PC lists the
|
||||||
|
assigned port with this name: "USB-SERIAL CH340 (COM2)".
|
||||||
|
|
||||||
|
Assuming Windows 10, navigate to: This PC -> Manage -> Device Manager -> Ports.
|
||||||
|
|
||||||
|
4. ST's Flash loader demonstrator tool. You can download it from here:
|
||||||
|
https://www.st.com/en/development-tools/flasher-stm32.html
|
||||||
|
|
||||||
|
To install the NuttX firmware (nuttx.bin) on the ET-STM32 Stamp:
|
||||||
|
|
||||||
|
1. First, power the Stamp module with a 3.3 VDC power supply. I made my own
|
||||||
|
Stamp module fixture using a 3.3 VDC switching regulator, a prototype PCB card
|
||||||
|
and some solder.
|
||||||
|
|
||||||
|
2. Insert the RS232CONN into the 4-pin on-board header. The other end should be
|
||||||
|
connected to the USB port of the PC using the RS232-USB converter.
|
||||||
|
|
||||||
|
3. Set the BOOT1 jumper on your board to the ISP position.
|
||||||
|
|
||||||
|
4. Press the BOOT0 switch. The green "BOOT0=1" LED should light up.
|
||||||
|
|
||||||
|
5. Reset the board by pressing on the RESET button.
|
||||||
|
|
||||||
|
6. Using the ST Flash loader demonstrator to download the NuttX binary image.
|
||||||
|
|
||||||
|
7. Wait until programming is completed and press "Finish". Toggle the
|
||||||
|
BOOT0 switch again. Reset the board.
|
||||||
|
|
||||||
|
You will now be presented with the NuttShell (NSH). Enjoy.
|
||||||
|
|
||||||
|
Configurations
|
||||||
|
==============
|
||||||
|
|
||||||
|
Information Common to All Configurations
|
||||||
|
----------------------------------------
|
||||||
|
The ET-STM32 Stamp configuration is maintained in a sub-directory and can be
|
||||||
|
selected as follow:
|
||||||
|
|
||||||
|
tools/configure.sh et-stm32-stamp:<subdir>
|
||||||
|
|
||||||
|
Before building, make sure the PATH environment variable includes the
|
||||||
|
correct path to the directory than holds your toolchain binaries.
|
||||||
|
|
||||||
|
And then build NuttX by simply typing the following. At the conclusion of
|
||||||
|
the make, the nuttx binary will reside in an ELF file called, simply, nuttx.
|
||||||
|
|
||||||
|
make
|
||||||
|
|
||||||
|
The <subdir> that is provided above as an argument to the tools/configure.sh
|
||||||
|
must be in one of the following.
|
||||||
|
|
||||||
|
NOTES:
|
||||||
|
|
||||||
|
1. These configurations use the mconf-based configuration tool. To
|
||||||
|
change any of these configurations using that tool, you should:
|
||||||
|
|
||||||
|
a. Build and install the kconfig-mconf tool. See nuttx/README.txt
|
||||||
|
see additional README.txt files in the NuttX tools repository.
|
||||||
|
|
||||||
|
b. Execute 'make menuconfig' in nuttx/ in order to start the
|
||||||
|
reconfiguration process.
|
||||||
|
|
||||||
|
Configuration Sub-directories
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
nsh:
|
||||||
|
|
||||||
|
This configuration directory provide the basic NuttShell (NSH).
|
||||||
|
A serial console is provided on USART1.
|
38
boards/arm/stm32/et-stm32-stamp/configs/nsh/defconfig
Normal file
38
boards/arm/stm32/et-stm32-stamp/configs/nsh/defconfig
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
#
|
||||||
|
# This file is autogenerated: PLEASE DO NOT EDIT IT.
|
||||||
|
#
|
||||||
|
# You can use "make menuconfig" to make any modifications to the installed .config file.
|
||||||
|
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||||
|
# modifications.
|
||||||
|
#
|
||||||
|
CONFIG_ARCH="arm"
|
||||||
|
CONFIG_ARCH_BOARD="et-stm32-stamp"
|
||||||
|
CONFIG_ARCH_BOARD_ET_STM32_STAMP=y
|
||||||
|
CONFIG_ARCH_CHIP="stm32"
|
||||||
|
CONFIG_ARCH_CHIP_STM32=y
|
||||||
|
CONFIG_ARCH_CHIP_STM32F103RE=y
|
||||||
|
CONFIG_ARCH_STACKDUMP=y
|
||||||
|
CONFIG_BOARD_LOOPSPERMSEC=5483
|
||||||
|
CONFIG_BUILTIN=y
|
||||||
|
CONFIG_DEFAULT_SMALL=y
|
||||||
|
CONFIG_LIB_RAND_ORDER=2
|
||||||
|
CONFIG_MAX_TASKS=16
|
||||||
|
CONFIG_NSH_BUILTIN_APPS=y
|
||||||
|
CONFIG_NSH_FILEIOSIZE=1024
|
||||||
|
CONFIG_NSH_LINELEN=80
|
||||||
|
CONFIG_PREALLOC_TIMERS=4
|
||||||
|
CONFIG_PTHREAD_STACK_DEFAULT=1024
|
||||||
|
CONFIG_RAM_SIZE=20480
|
||||||
|
CONFIG_RAM_START=0x20000000
|
||||||
|
CONFIG_RAW_BINARY=y
|
||||||
|
CONFIG_RR_INTERVAL=200
|
||||||
|
CONFIG_SDCLONE_DISABLE=y
|
||||||
|
CONFIG_START_DAY=23
|
||||||
|
CONFIG_START_MONTH=10
|
||||||
|
CONFIG_START_YEAR=2009
|
||||||
|
CONFIG_STM32_USART1=y
|
||||||
|
CONFIG_SYMTAB_ORDEREDBYNAME=y
|
||||||
|
CONFIG_SYSTEM_NSH=y
|
||||||
|
CONFIG_TASK_NAME_SIZE=0
|
||||||
|
CONFIG_USART1_SERIAL_CONSOLE=y
|
||||||
|
CONFIG_USER_ENTRYPOINT="nsh_main"
|
149
boards/arm/stm32/et-stm32-stamp/include/board.h
Normal file
149
boards/arm/stm32/et-stm32-stamp/include/board.h
Normal file
@ -0,0 +1,149 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* boards/arm/stm32/et-stm32-stamp/include/board.h
|
||||||
|
*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
|
* this work for additional information regarding copyright ownership. The
|
||||||
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance with the
|
||||||
|
* License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
* License for the specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef __BOARDS_ARM_STM32_ET_STM32_STAMP_INCLUDE_BOARD_H
|
||||||
|
#define __BOARDS_ARM_STM32_ET_STM32_STAMP_INCLUDE_BOARD_H
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Included Files
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <nuttx/config.h>
|
||||||
|
#ifndef __ASSEMBLY__
|
||||||
|
# include <stdint.h>
|
||||||
|
#endif
|
||||||
|
#include "stm32_rcc.h"
|
||||||
|
#include "stm32_sdio.h"
|
||||||
|
#include "stm32.h"
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Pre-processor Definitions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/* Clocking *****************************************************************/
|
||||||
|
|
||||||
|
/* On-board crystal frequency is 8MHz (HSE) */
|
||||||
|
|
||||||
|
#define STM32_BOARD_XTAL 8000000ul
|
||||||
|
|
||||||
|
/* PLL source is HSE/1, PLL multipler is 9:
|
||||||
|
* PLL frequency is 8MHz (XTAL) x 9 = 72MHz
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define STM32_CFGR_PLLSRC RCC_CFGR_PLLSRC
|
||||||
|
#define STM32_CFGR_PLLXTPRE 0
|
||||||
|
#define STM32_CFGR_PLLMUL RCC_CFGR_PLLMUL_CLKx9
|
||||||
|
#define STM32_PLL_FREQUENCY (9*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 (72MHz) */
|
||||||
|
|
||||||
|
#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK
|
||||||
|
#define STM32_HCLK_FREQUENCY STM32_PLL_FREQUENCY
|
||||||
|
|
||||||
|
/* APB2 clock (PCLK2) is HCLK (72MHz) */
|
||||||
|
|
||||||
|
#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLK
|
||||||
|
#define STM32_PCLK2_FREQUENCY STM32_HCLK_FREQUENCY
|
||||||
|
|
||||||
|
/* APB2 timers 1 and 8 will receive PCLK2. */
|
||||||
|
|
||||||
|
#define STM32_APB2_TIM1_CLKIN (STM32_PCLK2_FREQUENCY)
|
||||||
|
#define STM32_APB2_TIM8_CLKIN (STM32_PCLK2_FREQUENCY)
|
||||||
|
|
||||||
|
/* APB1 clock (PCLK1) is HCLK/2 (36MHz) */
|
||||||
|
|
||||||
|
#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd2
|
||||||
|
#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2)
|
||||||
|
|
||||||
|
/* APB1 timers 2-7 will be twice PCLK1 */
|
||||||
|
|
||||||
|
#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
||||||
|
#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
||||||
|
#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
||||||
|
#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
||||||
|
#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
||||||
|
#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY)
|
||||||
|
|
||||||
|
/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx
|
||||||
|
* otherwise frequency is 2xAPBx.
|
||||||
|
* Note: TIM1,8 are on APB2, others on APB1
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define BOARD_TIM1_FREQUENCY STM32_HCLK_FREQUENCY
|
||||||
|
#define BOARD_TIM2_FREQUENCY STM32_HCLK_FREQUENCY
|
||||||
|
#define BOARD_TIM3_FREQUENCY STM32_HCLK_FREQUENCY
|
||||||
|
#define BOARD_TIM4_FREQUENCY STM32_HCLK_FREQUENCY
|
||||||
|
#define BOARD_TIM5_FREQUENCY STM32_HCLK_FREQUENCY
|
||||||
|
#define BOARD_TIM6_FREQUENCY STM32_HCLK_FREQUENCY
|
||||||
|
#define BOARD_TIM7_FREQUENCY STM32_HCLK_FREQUENCY
|
||||||
|
#define BOARD_TIM8_FREQUENCY STM32_HCLK_FREQUENCY
|
||||||
|
|
||||||
|
/* SDIO dividers. Note that slower clocking is required when DMA is disabled
|
||||||
|
* in order to avoid RX overrun/TX underrun errors due to delayed responses
|
||||||
|
* to service FIFOs in interrupt driven mode. These values have not been
|
||||||
|
* tuned!!!
|
||||||
|
*
|
||||||
|
* HCLK=72MHz, SDIOCLK=72MHz, SDIO_CK=HCLK/(178+2)=400 KHz
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define SDIO_INIT_CLKDIV (178 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||||
|
|
||||||
|
/* DMA ON: HCLK=72 MHz, SDIOCLK=72MHz, SDIO_CK=HCLK/(2+2)=18 MHz
|
||||||
|
* DMA OFF: HCLK=72 MHz, SDIOCLK=72MHz, SDIO_CK=HCLK/(3+2)=14.4 MHz
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef CONFIG_SDIO_DMA
|
||||||
|
# define SDIO_MMCXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||||
|
#else
|
||||||
|
# define SDIO_MMCXFR_CLKDIV (3 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* DMA ON: HCLK=72 MHz, SDIOCLK=72MHz, SDIO_CK=HCLK/(1+2)=24 MHz
|
||||||
|
* DMA OFF: HCLK=72 MHz, SDIOCLK=72MHz, SDIO_CK=HCLK/(3+2)=14.4 MHz
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef CONFIG_SDIO_DMA
|
||||||
|
# define SDIO_SDXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||||
|
#else
|
||||||
|
# define SDIO_SDXFR_CLKDIV (3 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* LED definitions **********************************************************/
|
||||||
|
|
||||||
|
/* The ET-STM32 Stamp doesn't have an on-board LED. These innocent macros
|
||||||
|
* can still be here.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define LED_STARTED 0 /* No LEDs */
|
||||||
|
#define LED_HEAPALLOCATE 1 /* LED1 on */
|
||||||
|
#define LED_IRQSENABLED 2 /* LED2 on */
|
||||||
|
#define LED_STACKCREATED 3 /* LED1 on */
|
||||||
|
#define LED_INIRQ 4 /* LED1 off */
|
||||||
|
#define LED_SIGNAL 5 /* LED2 on */
|
||||||
|
#define LED_ASSERTION 6 /* LED1 + LED2 */
|
||||||
|
#define LED_PANIC 7 /* LED1 / LED2 blinking */
|
||||||
|
|
||||||
|
#endif /* __BOARDS_ARM_STM32_ET_STM32_STAMP_INCLUDE_BOARD_H */
|
63
boards/arm/stm32/et-stm32-stamp/scripts/Make.defs
Normal file
63
boards/arm/stm32/et-stm32-stamp/scripts/Make.defs
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
############################################################################
|
||||||
|
# boards/arm/stm32/et-stm32-stamp/scripts/Make.defs
|
||||||
|
#
|
||||||
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
# contributor license agreements. See the NOTICE file distributed with
|
||||||
|
# this work for additional information regarding copyright ownership. The
|
||||||
|
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||||
|
# "License"); you may not use this file except in compliance with the
|
||||||
|
# License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
#
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
include $(TOPDIR)/.config
|
||||||
|
include $(TOPDIR)/tools/Config.mk
|
||||||
|
include $(TOPDIR)/arch/arm/src/armv7-m/Toolchain.defs
|
||||||
|
|
||||||
|
LDSCRIPT = ld.script
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
|
||||||
|
ARCHSCRIPT = -T "${shell cygpath -w $(BOARD_DIR)$(DELIM)scripts$(DELIM)$(LDSCRIPT)}"
|
||||||
|
else
|
||||||
|
ARCHSCRIPT = -T$(BOARD_DIR)$(DELIM)scripts$(DELIM)$(LDSCRIPT)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_DEBUG_NOOPT),y)
|
||||||
|
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||||
|
ARCHOPTIMIZATION += -g
|
||||||
|
endif
|
||||||
|
|
||||||
|
ARCHCFLAGS = -fno-builtin
|
||||||
|
ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new
|
||||||
|
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||||
|
ARCHWARNINGSXX = -Wall -Wshadow -Wundef
|
||||||
|
ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
|
||||||
|
|
||||||
|
CFLAGS := $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
|
||||||
|
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
|
||||||
|
CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
|
||||||
|
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
|
||||||
|
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
|
||||||
|
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
|
||||||
|
|
||||||
|
ifneq ($(CROSSDEV),arm-nuttx-elf-)
|
||||||
|
LDFLAGS += -nostartfiles -nodefaultlibs
|
||||||
|
endif
|
||||||
|
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||||
|
LDFLAGS += -g
|
||||||
|
endif
|
108
boards/arm/stm32/et-stm32-stamp/scripts/ld.script
Normal file
108
boards/arm/stm32/et-stm32-stamp/scripts/ld.script
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* boards/arm/stm32/et-stm32-stamp/scripts/ld.script
|
||||||
|
*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
|
* this work for additional information regarding copyright ownership. The
|
||||||
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance with the
|
||||||
|
* License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
* License for the specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/* The STM32F103RE has 512Kb of FLASH beginning at address 0x0800:0000 and
|
||||||
|
* 64Kb of SRAM beginning at address 0x2000:0000. When booting from FLASH,
|
||||||
|
* FLASH memory is aliased to address 0x0000:0000 where the code expects to
|
||||||
|
* begin execution by jumping to the entry point in the 0x0800:0000 address
|
||||||
|
* range.
|
||||||
|
*/
|
||||||
|
|
||||||
|
MEMORY
|
||||||
|
{
|
||||||
|
flash (rx) : ORIGIN = 0x08000000, LENGTH = 512K
|
||||||
|
sram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
|
||||||
|
}
|
||||||
|
|
||||||
|
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 : ALIGN(4) {
|
||||||
|
_sinit = ABSOLUTE(.);
|
||||||
|
*(.init_array .init_array.*)
|
||||||
|
_einit = ABSOLUTE(.);
|
||||||
|
} > flash
|
||||||
|
|
||||||
|
.ARM.extab : ALIGN(4) {
|
||||||
|
*(.ARM.extab*)
|
||||||
|
} > flash
|
||||||
|
|
||||||
|
.ARM.exidx : ALIGN(4) {
|
||||||
|
__exidx_start = ABSOLUTE(.);
|
||||||
|
*(.ARM.exidx*)
|
||||||
|
__exidx_end = ABSOLUTE(.);
|
||||||
|
} > flash
|
||||||
|
|
||||||
|
_eronly = ABSOLUTE(.);
|
||||||
|
|
||||||
|
/* The STM32F103RET6 has 64Kb of SRAM beginning at the following address */
|
||||||
|
|
||||||
|
.data : ALIGN(4) {
|
||||||
|
_sdata = ABSOLUTE(.);
|
||||||
|
*(.data .data.*)
|
||||||
|
*(.gnu.linkonce.d.*)
|
||||||
|
CONSTRUCTORS
|
||||||
|
. = ALIGN(4);
|
||||||
|
_edata = ABSOLUTE(.);
|
||||||
|
} > sram AT > flash
|
||||||
|
|
||||||
|
.bss : ALIGN(4) {
|
||||||
|
_sbss = ABSOLUTE(.);
|
||||||
|
*(.bss .bss.*)
|
||||||
|
*(.gnu.linkonce.b.*)
|
||||||
|
*(COMMON)
|
||||||
|
. = ALIGN(4);
|
||||||
|
_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) }
|
||||||
|
}
|
40
boards/arm/stm32/et-stm32-stamp/src/Make.defs
Normal file
40
boards/arm/stm32/et-stm32-stamp/src/Make.defs
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
############################################################################
|
||||||
|
# boards/arm/stm32/et-stm32-stamp/src/Make.defs
|
||||||
|
#
|
||||||
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
# contributor license agreements. See the NOTICE file distributed with
|
||||||
|
# this work for additional information regarding copyright ownership. The
|
||||||
|
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||||
|
# "License"); you may not use this file except in compliance with the
|
||||||
|
# License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
#
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
include $(TOPDIR)/Make.defs
|
||||||
|
|
||||||
|
CSRCS = stm32_boot.c
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_LIB_BOARDCTL),y)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_INPUT),y)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_USBMSC),y)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_LIB_BOARDCTL),y)
|
||||||
|
CSRCS += stm32_appinit.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
DEPPATH += --dep-path board
|
||||||
|
VPATH += :board
|
||||||
|
CFLAGS += $(shell $(INCDIR) "$(CC)" $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board)
|
57
boards/arm/stm32/et-stm32-stamp/src/et-stm32-stamp.h
Normal file
57
boards/arm/stm32/et-stm32-stamp/src/et-stm32-stamp.h
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* boards/arm/stm32/et-stm32-stamp/src/et-stm32-stamp.h
|
||||||
|
*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
|
* this work for additional information regarding copyright ownership. The
|
||||||
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance with the
|
||||||
|
* License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
* License for the specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef __BOARDS_ARM_STM32_ET_STM32_STAMP_SRC_ET_STM32_STAMP_H
|
||||||
|
#define __BOARDS_ARM_STM32_ET_STM32_STAMP_SRC_ET_STM32_STAMP_H
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Included Files
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <nuttx/config.h>
|
||||||
|
#include <nuttx/compiler.h>
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include <arch/stm32/chip.h>
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Pre-processor Definitions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/* The ET-STM32 Stamp target doesn't have any configurable LEDs OR buttons.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Types
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Data
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Functions Definitions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#endif /* __ASSEMBLY__ */
|
||||||
|
#endif /* __BOARDS_ARM_STM32_ET_STM32_STAMP_SRC_ET_STM32_STAMP_H */
|
63
boards/arm/stm32/et-stm32-stamp/src/stm32_appinit.c
Normal file
63
boards/arm/stm32/et-stm32-stamp/src/stm32_appinit.c
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* boards/arm/stm32/et-stm32-stamp/src/stm32_appinit.c
|
||||||
|
*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
|
* this work for additional information regarding copyright ownership. The
|
||||||
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance with the
|
||||||
|
* License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
* License for the specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Included Files
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#include <nuttx/board.h>
|
||||||
|
|
||||||
|
#include "et-stm32-stamp.h"
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: board_app_initialize
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Perform architecture specific initialization
|
||||||
|
*
|
||||||
|
* Input Parameters:
|
||||||
|
* arg - The boardctl() argument is passed to the board_app_initialize()
|
||||||
|
* implementation without modification. The argument has no
|
||||||
|
* meaning to NuttX; the meaning of the argument is a contract
|
||||||
|
* between the board-specific initialization logic and the
|
||||||
|
* matching application logic. The value could be such things as a
|
||||||
|
* mode enumeration value, a set of DIP switch switch settings, a
|
||||||
|
* pointer to configuration data read from a file or serial FLASH,
|
||||||
|
* or whatever you would like to do with it. Every implementation
|
||||||
|
* should accept zero/NULL as a default configuration.
|
||||||
|
*
|
||||||
|
* Returned Value:
|
||||||
|
* Zero (OK) is returned on success; a negated errno value is returned on
|
||||||
|
* any failure to indicate the nature of the failure.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
int board_app_initialize(uintptr_t arg)
|
||||||
|
{
|
||||||
|
return OK;
|
||||||
|
}
|
61
boards/arm/stm32/et-stm32-stamp/src/stm32_boot.c
Normal file
61
boards/arm/stm32/et-stm32-stamp/src/stm32_boot.c
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* boards/arm/stm32/et-stm32-stamp/src/stm32_boot.c
|
||||||
|
*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
|
* this work for additional information regarding copyright ownership. The
|
||||||
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance with the
|
||||||
|
* License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
* License for the specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Included Files
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <nuttx/config.h>
|
||||||
|
#include <nuttx/spi/spi.h>
|
||||||
|
#include <debug.h>
|
||||||
|
|
||||||
|
#include <nuttx/board.h>
|
||||||
|
#include <arch/board/board.h>
|
||||||
|
|
||||||
|
#include "arm_arch.h"
|
||||||
|
#include "et-stm32-stamp.h"
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Pre-processor Definitions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Private Data
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* 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)
|
||||||
|
{
|
||||||
|
/* Empty for now. */
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user