Merge remote-tracking branch 'origin/master' into misoc
This commit is contained in:
commit
a8ef1e55e9
@ -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: July 3, 2016</p>
|
||||
<p>Last Updated: November 1, 2016</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -62,6 +62,8 @@ nuttx/
|
||||
| | `- <a href="https://bitbucket.org/nuttx/nuttx/src/master/configs/arduino-due/README.txt" target="_blank"><b><i>README.txt</i></b></a>
|
||||
| |- avr32dev1/
|
||||
| | `- <a href="https://bitbucket.org/nuttx/nuttx/src/master/configs/avr32dev1/README.txt" target="_blank"><b><i>README.txt</i></b></a>
|
||||
| |- bambino-200e/
|
||||
| | `- <a href="https://bitbucket.org/nuttx/nuttx/src/master/configs/bambino-200e/README.txt" target="_blank"><b><i>README.txt</i></b></a>
|
||||
| |- c5471evm/
|
||||
| | `- <a href="https://bitbucket.org/nuttx/nuttx/src/master/configs/c5471evm/README.txt" target="_blank"><b><i>README.txt</i></b></a>
|
||||
| |- cc3200-launchpad/
|
||||
|
@ -987,7 +987,7 @@ Native Windows Build
|
||||
The windows native build logic initiated if CONFIG_WINDOWS_NATIVE=y is
|
||||
defined in the NuttX configuration file:
|
||||
|
||||
|
||||
|
||||
This build:
|
||||
|
||||
- Uses all Windows style paths
|
||||
@ -1279,6 +1279,8 @@ nuttx/
|
||||
| | `- README.txt
|
||||
| |- avr32dev1/
|
||||
| | `- README.txt
|
||||
| |- bambino-200e/
|
||||
| | `- README.txt
|
||||
| |- c5471evm/
|
||||
| | `- README.txt
|
||||
| |- cc3200-launchpad/
|
||||
|
@ -81,7 +81,11 @@
|
||||
#define WRITE_TX0 0x00
|
||||
#define WRITE_TX1 0xFF
|
||||
|
||||
#define PIN_OPENDRAIN(GPIO) ((GPIO) | GPIO_OPENDRAIN)
|
||||
#define PIN_OPENDRAIN(GPIO) ((GPIO) | GPIO_CNF_OUTOD)
|
||||
|
||||
#if defined(CONFIG_STM32_STM32F10XX)
|
||||
# define USART_CR3_ONEBIT (0)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
@ -568,13 +572,13 @@ static void stm32_1wire_set_apb_clock(struct stm32_1wire_priv_s *priv,
|
||||
regaddr = STM32_RCC_APB1ENR;
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_STM32_UART4
|
||||
#ifdef CONFIG_STM32_UART4_1WIREDRIVER
|
||||
case STM32_UART4_BASE:
|
||||
rcc_en = RCC_APB1ENR_UART4EN;
|
||||
regaddr = STM32_RCC_APB1ENR;
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_STM32_UART5
|
||||
#ifdef CONFIG_STM32_UART5_1WIREDRIVER
|
||||
case STM32_UART5_BASE:
|
||||
rcc_en = RCC_APB1ENR_UART5EN;
|
||||
regaddr = STM32_RCC_APB1ENR;
|
||||
@ -586,13 +590,13 @@ static void stm32_1wire_set_apb_clock(struct stm32_1wire_priv_s *priv,
|
||||
regaddr = STM32_RCC_APB2ENR;
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_STM32_UART7
|
||||
#ifdef CONFIG_STM32_UART7_1WIREDRIVER
|
||||
case STM32_UART7_BASE:
|
||||
rcc_en = RCC_APB1ENR_UART7EN;
|
||||
regaddr = STM32_RCC_APB1ENR;
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_STM32_UART8
|
||||
#ifdef CONFIG_STM32_UART8_1WIREDRIVER
|
||||
case STM32_UART8_BASE:
|
||||
rcc_en = RCC_APB1ENR_UART8EN;
|
||||
regaddr = STM32_RCC_APB1ENR;
|
||||
|
@ -318,6 +318,15 @@ config ARCH_BOARD_LPCXPRESSO
|
||||
Embedded Artists base board with NXP LPCExpresso LPC1768. This board
|
||||
is based on the NXP LPC1768. The Code Red toolchain is used by default.
|
||||
|
||||
config ARCH_BOARD_BAMBINO_200E
|
||||
bool "Micromint Bambino 200E"
|
||||
depends on ARCH_CHIP_LPC4330FBD144
|
||||
select ARCH_HAVE_LEDS
|
||||
select ARCH_HAVE_BUTTONS
|
||||
select ARCH_HAVE_IRQBUTTONS
|
||||
---help---
|
||||
Micromint Bambino board. This board is based on the LPC4330FBD144.
|
||||
|
||||
config ARCH_BOARD_LPC4330_XPLORER
|
||||
bool "NXG LPC4330-Xplorer"
|
||||
depends on ARCH_CHIP_LPC4330FET100
|
||||
@ -1381,6 +1390,7 @@ config ARCH_BOARD
|
||||
default "arduino-mega2560" if ARCH_BOARD_ARDUINO_MEGA2560
|
||||
default "arduino-due" if ARCH_BOARD_ARDUINO_DUE
|
||||
default "avr32dev1" if ARCH_BOARD_AVR32DEV1
|
||||
default "bambino-200e" if ARCH_BOARD_BAMBINO_200E
|
||||
default "c5471evm" if ARCH_BOARD_C5471EVM
|
||||
default "cloudctrl" if ARCH_BOARD_CLOUDCTRL
|
||||
default "compal_e86" if ARCH_BOARD_COMPALE86
|
||||
@ -1555,6 +1565,9 @@ endif
|
||||
if ARCH_BOARD_AVR32DEV1
|
||||
source "configs/avr32dev1/Kconfig"
|
||||
endif
|
||||
if ARCH_BOARD_BAMBINO_200E
|
||||
source "configs/bambino-200e/Kconfig"
|
||||
endif
|
||||
if ARCH_BOARD_C5471EVM
|
||||
source "configs/c5471evm/Kconfig"
|
||||
endif
|
||||
|
@ -191,6 +191,9 @@ configs/avr32dev1
|
||||
Atmel website. STATUS: This port is functional but very basic. There
|
||||
are configurations for NSH and the OS test.
|
||||
|
||||
configs/bambino-200e
|
||||
Micromint Bambino board. This board is based on the LPC4330FBD144.
|
||||
|
||||
configs/c5471evm
|
||||
This is a port to the Spectrum Digital C5471 evaluation board. The
|
||||
TMS320C5471 is a dual core processor from TI with an ARM7TDMI general
|
||||
|
7
configs/bambino-200e/Kconfig
Normal file
7
configs/bambino-200e/Kconfig
Normal file
@ -0,0 +1,7 @@
|
||||
#
|
||||
# For a description of the syntax of this configuration file,
|
||||
# see the file kconfig-language.txt in the NuttX tools repository.
|
||||
#
|
||||
|
||||
if ARCH_BOARD_BAMBINO_200E
|
||||
endif
|
453
configs/bambino-200e/README.txt
Normal file
453
configs/bambino-200e/README.txt
Normal file
@ -0,0 +1,453 @@
|
||||
README
|
||||
======
|
||||
|
||||
README for NuttX port to the "Bambino 200E" board from Micromint USA
|
||||
featuring the NXP LPC4330FBD144 MCU
|
||||
|
||||
Contents
|
||||
========
|
||||
|
||||
- Bambino 200E board
|
||||
- Status
|
||||
- Serial Console
|
||||
- FPU
|
||||
- Bambino-200e Configuration Options
|
||||
- Configurations
|
||||
|
||||
Bambino 200E board
|
||||
=====================
|
||||
|
||||
Memory Map
|
||||
----------
|
||||
|
||||
Block Start Length
|
||||
Name Address
|
||||
--------------------- ---------- ------
|
||||
RAM 0x10000000 128K
|
||||
RAM2 0x10080000 72K
|
||||
RAMAHB 0x20000000 32K
|
||||
RAMAHB2 0x20008000 16K
|
||||
RAMAHB3 0x2000c000 16K
|
||||
SPIFI flash 0x1e000000 4096K
|
||||
|
||||
GPIO Usage:
|
||||
-----------
|
||||
|
||||
GPIO PIN SIGNAL NAME
|
||||
-------------------------------- ------- --------------
|
||||
gpio3[7] - LED1 101 GPIO3[7]
|
||||
gpio5[5] - LED2 91 GPIO5[5]
|
||||
gpio0[7] - BTN1 96 GPIO0[7]
|
||||
|
||||
Console
|
||||
-------
|
||||
|
||||
The Bambino 200E default console is the UART1 on Gadgeteer Sockets 5 (U).
|
||||
|
||||
Status
|
||||
======
|
||||
|
||||
Many drivers are working (USB0 Device, Ethernet, etc), but many drivers are
|
||||
missing.
|
||||
|
||||
Development Environment
|
||||
=======================
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment.
|
||||
|
||||
Serial Console
|
||||
==============
|
||||
|
||||
The LPC4330 Xplorer does not have RS-232 drivers or serial connectors on board.
|
||||
USART0 and UART1 are available on J8 as follows:
|
||||
|
||||
------ ------ -----------------------
|
||||
SIGNAL J8 PIN LPC4330FET100 PIN
|
||||
(TFBGA100 package)
|
||||
------ ------ -----------------------
|
||||
U0_TXD pin 9 F6 P6_4 U0_TXD=Alt 2
|
||||
U0_RXD pin 10 F9 P6_5 U0_RXD=Alt 2
|
||||
U1_TXD pin 13 H8 P1_13 U1_TXD=Alt 1
|
||||
U1_RXD pin 14 J8 P1_14 U1_RXD=Alt 1
|
||||
------ ------ -----------------------
|
||||
|
||||
GND is available on J8 pin 1
|
||||
5V is available on J8 pin 2
|
||||
VBAT is available on J8 pin 3
|
||||
|
||||
FPU
|
||||
===
|
||||
|
||||
FPU Configuration Options
|
||||
-------------------------
|
||||
|
||||
There are two version of the FPU support built into the most NuttX Cortex-M4
|
||||
ports. The current LPC43xx port support only one of these options, the "Non-
|
||||
Lazy Floating Point Register Save". As a consequence, CONFIG_ARMV7M_CMNVECTOR
|
||||
must be defined in *all* LPC43xx configuration files.
|
||||
|
||||
1. Lazy Floating Point Register Save.
|
||||
|
||||
This is an untested implementation that saves and restores FPU registers
|
||||
only on context switches. This means: (1) floating point registers are
|
||||
not stored on each context switch and, hence, possibly better interrupt
|
||||
performance. But, (2) since floating point registers are not saved,
|
||||
you cannot use floating point operations within interrupt handlers.
|
||||
|
||||
This logic can be enabled by simply adding the following to your .config
|
||||
file:
|
||||
|
||||
CONFIG_ARCH_FPU=y
|
||||
|
||||
2. Non-Lazy Floating Point Register Save
|
||||
|
||||
Mike Smith has contributed an extensive re-write of the ARMv7-M exception
|
||||
handling logic. This includes verified support for the FPU. These changes
|
||||
have not yet been incorporated into the mainline and are still considered
|
||||
experimental. These FPU logic can be enabled with:
|
||||
|
||||
CONFIG_ARCH_FPU=y
|
||||
CONFIG_ARMV7M_CMNVECTOR=y
|
||||
|
||||
You will probably also changes to the ld.script in if this option is selected.
|
||||
This should work:
|
||||
|
||||
-ENTRY(_stext)
|
||||
+ENTRY(__start) /* Treat __start as the anchor for dead code stripping */
|
||||
+EXTERN(_vectors) /* Force the vectors to be included in the output */
|
||||
|
||||
CFLAGS
|
||||
------
|
||||
|
||||
Only the recent toolchains have built-in support for the Cortex-M4 FPU. You will see
|
||||
the following lines in each Make.defs file:
|
||||
|
||||
ifeq ($(CONFIG_ARCH_FPU),y)
|
||||
ARCHCPUFLAGS = -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard
|
||||
else
|
||||
ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
endif
|
||||
|
||||
Configuration Changes
|
||||
---------------------
|
||||
|
||||
Below are all of the configuration changes that I had to make to configs/stm3240g-eval/nsh2
|
||||
in order to successfully build NuttX using the Atollic toolchain WITH FPU support:
|
||||
|
||||
-CONFIG_ARCH_FPU=n : Enable FPU support
|
||||
+CONFIG_ARCH_FPU=y
|
||||
|
||||
-CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : Disable the CodeSourcery toolchain
|
||||
+CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=n
|
||||
|
||||
-CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC=n : Enable the Atollic toolchains
|
||||
+CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC=y :
|
||||
|
||||
-CONFIG_INTELHEX_BINARY=y : Suppress generation FLASH download formats
|
||||
+CONFIG_INTELHEX_BINARY=n : (Only necessary with the "Lite" version)
|
||||
|
||||
-CONFIG_HAVE_CXX=y : Suppress generation of C++ code
|
||||
+CONFIG_HAVE_CXX=n : (Only necessary with the "Lite" version)
|
||||
|
||||
See the section above on Toolchains, NOTE 2, for explanations for some of
|
||||
the configuration settings. Some of the usual settings are just not supported
|
||||
by the "Lite" version of the Atollic toolchain.
|
||||
|
||||
Bambino-200e Configuration Options
|
||||
==================================
|
||||
|
||||
CONFIG_ARCH - Identifies the arch/ subdirectory. This should
|
||||
be set to:
|
||||
|
||||
CONFIG_ARCH=arm
|
||||
|
||||
CONFIG_ARCH_family - For use in C code:
|
||||
|
||||
CONFIG_ARCH_ARM=y
|
||||
|
||||
CONFIG_ARCH_architecture - For use in C code:
|
||||
|
||||
CONFIG_ARCH_CORTEXM4=y
|
||||
|
||||
CONFIG_ARCH_CHIP - Identifies the arch/*/chip subdirectory
|
||||
|
||||
CONFIG_ARCH_CHIP=lpc43xx
|
||||
|
||||
CONFIG_ARCH_CHIP_name - For use in C code to identify the exact
|
||||
chip:
|
||||
|
||||
CONFIG_ARCH_CHIP_LPC4330=y
|
||||
|
||||
CONFIG_ARCH_BOARD - Identifies the configs subdirectory and
|
||||
hence, the board that supports the particular chip or SoC.
|
||||
|
||||
CONFIG_ARCH_BOARD=bambino-200e (for the Bambino-200e board)
|
||||
|
||||
CONFIG_ARCH_BOARD_name - For use in C code
|
||||
|
||||
CONFIG_ARCH_BOARD_BAMBINO_200E=y
|
||||
|
||||
CONFIG_ARCH_LOOPSPERMSEC - Must be calibrated for correct operation
|
||||
of delay loops
|
||||
|
||||
CONFIG_ENDIAN_BIG - define if big endian (default is little
|
||||
endian)
|
||||
|
||||
CONFIG_RAM_SIZE - Describes the installed DRAM (CPU SRAM in this case):
|
||||
|
||||
CONFIG_RAM_SIZE=(32*1024) (32Kb)
|
||||
|
||||
There is an additional 32Kb of SRAM in AHB SRAM banks 0 and 1.
|
||||
|
||||
CONFIG_RAM_START - The start address of installed DRAM
|
||||
|
||||
CONFIG_RAM_START=0x10000000
|
||||
|
||||
CONFIG_ARCH_FPU - The LPC43xxx supports a floating point unit (FPU)
|
||||
|
||||
CONFIG_ARCH_FPU=y
|
||||
|
||||
CONFIG_LPC43_BOOT_xxx - The startup code needs to know if the code is running
|
||||
from internal FLASH, external FLASH, SPIFI, or SRAM in order to
|
||||
initialize properly. Note that a boot device is not specified for
|
||||
cases where the code is copied into SRAM; those cases are all covered
|
||||
by CONFIG_LPC43_BOOT_SRAM.
|
||||
|
||||
CONFIG_LPC43_BOOT_SRAM=y : Running from SRAM (0x1000:0000)
|
||||
CONFIG_LPC43_BOOT_SPIFI=y : Running from QuadFLASH (0x1400:0000)
|
||||
CONFIG_LPC43_BOOT_FLASHA=y : Running in internal FLASHA (0x1a00:0000)
|
||||
CONFIG_LPC43_BOOT_FLASHB=y : Running in internal FLASHA (0x1b00:0000)
|
||||
CONFIG_LPC43_BOOT_CS0FLASH=y : Running in external FLASH CS0 (0x1c00:0000)
|
||||
CONFIG_LPC43_BOOT_CS1FLASH=y : Running in external FLASH CS1 (0x1d00:0000)
|
||||
CONFIG_LPC43_BOOT_CS2FLASH=y : Running in external FLASH CS2 (0x1e00:0000)
|
||||
CONFIG_LPC43_BOOT_CS3FLASH=y : Running in external FLASH CS3 (0x1f00:0000)
|
||||
|
||||
CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to boards that
|
||||
have LEDs
|
||||
|
||||
CONFIG_ARCH_INTERRUPTSTACK - This architecture supports an interrupt
|
||||
stack. If defined, this symbol is the size of the interrupt
|
||||
stack in bytes. If not defined, the user task stacks will be
|
||||
used during interrupt handling.
|
||||
|
||||
CONFIG_ARCH_STACKDUMP - Do stack dumps after assertions
|
||||
|
||||
CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to board architecture.
|
||||
|
||||
CONFIG_ARCH_CALIBRATION - Enables some build in instrumentation that
|
||||
cause a 100 second delay during boot-up. This 100 second delay
|
||||
serves no purpose other than it allows you to calibratre
|
||||
CONFIG_ARCH_LOOPSPERMSEC. You simply use a stop watch to measure
|
||||
the 100 second delay then adjust CONFIG_ARCH_LOOPSPERMSEC until
|
||||
the delay actually is 100 seconds.
|
||||
|
||||
Individual subsystems can be enabled:
|
||||
|
||||
CONFIG_LPC43_ADC0=y
|
||||
CONFIG_LPC43_ADC1=y
|
||||
CONFIG_LPC43_ATIMER=y
|
||||
CONFIG_LPC43_CAN1=y
|
||||
CONFIG_LPC43_CAN2=y
|
||||
CONFIG_LPC43_DAC=y
|
||||
CONFIG_LPC43_EMC=y
|
||||
CONFIG_LPC43_ETHERNET=y
|
||||
CONFIG_LPC43_EVNTMNTR=y
|
||||
CONFIG_LPC43_GPDMA=y
|
||||
CONFIG_LPC43_I2C0=y
|
||||
CONFIG_LPC43_I2C1=y
|
||||
CONFIG_LPC43_I2S0=y
|
||||
CONFIG_LPC43_I2S1=y
|
||||
CONFIG_LPC43_LCD=y
|
||||
CONFIG_LPC43_MCPWM=y
|
||||
CONFIG_LPC43_QEI=y
|
||||
CONFIG_LPC43_RIT=y
|
||||
CONFIG_LPC43_RTC=y
|
||||
CONFIG_LPC43_SCT=y
|
||||
CONFIG_LPC43_SDMMC=y
|
||||
CONFIG_LPC43_SPI=y
|
||||
CONFIG_LPC43_SPIFI=y
|
||||
CONFIG_LPC43_SSP0=y
|
||||
CONFIG_LPC43_SSP1=y
|
||||
CONFIG_LPC43_TMR0=y
|
||||
CONFIG_LPC43_TMR1=y
|
||||
CONFIG_LPC43_TMR2=y
|
||||
CONFIG_LPC43_TMR3=y
|
||||
CONFIG_LPC43_USART0=y
|
||||
CONFIG_LPC43_UART1=y
|
||||
CONFIG_LPC43_USART2=y
|
||||
CONFIG_LPC43_USART3=y
|
||||
CONFIG_LPC43_USB0=y
|
||||
CONFIG_LPC43_USB1=y
|
||||
CONFIG_LPC43_USB1_ULPI=y
|
||||
CONFIG_LPC43_WWDT=y
|
||||
|
||||
LPC43xx specific U[S]ART device driver settings
|
||||
|
||||
CONFIG_U[S]ARTn_SERIAL_CONSOLE - selects the UARTn for the
|
||||
console and ttys0 (default is the USART0).
|
||||
CONFIG_U[S]ARTn_RXBUFSIZE - Characters are buffered as received.
|
||||
This specific the size of the receive buffer
|
||||
CONFIG_U[S]ARTn_TXBUFSIZE - Characters are buffered before
|
||||
being sent. This specific the size of the transmit buffer
|
||||
CONFIG_U[S]ARTn_BAUD - The configure BAUD of the UART. Must be
|
||||
CONFIG_U[S]ARTn_BITS - The number of bits. Must be either 7 or 8.
|
||||
CONFIG_U[S]ARTn_PARTIY - 0=no parity, 1=odd parity, 2=even parity
|
||||
CONFIG_U[S]ARTn_2STOP - Two stop bits
|
||||
|
||||
CONFIG_USARTn_RS485MODE - Support LPC43xx USART0,2,3 RS485 mode
|
||||
ioctls (TIOCSRS485 and TIOCGRS485) to enable and disable
|
||||
RS-485 mode.
|
||||
|
||||
LPC43xx specific CAN device driver settings. These settings all
|
||||
require CONFIG_CAN:
|
||||
|
||||
CONFIG_CAN_EXTID - Enables support for the 29-bit extended ID. Default
|
||||
Standard 11-bit IDs.
|
||||
CONFIG_CAN1_BAUD - CAN1 BAUD rate. Required if CONFIG_LPC43_CAN1 is defined.
|
||||
CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_LPC43_CAN2 is defined.
|
||||
CONFIG_CAN1_DIVISOR - CAN1 is clocked at CCLK divided by this number.
|
||||
(the CCLK frequency is divided by this number to get the CAN clock).
|
||||
Options = {1,2,4,6}. Default: 4.
|
||||
CONFIG_CAN2_DIVISOR - CAN2 is clocked at CCLK divided by this number.
|
||||
(the CCLK frequency is divided by this number to get the CAN clock).
|
||||
Options = {1,2,4,6}. Default: 4.
|
||||
CONFIG_CAN_TSEG1 - The number of CAN time quanta in segment 1. Default: 6
|
||||
CONFIG_CAN_TSEG2 = the number of CAN time quanta in segment 2. Default: 7
|
||||
|
||||
LPC43xx specific PHY/Ethernet device driver settings. These setting
|
||||
also require CONFIG_NET and CONFIG_LPC43_ETHERNET.
|
||||
|
||||
CONFIG_ETH0_PHY_KS8721 - Selects Micrel KS8721 PHY
|
||||
CONFIG_PHY_AUTONEG - Enable auto-negotion
|
||||
CONFIG_PHY_SPEED100 - Select 100Mbit vs. 10Mbit speed.
|
||||
CONFIG_PHY_FDUPLEX - Select full (vs. half) duplex
|
||||
|
||||
CONFIG_NET_EMACRAM_SIZE - Size of EMAC RAM. Default: 16Kb
|
||||
CONFIG_NET_NTXDESC - Configured number of Tx descriptors. Default: 18
|
||||
CONFIG_NET_NRXDESC - Configured number of Rx descriptors. Default: 18
|
||||
CONFIG_NET_WOL - Enable Wake-up on Lan (not fully implemented).
|
||||
CONFIG_NET_REGDEBUG - Enabled low level register debug. Also needs
|
||||
CONFIG_DEBUG_FEATURES.
|
||||
CONFIG_NET_DUMPPACKET - Dump all received and transmitted packets.
|
||||
Also needs CONFIG_DEBUG_FEATURES.
|
||||
CONFIG_NET_HASH - Enable receipt of near-perfect match frames.
|
||||
|
||||
LPC43xx USB Device Configuration
|
||||
|
||||
CONFIG_LPC43_USBDEV_FRAME_INTERRUPT
|
||||
Handle USB Start-Of-Frame events.
|
||||
Enable reading SOF from interrupt handler vs. simply reading on demand.
|
||||
Probably a bad idea... Unless there is some issue with sampling the SOF
|
||||
from hardware asynchronously.
|
||||
CONFIG_LPC43_USBDEV_EPFAST_INTERRUPT
|
||||
Enable high priority interrupts. I have no idea why you might want to
|
||||
do that
|
||||
CONFIG_LPC43_USBDEV_NDMADESCRIPTORS
|
||||
Number of DMA descriptors to allocate in SRAM.
|
||||
CONFIG_LPC43_USBDEV_DMA
|
||||
Enable lpc17xx-specific DMA support
|
||||
CONFIG_LPC43_USBDEV_NOVBUS
|
||||
Define if the hardware implementation does not support the VBUS signal
|
||||
CONFIG_LPC43_USBDEV_NOLED
|
||||
Define if the hardware implementation does not support the LED output
|
||||
|
||||
LPC43xx USB Host Configuration
|
||||
|
||||
CONFIG_USBHOST_OHCIRAM_SIZE
|
||||
Total size of OHCI RAM (in AHB SRAM Bank 1)
|
||||
CONFIG_USBHOST_NEDS
|
||||
Number of endpoint descriptors
|
||||
CONFIG_USBHOST_NTDS
|
||||
Number of transfer descriptors
|
||||
CONFIG_USBHOST_TDBUFFERS
|
||||
Number of transfer descriptor buffers
|
||||
CONFIG_USBHOST_TDBUFSIZE
|
||||
Size of one transfer descriptor buffer
|
||||
CONFIG_USBHOST_IOBUFSIZE
|
||||
Size of one end-user I/O buffer. This can be zero if the
|
||||
application can guarantee that all end-user I/O buffers
|
||||
reside in AHB SRAM.
|
||||
|
||||
Configurations
|
||||
==============
|
||||
|
||||
Each Bambino-200e configuration is maintained in a sub-directory and can be selected
|
||||
as follow:
|
||||
|
||||
cd tools
|
||||
./configure.sh bambino-200e/<subdir>
|
||||
cd -
|
||||
. ./setenv.sh
|
||||
|
||||
Where <subdir> is one of the following:
|
||||
|
||||
nsh:
|
||||
----
|
||||
This configuration is the NuttShell (NSH) example at examples/nsh/.
|
||||
|
||||
NOTES:
|
||||
|
||||
1. This configuration uses the mconf-based configuration tool. To
|
||||
change this 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.
|
||||
|
||||
2. By default, this project assumes that you are executing directly from
|
||||
SRAM.
|
||||
|
||||
CONFIG_LPC43_BOOT_SRAM=y : Executing in SRAM
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODEREDW=y : Code Red under Windows
|
||||
|
||||
3. To execute from SPIFI, you would need to set:
|
||||
|
||||
CONFIG_LPC43_BOOT_SPIFI=y : Executing from SPIFI
|
||||
CONFIG_RAM_SIZE=(128*1024) : SRAM Bank0 size
|
||||
CONFIG_RAM_START=0x10000000 : SRAM Bank0 base address
|
||||
CONFIG_SPIFI_OFFSET=(512*1024) : SPIFI file system offset
|
||||
|
||||
CONFIG_MM_REGIONS should also be increased if you want to other SRAM banks
|
||||
to the memory pool.
|
||||
|
||||
4. This configuration an also be used create a block device on the SPIFI
|
||||
FLASH. CONFIG_LPC43_SPIFI=y must also be defined to enable SPIFI setup
|
||||
support:
|
||||
|
||||
SPIFI device geometry:
|
||||
|
||||
CONFIG_SPIFI_OFFSET - Offset the beginning of the block driver this many
|
||||
bytes into the device address space. This offset must be an exact
|
||||
multiple of the erase block size (CONFIG_SPIFI_BLKSIZE). Default 0.
|
||||
CONFIG_SPIFI_BLKSIZE - The size of one device erase block. If not defined
|
||||
then the driver will try to determine the correct erase block size by
|
||||
examining that data returned from spifi_initialize (which sometimes
|
||||
seems bad).
|
||||
|
||||
Other SPIFI options
|
||||
|
||||
CONFIG_SPIFI_SECTOR512 - If defined, then the driver will report a more
|
||||
FAT friendly 512 byte sector size and will manage the read-modify-write
|
||||
operations on the larger erase block.
|
||||
CONFIG_SPIFI_READONLY - Define to support only read-only operations.
|
||||
CONFIG_SPIFI_LIBRARY - Don't use the LPC43xx ROM routines but, instead,
|
||||
use an external library implementation of the SPIFI interface.
|
||||
CONFIG_SPIFI_VERIFY - Verify all spifi_program() operations by reading
|
||||
from the SPI address space after each write.
|
||||
CONFIG_DEBUG_SPIFI_DUMP - Debug option to dump read/write buffers. You
|
||||
probably do not want to enable this unless you want to dig through a
|
||||
*lot* of debug output! Also required CONFIG_DEBUG_FEATURES, CONFIG_DEBUG_INFO,
|
||||
and CONFIG_DEBUG_FS,
|
||||
|
||||
5. In my experience, there were some missing function pointers in the LPC43xx
|
||||
SPIFI ROM routines and the SPIFI configuration could only be built with
|
||||
CONFIG_SPIFI_LIBRARY=y. The SPIFI library is proprietary and cannot be
|
||||
provided within NuttX open source repository; SPIFI library binaries can
|
||||
be found on the lpcware.com website. In this build sceneario, you must
|
||||
also provide the patch to the external SPIFI library be defining the make
|
||||
variable EXTRA_LIBS in the top-level Make.defs file. Good luck!
|
360
configs/bambino-200e/include/board.h
Normal file
360
configs/bambino-200e/include/board.h
Normal file
@ -0,0 +1,360 @@
|
||||
/****************************************************************************
|
||||
* configs/bambino-200e/include/board.h
|
||||
*
|
||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Alan Carvalho de Assis acassis@gmail.com [nuttx] <nuttx@yahoogroups.com>
|
||||
*
|
||||
* 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_BAMBINO_200E_INCLUDE_BOARD_H
|
||||
#define __CONFIG_BAMBINO_200E_INCLUDE_BOARD_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#if defined(CONFIG_ARCH_IRQBUTTONS) && defined(CONFIG_LPC43_GPIO_IRQ)
|
||||
# include <nuttx/irq.h>
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Clocking ****************************************************************/
|
||||
/* NOTE: The following definitions require lpc43_cgu.h. It is not included
|
||||
* here because the including C file may not have that file in its include
|
||||
* path.
|
||||
*
|
||||
* The Xplorer board has four crystals on board:
|
||||
*
|
||||
* Y1 - RTC 32.768 MHz oscillator input,
|
||||
* Y2 - 24.576 MHz input to the UDA 1380 audio codec,
|
||||
* Y3 - 12.000 MHz LPC43xx crystal oscillator input
|
||||
* Y4 - 50 MHz input for Ethernet
|
||||
*/
|
||||
|
||||
#define BOARD_XTAL_FREQUENCY (12000000) /* XTAL oscillator frequency (Y3) */
|
||||
#define BOARD_RTCCLK_FREQUENCY (32768) /* RTC oscillator frequency (Y1) */
|
||||
#define BOARD_INTRCOSC_FREQUENCY (4000000) /* Internal RC oscillator frequency */
|
||||
|
||||
/* Integer and direct modes are supported:
|
||||
*
|
||||
* In integer mode (Fclkout < 156000000):
|
||||
* Fclkin = BOARD_XTAL_FREQUENCY
|
||||
* Fclkout = Msel * FClkin / Nsel
|
||||
* Fcco = 2 * Psel * Fclkout
|
||||
* In direct mode (Fclkout > 156000000):
|
||||
* Fclkin = BOARD_XTAL_FREQUENCY
|
||||
* Fclkout = Msel * FClkin / Nsel
|
||||
* Fcco = Fclkout
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_LPC43_72MHz
|
||||
|
||||
/* NOTE: At 72MHz, the calibrated value of CONFIG_BOARD_LOOPSPERMSEC was
|
||||
* determined to be:
|
||||
*
|
||||
* CONFIG_BOARD_LOOPSPERMSEC=7191
|
||||
*
|
||||
* executing from SRAM.
|
||||
*/
|
||||
|
||||
/* Final clocking (Integer mode with no ramp-up)
|
||||
*
|
||||
* Fclkout = 6 * 12MHz / 1 = 72MHz
|
||||
* Fcco = 2 * 2 * 72MHz = 216MHz
|
||||
*/
|
||||
|
||||
# define BOARD_PLL_MSEL (6) /* Msel = 6 */
|
||||
# define BOARD_PLL_NSEL (1) /* Nsel = 1 */
|
||||
# define BOARD_PLL_PSEL (2) /* Psel = 2 */
|
||||
|
||||
# define BOARD_FCLKOUT_FREQUENCY (72000000) /* 6 * 12,000,000 / 1 */
|
||||
# define BOARD_FCCO_FREQUENCY (244000000) /* 2 * 2 * Fclkout */
|
||||
|
||||
#else
|
||||
|
||||
/* NOTE: At 72MHz, the calibrated value of CONFIG_BOARD_LOOPSPERMSEC was
|
||||
* determined to be:
|
||||
*
|
||||
* CONFIG_BOARD_LOOPSPERMSEC=18535
|
||||
*
|
||||
* executing from SRAM.
|
||||
*/
|
||||
|
||||
/* Intermediate ramp-up clocking (Integer mode). If BOARD_PLL_RAMP_MSEL
|
||||
* is not defined, there will be no ramp-up.
|
||||
*
|
||||
* Fclkout = 9 * 12MHz / 1 = 108MHz
|
||||
* Fcco = 2 * 1 * 108MHz = 216MHz
|
||||
*/
|
||||
|
||||
# define BOARD_PLL_RAMP_MSEL (9) /* Msel = 9 */
|
||||
# define BOARD_PLL_RAMP_NSEL (1) /* Nsel = 1 */
|
||||
# define BOARD_PLL_RAMP_PSEL (1) /* Psel = 1 */
|
||||
|
||||
# define BOARD_RAMP_FCLKOUT (108000000) /* 9 * 12,000,000 / 1 */
|
||||
# define BOARD_RAMP_FCCO (216000000) /* 2 * 1 * Fclkout */
|
||||
|
||||
/* Final clocking (Direct mode).
|
||||
*
|
||||
* Fclkout = 17 * 12MHz / 1 = 204MHz
|
||||
* Fcco = Fclockout = 204MHz
|
||||
*/
|
||||
|
||||
# define BOARD_PLL_MSEL (17) /* Msel = 17 */
|
||||
# define BOARD_PLL_NSEL (1) /* Nsel = 1 */
|
||||
|
||||
# define BOARD_FCLKOUT_FREQUENCY (204000000) /* 17 * 12,000,000 / 1 */
|
||||
# define BOARD_FCCO_FREQUENCY (204000000) /* Fclockout */
|
||||
|
||||
#endif
|
||||
|
||||
/* This is the clock setup we configure for:
|
||||
*
|
||||
* SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source
|
||||
* PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz -> PLL0 multipler=20, pre-divider=1
|
||||
* CCLCK = 480MHz / 6 = 80MHz -> CCLK divider = 6
|
||||
*/
|
||||
|
||||
#define LPC43_CCLK BOARD_FCLKOUT_FREQUENCY
|
||||
|
||||
/* APB Clocking */
|
||||
|
||||
#if defined(CONFIG_LPC43_BUS) || defined(CONFIG_LPC43_MCPWM) || \
|
||||
defined(CONFIG_LPC43_I2C0) || defined(CONFIG_LPC43_I2S0) || \
|
||||
defined(CONFIG_LPC43_I2S1) || defined(CONFIG_LPC43_CAN1)
|
||||
# define BOARD_ABP1_CLKSRC BASE_APB_CLKSEL_XTAL
|
||||
# define BOARD_ABP1_FREQUENCY BOARD_XTAL_FREQUENCY
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(CONFIG_LPC43_BUS) || defined(CONFIG_LPC43_I2C1) || \
|
||||
defined(CONFIG_LPC43_DAC) || defined(CONFIG_LPC43_ADC0) || \
|
||||
defined(CONFIG_LPC43_ADC1) || defined(CONFIG_LPC43_CAN0)
|
||||
# define BOARD_ABP3_CLKSRC BASE_APB_CLKSEL_XTAL
|
||||
# define BOARD_ABP3_FREQUENCY BOARD_XTAL_FREQUENCY
|
||||
#endif
|
||||
|
||||
/* SSP Clocking */
|
||||
|
||||
#define BOARD_IDIVA_DIVIDER (2)
|
||||
#define BOARD_IDIVA_CLKSRC IDIVA_CLKSEL_PLL1
|
||||
#define BOARD_IDIVA_FREQUENCY (BOARD_FCLKOUT_FREQUENCY/BOARD_IDIVA_DIVIDER)
|
||||
|
||||
#define BOARD_SSP0_CLKSRC BASE_SSP0_CLKSEL_IDIVA
|
||||
#define BOARD_SSP0_BASEFREQ BOARD_IDIVA_FREQUENCY
|
||||
|
||||
#define BOARD_SSP1_CLKSRC BASE_SSP1_CLKSEL_IDIVA
|
||||
#define BOARD_SSP1_BASEFREQ BOARD_IDIVA_FREQUENCY
|
||||
|
||||
/* USB0 ********************************************************************/
|
||||
/* Settings needed in lpc43_cpu.c */
|
||||
|
||||
#define BOARD_USB0_CLKSRC PLL0USB_CLKSEL_XTAL
|
||||
#define BOARD_USB0_MDIV 0x06167ffa /* Table 149 datsheet, valid for 12Mhz Fclkin */
|
||||
#define BOARD_USB0_NP_DIV 0x00302062 /* Table 149 datsheet, valid for 12Mhz Fclkin */
|
||||
|
||||
/* SPIFI clocking **********************************************************/
|
||||
/* The SPIFI will receive clocking from a divider per the settings provided
|
||||
* in this file. The NuttX code will configure PLL1 as the input clock
|
||||
* for the selected divider
|
||||
*/
|
||||
|
||||
#undef BOARD_SPIFI_PLL1 /* No division */
|
||||
#undef BOARD_SPIFI_DIVA /* Supports division by 1-4 */
|
||||
#undef BOARD_SPIFI_DIVB /* Supports division by 1-16 */
|
||||
#undef BOARD_SPIFI_DIVC /* Supports division by 1-16 */
|
||||
#undef BOARD_SPIFI_DIVD /* Supports division by 1-16 */
|
||||
#undef BOARD_SPIFI_DIVE /* Supports division by 1-256 */
|
||||
|
||||
#if BOARD_FCLKOUT_FREQUENCY < 20000000
|
||||
# define BOARD_SPIFI_PLL1 1 /* Use PLL1 directly */
|
||||
#else
|
||||
# define BOARD_SPIFI_DIVB 1 /* Use IDIVB */
|
||||
#endif
|
||||
|
||||
|
||||
/* We need to configure the divider so that its output is as close to the
|
||||
* desired SCLK value. The peak data transfer rate will be about half of
|
||||
* this frequency in bytes per second.
|
||||
*/
|
||||
|
||||
#if BOARD_FCLKOUT_FREQUENCY < 20000000
|
||||
# define BOARD_SPIFI_FREQUENCY BOARD_FCLKOUT_FREQUENCY /* 72Mhz? */
|
||||
#else
|
||||
# define BOARD_SPIFI_DIVIDER (14) /* 204MHz / 14 = 14.57MHz */
|
||||
# define BOARD_SPIFI_FREQUENCY (102000000) /* 204MHz / 14 = 14.57MHz */
|
||||
#endif
|
||||
|
||||
/* UART clocking ***********************************************************/
|
||||
/* Configure all U[S]ARTs to use the XTAL input frequency */
|
||||
|
||||
#define BOARD_USART0_CLKSRC BASE_USART0_CLKSEL_XTAL
|
||||
#define BOARD_USART0_BASEFREQ BOARD_XTAL_FREQUENCY
|
||||
|
||||
#define BOARD_UART1_CLKSRC BASE_UART1_CLKSEL_XTAL
|
||||
#define BOARD_UART1_BASEFREQ BOARD_XTAL_FREQUENCY
|
||||
|
||||
#define BOARD_USART2_CLKSRC BASE_USART2_CLKSEL_XTAL
|
||||
#define BOARD_USART2_BASEFREQ BOARD_XTAL_FREQUENCY
|
||||
|
||||
#define BOARD_USART3_CLKSRC BASE_USART3_CLKSEL_XTAL
|
||||
#define BOARD_USART3_BASEFREQ BOARD_XTAL_FREQUENCY
|
||||
|
||||
/* LED definitions *********************************************************/
|
||||
/* The Bambino 200E has 2 user-controllable LEDs labeled LED1 and LED2 in the
|
||||
* schematic and on bus referred to has GPIO3[7] and GPIO5[5], respectively.
|
||||
*
|
||||
* LED1 GPIO3[7]
|
||||
* LED2 GPIO5[5]
|
||||
*
|
||||
* LEDs are pulled high to a low output illuminates the LED.
|
||||
*
|
||||
* LED index values for use with board_userled()
|
||||
*/
|
||||
|
||||
#define BOARD_LED1 0
|
||||
#define BOARD_LED2 1
|
||||
#define BOARD_NLEDS 2
|
||||
|
||||
/* LED bits for use with board_userled_all() */
|
||||
|
||||
#define BOARD_LED1_BIT (1 << BOARD_LED1)
|
||||
#define BOARD_LED2_BIT (1 << BOARD_LED2)
|
||||
|
||||
/* If CONFIG_ARCH_LEDS is defined, the LEDs will be controlled as follows
|
||||
* for NuttX debug functionality (where NC means "No Change"). If
|
||||
* CONFIG_ARCH_LEDS is not defined, then the LEDs are completely under
|
||||
* control of the application. The following interfaces are then available
|
||||
* for application control of the LEDs:
|
||||
*
|
||||
* void board_userled_initialize(void);
|
||||
* void board_userled(int led, bool ledon);
|
||||
* void board_userled_all(uint8_t ledset);
|
||||
*/
|
||||
/* ON OFF */
|
||||
/* LED1 LED2 LED1 LED2 */
|
||||
#define LED_STARTED 0 /* OFF OFF - - */
|
||||
#define LED_HEAPALLOCATE 1 /* ON OFF - - */
|
||||
#define LED_IRQSENABLED 1 /* ON OFF - - */
|
||||
#define LED_STACKCREATED 1 /* ON OFF - - */
|
||||
#define LED_INIRQ 2 /* NC ON NC OFF */
|
||||
#define LED_SIGNAL 2 /* NC ON NC OFF */
|
||||
#define LED_ASSERTION 2 /* NC ON NC OFF */
|
||||
#define LED_PANIC 2 /* NC ON NC OFF */
|
||||
|
||||
/* UART Pins ****************************************************************/
|
||||
/* The Bambino 200E does not have RS-232 drivers or serial connectors on
|
||||
* board. UART1 and USART2 are availables on Socket 5 and 10, recpectively:
|
||||
*
|
||||
* ------ ---------- -----------------------
|
||||
* SIGNAL Socket/Pin LPC4330FBD144 PIN
|
||||
* ------ ---------- -----------------------
|
||||
* U1_TXD s:5 / p:4 63 P5_6 U1_TXD=Alt 1
|
||||
* U1_RXD s:5 / p:5 61 P1_14 U1_RXD=Alt 1
|
||||
* U2_TXD s:10 / p:4 104 P2_10 U2_TXD=Alt 1
|
||||
* U2_RXD s:10 / p:5 105 P2_11 U2_RXD=Alt 1
|
||||
* ------ ---------- -----------------------
|
||||
*
|
||||
* The following definitions must be provided so that the LPC43 serial
|
||||
* driver can set up the U[S]ART for the serial console properly (see the
|
||||
* file arch/arc/src/lpc43xx/lpc4310203050_pinconf.h for more info).
|
||||
*/
|
||||
|
||||
#define PINCONF_U0_TXD PINCONF_U0_TXD_3
|
||||
#define PINCONF_U0_RXD PINCONF_U0_RXD_3
|
||||
#define PINCONF_U0_DIR PINCONF_U0_DIR_3
|
||||
|
||||
#define PINCONF_U1_TXD PINCONF_U1_TXD_5
|
||||
#define PINCONF_U1_RXD PINCONF_U1_RXD_1
|
||||
|
||||
#define PINCONF_U2_TXD PINCONF_U2_TXD_2
|
||||
#define PINCONF_U2_RXD PINCONF_U2_RXD_2
|
||||
#define PINCONF_U2_DIR PINCONF_U2_DIR_2
|
||||
|
||||
#define PINCONF_U3_TXD PINCONF_U3_TXD_2
|
||||
#define PINCONF_U3_RXD PINCONF_U3_RXD_2
|
||||
#define PINCONF_U3_DIR PINCONF_U3_DIR_2
|
||||
|
||||
/* Ethernet */
|
||||
|
||||
#define PINCONF_ENET_RX_DV PINCONF_ENET_RX_DV_2
|
||||
#define PINCONF_ENET_RESET PINCONF_GPIO0p4
|
||||
#define GPIO_ENET_RESET (GPIO_MODE_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT0 | GPIO_PIN4)
|
||||
#define PINCONF_ENET_MDC PINCONF_ENET_MDC_3
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: lpc43_boardinitialize
|
||||
*
|
||||
* Description:
|
||||
* All LPC43xx 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 lpc43_boardinitialize(void);
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __CONFIG_BAMBINO_200E_INCLUDE_BOARD_H */
|
132
configs/bambino-200e/nsh/Make.defs
Normal file
132
configs/bambino-200e/nsh/Make.defs
Normal file
@ -0,0 +1,132 @@
|
||||
############################################################################
|
||||
# configs/bambino-200e/nsh/Make.defs
|
||||
#
|
||||
# Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
# Alan Carvalho de Assis acassis@gmail.com [nuttx] <nuttx@yahoogroups.com>
|
||||
#
|
||||
# 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
|
||||
|
||||
# Setup for the kind of memory that we are executing from
|
||||
|
||||
ifeq ($(CONFIG_LPC43_BOOT_SRAM),y)
|
||||
LDSCRIPT = ramconfig.ld
|
||||
endif
|
||||
ifeq ($(CONFIG_LPC43_BOOT_SPIFI),y)
|
||||
LDSCRIPT = spificonfig.ld
|
||||
endif
|
||||
ifeq ($(CONFIG_LPC43_BOOT_FLASHA),y)
|
||||
LDSCRIPT = flashaconfig.ld
|
||||
endif
|
||||
ifeq ($(CONFIG_LPC43_BOOT_FLASHB),y)
|
||||
LDSCRIPT = flashaconfig.ld
|
||||
endif
|
||||
ifeq ($(CONFIG_LPC43_BOOT_CS0FLASH),y)
|
||||
LDSCRIPT = cs0flash.ld
|
||||
endif
|
||||
|
||||
# Setup for Windows vs Linux/Cygwin/OSX environments
|
||||
|
||||
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
|
||||
AR = $(ARCROSSDEV)ar rcs
|
||||
NM = $(ARCROSSDEV)nm
|
||||
OBJCOPY = $(CROSSDEV)objcopy
|
||||
OBJDUMP = $(CROSSDEV)objdump
|
||||
|
||||
ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'}
|
||||
ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1}
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||
ARCHOPTIMIZATION = -g
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_DEBUG_NOOPT),y)
|
||||
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
|
||||
endif
|
||||
|
||||
ARCHCFLAGS = -fno-builtin
|
||||
ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -fno-rtti
|
||||
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||
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
|
||||
|
||||
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 =
|
||||
|
989
configs/bambino-200e/nsh/defconfig
Normal file
989
configs/bambino-200e/nsh/defconfig
Normal file
@ -0,0 +1,989 @@
|
||||
#
|
||||
# Automatically generated file; DO NOT EDIT.
|
||||
# Nuttx/ Configuration
|
||||
#
|
||||
|
||||
#
|
||||
# Build Setup
|
||||
#
|
||||
# CONFIG_EXPERIMENTAL is not set
|
||||
# CONFIG_DEFAULT_SMALL is not set
|
||||
CONFIG_HOST_LINUX=y
|
||||
# CONFIG_HOST_OSX is not set
|
||||
# CONFIG_HOST_WINDOWS is not set
|
||||
# CONFIG_HOST_OTHER is not set
|
||||
|
||||
#
|
||||
# Build Configuration
|
||||
#
|
||||
# CONFIG_APPS_DIR="../apps"
|
||||
CONFIG_BUILD_FLAT=y
|
||||
# CONFIG_BUILD_2PASS is not set
|
||||
|
||||
#
|
||||
# Binary Output Formats
|
||||
#
|
||||
# CONFIG_RRLOAD_BINARY is not set
|
||||
# CONFIG_INTELHEX_BINARY is not set
|
||||
# CONFIG_MOTOROLA_SREC is not set
|
||||
CONFIG_RAW_BINARY=y
|
||||
# CONFIG_UBOOT_UIMAGE is not set
|
||||
|
||||
#
|
||||
# Customize Header Files
|
||||
#
|
||||
# CONFIG_ARCH_STDINT_H is not set
|
||||
# CONFIG_ARCH_STDBOOL_H is not set
|
||||
# CONFIG_ARCH_MATH_H is not set
|
||||
# CONFIG_ARCH_FLOAT_H is not set
|
||||
CONFIG_ARCH_STDARG_H=y
|
||||
# CONFIG_ARCH_DEBUG_H is not set
|
||||
|
||||
#
|
||||
# Debug Options
|
||||
#
|
||||
CONFIG_DEBUG_ALERT=y
|
||||
# CONFIG_DEBUG_FEATURES is not set
|
||||
CONFIG_ARCH_HAVE_STACKCHECK=y
|
||||
# CONFIG_STACK_COLORATION is not set
|
||||
# CONFIG_ARCH_HAVE_HEAPCHECK is not set
|
||||
CONFIG_DEBUG_SYMBOLS=y
|
||||
CONFIG_ARCH_HAVE_CUSTOMOPT=y
|
||||
CONFIG_DEBUG_NOOPT=y
|
||||
# CONFIG_DEBUG_CUSTOMOPT is not set
|
||||
# CONFIG_DEBUG_FULLOPT is not set
|
||||
|
||||
#
|
||||
# System Type
|
||||
#
|
||||
CONFIG_ARCH_ARM=y
|
||||
# CONFIG_ARCH_AVR is not set
|
||||
# CONFIG_ARCH_HC is not set
|
||||
# CONFIG_ARCH_MIPS is not set
|
||||
# CONFIG_ARCH_RGMP is not set
|
||||
# CONFIG_ARCH_RENESAS is not set
|
||||
# CONFIG_ARCH_RISCV is not set
|
||||
# CONFIG_ARCH_SIM is not set
|
||||
# CONFIG_ARCH_X86 is not set
|
||||
# CONFIG_ARCH_Z16 is not set
|
||||
# CONFIG_ARCH_Z80 is not set
|
||||
CONFIG_ARCH="arm"
|
||||
|
||||
#
|
||||
# ARM Options
|
||||
#
|
||||
# CONFIG_ARCH_CHIP_A1X is not set
|
||||
# CONFIG_ARCH_CHIP_C5471 is not set
|
||||
# CONFIG_ARCH_CHIP_CALYPSO is not set
|
||||
# CONFIG_ARCH_CHIP_DM320 is not set
|
||||
# CONFIG_ARCH_CHIP_EFM32 is not set
|
||||
# CONFIG_ARCH_CHIP_IMX1 is not set
|
||||
# CONFIG_ARCH_CHIP_IMX6 is not set
|
||||
# CONFIG_ARCH_CHIP_KINETIS is not set
|
||||
# CONFIG_ARCH_CHIP_KL is not set
|
||||
# CONFIG_ARCH_CHIP_LM is not set
|
||||
# CONFIG_ARCH_CHIP_TIVA is not set
|
||||
# CONFIG_ARCH_CHIP_LPC11XX is not set
|
||||
# CONFIG_ARCH_CHIP_LPC17XX is not set
|
||||
# CONFIG_ARCH_CHIP_LPC214X is not set
|
||||
# CONFIG_ARCH_CHIP_LPC2378 is not set
|
||||
# CONFIG_ARCH_CHIP_LPC31XX is not set
|
||||
CONFIG_ARCH_CHIP_LPC43XX=y
|
||||
# CONFIG_ARCH_CHIP_NUC1XX is not set
|
||||
# CONFIG_ARCH_CHIP_SAMA5 is not set
|
||||
# CONFIG_ARCH_CHIP_SAMD is not set
|
||||
# CONFIG_ARCH_CHIP_SAML is not set
|
||||
# CONFIG_ARCH_CHIP_SAM34 is not set
|
||||
# CONFIG_ARCH_CHIP_SAMV7 is not set
|
||||
# CONFIG_ARCH_CHIP_STM32 is not set
|
||||
# CONFIG_ARCH_CHIP_STM32F7 is not set
|
||||
# CONFIG_ARCH_CHIP_STM32L4 is not set
|
||||
# CONFIG_ARCH_CHIP_STR71X is not set
|
||||
# CONFIG_ARCH_CHIP_TMS570 is not set
|
||||
# CONFIG_ARCH_CHIP_MOXART is not set
|
||||
# CONFIG_ARCH_ARM7TDMI is not set
|
||||
# CONFIG_ARCH_ARM926EJS is not set
|
||||
# CONFIG_ARCH_ARM920T is not set
|
||||
# CONFIG_ARCH_CORTEXM0 is not set
|
||||
# CONFIG_ARCH_CORTEXM3 is not set
|
||||
CONFIG_ARCH_CORTEXM4=y
|
||||
# CONFIG_ARCH_CORTEXM7 is not set
|
||||
# CONFIG_ARCH_CORTEXA5 is not set
|
||||
# CONFIG_ARCH_CORTEXA8 is not set
|
||||
# CONFIG_ARCH_CORTEXA9 is not set
|
||||
# CONFIG_ARCH_CORTEXR4 is not set
|
||||
# CONFIG_ARCH_CORTEXR4F is not set
|
||||
# CONFIG_ARCH_CORTEXR5 is not set
|
||||
# CONFIG_ARCH_CORTEX5F is not set
|
||||
# CONFIG_ARCH_CORTEXR7 is not set
|
||||
# CONFIG_ARCH_CORTEXR7F is not set
|
||||
CONFIG_ARCH_FAMILY="armv7-m"
|
||||
CONFIG_ARCH_CHIP="lpc43xx"
|
||||
# CONFIG_ARM_TOOLCHAIN_IAR is not set
|
||||
CONFIG_ARM_TOOLCHAIN_GNU=y
|
||||
# CONFIG_ARMV7M_USEBASEPRI is not set
|
||||
CONFIG_ARCH_HAVE_CMNVECTOR=y
|
||||
CONFIG_ARMV7M_CMNVECTOR=y
|
||||
# CONFIG_ARMV7M_LAZYFPU is not set
|
||||
CONFIG_ARCH_HAVE_FPU=y
|
||||
# CONFIG_ARCH_HAVE_DPFPU is not set
|
||||
# CONFIG_ARCH_FPU is not set
|
||||
# CONFIG_ARCH_HAVE_TRUSTZONE is not set
|
||||
CONFIG_ARM_HAVE_MPU_UNIFIED=y
|
||||
# CONFIG_ARM_MPU is not set
|
||||
|
||||
#
|
||||
# ARMV7M Configuration Options
|
||||
#
|
||||
# CONFIG_ARMV7M_HAVE_ICACHE is not set
|
||||
# CONFIG_ARMV7M_HAVE_DCACHE is not set
|
||||
# CONFIG_ARMV7M_HAVE_ITCM is not set
|
||||
# CONFIG_ARMV7M_HAVE_DTCM is not set
|
||||
# CONFIG_ARMV7M_TOOLCHAIN_IARL is not set
|
||||
# CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT is not set
|
||||
# CONFIG_ARMV7M_TOOLCHAIN_CODEREDL is not set
|
||||
# CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL is not set
|
||||
CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y
|
||||
# CONFIG_ARMV7M_HAVE_STACKCHECK is not set
|
||||
# CONFIG_ARMV7M_ITMSYSLOG is not set
|
||||
# CONFIG_SERIAL_TERMIOS is not set
|
||||
|
||||
#
|
||||
# LPC43xx Configuration Options
|
||||
#
|
||||
# CONFIG_ARCH_CHIP_LPC4310FBD144 is not set
|
||||
# CONFIG_ARCH_CHIP_LPC4310FET100 is not set
|
||||
# CONFIG_ARCH_CHIP_LPC4320FBD144 is not set
|
||||
# CONFIG_ARCH_CHIP_LPC4320FET100 is not set
|
||||
CONFIG_ARCH_CHIP_LPC4330FBD144=y
|
||||
# CONFIG_ARCH_CHIP_LPC4330FET100 is not set
|
||||
# CONFIG_ARCH_CHIP_LPC4330FET180 is not set
|
||||
# CONFIG_ARCH_CHIP_LPC4330FET256 is not set
|
||||
# CONFIG_ARCH_CHIP_LPC4337JBD144 is not set
|
||||
# CONFIG_ARCH_CHIP_LPC4337JET100 is not set
|
||||
# CONFIG_ARCH_CHIP_LPC4350FBD208 is not set
|
||||
# CONFIG_ARCH_CHIP_LPC4350FET180 is not set
|
||||
# CONFIG_ARCH_CHIP_LPC4350FET256 is not set
|
||||
# CONFIG_ARCH_CHIP_LPC4353FBD208 is not set
|
||||
# CONFIG_ARCH_CHIP_LPC4353FET180 is not set
|
||||
# CONFIG_ARCH_CHIP_LPC4353FET256 is not set
|
||||
# CONFIG_ARCH_CHIP_LPC4357FET180 is not set
|
||||
# CONFIG_ARCH_CHIP_LPC4357FBD208 is not set
|
||||
# CONFIG_ARCH_CHIP_LPC4357FET256 is not set
|
||||
# CONFIG_ARCH_CHIP_LPC4370FET100 is not set
|
||||
CONFIG_ARCH_FAMILY_LPC4330=y
|
||||
# CONFIG_LPC43_BOOT_SRAM is not set
|
||||
CONFIG_LPC43_BOOT_SPIFI=y
|
||||
# CONFIG_LPC43_BOOT_FLASHA is not set
|
||||
# CONFIG_LPC43_BOOT_FLASHB is not set
|
||||
# CONFIG_LPC43_BOOT_CS0FLASH is not set
|
||||
# CONFIG_LPC43_BOOT_CS1FLASH is not set
|
||||
# CONFIG_LPC43_BOOT_CS2FLASH is not set
|
||||
# CONFIG_LPC43_BOOT_CS3FLASH is not set
|
||||
|
||||
#
|
||||
# LPC43xx Peripheral Support
|
||||
#
|
||||
# CONFIG_LPC43_ADC0 is not set
|
||||
# CONFIG_LPC43_ADC1 is not set
|
||||
# CONFIG_LPC43_ATIMER is not set
|
||||
# CONFIG_LPC43_CAN1 is not set
|
||||
# CONFIG_LPC43_CAN2 is not set
|
||||
# CONFIG_LPC43_DAC is not set
|
||||
# CONFIG_LPC43_EMC is not set
|
||||
# CONFIG_LPC43_ETHERNET is not set
|
||||
# CONFIG_LPC43_EVNTMNTR is not set
|
||||
# CONFIG_LPC43_GPDMA is not set
|
||||
# CONFIG_LPC43_I2C0 is not set
|
||||
# CONFIG_LPC43_I2C1 is not set
|
||||
# CONFIG_LPC43_I2S0 is not set
|
||||
# CONFIG_LPC43_I2S1 is not set
|
||||
# CONFIG_LPC43_LCD is not set
|
||||
# CONFIG_LPC43_MCPWM is not set
|
||||
# CONFIG_LPC43_QEI is not set
|
||||
# CONFIG_LPC43_RIT is not set
|
||||
# CONFIG_LPC43_RTC is not set
|
||||
# CONFIG_LPC43_SCT is not set
|
||||
# CONFIG_LPC43_SDMMC is not set
|
||||
# CONFIG_LPC43_SPI is not set
|
||||
# CONFIG_LPC43_SPIFI is not set
|
||||
# CONFIG_LPC43_SSP0 is not set
|
||||
# CONFIG_LPC43_SSP1 is not set
|
||||
# CONFIG_LPC43_TMR0 is not set
|
||||
# CONFIG_LPC43_TMR1 is not set
|
||||
# CONFIG_LPC43_TMR2 is not set
|
||||
# CONFIG_LPC43_TMR3 is not set
|
||||
# CONFIG_LPC43_USART0 is not set
|
||||
CONFIG_LPC43_UART1=y
|
||||
# CONFIG_LPC43_USART2 is not set
|
||||
# CONFIG_LPC43_USART3 is not set
|
||||
# CONFIG_LPC43_USBOTG is not set
|
||||
CONFIG_LPC43_USB0=y
|
||||
# CONFIG_LPC43_USB1 is not set
|
||||
# CONFIG_LPC43_WWDT is not set
|
||||
# CONFIG_LPC43_GPIO_IRQ is not set
|
||||
|
||||
#
|
||||
# Internal Memory Configuration
|
||||
#
|
||||
CONFIG_ARCH_HAVE_AHB_SRAM_BANK1=y
|
||||
# CONFIG_LPC43_USE_LOCSRAM_BANK1 is not set
|
||||
# CONFIG_LPC43_USE_AHBSRAM_BANK0 is not set
|
||||
# CONFIG_LPC43_USE_AHBSRAM_BANK1 is not set
|
||||
# CONFIG_LPC43_HEAP_AHBSRAM_BANK2 is not set
|
||||
|
||||
#
|
||||
# External Memory Configuration
|
||||
#
|
||||
|
||||
#
|
||||
# RS-485 Configuration
|
||||
#
|
||||
# CONFIG_USART2_RS485MODE is not set
|
||||
|
||||
#
|
||||
# USB device controller driver (DCD) options
|
||||
#
|
||||
# CONFIG_LPC43_USB0DEV_NOVBUS is not set
|
||||
|
||||
#
|
||||
# Architecture Options
|
||||
#
|
||||
# CONFIG_ARCH_NOINTC is not set
|
||||
# CONFIG_ARCH_VECNOTIRQ is not set
|
||||
# CONFIG_ARCH_DMA is not set
|
||||
CONFIG_ARCH_HAVE_IRQPRIO=y
|
||||
# CONFIG_ARCH_L2CACHE is not set
|
||||
# CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set
|
||||
# CONFIG_ARCH_HAVE_ADDRENV is not set
|
||||
# CONFIG_ARCH_NEED_ADDRENV_MAPPING is not set
|
||||
# CONFIG_ARCH_HAVE_MULTICPU is not set
|
||||
CONFIG_ARCH_HAVE_VFORK=y
|
||||
# CONFIG_ARCH_HAVE_MMU is not set
|
||||
CONFIG_ARCH_HAVE_MPU=y
|
||||
# CONFIG_ARCH_NAND_HWECC is not set
|
||||
# CONFIG_ARCH_HAVE_EXTCLK is not set
|
||||
# CONFIG_ARCH_HAVE_POWEROFF is not set
|
||||
CONFIG_ARCH_HAVE_RESET=y
|
||||
# CONFIG_ARCH_USE_MPU is not set
|
||||
# CONFIG_ARCH_IRQPRIO is not set
|
||||
CONFIG_ARCH_STACKDUMP=y
|
||||
# CONFIG_ENDIAN_BIG is not set
|
||||
# CONFIG_ARCH_IDLE_CUSTOM is not set
|
||||
# CONFIG_ARCH_HAVE_RAMFUNCS is not set
|
||||
CONFIG_ARCH_HAVE_RAMVECTORS=y
|
||||
# CONFIG_ARCH_RAMVECTORS is not set
|
||||
|
||||
#
|
||||
# Board Settings
|
||||
#
|
||||
CONFIG_BOARD_LOOPSPERMSEC=18535
|
||||
# CONFIG_ARCH_CALIBRATION is not set
|
||||
|
||||
#
|
||||
# Interrupt options
|
||||
#
|
||||
CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
|
||||
CONFIG_ARCH_INTERRUPTSTACK=0
|
||||
CONFIG_ARCH_HAVE_HIPRI_INTERRUPT=y
|
||||
# CONFIG_ARCH_HIPRI_INTERRUPT is not set
|
||||
|
||||
#
|
||||
# Boot options
|
||||
#
|
||||
# CONFIG_BOOT_RUNFROMEXTSRAM is not set
|
||||
CONFIG_BOOT_RUNFROMFLASH=y
|
||||
# CONFIG_BOOT_RUNFROMISRAM is not set
|
||||
# CONFIG_BOOT_RUNFROMSDRAM is not set
|
||||
# CONFIG_BOOT_COPYTORAM is not set
|
||||
|
||||
#
|
||||
# Boot Memory Configuration
|
||||
#
|
||||
CONFIG_RAM_START=0x10000000
|
||||
CONFIG_RAM_SIZE=131072
|
||||
# CONFIG_ARCH_HAVE_SDRAM is not set
|
||||
|
||||
#
|
||||
# Board Selection
|
||||
#
|
||||
CONFIG_ARCH_BOARD_BAMBINO_200E=y
|
||||
# CONFIG_ARCH_BOARD_CUSTOM is not set
|
||||
CONFIG_ARCH_BOARD="bambino-200e"
|
||||
|
||||
#
|
||||
# Common Board Options
|
||||
#
|
||||
CONFIG_ARCH_HAVE_LEDS=y
|
||||
CONFIG_ARCH_LEDS=y
|
||||
CONFIG_ARCH_HAVE_BUTTONS=y
|
||||
# CONFIG_ARCH_BUTTONS is not set
|
||||
CONFIG_ARCH_HAVE_IRQBUTTONS=y
|
||||
|
||||
#
|
||||
# Board-Specific Options
|
||||
#
|
||||
# CONFIG_BOARD_CRASHDUMP is not set
|
||||
CONFIG_LIB_BOARDCTL=y
|
||||
# CONFIG_BOARDCTL_RESET is not set
|
||||
# CONFIG_BOARDCTL_UNIQUEID is not set
|
||||
CONFIG_BOARDCTL_USBDEVCTRL=y
|
||||
# CONFIG_BOARDCTL_TSCTEST is not set
|
||||
# CONFIG_BOARDCTL_ADCTEST is not set
|
||||
# CONFIG_BOARDCTL_PWMTEST is not set
|
||||
# CONFIG_BOARDCTL_GRAPHICS is not set
|
||||
# CONFIG_BOARDCTL_IOCTL is not set
|
||||
|
||||
#
|
||||
# RTOS Features
|
||||
#
|
||||
CONFIG_DISABLE_OS_API=y
|
||||
# CONFIG_DISABLE_POSIX_TIMERS is not set
|
||||
# CONFIG_DISABLE_PTHREAD is not set
|
||||
# CONFIG_DISABLE_SIGNALS is not set
|
||||
# CONFIG_DISABLE_MQUEUE is not set
|
||||
# CONFIG_DISABLE_ENVIRON is not set
|
||||
|
||||
#
|
||||
# Clocks and Timers
|
||||
#
|
||||
CONFIG_ARCH_HAVE_TICKLESS=y
|
||||
# CONFIG_SCHED_TICKLESS is not set
|
||||
CONFIG_USEC_PER_TICK=10000
|
||||
# CONFIG_SYSTEM_TIME64 is not set
|
||||
# CONFIG_CLOCK_MONOTONIC is not set
|
||||
# CONFIG_ARCH_HAVE_TIMEKEEPING is not set
|
||||
# CONFIG_JULIAN_TIME is not set
|
||||
CONFIG_START_YEAR=2012
|
||||
CONFIG_START_MONTH=7
|
||||
CONFIG_START_DAY=11
|
||||
CONFIG_MAX_WDOGPARMS=2
|
||||
CONFIG_PREALLOC_WDOGS=4
|
||||
CONFIG_WDOG_INTRESERVE=0
|
||||
CONFIG_PREALLOC_TIMERS=4
|
||||
|
||||
#
|
||||
# Tasks and Scheduling
|
||||
#
|
||||
# CONFIG_INIT_NONE is not set
|
||||
CONFIG_INIT_ENTRYPOINT=y
|
||||
# CONFIG_INIT_FILEPATH is not set
|
||||
CONFIG_USER_ENTRYPOINT="nsh_main"
|
||||
CONFIG_RR_INTERVAL=200
|
||||
# CONFIG_SCHED_SPORADIC is not set
|
||||
CONFIG_TASK_NAME_SIZE=0
|
||||
CONFIG_MAX_TASKS=16
|
||||
# CONFIG_SCHED_HAVE_PARENT is not set
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
|
||||
#
|
||||
# Pthread Options
|
||||
#
|
||||
# CONFIG_MUTEX_TYPES is not set
|
||||
CONFIG_NPTHREAD_KEYS=4
|
||||
|
||||
#
|
||||
# Performance Monitoring
|
||||
#
|
||||
# CONFIG_SCHED_CPULOAD is not set
|
||||
# CONFIG_SCHED_INSTRUMENTATION is not set
|
||||
|
||||
#
|
||||
# Files and I/O
|
||||
#
|
||||
CONFIG_DEV_CONSOLE=y
|
||||
# CONFIG_FDCLONE_DISABLE is not set
|
||||
# CONFIG_FDCLONE_STDIO is not set
|
||||
CONFIG_SDCLONE_DISABLE=y
|
||||
CONFIG_NFILE_DESCRIPTORS=8
|
||||
CONFIG_NFILE_STREAMS=8
|
||||
CONFIG_NAME_MAX=32
|
||||
# CONFIG_PRIORITY_INHERITANCE is not set
|
||||
|
||||
#
|
||||
# RTOS hooks
|
||||
#
|
||||
# CONFIG_BOARD_INITIALIZE is not set
|
||||
# CONFIG_SCHED_STARTHOOK is not set
|
||||
# CONFIG_SCHED_ATEXIT is not set
|
||||
# CONFIG_SCHED_ONEXIT is not set
|
||||
|
||||
#
|
||||
# Signal Numbers
|
||||
#
|
||||
CONFIG_SIG_SIGUSR1=1
|
||||
CONFIG_SIG_SIGUSR2=2
|
||||
CONFIG_SIG_SIGALARM=3
|
||||
CONFIG_SIG_SIGCONDTIMEDOUT=16
|
||||
|
||||
#
|
||||
# POSIX Message Queue Options
|
||||
#
|
||||
CONFIG_PREALLOC_MQ_MSGS=4
|
||||
CONFIG_MQ_MAXMSGSIZE=32
|
||||
# CONFIG_MODULE is not set
|
||||
|
||||
#
|
||||
# Work queue support
|
||||
#
|
||||
# CONFIG_SCHED_WORKQUEUE is not set
|
||||
# CONFIG_SCHED_HPWORK is not set
|
||||
# CONFIG_SCHED_LPWORK is not set
|
||||
|
||||
#
|
||||
# Stack and heap information
|
||||
#
|
||||
CONFIG_IDLETHREAD_STACKSIZE=1024
|
||||
CONFIG_USERMAIN_STACKSIZE=2048
|
||||
CONFIG_PTHREAD_STACK_MIN=256
|
||||
CONFIG_PTHREAD_STACK_DEFAULT=2048
|
||||
# CONFIG_LIB_SYSCALL is not set
|
||||
|
||||
#
|
||||
# Device Drivers
|
||||
#
|
||||
# CONFIG_DISABLE_POLL is not set
|
||||
CONFIG_DEV_NULL=y
|
||||
# CONFIG_DEV_ZERO is not set
|
||||
# CONFIG_DEV_URANDOM is not set
|
||||
# CONFIG_DEV_LOOP is not set
|
||||
|
||||
#
|
||||
# Buffering
|
||||
#
|
||||
# CONFIG_DRVR_WRITEBUFFER is not set
|
||||
# CONFIG_DRVR_READAHEAD is not set
|
||||
# CONFIG_RAMDISK is not set
|
||||
# CONFIG_CAN is not set
|
||||
# CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set
|
||||
# CONFIG_ARCH_HAVE_PWM_MULTICHAN is not set
|
||||
# CONFIG_PWM is not set
|
||||
# CONFIG_ARCH_HAVE_I2CRESET is not set
|
||||
# CONFIG_I2C is not set
|
||||
# CONFIG_SPI is not set
|
||||
# CONFIG_I2S is not set
|
||||
|
||||
#
|
||||
# Timer Driver Support
|
||||
#
|
||||
# CONFIG_TIMER is not set
|
||||
# CONFIG_ONESHOT is not set
|
||||
# CONFIG_RTC is not set
|
||||
# CONFIG_WATCHDOG is not set
|
||||
# CONFIG_ANALOG is not set
|
||||
# CONFIG_AUDIO_DEVICES is not set
|
||||
# CONFIG_VIDEO_DEVICES is not set
|
||||
# CONFIG_BCH is not set
|
||||
# CONFIG_INPUT is not set
|
||||
|
||||
#
|
||||
# IO Expander/GPIO Support
|
||||
#
|
||||
# CONFIG_IOEXPANDER is not set
|
||||
# CONFIG_DEV_GPIO is not set
|
||||
|
||||
#
|
||||
# LCD Driver Support
|
||||
#
|
||||
# CONFIG_LCD is not set
|
||||
# CONFIG_SLCD is not set
|
||||
|
||||
#
|
||||
# LED Support
|
||||
#
|
||||
# CONFIG_USERLED is not set
|
||||
# CONFIG_RGBLED is not set
|
||||
# CONFIG_PCA9635PW is not set
|
||||
# CONFIG_NCP5623C is not set
|
||||
# CONFIG_MMCSD is not set
|
||||
# CONFIG_MODEM is not set
|
||||
# CONFIG_MTD is not set
|
||||
# CONFIG_EEPROM is not set
|
||||
# CONFIG_PIPES is not set
|
||||
# CONFIG_PM is not set
|
||||
# CONFIG_POWER is not set
|
||||
# CONFIG_SENSORS is not set
|
||||
# CONFIG_SERCOMM_CONSOLE is not set
|
||||
CONFIG_SERIAL=y
|
||||
# CONFIG_DEV_LOWCONSOLE is not set
|
||||
CONFIG_SERIAL_REMOVABLE=y
|
||||
CONFIG_SERIAL_CONSOLE=y
|
||||
# CONFIG_16550_UART is not set
|
||||
# CONFIG_UART_SERIALDRIVER is not set
|
||||
# CONFIG_UART0_SERIALDRIVER is not set
|
||||
CONFIG_UART1_SERIALDRIVER=y
|
||||
# CONFIG_UART2_SERIALDRIVER is not set
|
||||
# CONFIG_UART3_SERIALDRIVER is not set
|
||||
# CONFIG_UART4_SERIALDRIVER is not set
|
||||
# CONFIG_UART5_SERIALDRIVER is not set
|
||||
# CONFIG_UART6_SERIALDRIVER is not set
|
||||
# CONFIG_UART7_SERIALDRIVER is not set
|
||||
# CONFIG_UART8_SERIALDRIVER is not set
|
||||
# CONFIG_SCI0_SERIALDRIVER is not set
|
||||
# CONFIG_SCI1_SERIALDRIVER is not set
|
||||
# CONFIG_USART0_SERIALDRIVER is not set
|
||||
# CONFIG_USART1_SERIALDRIVER is not set
|
||||
# CONFIG_USART2_SERIALDRIVER is not set
|
||||
# CONFIG_USART3_SERIALDRIVER is not set
|
||||
# CONFIG_USART4_SERIALDRIVER is not set
|
||||
# CONFIG_USART5_SERIALDRIVER is not set
|
||||
# CONFIG_USART6_SERIALDRIVER is not set
|
||||
# CONFIG_USART7_SERIALDRIVER is not set
|
||||
# CONFIG_USART8_SERIALDRIVER is not set
|
||||
# CONFIG_OTHER_UART_SERIALDRIVER is not set
|
||||
CONFIG_MCU_SERIAL=y
|
||||
CONFIG_STANDARD_SERIAL=y
|
||||
CONFIG_SERIAL_NPOLLWAITERS=2
|
||||
# CONFIG_SERIAL_IFLOWCONTROL is not set
|
||||
# CONFIG_SERIAL_OFLOWCONTROL is not set
|
||||
# CONFIG_SERIAL_DMA is not set
|
||||
# CONFIG_SERIAL_TIOCSERGSTRUCT is not set
|
||||
CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y
|
||||
CONFIG_UART1_SERIAL_CONSOLE=y
|
||||
# CONFIG_USART2_SERIAL_CONSOLE is not set
|
||||
# CONFIG_OTHER_SERIAL_CONSOLE is not set
|
||||
# CONFIG_NO_SERIAL_CONSOLE is not set
|
||||
|
||||
#
|
||||
# UART1 Configuration
|
||||
#
|
||||
CONFIG_UART1_RXBUFSIZE=256
|
||||
CONFIG_UART1_TXBUFSIZE=256
|
||||
CONFIG_UART1_BAUD=115200
|
||||
CONFIG_UART1_BITS=8
|
||||
CONFIG_UART1_PARITY=0
|
||||
CONFIG_UART1_2STOP=0
|
||||
# CONFIG_UART1_IFLOWCONTROL is not set
|
||||
# CONFIG_UART1_OFLOWCONTROL is not set
|
||||
# CONFIG_UART1_DMA is not set
|
||||
# CONFIG_PSEUDOTERM is not set
|
||||
CONFIG_USBDEV=y
|
||||
|
||||
#
|
||||
# USB Device Controller Driver Options
|
||||
#
|
||||
# CONFIG_USBDEV_ISOCHRONOUS is not set
|
||||
# CONFIG_USBDEV_DUALSPEED is not set
|
||||
CONFIG_USBDEV_SELFPOWERED=y
|
||||
# CONFIG_USBDEV_BUSPOWERED is not set
|
||||
CONFIG_USBDEV_MAXPOWER=100
|
||||
# CONFIG_USBDEV_DMA is not set
|
||||
# CONFIG_ARCH_USBDEV_STALLQUEUE is not set
|
||||
# CONFIG_USBDEV_TRACE is not set
|
||||
|
||||
#
|
||||
# USB Device Class Driver Options
|
||||
#
|
||||
# CONFIG_USBDEV_COMPOSITE is not set
|
||||
# CONFIG_PL2303 is not set
|
||||
CONFIG_CDCACM=y
|
||||
# CONFIG_CDCACM_CONSOLE is not set
|
||||
CONFIG_CDCACM_EP0MAXPACKET=64
|
||||
CONFIG_CDCACM_EPINTIN=1
|
||||
CONFIG_CDCACM_EPINTIN_FSSIZE=64
|
||||
CONFIG_CDCACM_EPINTIN_HSSIZE=64
|
||||
CONFIG_CDCACM_EPBULKOUT=3
|
||||
CONFIG_CDCACM_EPBULKOUT_FSSIZE=64
|
||||
CONFIG_CDCACM_EPBULKOUT_HSSIZE=512
|
||||
CONFIG_CDCACM_EPBULKIN=2
|
||||
CONFIG_CDCACM_EPBULKIN_FSSIZE=64
|
||||
CONFIG_CDCACM_EPBULKIN_HSSIZE=512
|
||||
CONFIG_CDCACM_NRDREQS=4
|
||||
CONFIG_CDCACM_NWRREQS=4
|
||||
CONFIG_CDCACM_BULKIN_REQLEN=96
|
||||
CONFIG_CDCACM_RXBUFSIZE=257
|
||||
CONFIG_CDCACM_TXBUFSIZE=193
|
||||
CONFIG_CDCACM_VENDORID=0x0525
|
||||
CONFIG_CDCACM_PRODUCTID=0xa4a7
|
||||
CONFIG_CDCACM_VENDORSTR="NuttX"
|
||||
CONFIG_CDCACM_PRODUCTSTR="CDC/ACM Serial"
|
||||
# CONFIG_USBMSC is not set
|
||||
# CONFIG_USBHOST is not set
|
||||
# CONFIG_HAVE_USBTRACE is not set
|
||||
# CONFIG_DRIVERS_WIRELESS is not set
|
||||
# CONFIG_DRIVERS_CONTACTLESS is not set
|
||||
|
||||
#
|
||||
# System Logging
|
||||
#
|
||||
# CONFIG_ARCH_SYSLOG is not set
|
||||
# CONFIG_RAMLOG is not set
|
||||
# CONFIG_SYSLOG_INTBUFFER is not set
|
||||
# CONFIG_SYSLOG_TIMESTAMP is not set
|
||||
CONFIG_SYSLOG_SERIAL_CONSOLE=y
|
||||
# CONFIG_SYSLOG_CHAR is not set
|
||||
CONFIG_SYSLOG_CONSOLE=y
|
||||
# CONFIG_SYSLOG_NONE is not set
|
||||
# CONFIG_SYSLOG_FILE is not set
|
||||
# CONFIG_SYSLOG_CHARDEV is not set
|
||||
|
||||
#
|
||||
# Networking Support
|
||||
#
|
||||
# CONFIG_ARCH_HAVE_NET is not set
|
||||
# CONFIG_ARCH_HAVE_PHY is not set
|
||||
# CONFIG_NET is not set
|
||||
|
||||
#
|
||||
# Crypto API
|
||||
#
|
||||
# CONFIG_CRYPTO is not set
|
||||
|
||||
#
|
||||
# File Systems
|
||||
#
|
||||
|
||||
#
|
||||
# File system configuration
|
||||
#
|
||||
# CONFIG_DISABLE_MOUNTPOINT is not set
|
||||
# CONFIG_FS_AUTOMOUNTER is not set
|
||||
# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set
|
||||
CONFIG_FS_READABLE=y
|
||||
CONFIG_FS_WRITABLE=y
|
||||
# CONFIG_FS_NAMED_SEMAPHORES is not set
|
||||
CONFIG_FS_MQUEUE_MPATH="/var/mqueue"
|
||||
# CONFIG_FS_RAMMAP is not set
|
||||
CONFIG_FS_FAT=y
|
||||
CONFIG_FAT_LCNAMES=y
|
||||
CONFIG_FAT_LFN=y
|
||||
CONFIG_FAT_MAXFNAME=32
|
||||
# CONFIG_FS_FATTIME is not set
|
||||
# CONFIG_FAT_FORCE_INDIRECT is not set
|
||||
# CONFIG_FAT_DMAMEMORY is not set
|
||||
# CONFIG_FAT_DIRECT_RETRY is not set
|
||||
# CONFIG_FS_NXFFS is not set
|
||||
# CONFIG_FS_ROMFS is not set
|
||||
# CONFIG_FS_TMPFS is not set
|
||||
# CONFIG_FS_SMARTFS is not set
|
||||
# CONFIG_FS_PROCFS is not set
|
||||
# CONFIG_FS_UNIONFS is not set
|
||||
|
||||
#
|
||||
# Graphics Support
|
||||
#
|
||||
# CONFIG_NX is not set
|
||||
|
||||
#
|
||||
# Memory Management
|
||||
#
|
||||
# CONFIG_MM_SMALL is not set
|
||||
CONFIG_MM_REGIONS=2
|
||||
# CONFIG_ARCH_HAVE_HEAP2 is not set
|
||||
# CONFIG_GRAN is not set
|
||||
|
||||
#
|
||||
# Audio Support
|
||||
#
|
||||
# CONFIG_AUDIO is not set
|
||||
|
||||
#
|
||||
# Wireless Support
|
||||
#
|
||||
|
||||
#
|
||||
# Binary Loader
|
||||
#
|
||||
# CONFIG_BINFMT_DISABLE is not set
|
||||
# CONFIG_BINFMT_EXEPATH is not set
|
||||
# CONFIG_NXFLAT is not set
|
||||
# CONFIG_ELF is not set
|
||||
CONFIG_BUILTIN=y
|
||||
# CONFIG_PIC is not set
|
||||
CONFIG_SYMTAB_ORDEREDBYNAME=y
|
||||
|
||||
#
|
||||
# Library Routines
|
||||
#
|
||||
|
||||
#
|
||||
# Standard C Library Options
|
||||
#
|
||||
CONFIG_STDIO_BUFFER_SIZE=64
|
||||
CONFIG_STDIO_LINEBUFFER=y
|
||||
CONFIG_NUNGET_CHARS=2
|
||||
CONFIG_LIB_HOMEDIR="/"
|
||||
# CONFIG_LIBM is not set
|
||||
# CONFIG_NOPRINTF_FIELDWIDTH is not set
|
||||
# CONFIG_LIBC_FLOATINGPOINT is not set
|
||||
CONFIG_LIBC_LONG_LONG=y
|
||||
# CONFIG_LIBC_IOCTL_VARIADIC is not set
|
||||
# CONFIG_LIBC_WCHAR is not set
|
||||
# CONFIG_LIBC_LOCALE is not set
|
||||
CONFIG_LIB_RAND_ORDER=1
|
||||
# CONFIG_EOL_IS_CR is not set
|
||||
# CONFIG_EOL_IS_LF is not set
|
||||
# CONFIG_EOL_IS_BOTH_CRLF is not set
|
||||
CONFIG_EOL_IS_EITHER_CRLF=y
|
||||
# CONFIG_LIBC_EXECFUNCS is not set
|
||||
CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024
|
||||
CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048
|
||||
# CONFIG_LIBC_STRERROR is not set
|
||||
# CONFIG_LIBC_PERROR_STDOUT is not set
|
||||
CONFIG_LIBC_TMPDIR="/tmp"
|
||||
CONFIG_LIBC_MAX_TMPFILE=32
|
||||
CONFIG_ARCH_LOWPUTC=y
|
||||
# CONFIG_LIBC_LOCALTIME is not set
|
||||
# CONFIG_TIME_EXTENDED is not set
|
||||
CONFIG_LIB_SENDFILE_BUFSIZE=512
|
||||
# CONFIG_ARCH_ROMGETC is not set
|
||||
# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set
|
||||
CONFIG_ARCH_HAVE_TLS=y
|
||||
# CONFIG_TLS is not set
|
||||
# CONFIG_LIBC_NETDB is not set
|
||||
# CONFIG_NETDB_HOSTFILE is not set
|
||||
|
||||
#
|
||||
# Non-standard Library Support
|
||||
#
|
||||
# CONFIG_LIB_CRC64_FAST is not set
|
||||
# CONFIG_LIB_KBDCODEC is not set
|
||||
# CONFIG_LIB_SLCDCODEC is not set
|
||||
# CONFIG_LIB_HEX2BIN is not set
|
||||
|
||||
#
|
||||
# Basic CXX Support
|
||||
#
|
||||
# CONFIG_C99_BOOL8 is not set
|
||||
# CONFIG_HAVE_CXX is not set
|
||||
|
||||
#
|
||||
# Application Configuration
|
||||
#
|
||||
|
||||
#
|
||||
# Built-In Applications
|
||||
#
|
||||
CONFIG_BUILTIN_PROXY_STACKSIZE=1024
|
||||
|
||||
#
|
||||
# CAN Utilities
|
||||
#
|
||||
|
||||
#
|
||||
# Examples
|
||||
#
|
||||
# CONFIG_EXAMPLES_BUTTONS is not set
|
||||
# CONFIG_EXAMPLES_CCTYPE is not set
|
||||
# CONFIG_EXAMPLES_CHAT is not set
|
||||
# CONFIG_EXAMPLES_CONFIGDATA is not set
|
||||
# CONFIG_EXAMPLES_DHCPD is not set
|
||||
# CONFIG_EXAMPLES_ELF is not set
|
||||
# CONFIG_EXAMPLES_FSTEST is not set
|
||||
# CONFIG_EXAMPLES_FTPC is not set
|
||||
# CONFIG_EXAMPLES_FTPD is not set
|
||||
# CONFIG_EXAMPLES_HELLO is not set
|
||||
# CONFIG_EXAMPLES_HIDKBD is not set
|
||||
# CONFIG_EXAMPLES_IGMP is not set
|
||||
# CONFIG_EXAMPLES_JSON is not set
|
||||
# CONFIG_EXAMPLES_KEYPADTEST is not set
|
||||
# CONFIG_EXAMPLES_MEDIA is not set
|
||||
# CONFIG_EXAMPLES_MM is not set
|
||||
# CONFIG_EXAMPLES_MODBUS is not set
|
||||
# CONFIG_EXAMPLES_MOUNT is not set
|
||||
# CONFIG_EXAMPLES_NRF24L01TERM is not set
|
||||
CONFIG_EXAMPLES_NSH=y
|
||||
# CONFIG_EXAMPLES_NULL is not set
|
||||
# CONFIG_EXAMPLES_NXFFS is not set
|
||||
# CONFIG_EXAMPLES_NXHELLO is not set
|
||||
# CONFIG_EXAMPLES_NXIMAGE is not set
|
||||
# CONFIG_EXAMPLES_NX is not set
|
||||
# CONFIG_EXAMPLES_NXLINES is not set
|
||||
# CONFIG_EXAMPLES_NXTERM is not set
|
||||
# CONFIG_EXAMPLES_NXTEXT is not set
|
||||
# CONFIG_EXAMPLES_OSTEST is not set
|
||||
# CONFIG_EXAMPLES_PCA9635 is not set
|
||||
# CONFIG_EXAMPLES_POSIXSPAWN is not set
|
||||
# CONFIG_EXAMPLES_PPPD is not set
|
||||
# CONFIG_EXAMPLES_RFID_READUID is not set
|
||||
# CONFIG_EXAMPLES_RGBLED is not set
|
||||
# CONFIG_EXAMPLES_RGMP is not set
|
||||
# CONFIG_EXAMPLES_SENDMAIL is not set
|
||||
# CONFIG_EXAMPLES_SERIALBLASTER is not set
|
||||
# CONFIG_EXAMPLES_SERIALRX is not set
|
||||
# CONFIG_EXAMPLES_SERLOOP is not set
|
||||
# CONFIG_EXAMPLES_SLCD is not set
|
||||
# CONFIG_EXAMPLES_SMART is not set
|
||||
# CONFIG_EXAMPLES_SMART_TEST is not set
|
||||
# CONFIG_EXAMPLES_SMP is not set
|
||||
# CONFIG_EXAMPLES_TCPECHO is not set
|
||||
# CONFIG_EXAMPLES_TELNETD is not set
|
||||
# CONFIG_EXAMPLES_TIFF is not set
|
||||
# CONFIG_EXAMPLES_TOUCHSCREEN is not set
|
||||
# CONFIG_EXAMPLES_USBSERIAL is not set
|
||||
# CONFIG_EXAMPLES_USBTERM is not set
|
||||
# CONFIG_EXAMPLES_WATCHDOG is not set
|
||||
# CONFIG_EXAMPLES_WEBSERVER is not set
|
||||
|
||||
#
|
||||
# File System Utilities
|
||||
#
|
||||
# CONFIG_FSUTILS_INIFILE is not set
|
||||
# CONFIG_FSUTILS_PASSWD is not set
|
||||
|
||||
#
|
||||
# GPS Utilities
|
||||
#
|
||||
# CONFIG_GPSUTILS_MINMEA_LIB is not set
|
||||
|
||||
#
|
||||
# Graphics Support
|
||||
#
|
||||
# CONFIG_TIFF is not set
|
||||
# CONFIG_GRAPHICS_TRAVELER is not set
|
||||
|
||||
#
|
||||
# Interpreters
|
||||
#
|
||||
# CONFIG_INTERPRETERS_BAS is not set
|
||||
# CONFIG_INTERPRETERS_FICL is not set
|
||||
# CONFIG_INTERPRETERS_MICROPYTHON is not set
|
||||
# CONFIG_INTERPRETERS_MINIBASIC is not set
|
||||
# CONFIG_INTERPRETERS_PCODE is not set
|
||||
|
||||
#
|
||||
# FreeModBus
|
||||
#
|
||||
# CONFIG_MODBUS is not set
|
||||
|
||||
#
|
||||
# Network Utilities
|
||||
#
|
||||
# CONFIG_NETUTILS_CHAT is not set
|
||||
# CONFIG_NETUTILS_CODECS is not set
|
||||
# CONFIG_NETUTILS_ESP8266 is not set
|
||||
# CONFIG_NETUTILS_FTPC is not set
|
||||
# CONFIG_NETUTILS_JSON is not set
|
||||
# CONFIG_NETUTILS_SMTP is not set
|
||||
|
||||
#
|
||||
# NSH Library
|
||||
#
|
||||
CONFIG_NSH_LIBRARY=y
|
||||
# CONFIG_NSH_MOTD is not set
|
||||
|
||||
#
|
||||
# Command Line Configuration
|
||||
#
|
||||
CONFIG_NSH_READLINE=y
|
||||
# CONFIG_NSH_CLE is not set
|
||||
CONFIG_NSH_LINELEN=64
|
||||
# CONFIG_NSH_DISABLE_SEMICOLON is not set
|
||||
CONFIG_NSH_CMDPARMS=y
|
||||
CONFIG_NSH_MAXARGUMENTS=6
|
||||
CONFIG_NSH_ARGCAT=y
|
||||
CONFIG_NSH_NESTDEPTH=3
|
||||
# CONFIG_NSH_DISABLEBG is not set
|
||||
CONFIG_NSH_BUILTIN_APPS=y
|
||||
|
||||
#
|
||||
# Disable Individual commands
|
||||
#
|
||||
# CONFIG_NSH_DISABLE_ADDROUTE is not set
|
||||
# CONFIG_NSH_DISABLE_BASENAME is not set
|
||||
# CONFIG_NSH_DISABLE_CAT is not set
|
||||
# CONFIG_NSH_DISABLE_CD is not set
|
||||
# CONFIG_NSH_DISABLE_CP is not set
|
||||
# CONFIG_NSH_DISABLE_CMP is not set
|
||||
CONFIG_NSH_DISABLE_DATE=y
|
||||
# CONFIG_NSH_DISABLE_DD is not set
|
||||
# CONFIG_NSH_DISABLE_DF is not set
|
||||
# CONFIG_NSH_DISABLE_DELROUTE is not set
|
||||
# CONFIG_NSH_DISABLE_DIRNAME is not set
|
||||
# CONFIG_NSH_DISABLE_ECHO is not set
|
||||
# CONFIG_NSH_DISABLE_EXEC is not set
|
||||
# CONFIG_NSH_DISABLE_EXIT is not set
|
||||
# CONFIG_NSH_DISABLE_FREE is not set
|
||||
# CONFIG_NSH_DISABLE_GET is not set
|
||||
# CONFIG_NSH_DISABLE_HELP is not set
|
||||
# CONFIG_NSH_DISABLE_HEXDUMP is not set
|
||||
# CONFIG_NSH_DISABLE_IFCONFIG is not set
|
||||
CONFIG_NSH_DISABLE_IFUPDOWN=y
|
||||
# CONFIG_NSH_DISABLE_KILL is not set
|
||||
# CONFIG_NSH_DISABLE_LOSETUP is not set
|
||||
CONFIG_NSH_DISABLE_LOSMART=y
|
||||
# CONFIG_NSH_DISABLE_LS is not set
|
||||
# CONFIG_NSH_DISABLE_MB is not set
|
||||
# CONFIG_NSH_DISABLE_MKDIR is not set
|
||||
# CONFIG_NSH_DISABLE_MKFATFS is not set
|
||||
# CONFIG_NSH_DISABLE_MKRD is not set
|
||||
# CONFIG_NSH_DISABLE_MH is not set
|
||||
# CONFIG_NSH_DISABLE_MOUNT is not set
|
||||
# CONFIG_NSH_DISABLE_MV is not set
|
||||
# CONFIG_NSH_DISABLE_MW is not set
|
||||
CONFIG_NSH_DISABLE_PRINTF=y
|
||||
# CONFIG_NSH_DISABLE_PS is not set
|
||||
# CONFIG_NSH_DISABLE_PUT is not set
|
||||
# CONFIG_NSH_DISABLE_PWD is not set
|
||||
# CONFIG_NSH_DISABLE_RM is not set
|
||||
# CONFIG_NSH_DISABLE_RMDIR is not set
|
||||
# CONFIG_NSH_DISABLE_SET is not set
|
||||
# CONFIG_NSH_DISABLE_SH is not set
|
||||
# CONFIG_NSH_DISABLE_SLEEP is not set
|
||||
# CONFIG_NSH_DISABLE_TIME is not set
|
||||
# CONFIG_NSH_DISABLE_TEST is not set
|
||||
# CONFIG_NSH_DISABLE_UMOUNT is not set
|
||||
# CONFIG_NSH_DISABLE_UNAME is not set
|
||||
# CONFIG_NSH_DISABLE_UNSET is not set
|
||||
# CONFIG_NSH_DISABLE_USLEEP is not set
|
||||
# CONFIG_NSH_DISABLE_WGET is not set
|
||||
# CONFIG_NSH_DISABLE_XD is not set
|
||||
CONFIG_NSH_MMCSDMINOR=0
|
||||
|
||||
#
|
||||
# Configure Command Options
|
||||
#
|
||||
CONFIG_NSH_CMDOPT_DF_H=y
|
||||
CONFIG_NSH_CODECS_BUFSIZE=128
|
||||
CONFIG_NSH_CMDOPT_HEXDUMP=y
|
||||
CONFIG_NSH_FILEIOSIZE=512
|
||||
|
||||
#
|
||||
# Scripting Support
|
||||
#
|
||||
# CONFIG_NSH_DISABLESCRIPT is not set
|
||||
# CONFIG_NSH_DISABLE_ITEF is not set
|
||||
# CONFIG_NSH_DISABLE_LOOPS is not set
|
||||
|
||||
#
|
||||
# Console Configuration
|
||||
#
|
||||
CONFIG_NSH_CONSOLE=y
|
||||
# CONFIG_NSH_USBCONSOLE is not set
|
||||
# CONFIG_NSH_ALTCONDEV is not set
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
# CONFIG_NSH_LOGIN is not set
|
||||
# CONFIG_NSH_CONSOLE_LOGIN is not set
|
||||
|
||||
#
|
||||
# NxWidgets/NxWM
|
||||
#
|
||||
|
||||
#
|
||||
# Platform-specific Support
|
||||
#
|
||||
# CONFIG_PLATFORM_CONFIGDATA is not set
|
||||
|
||||
#
|
||||
# System Libraries and NSH Add-Ons
|
||||
#
|
||||
CONFIG_SYSTEM_CDCACM=y
|
||||
CONFIG_SYSTEM_CDCACM_DEVMINOR=1
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
# CONFIG_SYSTEM_CUTERM is not set
|
||||
# CONFIG_SYSTEM_FREE is not set
|
||||
# CONFIG_SYSTEM_HEX2BIN is not set
|
||||
# CONFIG_SYSTEM_HEXED is not set
|
||||
# CONFIG_SYSTEM_INSTALL is not set
|
||||
# CONFIG_SYSTEM_RAMTEST is not set
|
||||
CONFIG_READLINE_HAVE_EXTMATCH=y
|
||||
CONFIG_SYSTEM_READLINE=y
|
||||
CONFIG_READLINE_ECHO=y
|
||||
# CONFIG_READLINE_TABCOMPLETION is not set
|
||||
# CONFIG_READLINE_CMD_HISTORY is not set
|
||||
# CONFIG_SYSTEM_SUDOKU is not set
|
||||
# CONFIG_SYSTEM_SYSTEM is not set
|
||||
# CONFIG_SYSTEM_TEE is not set
|
||||
# CONFIG_SYSTEM_UBLOXMODEM is not set
|
||||
# CONFIG_SYSTEM_VI is not set
|
||||
# CONFIG_SYSTEM_ZMODEM is not set
|
92
configs/bambino-200e/nsh/setenv.sh
Normal file
92
configs/bambino-200e/nsh/setenv.sh
Normal file
@ -0,0 +1,92 @@
|
||||
#!/bin/bash
|
||||
# configs/bambino-200e/nsh/setenv.sh
|
||||
#
|
||||
# Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
# Alan Carvalho de Assis acassis@gmail.com [nuttx] <nuttx@yahoogroups.com>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
if [ "$_" = "$0" ] ; then
|
||||
echo "You must source this script, not run it!" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
WD=`pwd`
|
||||
if [ ! -x "setenv.sh" ]; then
|
||||
echo "This script must be executed from the top-level NuttX build directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${PATH_ORIG}" ]; then
|
||||
export PATH_ORIG="${PATH}"
|
||||
fi
|
||||
|
||||
# This is the Cygwin path to the location where I installed the Code Red
|
||||
# toolchain under windows. You will have to edit this if you install the
|
||||
# Code Red toolchain in any other location or if you install a different
|
||||
# version
|
||||
export TOOLCHAIN_BIN="/cygdrive/c/code_red/RedSuite_4.2.3_379/redsuite/Tools/bin"
|
||||
#export SCRIPT_BIN="/cygdrive/c/code_red/RedSuite_4.2.3_379/redsuite/bin"
|
||||
export SCRIPT_BIN="/cygdrive/c/nxp/LPCXpresso_4.2.3_292/lpcxpresso/bin"
|
||||
|
||||
# This is the Cygwin path to the location where I installed the CodeSourcery
|
||||
# toolchain under windows. You will also have to edit this if you install
|
||||
# the CodeSourcery toolchain in any other location
|
||||
#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin"
|
||||
#export SCRIPT_BIN=
|
||||
|
||||
# These are the Cygwin paths to the locations where I installed the Atollic
|
||||
# toolchain under windows. You will also have to edit this if you install
|
||||
# the Atollic toolchain in any other location. /usr/bin is added before
|
||||
# the Atollic bin path because there is are binaries named gcc.exe and g++.exe
|
||||
# at those locations as well.
|
||||
#export TOOLCHAIN_BIN="/usr/bin:/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for ARM Pro 2.3.0/ARMTools/bin"
|
||||
#export TOOLCHAIN_BIN="/usr/bin:/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for STMicroelectronics STM32 Lite 2.3.0/ARMTools/bin"
|
||||
#export SCRIPT_BIN=
|
||||
|
||||
# This is the Cygwin path to the location where I build the buildroot
|
||||
# toolchain.
|
||||
#export TOOLCHAIN_BIN="${WD}/../buildroot/build_arm_nofpu/staging_dir/bin"
|
||||
#export SCRIPT_BIN=
|
||||
|
||||
# And add the selected toolchain path[s] to the PATH variable
|
||||
|
||||
export PATH="/sbin:/usr/sbin:${PATH_ORIG}"
|
||||
|
||||
if [ ! -z ${SCRIPT_BIN} ]; then
|
||||
export PATH="${SCRIPT_BIN}:${PATH}"
|
||||
fi
|
||||
|
||||
export PATH="${TOOLCHAIN_BIN}:${PATH}"
|
||||
echo "PATH : ${PATH}"
|
||||
|
||||
# Set an alias that can be used to put the LPC43xx in boot mode
|
||||
|
||||
alias lpc43xx='${SCRIPT_BIN}/Scripts/bootLPCXpresso.cmd winusb'
|
156
configs/bambino-200e/scripts/flash.sh
Normal file
156
configs/bambino-200e/scripts/flash.sh
Normal file
@ -0,0 +1,156 @@
|
||||
#!/bin/bash
|
||||
####################################################################################
|
||||
# flash.sh
|
||||
#
|
||||
# Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
# Alan Carvalho de Assis acassis@gmail.com [nuttx] <nuttx@yahoogroups.com>
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
####################################################################################
|
||||
set -x
|
||||
|
||||
USAGE="$0 <nuttx-path>"
|
||||
|
||||
# LPCXpresso 3.6 installed at /cygdrive/c/nxp/lpcxpresso_3.6"
|
||||
|
||||
BINDIR="/cygdrive/c/nxp/LPCXpresso_4.2.3_292/lpcxpresso/bin"
|
||||
|
||||
# RedSuite with LPC4330 support installed at /cygdrive/c/code_red/RedSuite_4.2.3_379 "
|
||||
|
||||
#BINDIR="/cygdrive/c/code_red/RedSuite_4.2.3_379/redsuite/bin"
|
||||
|
||||
TARGET=LPC4330
|
||||
|
||||
echo "############################################################################"
|
||||
echo "# Assumptions:"
|
||||
echo "#"
|
||||
echo "# - Windows 7"
|
||||
echo "# - Binaries installed at ${BINDIR}"
|
||||
echo "# - AXF image built with Code Red"
|
||||
echo "# - ${TARGET}"
|
||||
echo "#"
|
||||
echo "# You will need to edit this is any of the above are false"
|
||||
echo "#"
|
||||
echo "############################################################################"
|
||||
echo ""
|
||||
|
||||
# This is the default install location for binaries on Windows (note that this
|
||||
# path could change with the Code Red version number)
|
||||
|
||||
if [ ! -d "${BINDIR}" ]; then
|
||||
echo "Directory ${BINDIR} does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# This is the relative path to the booLPCXpresso utility.
|
||||
|
||||
BOOTLPC="Scripts/bootLPCXpresso.cmd"
|
||||
if [ ! -x "${BINDIR}/${BOOTLPC}" ]; then
|
||||
echo "No executable at ${BINDIR}/${BOOTLPC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# bootLPCXpresso arguments
|
||||
|
||||
BOOTLPC_ARG=winusb # Win7
|
||||
|
||||
# Use the LPC18xx/LPC43xx flash utility
|
||||
|
||||
FLASHUTIL="crt_emu_lpc18_43_nxp" # for LPC18xx/LPC43xx parts
|
||||
|
||||
if [ ! -x "${BINDIR}/${FLASHUTIL}" ]; then
|
||||
echo "No executable file at ${BINDIR}/${FLASHUTIL}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# FLUSHUTIL arguements
|
||||
|
||||
WIRE="-wire=winusb" # for LPC-Link on Windows Vista/Windows 7)
|
||||
|
||||
# The nuttx directory must be provided as an argument
|
||||
|
||||
NUTTX=$1
|
||||
if [ -z "${NUTTX}" ]; then
|
||||
echo "Missing argument"
|
||||
echo $USAGE
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d "${NUTTX}" ]; then
|
||||
echo "Directory ${NUTTX} does not exist"
|
||||
echo $USAGE
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# The binary to download:
|
||||
|
||||
if [ ! -f "${NUTTX}/nuttx.axf" ]; then
|
||||
if [ -f "${NUTTX}/nuttx" ]; then
|
||||
echo "Renaming ${NUTTX}/nuttx to ${NUTTX}/nuttx.axf"
|
||||
mv ${NUTTX}/nuttx ${NUTTX}/nuttx.axf
|
||||
fi
|
||||
else
|
||||
if [ -f "${NUTTX}/nuttx" ]; then
|
||||
echo "Both ${NUTTX}/nuttx ${NUTTX}/nuttx.axf exist.."
|
||||
echo " Deleting ${NUTTX}/nuttx.axf"
|
||||
rm -f ${NUTTX}/nuttx.axf
|
||||
echo "Renaming ${NUTTX}/nuttx to ${NUTTX}/nuttx.axf"
|
||||
mv ${NUTTX}/nuttx ${NUTTX}/nuttx.axf
|
||||
fi
|
||||
fi
|
||||
NUTTXPATH=`cygpath -w "${NUTTX}/nuttx.axf"`
|
||||
|
||||
# First of all boot the LPC-Link using the script: ${BINDIR}/${BOOTLPC}
|
||||
|
||||
cd ${BINDIR} || \
|
||||
{ echo "Failed to CD to ${BINDIR}"; exit 1; }
|
||||
./${BOOTLPC} ${BOOTLPC_ARG} || \
|
||||
{ echo "'${BOOTLPC} ${BOOTLPC_ARG}' Failed"; }
|
||||
|
||||
echo ""
|
||||
echo "Wait a bit"
|
||||
echo "5..."
|
||||
sleep 1
|
||||
echo "4..."
|
||||
sleep 1
|
||||
echo "3..."
|
||||
sleep 1
|
||||
echo "2..."
|
||||
sleep 1
|
||||
echo "1..."
|
||||
sleep 1
|
||||
echo "0..."
|
||||
echo ""
|
||||
|
||||
# Then program the FLASH
|
||||
|
||||
cd ${BINDIR} || \
|
||||
{ echo "Failed to CD to ${BINDIR}"; exit 1; }
|
||||
./${FLASHUTIL} ${WIRE} -p${TARGET} -flash-load-exec="${NUTTXPATH}"
|
151
configs/bambino-200e/scripts/ramconfig.ld
Normal file
151
configs/bambino-200e/scripts/ramconfig.ld
Normal file
@ -0,0 +1,151 @@
|
||||
/****************************************************************************
|
||||
* configs/bambino-200e/scripts/ramconfig.ld
|
||||
*
|
||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Alan Carvalho de Assis acassis@gmail.com [nuttx] <nuttx@yahoogroups.com>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
/*
|
||||
* Power-Up Reset Overview
|
||||
* -----------------------
|
||||
*
|
||||
* The ARM core starts executing code on reset with the program counter set
|
||||
* to 0x0000 0000. The LPC43xx contains a shadow pointer register that
|
||||
* allows areas of memory to be mapped to address 0x0000 0000. The default,
|
||||
* reset value of the shadow pointer is 0x1040 0000 so that on reset code in
|
||||
* the boot ROM is always executed first.
|
||||
*
|
||||
* The boot starts after reset is released. The IRC is selected as CPU clock
|
||||
* and the Cortex-M4 starts the boot loader. By default the JTAG access to the
|
||||
* chip is disabled at reset. The boot ROM determines the boot mode based on
|
||||
* the OTP BOOT_SRC value or reset state pins. For flash-based parts, the part
|
||||
* boots from internal flash by default. Otherwse, the boot ROM copies the
|
||||
* image to internal SRAM at location 0x1000 0000, sets the ARM's shadow
|
||||
* pointer to 0x1000 0000, and jumps to that location.
|
||||
*
|
||||
* However, using JTAG the executable image can be also loaded directly into
|
||||
* and executed from SRAM.
|
||||
*/
|
||||
|
||||
/* The LPC4330 on the LPC4330-Xplorer has the following memory resources:
|
||||
*
|
||||
* 1. 4096Kb of SPIFI FLASH beginning at address 0x1400:0000
|
||||
* 2. 264KB of total SRAM:
|
||||
* a. 128KB of SRAM in the CPU block beginning at address 0x1000:0000
|
||||
* b. 72KB beginning at address 0x1008:0000 and
|
||||
* c. 64KB of AHB SRAM in three banks beginning at addresses 0x2000:0000,
|
||||
* 0x2000:8000 and 0x2000:C000.
|
||||
* 3. No internal FLASH
|
||||
*
|
||||
* Here we assume that:
|
||||
*
|
||||
* 1. We will be running out of SRAM at 0x1000:0000, and
|
||||
* 2. All .data and .bss will all fit into the 72KB SRAM block.
|
||||
*
|
||||
* NOTE: That initialized data is kept in the program memory SRAM and copied
|
||||
* to .data SRAM. This is wasteful and unnecessary but provides a good test
|
||||
* for future, FLASH-resident code.
|
||||
*/
|
||||
|
||||
MEMORY
|
||||
{
|
||||
progmem (rx) : ORIGIN = 0x10000000, LENGTH = 128K
|
||||
datamem (rwx) : ORIGIN = 0x10080000, LENGTH = 72K
|
||||
}
|
||||
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(__start) /* Treat __start as the anchor for dead code stripping */
|
||||
EXTERN(_vectors) /* Force the vectors to be included in the output */
|
||||
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(.);
|
||||
} > progmem
|
||||
|
||||
.init_section : {
|
||||
_sinit = ABSOLUTE(.);
|
||||
*(.init_array .init_array.*)
|
||||
_einit = ABSOLUTE(.);
|
||||
} > progmem
|
||||
|
||||
.ARM.extab : {
|
||||
*(.ARM.extab*)
|
||||
} > progmem
|
||||
|
||||
__exidx_start = ABSOLUTE(.);
|
||||
.ARM.exidx : {
|
||||
*(.ARM.exidx*)
|
||||
} > progmem
|
||||
__exidx_end = ABSOLUTE(.);
|
||||
|
||||
_eronly = ABSOLUTE(.);
|
||||
|
||||
.data : {
|
||||
_sdata = ABSOLUTE(.);
|
||||
*(.data .data.*)
|
||||
*(.gnu.linkonce.d.*)
|
||||
CONSTRUCTORS
|
||||
_edata = ABSOLUTE(.);
|
||||
} > datamem AT > progmem
|
||||
|
||||
.bss : { /* BSS */
|
||||
_sbss = ABSOLUTE(.);
|
||||
*(.bss .bss.*)
|
||||
*(.gnu.linkonce.b.*)
|
||||
*(COMMON)
|
||||
_ebss = ABSOLUTE(.);
|
||||
} > datamem
|
||||
/* 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) }
|
||||
}
|
147
configs/bambino-200e/scripts/spificonfig.ld
Normal file
147
configs/bambino-200e/scripts/spificonfig.ld
Normal file
@ -0,0 +1,147 @@
|
||||
/****************************************************************************
|
||||
* configs/bambino-200e/scripts/spificonfig.ld
|
||||
*
|
||||
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Alan Carvalho de Assis acassis@gmail.com [nuttx] <nuttx@yahoogroups.com>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
/*
|
||||
* Power-Up Reset Overview
|
||||
* -----------------------
|
||||
*
|
||||
* The ARM core starts executing code on reset with the program counter set
|
||||
* to 0x0000 0000. The LPC43xx contains a shadow pointer register that
|
||||
* allows areas of memory to be mapped to address 0x0000 0000. The default,
|
||||
* reset value of the shadow pointer is 0x1040 0000 so that on reset code in
|
||||
* the boot ROM is always executed first.
|
||||
*
|
||||
* The boot starts after reset is released. The IRC is selected as CPU clock
|
||||
* and the Cortex-M4 starts the boot loader. By default the JTAG access to the
|
||||
* chip is disabled at reset. The boot ROM determines the boot mode based on
|
||||
* the OTP BOOT_SRC value or reset state pins. For flash-based parts, the part
|
||||
* boots from internal flash by default. Otherwse, the boot ROM copies the
|
||||
* image to internal SRAM at location 0x1000 0000, sets the ARM's shadow
|
||||
* pointer to 0x1000 0000, and jumps to that location.
|
||||
*
|
||||
* Of course, using JTAG the executable image can be also loaded directly
|
||||
* into and executed from SRAM.
|
||||
*/
|
||||
|
||||
/* The LPC4330 on the LPC4330-Xplorer has the following memory resources:
|
||||
*
|
||||
* 1. 4096Kb of SPIFI FLASH beginning at address 0x1400:0000
|
||||
* 2. 264KB of total SRAM:
|
||||
* a. 128KB of SRAM in the CPU block beginning at address 0x1000:0000
|
||||
* b. 72KB beginning at address 0x1008:0000 and
|
||||
* c. 64KB of AHB SRAM in three banks beginning at addresses 0x2000:0000,
|
||||
* 0x2000:8000 and 0x2000:C000.
|
||||
* 3. No internal FLASH
|
||||
*
|
||||
* Here we assume that:
|
||||
*
|
||||
* 1. We will be running out of SPIFI flash at 0x1400:0000, and
|
||||
* 2. All .data and .bss will all fit into the 128KB CPU SRAM block.
|
||||
*/
|
||||
|
||||
MEMORY
|
||||
{
|
||||
progmem (rx) : ORIGIN = 0x14000000, LENGTH = 1024K
|
||||
datamem (rwx) : ORIGIN = 0x10000000, LENGTH = 128K
|
||||
}
|
||||
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(__start) /* Treat __start as the anchor for dead code stripping */
|
||||
EXTERN(_vectors) /* Force the vectors to be included in the output */
|
||||
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(.);
|
||||
} > progmem
|
||||
|
||||
.init_section : {
|
||||
_sinit = ABSOLUTE(.);
|
||||
*(.init_array .init_array.*)
|
||||
_einit = ABSOLUTE(.);
|
||||
} > progmem
|
||||
|
||||
.ARM.extab : {
|
||||
*(.ARM.extab*)
|
||||
} > progmem
|
||||
|
||||
__exidx_start = ABSOLUTE(.);
|
||||
.ARM.exidx : {
|
||||
*(.ARM.exidx*)
|
||||
} > progmem
|
||||
__exidx_end = ABSOLUTE(.);
|
||||
|
||||
_eronly = ABSOLUTE(.);
|
||||
|
||||
.data : {
|
||||
_sdata = ABSOLUTE(.);
|
||||
*(.data .data.*)
|
||||
*(.gnu.linkonce.d.*)
|
||||
CONSTRUCTORS
|
||||
_edata = ABSOLUTE(.);
|
||||
} > datamem AT > progmem
|
||||
|
||||
.bss : { /* BSS */
|
||||
_sbss = ABSOLUTE(.);
|
||||
*(.bss .bss.*)
|
||||
*(.gnu.linkonce.b.*)
|
||||
*(COMMON)
|
||||
_ebss = ABSOLUTE(.);
|
||||
} > datamem
|
||||
/* 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) }
|
||||
}
|
2
configs/bambino-200e/src/.gitignore
vendored
Normal file
2
configs/bambino-200e/src/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/.depend
|
||||
/Make.dep
|
82
configs/bambino-200e/src/Makefile
Normal file
82
configs/bambino-200e/src/Makefile
Normal file
@ -0,0 +1,82 @@
|
||||
############################################################################
|
||||
# configs/bambino-200e/src/Makefile
|
||||
#
|
||||
# Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
# Alan Carvalho de Assis acassis@gmail.com [nuttx] <nuttx@yahoogroups.com>
|
||||
#
|
||||
# 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 = lpc43_boot.c
|
||||
|
||||
ifeq ($(CONFIG_LIB_BOARDCTL),y)
|
||||
CSRCS += lpc43_appinit.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ARCH_FPU),y)
|
||||
CSRCS += lpc43_ostest.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ARCH_LEDS),y)
|
||||
CSRCS += lpc43_autoleds.c
|
||||
else
|
||||
CSRCS += lpc43_userleds.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ARCH_BUTTONS),y)
|
||||
CSRCS += lpc43_buttons.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_USBMSC),y)
|
||||
CSRCS += lpc43_usbmsc.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SPIFI_LIBRARY),y)
|
||||
CFLAGS += -DEUROBIRD
|
||||
SPIFI_LIB = spifi_lib
|
||||
CSRCS += $(SPIFI_LIB)/spifi_rom_api.c
|
||||
#CSRCS += $(SPIFI_LIB)/amic.c
|
||||
#CSRCS += $(SPIFI_LIB)/atmel.c
|
||||
#CSRCS += $(SPIFI_LIB)/chi.c
|
||||
#CSRCS += $(SPIFI_LIB)/eon.c
|
||||
#CSRCS += $(SPIFI_LIB)/esmt.c
|
||||
#CSRCS += $(SPIFI_LIB)/esmt.c
|
||||
#CSRCS += $(SPIFI_LIB)/giga.c
|
||||
#CSRCS += $(SPIFI_LIB)/macronix.c
|
||||
#CSRCS += $(SPIFI_LIB)/numonyx.c
|
||||
CSRCS += $(SPIFI_LIB)/spansion.c
|
||||
#CSRCS += $(SPIFI_LIB)/sst.c
|
||||
CSRCS += $(SPIFI_LIB)/winbond.c
|
||||
endif
|
||||
|
||||
include $(TOPDIR)/configs/Board.mk
|
127
configs/bambino-200e/src/bambino-200e.h
Normal file
127
configs/bambino-200e/src/bambino-200e.h
Normal file
@ -0,0 +1,127 @@
|
||||
/****************************************************************************
|
||||
* configs/bambino-200e/src/bambino-200e.h
|
||||
*
|
||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Alan Carvalho de Assis acassis@gmail.com [nuttx] <nuttx@yahoogroups.com>
|
||||
*
|
||||
* 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_BAMBINO_200E_SRC_BAMBINO_H
|
||||
#define _CONFIGS_BAMBINO_200E_SRC_BAMBINO_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/compiler.h>
|
||||
|
||||
#include "lpc43_pinconfig.h"
|
||||
#include "lpc43_gpio.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* LEDs GPIO PIN SIGNAL NAME
|
||||
* -------------------------------- ------- --------------
|
||||
* gpio3[7] - LED1 101 GPIO3[7]
|
||||
* gpio5[5] - LED2 91 GPIO5[5]
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/* Definitions to configure LED pins as GPIOs:
|
||||
*
|
||||
* - Floating
|
||||
* - Normal drive
|
||||
* - No buffering, glitch filtering, slew=slow
|
||||
*/
|
||||
|
||||
#define PINCONFIG_LED1 PINCONF_GPIO3p7
|
||||
#define PINCONFIG_LED2 PINCONF_GPIO5p5
|
||||
#define GPIO_LED1 (GPIO_MODE_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT3 | GPIO_PIN7)
|
||||
#define GPIO_LED2 (GPIO_MODE_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT5 | GPIO_PIN5)
|
||||
|
||||
/****************************************************************************
|
||||
* Buttons GPIO
|
||||
* ----------------------------
|
||||
* gpio0[7] - User Button USR1
|
||||
****************************************************************************/
|
||||
|
||||
#define BAMBINO_BUT1 (GPIO_INTBOTH | GPIO_FLOAT | GPIO_PORT0 | GPIO_PIN7)
|
||||
|
||||
/* Button IRQ numbers */
|
||||
|
||||
#define BAMBINO_BUT1_IRQ LPC43_IRQ_P0p23
|
||||
|
||||
#define GPIO_SSP0_SCK GPIO_SSP0_SCK_1
|
||||
#define GPIO_SSP0_SSEL GPIO_SSP0_SSEL_1
|
||||
#define GPIO_SSP0_MISO GPIO_SSP0_MISO_1
|
||||
#define GPIO_SSP0_MOSI GPIO_SSP0_MOSI_1
|
||||
|
||||
/* We need to redefine USB_PWRD as GPIO to get USB Host working
|
||||
* Also remember to add 2 resistors of 15K to D+ and D- pins.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_USBHOST
|
||||
# ifdef GPIO_USB_PWRD
|
||||
# undef GPIO_USB_PWRD
|
||||
# define GPIO_USB_PWRD (GPIO_INPUT | GPIO_PORT1 | GPIO_PIN22)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: lpc43_sspdev_initialize
|
||||
*
|
||||
* Description:
|
||||
* Called to configure SPI chip select GPIO pins for the Lincoln 80 board.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void weak_function lpc43_sspdev_initialize(void);
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* _CONFIGS_BAMBINO_200E_SRC_BAMBINO_H */
|
166
configs/bambino-200e/src/lpc43_appinit.c
Normal file
166
configs/bambino-200e/src/lpc43_appinit.c
Normal file
@ -0,0 +1,166 @@
|
||||
/****************************************************************************
|
||||
* config/bambino-200e/src/lpc43_appinit.c
|
||||
*
|
||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Alan Carvalho de Assis acassis@gmail.com [nuttx] <nuttx@yahoogroups.com>
|
||||
*
|
||||
* 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 <stdio.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/board.h>
|
||||
|
||||
#include "chip.h"
|
||||
|
||||
#ifdef CONFIG_LPC43_SPIFI
|
||||
# include <nuttx/mtd/mtd.h>
|
||||
# include "lpc43_spifi.h"
|
||||
|
||||
# ifdef CONFIG_SPFI_NXFFS
|
||||
# include <sys/mount.h>
|
||||
# include <nuttx/fs/nxffs.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
#ifndef CONFIG_SPIFI_DEVNO
|
||||
# define CONFIG_SPIFI_DEVNO 0
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: nsh_spifi_initialize
|
||||
*
|
||||
* Description:
|
||||
* Make the SPIFI (or part of it) into a block driver that can hold a
|
||||
* file system.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_LPC43_SPIFI
|
||||
static int nsh_spifi_initialize(void)
|
||||
{
|
||||
FAR struct mtd_dev_s *mtd;
|
||||
int ret;
|
||||
|
||||
/* Initialize the SPIFI interface and create the MTD driver instance */
|
||||
|
||||
mtd = lpc43_spifi_initialize();
|
||||
if (!mtd)
|
||||
{
|
||||
ferr("ERROR: lpc43_spifi_initialize failed\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_SPFI_NXFFS
|
||||
/* And finally, use the FTL layer to wrap the MTD driver as a block driver */
|
||||
|
||||
ret = ftl_initialize(CONFIG_SPIFI_DEVNO, mtd);
|
||||
if (ret < 0)
|
||||
{
|
||||
ferr("ERROR: Initializing the FTL layer: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
/* Initialize to provide NXFFS on the MTD interface */
|
||||
|
||||
ret = nxffs_initialize(mtd);
|
||||
if (ret < 0)
|
||||
{
|
||||
ferr("ERROR: NXFFS initialization failed: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Mount the file system at /mnt/spifi */
|
||||
|
||||
ret = mount(NULL, "/mnt/spifi", "nxffs", 0, NULL);
|
||||
if (ret < 0)
|
||||
{
|
||||
ferr("ERROR: Failed to mount the NXFFS volume: %d\n", errno);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
return OK;
|
||||
}
|
||||
#else
|
||||
# define nsh_spifi_initialize() (OK)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* 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 initalization logic and the 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)
|
||||
{
|
||||
/* Initialize the SPIFI block device */
|
||||
|
||||
return nsh_spifi_initialize();
|
||||
}
|
177
configs/bambino-200e/src/lpc43_autoleds.c
Normal file
177
configs/bambino-200e/src/lpc43_autoleds.c
Normal file
@ -0,0 +1,177 @@
|
||||
/****************************************************************************
|
||||
* configs/bambino-200e/src/lpc43_autoleds.c
|
||||
*
|
||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Alan Carvalho de Assis acassis@gmail.com [nuttx] <nuttx@yahoogroups.com>
|
||||
*
|
||||
* 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 <nuttx/board.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "chip.h"
|
||||
#include "up_arch.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
#include "bambino-200e.h"
|
||||
|
||||
#ifdef CONFIG_ARCH_LEDS
|
||||
|
||||
/* LED definitions **********************************************************/
|
||||
/* The LPC4330-Xplorer has 2 user-controllable LEDs labeled D2 an D3 in the
|
||||
* schematic and on but referred to has LED1 and LED2 here, respectively.
|
||||
*
|
||||
* LED1 D2 GPIO1[12]
|
||||
* LED2 D3 GPIO1[11]
|
||||
*
|
||||
* LEDs are pulled high to a low output illuminates the LED.
|
||||
*
|
||||
* If CONFIG_ARCH_LEDS is defined, the LEDs will be controlled as follows
|
||||
* for NuttX debug functionality (where NC means "No Change").
|
||||
*
|
||||
* ON OFF
|
||||
* LED1 LED2 LED1 LED2
|
||||
* LED_STARTED 0 OFF OFF - -
|
||||
* LED_HEAPALLOCATE 1 ON OFF - -
|
||||
* LED_IRQSENABLED 1 ON OFF - -
|
||||
* LED_STACKCREATED 1 ON OFF - -
|
||||
* LED_INIRQ 2 NC ON NC OFF
|
||||
* LED_SIGNAL 2 NC ON NC OFF
|
||||
* LED_ASSERTION 2 NC ON NC OFF
|
||||
* LED_PANIC 2 NC ON NC OFF
|
||||
*
|
||||
* If CONFIG_ARCH_LEDS is not defined, then the LEDs are completely under
|
||||
* control of the application. The following interfaces are then available
|
||||
* for application control of the LEDs:
|
||||
*
|
||||
* void board_userled_initialize(void);
|
||||
* void board_userled(int led, bool ledon);
|
||||
* void board_userled_all(uint8_t ledset);
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: led_dumppins
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef LED_VERBOSE
|
||||
static void led_dumppins(FAR const char *msg)
|
||||
{
|
||||
lpc43_pin_dump(PINCONFIG_LED1, msg);
|
||||
lpc43_gpio_dump(GPIO_LED2, msg);
|
||||
}
|
||||
#else
|
||||
# define led_dumppins(m)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_autoled_initialize
|
||||
****************************************************************************/
|
||||
|
||||
void board_autoled_initialize(void)
|
||||
{
|
||||
/* Configure all LED pins as GPIO outputs */
|
||||
|
||||
led_dumppins("board_autoled_initialize() Entry)");
|
||||
|
||||
/* Configure LED pins as GPIOs, then configure GPIOs as outputs */
|
||||
|
||||
lpc43_pin_config(PINCONFIG_LED1);
|
||||
lpc43_gpio_config(GPIO_LED1);
|
||||
|
||||
lpc43_pin_config(PINCONFIG_LED2);
|
||||
lpc43_gpio_config(GPIO_LED2);
|
||||
|
||||
led_dumppins("board_autoled_initialize() Exit");
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_autoled_on
|
||||
****************************************************************************/
|
||||
|
||||
void board_autoled_on(int led)
|
||||
{
|
||||
switch (led)
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
lpc43_gpio_write(GPIO_LED1, true); /* LED1 OFF */
|
||||
lpc43_gpio_write(GPIO_LED2, true); /* LED2 OFF */
|
||||
break;
|
||||
|
||||
case 1:
|
||||
lpc43_gpio_write(GPIO_LED1, false); /* LED1 ON */
|
||||
lpc43_gpio_write(GPIO_LED2, true); /* LED2 OFF */
|
||||
break;
|
||||
|
||||
case 2:
|
||||
lpc43_gpio_write(GPIO_LED2, false); /* LED2 ON */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_autoled_off
|
||||
****************************************************************************/
|
||||
|
||||
void board_autoled_off(int led)
|
||||
{
|
||||
switch (led)
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
case 1:
|
||||
break;
|
||||
|
||||
case 2:
|
||||
lpc43_gpio_write(GPIO_LED2, true); /* LED2 OFF */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ARCH_LEDS */
|
74
configs/bambino-200e/src/lpc43_boot.c
Normal file
74
configs/bambino-200e/src/lpc43_boot.c
Normal file
@ -0,0 +1,74 @@
|
||||
/************************************************************************************
|
||||
* configs/bambino-200e/src/lpc43_boot.c
|
||||
*
|
||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Alan Carvalho de Assis acassis@gmail.com [nuttx] <nuttx@yahoogroups.com>
|
||||
*
|
||||
* 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 <nuttx/board.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "up_arch.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
#include "bambino-200e.h"
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Name: lpc43_boardinitialize
|
||||
*
|
||||
* Description:
|
||||
* All LPC43xx 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 lpc43_boardinitialize(void)
|
||||
{
|
||||
/* Configure on-board LEDs if LED support has been selected. */
|
||||
|
||||
#ifdef CONFIG_ARCH_LEDS
|
||||
board_autoled_initialize();
|
||||
#endif
|
||||
}
|
220
configs/bambino-200e/src/lpc43_buttons.c
Normal file
220
configs/bambino-200e/src/lpc43_buttons.c
Normal file
@ -0,0 +1,220 @@
|
||||
/****************************************************************************
|
||||
* configs/bambino-200e/src/lpc43_buttons.c
|
||||
*
|
||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Alan Carvalho de Assis acassis@gmail.com [nuttx] <nuttx@yahoogroups.com>
|
||||
*
|
||||
* 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 <nuttx/arch.h>
|
||||
#include <nuttx/board.h>
|
||||
#include <nuttx/irq.h>
|
||||
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "bambino-200e.h"
|
||||
|
||||
#ifdef CONFIG_ARCH_BUTTONS
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/* Pin configuration for each LPC4330 Xplorer button. This array is indexed
|
||||
* by the BUTTON_* definitions in board.h
|
||||
*/
|
||||
|
||||
static const uint16_t g_buttoncfg[BOARD_NUM_BUTTONS] =
|
||||
{
|
||||
BAMBINO_BUT1
|
||||
};
|
||||
|
||||
/* This array defines all of the interrupt handlers current attached to
|
||||
* button events.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_ARCH_IRQBUTTONS) && defined(CONFIG_LPC43_GPIO_IRQ)
|
||||
static xcpt_t g_buttonisr[BOARD_NUM_BUTTONS];
|
||||
|
||||
/* This array provides the mapping from button ID numbers to button IRQ
|
||||
* numbers.
|
||||
*/
|
||||
|
||||
static uint8_t g_buttonirq[BOARD_NUM_BUTTONS] =
|
||||
{
|
||||
BAMBINO_BUT1_IRQ
|
||||
};
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_button_initialize
|
||||
*
|
||||
* Description:
|
||||
* board_button_initialize() must be called to initialize button resources.
|
||||
* After that, board_buttons() may be called to collect the current state
|
||||
* of all buttons or board_button_irq() may be called to register button
|
||||
* interrupt handlers.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void board_button_initialize(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* Configure the GPIO pins as interrupting inputs. */
|
||||
|
||||
for (i = 0; i < BOARD_NUM_BUTTONS; i++)
|
||||
{
|
||||
lpc43_configgpio(g_buttoncfg[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_buttons
|
||||
*
|
||||
* Description:
|
||||
* board_button_initialize() must be called to initialize button resources. After
|
||||
* that, board_buttons() may be called to collect the current state of all
|
||||
* buttons.
|
||||
*
|
||||
* board_buttons() may be called at any time to harvest the state of every
|
||||
* button. The state of the buttons is returned as a bitset with one
|
||||
* bit corresponding to each button: If the bit is set, then the button
|
||||
* is pressed. See the BOARD_BUTTON_*_BIT and BOARD_JOYSTICK_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
uint8_t board_buttons(void)
|
||||
{
|
||||
uint8_t ret = 0;
|
||||
int i;
|
||||
|
||||
/* Check that state of each key */
|
||||
|
||||
for (i = 0; i < BOARD_NUM_BUTTONS; i++)
|
||||
{
|
||||
/* A LOW value means that the key is pressed. */
|
||||
|
||||
bool released = lpc43_gpio_read(g_buttoncfg[i]);
|
||||
|
||||
/* Accumulate the set of depressed (not released) keys */
|
||||
|
||||
if (!released)
|
||||
{
|
||||
ret |= (1 << i);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Button support.
|
||||
*
|
||||
* Description:
|
||||
* board_button_initialize() must be called to initialize button resources. After
|
||||
* that, board_button_irq() may be called to register button interrupt handlers.
|
||||
*
|
||||
* board_button_irq() may be called to register an interrupt handler that will
|
||||
* be called when a button is depressed or released. The ID value is a
|
||||
* button enumeration value that uniquely identifies a button resource. See the
|
||||
* BOARD_BUTTON_* and BOARD_JOYSTICK_* definitions in board.h for the meaning
|
||||
* of enumeration values. The previous interrupt handler address is returned
|
||||
* (so that it may restored, if so desired).
|
||||
*
|
||||
* Note that board_button_irq() also enables button interrupts. Button
|
||||
* interrupts will remain enabled after the interrupt handler is attached.
|
||||
* Interrupts may be disabled (and detached) by calling board_button_irq with
|
||||
* irqhandler equal to NULL.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_ARCH_IRQBUTTONS) && defined(CONFIG_LPC43_GPIO_IRQ)
|
||||
xcpt_t board_button_irq(int id, xcpt_t irqhandler)
|
||||
{
|
||||
xcpt_t oldhandler = NULL;
|
||||
irqstate_t flags;
|
||||
int irq;
|
||||
|
||||
/* Verify that the button ID is within range */
|
||||
|
||||
if ((unsigned)id < BOARD_NUM_BUTTONS)
|
||||
{
|
||||
/* Return the current button handler and set the new interrupt handler */
|
||||
|
||||
oldhandler = g_buttonisr[id];
|
||||
g_buttonisr[id] = irqhandler;
|
||||
|
||||
/* Disable interrupts until we are done */
|
||||
|
||||
flags = enter_critical_section();
|
||||
|
||||
/* Configure the interrupt. Either attach and enable the new
|
||||
* interrupt or disable and detach the old interrupt handler.
|
||||
*/
|
||||
|
||||
irq = g_buttonirq[id];
|
||||
if (irqhandler)
|
||||
{
|
||||
/* Attach then enable the new interrupt handler */
|
||||
|
||||
(void)irq_attach(irq, irqhandler);
|
||||
up_enable_irq(irq);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Disable then detach the old interrupt handler */
|
||||
|
||||
up_disable_irq(irq);
|
||||
(void)irq_detach(irq);
|
||||
}
|
||||
leave_critical_section(flags);
|
||||
}
|
||||
|
||||
return oldhandler;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_ARCH_BUTTONS */
|
112
configs/bambino-200e/src/lpc43_ostest.c
Normal file
112
configs/bambino-200e/src/lpc43_ostest.c
Normal file
@ -0,0 +1,112 @@
|
||||
/************************************************************************************
|
||||
* configs/bambino-200e/src/lpc43_ostest.c
|
||||
*
|
||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Alan Carvalho de Assis acassis@gmail.com [nuttx] <nuttx@yahoogroups.com>
|
||||
*
|
||||
* 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 <string.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/irq.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "up_arch.h"
|
||||
#include "up_internal.h"
|
||||
#include "bambino-200e.h"
|
||||
|
||||
/************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
|
||||
/* Configuration ********************************************************************/
|
||||
|
||||
#undef HAVE_FPU
|
||||
#if defined(CONFIG_ARCH_FPU) && defined(CONFIG_EXAMPLES_OSTEST_FPUSIZE) && \
|
||||
defined(CONFIG_SCHED_WAITPID) && !defined(CONFIG_DISABLE_SIGNALS) && \
|
||||
!defined(CONFIG_ARMV7M_CMNVECTOR)
|
||||
# define HAVE_FPU 1
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FPU
|
||||
|
||||
#if CONFIG_EXAMPLES_OSTEST_FPUSIZE != (4*SW_FPU_REGS)
|
||||
# error "CONFIG_EXAMPLES_OSTEST_FPUSIZE has the wrong size"
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Private Data
|
||||
************************************************************************************/
|
||||
|
||||
static uint32_t g_saveregs[XCPTCONTEXT_REGS];
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
|
||||
/* Given an array of size CONFIG_EXAMPLES_OSTEST_FPUSIZE, this function will return
|
||||
* the current FPU registers.
|
||||
*/
|
||||
|
||||
void arch_getfpu(FAR uint32_t *fpusave)
|
||||
{
|
||||
irqstate_t flags;
|
||||
|
||||
/* Take a snapshot of the thread context right now */
|
||||
|
||||
flags = enter_critical_section();
|
||||
up_saveusercontext(g_saveregs);
|
||||
|
||||
/* Return only the floating register values */
|
||||
|
||||
memcpy(fpusave, &g_saveregs[REG_S0], (4*SW_FPU_REGS));
|
||||
leave_critical_section(flags);
|
||||
}
|
||||
|
||||
/* Given two arrays of size CONFIG_EXAMPLES_OSTEST_FPUSIZE this function
|
||||
* will compare them and return true if they are identical.
|
||||
*/
|
||||
|
||||
bool arch_cmpfpu(FAR const uint32_t *fpusave1, FAR const uint32_t *fpusave2)
|
||||
{
|
||||
return memcmp(fpusave1, fpusave2, (4*SW_FPU_REGS)) == 0;
|
||||
}
|
||||
|
||||
#endif /* HAVE_FPU */
|
134
configs/bambino-200e/src/lpc43_userleds.c
Normal file
134
configs/bambino-200e/src/lpc43_userleds.c
Normal file
@ -0,0 +1,134 @@
|
||||
/****************************************************************************
|
||||
* configs/bambino-200e/src/lpc43_userleds.c
|
||||
*
|
||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Alan Carvalho de Assis acassis@gmail.com [nuttx] <nuttx@yahoogroups.com>
|
||||
*
|
||||
* 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 "chip.h"
|
||||
#include "up_arch.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
#include "bambino-200e.h"
|
||||
|
||||
#ifndef CONFIG_ARCH_LEDS
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* LED definitions **********************************************************/
|
||||
/* The LPC4330-Xplorer has 2 user-controllable LEDs labeled D2 an D3 in the
|
||||
* schematic and on but referred to has LED1 and LED2 here, respectively.
|
||||
*
|
||||
* LED1 D2 GPIO1[12]
|
||||
* LED2 D3 GPIO1[11]
|
||||
*
|
||||
* LEDs are pulled high to a low output illuminates the LED.
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: led_dumppins
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef LED_VERBOSE
|
||||
static void led_dumppins(FAR const char *msg)
|
||||
{
|
||||
lpc43_pin_dump(PINCONFIG_LED1, msg);
|
||||
lpc43_gpio_dump(GPIO_LED2, msg);
|
||||
}
|
||||
#else
|
||||
# define led_dumppins(m)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_userled_initialize
|
||||
****************************************************************************/
|
||||
|
||||
void board_userled_initialize(void)
|
||||
{
|
||||
/* Configure all LED GPIO lines */
|
||||
|
||||
led_dumppins("board_userled_initialize() Entry)");
|
||||
|
||||
/* Configure LED pins as GPIOs, then configure GPIOs as outputs */
|
||||
|
||||
lpc43_pin_config(PINCONFIG_LED1);
|
||||
lpc43_gpio_config(GPIO_LED1);
|
||||
|
||||
lpc43_pin_config(PINCONFIG_LED2);
|
||||
lpc43_gpio_config(GPIO_LED2);
|
||||
|
||||
led_dumppins("board_userled_initialize() Exit");
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_userled
|
||||
****************************************************************************/
|
||||
|
||||
void board_userled(int led, bool ledon)
|
||||
{
|
||||
uint16_t gpiocfg = (led == BOARD_LED1 ? GPIO_LED1 : GPIO_LED2);
|
||||
lpc43_gpio_write(gpiocfg, !ledon);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_userled_all
|
||||
****************************************************************************/
|
||||
|
||||
void board_userled_all(uint8_t ledset)
|
||||
{
|
||||
lpc43_gpio_write(GPIO_LED1, (ledset & BOARD_LED1_BIT) == 0);
|
||||
lpc43_gpio_write(GPIO_LED2, (ledset & BOARD_LED2_BIT) == 0);
|
||||
}
|
||||
|
||||
#endif /* !CONFIG_ARCH_LEDS */
|
@ -23,6 +23,7 @@ Contents
|
||||
o Buttons and LEDs
|
||||
o SMP
|
||||
o Configurations
|
||||
o Things to Do
|
||||
|
||||
STATUS
|
||||
======
|
||||
@ -116,7 +117,7 @@ SMP
|
||||
|
||||
Open Issues:
|
||||
|
||||
1. Currently all device interrupts are handled on the PRO CPU only. Critical
|
||||
1. Currently all device interrupts are handled on the PRO CPU only. Critical
|
||||
sections will attempt to disable interrupts but will now disable interrupts
|
||||
only on the current CPU (which may not be CPU0). Perhaps that should be a
|
||||
spinlock to prohibit execution of interrupts on CPU0 when other CPUs are in
|
||||
@ -196,3 +197,19 @@ NOTES:
|
||||
SMP operation.
|
||||
|
||||
NOTES:
|
||||
|
||||
Things to Do
|
||||
============
|
||||
|
||||
1. There is no support for an interrupt stack yet.
|
||||
2. I did not implement the lazy co-processor save logic supported by Xtensa. That logic works like this:
|
||||
|
||||
a. CPENABLE is set to zero on each context switch, disabling all co-processors.
|
||||
b. If/when the task attempts to use the disabled co-processor, an exception occurs
|
||||
c. The co-processor exception handler re-enables the co-processor.
|
||||
|
||||
Instead, the NuttX logic saves and restores CPENABLE on each context switch.
|
||||
|
||||
3. Currently the Xtensa port copies register state save information from the stack into the TCB. A more efficient alternative would be to just save a pointer to a register state save area in the TCB. This would add some complexity to signal handling and also also the the up_initialstate(). But the performance improvement might be worth the effort.
|
||||
|
||||
4. See SMP-related issues above
|
@ -139,6 +139,10 @@
|
||||
# define CONFIG_AT24XX_MTD_BLOCKSIZE AT24XX_PAGESIZE
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_AT24XX_TIMEOUT_MS
|
||||
# define CONFIG_AT24XX_TIMEOUT_MS 10
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Private Types
|
||||
************************************************************************************/
|
||||
@ -252,6 +256,7 @@ static int at24c_eraseall(FAR struct at24c_dev_s *priv)
|
||||
{
|
||||
uint8_t buf[AT24XX_PAGESIZE + AT24XX_ADDRSIZE];
|
||||
int startblock = 0;
|
||||
uint16_t wait;
|
||||
|
||||
memset(&buf[AT24XX_ADDRSIZE], 0xff, priv->pagesize);
|
||||
|
||||
@ -269,8 +274,15 @@ static int at24c_eraseall(FAR struct at24c_dev_s *priv)
|
||||
at24addr = (priv->addr | ((offset >> 8) & 0x07));
|
||||
#endif
|
||||
|
||||
wait = CONFIG_AT24XX_TIMEOUT_MS;
|
||||
while (at24c_i2c_write(priv, at24addr, buf, AT24XX_ADDRSIZE) < 0)
|
||||
{
|
||||
finfo("wait\n");
|
||||
if (!wait--)
|
||||
{
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
usleep(1000);
|
||||
}
|
||||
|
||||
@ -301,6 +313,7 @@ static ssize_t at24c_read_internal(FAR struct at24c_dev_s *priv, off_t offset,
|
||||
{
|
||||
uint8_t buf[AT24XX_ADDRSIZE];
|
||||
uint16_t at24addr;
|
||||
uint16_t wait;
|
||||
|
||||
finfo("offset: %lu nbytes: %lu address: %02x\n",
|
||||
(unsigned long)offset, (unsigned long)nbytes, address);
|
||||
@ -327,9 +340,15 @@ static ssize_t at24c_read_internal(FAR struct at24c_dev_s *priv, off_t offset,
|
||||
at24addr = (address | ((offset >> 8) & 0x07));
|
||||
#endif
|
||||
|
||||
wait = CONFIG_AT24XX_TIMEOUT_MS;
|
||||
while (at24c_i2c_write(priv, at24addr, buf, AT24XX_ADDRSIZE) < 0)
|
||||
{
|
||||
finfo("wait\n");
|
||||
if (!wait--)
|
||||
{
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
usleep(1000);
|
||||
}
|
||||
|
||||
@ -410,6 +429,7 @@ static ssize_t at24c_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, size_t
|
||||
FAR struct at24c_dev_s *priv = (FAR struct at24c_dev_s *)dev;
|
||||
size_t blocksleft;
|
||||
uint8_t buf[AT24XX_PAGESIZE + AT24XX_ADDRSIZE];
|
||||
uint16_t wait;
|
||||
|
||||
#if CONFIG_AT24XX_MTD_BLOCKSIZE > AT24XX_PAGESIZE
|
||||
startblock *= (CONFIG_AT24XX_MTD_BLOCKSIZE / AT24XX_PAGESIZE);
|
||||
@ -443,9 +463,15 @@ static ssize_t at24c_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, size_t
|
||||
at24addr = (priv->addr | ((offset >> 8) & 0x07));
|
||||
#endif
|
||||
|
||||
wait = CONFIG_AT24XX_TIMEOUT_MS;
|
||||
while (at24c_i2c_write(priv, at24addr, buf, AT24XX_ADDRSIZE) < 0)
|
||||
{
|
||||
finfo("wait\n");
|
||||
if (!wait--)
|
||||
{
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
usleep(1000);
|
||||
}
|
||||
|
||||
|
@ -61,12 +61,13 @@
|
||||
struct inode;
|
||||
struct nsem_inode_s
|
||||
{
|
||||
sem_t ns_sem; /* The contained semaphore */
|
||||
|
||||
/* Inode payload unique to named semaphores. ns_inode must appear first
|
||||
* in this structure in order to support casting between type sem_t and
|
||||
* types of struct nsem_inode_s. */
|
||||
|
||||
FAR struct inode *ns_inode; /* Containing inode */
|
||||
sem_t ns_sem; /* The semaphore */
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -135,6 +135,12 @@
|
||||
|
||||
#define PTHREAD_BARRIER_SERIAL_THREAD 0x1000
|
||||
|
||||
/* Values for protocol attribute */
|
||||
|
||||
#define PTHREAD_PRIO_NONE SEM_PRIO_NONE
|
||||
#define PTHREAD_PRIO_INHERIT SEM_PRIO_INHERIT
|
||||
#define PTHREAD_PRIO_PROTECT SEM_PRIO_PROTECT
|
||||
|
||||
/* Definitions to map some non-standard, BSD thread management interfaces to
|
||||
* the non-standard Linux-like prctl() interface. Since these are simple
|
||||
* mappings to prctl, they will return 0 on success and -1 on failure with the
|
||||
@ -212,6 +218,9 @@ typedef struct pthread_cond_s pthread_cond_t;
|
||||
struct pthread_mutexattr_s
|
||||
{
|
||||
uint8_t pshared; /* PTHREAD_PROCESS_PRIVATE or PTHREAD_PROCESS_SHARED */
|
||||
#ifdef CONFIG_PRIORITY_INHERITANCE
|
||||
uint8_t proto; /* See PTHREAD_PRIO_* definitions */
|
||||
#endif
|
||||
#ifdef CONFIG_MUTEX_TYPES
|
||||
uint8_t type; /* Type of the mutex. See PTHREAD_MUTEX_* definitions */
|
||||
#endif
|
||||
@ -222,11 +231,11 @@ typedef struct pthread_mutexattr_s pthread_mutexattr_t;
|
||||
|
||||
struct pthread_mutex_s
|
||||
{
|
||||
int pid; /* ID of the holder of the mutex */
|
||||
sem_t sem; /* Semaphore underlying the implementation of the mutex */
|
||||
int pid; /* ID of the holder of the mutex */
|
||||
sem_t sem; /* Semaphore underlying the implementation of the mutex */
|
||||
#ifdef CONFIG_MUTEX_TYPES
|
||||
uint8_t type; /* Type of the mutex. See PTHREAD_MUTEX_* definitions */
|
||||
int nlocks; /* The number of recursive locks held */
|
||||
uint8_t type; /* Type of the mutex. See PTHREAD_MUTEX_* definitions */
|
||||
int nlocks; /* The number of recursive locks held */
|
||||
#endif
|
||||
};
|
||||
|
||||
@ -395,6 +404,15 @@ int pthread_mutex_lock(FAR pthread_mutex_t *mutex);
|
||||
int pthread_mutex_trylock(FAR pthread_mutex_t *mutex);
|
||||
int pthread_mutex_unlock(FAR pthread_mutex_t *mutex);
|
||||
|
||||
#ifdef CONFIG_PRIORITY_INHERITANCE
|
||||
/* Manage priority inheritance */
|
||||
|
||||
int pthread_mutexattr_getprotocol(FAR const pthread_mutexattr_t *attr,
|
||||
FAR int *protocol);
|
||||
int pthread_mutexattr_setprotocol(FAR pthread_mutexattr_t *attr,
|
||||
int protocol);
|
||||
#endif
|
||||
|
||||
/* Operations on condition variables */
|
||||
|
||||
int pthread_condattr_init(FAR pthread_condattr_t *attr);
|
||||
|
@ -57,6 +57,17 @@ extern "C"
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Values for protocol attribute */
|
||||
|
||||
#define SEM_PRIO_NONE 0
|
||||
#define SEM_PRIO_INHERIT 1
|
||||
#define SEM_PRIO_PROTECT 2
|
||||
|
||||
/* Bit definitions for the struct sem_s flags field */
|
||||
|
||||
#define PRIOINHERIT_FLAGS_DISABLE (1 << 0) /* Bit 0: Priority inheritance
|
||||
* is disabled for this semaphore. */
|
||||
|
||||
/****************************************************************************
|
||||
* Public Type Declarations
|
||||
****************************************************************************/
|
||||
@ -92,6 +103,7 @@ struct sem_s
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_PRIORITY_INHERITANCE
|
||||
uint8_t flags; /* See PRIOINHERIT_FLAGS_* definitions */
|
||||
# if CONFIG_SEM_PREALLOCHOLDERS > 0
|
||||
FAR struct semholder_s *hhead; /* List of holders of semaphore counts */
|
||||
# else
|
||||
@ -106,9 +118,9 @@ typedef struct sem_s sem_t;
|
||||
|
||||
#ifdef CONFIG_PRIORITY_INHERITANCE
|
||||
# if CONFIG_SEM_PREALLOCHOLDERS > 0
|
||||
# define SEM_INITIALIZER(c) {(c), NULL} /* semcount, hhead */
|
||||
# define SEM_INITIALIZER(c) {(c), 0, NULL} /* semcount, flags, hhead */
|
||||
# else
|
||||
# define SEM_INITIALIZER(c) {(c), SEMHOLDER_INITIALIZER} /* semcount, holder */
|
||||
# define SEM_INITIALIZER(c) {(c), 0, SEMHOLDER_INITIALIZER} /* semcount, flags, holder */
|
||||
# endif
|
||||
#else
|
||||
# define SEM_INITIALIZER(c) {(c)} /* semcount */
|
||||
@ -141,6 +153,13 @@ int sem_close(FAR sem_t *sem);
|
||||
int sem_unlink(FAR const char *name);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PRIORITY_INHERITANCE
|
||||
/* Non-standard interfaces to manage priority inheritance */
|
||||
|
||||
int sem_getprotocol(FAR sem_t *sem, FAR int *protocol);
|
||||
int sem_setprotocol(FAR sem_t *sem, int protocol);
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -91,15 +91,22 @@
|
||||
#define SYS_sem_trywait (CONFIG_SYS_RESERVED+18)
|
||||
#define SYS_sem_wait (CONFIG_SYS_RESERVED+19)
|
||||
|
||||
#ifdef CONFIG_PRIORITY_INHERITANCE
|
||||
# define SYS_sem_setprotocol (CONFIG_SYS_RESERVED+20)
|
||||
# define __SYS_named_sem (CONFIG_SYS_RESERVED+21)
|
||||
#else
|
||||
# define __SYS_named_sem (CONFIG_SYS_RESERVED+20)
|
||||
#endif
|
||||
|
||||
/* Named semaphores */
|
||||
|
||||
#ifdef CONFIG_FS_NAMED_SEMAPHORES
|
||||
# define SYS_sem_open (CONFIG_SYS_RESERVED+20)
|
||||
# define SYS_sem_close (CONFIG_SYS_RESERVED+21)
|
||||
# define SYS_sem_unlink (CONFIG_SYS_RESERVED+22)
|
||||
# define __SYS_task_create (CONFIG_SYS_RESERVED+23)
|
||||
# define SYS_sem_open __SYS_named_sem
|
||||
# define SYS_sem_close (__SYS_named_sem+1)
|
||||
# define SYS_sem_unlink (__SYS_named_sem+2)
|
||||
# define __SYS_task_create (__SYS_named_sem+3)
|
||||
#else
|
||||
# define __SYS_task_create (CONFIG_SYS_RESERVED+20)
|
||||
# define __SYS_task_create __SYS_named_sem
|
||||
#endif
|
||||
|
||||
/* Task creation APIs based on global entry points cannot be use with
|
||||
|
@ -35,23 +35,27 @@
|
||||
|
||||
# Add the pthread C files to the build
|
||||
|
||||
CSRCS += pthread_attrinit.c pthread_attrdestroy.c \
|
||||
pthread_attrsetschedpolicy.c pthread_attrgetschedpolicy.c \
|
||||
pthread_attrsetinheritsched.c pthread_attrgetinheritsched.c \
|
||||
pthread_attrsetstacksize.c pthread_attrgetstacksize.c \
|
||||
pthread_attrsetschedparam.c pthread_attrgetschedparam.c \
|
||||
pthread_barrierattrinit.c pthread_barrierattrdestroy.c \
|
||||
pthread_barrierattrgetpshared.c pthread_barrierattrsetpshared.c \
|
||||
pthread_condattrinit.c pthread_condattrdestroy.c \
|
||||
pthread_mutexattrinit.c pthread_mutexattrdestroy.c \
|
||||
pthread_mutexattrgetpshared.c pthread_mutexattrsetpshared.c
|
||||
CSRCS += pthread_attr_init.c pthread_attr_destroy.c \
|
||||
pthread_attr_setschedpolicy.c pthread_attr_getschedpolicy.c \
|
||||
pthread_attr_setinheritsched.c pthread_attr_getinheritsched.c \
|
||||
pthread_attr_setstacksize.c pthread_attr_getstacksize.c \
|
||||
pthread_attr_setschedparam.c pthread_attr_getschedparam.c \
|
||||
pthread_barrierattr_init.c pthread_barrierattr_destroy.c \
|
||||
pthread_barrierattr_getpshared.c pthread_barrierattr_setpshared.c \
|
||||
pthread_condattr_init.c pthread_condattr_destroy.c \
|
||||
pthread_mutexattr_init.c pthread_mutexattr_destroy.c \
|
||||
pthread_mutexattr_getpshared.c pthread_mutexattr_setpshared.c
|
||||
|
||||
ifeq ($(CONFIG_SMP),y)
|
||||
CSRCS += pthread_attrgetaffinity.c pthread_attrsetaffinity.c
|
||||
CSRCS += pthread_attr_getaffinity.c pthread_attr_setaffinity.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MUTEX_TYPES),y)
|
||||
CSRCS += pthread_mutexattrsettype.c pthread_mutexattrgettype.c
|
||||
CSRCS += pthread_mutexattr_settype.c pthread_mutexattr_gettype.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PRIORITY_INHERITANCE),y)
|
||||
CSRCS += pthread_mutexattr_setprotocol.c pthread_mutexattr_getprotocol.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BUILD_PROTECTED),y)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* libc/pthread/pthread_attrdestroy.c
|
||||
* libc/pthread/pthread_attr_destroy.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@ -52,8 +52,7 @@
|
||||
* Function: pthread_attr_destroy
|
||||
*
|
||||
* Description:
|
||||
* An attributes object can be deleted when it is no longer
|
||||
* needed.
|
||||
* An attributes object can be deleted when it is no longer needed.
|
||||
*
|
||||
* Parameters:
|
||||
* attr
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* libc/pthread/pthread_attrgetaffinity.c
|
||||
* libc/pthread/pthread_attr_getaffinity.c
|
||||
*
|
||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* libc/pthread/pthread_attrgetinheritsched.c
|
||||
* libc/pthread/pthread_attr_getinheritsched.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* libc/pthread/pthread_attrgetschedparam.c
|
||||
* libc/pthread/pthread_attr_getschedparam.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* libc/pthread/pthread_attrgetschedpolicy.c
|
||||
* libc/pthread/pthread_attr_getschedpolicy.c
|
||||
*
|
||||
* Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* libc/pthread/pthread_attrgetstacksize.c
|
||||
* libc/pthread/pthread_attr_getstacksize.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* libc/pthread/pthread_attrinit.c
|
||||
* libc/pthread/pthread_attr_init.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* libc/pthread/pthread_attrsetaffinity.c
|
||||
* libc/pthread/pthread_attr_setaffinity.c
|
||||
*
|
||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* libc/pthread/pthread_attrsetinheritsched.c
|
||||
* libc/pthread/pthread_attr_setinheritsched.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* libc/pthread/pthread_attrsetschedparam.c
|
||||
* libc/pthread/pthread_attr_setschedparam.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011, 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* libc/pthread/pthread_attrsetschedpolicy.c
|
||||
* libc/pthread/pthread_attr_setschedpolicy.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011, 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* libc/pthread/pthread_attrsetstacksize.c
|
||||
* libc/pthread/pthread_attr_setstacksize.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
@ -1,5 +1,5 @@
|
||||
/********************************************************************************
|
||||
* libc/pthread/pthread_barrierattrdestroy.c
|
||||
* libc/pthread/pthread_barrierattr_destroy.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
@ -1,5 +1,5 @@
|
||||
/********************************************************************************
|
||||
* libc/pthread/pthread_barrierattrgetpshared.c
|
||||
* libc/pthread/pthread_barrierattr_getpshared.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
@ -1,5 +1,5 @@
|
||||
/********************************************************************************
|
||||
* libc/pthread/pthread_barrierattrinit.c
|
||||
* libc/pthread/pthread_barrierattr_init.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
@ -1,5 +1,5 @@
|
||||
/********************************************************************************
|
||||
* libc/pthread/pthread_barrierattrsetpshared.c
|
||||
* libc/pthread/pthread_barrierattr_setpshared.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* libc/pthread/pthread_condattrdestroy.c
|
||||
* libc/pthread/pthread_condattr_destroy.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* libc/pthread/pthread_condattrinit.c
|
||||
* libc/pthread/pthread_condattr_init.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* libc/pthread/pthread_mutexattrdestroy.c
|
||||
* libc/pthread/pthread_mutexattr_destroy.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@ -55,7 +55,6 @@
|
||||
*
|
||||
* Parameters:
|
||||
* attr
|
||||
* pshared
|
||||
*
|
||||
* Return Value:
|
||||
* 0 if successful. Otherwise, an error code.
|
73
libc/pthread/pthread_mutexattr_getprotocol.c
Normal file
73
libc/pthread/pthread_mutexattr_getprotocol.c
Normal file
@ -0,0 +1,73 @@
|
||||
/****************************************************************************
|
||||
* libc/pthread/pthread_mutexattr_getprotocol.c
|
||||
*
|
||||
* Copyright (C) 2016 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 <pthread.h>
|
||||
#include <assert.h>
|
||||
#include <debug.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: pthread_mutexattr_getprotocol
|
||||
*
|
||||
* Description:
|
||||
* Return the value of the mutex protocol attribute.
|
||||
*
|
||||
* Parameters:
|
||||
* attr - A pointer to the mutex attributes to be queried.
|
||||
* protocol - The user provided location in which to store the protocol
|
||||
* value.
|
||||
*
|
||||
* Return Value:
|
||||
* 0 if successful. Otherwise, an error code.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int pthread_mutexattr_getprotocol(FAR const pthread_mutexattr_t *attr,
|
||||
FAR int *protocol)
|
||||
{
|
||||
DEBUGASSERT(attr != NULL && protocol != NULL);
|
||||
|
||||
linfo("Returning %d\n", attr->proto);
|
||||
return attr->proto;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* libc/pthread/pthread_mutexattrgetpshared.c
|
||||
* libc/pthread/pthread_mutexattr_getpshared.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* libc/pthread/pthread_mutexattrgettype.c
|
||||
* libc/pthread/pthread_mutexattr_gettype.c
|
||||
*
|
||||
* Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@ -72,6 +72,7 @@ int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *type)
|
||||
*type = attr->type;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return EINVAL;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* libc/pthread/pthread_mutexattrinit.c
|
||||
* libc/pthread/pthread_mutexattr_init.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
79
libc/pthread/pthread_mutexattr_setprotocol.c
Normal file
79
libc/pthread/pthread_mutexattr_setprotocol.c
Normal file
@ -0,0 +1,79 @@
|
||||
/****************************************************************************
|
||||
* libc/pthread/pthread_mutexattr_setprotocol.c
|
||||
*
|
||||
* Copyright (C) 2016 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 <pthread.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: pthread_mutexattr_setprotocol
|
||||
*
|
||||
* Description:
|
||||
* Set mutex protocol attribute.
|
||||
*
|
||||
* Parameters:
|
||||
* attr - A pointer to the mutex attributes to be modified
|
||||
* protocol - The new protocol to use
|
||||
*
|
||||
* Return Value:
|
||||
* 0 if successful. Otherwise, an error code.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int pthread_mutexattr_setprotocol(FAR pthread_mutexattr_t *attr,
|
||||
int protocol)
|
||||
{
|
||||
linfo("attr=0x%p protocol=%d\n", attr, protocol);
|
||||
DEBUGASSERT(attr != NULL);
|
||||
|
||||
if (protocol >= PTHREAD_PRIO_NONE && protocol <= PTHREAD_PRIO_PROTECT)
|
||||
{
|
||||
attr->proto = protocol;
|
||||
return OK;
|
||||
}
|
||||
|
||||
return EINVAL;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* libc/pthread/pthread_mutexattrsetpshared.c
|
||||
* libc/pthread/pthread_mutexattr_setpshared.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* libc/pthread/pthread_mutexattrsettype.c
|
||||
* libc/pthread/pthread_mutexattr_settype.c
|
||||
*
|
||||
* Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
@ -1,7 +1,7 @@
|
||||
############################################################################
|
||||
# libc/semaphore/Make.defs
|
||||
#
|
||||
# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
|
||||
# Copyright (C) 2011-2012, 2016 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@ -37,6 +37,10 @@
|
||||
|
||||
CSRCS += sem_init.c sem_getvalue.c
|
||||
|
||||
ifeq ($(CONFIG_PRIORITY_INHERITANCE),y)
|
||||
CSRCS += sem_getprotocol.c
|
||||
endif
|
||||
|
||||
# Add the semaphore directory to the build
|
||||
|
||||
DEPPATH += --dep-path semaphore
|
||||
|
83
libc/semaphore/sem_getprotocol.c
Normal file
83
libc/semaphore/sem_getprotocol.c
Normal file
@ -0,0 +1,83 @@
|
||||
/****************************************************************************
|
||||
* libc/semaphore/sem_getprotocol.c
|
||||
*
|
||||
* Copyright (C) 2016 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 <semaphore.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef CONFIG_PRIORITY_INHERITANCE
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: sem_getprotocol
|
||||
*
|
||||
* Description:
|
||||
* Return the value of the semaphore protocol attribute.
|
||||
*
|
||||
* Parameters:
|
||||
* sem - A pointer to the semaphore whose attributes are to be
|
||||
* queried.
|
||||
* protocol - The user provided location in which to store the protocol
|
||||
* value.
|
||||
*
|
||||
* Return Value:
|
||||
* 0 if successful. Otherwise, -1 is returned and the errno value is set
|
||||
* appropriately.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int sem_getprotocol(FAR sem_t *sem, FAR int *protocol)
|
||||
{
|
||||
DEBUGASSERT(sem != NULL && protocol != NULL);
|
||||
|
||||
if ((sem->flags & PRIOINHERIT_FLAGS_DISABLE) != 0)
|
||||
{
|
||||
return SEM_PRIO_NONE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return SEM_PRIO_INHERIT;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* CONFIG_PRIORITY_INHERITANCE */
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* libc/sem/sem_init.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2009, 2011-2012, 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -44,26 +44,6 @@
|
||||
#include <semaphore.h>
|
||||
#include <errno.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Type Declarations
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@ -108,6 +88,7 @@ int sem_init(FAR sem_t *sem, int pshared, unsigned int value)
|
||||
/* Initialize to support priority inheritance */
|
||||
|
||||
#ifdef CONFIG_PRIORITY_INHERITANCE
|
||||
sem->flags = 0;
|
||||
# if CONFIG_SEM_PREALLOCHOLDERS > 0
|
||||
sem->hhead = NULL;
|
||||
# else
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* sched/pthread/pthread_mutexinit.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2009, 2011, 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -66,13 +66,17 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int pthread_mutex_init(FAR pthread_mutex_t *mutex, FAR const pthread_mutexattr_t *attr)
|
||||
int pthread_mutex_init(FAR pthread_mutex_t *mutex,
|
||||
FAR const pthread_mutexattr_t *attr)
|
||||
{
|
||||
int pshared = 0;
|
||||
#ifdef CONFIG_MUTEX_TYPES
|
||||
uint8_t type = PTHREAD_MUTEX_DEFAULT;
|
||||
uint8_t type = PTHREAD_MUTEX_DEFAULT;
|
||||
#endif
|
||||
int ret = OK;
|
||||
#ifdef CONFIG_PRIORITY_INHERITANCE
|
||||
uint8_t proto = PTHREAD_PRIO_INHERIT;
|
||||
#endif
|
||||
int ret = OK;
|
||||
int status;
|
||||
|
||||
sinfo("mutex=0x%p attr=0x%p\n", mutex, attr);
|
||||
@ -88,6 +92,9 @@ int pthread_mutex_init(FAR pthread_mutex_t *mutex, FAR const pthread_mutexattr_t
|
||||
if (attr)
|
||||
{
|
||||
pshared = attr->pshared;
|
||||
#ifdef CONFIG_PRIORITY_INHERITANCE
|
||||
proto = attr->proto;
|
||||
#endif
|
||||
#ifdef CONFIG_MUTEX_TYPES
|
||||
type = attr->type;
|
||||
#endif
|
||||
@ -102,9 +109,19 @@ int pthread_mutex_init(FAR pthread_mutex_t *mutex, FAR const pthread_mutexattr_t
|
||||
status = sem_init((FAR sem_t *)&mutex->sem, pshared, 1);
|
||||
if (status != OK)
|
||||
{
|
||||
ret = EINVAL;
|
||||
ret = get_errno();
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PRIORITY_INHERITANCE
|
||||
/* Initialize the semaphore protocol */
|
||||
|
||||
status = sem_setprotocol((FAR sem_t *)&mutex->sem, proto);
|
||||
if (status != OK)
|
||||
{
|
||||
ret = get_errno();
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Set up attributes unique to the mutex type */
|
||||
|
||||
#ifdef CONFIG_MUTEX_TYPES
|
||||
|
@ -33,12 +33,14 @@
|
||||
#
|
||||
############################################################################
|
||||
|
||||
# Add semaphore-related files to the build
|
||||
|
||||
CSRCS += sem_destroy.c sem_wait.c sem_trywait.c sem_tickwait.c
|
||||
CSRCS += sem_timedwait.c sem_timeout.c sem_post.c sem_recover.c
|
||||
CSRCS += sem_reset.c sem_waitirq.c
|
||||
|
||||
ifeq ($(CONFIG_PRIORITY_INHERITANCE),y)
|
||||
CSRCS += sem_initialize.c sem_holder.c
|
||||
CSRCS += sem_initialize.c sem_holder.c sem_setprotocol.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SPINLOCK),y)
|
||||
|
@ -790,7 +790,7 @@ void sem_initholders(void)
|
||||
* Name: sem_destroyholder
|
||||
*
|
||||
* Description:
|
||||
* Called from sem_destroy() to handle any holders of a semaphore when
|
||||
* Called from sem_destroyholder() to handle any holders of a semaphore when
|
||||
* it is destroyed.
|
||||
*
|
||||
* Parameters:
|
||||
@ -855,17 +855,25 @@ void sem_addholder_tcb(FAR struct tcb_s *htcb, FAR sem_t *sem)
|
||||
{
|
||||
FAR struct semholder_s *pholder;
|
||||
|
||||
/* Find or allocate a container for this new holder */
|
||||
/* If priority inheritance is disabled for this thread, then do not add
|
||||
* the holder. If there are never holders of the semaphore, the priority
|
||||
* inheritance is effectively disabled.
|
||||
*/
|
||||
|
||||
pholder = sem_findorallocateholder(sem, htcb);
|
||||
if (pholder != NULL)
|
||||
if ((sem->flags & PRIOINHERIT_FLAGS_DISABLE) == 0)
|
||||
{
|
||||
/* Then set the holder and increment the number of counts held by this
|
||||
* holder
|
||||
*/
|
||||
/* Find or allocate a container for this new holder */
|
||||
|
||||
pholder->htcb = htcb;
|
||||
pholder->counts++;
|
||||
pholder = sem_findorallocateholder(sem, htcb);
|
||||
if (pholder != NULL)
|
||||
{
|
||||
/* Then set the holder and increment the number of counts held by this
|
||||
* holder
|
||||
*/
|
||||
|
||||
pholder->htcb = htcb;
|
||||
pholder->counts++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
110
sched/semaphore/sem_setprotocol.c
Normal file
110
sched/semaphore/sem_setprotocol.c
Normal file
@ -0,0 +1,110 @@
|
||||
/****************************************************************************
|
||||
* sched/semaphore/sem_setprotocol.c
|
||||
*
|
||||
* Copyright (C) 2016 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 <semaphore.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "semaphore/semaphore.h"
|
||||
|
||||
#ifdef CONFIG_PRIORITY_INHERITANCE
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: sem_setprotocol
|
||||
*
|
||||
* Description:
|
||||
* Set semaphore protocol attribute.
|
||||
*
|
||||
* Parameters:
|
||||
* sem - A pointer to the semaphore whose attributes are to be
|
||||
* modified
|
||||
* protocol - The new protocol to use
|
||||
*
|
||||
* Return Value:
|
||||
* 0 if successful. Otherwise, -1 is returned and the errno value is set
|
||||
* appropriately.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int sem_setprotocol(FAR sem_t *sem, int protocol)
|
||||
{
|
||||
int errcode;
|
||||
|
||||
DEBUGASSERT(sem != NULL);
|
||||
|
||||
switch (protocol)
|
||||
{
|
||||
case SEM_PRIO_NONE:
|
||||
/* Disable priority inheritance */
|
||||
|
||||
sem->flags |= PRIOINHERIT_FLAGS_DISABLE;
|
||||
|
||||
/* Remove any current holders */
|
||||
|
||||
sem_destroyholder(sem);
|
||||
return OK;
|
||||
|
||||
case SEM_PRIO_INHERIT:
|
||||
/* Enable priority inheritance (dangerous) */
|
||||
|
||||
sem->flags &= ~PRIOINHERIT_FLAGS_DISABLE;
|
||||
return OK;
|
||||
|
||||
case SEM_PRIO_PROTECT:
|
||||
/* Not yet supported */
|
||||
|
||||
errcode = ENOSYS;
|
||||
break;
|
||||
|
||||
default:
|
||||
errcode = EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
set_errno(errcode);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_PRIORITY_INHERITANCE */
|
@ -118,6 +118,7 @@
|
||||
"sem_destroy","semaphore.h","","int","FAR sem_t*"
|
||||
"sem_open","semaphore.h","defined(CONFIG_FS_NAMED_SEMAPHORES)","FAR sem_t*","FAR const char*","int","..."
|
||||
"sem_post","semaphore.h","","int","FAR sem_t*"
|
||||
"sem_setprotocol","semaphore.h","defined(CONFIG_PRIORITY_INHERITANCE)","int","FAR sem_t*","int"
|
||||
"sem_timedwait","semaphore.h","","int","FAR sem_t*","FAR const struct timespec *"
|
||||
"sem_trywait","semaphore.h","","int","FAR sem_t*"
|
||||
"sem_unlink","semaphore.h","defined(CONFIG_FS_NAMED_SEMAPHORES)","int","FAR const char*"
|
||||
|
Can't render this file because it has a wrong number of fields in line 2.
|
@ -61,12 +61,16 @@ SYSCALL_LOOKUP(uname, 1, STUB_uname)
|
||||
|
||||
/* Semaphores */
|
||||
|
||||
SYSCALL_LOOKUP(sem_destroy, 2, STUB_sem_destroy)
|
||||
SYSCALL_LOOKUP(sem_destroy, 1, STUB_sem_destroy)
|
||||
SYSCALL_LOOKUP(sem_post, 1, STUB_sem_post)
|
||||
SYSCALL_LOOKUP(sem_timedwait, 2, STUB_sem_timedwait)
|
||||
SYSCALL_LOOKUP(sem_trywait, 1, STUB_sem_trywait)
|
||||
SYSCALL_LOOKUP(sem_wait, 1, STUB_sem_wait)
|
||||
|
||||
#ifdef CONFIG_PRIORITY_INHERITANCE
|
||||
SYSCALL_LOOKUP(sem_setprotocol, 2, STUB_sem_setprotocol)
|
||||
#endif
|
||||
|
||||
/* Named semaphores */
|
||||
|
||||
#ifdef CONFIG_FS_NAMED_SEMAPHORES
|
||||
|
@ -85,10 +85,12 @@ uintptr_t STUB_sem_destroy(int nbr, uintptr_t parm1);
|
||||
uintptr_t STUB_sem_open(int nbr, uintptr_t parm1, uintptr_t parm2,
|
||||
uintptr_t parm3, uintptr_t parm4, uintptr_t parm5, uintptr_t parm6);
|
||||
uintptr_t STUB_sem_post(int nbr, uintptr_t parm1);
|
||||
uintptr_t STUB_sem_setprotocol(int nbr, uintptr_t parm1, uintptr_t parm2);
|
||||
uintptr_t STUB_sem_timedwait(int nbr, uintptr_t parm1, uintptr_t parm2);
|
||||
uintptr_t STUB_sem_trywait(int nbr, uintptr_t parm1);
|
||||
uintptr_t STUB_sem_unlink(int nbr, uintptr_t parm1);
|
||||
uintptr_t STUB_sem_wait(int nbr, uintptr_t parm1);
|
||||
|
||||
uintptr_t STUB_pgalloc(int nbr, uintptr_t parm1, uintptr_t parm2);
|
||||
uintptr_t STUB_task_create(int nbr, uintptr_t parm1, uintptr_t parm2,
|
||||
uintptr_t parm3, uintptr_t parm4, uintptr_t parm5);
|
||||
|
Loading…
x
Reference in New Issue
Block a user