diff --git a/ChangeLog b/ChangeLog
index ed8dd467b11..faa17d5bbf1 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -11665,4 +11665,13 @@
complete, but untested and so not ready for primetime (2016-04-18).
* configs/samv71-xult/vnc: Add a configuration that will be used to
verify VNC (also untested) (2016-04-18).
+ * drivers/ioexpander: Fix an error in the PCA9555 driver: Under certain
+ error conditions, interrupts were not being re-enabled. Sebastien
+ Lorquet (2016-04-20).
+ * arch/arm/src/stm32 and configs/stm32f429i-disco: Correct some bad
+ commits that broke the LTDC display example. From Marco Krahl
+ (2016-04-22).
+ * configs/samv71-xult/vnwwm: Add a more complex NxWM configuration
+ to support further VNC testing (particularly of VNC keyboard and
+ mouse intputs). Initial configuration is not functional (2016-04-23).
diff --git a/Documentation/NuttX.html b/Documentation/NuttX.html
index 03b8fc720a0..9910e4c275d 100644
--- a/Documentation/NuttX.html
+++ b/Documentation/NuttX.html
@@ -680,7 +680,10 @@
|
- Graphics: framebuffer drivers, graphic- and segment-LCD drivers.
+
+ Graphics: framebuffer drivers, graphic- and segment-LCD drivers.
+ VNC server.
+
|
@@ -831,7 +834,8 @@
Networking utilities (DHCP server and client, SMTP client, TELNET client, FTP server and client, TFTP client, HTTP server and client, PPPD, NTP client).
- Inheritable TELNET sessions (as "controlling terminal")
+ Inheritable TELNET sessions (as "controlling terminal").
+ VNC server.
|
diff --git a/README.txt b/README.txt
index 570cf1478db..cbba0da1d01 100644
--- a/README.txt
+++ b/README.txt
@@ -833,14 +833,29 @@ Re-building
a file in one of the linked (i.e., copied) directories, re-build NuttX,
and then not see your changes when you run the program. That is because
build is still using the version of the file in the copied directory, not
- your modified file! To work around this annoying behavior, do the
- following when you re-build:
+ your modified file!
+
+ Older versions of NuttX did not support dependiencies in this
+ configuration. So a simple work around this annoying behavior in this
+ case was the following when you re-build:
make clean_context all
This 'make' command will remove of the copied directories, re-copy them,
then make NuttX.
+ However, more recent versions of NuttX do support dependencies for the
+ Cygwin build. As a result, the above command will cause everything to be
+ rebuilt (beause it removes and will cause recreating the
+ include/nuttx/config.h header file). A much less gracefully but still
+ effective command in this case is the following for the ARM configuration:
+
+ rm -rf arch/arm/src/chip arch/arm/src/board
+
+ This "kludge" simple removes the copied directories. These directories
+ will be re-created when you do a normal 'make' and your edits will then be
+ effective.
+
Build Targets and Options
-------------------------
diff --git a/arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h b/arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h
index 02664a0ba90..d8fbe7346cc 100644
--- a/arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h
+++ b/arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h
@@ -329,11 +329,21 @@
# define GPIO_FSMC_NCE4_2 (GPIO_ALT|GPIO_AF12|GPIO_SPEED_100MHz|GPIO_PORTG|GPIO_PIN11)
# define GPIO_FSMC_NIORD (GPIO_ALT|GPIO_AF12|GPIO_SPEED_100MHz|GPIO_PORTF|GPIO_PIN6)
# define GPIO_FSMC_NIOWR (GPIO_ALT|GPIO_AF12|GPIO_SPEED_100MHz|GPIO_PORTF|GPIO_PIN8)
+# define GPIO_FSMC_SDCKE0_1 (GPIO_ALT|GPIO_AF12|GPIO_SPEED_100MHz|GPIO_PORTH|GPIO_PIN2)
+# define GPIO_FSMC_SDCKE0_2 (GPIO_ALT|GPIO_AF12|GPIO_SPEED_100MHz|GPIO_PORTC|GPIO_PIN3)
+# define GPIO_FSMC_SDNE0_1 (GPIO_ALT|GPIO_AF12|GPIO_SPEED_100MHz|GPIO_PORTH|GPIO_PIN3)
+# define GPIO_FSMC_SDNE0_2 (GPIO_ALT|GPIO_AF12|GPIO_SPEED_100MHz|GPIO_PORTC|GPIO_PIN2)
+# define GPIO_FSMC_SDNWE_1 (GPIO_ALT|GPIO_AF12|GPIO_SPEED_100MHz|GPIO_PORTC|GPIO_PIN0)
+# define GPIO_FSMC_SDNWE_2 (GPIO_ALT|GPIO_AF12|GPIO_SPEED_100MHz|GPIO_PORTH|GPIO_PIN5)
+# define GPIO_FSMC_SDNRAS (GPIO_ALT|GPIO_AF12|GPIO_SPEED_100MHz|GPIO_PORTF|GPIO_PIN11)
+# define GPIO_FSMC_SDCLK (GPIO_ALT|GPIO_AF12|GPIO_SPEED_100MHz|GPIO_PORTG|GPIO_PIN8)
+# define GPIO_FSMC_SDNCAS (GPIO_ALT|GPIO_AF12|GPIO_SPEED_100MHz|GPIO_PORTG|GPIO_PIN15)
+# define GPIO_FSMC_BA0 (GPIO_ALT|GPIO_AF12|GPIO_SPEED_100MHz|GPIO_PORTG|GPIO_PIN4)
+# define GPIO_FSMC_BA1 (GPIO_ALT|GPIO_AF12|GPIO_SPEED_100MHz|GPIO_PORTG|GPIO_PIN5)
# define GPIO_FSMC_NREG (GPIO_ALT|GPIO_AF12|GPIO_SPEED_100MHz|GPIO_PORTF|GPIO_PIN7)
#endif
-#if defined(CONFIG_STM32_STM32F427) || defined(CONFIG_STM32_STM32F429) || \
- defined(CONFIG_STM32_STM32F446) || defined(CONFIG_STM32_STM32F469)
+#if defined(CONFIG_STM32_STM32F446) || defined(CONFIG_STM32_STM32F469)
# define GPIO_FSMC_SDCKE0_1 (GPIO_ALT|GPIO_AF12|GPIO_SPEED_100MHz|GPIO_PORTC|GPIO_PIN3)
# define GPIO_FSMC_SDCKE0_2 (GPIO_ALT|GPIO_AF12|GPIO_SPEED_100MHz|GPIO_PORTC|GPIO_PIN5)
# define GPIO_FSMC_SDNE0_1 (GPIO_ALT|GPIO_AF12|GPIO_SPEED_100MHz|GPIO_PORTC|GPIO_PIN2)
diff --git a/arch/arm/src/stm32l4/Kconfig b/arch/arm/src/stm32l4/Kconfig
index 5bda5de53a8..f334ca32bc6 100644
--- a/arch/arm/src/stm32l4/Kconfig
+++ b/arch/arm/src/stm32l4/Kconfig
@@ -69,6 +69,34 @@ config STM32L4_FLASH_1024KB
endchoice # Embedded FLASH size
+comment "SRAM2 Options"
+
+config STM32L4_SRAM2_HEAP
+ bool "SRAM2 is used for heap"
+ default n
+ select STM32L4_SRAM2_INIT
+ ---help---
+ The STM32L4 SRAM2 region has special properties (power, protection, parity)
+ which may be used by the application for special purposes. But if these
+ special properties are not needed, it may be instead added to the heap for
+ use by malloc().
+ NOTE: you must also select an appropriate number of memory regions in the
+ 'Memory Management' section.
+
+config STM32L4_SRAM2_INIT
+ bool "SRAM2 is initialized to zero"
+ default n
+ ---help---
+ The STM32L4 SRAM2 region has parity checking. However, when the system
+ powers on, the memory is in an unknown state, and reads from uninitialized
+ memory can trigger parity faults from the random data. This can be
+ avoided by first writing to all locations to force the parity into a valid
+ state.
+ However, if the SRAM2 is being used for it's battery-backed capability,
+ this may be undesireable (because it will destroy the contents). In that
+ case, the board should handle the initialization itself at the appropriate
+ time.
+
menu "STM32L4 Peripheral Support"
# These "hidden" settings determine is a peripheral option is available for the
@@ -79,7 +107,7 @@ config STM32L4_HAVE_LTDC
default n
# These "hidden" settings are the OR of individual peripheral selections
-# indicating that the general capabilitiy is required.
+# indicating that the general capability is required.
config STM32L4_ADC
bool
@@ -133,7 +161,6 @@ config STM32L4_DMA2
select STM32L4_DMA
select ARCH_DMA
-
config STM32L4_CRC
bool "CRC"
default n
@@ -209,7 +236,119 @@ config STM32L4_QSPI_CSHT
---help---
The STM32L4 QSPI peripheral requires that it be specified the minimum number
of AHB cycles that Chip Select be held inactive between transactions.
-
+
+choice
+ prompt "Transfer technique"
+ default STM32L4_QSPI_DMA
+ ---help---
+ You can choose between using polling, interrupts, or DMA to transfer data
+ over the QSPI interface.
+
+config STM32L4_QSPI_POLLING
+ bool "Polling"
+ ---help---
+ Use conventional register I/O with status polling to transfer data.
+
+config STM32L4_QSPI_INTERRUPTS
+ bool "Interrupts"
+ ---help---
+ User interrupt driven I/O transfers.
+
+config STM32L4_QSPI_DMA
+ bool "DMA"
+ depends on STM32L4_DMA
+ ---help---
+ Use DMA to improve QSPI transfer performance.
+
+endchoice
+
+choice
+ prompt "DMA Channel"
+ default STM32L4_QSPI_DMA_CHAN_1_5
+ depends on STM32L4_DMA
+ ---help---
+ You can choose between two DMA channels for use with QSPI:
+ either DMA1 channel 5, or DMA2 channel 7.
+ If you only see one choice here, it is probably because
+ you have not also enabled the associated DMA controller.
+
+config STM32L4_QSPI_DMA_CHAN_1_5
+ bool "DMA1 Channel 5"
+ depends on STM32L4_DMA1
+ ---help---
+ Use DMA1 channel 5 for QSPI.
+
+config STM32L4_QSPI_DMA_CHAN_2_7
+ bool "DMA2 Channel 7"
+ depends on STM32L4_DMA2
+ ---help---
+ Use DMA2 channel 7 for QSPI.
+
+endchoice
+
+choice
+ prompt "DMA Priority"
+ default STM32L4_QSPI_DMAPRIORITY_MEDIUM
+ depends on STM32L4_DMA
+ ---help---
+ The DMA controller supports priority levels. You are probably fine
+ with the default of 'medium' except for special cases. In the event
+ of contention between to channels at the same priority, the lower
+ numbered channel has hardware priority over the higher numbered one.
+
+config STM32L4_QSPI_DMAPRIORITY_VERYHIGH
+ bool "Very High priority"
+ depends on STM32L4_DMA
+ ---help---
+ 'Highest' priority.
+
+config STM32L4_QSPI_DMAPRIORITY_HIGH
+ bool "High priority"
+ depends on STM32L4_DMA
+ ---help---
+ 'High' priority.
+
+config STM32L4_QSPI_DMAPRIORITY_MEDIUM
+ bool "Medium priority"
+ depends on STM32L4_DMA
+ ---help---
+ 'Medium' priority.
+
+config STM32L4_QSPI_DMAPRIORITY_LOW
+ bool "Low priority"
+ depends on STM32L4_DMA
+ ---help---
+ 'Low' priority.
+
+endchoice
+
+config STM32L4_QSPI_DMATHRESHOLD
+ int "QSPI DMA threshold"
+ default 4
+ depends on STM32L4_QSPI_DMA
+ ---help---
+ When QSPI DMA is enabled, small DMA transfers will still be performed
+ by polling logic. This value is the threshold below which transfers
+ will still be performed by conventional register status polling.
+
+config STM32L4_QSPI_DMADEBUG
+ bool "QSPI DMA transfer debug"
+ depends on STM32L4_QSPI_DMA && DEBUG && DEBUG_DMA
+ default n
+ ---help---
+ Enable special debug instrumentation to analyze QSPI DMA data transfers.
+ This logic is as non-invasive as possible: It samples DMA
+ registers at key points in the data transfer and then dumps all of
+ the registers at the end of the transfer.
+
+config STM32L4_QSPI_REGDEBUG
+ bool "QSPI Register level debug"
+ depends on DEBUG
+ default n
+ ---help---
+ Output detailed register-level QSPI device debug information.
+ Requires also DEBUG.
+
endif
comment "APB1 Peripherals"
diff --git a/arch/arm/src/stm32l4/README.txt b/arch/arm/src/stm32l4/README.txt
index bf38fb80ae1..59f2eb28d9f 100644
--- a/arch/arm/src/stm32l4/README.txt
+++ b/arch/arm/src/stm32l4/README.txt
@@ -23,13 +23,13 @@ LSE : works, but TODO autotrim of MSI, etc
RCC : All registers defined, peripherals enabled, basic clock working
SYSCTL : All registers defined
USART : Working in normal mode (no DMA, to be tested, code is written)
-DMA : Ported from STM32, code written, to be tested
+DMA : works; at least tested with QSPI
SRAM2 : Should work with enough MM regions
FIREWALL : Code written, to be tested, requires support from ldscript
SPI : Code written, to be tested, including DMA
I2C : Registers defined
RTC : works
-QSPI : TODO (port from stm32f7)
+QSPI : works in polling, interrupt, DMA, and also memory-mapped modes
CAN : TODO
OTGFS : TODO
Timers : TODO
diff --git a/arch/arm/src/stm32l4/chip/stm32l4x6xx_dma.h b/arch/arm/src/stm32l4/chip/stm32l4x6xx_dma.h
index c0d136150fa..ab63195d2f2 100644
--- a/arch/arm/src/stm32l4/chip/stm32l4x6xx_dma.h
+++ b/arch/arm/src/stm32l4/chip/stm32l4x6xx_dma.h
@@ -39,8 +39,7 @@
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
-/* These definitions apply to both the STM32 F1 and F3 families */
-/* 12 Channels Total: 7 DMA1 Channels(1-7) and 5 DMA2 channels (1-5) */
+/* 14 Channels Total: 7 DMA1 Channels(1-7) and 7 DMA2 channels (1-7) */
#define DMA1 0
#define DMA2 1
@@ -158,6 +157,8 @@
#define STM32L4_DMA2_CCR3 (STM32L4_DMA2_BASE+STM32L4_DMA_CCR3_OFFSET)
#define STM32L4_DMA2_CCR4 (STM32L4_DMA2_BASE+STM32L4_DMA_CCR4_OFFSET)
#define STM32L4_DMA2_CCR5 (STM32L4_DMA2_BASE+STM32L4_DMA_CCR5_OFFSET)
+#define STM32L4_DMA2_CCR6 (STM32L4_DMA2_BASE+STM32L4_DMA_CCR6_OFFSET)
+#define STM32L4_DMA2_CCR7 (STM32L4_DMA2_BASE+STM32L4_DMA_CCR7_OFFSET)
#define STM32L4_DMA2_CNDTR(n) (STM32L4_DMA2_BASE+STM32L4_DMA_CNDTR_OFFSET(n))
#define STM32L4_DMA2_CNDTR1 (STM32L4_DMA2_BASE+STM32L4_DMA_CNDTR1_OFFSET)
@@ -165,6 +166,8 @@
#define STM32L4_DMA2_CNDTR3 (STM32L4_DMA2_BASE+STM32L4_DMA_CNDTR3_OFFSET)
#define STM32L4_DMA2_CNDTR4 (STM32L4_DMA2_BASE+STM32L4_DMA_CNDTR4_OFFSET)
#define STM32L4_DMA2_CNDTR5 (STM32L4_DMA2_BASE+STM32L4_DMA_CNDTR5_OFFSET)
+#define STM32L4_DMA2_CNDTR6 (STM32L4_DMA2_BASE+STM32L4_DMA_CNDTR6_OFFSET)
+#define STM32L4_DMA2_CNDTR7 (STM32L4_DMA2_BASE+STM32L4_DMA_CNDTR7_OFFSET)
#define STM32L4_DMA2_CPAR(n) (STM32L4_DMA2_BASE+STM32L4_DMA_CPAR_OFFSET(n))
#define STM32L4_DMA2_CPAR1 (STM32L4_DMA2_BASE+STM32L4_DMA_CPAR1_OFFSET)
@@ -172,6 +175,8 @@
#define STM32L4_DMA2_CPAR3 (STM32L4_DMA2_BASE+STM32L4_DMA_CPAR3_OFFSET)
#define STM32L4_DMA2_CPAR4 (STM32L4_DMA2_BASE+STM32L4_DMA_CPAR4_OFFSET)
#define STM32L4_DMA2_CPAR5 (STM32L4_DMA2_BASE+STM32L4_DMA_CPAR5_OFFSET)
+#define STM32L4_DMA2_CPAR6 (STM32L4_DMA2_BASE+STM32L4_DMA_CPAR6_OFFSET)
+#define STM32L4_DMA2_CPAR7 (STM32L4_DMA2_BASE+STM32L4_DMA_CPAR7_OFFSET)
#define STM32L4_DMA2_CMAR(n) (STM32L4_DMA2_BASE+STM32L4_DMA_CMAR_OFFSET(n))
#define STM32L4_DMA2_CMAR1 (STM32L4_DMA2_BASE+STM32L4_DMA_CMAR1_OFFSET)
@@ -179,6 +184,8 @@
#define STM32L4_DMA2_CMAR3 (STM32L4_DMA2_BASE+STM32L4_DMA_CMAR3_OFFSET)
#define STM32L4_DMA2_CMAR4 (STM32L4_DMA2_BASE+STM32L4_DMA_CMAR4_OFFSET)
#define STM32L4_DMA2_CMAR5 (STM32L4_DMA2_BASE+STM32L4_DMA_CMAR5_OFFSET)
+#define STM32L4_DMA2_CMAR6 (STM32L4_DMA2_BASE+STM32L4_DMA_CMAR6_OFFSET)
+#define STM32L4_DMA2_CMAR7 (STM32L4_DMA2_BASE+STM32L4_DMA_CMAR7_OFFSET)
/* Register Bitfield Definitions ****************************************************/
diff --git a/arch/arm/src/stm32l4/stm32l4_allocateheap.c b/arch/arm/src/stm32l4/stm32l4_allocateheap.c
index e1c2e1acafc..9e37373adfe 100644
--- a/arch/arm/src/stm32l4/stm32l4_allocateheap.c
+++ b/arch/arm/src/stm32l4/stm32l4_allocateheap.c
@@ -62,13 +62,13 @@
****************************************************************************/
/* Internal SRAM is available in all members of the STM32L4 family. The
* following definitions must be provided to specify the size and
- * location of internal(system) SRAM:
+ * location of internal (system) SRAM1 and SRAM2:
*
* SRAM1_END 0x20018000
* SRAM2_START 0x10000000
* SRAM2_END 0x10008000
*
- * In addition to internal SRAM, SRAM may also be available through the FSMC.
+ * In addition to internal SRAM, memory may also be available through the FSMC.
* In order to use FSMC SRAM, the following additional things need to be
* present in the NuttX configuration file:
*
@@ -80,15 +80,14 @@
* CONFIG_HEAP2_SIZE : The size of the SRAM in the FSMC
* address space
* CONFIG_MM_REGIONS : Must be set to a large enough value to
- * include the FSMC SRAM (as determined by
- * the rules provided below)
+ * include the additional regions.
*/
#ifndef CONFIG_STM32L4_FSMC
# undef CONFIG_STM32L4_FSMC_SRAM
#endif
-/* MSTM32L4x6xx have 128Kib in two banks, both accessible to DMA:
+/* STM32L4x6xx have 128Kib in two banks, both accessible to DMA:
*
* 1) 96KiB of System SRAM beginning at address 0x2000:0000 - 0x2001:8000
* 2) 32KiB of System SRAM beginning at address 0x1000:0000 - 0x1000:8000
@@ -105,55 +104,21 @@
#define SRAM2_START 0x10000000
#define SRAM2_END 0x10008000
-/* Allocations according to the number of memory regions:
- *
- * 1 region available:
- * - map it to SRAM1
- * - warn that SRAM2 is not available for heap
- * - if FMC is enabled, warn that it is not available for heap
- *
- * 2 regions available: map them to SRAM1 and SRAM2
- * - map region 1 to SRAM1
- * - map region 2 to SRAM2
- * - if FMC is enabled, warn that it is not available for heap
- *
- * 3 or more regions
- *
- * - map them to SRAM1, SRAM2, FMC
- */
-
-#if CONFIG_MM_REGIONS < 1
-# warning heap is not usable
-
-#elif CONFIG_MM_REGIONS < 2
-
-# warning SRAM2 (32k) is NOT available for heap, only SRAM1 (96k) : not enough MM regions
-# undef SRAM2_START
-# undef SRAM2_END
-
-# if defined(CONFIG_STM32L4_FSMC_SRAM)
-# warning FMC SRAM is NOT available for heap : not enough MM regions (1)
-# undef CONFIG_STM32L4_FSMC_SRAM
+#if defined(STM32L4_SRAM2_HEAP) && defined(CONFIG_STM32L4_FSMC_SRAM_HEAP)
+# if CONFIG_MM_REGIONS < 3
+# error you need at least 3 memory manager regions to support SRAM2 and FSMC
# endif
-
-#elif CONFIG_MM_REGIONS < 3
-
-# if defined(CONFIG_STM32L4_FSMC_SRAM)
-# warning FMC SRAM is NOT available for heap : not enough MM regions (2)
-# undef CONFIG_STM32L4_FSMC_SRAM
-# endif
-
-#elif CONFIG_MM_REGIONS > 3
-
-/*Everything can be mapped but some entries wont be used -> warn and correct*/
-# warning "CONFIG_MM_REGIONS > 3 but I don't know what some of the region(s) are"
-# undef CONFIG_MM_REGIONS
-# define CONFIG_MM_REGIONS 3
-
-#else
-/*Everything can be mapped*/
#endif
+#if defined(STM32L4_SRAM2_HEAP) || defined(CONFIG_STM32L4_FSMC_SRAM_HEAP)
+# if CONFIG_MM_REGIONS < 2
+# error you need at least 2 memory manager regions to support SRAM2 or FSMC
+# endif
+#endif
+
+#if CONFIG_MM_REGIONS < 1
+# warning you have no heap; malloc() will fail. are you sure?
+#endif
/* If FSMC SRAM is going to be used as heap, then verify that the starting
* address and size of the external SRAM region has been provided in the
@@ -338,6 +303,8 @@ void up_allocate_kheap(FAR void **heap_start, size_t *heap_size)
void up_addregion(void)
{
+#ifdef CONFIG_STM32L4_SRAM2_HEAP
+
#if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_MM_KERNEL_HEAP)
/* Allow user-mode access to the SRAM2 heap */
@@ -354,7 +321,9 @@ void up_addregion(void)
kumm_addregion((FAR void *)SRAM2_START, SRAM2_END-SRAM2_START);
-#ifdef CONFIG_STM32L4_FSMC_SRAM
+#endif
+
+#ifdef CONFIG_STM32L4_FSMC_SRAM_HEAP
#if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_MM_KERNEL_HEAP)
/* Allow user-mode access to the FSMC SRAM user heap memory */
diff --git a/arch/arm/src/stm32l4/stm32l4_dma.h b/arch/arm/src/stm32l4/stm32l4_dma.h
index 9fd36a63373..ee11f8655c5 100644
--- a/arch/arm/src/stm32l4/stm32l4_dma.h
+++ b/arch/arm/src/stm32l4/stm32l4_dma.h
@@ -3,6 +3,8 @@
*
* Copyright (C) 2009, 2011-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
+ * Sebastien Lorquet
+ * dev@ziggurat29.com
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -57,13 +59,11 @@
* DMA callback function (see dma_callback_t).
*/
-# define DMA_STATUS_FEIF 0 /* (Not available in F1) */
-# define DMA_STATUS_DMEIF 0 /* (Not available in F1) */
# define DMA_STATUS_TEIF DMA_CHAN_TEIF_BIT /* Channel Transfer Error */
# define DMA_STATUS_HTIF DMA_CHAN_HTIF_BIT /* Channel Half Transfer */
# define DMA_STATUS_TCIF DMA_CHAN_TCIF_BIT /* Channel Transfer Complete */
-#define DMA_STATUS_ERROR (DMA_STATUS_FEIF|DMA_STATUS_DMEIF|DMA_STATUS_TEIF)
+#define DMA_STATUS_ERROR (DMA_STATUS_TEIF)
#define DMA_STATUS_SUCCESS (DMA_STATUS_TCIF|DMA_STATUS_HTIF)
/************************************************************************************
@@ -71,7 +71,7 @@
************************************************************************************/
/* DMA_HANDLE provides an opaque are reference that can be used to represent a DMA
- * channel (F1) or a DMA stream (F4).
+ * channel.
*/
typedef FAR void *DMA_HANDLE;
@@ -81,7 +81,7 @@ typedef FAR void *DMA_HANDLE;
* completion of the DMA.
*
* Input Parameters:
- * handle - Refers tot he DMA channel or stream
+ * handle - Refers tot he DMA channel
* status - A bit encoded value that provides the completion status. See the
* DMASTATUS_* definitions above.
* arg - A user-provided value that was provided when stm32l4_dmastart() was
@@ -93,11 +93,12 @@ typedef void (*dma_callback_t)(DMA_HANDLE handle, uint8_t status, void *arg);
#ifdef CONFIG_DEBUG_DMA
struct stm32l4_dmaregs_s
{
- uint32_t isr;
- uint32_t ccr;
- uint32_t cndtr;
- uint32_t cpar;
- uint32_t cmar;
+ uint32_t isr; /* Interrupt Status Register; each channel gets 4 bits */
+ uint32_t cselr; /* Channel Selection Register; chooses peripheral bound */
+ uint32_t ccr; /* Channel Configuration Register; determines functionality */
+ uint32_t cndtr; /* Channel Count Register; determines number of transfers */
+ uint32_t cpar; /* Channel Peripheral Address Register; determines start */
+ uint32_t cmar; /* Channel Memory Address Register; determines start */
};
#endif
@@ -126,7 +127,7 @@ extern "C"
* Description:
* Allocate a DMA channel. This function gives the caller mutually
* exclusive access to the DMA channel specified by the 'chan' argument.
- * DMA channels are shared on the STM32: Devices sharing the same DMA
+ * DMA channels are shared on the STM32L4: Devices sharing the same DMA
* channel cannot do DMA concurrently! See the DMACHAN_* definitions in
* stm32l4_dma.h.
*
@@ -142,10 +143,8 @@ extern "C"
*
* Input parameter:
* chan - Identifies the stream/channel resource
- * For the STM32 F1, this is simply the channel number as provided by
- * the DMACHAN_* definitions in chip/stm32f10xxx_dma.h.
- * For the STM32 F4, this is a bit encoded value as provided by the
- * the DMAMAP_* definitions in chip/stm32f40xxx_dma.h
+ * This is a bit encoded value as provided by the DMACHAN_* definitions
+ * in chip/stm32l4x6xx_dma.h
*
* Returned Value:
* Provided that 'chan' is valid, this function ALWAYS returns a non-NULL,
@@ -153,8 +152,8 @@ extern "C"
* assert if debug is enabled or do something ignorant otherwise).
*
* Assumptions:
- * - The caller does not hold he DMA channel.
- * - The caller can wait for the DMA channel to be freed if it is no
+ * - The caller does not hold the DMA channel.
+ * - The caller can wait for the DMA channel to be freed if it is not
* available.
*
****************************************************************************/
diff --git a/arch/arm/src/stm32l4/stm32l4_qspi.c b/arch/arm/src/stm32l4/stm32l4_qspi.c
index 68e3d0ccb35..57aa85dac05 100644
--- a/arch/arm/src/stm32l4/stm32l4_qspi.c
+++ b/arch/arm/src/stm32l4/stm32l4_qspi.c
@@ -120,34 +120,59 @@
#define DMA_END_TRANSFER 4
#define DMA_NSAMPLES 5
-#ifdef CONFIG_STM32L4_QSPI_DMA
-# error QSPI DMA support not yet implemented
+/* Can't have both interrupt-driven QSPI and DMA QSPI */
+
+#if defined(STM32L4_QSPI_INTERRUPTS) && defined(CONFIG_STM32L4_QSPI_DMA)
+# error "Cannot enable both interrupt mode and DMA mode for QSPI"
#endif
-/* QSPI dma is not yet implemented */
-
-#undef CONFIG_STM32L4_QSPI_DMA
-
-/* QSPI Interrupt mode is implemented */
-
-#define QSPI_USE_INTERRUPTS
-
/* Sanity check that board.h defines requisite QSPI pinmap options for */
#if (!defined(GPIO_QSPI_CS) || !defined(GPIO_QSPI_IO0) || !defined(GPIO_QSPI_IO1) || \
!defined(GPIO_QSPI_IO2) || !defined(GPIO_QSPI_IO3) || !defined(GPIO_QSPI_SCK))
-# error you must define QSPI pinmapping options for GPIO_QSPI_CS GPIO_QSPI_IO0 \
+# error you must define QSPI pinmapping options for GPIO_QSPI_CS GPIO_QSPI_IO0 \
GPIO_QSPI_IO1 GPIO_QSPI_IO2 GPIO_QSPI_IO3 GPIO_QSPI_SCK in your board.h
#endif
+#ifdef CONFIG_STM32L4_QSPI_DMA
+
+# if defined(CONFIG_STM32L4_QSPI_DMA_CHAN_1_5)
+# define DMACHAN_QUADSPI DMACHAN_QUADSPI_1
+# elif defined(CONFIG_STM32L4_QSPI_DMA_CHAN_2_7)
+# define DMACHAN_QUADSPI DMACHAN_QUADSPI_2
+# else
+# error QSPI DMA channel must be specified via DMACHAN_QUADSPI in your board.h
+# endif
+
+# if defined(CONFIG_STM32L4_QSPI_DMAPRIORITY_LOW)
+# define QSPI_DMA_PRIO DMA_CCR_PRILO
+# elif defined(CONFIG_STM32L4_QSPI_DMAPRIORITY_MEDIUM)
+# define QSPI_DMA_PRIO DMA_CCR_PRIMED
+# elif defined(CONFIG_STM32L4_QSPI_DMAPRIORITY_HIGH)
+# define QSPI_DMA_PRIO DMA_CCR_PRIHI
+# elif defined(CONFIG_STM32L4_QSPI_DMAPRIORITY_VERYHIGH)
+# define QSPI_DMA_PRIO DMA_CCR_PRIVERYHI
+# else
+# define QSPI_DMA_PRIO DMA_CCR_PRIMED
+# endif
+
+#endif
+
#ifndef BOARD_AHB_FREQUENCY
-# error your board.h needs to define the value of BOARD_AHB_FREQUENCY
+# error your board.h needs to define the value of BOARD_AHB_FREQUENCY
#endif
#if !defined(CONFIG_STM32L4_QSPI_FLASH_SIZE) || 0 == CONFIG_STM32L4_QSPI_FLASH_SIZE
-# error you must specify a positive flash size via CONFIG_STM32L4_QSPI_FLASH_SIZE
+# error you must specify a positive flash size via CONFIG_STM32L4_QSPI_FLASH_SIZE
#endif
+/* DMA timeout. The value is not critical; we just don't want the system to
+ * hang in the event that a DMA does not finish.
+ */
+
+#define DMA_TIMEOUT_MS (800)
+#define DMA_TIMEOUT_TICKS MSEC2TICK(DMA_TIMEOUT_MS)
+
/* Clocking *****************************************************************/
/* The QSPI bit rate clock is generated by dividing the peripheral clock by
* a value between 1 and 255
@@ -176,8 +201,9 @@ struct stm32l4_qspidev_s
uint8_t intf; /* QSPI controller number (0) */
bool initialized; /* TRUE: Controller has been initialized */
sem_t exclsem; /* Assures mutually exclusive access to QSPI */
+ bool memmap; /* TRUE: Controller is in memory mapped mode */
-#ifdef QSPI_USE_INTERRUPTS
+#ifdef STM32L4_QSPI_INTERRUPTS
xcpt_t handler; /* Interrupt handler */
uint8_t irq; /* Interrupt number */
sem_t op_sem; /* Block until complete */
@@ -185,7 +211,11 @@ struct stm32l4_qspidev_s
#endif
#ifdef CONFIG_STM32L4_QSPI_DMA
- /* XXX III needs implementation */
+ bool candma; /* DMA is supported */
+ sem_t dmawait; /* Used to wait for DMA completion */
+ int result; /* DMA result */
+ DMA_HANDLE dmach; /* QSPI DMA handle */
+ WDOG_ID dmadog; /* Watchdog that handles DMA timeouts */
#endif
/* Debug stuff */
@@ -231,7 +261,7 @@ struct qspi_xctnspec_s
uint8_t isddr; /* true if 'double data rate' */
uint8_t issioo; /* true if 'send instruction only once' mode */
-#ifdef QSPI_USE_INTERRUPTS
+#ifdef STM32L4_QSPI_INTERRUPTS
uint8_t function; /* functional mode; to distinguish a read or write */
int8_t disposition; /* how it all turned out */
uint32_t idxnow; /* index into databuffer of current byte in transfer */
@@ -270,11 +300,37 @@ static void qspi_dumpgpioconfig(const char *msg);
/* Interrupts */
-#ifdef QSPI_USE_INTERRUPTS
+#ifdef STM32L4_QSPI_INTERRUPTS
static int qspi0_interrupt(int irq, void *context);
#endif
+/* DMA support */
+
+#ifdef CONFIG_STM32L4_QSPI_DMA
+
+# if defined(CONFIG_QSPI_DMAPRIO)
+# define QSPI_DMA_PRIO CONFIG_QSPI_DMAPRIO
+# else
+# define QSPI_DMA_PRIO DMA_CCR_PRIMED
+# endif
+
+# ifdef CONFIG_STM32L4_QSPI_DMADEBUG
+# define qspi_dma_sample(s,i) stm32l4_dmasample((s)->dmach, &(s)->dmaregs[i])
+static void qspi_dma_sampleinit(struct stm32l4_qspidev_s *priv);
+static void qspi_dma_sampledone(struct stm32l4_qspidev_s *priv);
+# else
+# define qspi_dma_sample(s,i)
+# define qspi_dma_sampleinit(s)
+# define qspi_dma_sampledone(s)
+# endif
+
+# ifndef CONFIG_STM32L4_QSPI_DMATHRESHOLD
+# define CONFIG_STM32L4_QSPI_DMATHRESHOLD 4
+# endif
+
+#endif
+
/* QSPI methods */
static int qspi_lock(struct qspi_dev_s *dev, bool lock);
@@ -319,13 +375,13 @@ static struct stm32l4_qspidev_s g_qspi0dev =
.ops = &g_qspi0ops,
},
.base = STM32L4_QSPI_BASE,
-#ifdef QSPI_USE_INTERRUPTS
+#ifdef STM32L4_QSPI_INTERRUPTS
.handler = qspi0_interrupt,
.irq = STM32L4_IRQ_QUADSPI,
#endif
.intf = 0,
#ifdef CONFIG_STM32L4_QSPI_DMA
- /* XXX III needs implementation */
+ .candma = true,
#endif
};
@@ -565,6 +621,93 @@ static void qspi_dumpgpioconfig(const char *msg)
}
#endif
+#ifdef CONFIG_STM32L4_QSPI_DMADEBUG
+/****************************************************************************
+ * Name: qspi_dma_sampleinit
+ *
+ * Description:
+ * Initialize sampling of DMA registers
+ *
+ * Input Parameters:
+ * priv - QSPI driver instance
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+static void qspi_dma_sampleinit(struct stm32l4_qspidev_s *priv)
+{
+ /* Put contents of register samples into a known state */
+
+ memset(priv->dmaregs, 0xff, DMA_NSAMPLES * sizeof(struct stm32l4_dmaregs_s));
+
+ /* Then get the initial samples */
+
+ stm32l4_dmasample(priv->dmach, &priv->dmaregs[DMA_INITIAL]);
+}
+
+/****************************************************************************
+ * Name: qspi_dma_sampledone
+ *
+ * Description:
+ * Dump sampled DMA registers
+ *
+ * Input Parameters:
+ * priv - QSPI driver instance
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+static void qspi_dma_sampledone(struct stm32l4_qspidev_s *priv)
+{
+ /* Sample the final registers */
+
+ stm32l4_dmasample(priv->dmach, &priv->dmaregs[DMA_END_TRANSFER]);
+
+ /* Then dump the sampled DMA registers */
+ /* Initial register values */
+
+ stm32l4_dmadump(priv->dmach, &priv->dmaregs[DMA_INITIAL],
+ "Initial Registers");
+
+ /* Register values after DMA setup */
+
+ stm32l4_dmadump(priv->dmach, &priv->dmaregs[DMA_AFTER_SETUP],
+ "After DMA Setup");
+
+ /* Register values after DMA start */
+
+ stm32l4_dmadump(priv->dmach, &priv->dmaregs[DMA_AFTER_START],
+ "After DMA Start");
+
+ /* Register values at the time of the TX and RX DMA callbacks
+ * -OR- DMA timeout.
+ *
+ * If the DMA timed out, then there will not be any RX DMA
+ * callback samples. There is probably no TX DMA callback
+ * samples either, but we don't know for sure.
+ */
+
+ if (priv->result == -ETIMEDOUT)
+ {
+ stm32l4_dmadump(priv->dmach, &priv->dmaregs[DMA_TIMEOUT],
+ "At DMA timeout");
+ }
+ else
+ {
+ stm32l4_dmadump(priv->dmach, &priv->dmaregs[DMA_CALLBACK],
+ "At DMA callback");
+ }
+
+ stm32l4_dmadump(priv->dmach, &priv->dmaregs[DMA_END_TRANSFER],
+ "At End-of-Transfer");
+}
+#endif
+
+
/****************************************************************************
* Name: qspi_setupxctnfromcmd
*
@@ -680,7 +823,7 @@ static int qspi_setupxctnfromcmd(struct qspi_xctnspec_s *xctn,
xctn->isddr = 0;
}
-#if defined(QSPI_USE_INTERRUPTS)
+#if defined(STM32L4_QSPI_INTERRUPTS)
xctn->function = QSPICMD_ISWRITE(cmdinfo->flags) ? CCR_FMODE_INDWR : CCR_FMODE_INDRD;
xctn->disposition = - EIO;
xctn->idxnow = 0;
@@ -809,7 +952,7 @@ static int qspi_setupxctnfrommem(struct qspi_xctnspec_s *xctn,
xctn->isddr = 0;
-#if defined(QSPI_USE_INTERRUPTS)
+#if defined(STM32L4_QSPI_INTERRUPTS)
xctn->function = QSPIMEM_ISWRITE(meminfo->flags) ? CCR_FMODE_INDWR : CCR_FMODE_INDRD;
xctn->disposition = - EIO;
xctn->idxnow = 0;
@@ -931,7 +1074,7 @@ static void qspi_ccrconfig(struct stm32l4_qspidev_s *priv,
}
}
-#if defined(QSPI_USE_INTERRUPTS)
+#if defined(STM32L4_QSPI_INTERRUPTS)
/****************************************************************************
* Name: qspi0_interrupt
*
@@ -1101,7 +1244,11 @@ static int qspi0_interrupt(int irq, void *context)
regval &= ~(QSPI_CR_TEIE | QSPI_CR_TCIE | QSPI_CR_FTIE | QSPI_CR_SMIE | QSPI_CR_TOIE);
qspi_putreg(&g_qspi0dev, regval, STM32L4_QUADSPI_CR_OFFSET);
- /* Set error status */
+ /* Set error status; 'transfer error' means that, in 'indirect mode',
+ * an invalid address is attempted to be accessed. 'Invalid' is
+ * presumably relative to the FSIZE field in CCR; the manual is not
+ * explicit, but what else could it be?
+ */
g_qspi0dev.xctn->disposition = - EIO;
@@ -1110,7 +1257,7 @@ static int qspi0_interrupt(int irq, void *context)
sem_post(&g_qspi0dev.op_sem);
}
- /* Is it 'Timeout'? (: */
+ /* Is it 'Timeout'? */
if ((status & QSPI_SR_TOF) && (cr & QSPI_CR_TOIE))
{
@@ -1118,22 +1265,284 @@ static int qspi0_interrupt(int irq, void *context)
qspi_putreg(&g_qspi0dev, QSPI_FCR_CTOF, STM32L4_QUADSPI_FCR);
- /* Set error status */
-
- g_qspi0dev.xctn->disposition = - ETIMEDOUT;
-
- /* Signal complete */
-
- sem_post(&g_qspi0dev.op_sem);
+ /* XXX this interrupt simply means that, in 'memory mapped mode',
+ * the QSPI memory has not been accessed for a while, and the
+ * IP block was configured to automatically de-assert CS after
+ * a timeout. And now we're being informed that has happened.
+ *
+ * But who cares? If someone does, perhaps a user callback is
+ * appropriate, or some signal? Either way, realize the xctn
+ * member is /not/ valid, so you can't set the disposition
+ * field. Also, note signaling completion has no meaning here
+ * because in memory mapped mode no one holds the semaphore.
+ */
}
return OK;
}
#elif defined(CONFIG_STM32L4_QSPI_DMA)
- /* XXX III dma mode */
+/****************************************************************************
+ * Name: qspi_dma_timeout
+ *
+ * Description:
+ * The watchdog timeout setup when a has expired without completion of a
+ * DMA.
+ *
+ * Input Parameters:
+ * argc - The number of arguments (should be 1)
+ * arg - The argument (state structure reference cast to uint32_t)
+ *
+ * Returned Value:
+ * None
+ *
+ * Assumptions:
+ * Always called from the interrupt level with interrupts disabled.
+ *
+ ****************************************************************************/
-#else
+static void qspi_dma_timeout(int argc, uint32_t arg)
+{
+ struct stm32l4_qspidev_s *priv = (struct stm32l4_qspidev_s *)arg;
+ DEBUGASSERT(priv != NULL);
+
+ /* Sample DMA registers at the time of the timeout */
+
+ qspi_dma_sample(priv, DMA_CALLBACK);
+
+ /* Report timeout result, perhaps overwriting any failure reports from
+ * the TX callback.
+ */
+
+ priv->result = -ETIMEDOUT;
+
+ /* Then wake up the waiting thread */
+
+ sem_post(&priv->dmawait);
+}
+
+/****************************************************************************
+ * Name: qspi_dma_callback
+ *
+ * Description:
+ * This callback function is invoked at the completion of the QSPI DMA.
+ *
+ * Input Parameters:
+ * handle - The DMA handler
+ * isr - source of the DMA interrupt
+ * arg - A pointer to the chip select structure
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+static void qspi_dma_callback(DMA_HANDLE handle, uint8_t isr, void *arg)
+{
+ struct stm32l4_qspidev_s *priv = (struct stm32l4_qspidev_s *)arg;
+ DEBUGASSERT(priv != NULL);
+
+ /* Cancel the watchdog timeout */
+
+ (void)wd_cancel(priv->dmadog);
+
+ /* Sample DMA registers at the time of the callback */
+
+ qspi_dma_sample(priv, DMA_CALLBACK);
+
+ /* Report the result of the transfer only if the callback has not already
+ * reported an error.
+ */
+
+ if (priv->result == -EBUSY)
+ {
+ /* Save the result of the transfer if no error was previously reported */
+
+ if ( isr & DMA_CHAN_TCIF_BIT )
+ {
+ priv->result = OK;
+ }
+ else if ( isr & DMA_CHAN_TEIF_BIT )
+ {
+ priv->result = -EIO;
+ }
+ else
+ {
+ priv->result = OK;
+ }
+ }
+
+ /* Then wake up the waiting thread */
+
+ sem_post(&priv->dmawait);
+}
+
+/****************************************************************************
+ * Name: qspi_regaddr
+ *
+ * Description:
+ * Return the address of an QSPI register
+ *
+ ****************************************************************************/
+
+static inline uintptr_t qspi_regaddr(struct stm32l4_qspidev_s *priv,
+ unsigned int offset)
+{
+ return priv->base + offset;
+}
+
+/****************************************************************************
+ * Name: qspi_memory_dma
+ *
+ * Description:
+ * Perform one QSPI memory transfer using DMA
+ *
+ * Input Parameters:
+ * priv - Device-specific state data
+ * meminfo - Describes the memory transfer to be performed.
+ * xctn - Describes the transaction context.
+ *
+ * Returned Value:
+ * Zero (OK) on SUCCESS, a negated errno on value of failure
+ *
+ ****************************************************************************/
+
+static int qspi_memory_dma(struct stm32l4_qspidev_s *priv,
+ struct qspi_meminfo_s *meminfo,
+ struct qspi_xctnspec_s *xctn)
+{
+ uint32_t dmaflags;
+ uint32_t regval;
+ int ret;
+
+ /* Initialize register sampling */
+
+ qspi_dma_sampleinit(priv);
+
+ /* Determine DMA flags and setup the DMA */
+
+ if (QSPIMEM_ISWRITE(meminfo->flags))
+ {
+ /* Setup the DMA (memory-to-peripheral) */
+
+ dmaflags = (QSPI_DMA_PRIO | DMA_CCR_MSIZE_8BITS | DMA_CCR_PSIZE_8BITS | DMA_CCR_MINC | DMA_CCR_DIR);
+ }
+ else
+ {
+ /* Setup the DMA (peripheral-to-memory) */
+
+ dmaflags = (QSPI_DMA_PRIO | DMA_CCR_MSIZE_8BITS | DMA_CCR_PSIZE_8BITS | DMA_CCR_MINC );
+ }
+
+ stm32l4_dmasetup(priv->dmach, qspi_regaddr(priv, STM32L4_QUADSPI_DR_OFFSET),
+ (uint32_t)meminfo->buffer, meminfo->buflen, dmaflags);
+
+ qspi_dma_sample(priv, DMA_AFTER_SETUP);
+
+ /* Enable the memory transfer */
+
+ regval = qspi_getreg(priv, STM32L4_QUADSPI_CR_OFFSET);
+ regval |= QSPI_CR_DMAEN;
+ qspi_putreg(priv, regval, STM32L4_QUADSPI_CR_OFFSET);
+
+ /* Set up the Communications Configuration Register as per command info */
+
+ qspi_ccrconfig(priv, xctn,
+ QSPIMEM_ISWRITE(meminfo->flags) ? CCR_FMODE_INDWR : CCR_FMODE_INDRD);
+
+ /* Start the DMA */
+
+ priv->result = -EBUSY;
+ stm32l4_dmastart(priv->dmach, qspi_dma_callback, priv, false);
+
+ qspi_dma_sample(priv, DMA_AFTER_START);
+
+ /* Wait for DMA completion. This is done in a loop because there may be
+ * false alarm semaphore counts that cause sem_wait() not fail to wait
+ * or to wake-up prematurely (for example due to the receipt of a signal).
+ * We know that the DMA has completed when the result is anything other
+ * that -EBUSY.
+ */
+
+ do
+ {
+ /* Start (or re-start) the watchdog timeout */
+
+ ret = wd_start(priv->dmadog, DMA_TIMEOUT_TICKS,
+ (wdentry_t)qspi_dma_timeout, 1, (uint32_t)priv);
+ if (ret != OK)
+ {
+ qspidbg("ERROR: wd_start failed: %d\n", ret);
+ }
+
+ /* Wait for the DMA complete */
+
+ ret = sem_wait(&priv->dmawait);
+
+ /* Cancel the watchdog timeout */
+
+ (void)wd_cancel(priv->dmadog);
+
+ /* Check if we were awakened by an error of some kind */
+
+ if (ret < 0)
+ {
+ /* EINTR is not a failure. That simply means that the wait
+ * was awakened by a signal.
+ */
+
+ int errorcode = errno;
+ if (errorcode != EINTR)
+ {
+ DEBUGPANIC();
+ regval = qspi_getreg(priv, STM32L4_QUADSPI_CR_OFFSET);
+ regval &= ~QSPI_CR_DMAEN;
+ qspi_putreg(priv, regval, STM32L4_QUADSPI_CR_OFFSET);
+ return -errorcode;
+ }
+ }
+
+ /* Note that we might be awakened before the wait is over due to
+ * residual counts on the semaphore. So, to handle, that case,
+ * we loop until something changes the DMA result to any value other
+ * than -EBUSY.
+ */
+ }
+ while (priv->result == -EBUSY);
+
+ /* Wait for Transfer complete, and not busy */
+
+ qspi_waitstatusflags(priv, QSPI_SR_TCF,1);
+ qspi_waitstatusflags(priv, QSPI_SR_BUSY,0);
+ MEMORY_SYNC();
+
+ /* Dump the sampled DMA registers */
+
+ qspi_dma_sampledone(priv);
+
+ /* Make sure that the DMA is stopped (it will be stopped automatically
+ * on normal transfers, but not necessarily when the transfer terminates
+ * on an error condition).
+ */
+
+ stm32l4_dmastop(priv->dmach);
+
+ regval = qspi_getreg(priv, STM32L4_QUADSPI_CR_OFFSET);
+ regval &= ~QSPI_CR_DMAEN;
+ qspi_putreg(priv, regval, STM32L4_QUADSPI_CR_OFFSET);
+
+ /* Complain if the DMA fails */
+
+ if (priv->result)
+ {
+ qspidbg("ERROR: DMA failed with result: %d\n", priv->result);
+ }
+
+ return priv->result;
+}
+#endif
+
+#if !defined(STM32L4_QSPI_INTERRUPTS)
/****************************************************************************
* Name: qspi_receive_blocking
*
@@ -1340,6 +1749,15 @@ static uint32_t qspi_setfrequency(struct qspi_dev_s *dev, uint32_t frequency)
uint32_t prescaler;
uint32_t regval;
+ if (priv->memmap)
+ {
+ /* XXX we have no better return here, but the caller will find out
+ * in their subsequent calls.
+ */
+
+ return 0;
+ }
+
qspivdbg("frequency=%d\n", frequency);
DEBUGASSERT(priv);
@@ -1424,6 +1842,14 @@ static void qspi_setmode(struct qspi_dev_s *dev, enum qspi_mode_e mode)
struct stm32l4_qspidev_s *priv = (struct stm32l4_qspidev_s *)dev;
uint32_t regval;
+ if (priv->memmap)
+ {
+ /* XXX we have no better return here, but the caller will find out
+ * in their subsequent calls.
+ */
+ return;
+ }
+
qspivdbg("mode=%d\n", mode);
/* Has the mode changed? */
@@ -1518,6 +1944,16 @@ static int qspi_command(struct qspi_dev_s *dev,
struct qspi_xctnspec_s xctn;
int ret;
+ /* Reject commands issued while in memory mapped mode, which will
+ * automatically cancel the memory mapping. You must exit the
+ * memory mapped mode first.
+ */
+
+ if (priv->memmap)
+ {
+ return -EBUSY;
+ }
+
/* Set up the transaction descriptor as per command info */
ret = qspi_setupxctnfromcmd(&xctn, cmdinfo);
@@ -1539,7 +1975,7 @@ static int qspi_command(struct qspi_dev_s *dev,
QSPI_FCR_CTEF | QSPI_FCR_CTCF | QSPI_FCR_CSMF | QSPI_FCR_CTOF,
STM32L4_QUADSPI_FCR);
-#ifdef QSPI_USE_INTERRUPTS
+#ifdef STM32L4_QSPI_INTERRUPTS
/* interrupt mode will need access to the transaction context */
priv->xctn = &xctn;
@@ -1623,9 +2059,9 @@ static int qspi_command(struct qspi_dev_s *dev,
ret = xctn.disposition;
-#elif defined(CONFIG_STM32L4_QSPI_DMA)
- /* XXX III dma mode (and 'autopolling'?) */
-
+ /* because command transfers are so small, we're not going to use
+ * DMA for them, only interrupts or polling
+ */
#else
/* Polling mode */
@@ -1689,6 +2125,16 @@ static int qspi_memory(struct qspi_dev_s *dev,
struct qspi_xctnspec_s xctn;
int ret;
+ /* Reject commands issued while in memory mapped mode, which will
+ * automatically cancel the memory mapping. You must exit the
+ * memory mapped mode first.
+ */
+
+ if (priv->memmap)
+ {
+ return -EBUSY;
+ }
+
/* Set up the transaction descriptor as per command info */
ret = qspi_setupxctnfrommem(&xctn, meminfo);
@@ -1710,7 +2156,7 @@ static int qspi_memory(struct qspi_dev_s *dev,
QSPI_FCR_CTEF | QSPI_FCR_CTCF | QSPI_FCR_CSMF | QSPI_FCR_CTOF,
STM32L4_QUADSPI_FCR);
-#ifdef QSPI_USE_INTERRUPTS
+#ifdef STM32L4_QSPI_INTERRUPTS
/* interrupt mode will need access to the transaction context */
priv->xctn = &xctn;
@@ -1772,8 +2218,46 @@ static int qspi_memory(struct qspi_dev_s *dev,
ret = xctn.disposition;
#elif defined(CONFIG_STM32L4_QSPI_DMA)
- /* XXX III dma mode (and 'autopolling'?) */
-
+ /* Can we perform DMA? Should we perform DMA? */
+
+ if (priv->candma &&
+ meminfo->buflen > CONFIG_STM32L4_QSPI_DMATHRESHOLD &&
+ IS_ALIGNED((uintptr_t)meminfo->buffer) &&
+ IS_ALIGNED(meminfo->buflen))
+ {
+ ret = qspi_memory_dma(priv, meminfo, &xctn);
+ }
+ else
+ {
+ /* polling mode */
+
+ /* Set up the Communications Configuration Register as per command info */
+
+ qspi_ccrconfig(priv, &xctn,
+ QSPIMEM_ISWRITE(meminfo->flags) ? CCR_FMODE_INDWR : CCR_FMODE_INDRD);
+
+ /* Transfer data */
+
+ DEBUGASSERT(meminfo->buffer != NULL && meminfo->buflen > 0);
+ DEBUGASSERT(IS_ALIGNED(meminfo->buffer));
+
+ if (QSPIMEM_ISWRITE(meminfo->flags))
+ {
+ ret = qspi_transmit_blocking(priv, &xctn);
+ }
+ else
+ {
+ ret = qspi_receive_blocking(priv, &xctn);
+ }
+
+ /* Wait for Transfer complete, and not busy */
+
+ qspi_waitstatusflags(priv, QSPI_SR_TCF,1);
+ qspi_waitstatusflags(priv, QSPI_SR_BUSY,0);
+
+ MEMORY_SYNC();
+ }
+
#else
/* polling mode */
@@ -1796,31 +2280,13 @@ static int qspi_memory(struct qspi_dev_s *dev,
ret = qspi_receive_blocking(priv, &xctn);
}
- MEMORY_SYNC();
-
-#if 0
-#ifdef CONFIG_STM32L4_QSPI_DMA
- /* Can we perform DMA? Should we perform DMA? */
-
- if (priv->candma &&
- meminfo->buflen > CONFIG_STM32L4_QSPI_DMATHRESHOLD &&
- IS_ALIGNED((uintptr_t)meminfo->buffer) &&
- IS_ALIGNED(meminfo->buflen))
- {
- return qspi_memory_dma(priv, meminfo);
- }
- else
-#endif
- {
- return qspi_memory_nodma(priv, meminfo);
- }
-#endif
-
/* Wait for Transfer complete, and not busy */
qspi_waitstatusflags(priv, QSPI_SR_TCF,1);
qspi_waitstatusflags(priv, QSPI_SR_BUSY,0);
+ MEMORY_SYNC();
+
#endif
return ret;
@@ -1897,7 +2363,7 @@ static int qspi_hw_initialize(struct stm32l4_qspidev_s *priv)
qspi_abort(priv);
- regval = qspi_getreg(priv, STM32L4_QUADSPI_CR_OFFSET);
+ regval = 0;
regval &= ~(QSPI_CR_EN);
qspi_putreg(priv, regval, STM32L4_QUADSPI_CR_OFFSET);
@@ -2047,10 +2513,35 @@ struct qspi_dev_s *stm32l4_qspi_initialize(int intf)
sem_init(&priv->exclsem, 0, 1);
#ifdef CONFIG_STM32L4_QSPI_DMA
- /* XXX III needs implementation */
+ /* Pre-allocate DMA channels. */
+
+ if (priv->candma)
+ {
+ priv->dmach = stm32l4_dmachannel(DMACHAN_QUADSPI);
+ if (!priv->dmach)
+ {
+ qspidbg("ERROR: Failed to allocate the DMA channel\n");
+ priv->candma = false;
+ }
+ }
+
+ /* Initialize the QSPI semaphore that is used to wake up the waiting
+ * thread when the DMA transfer completes.
+ */
+
+ sem_init(&priv->dmawait, 0, 0);
+
+ /* Create a watchdog time to catch DMA timeouts */
+
+ priv->dmadog = wd_create();
+ if (priv->dmadog == NULL)
+ {
+ qspidbg("ERROR: Failed to create wdog\n");
+ goto errout_with_dmahandles;
+ }
#endif
-#ifdef QSPI_USE_INTERRUPTS
+#ifdef STM32L4_QSPI_INTERRUPTS
/* Attach the interrupt handler */
ret = irq_attach(priv->irq, priv->handler);
@@ -2080,7 +2571,8 @@ struct qspi_dev_s *stm32l4_qspi_initialize(int intf)
/* Enable interrupts at the NVIC */
priv->initialized = true;
-#ifdef QSPI_USE_INTERRUPTS
+ priv->memmap = false;
+#ifdef STM32L4_QSPI_INTERRUPTS
up_enable_irq(priv->irq);
#endif
}
@@ -2088,16 +2580,146 @@ struct qspi_dev_s *stm32l4_qspi_initialize(int intf)
return &priv->qspi;
errout_with_irq:
-#ifdef QSPI_USE_INTERRUPTS
+#ifdef STM32L4_QSPI_INTERRUPTS
irq_detach(priv->irq);
errout_with_dmadog:
#endif
#ifdef CONFIG_STM32L4_QSPI_DMA
- /* XXX III needs implementation */
+ wd_delete(priv->dmadog);
+
+errout_with_dmahandles:
+ sem_destroy(&priv->dmawait);
+
+ if (priv->dmach)
+ {
+ stm32l4_dmafree(priv->dmach);
+ priv->dmach = NULL;
+ }
#endif
sem_destroy(&priv->exclsem);
return NULL;
}
+
+/****************************************************************************
+ * Name: stm32l4_qspi_enter_memorymapped
+ *
+ * Description:
+ * Put the QSPI device into memory mapped mode
+ *
+ * Input Parameter:
+ * dev - QSPI device
+ * meminfo - parameters like for a memory transfer used for reading
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+void stm32l4_qspi_enter_memorymapped(struct qspi_dev_s* dev,
+ const struct qspi_meminfo_s *meminfo,
+ uint32_t lpto)
+{
+ struct stm32l4_qspidev_s *priv = (struct stm32l4_qspidev_s *)dev;
+ uint32_t regval;
+ struct qspi_xctnspec_s xctn;
+
+ /* lock during this mode change */
+
+ qspi_lock(dev, true);
+
+ if (priv->memmap)
+ {
+ qspi_lock(dev, false);
+ return;
+ }
+
+ /* Abort anything in-progress */
+
+ qspi_abort(priv);
+
+ /* Wait till BUSY flag reset */
+
+ qspi_waitstatusflags(priv, QSPI_SR_BUSY, 0);
+
+ /* if we want the 'low-power timeout counter' */
+
+ if (lpto > 0)
+ {
+ /* Set the Low Power Timeout value (automatically de-assert
+ * CS if memory is not accessed for a while)
+ */
+
+ qspi_putreg(priv, lpto, STM32L4_QUADSPI_LPTR_OFFSET);
+
+ /* Clear Timeout interrupt */
+
+ qspi_putreg(&g_qspi0dev, QSPI_FCR_CTOF, STM32L4_QUADSPI_FCR);
+
+#ifdef STM32L4_QSPI_INTERRUPTS
+ /* Enable Timeout interrupt */
+
+ regval = qspi_getreg(priv, STM32L4_QUADSPI_CR_OFFSET);
+ regval |= (QSPI_CR_TCEN | QSPI_CR_TOIE);
+ qspi_putreg(priv, regval, STM32L4_QUADSPI_CR_OFFSET);
+#endif
+ }
+ else
+ {
+ regval = qspi_getreg(priv, STM32L4_QUADSPI_CR_OFFSET);
+ regval &= ~QSPI_CR_TCEN;
+ qspi_putreg(priv, regval, STM32L4_QUADSPI_CR_OFFSET);
+ }
+
+ /* create a transaction object */
+
+ qspi_setupxctnfrommem(&xctn, meminfo);
+
+#ifdef STM32L4_QSPI_INTERRUPTS
+ priv->xctn = NULL;
+#endif
+
+ /* set it into the ccr */
+
+ qspi_ccrconfig(priv, &xctn, CCR_FMODE_MEMMAP);
+ priv->memmap = true;
+
+ /* we should be in memory mapped mode now */
+
+ qspi_dumpregs(priv, "After memory mapped:");
+
+ /* finished this mode change */
+
+ qspi_lock(dev, false);
+}
+
+/****************************************************************************
+ * Name: stm32l4_qspi_exit_memorymapped
+ *
+ * Description:
+ * Take the QSPI device out of memory mapped mode
+ *
+ * Input Parameter:
+ * dev - QSPI device
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+void stm32l4_qspi_exit_memorymapped(struct qspi_dev_s* dev)
+{
+ struct stm32l4_qspidev_s *priv = (struct stm32l4_qspidev_s *)dev;
+
+ qspi_lock(dev, true);
+
+ /* A simple abort is sufficient */
+
+ qspi_abort(priv);
+ priv->memmap = false;
+
+ qspi_lock(dev, false);
+}
+
#endif /* CONFIG_STM32L4_QSPI */
diff --git a/arch/arm/src/stm32l4/stm32l4_qspi.h b/arch/arm/src/stm32l4/stm32l4_qspi.h
index a62fb7635c4..ed65850fc56 100644
--- a/arch/arm/src/stm32l4/stm32l4_qspi.h
+++ b/arch/arm/src/stm32l4/stm32l4_qspi.h
@@ -97,6 +97,42 @@ extern "C"
struct qspi_dev_s;
FAR struct qspi_dev_s *stm32l4_qspi_initialize(int intf);
+/****************************************************************************
+ * Name: stm32l4_qspi_enter_memorymapped
+ *
+ * Description:
+ * Put the QSPI device into memory mapped mode
+ *
+ * Input Parameter:
+ * dev - QSPI device
+ * meminfo - parameters like for a memory transfer used for reading
+ * lpto - number of cycles to wait to automatically de-assert CS
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+void stm32l4_qspi_enter_memorymapped(struct qspi_dev_s* dev,
+ const struct qspi_meminfo_s *meminfo,
+ uint32_t lpto);
+
+/****************************************************************************
+ * Name: stm32l4_qspi_exit_memorymapped
+ *
+ * Description:
+ * Take the QSPI device out of memory mapped mode
+ *
+ * Input Parameter:
+ * dev - QSPI device
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+void stm32l4_qspi_exit_memorymapped(struct qspi_dev_s* dev);
+
#undef EXTERN
#if defined(__cplusplus)
}
diff --git a/arch/arm/src/stm32l4/stm32l4_start.c b/arch/arm/src/stm32l4/stm32l4_start.c
index ee1f894d8d3..6209cde5418 100644
--- a/arch/arm/src/stm32l4/stm32l4_start.c
+++ b/arch/arm/src/stm32l4/stm32l4_start.c
@@ -79,6 +79,8 @@
* 0x2001:7fff - End of internal SRAM and end of heap
*/
+#define SRAM2_START 0x10000000
+#define SRAM2_END 0x10008000
#define IDLE_STACK ((uintptr_t)&_ebss+CONFIG_IDLETHREAD_STACKSIZE-4)
#define HEAP_BASE ((uintptr_t)&_ebss+CONFIG_IDLETHREAD_STACKSIZE)
@@ -287,6 +289,24 @@ void __start(void)
__asm__ volatile ("sub r10, sp, %0" : : "r" (CONFIG_IDLETHREAD_STACKSIZE - 64) : );
#endif
+#ifdef CONFIG_STM32L4_SRAM2_INIT
+ /* The SRAM2 region is parity checked, but upon power up, it will be in
+ * a random state and probably invalid with respect to parity, potentially
+ * generating faults if accessed. If elected, we will write zeros to the
+ * memory, forcing the parity to be set to a valid state.
+ * NOTE: this is optional because this may be inappropriate, especially
+ * if the memory is being used for it's battery backed purpose. In that
+ * case, the first-time initialization needs to be performed by the board
+ * under application-specific circumstances. On the other hand, if we're
+ * using this memory for, say, additional heap space, then this is handy.
+ */
+
+ for (dest = (uint32_t *)SRAM2_START; dest < (uint32_t *)SRAM2_END; )
+ {
+ *dest++ = 0;
+ }
+#endif
+
/* Configure the UART so that we can get debug output as soon as possible */
stm32l4_clockconfig();
diff --git a/arch/arm/src/stm32l4/stm32l4x6xx_dma.c b/arch/arm/src/stm32l4/stm32l4x6xx_dma.c
index 2e6afa2b3b6..eb91e3a7547 100644
--- a/arch/arm/src/stm32l4/stm32l4x6xx_dma.c
+++ b/arch/arm/src/stm32l4/stm32l4x6xx_dma.c
@@ -3,6 +3,8 @@
*
* Copyright (C) 2009, 2011-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
+ * Sebastien Lorquet
+ * dev@ziggurat29.com
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -306,16 +308,17 @@ static int stm32l4_dmainterrupt(int irq, void *context)
isr = dmabase_getreg(dmach, STM32L4_DMA_ISR_OFFSET) & DMA_ISR_CHAN_MASK(dmach->chan);
- /* Clear the interrupts we are handling */
-
- dmabase_putreg(dmach, STM32L4_DMA_IFCR_OFFSET, isr);
-
/* Invoke the callback */
if (dmach->callback)
{
dmach->callback(dmach, isr >> DMA_ISR_CHAN_SHIFT(dmach->chan), dmach->arg);
}
+
+ /* Clear the interrupts we are handling */
+
+ dmabase_putreg(dmach, STM32L4_DMA_IFCR_OFFSET, isr);
+
return OK;
}
@@ -387,9 +390,9 @@ void weak_function up_dmainitialize(void)
* version. Feel free to do that if that is what you need.
*
* Input parameter:
- * chndx - Identifies the stream/channel resource. For the STM32 F1, this
- * is simply the channel number as provided by the DMACHAN_* definitions
- * in chip/stm32f10xxx_dma.h.
+ * chan - Identifies the stream/channel resource
+ * This is a bit encoded value as provided by the DMACHAN_* definitions
+ * in chip/stm32l4x6xx_dma.h
*
* Returned Value:
* Provided that 'chndx' is valid, this function ALWAYS returns a non-NULL,
@@ -471,6 +474,9 @@ void stm32l4_dmasetup(DMA_HANDLE handle, uint32_t paddr, uint32_t maddr,
struct stm32l4_dma_s *dmach = (struct stm32l4_dma_s *)handle;
uint32_t regval;
+ DEBUGASSERT(handle != NULL);
+ DEBUGASSERT(ntransfers<65536);
+
/* Then DMA_CNDTRx register can only be modified if the DMA channel is
* disabled.
*/
@@ -514,7 +520,12 @@ void stm32l4_dmasetup(DMA_HANDLE handle, uint32_t paddr, uint32_t maddr,
regval |= ccr;
dmachan_putreg(dmach, STM32L4_DMACHAN_CCR_OFFSET, regval);
-#warning TODO define peripheral by using dmach->function
+ /* define peripheral indicated in dmach->function */
+
+ regval = dmabase_getreg(dmach, STM32L4_DMA_CSELR_OFFSET);
+ regval &= ~(0x0f << (dmach->chan << 2));
+ regval |= (dmach->function << (dmach->chan << 2));
+ dmabase_putreg(dmach, STM32L4_DMA_CSELR_OFFSET, regval);
}
/****************************************************************************
@@ -641,7 +652,9 @@ bool stm32l4_dmacapable(uint32_t maddr, uint32_t count, uint32_t ccr)
* Transfers to/from memory performed by the DMA controller are
* required to be aligned to their size.
*
- * See ST RM0090 rev4, section 9.3.11
+ * Datasheet 3.13 claims
+ * "Access to Flash, SRAM, APB and AHB peripherals as source
+ * and destination"
*
* Compute mend inline to avoid a possible non-constant integer
* multiply.
@@ -682,13 +695,14 @@ bool stm32l4_dmacapable(uint32_t maddr, uint32_t count, uint32_t ccr)
switch (maddr & STM32L4_REGION_MASK)
{
-#if defined(CONFIG_STM32L4_STM32F10XX)
+ case STM32L4_PERIPH_BASE:
+ case STM32L4_FSMC_BASE:
case STM32L4_FSMC_BANK1:
case STM32L4_FSMC_BANK2:
case STM32L4_FSMC_BANK3:
case STM32L4_FSMC_BANK4:
-#endif
case STM32L4_SRAM_BASE:
+ case STM32L4_SRAM2_BASE:
case STM32L4_CODE_BASE:
/* All RAM and flash is supported */
@@ -719,13 +733,14 @@ void stm32l4_dmasample(DMA_HANDLE handle, struct stm32l4_dmaregs_s *regs)
struct stm32l4_dma_s *dmach = (struct stm32l4_dma_s *)handle;
irqstate_t flags;
- flags = irqsave();
+ flags = enter_critical_section();
regs->isr = dmabase_getreg(dmach, STM32L4_DMA_ISR_OFFSET);
+ regs->cselr = dmabase_getreg(dmach, STM32L4_DMA_CSELR_OFFSET);
regs->ccr = dmachan_getreg(dmach, STM32L4_DMACHAN_CCR_OFFSET);
regs->cndtr = dmachan_getreg(dmach, STM32L4_DMACHAN_CNDTR_OFFSET);
regs->cpar = dmachan_getreg(dmach, STM32L4_DMACHAN_CPAR_OFFSET);
regs->cmar = dmachan_getreg(dmach, STM32L4_DMACHAN_CMAR_OFFSET);
- irqrestore(flags);
+ leave_critical_section(flags);
}
#endif
@@ -748,7 +763,8 @@ void stm32l4_dmadump(DMA_HANDLE handle, const struct stm32l4_dmaregs_s *regs,
uint32_t dmabase = DMA_BASE(dmach->base);
dmadbg("DMA Registers: %s\n", msg);
- dmadbg(" ISRC[%08x]: %08x\n", dmabase + STM32L4_DMA_ISR_OFFSET, regs->isr);
+ dmadbg(" ISR[%08x]: %08x\n", dmabase + STM32L4_DMA_ISR_OFFSET, regs->isr);
+ dmadbg(" CSELR[%08x]: %08x\n", dmabase + STM32L4_DMA_CSELR_OFFSET, regs->cselr);
dmadbg(" CCR[%08x]: %08x\n", dmach->base + STM32L4_DMACHAN_CCR_OFFSET, regs->ccr);
dmadbg(" CNDTR[%08x]: %08x\n", dmach->base + STM32L4_DMACHAN_CNDTR_OFFSET, regs->cndtr);
dmadbg(" CPAR[%08x]: %08x\n", dmach->base + STM32L4_DMACHAN_CPAR_OFFSET, regs->cpar);
diff --git a/configs/samv71-xult/README.txt b/configs/samv71-xult/README.txt
index 39d46eb0f28..bbde3150da1 100644
--- a/configs/samv71-xult/README.txt
+++ b/configs/samv71-xult/README.txt
@@ -2206,25 +2206,25 @@ Configuration sub-directories
The NxWM window manager can be found here:
- nuttx-git/NxWidgets/nxwm
+ NxWidgets/nxwm
The NxWM unit test can be found at:
- nuttx-git/NxWidgets/UnitTests/nxwm
+ NxWidgets/UnitTests/nxwm
Documentation for installing the NxWM unit test can be found here:
- nuttx-git/NxWidgets/UnitTests/README.txt
+ NxWidgets/UnitTests/README.txt
2. Here is the quick summary of the build steps. These steps assume
- that you have the entire NuttX GIT in some directory ~/nuttx-git.
- You may have these components installed elsewhere. In that case, you
+ that you have the entire NuttX GIT in some directory HOME. You may
+ have these components installed elsewhere. In that case, you
will need to adjust all of the paths in the following accordingly:
- a. Install the nxwm configuration
+ a. Install the VNC nxwm configuration
- $ cd ~/nuttx-git/nuttx/tools
- $ ./configure.sh samv71-xult/nxwm
+ $ cd HOME/nuttx/tools
+ $ ./configure.sh samv71-xult/vnc
b. Make the build context (only)
@@ -2241,27 +2241,27 @@ Configuration sub-directories
c. Install the nxwm unit test
- $ cd ~/nuttx-git/NxWidgets
- $ tools/install.sh ~/nuttx-git/apps nxwm
+ $ cd HOME/NxWidgets
+ $ tools/install.sh HOME/apps nxwm
Creating symbolic link
- - To ~/nuttx-git/NxWidgets/UnitTests/nxwm
- - At ~/nuttx-git/apps/external
+ - To HOME/NxWidgets/UnitTests/nxwm
+ - At HOME/apps/external
d. Build the NxWidgets library
- $ cd ~/nuttx-git/NxWidgets/libnxwidgets
- $ make TOPDIR=~/nuttx-git/nuttx
+ $ cd HOME/NxWidgets/libnxwidgets
+ $ make TOPDIR=HOME/nuttx
...
e. Build the NxWM library
- $ cd ~/nuttx-git/NxWidgets/nxwm
- $ make TOPDIR=~/nuttx-git/nuttx
+ $ cd HOME/NxWidgets/nxwm
+ $ make TOPDIR=HOME/nuttx
...
f. Built NuttX with the installed unit test as the application
- $ cd ~/nuttx-git/nuttx
+ $ cd HOME/nuttx
$ make
3. Reading from the LCD is not currently functional. The following
@@ -2320,7 +2320,7 @@ Configuration sub-directories
1. Network configuration: IP address 10.0.0.2. The is easily changed
via 'make menuconfig'. The VNC server address is 10.0.0.2:5900.
- 2. The default (local) framebuffer configuration is 320x240 with 16-bit
+ 2. The default (local) framebuffer configuration is 320x240 with 8-bit
RGB color.
3. There are complicated interactions between VNC and the network
@@ -2339,13 +2339,180 @@ Configuration sub-directories
mouse/keyboard inputs in the options/input menu. That will make
things a little clearer.
- STATUS:
- 2016-04-21: I have gottent he apps/examples/nximage to work
- with lots issues with GRAPHICS and UPDATER debug ON. There
- are reliability problems and it hangs at the end of the test.
- If I turn UPDATE debug off (only), then the display output is
- corrupted and I get a hardfault.
+ 5. To select 16-bits per pixel RGB15 5:6:5
- Mostly likely, the UPDATER debug output slows the updates and
- avoids some kind of race condition with the networking. Oddly,
- it does not work at all if I turn off TCP write buffering.
+ CONFIG_NX_DISABLE_8BPP=y
+ # CONFIG_NX_DISABLE_16BPP is not set
+
+ # CONFIG_VNCSERVER_COLORFMT_RGB8 is not set
+ CONFIG_VNCSERVER_COLORFMT_RGB16=y
+
+ CONFIG_EXAMPLES_NXIMAGE_BPP=16
+
+ To re-select 8-bits per pixel RGB8 3:3:2
+
+ # CONFIG_NX_DISABLE_8BPP is not set
+ CONFIG_NX_DISABLE_16BPP=y
+
+ CONFIG_VNCSERVER_COLORFMT_RGB8=y
+ # CONFIG_VNCSERVER_COLORFMT_RGB16 is not set
+
+ # CONFIG_EXAMPLES_NXIMAGE_GREYSCALE is not set
+ CONFIG_EXAMPLES_NXIMAGE_BPP=8
+
+ STATUS:
+ 2016-04-21: I have gotten the apps/examples/nximage to work with
+ lots issues with 16-bit RGB and verbose GRAPHICS and UPDATER debug
+ ON. There are reliability problems and it hangs at the end of the
+ test.
+
+ 2016-04-22: The default configuration now uses RGB8 which needs a lot
+ less SRAM for the local frame buffer and does not degrade the color
+ quality in the remote display (since it is also 8 BPP). At 8
+ BPP, the remote display is correct even with both GRAPHICS and
+ UPDATER debug OFF -- and there is no hang!
+
+ 2106-04-23: The NxImage test was selected because it is a very simple
+ graphics test. Continued testing, however, requires a more complex
+ configuration. Hence, the vnxwm configuration was created.
+
+ A memory clobber error was fixed and this probably corrects some of
+ the reliability problems noted on 2016-04-21.
+
+ vnxwm:
+
+ This is a special configuration setup for the NxWM window manager
+ UnitTest. It provides an interactive windowing experience via a remote
+ VNC client window running on your PC. The SAMV71-XULT is connected to
+ the PC via Ethernet.
+
+ NOTES:
+
+ 1. The NxWM window manager is a tiny window manager tailored for use
+ with smaller LCDs. It supports a task, a start window, and
+ multiple application windows with toolbars. However, to make the
+ best use of the visible LCD space, only one application window is
+ visible at at time.
+
+ The NxWM window manager can be found here:
+
+ NxWidgets/nxwm
+
+ The NxWM unit test can be found at:
+
+ NxWidgets/UnitTests/nxwm
+
+ Documentation for installing the NxWM unit test can be found here:
+
+ NxWidgets/UnitTests/README.txt
+
+ 2. Here is the quick summary of the build steps. These steps assume
+ that you have the entire NuttX GIT in some directory HOME. You may
+ have these components installed elsewhere. In that case, you
+ will need to adjust all of the paths in the following accordingly:
+
+ a. Install the nxwm configuration
+
+ $ cd HOME/nuttx/tools
+ $ ./configure.sh samv71-xult/nxwm
+
+ b. Make the build context (only)
+
+ $ cd ..
+ $ . ./setenv.sh
+ $ make context
+ ...
+
+ NOTE: the use of the setenv.sh file is optional. All that it will
+ do is to adjust your PATH variable so that the build system can find
+ your tools. If you use it, you will most likely need to modify the
+ script so that it has the correct path to your tool binaries
+ directory.
+
+ c. Install the nxwm unit test
+
+ $ cd HOME/NxWidgets
+ $ tools/install.sh HOME/apps nxwm
+ Creating symbolic link
+ - To HOME/NxWidgets/UnitTests/nxwm
+ - At HOME/apps/external
+
+ d. Build the NxWidgets library
+
+ $ cd HOME/NxWidgets/libnxwidgets
+ $ make TOPDIR=HOME/nuttx
+ ...
+
+ e. Build the NxWM library
+
+ $ cd HOME/NxWidgets/nxwm
+ $ make TOPDIR=HOME/nuttx
+ ...
+
+ f. Built NuttX with the installed unit test as the application
+
+ $ cd HOME/nuttx
+ $ make
+
+ 3. Network configuration: IP address 10.0.0.2. The is easily changed
+ via 'make menuconfig'. The VNC server address is 10.0.0.2:5900.
+
+ 4. The default (local) framebuffer configuration is 320x240 with 8-bit
+ RGB color.
+
+ I had some problems at 16-bits per pixle (see STATUS below). To
+ select 16-bits per pixel RGB15 5:6:5
+
+ CONFIG_NX_DISABLE_8BPP=y
+ # CONFIG_NX_DISABLE_16BPP is not set
+
+ # CONFIG_VNCSERVER_COLORFMT_RGB8 is not set
+ CONFIG_VNCSERVER_COLORFMT_RGB16=y
+
+ CONFIG_EXAMPLES_NXIMAGE_BPP=16
+
+ To re-select 8-bits per pixel RGB8 3:3:2
+
+ # CONFIG_NX_DISABLE_8BPP is not set
+ CONFIG_NX_DISABLE_16BPP=y
+
+ CONFIG_VNCSERVER_COLORFMT_RGB8=y
+ # CONFIG_VNCSERVER_COLORFMT_RGB16 is not set
+
+ # CONFIG_EXAMPLES_NXIMAGE_GREYSCALE is not set
+ CONFIG_EXAMPLES_NXIMAGE_BPP=8
+
+ 5. There are complicated interactions between VNC and the network
+ configuration. The CONFIG_VNCSERVER_UPDATE_BUFSIZE determines the
+ size of update messages. That is 1024 bytes in that configuration
+ (the full message with the header will be a little larger). The
+ MTU (CONFIG_NET_ETH_MTU) is set to 590 so that a full update will
+ require several packets.
+
+ Write buffering also effects network performance. This will break
+ up the large updates into small (196 byte) groups. When we run out
+ of read-ahead buffers, then partial updates may be sent causing a
+ loss of synchronization.
+
+ STATUS:
+ 2106-04-23: Configuration created. See status up to this data in
+ the vnc configuration. That probably all applies here as well.
+
+ Only some initial testing has been performed: The configuration
+ is partially functional. Menus do appear and mouse input is
+ probably working correctly.
+
+ But there are a lot of instabilities. I see assertions of
+ various kinds and the RealVNC client often crashes as well.
+ Some of the assertions I see are:
+
+ while (sem_wait(&session->queuesem) < 0)
+ ...
+ rect = (FAR struct vnc_fbupdate_s *)sq_remfirst(&session->updqueue);
+ DEBUGASSERT(rect != NULL);
+
+ I would think that could mean only that the semaphore counting is
+ out of sync with the number of updates in the queue.
+
+ But also the assertion at devif/devif_iobsend.c line: 102 which
+ probably means some kind of memory corruption.
diff --git a/configs/samv71-xult/vnc/defconfig b/configs/samv71-xult/vnc/defconfig
index 945e47f4f8a..087f0b0f1d1 100644
--- a/configs/samv71-xult/vnc/defconfig
+++ b/configs/samv71-xult/vnc/defconfig
@@ -901,7 +901,6 @@ CONFIG_FS_PROCFS=y
CONFIG_NX=y
CONFIG_NX_NPLANES=1
CONFIG_NX_BGCOLOR=0x0
-# CONFIG_NX_ANTIALIASING is not set
# CONFIG_NX_WRITEONLY is not set
CONFIG_NX_UPDATE=y
@@ -911,8 +910,8 @@ CONFIG_NX_UPDATE=y
CONFIG_NX_DISABLE_1BPP=y
CONFIG_NX_DISABLE_2BPP=y
CONFIG_NX_DISABLE_4BPP=y
-CONFIG_NX_DISABLE_8BPP=y
-# CONFIG_NX_DISABLE_16BPP is not set
+# CONFIG_NX_DISABLE_8BPP is not set
+CONFIG_NX_DISABLE_16BPP=y
CONFIG_NX_DISABLE_24BPP=y
CONFIG_NX_DISABLE_32BPP=y
CONFIG_NX_PACKEDMSFIRST=y
@@ -994,8 +993,8 @@ CONFIG_VNCSERVER_PRIO=100
CONFIG_VNCSERVER_STACKSIZE=2048
CONFIG_VNCSERVER_UPDATER_PRIO=100
CONFIG_VNCSERVER_UPDATER_STACKSIZE=2048
-# CONFIG_VNCSERVER_COLORFMT_RGB8 is not set
-CONFIG_VNCSERVER_COLORFMT_RGB16=y
+CONFIG_VNCSERVER_COLORFMT_RGB8=y
+# CONFIG_VNCSERVER_COLORFMT_RGB16 is not set
# CONFIG_VNCSERVER_COLORFMT_RGB32 is not set
CONFIG_VNCSERVER_SCREENWIDTH=320
CONFIG_VNCSERVER_SCREENHEIGHT=240
@@ -1129,7 +1128,8 @@ CONFIG_EXAMPLES_NSH=y
CONFIG_EXAMPLES_NXIMAGE=y
CONFIG_EXAMPLES_NXIMAGE_VPLANE=0
CONFIG_EXAMPLES_NXIMAGE_DEVNO=0
-CONFIG_EXAMPLES_NXIMAGE_BPP=16
+CONFIG_EXAMPLES_NXIMAGE_BPP=8
+# CONFIG_EXAMPLES_NXIMAGE_GREYSCALE is not set
# CONFIG_EXAMPLES_NXIMAGE_XSCALEp5 is not set
CONFIG_EXAMPLES_NXIMAGE_XSCALE1p0=y
# CONFIG_EXAMPLES_NXIMAGE_XSCALE1p5 is not set
diff --git a/configs/samv71-xult/vnxwm/Make.defs b/configs/samv71-xult/vnxwm/Make.defs
new file mode 100644
index 00000000000..fe4fd97aeb3
--- /dev/null
+++ b/configs/samv71-xult/vnxwm/Make.defs
@@ -0,0 +1,117 @@
+############################################################################
+# configs/samv71-xult/vnxwm/Make.defs
+#
+# Copyright (C) 2016 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt
+#
+# 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
+
+ifeq ($(CONFIG_ARMV7M_DTCM),y)
+ LDSCRIPT = flash-dtcm.ld
+else
+ LDSCRIPT = flash-sram.ld
+endif
+
+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 = $(CROSSDEV)ar rcs
+NM = $(CROSSDEV)nm
+OBJCOPY = $(CROSSDEV)objcopy
+OBJDUMP = $(CROSSDEV)objdump
+
+ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'}
+ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1}
+
+ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
+ ARCHOPTIMIZATION = -g
+endif
+
+ifneq ($(CONFIG_DEBUG_NOOPT),y)
+ ARCHOPTIMIZATION += $(MAXOPTIMIZATION)
+endif
+
+ARCHCFLAGS = -fno-builtin
+ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fno-rtti
+ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -fno-strict-aliasing
+ARCHWARNINGSXX = -Wall -Wshadow -Wundef
+ARCHDEFINES =
+ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
+
+CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
+CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
+CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
+AFLAGS = $(CFLAGS) -D__ASSEMBLY__
+
+NXFLATLDFLAGS1 = -r -d -warn-common
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
+LDNXFLATFLAGS = -e main -s 2048
+
+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 =
+
diff --git a/configs/samv71-xult/vnxwm/defconfig b/configs/samv71-xult/vnxwm/defconfig
new file mode 100644
index 00000000000..3e074f27096
--- /dev/null
+++ b/configs/samv71-xult/vnxwm/defconfig
@@ -0,0 +1,1567 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# Nuttx/ Configuration
+#
+
+#
+# Build Setup
+#
+CONFIG_EXPERIMENTAL=y
+# CONFIG_DEFAULT_SMALL is not set
+# CONFIG_HOST_LINUX is not set
+# CONFIG_HOST_OSX is not set
+CONFIG_HOST_WINDOWS=y
+# CONFIG_HOST_OTHER is not set
+# CONFIG_WINDOWS_NATIVE is not set
+CONFIG_WINDOWS_CYGWIN=y
+# CONFIG_WINDOWS_MSYS is not set
+# CONFIG_WINDOWS_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 is not set
+# CONFIG_ARCH_DEBUG_H is not set
+
+#
+# Debug Options
+#
+# CONFIG_DEBUG is not set
+# CONFIG_ARCH_HAVE_HEAPCHECK is not set
+CONFIG_ARCH_HAVE_STACKCHECK=y
+# CONFIG_STACK_COLORATION is not set
+CONFIG_DEBUG_SYMBOLS=y
+CONFIG_ARCH_HAVE_CUSTOMOPT=y
+# CONFIG_DEBUG_NOOPT is not set
+# CONFIG_DEBUG_CUSTOMOPT is not set
+CONFIG_DEBUG_FULLOPT=y
+
+#
+# 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_SH 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 is not set
+# 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=y
+# 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 is not set
+CONFIG_ARCH_CORTEXM7=y
+# 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="samv7"
+# 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=y
+CONFIG_ARCH_HAVE_FPU=y
+CONFIG_ARCH_HAVE_DPFPU=y
+CONFIG_ARCH_FPU=y
+CONFIG_ARCH_DPFPU=y
+# 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=y
+CONFIG_ARMV7M_HAVE_DCACHE=y
+CONFIG_ARMV7M_ICACHE=y
+CONFIG_ARMV7M_DCACHE=y
+CONFIG_ARMV7M_DCACHE_WRITETHROUGH=y
+CONFIG_ARMV7M_HAVE_ITCM=y
+CONFIG_ARMV7M_HAVE_DTCM=y
+# CONFIG_ARMV7M_ITCM is not set
+# CONFIG_ARMV7M_DTCM is not set
+# CONFIG_ARMV7M_TOOLCHAIN_IARW is not set
+# CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC is not set
+# CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT is not set
+# CONFIG_ARMV7M_TOOLCHAIN_CODEREDW is not set
+# CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW is not set
+# CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM is not set
+# CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL is not set
+CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIW=y
+# CONFIG_ARMV7M_TOOLCHAIN_RAISONANCE is not set
+CONFIG_ARMV7M_HAVE_STACKCHECK=y
+# CONFIG_ARMV7M_STACKCHECK is not set
+# CONFIG_ARMV7M_ITMSYSLOG is not set
+# CONFIG_SERIAL_TERMIOS is not set
+CONFIG_SDIO_DMA=y
+# CONFIG_SDIO_WIDTH_D1_ONLY is not set
+
+#
+# SAMV7 Configuration Options
+#
+# CONFIG_ARCH_CHIP_SAME70Q19 is not set
+# CONFIG_ARCH_CHIP_SAME70Q20 is not set
+# CONFIG_ARCH_CHIP_SAME70Q21 is not set
+# CONFIG_ARCH_CHIP_SAME70N19 is not set
+# CONFIG_ARCH_CHIP_SAME70N20 is not set
+# CONFIG_ARCH_CHIP_SAME70N21 is not set
+# CONFIG_ARCH_CHIP_SAME70J19 is not set
+# CONFIG_ARCH_CHIP_SAME70J20 is not set
+# CONFIG_ARCH_CHIP_SAME70J21 is not set
+# CONFIG_ARCH_CHIP_SAMV71Q19 is not set
+# CONFIG_ARCH_CHIP_SAMV71Q20 is not set
+CONFIG_ARCH_CHIP_SAMV71Q21=y
+# CONFIG_ARCH_CHIP_SAMV71N19 is not set
+# CONFIG_ARCH_CHIP_SAMV71N20 is not set
+# CONFIG_ARCH_CHIP_SAMV71N21 is not set
+# CONFIG_ARCH_CHIP_SAMV71J19 is not set
+# CONFIG_ARCH_CHIP_SAMV71J20 is not set
+# CONFIG_ARCH_CHIP_SAMV71J21 is not set
+# CONFIG_ARCH_CHIP_SAME70 is not set
+# CONFIG_ARCH_CHIP_SAME70Q is not set
+# CONFIG_ARCH_CHIP_SAME70N is not set
+# CONFIG_ARCH_CHIP_SAME70J is not set
+CONFIG_ARCH_CHIP_SAMV71=y
+CONFIG_ARCH_CHIP_SAMV71Q=y
+# CONFIG_ARCH_CHIP_SAMV71N is not set
+# CONFIG_ARCH_CHIP_SAMV71J is not set
+# CONFIG_SAMV7_MCAN is not set
+CONFIG_SAMV7_HAVE_MCAN1=y
+CONFIG_SAMV7_HAVE_DAC1=y
+CONFIG_SAMV7_HAVE_EBI=y
+CONFIG_SAMV7_EMAC=y
+CONFIG_SAMV7_HSMCI=y
+CONFIG_SAMV7_HAVE_HSMCI0=y
+# CONFIG_SAMV7_HAVE_ISI8 is not set
+CONFIG_SAMV7_HAVE_MEDIALB=y
+CONFIG_SAMV7_HAVE_SDRAMC=y
+CONFIG_SAMV7_HAVE_SPI0=y
+CONFIG_SAMV7_HAVE_SPI1=y
+# CONFIG_SAMV7_QSPI_IS_SPI is not set
+# CONFIG_SAMV7_SSC is not set
+# CONFIG_SAMV7_HAVE_TC is not set
+CONFIG_SAMV7_HAVE_TWIHS2=y
+# CONFIG_SAMV7_HAVE_USBFS is not set
+CONFIG_SAMV7_HAVE_USBHS=y
+CONFIG_SAMV7_HAVE_USART0=y
+CONFIG_SAMV7_HAVE_USART1=y
+CONFIG_SAMV7_HAVE_USART2=y
+# CONFIG_SAMV7_SPI is not set
+# CONFIG_SAMV7_SPI_MASTER is not set
+# CONFIG_SAMV7_SPI_SLAVE is not set
+
+#
+# SAMV7 Peripheral Selection
+#
+# CONFIG_SAMV7_ACC is not set
+# CONFIG_SAMV7_ADC is not set
+# CONFIG_SAMV7_AFEC0 is not set
+# CONFIG_SAMV7_AFEC1 is not set
+# CONFIG_SAMV7_MCAN0 is not set
+# CONFIG_SAMV7_MCAN1 is not set
+# CONFIG_SAMV7_DAC0 is not set
+# CONFIG_SAMV7_DAC1 is not set
+# CONFIG_SAMV7_EBI is not set
+CONFIG_SAMV7_EMAC0=y
+CONFIG_SAMV7_XDMAC=y
+CONFIG_SAMV7_HSMCI0=y
+# CONFIG_SAMV7_ISI is not set
+# CONFIG_SAMV7_MLB is not set
+# CONFIG_SAMV7_PWM0 is not set
+# CONFIG_SAMV7_PWM1 is not set
+# CONFIG_SAMV7_QSPI is not set
+# CONFIG_SAMV7_RTC is not set
+# CONFIG_SAMV7_RTT is not set
+# CONFIG_SAMV7_SDRAMC is not set
+# CONFIG_SAMV7_SMC is not set
+# CONFIG_SAMV7_SPI0 is not set
+# CONFIG_SAMV7_SPI1 is not set
+# CONFIG_SAMV7_SSC0 is not set
+# CONFIG_SAMV7_TC0 is not set
+# CONFIG_SAMV7_TC1 is not set
+# CONFIG_SAMV7_TC2 is not set
+# CONFIG_SAMV7_TC3 is not set
+# CONFIG_SAMV7_TRNG is not set
+CONFIG_SAMV7_TWIHS0=y
+# CONFIG_SAMV7_TWIHS1 is not set
+# CONFIG_SAMV7_TWIHS2 is not set
+# CONFIG_SAMV7_UART0 is not set
+# CONFIG_SAMV7_UART1 is not set
+# CONFIG_SAMV7_UART2 is not set
+CONFIG_SAMV7_UART3=y
+# CONFIG_SAMV7_UART4 is not set
+# CONFIG_SAMV7_USBDEVHS is not set
+# CONFIG_SAMV7_USBHOSTHS is not set
+# CONFIG_SAMV7_USART0 is not set
+# CONFIG_SAMV7_USART1 is not set
+# CONFIG_SAMV7_USART2 is not set
+# CONFIG_SAMV7_WDT is not set
+# CONFIG_SAMV7_RSWDT is not set
+CONFIG_SAMV7_GPIO_IRQ=y
+CONFIG_SAMV7_GPIOA_IRQ=y
+CONFIG_SAMV7_GPIOB_IRQ=y
+# CONFIG_SAMV7_GPIOC_IRQ is not set
+CONFIG_SAMV7_GPIOD_IRQ=y
+# CONFIG_SAMV7_GPIOE_IRQ is not set
+# CONFIG_SAMV7_PROGMEM is not set
+
+#
+# TWIHS device driver options
+#
+CONFIG_SAMV7_TWIHS0_FREQUENCY=100000
+
+#
+# HSMCI device driver options
+#
+# CONFIG_SAMV7_HSMCI_RDPROOF is not set
+# CONFIG_SAMV7_HSMCI_WRPROOF is not set
+# CONFIG_SAMV7_HSMCI_UNALIGNED is not set
+
+#
+# EMAC device driver options
+#
+CONFIG_SAMV7_EMAC0_NRXBUFFERS=16
+CONFIG_SAMV7_EMAC0_NTXBUFFERS=8
+CONFIG_SAMV7_EMAC0_PHYADDR=1
+# CONFIG_SAMV7_EMAC0_PHYINIT is not set
+# CONFIG_SAMV7_EMAC0_MII is not set
+CONFIG_SAMV7_EMAC0_RMII=y
+CONFIG_SAMV7_EMAC0_AUTONEG=y
+CONFIG_SAMV7_EMAC0_PHYSR=30
+CONFIG_SAMV7_EMAC0_PHYSR_ALTCONFIG=y
+CONFIG_SAMV7_EMAC0_PHYSR_ALTMODE=0x7
+CONFIG_SAMV7_EMAC0_PHYSR_10HD=0x1
+CONFIG_SAMV7_EMAC0_PHYSR_100HD=0x2
+CONFIG_SAMV7_EMAC0_PHYSR_10FD=0x5
+CONFIG_SAMV7_EMAC0_PHYSR_100FD=0x6
+CONFIG_SAMV7_EMAC0_ISETH0=y
+# CONFIG_SAMV7_EMAC_PREALLOCATE is not set
+# CONFIG_SAMV7_EMAC_NBC is not set
+
+#
+# Architecture Options
+#
+# CONFIG_ARCH_NOINTC is not set
+# CONFIG_ARCH_VECNOTIRQ is not set
+CONFIG_ARCH_DMA=y
+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 is not set
+# 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=y
+# CONFIG_ARCH_RAMFUNCS is not set
+CONFIG_ARCH_HAVE_RAMVECTORS=y
+# CONFIG_ARCH_RAMVECTORS is not set
+
+#
+# Board Settings
+#
+CONFIG_BOARD_LOOPSPERMSEC=51262
+# CONFIG_ARCH_CALIBRATION is not set
+
+#
+# Interrupt options
+#
+CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
+CONFIG_ARCH_INTERRUPTSTACK=2048
+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=0x20400000
+CONFIG_RAM_SIZE=393216
+# CONFIG_ARCH_HAVE_SDRAM is not set
+
+#
+# Board Selection
+#
+CONFIG_ARCH_BOARD_SAMV71_XULT=y
+# CONFIG_ARCH_BOARD_CUSTOM is not set
+CONFIG_ARCH_BOARD="samv71-xult"
+
+#
+# Common Board Options
+#
+CONFIG_ARCH_HAVE_LEDS=y
+CONFIG_ARCH_LEDS=y
+CONFIG_ARCH_HAVE_BUTTONS=y
+CONFIG_ARCH_BUTTONS=y
+CONFIG_ARCH_HAVE_IRQBUTTONS=y
+CONFIG_ARCH_IRQBUTTONS=y
+CONFIG_NSH_MMCSDMINOR=0
+CONFIG_NSH_MMCSDSLOTNO=0
+
+#
+# Board-Specific Options
+#
+# CONFIG_SAMV71XULT_MXTXPLND is not set
+CONFIG_LIB_BOARDCTL=y
+# CONFIG_BOARDCTL_UNIQUEID is not set
+# 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_JULIAN_TIME is not set
+CONFIG_START_YEAR=2014
+CONFIG_START_MONTH=3
+CONFIG_START_DAY=10
+CONFIG_MAX_WDOGPARMS=2
+CONFIG_PREALLOC_WDOGS=32
+CONFIG_WDOG_INTRESERVE=4
+CONFIG_PREALLOC_TIMERS=4
+
+#
+# Tasks and Scheduling
+#
+# CONFIG_SPINLOCK is not set
+# CONFIG_INIT_NONE is not set
+CONFIG_INIT_ENTRYPOINT=y
+# CONFIG_INIT_FILEPATH is not set
+CONFIG_USER_ENTRYPOINT="nxwm_main"
+CONFIG_RR_INTERVAL=200
+# CONFIG_SCHED_SPORADIC is not set
+CONFIG_TASK_NAME_SIZE=31
+CONFIG_MAX_TASKS=16
+CONFIG_SCHED_HAVE_PARENT=y
+# CONFIG_SCHED_CHILD_STATUS 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=y
+CONFIG_SCHED_ONEXIT_MAX=1
+# CONFIG_SIG_EVTHREAD is not set
+
+#
+# Signal Numbers
+#
+CONFIG_SIG_SIGUSR1=1
+CONFIG_SIG_SIGUSR2=2
+CONFIG_SIG_SIGALARM=3
+CONFIG_SIG_SIGCHLD=4
+CONFIG_SIG_SIGCONDTIMEDOUT=16
+CONFIG_SIG_SIGWORK=17
+
+#
+# POSIX Message Queue Options
+#
+CONFIG_PREALLOC_MQ_MSGS=32
+CONFIG_MQ_MAXMSGSIZE=64
+# CONFIG_MODULE is not set
+
+#
+# Work queue support
+#
+CONFIG_SCHED_WORKQUEUE=y
+CONFIG_SCHED_HPWORK=y
+CONFIG_SCHED_HPWORKPRIORITY=192
+CONFIG_SCHED_HPWORKPERIOD=50000
+CONFIG_SCHED_HPWORKSTACKSIZE=2048
+# CONFIG_SCHED_LPWORK is not set
+
+#
+# Stack and heap information
+#
+CONFIG_IDLETHREAD_STACKSIZE=1024
+CONFIG_USERMAIN_STACKSIZE=1526
+CONFIG_PTHREAD_STACK_MIN=256
+CONFIG_PTHREAD_STACK_DEFAULT=2048
+# CONFIG_LIB_SYSCALL is not set
+
+#
+# Device Drivers
+#
+CONFIG_DISABLE_POLL=y
+CONFIG_DEV_NULL=y
+# CONFIG_DEV_ZERO 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=y
+# CONFIG_I2C_SLAVE is not set
+# CONFIG_I2C_POLLED is not set
+# CONFIG_I2C_TRACE is not set
+CONFIG_I2C_DRIVER=y
+CONFIG_SPI=y
+# CONFIG_SPI_SLAVE is not set
+CONFIG_SPI_EXCHANGE=y
+# CONFIG_SPI_CMDDATA is not set
+# CONFIG_SPI_CALLBACK is not set
+# CONFIG_SPI_BITBANG is not set
+# CONFIG_SPI_HWFEATURES is not set
+# CONFIG_SPI_CRCGENERATION is not set
+# CONFIG_I2S is not set
+
+#
+# Timer Driver Support
+#
+# CONFIG_TIMER is not set
+# CONFIG_RTC is not set
+# CONFIG_WATCHDOG is not set
+# CONFIG_TIMERS_CS2100CP 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
+# CONFIG_IOEXPANDER is not set
+# CONFIG_LCD is not set
+
+#
+# LED Support
+#
+# CONFIG_USERLED is not set
+# CONFIG_RGBLED is not set
+# CONFIG_PCA9635PW is not set
+CONFIG_MMCSD=y
+CONFIG_MMCSD_NSLOTS=1
+# CONFIG_MMCSD_READONLY is not set
+CONFIG_MMCSD_MULTIBLOCK_DISABLE=y
+# CONFIG_MMCSD_MMCSUPPORT is not set
+CONFIG_MMCSD_HAVECARDDETECT=y
+# CONFIG_MMCSD_SPI is not set
+CONFIG_ARCH_HAVE_SDIO=y
+# CONFIG_ARCH_HAVE_SDIOWAIT_WRCOMPLETE is not set
+CONFIG_MMCSD_SDIO=y
+# CONFIG_SDIO_PREFLIGHT is not set
+# CONFIG_SDIO_MUXBUS is not set
+CONFIG_SDIO_BLOCKSETUP=y
+# CONFIG_MODEM is not set
+CONFIG_MTD=y
+
+#
+# MTD Configuration
+#
+# CONFIG_MTD_PARTITION is not set
+# CONFIG_MTD_SECT512 is not set
+# CONFIG_MTD_BYTE_WRITE is not set
+# CONFIG_MTD_PROGMEM is not set
+CONFIG_MTD_CONFIG=y
+# CONFIG_MTD_CONFIG_RAM_CONSOLIDATE is not set
+CONFIG_MTD_CONFIG_ERASEDVALUE=0xff
+
+#
+# MTD Device Drivers
+#
+# CONFIG_MTD_NAND is not set
+# CONFIG_RAMMTD is not set
+# CONFIG_FILEMTD is not set
+CONFIG_MTD_AT24XX=y
+# CONFIG_AT24XX_MULTI is not set
+CONFIG_AT24XX_SIZE=2
+CONFIG_AT24XX_ADDR=0x57
+CONFIG_AT24XX_EXTENDED=y
+CONFIG_AT24XX_EXTSIZE=160
+CONFIG_AT24XX_FREQUENCY=100000
+CONFIG_MTD_AT25=y
+CONFIG_AT25_SPIMODE=0
+CONFIG_AT25_SPIFREQUENCY=20000000
+# CONFIG_MTD_AT45DB is not set
+# CONFIG_MTD_M25P is not set
+# CONFIG_MTD_S25FL1 is not set
+# CONFIG_MTD_N25QXXX is not set
+# CONFIG_MTD_SMART is not set
+# CONFIG_MTD_RAMTRON is not set
+# CONFIG_MTD_SST25 is not set
+# CONFIG_MTD_SST25XX is not set
+# CONFIG_MTD_SST39FV is not set
+# CONFIG_MTD_W25 is not set
+# CONFIG_EEPROM is not set
+CONFIG_NETDEVICES=y
+
+#
+# General Ethernet MAC Driver Options
+#
+# CONFIG_NETDEV_LOOPBACK is not set
+CONFIG_NETDEV_TELNET=y
+CONFIG_TELNET_RXBUFFER_SIZE=256
+CONFIG_TELNET_TXBUFFER_SIZE=256
+# CONFIG_NETDEV_MULTINIC is not set
+CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y
+CONFIG_NETDEV_STATISTICS=y
+# CONFIG_NETDEV_LATEINIT is not set
+
+#
+# External Ethernet MAC Device Support
+#
+# CONFIG_NET_DM90x0 is not set
+# CONFIG_NET_CS89x0 is not set
+# CONFIG_ENC28J60 is not set
+# CONFIG_ENCX24J600 is not set
+# CONFIG_NET_E1000 is not set
+# CONFIG_NET_SLIP is not set
+# CONFIG_NET_FTMAC100 is not set
+# CONFIG_NET_VNET is not set
+
+#
+# External Ethernet PHY Device Support
+#
+CONFIG_ARCH_PHY_INTERRUPT=y
+# CONFIG_ETH0_PHY_NONE is not set
+# CONFIG_ETH0_PHY_AM79C874 is not set
+# CONFIG_ETH0_PHY_KS8721 is not set
+# CONFIG_ETH0_PHY_KSZ8041 is not set
+# CONFIG_ETH0_PHY_KSZ8051 is not set
+CONFIG_ETH0_PHY_KSZ8061=y
+# CONFIG_ETH0_PHY_KSZ8081 is not set
+# CONFIG_ETH0_PHY_KSZ90x1 is not set
+# CONFIG_ETH0_PHY_DP83848C is not set
+# CONFIG_ETH0_PHY_LAN8720 is not set
+# CONFIG_ETH0_PHY_LAN8740 is not set
+# CONFIG_ETH0_PHY_LAN8740A is not set
+# CONFIG_ETH0_PHY_LAN8742A is not set
+# CONFIG_ETH0_PHY_DM9161 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_16550_UART is not set
+# CONFIG_ARCH_HAVE_UART is not set
+# CONFIG_ARCH_HAVE_UART0 is not set
+# CONFIG_ARCH_HAVE_UART1 is not set
+# CONFIG_ARCH_HAVE_UART2 is not set
+CONFIG_ARCH_HAVE_UART3=y
+# CONFIG_ARCH_HAVE_UART4 is not set
+# CONFIG_ARCH_HAVE_UART5 is not set
+# CONFIG_ARCH_HAVE_UART6 is not set
+# CONFIG_ARCH_HAVE_UART7 is not set
+# CONFIG_ARCH_HAVE_UART8 is not set
+# CONFIG_ARCH_HAVE_SCI0 is not set
+# CONFIG_ARCH_HAVE_SCI1 is not set
+# CONFIG_ARCH_HAVE_USART0 is not set
+# CONFIG_ARCH_HAVE_USART1 is not set
+# CONFIG_ARCH_HAVE_USART2 is not set
+# CONFIG_ARCH_HAVE_USART3 is not set
+# CONFIG_ARCH_HAVE_USART4 is not set
+# CONFIG_ARCH_HAVE_USART5 is not set
+# CONFIG_ARCH_HAVE_USART6 is not set
+# CONFIG_ARCH_HAVE_USART7 is not set
+# CONFIG_ARCH_HAVE_USART8 is not set
+# CONFIG_ARCH_HAVE_OTHER_UART is not set
+
+#
+# USART Configuration
+#
+CONFIG_MCU_SERIAL=y
+CONFIG_STANDARD_SERIAL=y
+# CONFIG_SERIAL_IFLOWCONTROL is not set
+# CONFIG_SERIAL_OFLOWCONTROL is not set
+# CONFIG_SERIAL_DMA is not set
+CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y
+CONFIG_UART3_SERIAL_CONSOLE=y
+# CONFIG_OTHER_SERIAL_CONSOLE is not set
+# CONFIG_NO_SERIAL_CONSOLE is not set
+
+#
+# UART3 Configuration
+#
+CONFIG_UART3_RXBUFSIZE=256
+CONFIG_UART3_TXBUFSIZE=256
+CONFIG_UART3_BAUD=115200
+CONFIG_UART3_BITS=8
+CONFIG_UART3_PARITY=0
+CONFIG_UART3_2STOP=0
+# CONFIG_UART3_IFLOWCONTROL is not set
+# CONFIG_UART3_OFLOWCONTROL is not set
+# CONFIG_UART3_DMA is not set
+# CONFIG_USBDEV is not set
+# CONFIG_USBHOST is not set
+# CONFIG_DRIVERS_WIRELESS is not set
+
+#
+# System Logging Device Options
+#
+
+#
+# System Logging
+#
+# CONFIG_RAMLOG is not set
+# CONFIG_SYSLOG_CONSOLE is not set
+
+#
+# Networking Support
+#
+CONFIG_ARCH_HAVE_NET=y
+CONFIG_ARCH_HAVE_PHY=y
+CONFIG_NET=y
+CONFIG_NET_NOINTS=y
+# CONFIG_NET_PROMISCUOUS is not set
+
+#
+# Driver buffer configuration
+#
+# CONFIG_NET_MULTIBUFFER is not set
+CONFIG_NET_ETH_MTU=590
+CONFIG_NET_ETH_TCP_RECVWNDO=536
+CONFIG_NET_GUARDSIZE=2
+
+#
+# Data link support
+#
+# CONFIG_NET_MULTILINK is not set
+# CONFIG_NET_USER_DEVFMT is not set
+CONFIG_NET_ETHERNET=y
+# CONFIG_NET_LOOPBACK is not set
+# CONFIG_NET_TUN is not set
+
+#
+# Network Device Operations
+#
+CONFIG_NETDEV_PHY_IOCTL=y
+
+#
+# Internet Protocol Selection
+#
+CONFIG_NET_IPv4=y
+# CONFIG_NET_IPv6 is not set
+
+#
+# Socket Support
+#
+CONFIG_NSOCKET_DESCRIPTORS=8
+CONFIG_NET_NACTIVESOCKETS=16
+CONFIG_NET_SOCKOPTS=y
+# CONFIG_NET_SOLINGER is not set
+
+#
+# Raw Socket Support
+#
+# CONFIG_NET_PKT is not set
+
+#
+# Unix Domain Socket Support
+#
+# CONFIG_NET_LOCAL is not set
+
+#
+# TCP/IP Networking
+#
+CONFIG_NET_TCP=y
+# CONFIG_NET_TCPURGDATA is not set
+# CONFIG_NET_TCP_REASSEMBLY is not set
+CONFIG_NET_TCP_CONNS=8
+CONFIG_NET_MAX_LISTENPORTS=20
+CONFIG_NET_TCP_READAHEAD=y
+CONFIG_NET_TCP_WRITE_BUFFERS=y
+CONFIG_NET_TCP_NWRBCHAINS=8
+CONFIG_NET_TCP_RECVDELAY=0
+CONFIG_NET_TCPBACKLOG=y
+# CONFIG_NET_SENDFILE is not set
+
+#
+# UDP Networking
+#
+# CONFIG_NET_UDP is not set
+
+#
+# ICMP Networking Support
+#
+CONFIG_NET_ICMP=y
+CONFIG_NET_ICMP_PING=y
+
+#
+# IGMPv2 Client Support
+#
+# CONFIG_NET_IGMP is not set
+
+#
+# ARP Configuration
+#
+CONFIG_NET_ARP=y
+CONFIG_NET_ARPTAB_SIZE=16
+CONFIG_NET_ARP_MAXAGE=120
+# CONFIG_NET_ARP_IPIN is not set
+CONFIG_NET_ARP_SEND=y
+CONFIG_ARP_SEND_MAXTRIES=5
+CONFIG_ARP_SEND_DELAYMSEC=20
+
+#
+# Network I/O Buffer Support
+#
+CONFIG_NET_IOB=y
+CONFIG_IOB_NBUFFERS=72
+CONFIG_IOB_BUFSIZE=196
+CONFIG_IOB_NCHAINS=8
+CONFIG_IOB_THROTTLE=32
+# CONFIG_NET_ARCH_INCR32 is not set
+# CONFIG_NET_ARCH_CHKSUM is not set
+CONFIG_NET_STATISTICS=y
+
+#
+# Routing Table Configuration
+#
+# CONFIG_NET_ROUTE is not set
+CONFIG_NET_HOSTNAME="SAMV71-XULT"
+
+#
+# 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_BINFS is not set
+CONFIG_FS_PROCFS=y
+# CONFIG_FS_PROCFS_REGISTER is not set
+
+#
+# Exclude individual procfs entries
+#
+# CONFIG_FS_PROCFS_EXCLUDE_PROCESS is not set
+# CONFIG_FS_PROCFS_EXCLUDE_UPTIME is not set
+# CONFIG_FS_PROCFS_EXCLUDE_MOUNTS is not set
+# CONFIG_FS_PROCFS_EXCLUDE_NET is not set
+# CONFIG_FS_PROCFS_EXCLUDE_MTD is not set
+# CONFIG_FS_UNIONFS is not set
+
+#
+# System Logging
+#
+# CONFIG_SYSLOG is not set
+# CONFIG_SYSLOG_TIMESTAMP is not set
+
+#
+# Graphics Support
+#
+CONFIG_NX=y
+CONFIG_NX_NPLANES=1
+CONFIG_NX_BGCOLOR=0xbb
+# CONFIG_NX_WRITEONLY is not set
+CONFIG_NX_UPDATE=y
+
+#
+# Supported Pixel Depths
+#
+CONFIG_NX_DISABLE_1BPP=y
+CONFIG_NX_DISABLE_2BPP=y
+CONFIG_NX_DISABLE_4BPP=y
+# CONFIG_NX_DISABLE_8BPP is not set
+CONFIG_NX_DISABLE_16BPP=y
+CONFIG_NX_DISABLE_24BPP=y
+CONFIG_NX_DISABLE_32BPP=y
+CONFIG_NX_PACKEDMSFIRST=y
+
+#
+# Input Devices
+#
+CONFIG_NX_XYINPUT=y
+# CONFIG_NX_XYINPUT_NONE is not set
+CONFIG_NX_XYINPUT_MOUSE=y
+# CONFIG_NX_XYINPUT_TOUCHSCREEN is not set
+CONFIG_NX_KBD=y
+
+#
+# Framed Window Borders
+#
+CONFIG_NXTK_BORDERWIDTH=4
+CONFIG_NXTK_DEFAULT_BORDERCOLORS=y
+# CONFIG_NXTK_AUTORAISE is not set
+
+#
+# Font Selections
+#
+CONFIG_NXFONTS_CHARBITS=7
+# CONFIG_NXFONT_MONO5X8 is not set
+# CONFIG_NXFONT_SANS17X22 is not set
+# CONFIG_NXFONT_SANS20X26 is not set
+CONFIG_NXFONT_SANS23X27=y
+# CONFIG_NXFONT_SANS22X29 is not set
+# CONFIG_NXFONT_SANS28X37 is not set
+# CONFIG_NXFONT_SANS39X48 is not set
+# CONFIG_NXFONT_SANS17X23B is not set
+# CONFIG_NXFONT_SANS20X27B is not set
+CONFIG_NXFONT_SANS22X29B=y
+# CONFIG_NXFONT_SANS28X37B is not set
+# CONFIG_NXFONT_SANS40X49B is not set
+# CONFIG_NXFONT_SERIF22X29 is not set
+# CONFIG_NXFONT_SERIF29X37 is not set
+# CONFIG_NXFONT_SERIF38X48 is not set
+# CONFIG_NXFONT_SERIF22X28B is not set
+# CONFIG_NXFONT_SERIF27X38B is not set
+# CONFIG_NXFONT_SERIF38X49B is not set
+# CONFIG_NXFONT_PIXEL_UNICODE is not set
+# CONFIG_NXFONT_PIXEL_LCD_MACHINE is not set
+# CONFIG_NXFONT_X11_MISC_FIXED_4X6 is not set
+# CONFIG_NXFONT_X11_MISC_FIXED_5X7 is not set
+# CONFIG_NXFONT_X11_MISC_FIXED_5X8 is not set
+# CONFIG_NXFONT_X11_MISC_FIXED_6X9 is not set
+# CONFIG_NXFONT_X11_MISC_FIXED_6X10 is not set
+# CONFIG_NXFONT_X11_MISC_FIXED_6X12 is not set
+# CONFIG_NXFONT_X11_MISC_FIXED_6X13 is not set
+# CONFIG_NXFONT_X11_MISC_FIXED_6X13B is not set
+# CONFIG_NXFONT_X11_MISC_FIXED_6X13O is not set
+# CONFIG_NXFONT_X11_MISC_FIXED_7X13 is not set
+# CONFIG_NXFONT_X11_MISC_FIXED_7X13B is not set
+# CONFIG_NXFONT_X11_MISC_FIXED_7X13O is not set
+# CONFIG_NXFONT_X11_MISC_FIXED_7X14 is not set
+# CONFIG_NXFONT_X11_MISC_FIXED_7X14B is not set
+# CONFIG_NXFONT_X11_MISC_FIXED_8X13 is not set
+# CONFIG_NXFONT_X11_MISC_FIXED_8X13B is not set
+# CONFIG_NXFONT_X11_MISC_FIXED_8X13O is not set
+# CONFIG_NXFONT_X11_MISC_FIXED_9X15 is not set
+# CONFIG_NXFONT_X11_MISC_FIXED_9X15B is not set
+# CONFIG_NXFONT_X11_MISC_FIXED_9X18 is not set
+# CONFIG_NXFONT_X11_MISC_FIXED_9X18B is not set
+# CONFIG_NXFONT_X11_MISC_FIXED_10X20 is not set
+CONFIG_NXTERM=y
+
+#
+# NxTerm Output Text/Graphics Options
+#
+CONFIG_NXTERM_BPP=8
+CONFIG_NXTERM_CURSORCHAR=137
+CONFIG_NXTERM_MXCHARS=396
+CONFIG_NXTERM_CACHESIZE=32
+CONFIG_NXTERM_LINESEPARATION=0
+# CONFIG_NXTERM_NOWRAP is not set
+
+#
+# NxTerm Input options
+#
+CONFIG_NXTERM_NXKBDIN=y
+CONFIG_NXTERM_KBDBUFSIZE=16
+CONFIG_NXTERM_NPOLLWAITERS=4
+
+#
+# NX Multi-user only options
+#
+CONFIG_NX_MULTIUSER=y
+CONFIG_NX_BLOCKING=y
+CONFIG_NX_MXSERVERMSGS=32
+CONFIG_NX_MXCLIENTMSGS=16
+# CONFIG_NX_NXSTART is not set
+CONFIG_VNCSERVER=y
+# CONFIG_VNCSERVER_PROTO3p3 is not set
+CONFIG_VNCSERVER_PROTO3p8=y
+CONFIG_VNCSERVER_NDISPLAYS=1
+CONFIG_VNCSERVER_NAME="NuttX"
+CONFIG_VNCSERVER_PRIO=100
+CONFIG_VNCSERVER_STACKSIZE=2048
+CONFIG_VNCSERVER_UPDATER_PRIO=100
+CONFIG_VNCSERVER_UPDATER_STACKSIZE=2048
+CONFIG_VNCSERVER_COLORFMT_RGB8=y
+# CONFIG_VNCSERVER_COLORFMT_RGB16 is not set
+# CONFIG_VNCSERVER_COLORFMT_RGB32 is not set
+CONFIG_VNCSERVER_SCREENWIDTH=320
+CONFIG_VNCSERVER_SCREENHEIGHT=240
+CONFIG_VNCSERVER_NUPDATES=48
+CONFIG_VNCSERVER_UPDATE_BUFSIZE=1024
+CONFIG_VNCSERVER_INBUFFER_SIZE=80
+# CONFIG_VNCCLIENT is not set
+
+#
+# Memory Management
+#
+# CONFIG_MM_SMALL is not set
+CONFIG_MM_REGIONS=1
+# CONFIG_ARCH_HAVE_HEAP2 is not set
+# CONFIG_GRAN is not set
+
+#
+# Audio Support
+#
+# CONFIG_AUDIO is not set
+
+#
+# Wireless Support
+#
+# CONFIG_WIRELESS is not set
+
+#
+# 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 is not set
+
+#
+# Library Routines
+#
+
+#
+# Standard C Library Options
+#
+CONFIG_STDIO_BUFFER_SIZE=64
+CONFIG_STDIO_LINEBUFFER=y
+CONFIG_NUNGET_CHARS=2
+CONFIG_LIB_HOMEDIR="/"
+CONFIG_LIBM=y
+# CONFIG_NOPRINTF_FIELDWIDTH is not set
+CONFIG_LIBC_FLOATINGPOINT=y
+CONFIG_LIBC_LONG_LONG=y
+# CONFIG_LIBC_IOCTL_VARIADIC 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=y
+# CONFIG_NETDB_HOSTFILE is not set
+
+#
+# Non-standard Library Support
+#
+# CONFIG_LIB_KBDCODEC is not set
+# CONFIG_LIB_SLCDCODEC is not set
+
+#
+# Basic CXX Support
+#
+# CONFIG_C99_BOOL8 is not set
+CONFIG_HAVE_CXX=y
+CONFIG_HAVE_CXXINITIALIZE=y
+# CONFIG_CXX_NEWLONG is not set
+
+#
+# uClibc++ Standard C++ Library
+#
+# CONFIG_UCLIBCXX is not set
+
+#
+# Application Configuration
+#
+
+#
+# Built-In Applications
+#
+CONFIG_BUILTIN_PROXY_STACKSIZE=1024
+
+#
+# CAN Utilities
+#
+
+#
+# Examples
+#
+# CONFIG_EXAMPLES_BUTTONS is not set
+# CONFIG_EXAMPLES_CHAT is not set
+# CONFIG_EXAMPLES_CONFIGDATA is not set
+# CONFIG_EXAMPLES_CPUHOG is not set
+# CONFIG_EXAMPLES_CXXTEST 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_HELLOXX is not set
+# CONFIG_EXAMPLES_JSON is not set
+# CONFIG_EXAMPLES_HIDKBD is not set
+# CONFIG_EXAMPLES_KEYPADTEST is not set
+# CONFIG_EXAMPLES_IGMP 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_NETTEST is not set
+# CONFIG_EXAMPLES_NRF24L01TERM is not set
+# CONFIG_EXAMPLES_NSH is not set
+# CONFIG_EXAMPLES_NULL is not set
+# CONFIG_EXAMPLES_NX is not set
+# CONFIG_EXAMPLES_NXTERM is not set
+# CONFIG_EXAMPLES_NXFFS is not set
+# CONFIG_EXAMPLES_NXHELLO is not set
+# CONFIG_EXAMPLES_NXIMAGE is not set
+# CONFIG_EXAMPLES_NXLINES is not set
+# CONFIG_EXAMPLES_NXTEXT is not set
+# CONFIG_EXAMPLES_OSTEST is not set
+# CONFIG_EXAMPLES_PCA9635 is not set
+# CONFIG_EXAMPLES_PIPE is not set
+# CONFIG_EXAMPLES_PPPD is not set
+# CONFIG_EXAMPLES_POSIXSPAWN 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_TEST is not set
+# CONFIG_EXAMPLES_SMART 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_WEBSERVER is not set
+# CONFIG_EXAMPLES_USBSERIAL is not set
+# CONFIG_EXAMPLES_USBTERM is not set
+# CONFIG_EXAMPLES_WATCHDOG 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_PCODE is not set
+# CONFIG_INTERPRETERS_MICROPYTHON is not set
+
+#
+# FreeModBus
+#
+# CONFIG_MODBUS is not set
+
+#
+# Network Utilities
+#
+# CONFIG_NETUTILS_CODECS is not set
+# CONFIG_NETUTILS_FTPC is not set
+# CONFIG_NETUTILS_JSON is not set
+# CONFIG_NETUTILS_SMTP is not set
+CONFIG_NETUTILS_TELNETD=y
+CONFIG_NETUTILS_NETLIB=y
+CONFIG_NETUTILS_WEBCLIENT=y
+CONFIG_NSH_WGET_USERAGENT="NuttX/6.xx.x (; http://www.nuttx.org/)"
+CONFIG_WEBCLIENT_TIMEOUT=10
+# CONFIG_NETUTILS_WEBSERVER is not set
+# CONFIG_NETUTILS_XMLRPC is not set
+
+#
+# NSH Library
+#
+CONFIG_NSH_LIBRARY=y
+CONFIG_NSH_MOTD=y
+# CONFIG_NSH_PLATFORM_MOTD is not set
+CONFIG_NSH_MOTD_STRING="VNC Server at 10.0.0.2:5900"
+
+#
+# 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_ARP 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 is not set
+# 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_MKFIFO 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_PS is not set
+# CONFIG_NSH_DISABLE_PING 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
+
+#
+# Configure Command Options
+#
+# CONFIG_NSH_CMDOPT_DF_H is not set
+CONFIG_NSH_CODECS_BUFSIZE=128
+CONFIG_NSH_CMDOPT_HEXDUMP=y
+CONFIG_NSH_PROC_MOUNTPOINT="/proc"
+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_ARCHINIT=y
+
+#
+# Networking Configuration
+#
+CONFIG_NSH_NETINIT_THREAD=y
+CONFIG_NSH_NETINIT_THREAD_STACKSIZE=1568
+CONFIG_NSH_NETINIT_THREAD_PRIORITY=80
+
+#
+# IP Address Configuration
+#
+
+#
+# IPv4 Addresses
+#
+CONFIG_NSH_IPADDR=0x0a000002
+CONFIG_NSH_DRIPADDR=0x0a000001
+CONFIG_NSH_NETMASK=0xffffff00
+# CONFIG_NSH_NOMAC is not set
+CONFIG_NSH_MAX_ROUNDTRIP=20
+
+#
+# Telnet Configuration
+#
+CONFIG_NSH_TELNET=y
+CONFIG_NSH_TELNETD_PORT=23
+CONFIG_NSH_TELNETD_DAEMONPRIO=100
+CONFIG_NSH_TELNETD_DAEMONSTACKSIZE=2048
+CONFIG_NSH_TELNETD_CLIENTPRIO=100
+CONFIG_NSH_TELNETD_CLIENTSTACKSIZE=2048
+CONFIG_NSH_IOBUFFER_SIZE=512
+# CONFIG_NSH_LOGIN is not set
+# CONFIG_NSH_CONSOLE_LOGIN is not set
+# CONFIG_NSH_TELNET_LOGIN is not set
+
+#
+# NxWidgets/NxWM
+#
+CONFIG_NXWIDGETS=y
+
+#
+# NX Server/Device Configuration
+#
+# CONFIG_NXWIDGETS_FLICKERFREE is not set
+# CONFIG_NXWIDGETS_EXTERNINIT is not set
+CONFIG_NXWIDGETS_VPLANE=0
+CONFIG_NXWIDGET_SERVERINIT=y
+CONFIG_NXWIDGETS_SERVERPRIO=110
+CONFIG_NXWIDGETS_SERVERSTACK=2048
+CONFIG_NXWIDGETS_CLIENTPRIO=100
+CONFIG_NXWIDGETS_LISTENERPRIO=100
+CONFIG_NXWIDGETS_LISTENERSTACK=2048
+# CONFIG_NXWIDGET_EVENTWAIT is not set
+
+#
+# NXWidget Configuration
+#
+CONFIG_NXWIDGETS_BPP=8
+# CONFIG_NXWIDGETS_GREYSCALE is not set
+CONFIG_NXWIDGETS_SIZEOFCHAR=1
+
+#
+# NXWidget Default Values
+#
+# CONFIG_NXWIDGETS_SYSTEM_CUSTOM_FONTID is not set
+CONFIG_NXWIDGETS_TNXARRAY_INITIALSIZE=16
+CONFIG_NXWIDGETS_TNXARRAY_SIZEINCREMENT=8
+# CONFIG_NXWIDGETS_CUSTOM_FILLCOLORS is not set
+# CONFIG_NXWIDGETS_CUSTOM_EDGECOLORS is not set
+# CONFIG_NXWIDGETS_CUSTOM_TEXTCOLORS is not set
+CONFIG_NXWIDGETS_TRANSPARENT_COLOR=0x0
+
+#
+# Keypad behavior
+#
+CONFIG_NXWIDGETS_FIRST_REPEAT_TIME=500
+CONFIG_NXWIDGETS_CONTINUE_REPEAT_TIME=200
+CONFIG_NXWIDGETS_DOUBLECLICK_TIME=350
+CONFIG_NXWIDGETS_KBDBUFFER_SIZE=16
+CONFIG_NXWIDGETS_CURSORCONTROL_SIZE=4
+# CONFIG_NXWIDGET_MEMMONITOR is not set
+CONFIG_NXWM=y
+
+#
+# NxWM General Settings
+#
+# CONFIG_NXWM_LARGE_ICONS is not set
+CONFIG_NXWM_CUSTOM_FONTID=y
+CONFIG_NXWM_DEFAULT_FONTID=5
+CONFIG_NXWM_UNITTEST=y
+
+#
+# Color configuration
+#
+# CONFIG_NXWM_CUSTOM_FILLCOLORS is not set
+# CONFIG_NXWM_CUSTOM_EDGECOLORS is not set
+# CONFIG_NXWM_CUSTOM_TEXTCOLORS is not set
+
+#
+# Background Image
+#
+# CONFIG_NXWM_DISABLE_BACKGROUND_IMAGE is not set
+CONFIG_NXWM_BACKGROUND_IMAGE="NXWidgets::g_nuttxBitmap160x160"
+
+#
+# NxWM Taskbar Configuration
+#
+
+#
+# Horizontal and vertical spacing of icons in the task bar
+#
+CONFIG_NXWM_TASKBAR_VSPACING=4
+CONFIG_NXWM_TASKBAR_HSPACING=4
+# CONFIG_NXWM_TASKBAR_TOP is not set
+# CONFIG_NXWM_TASKBAR_BOTTOM is not set
+CONFIG_NXWM_TASKBAR_LEFT=y
+# CONFIG_NXWM_TASKBAR_RIGHT is not set
+# CONFIG_NXWM_CUSTOM_TASKBAR_WIDTH is not set
+# CONFIG_NXWM_TASKBAR_ICONSCALE is not set
+# CONFIG_NXWM_DISABLE_MINIMIZE is not set
+# CONFIG_NXWM_TASKBAR_NO_BORDER is not set
+
+#
+# NxWM Toolbar Configuration
+#
+# CONFIG_NXWM_CUSTOM_TOOLBAR_HEIGHT is not set
+CONFIG_NXWM_TOOLBAR_CUSTOM_FONTID=y
+CONFIG_NXWM_TOOLBAR_FONTID=5
+
+#
+# NxWM Application Window Configuration
+#
+# CONFIG_NXWM_CUSTOM_APPWINDOW_ICONS is not set
+
+#
+# NxWM Start Window Configuration
+#
+
+#
+# Horizontal and vertical spacing of icons in the task bar
+#
+CONFIG_NXWM_STARTWINDOW_VSPACING=4
+CONFIG_NXWM_STARTWINDOW_HSPACING=4
+# CONFIG_NXWM_CUSTOM_STARTWINDOW_ICON is not set
+CONFIG_NXWM_STARTWINDOW_MQNAME="/dev/nxwm"
+CONFIG_NXWM_STARTWINDOW_MXMSGS=32
+CONFIG_NXWM_STARTWINDOW_MXMPRIO=42
+CONFIG_NXWM_STARTWINDOW_PRIO=100
+CONFIG_NXWM_STARTWINDOW_STACKSIZE=2048
+
+#
+# NxTerm Window Settings
+#
+CONFIG_NXWM_NXTERM=y
+CONFIG_NXWM_NXTERM_PRIO=100
+CONFIG_NXWM_NXTERM_STACKSIZE=2048
+# CONFIG_NXWM_NXTERM_CUSTOM_COLORS is not set
+# CONFIG_NXWM_NXTERM_CUSTOM_FONTID is not set
+# CONFIG_NXWM_CUSTOM_NXTERM_ICON is not set
+
+#
+# NxWM Touchscreen Configuration
+#
+# CONFIG_NXWM_TOUCHSCREEN is not set
+
+#
+# NxWM Keyboard Configuration
+#
+CONFIG_NXWM_KEYBOARD=y
+
+#
+# Keyboard Device Settings
+#
+CONFIG_NXWM_KEYBOARD_DEVPATH="/dev/console"
+# CONFIG_NXWM_KEYBOARD_USBHOST is not set
+CONFIG_NXWM_KEYBOARD_SIGNO=6
+CONFIG_NXWM_KEYBOARD_BUFSIZE=16
+CONFIG_NXWM_KEYBOARD_LISTENERPRIO=120
+CONFIG_NXWM_KEYBOARD_LISTENERSTACK=2048
+
+#
+# NxWM Calibration Display Settings
+#
+CONFIG_NXWM_CALIBRATION_MARGIN=40
+# CONFIG_NXWM_CALIBRATION_CUSTOM_COLORS is not set
+CONFIG_NXWM_CALIBRATION_MESSAGES=y
+CONFIG_NXWM_CALIBRATION_CUSTOM_FONTID=y
+CONFIG_NXWM_CALIBRATION_FONTID=5
+CONFIG_NXWM_CALIBRATION_AVERAGE=y
+CONFIG_NXWM_CALIBRATION_NSAMPLES=2
+# CONFIG_NXWM_CALIBRATION_DISCARD_MINMAX is not set
+# CONFIG_NXWM_CALIBRATION_ANISOTROPIC is not set
+# CONFIG_NXWM_CUSTOM_CALIBRATION_ICON is not set
+CONFIG_NXWM_CALIBRATION_SIGNO=5
+CONFIG_NXWM_CALIBRATION_LISTENERPRIO=100
+CONFIG_NXWM_CALIBRATION_LISTENERSTACK=2048
+
+#
+# NxWM Hex Calculator Display Settings
+#
+# CONFIG_NXWM_HEXCALCULATOR_CUSTOM_COLORS is not set
+# CONFIG_NXWM_CUSTOM_HEXCALCULATOR_ICON is not set
+CONFIG_NXWM_HEXCALCULATOR_CUSTOM_FONTID=y
+CONFIG_NXWM_HEXCALCULATOR_FONTID=5
+
+#
+# NxWM Media Player Display Settings
+#
+
+#
+# Platform-specific Support
+#
+# CONFIG_PLATFORM_CONFIGDATA is not set
+
+#
+# System Libraries and NSH Add-Ons
+#
+# CONFIG_SYSTEM_FREE is not set
+# CONFIG_SYSTEM_CLE is not set
+# CONFIG_SYSTEM_CUTERM is not set
+# CONFIG_SYSTEM_INSTALL is not set
+# CONFIG_SYSTEM_FLASH_ERASEALL is not set
+# CONFIG_SYSTEM_HEX2BIN is not set
+# CONFIG_SYSTEM_I2CTOOL is not set
+# CONFIG_SYSTEM_HEXED is not set
+# CONFIG_SYSTEM_NETDB 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_MDIO is not set
+# CONFIG_SYSTEM_SUDOKU is not set
+# CONFIG_SYSTEM_VI is not set
+# CONFIG_SYSTEM_UBLOXMODEM is not set
+# CONFIG_SYSTEM_ZMODEM is not set
diff --git a/configs/samv71-xult/vnxwm/setenv.sh b/configs/samv71-xult/vnxwm/setenv.sh
new file mode 100644
index 00000000000..c3756d2330d
--- /dev/null
+++ b/configs/samv71-xult/vnxwm/setenv.sh
@@ -0,0 +1,77 @@
+#!/bin/bash
+# configs/samv7-xult/vnxwm/Make.defs
+#
+# Copyright (C) 2016 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt
+#
+# 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 Atmel GCC
+# toolchain under Windows. You will also have to edit this if you install
+# this toolchain in any other location
+#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Atmel/Atmel Toolchain/ARM GCC/Native/4.7.3.99/arm-gnu-toolchain/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 TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin"
+# export TOOLCHAIN_BIN="/cygdrive/c/Users/MyName/MentorGraphics/Sourcery_CodeBench_Lite_for_ARM_EABI/bin"
+
+# This is the location where I installed the ARM "GNU Tools for ARM Embedded Processors"
+# You can this free toolchain here https://launchpad.net/gcc-arm-embedded
+export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/GNU Tools ARM Embedded/4.9 2015q2/bin"
+
+# This is the path to the location where I installed the devkitARM toolchain
+# You can get this free toolchain from http://devkitpro.org/ or http://sourceforge.net/projects/devkitpro/
+#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/devkitARM/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"
+
+# Add the path to the toolchain to the PATH varialble
+export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}"
+
+echo "PATH : ${PATH}"
diff --git a/configs/sim/src/sim_touchscreen.c b/configs/sim/src/sim_touchscreen.c
index 5187aa411f2..c6afc355284 100644
--- a/configs/sim/src/sim_touchscreen.c
+++ b/configs/sim/src/sim_touchscreen.c
@@ -50,6 +50,10 @@
#include
#include
+#ifdef CONFIG_VNCSERVER
+# include
+#endif
+
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
@@ -130,6 +134,17 @@ int board_tsc_setup(int minor)
goto errout_with_fb;
}
+#ifdef CONFIG_VNCSERVER
+ /* Setup the VNC server to support keyboard/mouse inputs */
+
+ ret = vnc_default_fbinitialize(0, g_simtc.hnx);
+ if (ret < 0)
+ {
+ idbg("vnc_default_fbinitialize failed: %d\n", ret);
+ goto errout_with_fb;
+ }
+#endif
+
/* Set the background to the configured background color */
ivdbg("Set background color=%d\n", CONFIG_EXAMPLES_TOUCHSCREEN_BGCOLOR);
diff --git a/configs/stm32f429i-disco/src/stm32_ili93414ws.c b/configs/stm32f429i-disco/src/stm32_ili93414ws.c
index aea55ea8d63..58dad6eae23 100644
--- a/configs/stm32f429i-disco/src/stm32_ili93414ws.c
+++ b/configs/stm32f429i-disco/src/stm32_ili93414ws.c
@@ -69,6 +69,10 @@
/* spi frequency based on arch/arm/src/stm32/stm32_spi.c */
+#ifndef CONFIG_STM32F429I_DISCO_ILI9341_SPIFREQUENCY
+# define CONFIG_STM32F429I_DISCO_ILI9341_SPIFREQUENCY 20000000
+#endif
+
#if CONFIG_STM32F429I_DISCO_ILI9341_SPIFREQUENCY >= \
(STM32_PCLK1_FREQUENCY >> 1)
# define ILI93414WS_SPI_BR SPI_CR1_FPCLCKd2 /* 000: fPCLK/2 */
diff --git a/configs/stm32l476vg-disco/include/board.h b/configs/stm32l476vg-disco/include/board.h
index dcf8bf6bdcb..c3e1efd354c 100644
--- a/configs/stm32l476vg-disco/include/board.h
+++ b/configs/stm32l476vg-disco/include/board.h
@@ -144,16 +144,6 @@
#define GPIO_QSPI_IO3 (GPIO_QSPI_BK1_IO3_2 | GPIO_FLOAT | GPIO_PUSHPULL | GPIO_SPEED_100MHz)
#define GPIO_QSPI_SCK (GPIO_QSPI_CLK_2 | GPIO_FLOAT | GPIO_PUSHPULL | GPIO_SPEED_100MHz)
-#if 0
-/* XXX hmm, elsewhere */
-
-#define QSPI_USE_INTERRUPTS 1
-
-/* XXX hmm, better? (2^(23+1)); this is the value that goes into FSIZE */
-
-#define QSPI_FLASH_SIZE 23
-#endif
-
/* SPI */
/* XXX is SPI1 used on Disco? */
diff --git a/configs/stm32l476vg-disco/nsh/defconfig b/configs/stm32l476vg-disco/nsh/defconfig
index 8ee16e46cb2..43178e9ec53 100644
--- a/configs/stm32l476vg-disco/nsh/defconfig
+++ b/configs/stm32l476vg-disco/nsh/defconfig
@@ -59,6 +59,7 @@ CONFIG_DEBUG_VERBOSE=y
#
# OS Function Debug Options
#
+# CONFIG_DEBUG_DMA is not set
# CONFIG_DEBUG_HEAP is not set
# CONFIG_DEBUG_IRQ is not set
@@ -176,6 +177,7 @@ CONFIG_ARMV7M_HAVE_STACKCHECK=y
# CONFIG_ARMV7M_ITMSYSLOG is not set
# CONFIG_SERIAL_TERMIOS is not set
# CONFIG_USART2_RS485 is not set
+# CONFIG_USART2_RXDMA is not set
# CONFIG_SERIAL_DISABLE_REORDERING is not set
#
@@ -197,7 +199,7 @@ CONFIG_STM32L4_FLASH_1024KB=y
# CONFIG_STM32L4_ADC is not set
# CONFIG_STM32L4_CAN is not set
# CONFIG_STM32L4_DAC is not set
-# CONFIG_STM32L4_DMA is not set
+CONFIG_STM32L4_DMA=y
# CONFIG_STM32L4_I2C is not set
# CONFIG_STM32L4_SAI is not set
# CONFIG_STM32L4_SPI is not set
@@ -207,8 +209,8 @@ CONFIG_STM32L4_USART=y
#
# AHB1 Peripherals
#
-# CONFIG_STM32L4_DMA1 is not set
-# CONFIG_STM32L4_DMA2 is not set
+CONFIG_STM32L4_DMA1=y
+CONFIG_STM32L4_DMA2=y
# CONFIG_STM32L4_CRC is not set
# CONFIG_STM32L4_TSC is not set
@@ -230,6 +232,17 @@ CONFIG_STM32L4_QSPI=y
CONFIG_STM32L4_QSPI_FLASH_SIZE=16777216
CONFIG_STM32L4_QSPI_FIFO_THESHOLD=4
CONFIG_STM32L4_QSPI_CSHT=1
+# CONFIG_STM32L4_QSPI_POLLING is not set
+# CONFIG_STM32L4_QSPI_INTERRUPTS is not set
+CONFIG_STM32L4_QSPI_DMA=y
+CONFIG_STM32L4_QSPI_DMA_CHAN_1_5=y
+# CONFIG_STM32L4_QSPI_DMA_CHAN_2_7 is not set
+# CONFIG_STM32L4_QSPI_DMAPRIORITY_VERYHIGH is not set
+# CONFIG_STM32L4_QSPI_DMAPRIORITY_HIGH is not set
+CONFIG_STM32L4_QSPI_DMAPRIORITY_MEDIUM=y
+# CONFIG_STM32L4_QSPI_DMAPRIORITY_LOW is not set
+CONFIG_STM32L4_QSPI_DMATHRESHOLD=4
+# CONFIG_STM32L4_QSPI_REGDEBUG is not set
#
# APB1 Peripherals
@@ -302,7 +315,7 @@ CONFIG_STM32L4_SAI1PLL=y
#
# CONFIG_ARCH_NOINTC is not set
# CONFIG_ARCH_VECNOTIRQ is not set
-# CONFIG_ARCH_DMA is not set
+CONFIG_ARCH_DMA=y
CONFIG_ARCH_HAVE_IRQPRIO=y
# CONFIG_ARCH_L2CACHE is not set
# CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set
@@ -384,7 +397,7 @@ CONFIG_LIB_BOARDCTL=y
# CONFIG_BOARDCTL_ADCTEST is not set
# CONFIG_BOARDCTL_PWMTEST is not set
# CONFIG_BOARDCTL_GRAPHICS is not set
-# CONFIG_BOARDCTL_IOCTL is not set
+CONFIG_BOARDCTL_IOCTL=y
#
# RTOS Features
@@ -646,12 +659,7 @@ CONFIG_USART2_2STOP=0
#
# System Logging
#
-CONFIG_RAMLOG=y
-CONFIG_RAMLOG_SYSLOG=y
-# CONFIG_RAMLOG_CONSOLE is not set
-CONFIG_RAMLOG_BUFSIZE=8192
-# CONFIG_RAMLOG_CRLF is not set
-CONFIG_RAMLOG_NONBLOCKING=y
+# CONFIG_RAMLOG is not set
# CONFIG_SYSLOG_CONSOLE is not set
#
@@ -708,9 +716,8 @@ CONFIG_FS_PROCFS_REGISTER=y
#
# System Logging
#
-CONFIG_SYSLOG=y
+# CONFIG_SYSLOG is not set
# CONFIG_SYSLOG_TIMESTAMP is not set
-# CONFIG_SYSLOG_CHAR is not set
#
# Graphics Support
@@ -838,14 +845,7 @@ CONFIG_EXAMPLES_BUTTONS_NAME7="Button 7"
# CONFIG_EXAMPLES_CXXTEST is not set
# CONFIG_EXAMPLES_DHCPD is not set
# CONFIG_EXAMPLES_ELF is not set
-CONFIG_EXAMPLES_FSTEST=y
-CONFIG_EXAMPLES_FSTEST_MAXNAME=32
-CONFIG_EXAMPLES_FSTEST_MAXFILE=8192
-CONFIG_EXAMPLES_FSTEST_MAXIO=347
-CONFIG_EXAMPLES_FSTEST_MAXOPEN=512
-CONFIG_EXAMPLES_FSTEST_MOUNTPT="/mnt/n25qxxx"
-CONFIG_EXAMPLES_FSTEST_NLOOPS=1
-CONFIG_EXAMPLES_FSTEST_VERBOSE=y
+# CONFIG_EXAMPLES_FSTEST is not set
# CONFIG_EXAMPLES_FTPC is not set
# CONFIG_EXAMPLES_FTPD is not set
# CONFIG_EXAMPLES_HELLO is not set
@@ -871,20 +871,12 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y
# CONFIG_EXAMPLES_NXIMAGE is not set
# CONFIG_EXAMPLES_NXLINES is not set
# CONFIG_EXAMPLES_NXTEXT is not set
-CONFIG_EXAMPLES_OSTEST=y
-CONFIG_EXAMPLES_OSTEST_LOOPS=1
-CONFIG_EXAMPLES_OSTEST_STACKSIZE=8192
-CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=8
-CONFIG_EXAMPLES_OSTEST_RR_RANGE=10000
-CONFIG_EXAMPLES_OSTEST_RR_RUNS=10
-CONFIG_EXAMPLES_OSTEST_WAITRESULT=y
+# CONFIG_EXAMPLES_OSTEST is not set
# CONFIG_EXAMPLES_PCA9635 is not set
# CONFIG_EXAMPLES_PIPE is not set
# CONFIG_EXAMPLES_PPPD is not set
# CONFIG_EXAMPLES_POSIXSPAWN is not set
-CONFIG_EXAMPLES_RANDOM=y
-CONFIG_EXAMPLES_MAXSAMPLES=64
-CONFIG_EXAMPLES_NSAMPLES=8
+# CONFIG_EXAMPLES_RANDOM is not set
# CONFIG_EXAMPLES_RGBLED is not set
# CONFIG_EXAMPLES_RGMP is not set
# CONFIG_EXAMPLES_SENDMAIL is not set
diff --git a/configs/stm32l476vg-disco/src/stm32_appinit.c b/configs/stm32l476vg-disco/src/stm32_appinit.c
index 71da0040996..5e277507ec4 100644
--- a/configs/stm32l476vg-disco/src/stm32_appinit.c
+++ b/configs/stm32l476vg-disco/src/stm32_appinit.c
@@ -45,6 +45,8 @@
#include
#include
#include
+#include
+#include
#include
#include
@@ -57,6 +59,7 @@
#include
#include
#include
+#include
#include
#include
@@ -193,6 +196,7 @@ int board_app_initialize(void)
#ifdef HAVE_N25QXXX_SMARTFS
/* Configure the device with no partition support */
+ SYSLOG("doing smart_initialize()\n");
ret = smart_initialize(N25QXXX_SMART_MINOR, mtd, NULL);
if (ret != OK)
{
@@ -202,6 +206,7 @@ int board_app_initialize(void)
#elif defined(HAVE_N25QXXX_NXFFS)
/* Initialize to provide NXFFS on the N25QXXX MTD interface */
+ SYSLOG("doing nxffs_initialize()\n");
ret = nxffs_initialize(mtd);
if (ret < 0)
{
@@ -237,9 +242,9 @@ int board_app_initialize(void)
/* NOTE: for this to work, you will need to make sure that
* CONFIG_FS_WRITABLE is set in the config. It's not a user-
* visible setting, but you can make it set by selecting an
- * arbitrary writeable file system (you don't have to actually
+ * arbitrary writable file system (you don't have to actually
* use it, just select it so that the block device created via
- * ftl_initialize() will be writeable). Personally, I chose FAT,
+ * ftl_initialize() will be writable). Personally, I chose FAT,
* because SMARTFS and NXFFS will cause the other code branches
* above to become active.
*/
@@ -257,3 +262,12 @@ int board_app_initialize(void)
return OK;
}
#endif /* CONFIG_LIB_BOARDCTL */
+
+
+
+#ifdef CONFIG_BOARDCTL_IOCTL
+int board_ioctl(unsigned int cmd, uintptr_t arg)
+{
+ return OK;
+}
+#endif
diff --git a/fs/procfs/fs_procfsproc.c b/fs/procfs/fs_procfsproc.c
index eb93fc5a550..84484a593da 100644
--- a/fs/procfs/fs_procfsproc.c
+++ b/fs/procfs/fs_procfsproc.c
@@ -919,8 +919,7 @@ static ssize_t proc_groupfd(FAR struct proc_file_s *procfile,
totalsize = 0;
#if CONFIG_NFILE_DESCRIPTORS > 0 /* Guaranteed to be true */
- linesize = snprintf(procfile->line, STATUS_LINELEN, "\n%3-s %-8s %s\n",
- "FD", "POS", "OFLAGS");
+ linesize = snprintf(procfile->line, STATUS_LINELEN, "\n%-3s %-8s %s\n",
copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset);
totalsize += copysize;
diff --git a/graphics/nxmu/nx_start.c b/graphics/nxmu/nx_start.c
index 78e98132ee6..814dc5a70cf 100644
--- a/graphics/nxmu/nx_start.c
+++ b/graphics/nxmu/nx_start.c
@@ -53,22 +53,6 @@
#ifdef CONFIG_NX_NXSTART
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-/****************************************************************************
- * Private Types
- ****************************************************************************/
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
-/****************************************************************************
- * Public Data
- ****************************************************************************/
-
/****************************************************************************
* Private Functions
****************************************************************************/
diff --git a/graphics/vnc/server/Kconfig b/graphics/vnc/server/Kconfig
index 3f14b38bc2d..157b62dfc91 100644
--- a/graphics/vnc/server/Kconfig
+++ b/graphics/vnc/server/Kconfig
@@ -127,9 +127,20 @@ config VNCSERVER_INBUFFER_SIZE
int "Input buffer size"
default 80
+config VNCSERVER_DEBUG
+ bool "VNC Server debug"
+ default n
+ depends on DEBUG && !DEBUG_GRAPHICS
+ ---help---
+ Normally VNC debug output is selected with DEBUG_GRAPHICS. The VNC
+ server server suupport this special option to enable GRAPHICS debug
+ output for the VNC server while GRAPHICS debug is disabled. This
+ provides an cleaner, less cluttered output when you only wish to
+ debug the VNC server versus enabling DEBUG_GRAPHICS globally.
+
config VNCSERVER_UPDATE_DEBUG
bool "Detailed updater debug"
default n
- depends on DEBUG_GRAPHICS
+ depends on DEBUG_GRAPHICS || VNCSERVER_DEBUG
endif # VNCSERVER
diff --git a/graphics/vnc/server/vnc_color.c b/graphics/vnc/server/vnc_color.c
index 597b9686d67..8543cf7866e 100644
--- a/graphics/vnc/server/vnc_color.c
+++ b/graphics/vnc/server/vnc_color.c
@@ -265,9 +265,14 @@ uint32_t vnc_convert_rgb32_888(lfb_color_t rgb)
* Name: vnc_colors
*
* Description:
- * Test the update rectangle to see if it contains complex colors. If it
- * contains only a few colors, then it may be a candidate for some type
- * run-length encoding.
+ * Test the update rectangle to see if it contains complex colors. If it
+ * contains only a few colors, then it may be a candidate for some type
+ * run-length encoding.
+ *
+ * REVISIT: This function is imperfect: It will fail if there are more
+ * than 8 colors in the region. For small colors, we can keep a local
+ * array for all color formats and always return the exact result, no
+ * matter now many colors.
*
* Input Parameters:
* session - An instance of the session structure.
@@ -280,15 +285,13 @@ uint32_t vnc_convert_rgb32_888(lfb_color_t rgb)
* The number of valid colors in the colors[] array are returned, the
* first entry being the most frequent. A negated errno value is returned
* if the colors cannot be determined. This would be the case if the color
- * depth is > 8 and there are more than 'maxcolors' colors in the update
- * rectangle.
+ * there are more than 'maxcolors' colors in the update rectangle.
*
****************************************************************************/
int vnc_colors(FAR struct vnc_session_s *session, FAR struct nxgl_rect_s *rect,
unsigned int maxcolors, FAR lfb_color_t *colors)
{
-#if RFB_PIXELDEPTH > 8
FAR const lfb_color_t *rowstart;
FAR const lfb_color_t *pixptr;
lfb_color_t pixel;
@@ -412,12 +415,4 @@ int vnc_colors(FAR struct vnc_session_s *session, FAR struct nxgl_rect_s *rect,
/* And return the number of colors that we found */
return ncolors;
-
-#else
- /* For small colors, we can keep a local array for all color formats and
- * always return the exact result, no matter now many colors. OR we could
- * just remove this conditional compilation and live with 8 colors max.
- */
-# error No support for small colors
-#endif
}
diff --git a/graphics/vnc/server/vnc_fbdev.c b/graphics/vnc/server/vnc_fbdev.c
index 2f98fab21bd..fb3b71a4257 100644
--- a/graphics/vnc/server/vnc_fbdev.c
+++ b/graphics/vnc/server/vnc_fbdev.c
@@ -43,6 +43,14 @@
#include
#include
#include
+
+#if defined(CONFIG_VNCSERVER_DEBUG) && !defined(CONFIG_DEBUG_GRAPHICS)
+# undef CONFIG_DEBUG
+# undef CONFIG_DEBUG_VERBOSE
+# define CONFIG_DEBUG 1
+# define CONFIG_DEBUG_VERBOSE 1
+# define CONFIG_DEBUG_GRAPHICS 1
+#endif
#include
#include
@@ -481,7 +489,7 @@ static inline int vnc_wait_start(int display)
*/
while (g_vnc_sessions[display] == NULL ||
- g_vnc_sessions[display]->state != VNCSERVER_UNINITIALIZED)
+ g_vnc_sessions[display]->state == VNCSERVER_UNINITIALIZED)
{
/* The server is not yet running. Wait for the server to post the FB
* semaphore. In certain error situations, the server may post the
@@ -869,7 +877,7 @@ void nx_notify_rectangle(FAR NX_PLANEINFOTYPE *pinfo,
{
/* Queue the rectangular update */
- ret = vnc_update_rectangle(session, rect);
+ ret = vnc_update_rectangle(session, rect, true);
if (ret < 0)
{
gdbg("ERROR: vnc_update_rectangle failed: %d\n", ret);
diff --git a/graphics/vnc/server/vnc_keymap.c b/graphics/vnc/server/vnc_keymap.c
index bb5fe3f6233..b23e3199a1f 100644
--- a/graphics/vnc/server/vnc_keymap.c
+++ b/graphics/vnc/server/vnc_keymap.c
@@ -48,6 +48,8 @@
#define XK_LATIN1 1
#define XK_XKB_KEYS 1
+#include
+#include
#include
#include
@@ -627,4 +629,26 @@ void vnc_key_map(FAR struct vnc_session_s *session, uint16_t keysym,
#endif
}
+/****************************************************************************
+ * Function: vnc_kbdout
+ *
+ * Description:
+ * This is the default keyboard callout function. This is simply wrappers around nx_kdbout(), respectively. When configured using vnc_fbinitialize(), the 'arg' must be the correct NXHANDLE value.
+ *
+ * Parameters:
+ * arg - The NXHANDLE from the NX graphics subsystem
+ * nch - Number of characters
+ * ch - An array of input characters.
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+void vnc_kbdout(FAR void *arg, uint8_t nch, FAR const uint8_t *ch)
+{
+ DEBUGASSERT(arg != NULL);
+ (void)nx_kbdin((NXHANDLE)arg, nch, ch);
+}
+
#endif /* CONFIG_NX_KBD */
\ No newline at end of file
diff --git a/graphics/vnc/server/vnc_negotiate.c b/graphics/vnc/server/vnc_negotiate.c
index 5014e9a83d2..1d7e28d8148 100644
--- a/graphics/vnc/server/vnc_negotiate.c
+++ b/graphics/vnc/server/vnc_negotiate.c
@@ -43,6 +43,14 @@
#include
#include
#include
+
+#if defined(CONFIG_VNCSERVER_DEBUG) && !defined(CONFIG_DEBUG_GRAPHICS)
+# undef CONFIG_DEBUG
+# undef CONFIG_DEBUG_VERBOSE
+# define CONFIG_DEBUG 1
+# define CONFIG_DEBUG_VERBOSE 1
+# define CONFIG_DEBUG_GRAPHICS 1
+#endif
#include
#ifdef CONFIG_NET_SOCKOPTS
@@ -154,6 +162,11 @@ int vnc_negotiate(FAR struct vnc_session_s *session)
DEBUGASSERT(errcode > 0);
return -errcode;
}
+ else if (nrecvd == 0)
+ {
+ gdbg("Connection closed\n");
+ return -ECONNABORTED;
+ }
DEBUGASSERT(nrecvd == len);
@@ -221,6 +234,11 @@ int vnc_negotiate(FAR struct vnc_session_s *session)
DEBUGASSERT(errcode > 0);
return -errcode;
}
+ else if (nrecvd == 0)
+ {
+ gdbg("Connection closed\n");
+ return -ECONNABORTED;
+ }
DEBUGASSERT(nrecvd == sizeof(struct rfb_selected_sectype_s));
@@ -305,6 +323,11 @@ int vnc_negotiate(FAR struct vnc_session_s *session)
DEBUGASSERT(errcode > 0);
return -errcode;
}
+ else if (nrecvd == 0)
+ {
+ gdbg("Connection closed\n");
+ return -ECONNABORTED;
+ }
DEBUGASSERT(nrecvd == sizeof(struct rfb_clientinit_s));
@@ -375,6 +398,11 @@ int vnc_negotiate(FAR struct vnc_session_s *session)
DEBUGASSERT(errcode > 0);
return -errcode;
}
+ else if (nrecvd == 0)
+ {
+ gdbg("Connection closed\n");
+ return -ECONNABORTED;
+ }
else if (nrecvd != sizeof(struct rfb_setpixelformat_s))
{
/* Must not be a SetPixelFormat message? */
@@ -417,8 +445,13 @@ int vnc_negotiate(FAR struct vnc_session_s *session)
DEBUGASSERT(errcode > 0);
return -errcode;
}
+ else if (nrecvd == 0)
+ {
+ gdbg("Connection closed\n");
+ return -ECONNABORTED;
+ }
- if (nrecvd > 0 && encodings->msgtype == RFB_SETENCODINGS_MSG)
+ if (encodings->msgtype == RFB_SETENCODINGS_MSG)
{
DEBUGASSERT(nrecvd >= SIZEOF_RFB_SETENCODINGS_S(0));
@@ -513,5 +546,6 @@ int vnc_client_pixelformat(FAR struct vnc_session_s *session,
return -ENOSYS;
}
+ session->change = true;
return OK;
}
diff --git a/graphics/vnc/server/vnc_raw.c b/graphics/vnc/server/vnc_raw.c
index 64cfee779e6..947cbfe9055 100644
--- a/graphics/vnc/server/vnc_raw.c
+++ b/graphics/vnc/server/vnc_raw.c
@@ -42,6 +42,14 @@
#include
#include
#include
+
+#if defined(CONFIG_VNCSERVER_DEBUG) && !defined(CONFIG_DEBUG_GRAPHICS)
+# undef CONFIG_DEBUG
+# undef CONFIG_DEBUG_VERBOSE
+# define CONFIG_DEBUG 1
+# define CONFIG_DEBUG_VERBOSE 1
+# define CONFIG_DEBUG_GRAPHICS 1
+#endif
#include
#include "vnc_server.h"
diff --git a/graphics/vnc/server/vnc_receiver.c b/graphics/vnc/server/vnc_receiver.c
index 862b39362ae..4f25d4931eb 100644
--- a/graphics/vnc/server/vnc_receiver.c
+++ b/graphics/vnc/server/vnc_receiver.c
@@ -41,6 +41,14 @@
#include
#include
+
+#if defined(CONFIG_VNCSERVER_DEBUG) && !defined(CONFIG_DEBUG_GRAPHICS)
+# undef CONFIG_DEBUG
+# undef CONFIG_DEBUG_VERBOSE
+# define CONFIG_DEBUG 1
+# define CONFIG_DEBUG_VERBOSE 1
+# define CONFIG_DEBUG_GRAPHICS 1
+#endif
#include
#ifdef CONFIG_NET_SOCKOPTS
@@ -49,6 +57,9 @@
#include
#include
+#include
+#include
+#include
#include "vnc_server.h"
@@ -165,6 +176,16 @@ int vnc_receiver(FAR struct vnc_session_s *session)
return -errcode;
}
+ /* A return value of zero means that the connection was gracefully
+ * closed by the VNC client.
+ */
+
+ else if (nrecvd == 0)
+ {
+ gdbg("Connection closed\n", errcode);
+ return OK;
+ }
+
DEBUGASSERT(nrecvd == 1);
/* The single byte received should be the message type. Handle the
@@ -207,7 +228,7 @@ int vnc_receiver(FAR struct vnc_session_s *session)
case RFB_SETENCODINGS_MSG: /* SetEncodings */
{
FAR struct rfb_setencodings_s *encodings;
- uint32_t nencodings;
+ unsigned int nencodings;
gvdbg("Received SetEncodings\n");
@@ -228,7 +249,7 @@ int vnc_receiver(FAR struct vnc_session_s *session)
/* Read the following encodings */
encodings = (FAR struct rfb_setencodings_s *)session->inbuf;
- nencodings = rfb_getbe32(encodings->nencodings);
+ nencodings = rfb_getbe16(encodings->nencodings);
ret = vnc_read_remainder(session,
nencodings * sizeof(uint32_t),
@@ -280,7 +301,7 @@ int vnc_receiver(FAR struct vnc_session_s *session)
rect.pt2.x = rect.pt1.x + rfb_getbe16(update->width);
rect.pt2.y = rect.pt1.y + rfb_getbe16(update->height);
- ret = vnc_update_rectangle(session, &rect);
+ ret = vnc_update_rectangle(session, &rect, false);
if (ret < 0)
{
gdbg("ERROR: Failed to queue update: %d\n", ret);
@@ -452,7 +473,7 @@ int vnc_client_encodings(FAR struct vnc_session_s *session,
/* Loop for each client supported encoding */
- nencodings = rfb_getbe32(encodings->nencodings);
+ nencodings = rfb_getbe16(encodings->nencodings);
for (i = 0; i < nencodings; i++)
{
/* Get the next encoding */
@@ -464,9 +485,37 @@ int vnc_client_encodings(FAR struct vnc_session_s *session,
if (encoding == RFB_ENCODING_RRE)
{
session->rre = true;
- return OK;
}
}
+ session->change = true;
return OK;
}
+
+/****************************************************************************
+ * Function: vnc_mouse
+ *
+ * Description:
+ * This is the default keyboard/mouse callout function. This is simply a
+ * wrapper around nx_mousein(). When
+ * configured using vnc_fbinitialize(), the 'arg' must be the correct
+ * NXHANDLE value.
+ *
+ * Parameters:
+ * See vnc_mouseout_t and vnc_kbdout_t typde definitions above. These
+ * callouts have arguments that match the inputs to nx_kbdin() and
+ * nx_mousein() (if arg is really of type NXHANDLE).
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_NX_XYINPUT
+void vnc_mouseout(FAR void *arg, nxgl_coord_t x, nxgl_coord_t y,
+ uint8_t buttons)
+{
+ DEBUGASSERT(arg != NULL);
+ (void)nx_mousein((NXHANDLE)arg, x, y, buttons);
+}
+#endif
diff --git a/graphics/vnc/server/vnc_rre.c b/graphics/vnc/server/vnc_rre.c
index 0ccb841f869..a216a495249 100644
--- a/graphics/vnc/server/vnc_rre.c
+++ b/graphics/vnc/server/vnc_rre.c
@@ -42,6 +42,14 @@
#include
#include
#include
+
+#if defined(CONFIG_VNCSERVER_DEBUG) && !defined(CONFIG_DEBUG_GRAPHICS)
+# undef CONFIG_DEBUG
+# undef CONFIG_DEBUG_VERBOSE
+# define CONFIG_DEBUG 1
+# define CONFIG_DEBUG_VERBOSE 1
+# define CONFIG_DEBUG_GRAPHICS 1
+#endif
#include
#include "vnc_server.h"
diff --git a/graphics/vnc/server/vnc_server.c b/graphics/vnc/server/vnc_server.c
index c33050f3032..cad2f5ca3f4 100644
--- a/graphics/vnc/server/vnc_server.c
+++ b/graphics/vnc/server/vnc_server.c
@@ -46,6 +46,14 @@
#include
#include
#include
+
+#if defined(CONFIG_VNCSERVER_DEBUG) && !defined(CONFIG_DEBUG_GRAPHICS)
+# undef CONFIG_DEBUG
+# undef CONFIG_DEBUG_VERBOSE
+# define CONFIG_DEBUG 1
+# define CONFIG_DEBUG_VERBOSE 1
+# define CONFIG_DEBUG_GRAPHICS 1
+#endif
#include
#include
@@ -121,9 +129,16 @@ static void vnc_reset_session(FAR struct vnc_session_s *session,
sem_reset(&session->freesem, CONFIG_VNCSERVER_NUPDATES);
sem_reset(&session->queuesem, 0);
+
session->fb = fb;
session->display = display;
session->state = VNCSERVER_INITIALIZED;
+ session->nwhupd = 0;
+ session->change = true;
+
+ /* Careful not to disturb the keyboard/mouse callouts set by
+ * vnc_fbinitialize(). Client related data left in garbage state.
+ */
}
/****************************************************************************
@@ -336,6 +351,7 @@ int vnc_server(int argc, FAR char *argv[])
ret = vnc_receiver(session);
gvdbg("Session terminated with %d\n", ret);
+ UNUSED(ret);
/* Stop the VNC updater thread. */
diff --git a/graphics/vnc/server/vnc_server.h b/graphics/vnc/server/vnc_server.h
index 077bc0d6b44..45d34b52600 100644
--- a/graphics/vnc/server/vnc_server.h
+++ b/graphics/vnc/server/vnc_server.h
@@ -246,14 +246,15 @@ struct vnc_session_s
struct socket connect; /* Connected socket */
volatile uint8_t state; /* See enum vnc_server_e */
volatile uint8_t nwhupd; /* Number of whole screen updates queued */
+ volatile bool change; /* True: Frambebuffer data change since last whole screen update */
/* Display geometry and color characteristics */
uint8_t display; /* Display number (for debug) */
volatile uint8_t colorfmt; /* Remote color format (See include/nuttx/fb.h) */
volatile uint8_t bpp; /* Remote bits per pixel */
- volatile bool bigendian; /* Remote expect data in big-endian format */
- volatile bool rre; /* Remote supports RRE encoding */
+ volatile bool bigendian; /* True: Remote expect data in big-endian format */
+ volatile bool rre; /* True: Remote supports RRE encoding */
FAR uint8_t *fb; /* Allocated local frame buffer */
/* VNC client input support */
@@ -450,6 +451,7 @@ int vnc_stop_updater(FAR struct vnc_session_s *session);
* Input Parameters:
* session - An instance of the session structure.
* rect - The rectanglular region to be updated.
+ * change - True: Frame buffer data has changed
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned on
@@ -458,7 +460,8 @@ int vnc_stop_updater(FAR struct vnc_session_s *session);
****************************************************************************/
int vnc_update_rectangle(FAR struct vnc_session_s *session,
- FAR const struct nxgl_rect_s *rect);
+ FAR const struct nxgl_rect_s *rect,
+ bool change);
/****************************************************************************
* Name: vnc_receiver
diff --git a/graphics/vnc/server/vnc_updater.c b/graphics/vnc/server/vnc_updater.c
index eb76c990643..e1db02f0404 100644
--- a/graphics/vnc/server/vnc_updater.c
+++ b/graphics/vnc/server/vnc_updater.c
@@ -47,6 +47,15 @@
#include
#include
+#if defined(CONFIG_VNCSERVER_DEBUG) && !defined(CONFIG_DEBUG_GRAPHICS)
+# undef CONFIG_DEBUG
+# undef CONFIG_DEBUG_VERBOSE
+# define CONFIG_DEBUG 1
+# define CONFIG_DEBUG_VERBOSE 1
+# define CONFIG_DEBUG_GRAPHICS 1
+#endif
+#include
+
#include
#include "vnc_server.h"
@@ -55,7 +64,8 @@
* Pre-processor Definitions
****************************************************************************/
-#undef VNCSERVER_SEM_DEBUG
+#undef VNCSERVER_SEM_DEBUG /* Define to dump queue/semaphore state */
+#undef VNCSERVER_SEM_DEBUG_SILENT /* Define to dump only suspicious conditions */
/****************************************************************************
* Private Data
@@ -103,8 +113,14 @@ static void vnc_sem_debug(FAR struct vnc_session_s *session,
FAR const char *msg, unsigned int unattached)
{
FAR struct vnc_fbupdate_s *update;
- unsigned int nqueued;
- unsigned int nfree;
+ int nqueued;
+ int nfree;
+ int freesem;
+ int queuesem;
+ int freecount;
+ int queuecount;
+ int freewaiting;
+ int queuewaiting;
while (sem_wait(&g_dbgsem) < 0)
{
@@ -113,19 +129,40 @@ static void vnc_sem_debug(FAR struct vnc_session_s *session,
/* Count structures in the list */
- for (nqueued = 0, update = (FAR struct vnc_fbupdate_s *)session->updqueue.head;
- update != NULL;
- nqueued++, update = update->flink);
+ nqueued = sq_count(&session->updqueue);
+ nfree = sq_count(&session->updfree);
- for (nfree = 0, update = (FAR struct vnc_fbupdate_s *)session->updfree.head;
- update != NULL;
- nfree++, update = update->flink);
+ freesem = session->freesem.semcount;
+ queuesem = session->queuesem.semcount;
- syslog(LOG_INFO, "FREESEM DEBUG: %s\n", msg);
- syslog(LOG_INFO, " freesem: %d\n", session->freesem.semcount);
- syslog(LOG_INFO, " queued: %u\n", nqueued);
- syslog(LOG_INFO, " free: %u\n", nfree);
- syslog(LOG_INFO, " unattached: %u\n", unattached);
+ freecount = freesem > 0 ? freesem : 0;
+ queuecount = queuesem > 0 ? queuesem : 0;
+
+ freewaiting = freesem < 0 ? -freesem : 0;
+ queuewaiting = queuesem < 0 ? -queuesem : 0;
+
+#ifdef VNCSERVER_SEM_DEBUG_SILENT
+ /* This dumps most false alarms in the case where:
+ *
+ * - Updater was waiting on a semaphore (count is -1)
+ * - New update added to the queue (queue count is 1)
+ * - queuesem posted. Wakes up Updater and the count is 0.
+ */
+
+ if ((nqueued + nfree) != (freecount + queuecount))
+#endif
+ {
+ syslog(LOG_INFO, "FREESEM DEBUG: %s\n", msg);
+ syslog(LOG_INFO, " Free list:\n");
+ syslog(LOG_INFO, " semcount: %d\n", freecount);
+ syslog(LOG_INFO, " queued nodes: %u\n", nfree);
+ syslog(LOG_INFO, " waiting: %u\n", freewaiting);
+ syslog(LOG_INFO, " Qeued Updates:\n");
+ syslog(LOG_INFO, " semcount: %d\n", queuecount);
+ syslog(LOG_INFO, " queued nodes: %u\n", nqueued);
+ syslog(LOG_INFO, " waiting: %u\n", queuewaiting);
+ syslog(LOG_INFO, " Unqueued: %u\n", unattached);
+ }
sem_post(&g_dbgsem);
}
@@ -253,6 +290,8 @@ vnc_remove_queue(FAR struct vnc_session_s *session)
/* It is reserved.. go get it */
rect = (FAR struct vnc_fbupdate_s *)sq_remfirst(&session->updqueue);
+
+ vnc_sem_debug(session, "After remove", 0);
DEBUGASSERT(rect != NULL);
/* Check if we just removed the whole screen update from the queue */
@@ -263,7 +302,6 @@ vnc_remove_queue(FAR struct vnc_session_s *session)
updvdbg("Whole screen update: nwhupd=%d\n", session->nwhupd);
}
- vnc_sem_debug(session, "After remove", 0);
sched_unlock();
return rect;
}
@@ -481,6 +519,7 @@ int vnc_stop_updater(FAR struct vnc_session_s *session)
* Input Parameters:
* session - An instance of the session structure.
* rect - The rectanglular region to be updated.
+ * change - True: Frame buffer data has changed
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned on
@@ -489,7 +528,7 @@ int vnc_stop_updater(FAR struct vnc_session_s *session)
****************************************************************************/
int vnc_update_rectangle(FAR struct vnc_session_s *session,
- FAR const struct nxgl_rect_s *rect)
+ FAR const struct nxgl_rect_s *rect, bool change)
{
FAR struct vnc_fbupdate_s *update;
struct nxgl_rect_s intersection;
@@ -497,7 +536,7 @@ int vnc_update_rectangle(FAR struct vnc_session_s *session,
/* Clip rectangle to the screen dimensions */
- nxgl_rectintersect(&intersection, rect, &g_wholescreen);
+ nxgl_rectintersect(&intersection, rect, &g_wholescreen);
/* Make sure that the clipped rectangle has a area */
@@ -510,20 +549,34 @@ int vnc_update_rectangle(FAR struct vnc_session_s *session,
whupd = (memcmp(&intersection, &g_wholescreen,
sizeof(struct nxgl_rect_s)) == 0);
- /* Ignore all updates if there is a queue whole screen update */
+ /* Ignore any client update requests if there have been no changes to
+ * the framebuffer since the last whole screen update.
+ */
sched_lock();
+ if (!change && !session->change)
+ {
+ /* No.. ignore the client update. We have nothing new to report. */
+
+ sched_unlock();
+ return OK;
+ }
+
+ /* Ignore all updates if there is a queued whole screen update */
+
if (session->nwhupd == 0)
{
- /* Is this a new whole screen update */
+ /* No whole screen updates in the queue. Is this a new whole
+ * screen update?
+ */
if (whupd)
{
+ /* Yes.. Discard all of the previously queued updates */
+
FAR struct vnc_fbupdate_s *curr;
FAR struct vnc_fbupdate_s *next;
- /* Yes.. discard all of the previously queued updates */
-
updvdbg("New whole screen update...\n");
curr = (FAR struct vnc_fbupdate_s *)session->updqueue.head;
@@ -536,7 +589,20 @@ int vnc_update_rectangle(FAR struct vnc_session_s *session,
vnc_free_update(session, curr);
}
+ /* One whole screen update will be queued. There have been
+ * no frame buffer data changes since this update was queued.
+ */
+
session->nwhupd = 1;
+ session->change = false;
+ }
+ else
+ {
+ /* We are not updating the whole screen. Remember if this
+ * update (OR a preceding update) was due to a data change.
+ */
+
+ session->change |= change;
}
/* Allocate an update structure... waiting if necessary */
diff --git a/include/nuttx/board.h b/include/nuttx/board.h
index 0d742257e3c..9e0ea70ab80 100644
--- a/include/nuttx/board.h
+++ b/include/nuttx/board.h
@@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/board.h
*
- * Copyright (C) 2015 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,8 @@
* definitions provide the common interface between NuttX and the
* architecture-specific implementation in arch/
*
- * These definitions are retained in the the header file nuttx/include/arch.h
+ * These definitions are retained in the the header file
+ * nuttx/include/arch.h
*
* NOTE: up_ is supposed to stand for microprocessor; the u is like the
* Greek letter micron: µ. So it would be µP which is a common shortening
@@ -680,7 +681,8 @@ xcpt_t board_button_irq(int id, xcpt_t irqhandler);
****************************************************************************/
#ifdef CONFIG_BOARD_CRASHDUMP
-void board_crashdump(uint32_t currentsp, void *tcb, uint8_t *filename,
+void board_crashdump(uintptr_t currentsp, FAR void *tcb,
+ FAR const uint8_t *filename,
int lineno);
#endif
diff --git a/include/nuttx/video/rfb.h b/include/nuttx/video/rfb.h
index a8f68c45eb5..0b1c13821c0 100644
--- a/include/nuttx/video/rfb.h
+++ b/include/nuttx/video/rfb.h
@@ -370,8 +370,8 @@ struct rfb_setpixelformat_s
struct rfb_setencodings_s
{
uint8_t msgtype; /* U8 Message type */
- uint8_t padding[3];
- uint8_t nencodings[4]; /* U32 Number of encodings */
+ uint8_t padding;
+ uint8_t nencodings[2]; /* U16 Number of encodings */
uint8_t encodings[4]; /* S32 Encoding type, size = 4*nencodings */
};
diff --git a/include/nuttx/video/vnc.h b/include/nuttx/video/vnc.h
index a3b9f9e675f..fdb1dfd4a93 100644
--- a/include/nuttx/video/vnc.h
+++ b/include/nuttx/video/vnc.h
@@ -108,6 +108,8 @@ extern "C"
* higher level level callouts can then call nx_kbdin() or nx_mousein() on
* behalf of the VNC server.
*
+ * See also vnc_default_fbinitialize() below.
+ *
* Parameters:
* display - In the case of hardware with multiple displays, this
* specifies the display. Normally this is zero.
@@ -129,6 +131,79 @@ extern "C"
int vnc_fbinitialize(int display, vnc_kbdout_t kbdout,
vnc_mouseout_t mouseout, FAR void *arg);
+/****************************************************************************
+ * Function: vnc_mouse and vnc_kbdout
+ *
+ * Description:
+ * These are the default keyboard/mouse callout functions. They are
+ * simply wrappers around nx_mousein() and nx_kdbout(), respectively. When
+ * configured using vnc_fbinitialize(), the 'arg' must be the correct
+ * NXHANDLE value.
+ *
+ * See also vnc_default_fbinitialize() below.
+ *
+ * Parameters:
+ * See vnc_mouseout_t and vnc_kbdout_t typde definitions above. These
+ * callouts have arguments that match the inputs to nx_kbdin() and
+ * nx_mousein() (if arg is really of type NXHANDLE).
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_NX_KBD
+void vnc_kbdout(FAR void *arg, uint8_t nch, FAR const uint8_t *ch);
+#endif
+
+#ifdef CONFIG_NX_XYINPUT
+void vnc_mouseout(FAR void *arg, nxgl_coord_t x, nxgl_coord_t y,
+ uint8_t buttons);
+#endif
+
+/****************************************************************************
+ * Function: vnc_default_fbinitialize
+ *
+ * Description:
+ * This is just a wrapper around vnc_fbinitialize() that will establish
+ * the default mouse and keyboard callout functions.
+ *
+ * Parameters:
+ * display - In the case of hardware with multiple displays, this
+ * specifies the display. Normally this is zero.
+ * handle - And instance of NXHANDLE returned from initialization of the
+ * NX graphics system for that display.
+ *
+ * Returned Value:
+ * Zero (OK) is returned on success. Otherwise, a negated errno value is
+ * returned to indicate the nature of the failure.
+ *
+ ****************************************************************************/
+
+/* int vnc_default_fbinitialize(int display, NXHANDLE handle); */
+
+#if defined(CONFIG_NX_KBD) && defined(CONFIG_NX_XYINPUT)
+
+#define vnc_default_fbinitialize(d,h) \
+ vnc_fbinitialize((d), vnc_kbdout, vnc_mouseout, (FAR void *)(h))
+
+#elif defined(CONFIG_NX_KBD)
+
+#define vnc_default_fbinitialize(d,h) \
+ vnc_fbinitialize((d), vnc_kbdout, NULL, (FAR void *)(h))
+
+#elif defined(CONFIG_NX_XYINPUT)
+
+#define vnc_default_fbinitialize(d,h) \
+ vnc_fbinitialize((d), NULL, vnc_mouseout, (FAR void *)(h))
+
+#else
+
+#define vnc_default_fbinitialize(d,h) \
+ vnc_fbinitialize((d), NULL, NULL, NULL)
+
+#endif
+
#undef EXTERN
#ifdef __cplusplus
}
diff --git a/include/queue.h b/include/queue.h
index e18d9f0b7f7..d0953ed8484 100644
--- a/include/queue.h
+++ b/include/queue.h
@@ -135,6 +135,8 @@ extern "C"
#define EXTERN extern
#endif
+/* Add nodes to queues */
+
void sq_addfirst(FAR sq_entry_t *node, FAR sq_queue_t *queue);
void dq_addfirst(FAR dq_entry_t *node, FAR dq_queue_t *queue);
void sq_addlast(FAR sq_entry_t *node, FAR sq_queue_t *queue);
@@ -146,9 +148,13 @@ void dq_addafter(FAR dq_entry_t *prev, FAR dq_entry_t *node,
void dq_addbefore(FAR dq_entry_t *next, FAR dq_entry_t *node,
FAR dq_queue_t *queue);
+/* Combine queues */
+
void sq_cat(FAR sq_queue_t *queue1, FAR sq_queue_t *queue2);
void dq_cat(FAR dq_queue_t *queue1, FAR dq_queue_t *queue2);
+/* Remove nodes from queues */
+
FAR sq_entry_t *sq_remafter(FAR sq_entry_t *node, FAR sq_queue_t *queue);
void sq_rem(FAR sq_entry_t *node, FAR sq_queue_t *queue);
void dq_rem(FAR dq_entry_t *node, FAR dq_queue_t *queue);
@@ -157,6 +163,11 @@ FAR dq_entry_t *dq_remlast(FAR dq_queue_t *queue);
FAR sq_entry_t *sq_remfirst(FAR sq_queue_t *queue);
FAR dq_entry_t *dq_remfirst(FAR dq_queue_t *queue);
+/* Count nodes in queues */
+
+size_t sq_count(FAR sq_queue_t *queue);
+size_t dq_count(FAR dq_queue_t *queue);
+
#undef EXTERN
#ifdef __cplusplus
}
diff --git a/libc/queue/Make.defs b/libc/queue/Make.defs
index adc10fd2c58..6b85ffd8a2f 100644
--- a/libc/queue/Make.defs
+++ b/libc/queue/Make.defs
@@ -36,9 +36,9 @@
# Add the queue C files to the build
CSRCS += sq_addlast.c sq_addfirst.c sq_addafter.c sq_cat.c
-CSRCS += sq_rem.c sq_remlast.c sq_remfirst.c sq_remafter.c
+CSRCS += sq_rem.c sq_remlast.c sq_remfirst.c sq_remafter.c sq_count.c
CSRCS += dq_addlast.c dq_addfirst.c dq_addafter.c dq_addbefore.c dq_cat.c
-CSRCS += dq_rem.c dq_remlast.c dq_remfirst.c
+CSRCS += dq_rem.c dq_remlast.c dq_remfirst.c dq_count.c
# Add the queue directory to the build
diff --git a/libc/queue/dq_count.c b/libc/queue/dq_count.c
new file mode 100644
index 00000000000..c62924a3605
--- /dev/null
+++ b/libc/queue/dq_count.c
@@ -0,0 +1,69 @@
+/****************************************************************************
+ * libc/queue/dq_count.c
+ *
+ * Copyright (C) 2016 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt
+ *
+ * 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
+
+#include
+#include
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: dq_count
+ *
+ * Description:
+ * Return the number of nodes in the queue.
+ *
+ ****************************************************************************/
+
+size_t dq_count(FAR dq_queue_t *queue)
+{
+ FAR dq_entry_t *node;
+ size_t count;
+
+ DEBUGASSERT(queue != NULL);
+
+ for (node = queue->head, count = 0;
+ node != NULL;
+ node = node->flink, count++);
+
+ return count;
+}
diff --git a/libc/queue/sq_count.c b/libc/queue/sq_count.c
new file mode 100644
index 00000000000..7f7bb155c47
--- /dev/null
+++ b/libc/queue/sq_count.c
@@ -0,0 +1,69 @@
+/****************************************************************************
+ * libc/queue/sq_count.c
+ *
+ * Copyright (C) 2016 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt
+ *
+ * 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
+
+#include
+#include
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: sq_count
+ *
+ * Description:
+ * Return the number of nodes in the queue.
+ *
+ ****************************************************************************/
+
+size_t sq_count(FAR sq_queue_t *queue)
+{
+ FAR sq_entry_t *node;
+ size_t count;
+
+ DEBUGASSERT(queue != NULL);
+
+ for (node = queue->head, count = 0;
+ node != NULL;
+ node = node->flink, count++);
+
+ return count;
+}