diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-10-18 17:14:58 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-10-18 17:14:58 -0600 |
commit | 95621702e8ce219b6c53edc5bc2e444ce6694cad (patch) | |
tree | 7bd36a2ac7dd665561bb190361a565067dc57683 | |
parent | a500d703dcd27675581b173ae43ff5c3dfa8d4de (diff) | |
download | px4-nuttx-95621702e8ce219b6c53edc5bc2e444ce6694cad.tar.gz px4-nuttx-95621702e8ce219b6c53edc5bc2e444ce6694cad.tar.bz2 px4-nuttx-95621702e8ce219b6c53edc5bc2e444ce6694cad.zip |
Updated Spark/cc3000 files from David Sidrane
-rw-r--r-- | nuttx/ChangeLog | 1 | ||||
-rw-r--r-- | nuttx/configs/spark/nsh/defconfig | 108 | ||||
-rw-r--r-- | nuttx/configs/spark/src/up_nsh.c | 4 | ||||
-rw-r--r-- | nuttx/configs/spark/src/up_wireless.c | 8 | ||||
-rw-r--r-- | nuttx/drivers/wireless/cc3000/spi.c | 6 | ||||
-rw-r--r-- | nuttx/drivers/wireless/cc3000/spi.h | 3 | ||||
-rw-r--r-- | nuttx/drivers/wireless/cc3000/wlan.c | 6 | ||||
-rw-r--r-- | nuttx/include/nuttx/wireless/cc3000.h | 2 | ||||
-rw-r--r-- | nuttx/include/nuttx/wireless/cc3000/include/cc3000_upif.h | 4 |
9 files changed, 80 insertions, 62 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index c21281fe2..8b0c3885a 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -5815,4 +5815,5 @@ * arch/arm/src/sama5/chip/sam_rtc.c and sam_rtc.h: Basic RTC driver. Support for RTC alarms is fragmentary and this has not yet been hooked into the build system (2013-10-18). + * Various Spark and CC3000 files: Update by David Sidrane (2013-10-18). diff --git a/nuttx/configs/spark/nsh/defconfig b/nuttx/configs/spark/nsh/defconfig index 28fb705d8..63e076bdd 100644 --- a/nuttx/configs/spark/nsh/defconfig +++ b/nuttx/configs/spark/nsh/defconfig @@ -23,9 +23,9 @@ CONFIG_HOST_LINUX=y # Binary Output Formats # # CONFIG_RRLOAD_BINARY is not set -# CONFIG_INTELHEX_BINARY is not set +CONFIG_INTELHEX_BINARY=y # CONFIG_MOTOROLA_SREC is not set -CONFIG_RAW_BINARY=y +# CONFIG_RAW_BINARY is not set # # Customize Header Files @@ -189,7 +189,7 @@ CONFIG_STM32_MEDIUMDENSITY=y # CONFIG_STM32_STM32F20XX is not set # CONFIG_STM32_STM32F30XX is not set # CONFIG_STM32_STM32F40XX is not set -CONFIG_STM32_DFU=y +# CONFIG_STM32_DFU is not set # # STM32 Peripheral Support @@ -226,13 +226,12 @@ CONFIG_STM32_USART2=y CONFIG_STM32_USB=y # CONFIG_STM32_IWDG is not set # CONFIG_STM32_WWDG is not set -# CONFIG_STM32_I2C is not set +CONFIG_STM32_SPI=y # # Alternate Pin Mapping # -# CONFIG_STM32_I2C1_REMAP is not set -# CONFIG_STM32_USART1_REMAP is not set +# CONFIG_STM32_USART2_REMAP is not set # CONFIG_STM32_JTAG_DISABLE is not set CONFIG_STM32_JTAG_FULL_ENABLE=y # CONFIG_STM32_JTAG_NOJNTRST_ENABLE is not set @@ -245,18 +244,15 @@ CONFIG_STM32_USART=y # # U[S]ART Configuration # -# CONFIG_USART1_RS485 is not set +# CONFIG_USART2_RS485 is not set # CONFIG_SERIAL_DISABLE_REORDERING is not set # CONFIG_STM32_USART_SINGLEWIRE is not set # -# I2C Configuration +# SPI Configuration # -# CONFIG_STM32_I2C_DYNTIMEO is not set -# CONFIG_STM32_I2CTIMEOSEC is not set -# CONFIG_STM32_I2CTIMEOMS is not set -# CONFIG_STM32_I2CTIMEOTICKS is not set -# CONFIG_STM32_I2C_DUTY16_9 is not set +# CONFIG_STM32_SPI_INTERRUPTS is not set +# CONFIG_STM32_SPI_DMA is not set # # USB Host Configuration @@ -308,6 +304,7 @@ CONFIG_RAM_SIZE=20480 # # Board Selection # +# CONFIG_ARCH_BOARD_MAPLE is not set CONFIG_ARCH_BOARD_SPARK=y # CONFIG_ARCH_BOARD_CUSTOM is not set CONFIG_ARCH_BOARD="spark" @@ -321,17 +318,16 @@ CONFIG_ARCH_HAVE_BUTTONS=y CONFIG_ARCH_BUTTONS=y CONFIG_ARCH_HAVE_IRQBUTTONS=y CONFIG_ARCH_IRQBUTTONS=y +CONFIG_NSH_MMCSDMINOR=0 # # Board-Specific Options # CONFIG_SPARK_FLASH=y CONFIG_SPARK_FLASH_SPI=2 - CONFIG_SPARK_FLASH_MINOR=0 CONFIG_SPARK_FLASH_PART=y CONFIG_SPARK_FLASH_PART_LIST="256,768" -CONFIG_SPARK_FLASH_MOUNT_POINT="/mnt/p%d" # # RTOS Features @@ -366,6 +362,7 @@ CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 +CONFIG_SIG_SIGWORK=17 # # Sizes of configurable things (0 disables) @@ -385,10 +382,10 @@ CONFIG_PREALLOC_TIMERS=4 # # Stack and heap information # -CONFIG_IDLETHREAD_STACKSIZE=1024 -CONFIG_USERMAIN_STACKSIZE=2048 +CONFIG_IDLETHREAD_STACKSIZE=512 +CONFIG_USERMAIN_STACKSIZE=1024 CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=1024 +CONFIG_PTHREAD_STACK_DEFAULT=512 # # Device Drivers @@ -401,45 +398,56 @@ CONFIG_DEV_NULL=y # CONFIG_CAN is not set # CONFIG_PWM is not set # CONFIG_I2C is not set -# CONFIG_I2C_SLAVE is not set -# CONFIG_I2C_TRANSFER is not set -# CONFIG_I2C_WRITEREAD is not set -# CONFIG_I2C_POLLED is not set -# CONFIG_I2C_TRACE is not set -# CONFIG_ARCH_HAVE_I2CRESET is not set -# CONFIG_I2C_RESET is not set +CONFIG_ARCH_HAVE_I2CRESET=y CONFIG_SPI=y +# CONFIG_SPI_OWNBUS is not set +CONFIG_SPI_EXCHANGE=y +# CONFIG_SPI_CMDDATA is not set +# CONFIG_SPI_BITBANG is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set CONFIG_ANALOG=y +# CONFIG_ADC is not set +# CONFIG_DAC is not set # CONFIG_AUDIO_DEVICES is not set # CONFIG_BCH is not set # CONFIG_INPUT is not set # CONFIG_LCD is not set # CONFIG_MMCSD is not set +CONFIG_MTD=y # # MTD Configuration # -CONFIG_MTD=y CONFIG_MTD_PARTITION=y CONFIG_MTD_BYTE_WRITE=y # # MTD Device Drivers # +# CONFIG_RAMMTD is not set +# CONFIG_MTD_AT24XX is not set +# CONFIG_MTD_AT25 is not set +# CONFIG_MTD_AT45DB is not set +# CONFIG_MTD_M25P is not set +# CONFIG_MTD_SMART is not set +# CONFIG_MTD_RAMTRON is not set CONFIG_MTD_SST25=y CONFIG_SST25_SPIMODE=1 CONFIG_SST25_SPIFREQUENCY=20000000 -CONFIG_SST25_SECTOR512=n - - +# CONFIG_SST25_READONLY is not set +# CONFIG_SST25_SECTOR512 is not set +CONFIG_SST25_SLOWWRITE=y +# CONFIG_SST25_SLOWREAD is not set +# CONFIG_MTD_SST39FV is not set +# CONFIG_MTD_W25 is not set # CONFIG_PIPES is not set # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set CONFIG_SERIAL=y # CONFIG_DEV_LOWCONSOLE is not set +CONFIG_SERIAL_REMOVABLE=y # CONFIG_16550_UART is not set CONFIG_ARCH_HAVE_USART2=y @@ -450,11 +458,10 @@ CONFIG_USART2_ISUART=y CONFIG_MCU_SERIAL=y CONFIG_STANDARD_SERIAL=y CONFIG_USART2_SERIAL_CONSOLE=y - # CONFIG_NO_SERIAL_CONSOLE is not set # -# USART1 Configuration +# USART2 Configuration # CONFIG_USART2_RXBUFSIZE=256 CONFIG_USART2_TXBUFSIZE=256 @@ -462,8 +469,8 @@ CONFIG_USART2_BAUD=115200 CONFIG_USART2_BITS=8 CONFIG_USART2_PARITY=0 CONFIG_USART2_2STOP=0 -# CONFIG_USART1_IFLOWCONTROL is not set -# CONFIG_USART1_OFLOWCONTROL is not set +# CONFIG_USART2_IFLOWCONTROL is not set +# CONFIG_USART2_OFLOWCONTROL is not set # CONFIG_SERIAL_IFLOWCONTROL is not set # CONFIG_SERIAL_OFLOWCONTROL is not set CONFIG_USBDEV=y @@ -496,7 +503,7 @@ CONFIG_COMPOSITE_CONFIGSTR="NuttX COMPOSITE config" CONFIG_COMPOSITE_VERSIONNO=0x1010 # CONFIG_PL2303 is not set CONFIG_CDCACM=y -CONFIG_CDCACM_CONSOLE=n +# CONFIG_CDCACM_CONSOLE is not set CONFIG_CDCACM_COMPOSITE=y CONFIG_CDCACM_IFNOBASE=0 CONFIG_CDCACM_STRBASE=0 @@ -540,7 +547,11 @@ CONFIG_USBMSC_VERSIONNO=0x399 CONFIG_WIRELESS=y # CONFIG_WL_CC1101 is not set CONFIG_WL_CC3000=y -# CONFIG_WL_CC3000_DUMMY is not set +# CONFIG_CC3000_MULTIPLE is not set +CONFIG_CC3000_SPIDEV=2 +CONFIG_CC3000_DEVMINOR=0 +CONFIG_CC3000_SPI_MODE=0 +CONFIG_CC3000_SPI_FREQUENCY=16000000 # CONFIG_WL_NRF24L01 is not set # @@ -571,7 +582,7 @@ CONFIG_FAT_LCNAMES=y CONFIG_FAT_LFN=y CONFIG_FAT_MAXFNAME=32 CONFIG_FS_FATTIME=y - +# CONFIG_FAT_DMAMEMORY is not set # CONFIG_FS_NXFFS is not set # CONFIG_FS_ROMFS is not set # CONFIG_FS_SMARTFS is not set @@ -644,7 +655,12 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # # Non-standard Library Support # -# CONFIG_SCHED_WORKQUEUE is not set +CONFIG_SCHED_WORKQUEUE=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_WORKPRIORITY=192 +CONFIG_SCHED_WORKPERIOD=50000 +CONFIG_SCHED_WORKSTACKSIZE=2048 +# CONFIG_SCHED_LPWORK is not set # CONFIG_LIB_KBDCODEC is not set # CONFIG_LIB_SLCDCODEC is not set @@ -668,6 +684,7 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CAN is not set +CONFIG_EXAMPLES_CC3000BASIC=y # CONFIG_EXAMPLES_DHCPD is not set # CONFIG_EXAMPLES_ELF is not set # CONFIG_EXAMPLES_FTPC is not set @@ -682,6 +699,7 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # CONFIG_EXAMPLES_MM is not set # CONFIG_EXAMPLES_MODBUS is not set # CONFIG_EXAMPLES_MOUNT is not set +# CONFIG_EXAMPLES_MTDPART is not set # CONFIG_EXAMPLES_NRF24L01TERM is not set CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_NULL is not set @@ -762,11 +780,13 @@ CONFIG_NSH_BUILTIN_APPS=y # # Disable Individual commands # +# CONFIG_NSH_DISABLE_ADDROUTE 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_DD is not set +# CONFIG_NSH_DISABLE_DELROUTE is not set # CONFIG_NSH_DISABLE_ECHO is not set # CONFIG_NSH_DISABLE_EXEC is not set # CONFIG_NSH_DISABLE_EXIT is not set @@ -822,7 +842,7 @@ CONFIG_NSH_CONSOLE=y # # CONFIG_NSH_USBDEV_TRACE is not set # CONFIG_NSH_CONDEV is not set -# CONFIG_NSH_ARCHINIT is not set +CONFIG_NSH_ARCHINIT=y # # NxWidgets/NxWM @@ -835,10 +855,12 @@ CONFIG_NSH_CONSOLE=y # # USB CDC/ACM Device Commands # +# CONFIG_SYSTEM_CDCACM is not set # # USB Composite Device Commands # +# CONFIG_SYSTEM_COMPOSITE is not set # # Custom Free Memory Command @@ -848,13 +870,6 @@ CONFIG_NSH_CONSOLE=y # # I2C tool # -# CONFIG_SYSTEM_I2CTOOL is not set -# CONFIG_I2CTOOL_MINBUS is not set -# CONFIG_I2CTOOL_MAXBUS is not set -# CONFIG_I2CTOOL_MINADDR is not set -# CONFIG_I2CTOOL_MAXADDR is not set -# CONFIG_I2CTOOL_MAXREGADDR is not set -# CONFIG_I2CTOOL_DEFFREQ is not set # # FLASH Program Installation @@ -864,6 +879,7 @@ CONFIG_NSH_CONSOLE=y # # FLASH Erase-all Command # +# CONFIG_SYSTEM_FLASH_ERASEALL is not set # # RAM test @@ -895,6 +911,7 @@ CONFIG_READLINE_ECHO=y # Sysinfo # CONFIG_SYSTEM_SYSINFO=y +CONFIG_SYSTEM_SYSINFO_STACKSIZE=1024 # # USB Monitor @@ -908,6 +925,7 @@ CONFIG_SYSTEM_SYSINFO=y # # USB Mass Storage Device Commands # +# CONFIG_SYSTEM_USBMSC is not set # # Zmodem Commands diff --git a/nuttx/configs/spark/src/up_nsh.c b/nuttx/configs/spark/src/up_nsh.c index 449a838ee..67c92465d 100644 --- a/nuttx/configs/spark/src/up_nsh.c +++ b/nuttx/configs/spark/src/up_nsh.c @@ -51,6 +51,7 @@ #ifdef CONFIG_MTD_SST25 # include <nuttx/spi/spi.h> # include <nuttx/mtd.h> +# include <sys/mount.h> #endif #ifdef CONFIG_SYSTEM_USBMONITOR @@ -174,7 +175,7 @@ int nsh_archinitialize(void) mtd = sst25_initialize(spi); if (!mtd) { - message("nsh_archinitialize: Failed to bind SPI port %d to the SPI FLASH driver\n",CONFIG_SPARK_FLASH_SPI);); + message("nsh_archinitialize: Failed to bind SPI port %d to the SPI FLASH driver\n",CONFIG_SPARK_FLASH_SPI); } else { @@ -243,6 +244,7 @@ int nsh_archinitialize(void) partno++; } } +#endif /* CONFIG_SPARK_FLASH_PART */ #endif /* HAVE_SST25 */ diff --git a/nuttx/configs/spark/src/up_wireless.c b/nuttx/configs/spark/src/up_wireless.c index 59c49f019..c620301fd 100644 --- a/nuttx/configs/spark/src/up_wireless.c +++ b/nuttx/configs/spark/src/up_wireless.c @@ -258,8 +258,6 @@ void power_nop(unsigned char en) * configure the wireless device. This function will register the driver * as /dev/wirelessN where N is the minor device number. * - * Input Parameters: - * minor - The input device minor number * * Returned Value: * Zero is returned on success. Otherwise, a negated errno value is @@ -267,14 +265,14 @@ void power_nop(unsigned char en) * ****************************************************************************/ -int up_wlinitialize(int minor) +int wireless_archinitialize(void) { FAR struct spi_dev_s *spi; /* Init SPI bus */ idbg("minor %d\n", minor); - DEBUGASSERT(minor == 0); + DEBUGASSERT(CONFIG_CC3000_DEVMINOR == 0); /* Get an instance of the SPI interface */ @@ -287,7 +285,7 @@ int up_wlinitialize(int minor) /* Initialize and register the SPI CC3000 device */ - int ret = CC3000_register(spi, &g_cc3000_info.dev, CONFIG_CC3000_DEVMINOR); + int ret = cc3000_register(spi, &g_cc3000_info.dev, CONFIG_CC3000_DEVMINOR); if (ret < 0) { idbg("Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV); diff --git a/nuttx/drivers/wireless/cc3000/spi.c b/nuttx/drivers/wireless/cc3000/spi.c index 08734a10a..38d5f413e 100644 --- a/nuttx/drivers/wireless/cc3000/spi.c +++ b/nuttx/drivers/wireless/cc3000/spi.c @@ -195,7 +195,6 @@ static void *unsoliced_thread_func(void *parameter) void SpiOpen(gcSpiHandleRx pfRxHandler) { - pthread_attr_t attr; int status; DEBUGASSERT(spiconf.cc3000fd == 0); @@ -206,10 +205,7 @@ void SpiOpen(gcSpiHandleRx pfRxHandler) spiconf.cc3000fd = fd; spiconf.run = true; - status = pthread_attr_init(&attr); - DEBUGASSERT(status == 0) - - status = pthread_create(&spiconf.unsoliced_thread, &attr, + status = pthread_create(&spiconf.unsoliced_thread,NULL, unsoliced_thread_func, NULL); DEBUGASSERT(status == 0) } diff --git a/nuttx/drivers/wireless/cc3000/spi.h b/nuttx/drivers/wireless/cc3000/spi.h index cf339adab..5b1251765 100644 --- a/nuttx/drivers/wireless/cc3000/spi.h +++ b/nuttx/drivers/wireless/cc3000/spi.h @@ -37,9 +37,6 @@ typedef void (*gcSpiHandleRx)(void *p); * Public Data *****************************************************************************/ -extern uint16_t SPIInterruptsEnabled; -extern uint8_t wlan_tx_buffer[]; - /***************************************************************************** * Public Function Prototypes *****************************************************************************/ diff --git a/nuttx/drivers/wireless/cc3000/wlan.c b/nuttx/drivers/wireless/cc3000/wlan.c index 7b084e0ae..489fb1a95 100644 --- a/nuttx/drivers/wireless/cc3000/wlan.c +++ b/nuttx/drivers/wireless/cc3000/wlan.c @@ -91,6 +91,12 @@ #define WLAN_CONNECT_PARAM_LEN (29) #define WLAN_SMART_CONFIG_START_PARAMS_LEN (4) +/**************************************************************************** + * Private Variables + ****************************************************************************/ + +static uint8_t wlan_tx_buffer[CC3000_TX_BUFFER_SIZE]; + /***************************************************************************** * Public Data *****************************************************************************/ diff --git a/nuttx/include/nuttx/wireless/cc3000.h b/nuttx/include/nuttx/wireless/cc3000.h index 93da43244..d899770ba 100644 --- a/nuttx/include/nuttx/wireless/cc3000.h +++ b/nuttx/include/nuttx/wireless/cc3000.h @@ -149,7 +149,7 @@ EXTERN void CC3000_wlan_init(tWlanCB sWlanCB, * ************************************************************************************/ -void wireless_archinitialize(void); +int wireless_archinitialize(); #undef EXTERN diff --git a/nuttx/include/nuttx/wireless/cc3000/include/cc3000_upif.h b/nuttx/include/nuttx/wireless/cc3000/include/cc3000_upif.h index d987182f2..3341e1a0a 100644 --- a/nuttx/include/nuttx/wireless/cc3000/include/cc3000_upif.h +++ b/nuttx/include/nuttx/wireless/cc3000/include/cc3000_upif.h @@ -161,7 +161,7 @@ extern "C" { #endif /**************************************************************************** - * Name: CC3000_register + * Name: cc3000_register * * Description: * Configure the CC3000 to use the provided SPI device instance. This @@ -179,7 +179,7 @@ extern "C" { * ****************************************************************************/ -int CC3000_register(FAR struct spi_dev_s *spi, +int cc3000_register(FAR struct spi_dev_s *spi, FAR struct cc3000_config_s *config, int minor); #undef EXTERN |