diff options
Diffstat (limited to 'nuttx/configs')
-rw-r--r-- | nuttx/configs/lincoln60/include/board.h | 4 | ||||
-rw-r--r-- | nuttx/configs/lpcxpresso-lpc1768/include/board.h | 4 | ||||
-rw-r--r-- | nuttx/configs/mbed/include/board.h | 4 | ||||
-rw-r--r-- | nuttx/configs/nucleus2g/include/board.h | 4 | ||||
-rw-r--r-- | nuttx/configs/nutiny-nuc120/include/Makefile | 0 | ||||
-rw-r--r-- | nuttx/configs/nutiny-nuc120/include/board.h | 40 | ||||
-rw-r--r-- | nuttx/configs/nutiny-nuc120/src/Makefile | 116 | ||||
-rw-r--r-- | nuttx/configs/nutiny-nuc120/src/nuc_boardinitialize.c | 102 | ||||
-rw-r--r-- | nuttx/configs/nutiny-nuc120/src/nuc_led.c | 132 | ||||
-rw-r--r-- | nuttx/configs/nutiny-nuc120/src/nutiny-nuc120.h | 116 | ||||
-rw-r--r-- | nuttx/configs/olimex-lpc1766stk/include/board.h | 4 | ||||
-rw-r--r-- | nuttx/configs/open1788/include/board.h | 69 | ||||
-rwxr-xr-x | nuttx/configs/open1788/scripts/ld.script | 137 |
13 files changed, 591 insertions, 141 deletions
diff --git a/nuttx/configs/lincoln60/include/board.h b/nuttx/configs/lincoln60/include/board.h index b616689ec..ca6aeb7ba 100644 --- a/nuttx/configs/lincoln60/include/board.h +++ b/nuttx/configs/lincoln60/include/board.h @@ -124,8 +124,8 @@ /* FLASH Configuration */ -#undef CONFIG_LP17_FLASH -#define CONFIG_LP17_FLASH 1 +#undef CONFIG_LPC17_FLASH +#define CONFIG_LPC17_FLASH 1 #define BOARD_FLASHCFG_VALUE 0x0000303a /* LED definitions *********************************************************/ diff --git a/nuttx/configs/lpcxpresso-lpc1768/include/board.h b/nuttx/configs/lpcxpresso-lpc1768/include/board.h index 10af5dfc1..086e30c81 100644 --- a/nuttx/configs/lpcxpresso-lpc1768/include/board.h +++ b/nuttx/configs/lpcxpresso-lpc1768/include/board.h @@ -119,8 +119,8 @@ /* FLASH Configuration */ -#undef CONFIG_LP17_FLASH -#define CONFIG_LP17_FLASH 1 +#undef CONFIG_LPC17_FLASH +#define CONFIG_LPC17_FLASH 1 #define BOARD_FLASHCFG_VALUE 0x0000303a /* Ethernet configuration */ diff --git a/nuttx/configs/mbed/include/board.h b/nuttx/configs/mbed/include/board.h index b2bda1f4c..eb35fbc3e 100644 --- a/nuttx/configs/mbed/include/board.h +++ b/nuttx/configs/mbed/include/board.h @@ -119,8 +119,8 @@ /* FLASH Configuration */ -#undef CONFIG_LP17_FLASH -#define CONFIG_LP17_FLASH 1 +#undef CONFIG_LPC17_FLASH +#define CONFIG_LPC17_FLASH 1 #define BOARD_FLASHCFG_VALUE 0x0000303a /* LED definitions ******************************************************************/ diff --git a/nuttx/configs/nucleus2g/include/board.h b/nuttx/configs/nucleus2g/include/board.h index 88fc2164c..7682a5df8 100644 --- a/nuttx/configs/nucleus2g/include/board.h +++ b/nuttx/configs/nucleus2g/include/board.h @@ -119,8 +119,8 @@ /* FLASH Configuration */ -#undef CONFIG_LP17_FLASH -#define CONFIG_LP17_FLASH 1 +#undef CONFIG_LPC17_FLASH +#define CONFIG_LPC17_FLASH 1 #define BOARD_FLASHCFG_VALUE 0x0000303a /* LED definitions ******************************************************************/ diff --git a/nuttx/configs/nutiny-nuc120/include/Makefile b/nuttx/configs/nutiny-nuc120/include/Makefile deleted file mode 100644 index e69de29bb..000000000 --- a/nuttx/configs/nutiny-nuc120/include/Makefile +++ /dev/null diff --git a/nuttx/configs/nutiny-nuc120/include/board.h b/nuttx/configs/nutiny-nuc120/include/board.h index dab279878..276ce5d04 100644 --- a/nuttx/configs/nutiny-nuc120/include/board.h +++ b/nuttx/configs/nutiny-nuc120/include/board.h @@ -34,8 +34,8 @@ * ************************************************************************************/ -#ifndef _BITNO -#define _BITNO +#ifndef __CONFIGS_NUTINY_NUC12_INCLUDE_BOARD_H +#define __CONFIGS_NUTINY_NUC12_INCLUDE_BOARD_H /************************************************************************************ * Included Files @@ -54,18 +54,11 @@ /* LED definitions ******************************************************************/ /* The NuTiny has a single green LED that can be controlled from sofware. This LED - * is connected to PIN17. + * is connected to PIN17. It is pulled high so a low value will illuminate the LED. */ -/* LED index values for use with nuc_setled() */ - -#define BOARD_LED 0 /* Green LED */ #define BOARD_NLEDS 1 -/* LED bits for use with nuc_setleds() */ - -#define BOARD_LED_BIT (1 << BOARD_LED) - /* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the * NuTiny. The following definitions describe how NuttX controls the LEDs: * @@ -80,7 +73,7 @@ * LED_SIGNAL In a signal handler LED might glow * LED_ASSERTION An assertion failed LED ON while handling the assertion * LED_PANIC The system has crashed LED Blinking at 2Hz - * LED_IDLE STM32 is is sleep mode (Optional, not used) + * LED_IDLE NUC1XX is is sleep mode (Optional, not used) */ #define LED_STARTED 0 @@ -106,7 +99,8 @@ #undef EXTERN #if defined(__cplusplus) #define EXTERN extern "C" -extern "C" { +extern "C" +{ #else #define EXTERN extern #endif @@ -118,29 +112,13 @@ extern "C" { * Name: nuc_boardinitialize * * Description: - * All STM32 architectures must provide the following entry point. This entry point + * All NUC1XX 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. * ************************************************************************************/ -EXTERN void nuc_boardinitialize(void); - -/************************************************************************************ - * Name: nuc_ledinit, nuc_setled, and nuc_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 -EXTERN void nuc_ledinit(void); -EXTERN void nuc_setled(int led, bool ledon); -EXTERN void nuc_setleds(uint8_t ledset); -#endif +void nuc_boardinitialize(void); #undef EXTERN #if defined(__cplusplus) @@ -148,4 +126,4 @@ EXTERN void nuc_setleds(uint8_t ledset); #endif #endif /* __ASSEMBLY__ */ -#endif /* _BITNO */ +#endif /* __CONFIGS_NUTINY_NUC12_INCLUDE_BOARD_H */ diff --git a/nuttx/configs/nutiny-nuc120/src/Makefile b/nuttx/configs/nutiny-nuc120/src/Makefile new file mode 100644 index 000000000..7f05612d8 --- /dev/null +++ b/nuttx/configs/nutiny-nuc120/src/Makefile @@ -0,0 +1,116 @@ +############################################################################ +# configs/nutiny-nuc120/src/Makefile +# +# Copyright (C) 2013 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 + +CFLAGS += -I$(TOPDIR)/sched + +ASRCS = +AOBJS = $(ASRCS:.S=$(OBJEXT)) + +CSRCS = nuc_boardinitialize.c + +ifeq ($(CONFIG_HAVE_CXX),y) +CSRCS += nuc_cxxinitialize.c +endif + +ifeq ($(CONFIG_ARCH_LEDS),y) +CSRCS += nuc_led.c +endif + +ifeq ($(CONFIG_NUC1XX_USBD),y) +CSRCS += nuc_usbd.c +endif + +ifeq ($(CONFIG_PWM),y) +CSRCS += nuc_pwm.c +endif + +ifeq ($(CONFIG_QENCODER),y) +CSRCS += nuc_qencoder.c +endif + +ifeq ($(CONFIG_WATCHDOG),y) +CSRCS += nuc_watchdog.c +endif + +ifeq ($(CONFIG_NSH_ARCHINIT),y) +CSRCS += nuc_nsh.c +endif + +COBJS = $(CSRCS:.c=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) +OBJS = $(AOBJS) $(COBJS) + +ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + CFLAGS += -I$(ARCH_SRCDIR)\chip -I$(ARCH_SRCDIR)\common -I$(ARCH_SRCDIR)\armv7-m +else +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 +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 diff --git a/nuttx/configs/nutiny-nuc120/src/nuc_boardinitialize.c b/nuttx/configs/nutiny-nuc120/src/nuc_boardinitialize.c new file mode 100644 index 000000000..490413d3b --- /dev/null +++ b/nuttx/configs/nutiny-nuc120/src/nuc_boardinitialize.c @@ -0,0 +1,102 @@ +/************************************************************************************ + * configs/nutiny-nuc120/src/up_boot.c + * arch/arm/src/board/up_boot.c + * + * Copyright (C) 2013 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 <debug.h> + +#include <arch/board/board.h> + +#include "up_arch.h" +#include "nutiny-nuc120.h" + +/************************************************************************************ + * Definitions + ************************************************************************************/ + +/************************************************************************************ + * Private Functions + ************************************************************************************/ + +/************************************************************************************ + * Public Functions + ************************************************************************************/ + +/************************************************************************************ + * Name: nuc_boardinitialize + * + * Description: + * All NUC1XX 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 nuc_boardinitialize(void) +{ + /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function + * nuc_spiinitialize() has been brought into the link. + */ + +#if defined(CONFIG_NUC1XX_SPI1) || defined(CONFIG_NUC1XX_SPI2) || defined(CONFIG_NUC1XX_SPI3) + if (nuc_spiinitialize) + { + nuc_spiinitialize(); + } +#endif + + /* Initialize USB if the 1) USB device controller is in the configuration and 2) + * disabled, and 3) the weak function nuc_usbinitialize() has been brought + * into the build. Presumeably either CONFIG_USBDEV is also selected. + */ + +#ifdef CONFIG_NUC1XX_USB + if (nuc_usbinitialize) + { + nuc_usbinitialize(); + } +#endif + + /* Configure on-board LED if LED support has been selected. */ + +#ifdef CONFIG_ARCH_LEDS + nuc_ledinit(); +#endif +} diff --git a/nuttx/configs/nutiny-nuc120/src/nuc_led.c b/nuttx/configs/nutiny-nuc120/src/nuc_led.c new file mode 100644 index 000000000..873a116e3 --- /dev/null +++ b/nuttx/configs/nutiny-nuc120/src/nuc_led.c @@ -0,0 +1,132 @@ +/**************************************************************************** + * configs/nutiny-nuc120/src/up_autoleds.c + * arch/arm/src/board/up_autoleds.c + * + * Copyright (C) 2013 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 NuTiny has a single green LED that can be controlled from sofware. + * This LED is connected to PIN17. It is pulled high so a low value will + * illuminate the LED. + * + * If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the + * NuTiny. The following definitions describe how NuttX controls the LEDs: + * + * SYMBOL Meaning LED state + * Initially all LED is OFF + * ------------------- ----------------------- ------------- ------------ + * LED_STARTED NuttX has been started LED ON + * LED_HEAPALLOCATE Heap has been allocated LED ON + * LED_IRQSENABLED Interrupts enabled LED ON + * LED_STACKCREATED Idle stack created LED ON + * LED_INIRQ In an interrupt LED should glow + * LED_SIGNAL In a signal handler LED might glow + * LED_ASSERTION An assertion failed LED ON while handling the assertion + * LED_PANIC The system has crashed LED Blinking at 2Hz + * LED_IDLE NUC1XX is is sleep mode (Optional, not used) + */ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> + +#include <stdint.h> +#include <stdbool.h> +#include <debug.h> + +#include <arch/board/board.h> + +#include "chip.h" +#include "nuc_gpio.h" +#include "nutiny-nuc120.h" + +#ifdef CONFIG_ARCH_LEDS + +/**************************************************************************** + * Definitions + ****************************************************************************/ + +/* Enables debug output from this file (needs CONFIG_DEBUG with + * CONFIG_DEBUG_VERBOSE too) + */ + +#undef LED_DEBUG /* Define to enable debug */ + +#ifdef LED_DEBUG +# define leddbg lldbg +# define ledvdbg llvdbg +#else +# define leddbg(x...) +# define ledvdbg(x...) +#endif + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: up_ledinit + ****************************************************************************/ + +void up_ledinit(void) +{ + nuc_configgpio(GPIO_LED); +} + +/**************************************************************************** + * Name: up_ledon + ****************************************************************************/ + +void up_ledon(int led) +{ + nuc_gpiowrite(GPIO_LED, false); +} + +/**************************************************************************** + * Name: up_ledoff + ****************************************************************************/ + +void up_ledoff(int led) +{ + nuc_gpiowrite(GPIO_LED, true); +} + +#endif /* CONFIG_ARCH_LEDS */ diff --git a/nuttx/configs/nutiny-nuc120/src/nutiny-nuc120.h b/nuttx/configs/nutiny-nuc120/src/nutiny-nuc120.h new file mode 100644 index 000000000..f7f3184bc --- /dev/null +++ b/nuttx/configs/nutiny-nuc120/src/nutiny-nuc120.h @@ -0,0 +1,116 @@ +/**************************************************************************************************** + * configs/nutiny-nuc120/src/nutiny-nuc120.h + * arch/arm/src/board/nutiny-nuc120.n + * + * Copyright (C) 2013 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 __CONFIGS_NUTINY_NUC120_SRC_NUTINY_NUC120_H +#define __CONFIGS_NUTINY_NUC120_SRC_NUTINY_NUC120_H + +/**************************************************************************************************** + * Included Files + ****************************************************************************************************/ + +#include <nuttx/config.h> +#include <nuttx/compiler.h> +#include <stdint.h> + +/**************************************************************************************************** + * Definitions + ****************************************************************************************************/ +/* Configuration ************************************************************************************/ + +/* NuTiny-EVB-120 GPIOs *****************************************************************************/ +/* The NuTiny has a single green LED that can be controlled from sofware. This LED + * is connected to PIN17. It is pulled high so a low value will illuminate the LED. + * + * If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the + * NuTiny. The following definitions describe how NuttX controls the LEDs: + * + * SYMBOL Meaning LED state + * Initially all LED is OFF + * ------------------- ----------------------- ------------- ------------ + * LED_STARTED NuttX has been started LED ON + * LED_HEAPALLOCATE Heap has been allocated LED ON + * LED_IRQSENABLED Interrupts enabled LED ON + * LED_STACKCREATED Idle stack created LED ON + * LED_INIRQ In an interrupt LED should glow + * LED_SIGNAL In a signal handler LED might glow + * LED_ASSERTION An assertion failed LED ON while handling the assertion + * LED_PANIC The system has crashed LED Blinking at 2Hz + * LED_IDLE NUC1XX is is sleep mode (Optional, not used) + */ + +/* Button definitions ***************************************************************/ +/* The NuTiny has no buttons */ + +/**************************************************************************************************** + * Public Types + ****************************************************************************************************/ + +/**************************************************************************************************** + * Public data + ****************************************************************************************************/ + +#ifndef __ASSEMBLY__ + +/**************************************************************************************************** + * Public Functions + ****************************************************************************************************/ + +/**************************************************************************************************** + * Name: nuc_spiinitialize + * + * Description: + * Called to configure SPI chip select GPIO pins for the NuTiny-EVB-120 board. + * + ****************************************************************************************************/ + +void weak_function nuc_spiinitialize(void); + +/**************************************************************************************************** + * Name: nuc_usbinitialize + * + * Description: + * Called from nuc_usbinitialize very early in inialization to setup USB-related + * GPIO pins for the NuTiny-EVB-120 board. + * + ****************************************************************************************************/ + +#ifdef CONFIG_STM32_USB +void weak_function nuc_usbinitialize(void); +#endif + +#endif /* __ASSEMBLY__ */ +#endif /* __CONFIGS_NUTINY_NUC120_SRC_NUTINY_NUC120_H */ + diff --git a/nuttx/configs/olimex-lpc1766stk/include/board.h b/nuttx/configs/olimex-lpc1766stk/include/board.h index 94fd74fee..172ce6cc0 100644 --- a/nuttx/configs/olimex-lpc1766stk/include/board.h +++ b/nuttx/configs/olimex-lpc1766stk/include/board.h @@ -124,8 +124,8 @@ /* FLASH Configuration */ -#undef CONFIG_LP17_FLASH -#define CONFIG_LP17_FLASH 1 +#undef CONFIG_LPC17_FLASH +#define CONFIG_LPC17_FLASH 1 #define BOARD_FLASHCFG_VALUE 0x0000303a /* Ethernet configuration */ diff --git a/nuttx/configs/open1788/include/board.h b/nuttx/configs/open1788/include/board.h index 4f1d83349..f7c848e47 100644 --- a/nuttx/configs/open1788/include/board.h +++ b/nuttx/configs/open1788/include/board.h @@ -57,11 +57,11 @@ * because the including C file may not have that file in its include path. */ -#define BOARD_XTAL_FREQUENCY (12000000) /* XTAL oscillator frequency */ -#define BOARD_OSCCLK_FREQUENCY BOARD_XTAL_FREQUENCY /* Main oscillator frequency */ -#define BOARD_RTCCLK_FREQUENCY (32768) /* RTC oscillator frequency */ -#define BOARD_INTRCOSC_FREQUENCY (4000000) /* Internal RC oscillator frequency */ -#define BOARD_WDTOSC_FREQUENCY (500000) /* WDT oscillator frequency */ +#define BOARD_XTAL_FREQUENCY (12000000) /* XTAL oscillator frequency */ +#define BOARD_OSCCLK_FREQUENCY BOARD_XTAL_FREQUENCY /* Main oscillator frequency */ +#define BOARD_RTCCLK_FREQUENCY (32768) /* RTC oscillator frequency */ +#define BOARD_INTRCOSC_FREQUENCY (4000000) /* Internal RC oscillator frequency */ +#define BOARD_WDTOSC_FREQUENCY (500000) /* WDT oscillator frequency */ /* This is the clock setup we configure for: * @@ -71,6 +71,7 @@ */ #define LPC17_CCLK 120000000 /* 120Mhz */ +#define LPC17_PCLKDIV 2 /* Peripheral clock = LPC17_CCLK/2 */ /* Select the main oscillator as the frequency source. SYSCLK is then the frequency * of the main oscillator. @@ -87,7 +88,7 @@ #define BOARD_CCLKCFG_DIVIDER 6 #define BOARD_CCLKCFG_VALUE ((BOARD_CCLKCFG_DIVIDER-1) << SYSCON_CCLKCFG_CCLKDIV_SHIFT) -/* PLL0. PLL0 is used to generate the CPU clock divider input (PLLCLK). +/* PLL0. PLL0 is used to generate the CPU clock (PLLCLK). * * Source clock: Main oscillator * PLL0 Multiplier value (M): 10 @@ -106,16 +107,17 @@ (((BOARD_PLL0CFG_MSEL-1) << SYSCON_PLLCFG_MSEL_SHIFT) | \ ((BOARD_PLL0CFG_PSEL-1) << SYSCON_PLLCFG_PSEL_SHIFT)) -#ifdef (CONFIG_LPC17_USBHOST || CONFIG_LPC17_USBDEV) /* PLL1 : PLL1 is used to generate clock for the USB */ #undef CONFIG_LPC17_PLL1 - #define CONFIG_LPC17_PLL1 1 - #define BOARD_PLL1CFG_MSEL 4 - #define BOARD_PLL1CFG_PSEL 2 + #define CONFIG_LPC17_PLL1 1 + #define BOARD_PLL1CFG_MSEL 4 + #define BOARD_PLL1CFG_PSEL 2 #define BOARD_PLL1CFG_VALUE \ (((BOARD_PLL1CFG_MSEL-1) << SYSCON_PLLCFG_MSEL_SHIFT) | \ - ((BOARD_PLL1CFG_NSEL-1) << SYSCON_PLLCFG_PSEL_SHIFT)) + ((BOARD_PLL1CFG_PSEL-1) << SYSCON_PLLCFG_PSEL_SHIFT)) + +#if defined(CONFIG_LPC17_USBHOST) || (CONFIG_LPC17_USBDEV) /* USB divider. The output of the PLL is used as the USB clock * @@ -128,8 +130,8 @@ /* FLASH Configuration */ -#undef CONFIG_LP17_FLASH -#define CONFIG_LP17_FLASH 1 +#undef CONFIG_LPC17_FLASH +#define CONFIG_LPC17_FLASH 1 /* Flash access use 6 CPU clocks - Safe for any allowed conditions */ @@ -137,8 +139,7 @@ /* Ethernet configuration */ -//#define ETH_MCFG_CLKSEL_DIV ETH_MCFG_CLKSEL_DIV44 -#define ETH_MCFG_CLKSEL_DIV ETH_MCFG_CLKSEL_DIV20 +#define ETH_MCFG_CLKSEL_DIV ETH_MCFG_CLKSEL_DIV20 /* Set EMC delay values: * @@ -159,15 +160,15 @@ */ #if defined(CONFIG_LPC17_EMC_NAND) || defined(CONFIG_LPC17_EMC_SDRAM) -# define BOARD_CMDDLY 17 -# define BOARD_FBCLKDLY 17 -# define BOARD_CLKOUT0DLY 1 -# define BOARD_CLKOUT1DLY 1 +# define BOARD_CMDDLY 17 +# define BOARD_FBCLKDLY 17 +# define BOARD_CLKOUT0DLY 1 +# define BOARD_CLKOUT1DLY 1 #else -# define BOARD_CMDDLY 1 -# define BOARD_FBCLKDLY 1 -# define BOARD_CLKOUT0DLY 1 -# define BOARD_CLKOUT1DLY 1 +# define BOARD_CMDDLY 1 +# define BOARD_FBCLKDLY 1 +# define BOARD_CLKOUT0DLY 1 +# define BOARD_CLKOUT1DLY 1 #endif /* LED definitions ******************************************************************/ @@ -184,18 +185,18 @@ /* LED index values for use with lpc17_setled() */ -#define BOARD_LED1 0 -#define BOARD_LED2 1 -#define BOARD_LED3 2 -#define BOARD_LED4 3 -#define BOARD_NLEDS 4 +#define BOARD_LED1 0 +#define BOARD_LED2 1 +#define BOARD_LED3 2 +#define BOARD_LED4 3 +#define BOARD_NLEDS 4 /* LED bits for use with lpc17_setleds() */ -#define BOARD_LED1_BIT (1 << BOARD_LED1) -#define BOARD_LED2_BIT (1 << BOARD_LED2) -#define BOARD_LED3_BIT (1 << BOARD_LED3) -#define BOARD_LED4_BIT (1 << BOARD_LED4) +#define BOARD_LED1_BIT (1 << BOARD_LED1) +#define BOARD_LED2_BIT (1 << BOARD_LED2) +#define BOARD_LED3_BIT (1 << BOARD_LED3) +#define BOARD_LED4_BIT (1 << BOARD_LED4) /* If CONFIG_ARCH_LEDs is defined, then NuttX will control the four LEDs * on the WaveShare Open1788K. The following definitions describe how NuttX @@ -256,6 +257,10 @@ /* Alternate pin selections *********************************************************/ +#define GPIO_UART0_TXD GPIO_UART0_TXD_1 +#define GPIO_UART0_RXD GPIO_UART0_RXD_1 + + /************************************************************************************ * Public Types ************************************************************************************/ diff --git a/nuttx/configs/open1788/scripts/ld.script b/nuttx/configs/open1788/scripts/ld.script index a4ca9cf80..8ed9c24c3 100755 --- a/nuttx/configs/open1788/scripts/ld.script +++ b/nuttx/configs/open1788/scripts/ld.script @@ -39,8 +39,9 @@ * 0x10000000 and 32Kb of Peripheral SRAM in two banks, 8Kb at addresses * 0x20000000 bank0 first and 8kb at 0x20020000 at bank0 second. And 16Kb * at 0x20040000 on bank1. - * Here we assume that .data and .bss will all fit - * into the 64Kb CPU SRAM address range. + * + * Here we assume that .data and .bss will all fit into the 64Kb CPU SRAM + * address range. */ MEMORY @@ -55,81 +56,81 @@ OUTPUT_ARCH(arm) 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 + .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 + .init_section : { + _sinit = ABSOLUTE(.); + *(.init_array .init_array.*) + _einit = ABSOLUTE(.); + } > FLASH - .ARM.extab : { - *(.ARM.extab*) - } > FLASH + .ARM.extab : { + *(.ARM.extab*) + } > FLASH - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > FLASH - __exidx_end = ABSOLUTE(.); + __exidx_start = ABSOLUTE(.); + .ARM.exidx : { + *(.ARM.exidx*) + } > FLASH + __exidx_end = ABSOLUTE(.); - _eronly = ABSOLUTE(.); + _eronly = ABSOLUTE(.); - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > SRAM AT > FLASH + .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 - - .psram0 (NOLOAD) : + .bss : { + _sbss = ABSOLUTE(.); + *(.bss .bss.*) + *(.gnu.linkonce.b.*) + *(COMMON) + _ebss = ABSOLUTE(.); + } > SRAM +/* + .psram0 (NOLOAD) : { - *(.psram0) - . = ALIGN(4) - } > PSRAM0 + *(.psram0) + . = ALIGN(4) + } > PSRAM0 - .psram1 (NOLOAD) : + .psram1 (NOLOAD) : { - *(.psram0) - . = ALIGN(4) - } > PSRAM1 - - /* Stabs debugging sections */ + *(.psram1) + . = ALIGN(4) + } > PSRAM1 +*/ + /* 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) } + .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) } } |