mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +08:00
Add support for the Maxim Integrated MAX32660-EVSYS board.
Squashed commit of the following:
arch/arm/src/max326xx and configs/max32660-evsys/nsh/defconfig: Work out some issues related to MAX326xx configuration.
configs/max32660-evsys: Add unverified board support framework.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
<tr align="center" bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<h1><big><font color="#3c34ec"><i>NuttX README Files</i></font></big></h1>
|
||||
<p>Last Updated: October 30, 2018</p>
|
||||
<p>Last Updated: November 17, 2018</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -150,7 +150,9 @@ nuttx/
|
||||
| |- lpcxpresso-lpc54628/
|
||||
| | `- <a href="https://bitbucket.org/nuttx/nuttx/src/master/configs/lpcxpresso-lpc54628/README.txt" target="_blank"><b><i>README.txt</i></b></a>
|
||||
| |- maple/
|
||||
| | `- <a href="https://bitbucket.org/nuttx/nuttx/src/master/configs/maple/README.txt" target="_blank"><b><i>README.txt</i></b></a>
|
||||
| | `- <a href="https://bitbucket.org/nuttx/nuttx/src/master/configs/maple/README.txt" target="_blank"><b><i>README.txt</i></b></a>\
|
||||
| |- max32660-evsys/
|
||||
| | `- <a href="https://bitbucket.org/nuttx/nuttx/src/master/configs/max32660-evsys/README.txt" target="_blank"><b><i>README.txt</i></b></a>
|
||||
| |- mbed/
|
||||
| | `- <a href="https://bitbucket.org/nuttx/nuttx/src/master/configs/mbed/README.txt" target="_blank"><b><i>README.txt</i></b></a>
|
||||
| |- mcb1700/
|
||||
|
||||
@@ -1825,6 +1825,8 @@ nuttx/
|
||||
| | `- README.txt
|
||||
| |- maple/
|
||||
| | `- README.txt
|
||||
| |- max32660-evsys/
|
||||
| | `- README.txt
|
||||
| |- mbed/
|
||||
| | `- README.txt
|
||||
| |- mcb1700/
|
||||
|
||||
@@ -28,7 +28,7 @@ config ARCH_CHIP_MAX32632
|
||||
bool "MAX32632"
|
||||
select ARCH_FAMILY_MAX32630
|
||||
|
||||
config ARCH_CHIP_MAX32632
|
||||
config ARCH_CHIP_MAX32660
|
||||
bool "MAX32660"
|
||||
select ARCH_FAMILY_MAX32660
|
||||
|
||||
@@ -48,6 +48,7 @@ endchoice # MAX326xx Chip Selection
|
||||
config ARCH_FAMILY_MAX32620
|
||||
bool
|
||||
default n
|
||||
select ARCH_CORTEXM4
|
||||
select MAX326XX_HAVE_WWDOG
|
||||
select MAX326XX_HAVE_RWDOG
|
||||
select MAX326XX_HAVE_WAKEUP
|
||||
@@ -73,6 +74,7 @@ config ARCH_FAMILY_MAX32620
|
||||
config ARCH_FAMILY_MAX32630
|
||||
bool
|
||||
default n
|
||||
select ARCH_CORTEXM4
|
||||
select MAX326XX_HAVE_WWDOG
|
||||
select MAX326XX_HAVE_WAKEUP
|
||||
select MAX326XX_HAVE_CRC
|
||||
@@ -94,6 +96,9 @@ config ARCH_FAMILY_MAX32630
|
||||
config ARCH_FAMILY_MAX32660
|
||||
bool
|
||||
default n
|
||||
select ARCH_CORTEXM4
|
||||
select MAX326XX_HAVE_I2CS1
|
||||
select MAX326XX_HAVE_SPIS1
|
||||
select MAX326XX_HAVE_WDOG
|
||||
select MAX326XX_HAVE_TIMER8
|
||||
|
||||
@@ -207,6 +212,8 @@ config MAX326XX_HAVE_UART
|
||||
|
||||
# Peripheral Driver Selections
|
||||
|
||||
menu "MAX32xx Peripheral Selection"
|
||||
|
||||
config MAX326XX_WDOG
|
||||
bool "Watchdog Timer"
|
||||
default n
|
||||
@@ -288,6 +295,7 @@ config MAX326XX_TIMER8
|
||||
config MAX326XX_PTENGINE
|
||||
bool "Pulse Train Engine"
|
||||
default n
|
||||
depends on MAX326XX_HAVE_PTENGINE
|
||||
|
||||
config MAX326XX_SPIM0
|
||||
bool "SPI Master 0"
|
||||
@@ -308,11 +316,13 @@ config MAX326XX_SPIM2
|
||||
config MAX326XX_SPIS0
|
||||
bool "SPI Slave 0"
|
||||
default n
|
||||
depends on !MAX326XX_SPIM0 || !ARCH_FAMILY_MAX32660
|
||||
|
||||
config MAX326XX_SPIS1
|
||||
bool "SPI Slave 1"
|
||||
default n
|
||||
depends on MAX326XX_HAVE_SPIS1
|
||||
depends on !MAX326XX_SPIM1 || !ARCH_FAMILY_MAX32660
|
||||
|
||||
config MAX326XX_SPIXIP
|
||||
bool "SPI XIP"
|
||||
@@ -343,11 +353,13 @@ config MAX326XX_I2CM2
|
||||
config MAX326XX_I2CS0
|
||||
bool "I2C Slave 0"
|
||||
default n
|
||||
depends on !MAX326XX_I2CM0 || !ARCH_FAMILY_MAX32660
|
||||
|
||||
config MAX326XX_I2CS1
|
||||
bool "I2C Slave 1"
|
||||
default n
|
||||
depends on MAX326XX_HAVE_I2CS1
|
||||
depends on !MAX326XX_I2CM1 || !ARCH_FAMILY_MAX32660
|
||||
|
||||
config MAX326XX_UART0
|
||||
bool "UART 0"
|
||||
@@ -383,3 +395,13 @@ config MAX326XX_ADC10
|
||||
bool "10-Bit ADC"
|
||||
default n
|
||||
depends on MAX326XX_HAVE_ADC10
|
||||
|
||||
endmenu # MAX32xx Peripheral Selection
|
||||
|
||||
config MAX326XX_DMA
|
||||
bool "DMA"
|
||||
default n
|
||||
|
||||
config MAX326_GPIOIRQ
|
||||
bool "GPIO Interrupt Support"
|
||||
default n
|
||||
|
||||
@@ -103,7 +103,7 @@ ifeq ($(CONFIG_BUILD_PROTECTED),y)
|
||||
CHIP_CSRCS += max326_userspace.c max326_mpuinit.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MAX326_DMA),y)
|
||||
ifeq ($(CONFIG_MAX326XX_DMA),y)
|
||||
ifeq ($(CONFIG_ARCH_FAMILY_MAX32660),y)
|
||||
CHIP_CSRCS += max32660_dma.c
|
||||
endif
|
||||
@@ -113,7 +113,7 @@ ifneq ($(CONFIG_ARCH_IDLE_CUSTOM),y)
|
||||
CHIP_CSRCS += max326_idle.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MAX326_GPIOIRQ),y)
|
||||
ifeq ($(CONFIG_MAX326XX_GPIOIRQ),y)
|
||||
ifeq ($(CONFIG_ARCH_FAMILY_MAX32660),y)
|
||||
CHIP_CSRCS += max32660_gpioirq.c
|
||||
endif
|
||||
@@ -128,13 +128,13 @@ CHIP_CSRCS += max326_rtc_lowerhalf.c
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MAX326_WDT),y)
|
||||
ifeq ($(CONFIG_MAX326XX_WDT),y)
|
||||
ifeq ($(CONFIG_ARCH_FAMILY_MAX32660),y)
|
||||
CHIP_CSRCS += max32660_wdt.c
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MAX326_RNG),y)
|
||||
ifeq ($(CONFIG_MAX326XX_RNG),y)
|
||||
CHIP_CSRCS += max326_rng.c
|
||||
endif
|
||||
|
||||
|
||||
@@ -412,7 +412,7 @@ void up_irqinitialize(void)
|
||||
putreg32(regval, NVIC_DEMCR);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MAX326_GPIOIRQ
|
||||
#ifdef CONFIG_MAX326XX_GPIOIRQ
|
||||
/* Initialize GPIO interrupts */
|
||||
|
||||
max326_gpio_irqinitialize();
|
||||
|
||||
+17
-3
@@ -446,14 +446,24 @@ config ARCH_BOARD_LPC4370_LINK2
|
||||
NXP LPC4370 Link2 board. This board is based on the
|
||||
LPC4370FET100. The Code Red toolchain is used by default.
|
||||
|
||||
config ARCH_BOARD_MAX32660_EVSYS
|
||||
bool "Maxim Integrated MAX32660-EVSYS"
|
||||
depends on ARCH_CHIP_MAX32660
|
||||
select ARCH_HAVE_LEDS
|
||||
select ARCH_HAVE_BUTTONS
|
||||
select ARCH_HAVE_IRQBUTTONS
|
||||
---help---
|
||||
This option enables support the Maxim Integrated MAX32660-EVSYS
|
||||
board.
|
||||
|
||||
config ARCH_BOARD_MBED
|
||||
bool "mbed LCP1768"
|
||||
depends on ARCH_CHIP_LPC1768
|
||||
select ARCH_HAVE_LEDS
|
||||
---help---
|
||||
The configurations in this directory support the mbed board (http://mbed.org)
|
||||
that features the NXP LPC1768 microcontroller. This OS is also built
|
||||
with the arm-nuttx-elf toolchain*. STATUS: Contributed.
|
||||
This option enables support the mbed board (http://mbed.org)
|
||||
that features the NXP LPC1768 microcontroller. This OS is also
|
||||
built with the arm-nuttx-elf toolchain*. STATUS: Contributed.
|
||||
|
||||
config ARCH_BOARD_MCB1700
|
||||
bool "Keil MCB1700"
|
||||
@@ -1735,6 +1745,7 @@ config ARCH_BOARD
|
||||
default "lpcxpresso-lpc1768" if ARCH_BOARD_LPCXPRESSO
|
||||
default "lpcxpresso-lpc54628" if ARCH_BOARD_LPCXPRESSO_LPC54628
|
||||
default "maple" if ARCH_BOARD_MAPLE
|
||||
default "max32660-evsys" if ARCH_BOARD_MAX32660_EVSYS
|
||||
default "mbed" if ARCH_BOARD_MBED
|
||||
default "mcb1700" if ARCH_BOARD_MCB1700
|
||||
default "mcu123-lpc214x" if ARCH_BOARD_MCU123_LPC214X
|
||||
@@ -2021,6 +2032,9 @@ endif
|
||||
if ARCH_BOARD_MAPLE
|
||||
source "configs/maple/Kconfig"
|
||||
endif
|
||||
if ARCH_BOARD_MAX32660_EVSYS
|
||||
source "configs/max32660-evsys/Kconfig"
|
||||
endif
|
||||
if ARCH_BOARD_MBED
|
||||
source "configs/mbed/Kconfig"
|
||||
endif
|
||||
|
||||
@@ -357,6 +357,10 @@ configs/maple
|
||||
are based on the STM32F103RBT6 chip for the standard version and on the
|
||||
STM32F103CBT6 for the mini version (See http://leaflabs.com/docs/hardware/maple.html)
|
||||
|
||||
configs/max32660-evsys
|
||||
The configurations in this directory support the Maxim Integrated
|
||||
MAX32660-EVSYS board.
|
||||
|
||||
configs/mbed
|
||||
The configurations in this directory support the mbed board (http://mbed.org)
|
||||
that features the NXP LPC1768 microcontroller. This OS is also built
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
#
|
||||
# For a description of the syntax of this configuration file,
|
||||
# see the file kconfig-language.txt in the NuttX tools repository.
|
||||
#
|
||||
|
||||
if ARCH_BOARD_MAX32660_EVSYS
|
||||
|
||||
endif # ARCH_BOARD_MAX32660_EVSYS
|
||||
@@ -0,0 +1,70 @@
|
||||
README
|
||||
======
|
||||
|
||||
This directory holds NuttX board support for the Maxim Integrated
|
||||
MAX32660-EVSYS board. That board features:
|
||||
|
||||
o MAX32660 Microcontroller
|
||||
- Arm Cortex-M4F, 96MHz
|
||||
- 256KB Flash Memory
|
||||
- 96KB SRAM
|
||||
- 16KB Instruction Cache
|
||||
- Two SPIs
|
||||
- Two I2Cs
|
||||
- Two UARTs
|
||||
- 14 GPIOs
|
||||
o DIP Breakout Board
|
||||
- 100mil Pitch Dual Inline Pin Headers
|
||||
- Breadboard Compatible
|
||||
o Integrated Peripherals
|
||||
- Red Indicator LED
|
||||
- User Pushbutton
|
||||
o MAX32625PICO-Based Debug Adapter
|
||||
- CMSIS-DAP SWD Debugger
|
||||
- Virtual UART Console
|
||||
|
||||
Contents
|
||||
========
|
||||
|
||||
o Serial Console
|
||||
o LEDs and Buttons
|
||||
|
||||
Serial Console
|
||||
==============
|
||||
|
||||
A VCOM serial console is available. This is provided by UART1 via pins
|
||||
P0.10 and P0.11.
|
||||
|
||||
LEDs and Buttons
|
||||
================
|
||||
|
||||
LEDs
|
||||
----
|
||||
|
||||
A single red LED is available driven by GPIO P0.13.
|
||||
|
||||
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/sam_autoleds.c. The LED is used to encode
|
||||
OS-related events as follows:
|
||||
|
||||
------------------- ----------------------- ------
|
||||
SYMBOL Meaning LED
|
||||
------------------- ----------------------- ------
|
||||
LED_STARTED NuttX has been started OFF
|
||||
LED_HEAPALLOCATE Heap has been allocated OFF
|
||||
LED_IRQSENABLED Interrupts enabled OFF
|
||||
LED_STACKCREATED Idle stack created ON
|
||||
LED_INIRQ In an interrupt N/C
|
||||
LED_SIGNAL In a signal handler N/C
|
||||
LED_ASSERTION An assertion failed N/C
|
||||
LED_PANIC The system has crashed FLASH
|
||||
|
||||
Thus if the LED is statically on, NuttX has successfully booted and is,
|
||||
apparently, running normally. If the LED is flashing at approximately
|
||||
2Hz, then a fatal error has been detected and the system has halted.
|
||||
|
||||
Buttons
|
||||
-------
|
||||
|
||||
An single button is available on GPIO P0.12 for use by software.
|
||||
@@ -0,0 +1,114 @@
|
||||
/****************************************************************************
|
||||
* configs/max32660-evsys/include/board.h
|
||||
*
|
||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* 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_MAX32660_EVSYS_INCLUDE_BOARD_H
|
||||
#define __CONFIG_MAX32660_EVSYS_INCLUDE_BOARD_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Clocking *****************************************************************/
|
||||
|
||||
/* LED definitions **********************************************************/
|
||||
|
||||
/* The MAX32660-EVSYS board has a single red LED is connected to GPIO P0.13
|
||||
* for general user indication. A low value illuminates the LED.
|
||||
*
|
||||
* If CONFIG_ARCH_LEDS is not defined, then the user can control the LED in
|
||||
* any way. The following definitions are used to access individual LEDs.
|
||||
*/
|
||||
|
||||
/* LED index values for use with board_userled() */
|
||||
|
||||
#define BOARD_LED 0
|
||||
#define BOARD_NLEDS 1
|
||||
|
||||
/* LED bits for use with board_userled_all() */
|
||||
|
||||
#define BOARD_LED_BIT (1 << BOARD_LED)
|
||||
|
||||
/* 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/max326_autoleds.c. The LEDs are used to
|
||||
* encode OS-related events as follows:
|
||||
*
|
||||
* ------------------- ---------------------------- ------
|
||||
* SYMBOL Meaning LED
|
||||
* ------------------- ---------------------------- ------ */
|
||||
|
||||
#define LED_STARTED 0 /* NuttX has been started OFF */
|
||||
#define LED_HEAPALLOCATE 0 /* Heap has been allocated OFF */
|
||||
#define LED_IRQSENABLED 0 /* Interrupts enabled OFF */
|
||||
#define LED_STACKCREATED 1 /* Idle stack created ON */
|
||||
#define LED_INIRQ 2 /* In an interrupt N/C */
|
||||
#define LED_SIGNAL 2 /* In a signal handler N/C */
|
||||
#define LED_ASSERTION 2 /* An assertion failed N/C */
|
||||
#define LED_PANIC 3 /* The system has crashed FLASH */
|
||||
#undef LED_IDLE /* MCU is is sleep mode Not used */
|
||||
|
||||
/* Thus is LED is statically on, NuttX has successfully booted and is,
|
||||
* apparently, running normally. If LED is flashing at approximately
|
||||
* 2Hz, then a fatal error has been detected and the system has halted.
|
||||
*/
|
||||
|
||||
/* Button definitions ***************************************************************/
|
||||
|
||||
/* Buttons
|
||||
*
|
||||
* An single button, SW2, is available on GPIO P0.12 for use by software. A low
|
||||
* value will be sensed when the button is pressed.
|
||||
*
|
||||
* NOTE: There are no pull-up resistors connected to the generic user buttons
|
||||
* so it is necessary to enable the internal pull-up in the SAM E70 to use the
|
||||
* button.
|
||||
*/
|
||||
|
||||
#define BUTTON_SW2 0
|
||||
#define NUM_BUTTONS 1
|
||||
|
||||
#define BUTTON_SW2_BIT (1 << BUTTON_SW2)
|
||||
|
||||
/* Alternate function pin selections ****************************************/
|
||||
|
||||
/* DMA **********************************************************************/
|
||||
|
||||
#endif /* __CONFIG_NUCLEO_F303ZE_INCLUDE_BOARD_H */
|
||||
@@ -0,0 +1,39 @@
|
||||
# CONFIG_NSH_DISABLE_DATE is not set
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="max32660-evsys"
|
||||
CONFIG_ARCH_BOARD_MAX32660_EVSYS=y
|
||||
CONFIG_ARCH_BUTTONS=y
|
||||
CONFIG_ARCH_CHIP_MAX32660=y
|
||||
CONFIG_ARCH_CHIP_MAX326XX=y
|
||||
CONFIG_ARCH_INTERRUPTSTACK=2048
|
||||
CONFIG_ARCH_IRQBUTTONS=y
|
||||
CONFIG_ARCH_STACKDUMP=y
|
||||
CONFIG_ARMV7M_LAZYFPU=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=8192
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_DISABLE_POLL=y
|
||||
CONFIG_EXPERIMENTAL=y
|
||||
CONFIG_FS_PROCFS=y
|
||||
CONFIG_MAX326XX_UART1=y
|
||||
CONFIG_MAX_TASKS=16
|
||||
CONFIG_MAX_WDOGPARMS=2
|
||||
CONFIG_NFILE_DESCRIPTORS=8
|
||||
CONFIG_NFILE_STREAMS=8
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
CONFIG_NSH_BUILTIN_APPS=y
|
||||
CONFIG_NSH_FILEIOSIZE=512
|
||||
CONFIG_NSH_LINELEN=64
|
||||
CONFIG_NSH_READLINE=y
|
||||
CONFIG_PREALLOC_MQ_MSGS=4
|
||||
CONFIG_PREALLOC_TIMERS=4
|
||||
CONFIG_RAM_SIZE=98304
|
||||
CONFIG_RAM_START=0x20000000
|
||||
CONFIG_RR_INTERVAL=200
|
||||
CONFIG_SCHED_HPWORK=y
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
CONFIG_SDCLONE_DISABLE=y
|
||||
CONFIG_START_DAY=17
|
||||
CONFIG_START_MONTH=11
|
||||
CONFIG_SYSTEM_NSH=y
|
||||
CONFIG_UART1_SERIAL_CONSOLE=y
|
||||
CONFIG_USER_ENTRYPOINT="nsh_main"
|
||||
@@ -0,0 +1,125 @@
|
||||
############################################################################
|
||||
# configs/max32660-evsys/scripts/Make.defs
|
||||
#
|
||||
# Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
#
|
||||
# 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 = flash.ld
|
||||
|
||||
ifeq ($(WINTOOL),y)
|
||||
# Windows-native toolchains
|
||||
DIRLINK = $(TOPDIR)/tools/copydir.sh
|
||||
DIRUNLINK = $(TOPDIR)/tools/unlink.sh
|
||||
MKDEP = $(TOPDIR)/tools/mkwindeps.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)}"
|
||||
else
|
||||
# Linux/Cygwin-native toolchain
|
||||
MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT)
|
||||
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
|
||||
STRIP = $(CROSSDEV)strip --strip-unneeded
|
||||
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)
|
||||
endif
|
||||
|
||||
ARCHCFLAGS = -fno-builtin
|
||||
ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -fno-rtti
|
||||
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -fno-strict-aliasing
|
||||
ARCHWARNINGSXX = -Wall -Wshadow -Wundef
|
||||
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
|
||||
|
||||
# Loadable module definitions
|
||||
|
||||
CMODULEFLAGS = $(CFLAGS) -mlong-calls # --target1-abs
|
||||
|
||||
LDMODULEFLAGS = -r -e module_initialize
|
||||
ifeq ($(WINTOOL),y)
|
||||
LDMODULEFLAGS += -T "${shell cygpath -w $(TOPDIR)/libs/libc/modlib/gnu-elf.ld}"
|
||||
else
|
||||
LDMODULEFLAGS += -T $(TOPDIR)/libs/libc/modlib/gnu-elf.ld
|
||||
endif
|
||||
|
||||
ASMEXT = .S
|
||||
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 -Wundef -g -pipe
|
||||
HOSTLDFLAGS =
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
/****************************************************************************
|
||||
* configs/max32660-evsys/scripts/flash.ld
|
||||
*
|
||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* 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 MAX32660 has 256Kb of FLASH beginning at address 0x0000:0000 and
|
||||
* 96Kb of SRAM beginning at 0x2000:0000
|
||||
*/
|
||||
|
||||
MEMORY
|
||||
{
|
||||
flash (rx) : ORIGIN = 0x00000000, LENGTH = 256K
|
||||
sram (rwx) : ORIGIN = 0x20000000, LENGTH = 96K
|
||||
}
|
||||
|
||||
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,61 @@
|
||||
############################################################################
|
||||
# configs/max32660-evsys/src/Makefile
|
||||
#
|
||||
# Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
#
|
||||
# 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 =
|
||||
CSRCS = max326_boot.c
|
||||
|
||||
ifeq ($(CONFIG_LIB_BOARDCTL),y)
|
||||
CSRCS += max326_appinit.c max326_bringup.c
|
||||
else ifeq ($(CONFIG_BOARD_INITIALIZE),y)
|
||||
CSRCS += max326_bringup.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ARCH_LEDS),y)
|
||||
CSRCS += max326_autoleds.c
|
||||
else
|
||||
CSRCS += max326_userleds.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ARCH_BUTTONS),y)
|
||||
CSRCS += max326_buttons.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MAX326XX_HAVE_I2CM),y)
|
||||
CSRCS += max326_spi.c
|
||||
endif
|
||||
|
||||
include $(TOPDIR)/configs/Board.mk
|
||||
@@ -0,0 +1,73 @@
|
||||
/****************************************************************************
|
||||
* configs/max32660-evsys/src/max32660-evsys.h
|
||||
*
|
||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* 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_MAX32660_EVSYS_SRC_MAX32660_EVSYS_H
|
||||
#define __CONFIG_MAX32660_EVSYS_SRC_MAX32660_EVSYS_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: max326_bringup
|
||||
*
|
||||
* Description:
|
||||
* Bring up board features.
|
||||
*
|
||||
* If CONFIG_BOARD_INITIALIZE=y, then this function will be called from
|
||||
* board_initialize().
|
||||
*
|
||||
* If CONFIG_BOARD_INITIALIZE is not selected, but CONFIG_LIB_BOARDCTL=y
|
||||
* then this function will *probably* be called from application logic via
|
||||
* boardctl().
|
||||
*
|
||||
* Otherwise, this function will not be called (which is usually a bad
|
||||
* thing)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int max326_bringup(void);
|
||||
|
||||
#endif /* __CONFIG_NUCLEO_F303ZE_INCLUDE_BOARD_H */
|
||||
@@ -0,0 +1,90 @@
|
||||
/****************************************************************************
|
||||
* config/max32660-evsys/src/max326_appinit.c
|
||||
*
|
||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* 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 <sys/types.h>
|
||||
|
||||
#include <nuttx/board.h>
|
||||
|
||||
#include "max32660-evsys.h"
|
||||
|
||||
#ifdef CONFIG_LIB_BOARDCTL
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_app_initialize
|
||||
*
|
||||
* Description:
|
||||
* Perform application specific initialization. This function is never
|
||||
* called directly from application code, but only indirectly via the
|
||||
* (non-standard) boardctl() interface using the command BOARDIOC_INIT.
|
||||
*
|
||||
* 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 initalization logic and the
|
||||
* matching application logic. The value cold 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)
|
||||
{
|
||||
#ifndef CONFIG_BOARD_INITIALIZE
|
||||
/* Perform board initialization */
|
||||
|
||||
return max326_bringup();
|
||||
#else
|
||||
return OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* CONFIG_LIB_BOARDCTL */
|
||||
@@ -0,0 +1,120 @@
|
||||
/****************************************************************************
|
||||
* configs/max32660-evsys/src/max326_autoleds.c
|
||||
*
|
||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* 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 MAX32660-EVSYS board has a single red LED is connected to GPIO P0.13
|
||||
* for general user indication. A low value illuminates the LED.
|
||||
*
|
||||
* 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/max326_autoleds.c. The LEDs are used to
|
||||
* encode OS-related events as follows:
|
||||
*
|
||||
* ------------------- ----------------------- ------
|
||||
* SYMBOL Meaning LED
|
||||
* ------------------- ----------------------- ------
|
||||
*
|
||||
* LED_STARTED 0 NuttX has been started OFF
|
||||
* LED_HEAPALLOCATE 0 Heap has been allocated OFF
|
||||
* LED_IRQSENABLED 0 Interrupts enabled OFF
|
||||
* LED_STACKCREATED 1 Idle stack created ON
|
||||
* LED_INIRQ 2 In an interrupt N/C
|
||||
* LED_SIGNAL 2 In a signal handler N/C
|
||||
* LED_ASSERTION 2 An assertion failed N/C
|
||||
* LED_PANIC 3 The system has crashed FLASH
|
||||
* LED_IDLE MCU is is sleep mode Not used
|
||||
*
|
||||
* Thus is LED is statically on, NuttX has successfully booted and is,
|
||||
* apparently, running normally. If LED is flashing at approximately
|
||||
* 2Hz, then a fatal error has been detected and the system has halted.
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/board.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "max326_gpio.h"
|
||||
#include "max32660-evsys.h"
|
||||
|
||||
#ifdef CONFIG_ARCH_LEDS
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_autoled_initialize
|
||||
****************************************************************************/
|
||||
|
||||
void board_autoled_initialize(void)
|
||||
{
|
||||
/* Configure LED PIOs for output */
|
||||
|
||||
max326_configgpio(GPIO_LED);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_autoled_on
|
||||
****************************************************************************/
|
||||
|
||||
void board_autoled_on(int led)
|
||||
{
|
||||
if (led == 1 || led == 3)
|
||||
{
|
||||
max326_gpiowrite(GPIO_LED, false); /* Low illuminates */
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_autoled_off
|
||||
****************************************************************************/
|
||||
|
||||
void board_autoled_off(int led)
|
||||
{
|
||||
if (led == 3)
|
||||
{
|
||||
max326_gpiowrite(GPIO_LED, true); /* High extinguishes */
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ARCH_LEDS */
|
||||
@@ -0,0 +1,99 @@
|
||||
/****************************************************************************
|
||||
* configs/max32660-evsys/src/max326_boot.c
|
||||
*
|
||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* 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 <assert.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/board.h>
|
||||
#include <nuttx/clock.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "up_arch.h"
|
||||
#include "max326_start.h"
|
||||
#include "max32660-evsys.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: max326_board_initialize
|
||||
*
|
||||
* Description:
|
||||
* All MAX326XX architectures must provide the following entry point. This
|
||||
* entry point is called early in the initialization -- after clocking and
|
||||
* memory have been configured but before caches have been enabled and
|
||||
* before any devices have been initialized.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void max326_board_initialize(void)
|
||||
{
|
||||
#ifdef CONFIG_ARCH_LEDS
|
||||
/* Configure on-board LEDs if LED support has been selected. */
|
||||
|
||||
board_autoled_initialize();
|
||||
#endif
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_initialize
|
||||
*
|
||||
* Description:
|
||||
* If CONFIG_BOARD_INITIALIZE is selected, then an additional
|
||||
* initialization call will be performed in the boot-up sequence to a
|
||||
* function called board_initialize(). board_initialize() will be
|
||||
* called immediately after up_intitialize() is called and just before the
|
||||
* initial application is started. This additional initialization phase
|
||||
* may be used, for example, to initialize board-specific device drivers.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_BOARD_INITIALIZE
|
||||
void board_initialize(void)
|
||||
{
|
||||
/* Perform board initialization */
|
||||
|
||||
(void)max326_bringup();
|
||||
}
|
||||
#endif /* CONFIG_BOARD_INITIALIZE */
|
||||
@@ -0,0 +1,90 @@
|
||||
/****************************************************************************
|
||||
* config/max32660-evsys/src/max326_bringup.c
|
||||
*
|
||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* 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 <sys/mount.h>
|
||||
#include <syslog.h>
|
||||
|
||||
#include "max32660-evsys.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: max326_bringup
|
||||
*
|
||||
* Description:
|
||||
* Bring up board features.
|
||||
*
|
||||
* If CONFIG_BOARD_INITIALIZE=y, then this function will be called from
|
||||
* board_initialize().
|
||||
*
|
||||
* If CONFIG_BOARD_INITIALIZE is not selected, but CONFIG_LIB_BOARDCTL=y
|
||||
* then this function will *probably* be called from application logic via
|
||||
* boardctl().
|
||||
*
|
||||
* Otherwise, this function will not be called (which is usually a bad
|
||||
* thing)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int max326_bringup(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
#ifdef CONFIG_FS_PROCFS
|
||||
/* Mount the procfs file system */
|
||||
|
||||
ret = mount(NULL, "/proc", "procfs", 0, NULL);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Failed to mount procfs at /proc: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* If we got here then perhaps not all initialization was successful, but
|
||||
* at least enough succeeded to bring-up NSH with perhaps reduced
|
||||
* capabilities.
|
||||
*/
|
||||
|
||||
UNUSED(ret);
|
||||
return OK;
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
/****************************************************************************
|
||||
* configs/max32660-evsys/src/max326_userleds.c
|
||||
*
|
||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* 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 "max326_gpio.h"
|
||||
#include "max32660-evsys.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_userled_initialize
|
||||
****************************************************************************/
|
||||
|
||||
void board_userled_initialize(void)
|
||||
{
|
||||
/* Configure LED PIOs for output */
|
||||
|
||||
max326_configgpio(GPIO_LED);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_userled
|
||||
****************************************************************************/
|
||||
|
||||
void board_userled(int led, bool ledon)
|
||||
{
|
||||
if (led == BOARD_LED)
|
||||
{
|
||||
max326_gpiowrite(GPIO_LED, !ledon); /* Low illuminates */
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_userled_all
|
||||
****************************************************************************/
|
||||
|
||||
void board_userled_all(uint8_t ledset)
|
||||
{
|
||||
/* Low illuminates */
|
||||
|
||||
max326_gpiowrite(GPIO_LED, (ledset & BOARD_LED_BIT) == 0));
|
||||
}
|
||||
Reference in New Issue
Block a user