mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 14:27:37 +08:00
Fix start-up of USB monitor in STM32F3Discovery configuration; Back out back checkin of STM32 F1/F3 USB device driver
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5641 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -76,10 +76,6 @@
|
|||||||
# define CONFIG_USBDEV_EP0_MAXSIZE 64
|
# define CONFIG_USBDEV_EP0_MAXSIZE 64
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_USBDEV_SETUP_MAXDATASIZE
|
|
||||||
# define CONFIG_USBDEV_SETUP_MAXDATASIZE CONFIG_USBDEV_EP0_MAXSIZE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef CONFIG_USB_PRI
|
#ifndef CONFIG_USB_PRI
|
||||||
# define CONFIG_USB_PRI NVIC_SYSH_PRIORITY_DEFAULT
|
# define CONFIG_USB_PRI NVIC_SYSH_PRIORITY_DEFAULT
|
||||||
#endif
|
#endif
|
||||||
@@ -339,6 +335,7 @@ struct stm32_usbdev_s
|
|||||||
|
|
||||||
/* STM32-specific fields */
|
/* STM32-specific fields */
|
||||||
|
|
||||||
|
struct usb_ctrlreq_s ctrl; /* Last EP0 request */
|
||||||
uint8_t ep0state; /* State of EP0 (see enum stm32_ep0state_e) */
|
uint8_t ep0state; /* State of EP0 (see enum stm32_ep0state_e) */
|
||||||
uint8_t rsmstate; /* Resume state (see enum stm32_rsmstate_e) */
|
uint8_t rsmstate; /* Resume state (see enum stm32_rsmstate_e) */
|
||||||
uint8_t nesofs; /* ESOF counter (for resume support) */
|
uint8_t nesofs; /* ESOF counter (for resume support) */
|
||||||
@@ -350,30 +347,6 @@ struct stm32_usbdev_s
|
|||||||
uint16_t txstatus; /* " " " " " " " " */
|
uint16_t txstatus; /* " " " " " " " " */
|
||||||
uint16_t imask; /* Current interrupt mask */
|
uint16_t imask; /* Current interrupt mask */
|
||||||
|
|
||||||
/* E0 SETUP data buffering.
|
|
||||||
*
|
|
||||||
* ctrl:
|
|
||||||
* The 8-byte SETUP request is received on the EP0 OUT endpoint and is
|
|
||||||
* saved.
|
|
||||||
*
|
|
||||||
* ep0data
|
|
||||||
* For OUT SETUP requests, the SETUP data phase must also complete before
|
|
||||||
* the SETUP command can be processed. The pack receipt logic will save
|
|
||||||
* the accompanying EP0 IN data in ep0data[] before the SETUP command is
|
|
||||||
* processed.
|
|
||||||
*
|
|
||||||
* For IN SETUP requests, the DATA phase will occurr AFTER the SETUP
|
|
||||||
* control request is processed. In that case, ep0data[] may be used as
|
|
||||||
* the response buffer.
|
|
||||||
*
|
|
||||||
* ep0datlen
|
|
||||||
* Lenght of OUT DATA received in ep0data[] (Not used with OUT data)
|
|
||||||
*/
|
|
||||||
|
|
||||||
struct usb_ctrlreq_s ctrl; /* Last EP0 request */
|
|
||||||
uint8_t ep0data[CONFIG_USBDEV_SETUP_MAXDATASIZE];
|
|
||||||
uint16_t ep0datlen;
|
|
||||||
|
|
||||||
/* The endpoint list */
|
/* The endpoint list */
|
||||||
|
|
||||||
struct stm32_ep_s eplist[STM32_NENDPOINTS];
|
struct stm32_ep_s eplist[STM32_NENDPOINTS];
|
||||||
|
|||||||
@@ -652,16 +652,6 @@ STM32F3Discovery-specific Configuration Options
|
|||||||
CONFIG_STM32_SPI_DMA - Use DMA to improve SPI transfer performance.
|
CONFIG_STM32_SPI_DMA - Use DMA to improve SPI transfer performance.
|
||||||
Cannot be used with CONFIG_STM32_SPI_INTERRUPT.
|
Cannot be used with CONFIG_STM32_SPI_INTERRUPT.
|
||||||
|
|
||||||
STM32F3Discovery DMA Configuration
|
|
||||||
|
|
||||||
CONFIG_SDIO_DMA - Support DMA data transfers. Requires CONFIG_STM32_SDIO
|
|
||||||
and CONFIG_STM32_DMA2.
|
|
||||||
CONFIG_SDIO_PRI - Select SDIO interrupt prority. Default: 128
|
|
||||||
CONFIG_SDIO_DMAPRIO - Select SDIO DMA interrupt priority.
|
|
||||||
Default: Medium
|
|
||||||
CONFIG_SDIO_WIDTH_D1_ONLY - Select 1-bit transfer mode. Default:
|
|
||||||
4-bit transfer mode.
|
|
||||||
|
|
||||||
Configurations
|
Configurations
|
||||||
==============
|
==============
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "stm32_rcc.h"
|
#include "stm32_rcc.h"
|
||||||
#include "stm32_sdio.h"
|
|
||||||
#include "stm32.h"
|
#include "stm32.h"
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
|
|||||||
@@ -45,19 +45,10 @@
|
|||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#ifdef CONFIG_STM32_SDIO
|
|
||||||
# include <nuttx/sdio.h>
|
|
||||||
# include <nuttx/mmcsd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_SYSTEM_USBMONITOR
|
#ifdef CONFIG_SYSTEM_USBMONITOR
|
||||||
# include <apps/usbmonitor.h>
|
# include <apps/usbmonitor.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_STM32_OTGFS
|
|
||||||
# include "stm32_usbhost.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "stm32.h"
|
#include "stm32.h"
|
||||||
#include "stm32f3discovery-internal.h"
|
#include "stm32f3discovery-internal.h"
|
||||||
|
|
||||||
@@ -68,14 +59,14 @@
|
|||||||
/* Configuration ************************************************************/
|
/* Configuration ************************************************************/
|
||||||
|
|
||||||
#define HAVE_USBDEV 1
|
#define HAVE_USBDEV 1
|
||||||
#define HAVE_USBHOST 1
|
|
||||||
#define HAVE_USBMONITOR 1
|
#define HAVE_USBMONITOR 1
|
||||||
|
|
||||||
/* Can't support USB host or device features if USB OTG FS is not enabled */
|
/* Can't support USB device features if the STM32 USB peripheral is not
|
||||||
|
* enabled.
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef CONFIG_STM32_OTGFS
|
#ifndef CONFIG_STM32_USB
|
||||||
# undef HAVE_USBDEV
|
# undef HAVE_USBDEV
|
||||||
# undef HAVE_USBHOST
|
|
||||||
# undef HAVE_USBMONITOR
|
# undef HAVE_USBMONITOR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -86,12 +77,6 @@
|
|||||||
# undef HAVE_USBMONITOR
|
# undef HAVE_USBMONITOR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Can't support USB host is USB host is not enabled */
|
|
||||||
|
|
||||||
#ifndef CONFIG_USBHOST
|
|
||||||
# undef HAVE_USBHOST
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Check if we should enable the USB monitor before starting NSH */
|
/* Check if we should enable the USB monitor before starting NSH */
|
||||||
|
|
||||||
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_SYSTEM_USBMONITOR)
|
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_SYSTEM_USBMONITOR)
|
||||||
@@ -128,24 +113,9 @@
|
|||||||
|
|
||||||
int nsh_archinitialize(void)
|
int nsh_archinitialize(void)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_USBHOST) || defined(HAVE_USBMONITOR)
|
|
||||||
int ret;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_USBHOST
|
|
||||||
/* Initialize USB host operation. stm32_usbhost_initialize() starts a thread
|
|
||||||
* will monitor for USB connection and disconnection events.
|
|
||||||
*/
|
|
||||||
|
|
||||||
ret = stm32_usbhost_initialize();
|
|
||||||
if (ret != OK)
|
|
||||||
{
|
|
||||||
message("nsh_archinitialize: Failed to initialize USB host: %d\n", ret);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_USBMONITOR
|
#ifdef HAVE_USBMONITOR
|
||||||
|
int ret;
|
||||||
|
|
||||||
/* Start the USB Monitor */
|
/* Start the USB Monitor */
|
||||||
|
|
||||||
ret = usbmonitor_start(0, NULL);
|
ret = usbmonitor_start(0, NULL);
|
||||||
|
|||||||
@@ -48,7 +48,6 @@
|
|||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
#include <nuttx/usb/usbdev.h>
|
#include <nuttx/usb/usbdev.h>
|
||||||
#include <nuttx/usb/usbhost.h>
|
|
||||||
#include <nuttx/usb/usbdev_trace.h>
|
#include <nuttx/usb/usbdev_trace.h>
|
||||||
|
|
||||||
#include "up_arch.h"
|
#include "up_arch.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user