lpc31 ECHI. Early debug changes
This commit is contained in:
parent
04aa1e5384
commit
0a0537ebb7
@ -569,3 +569,43 @@ Configurations
|
||||
nsh:
|
||||
Configures the NuttShell (nsh) located at examples/nsh. The
|
||||
Configuration enables only the serial NSH interface.
|
||||
|
||||
General Configuration. These are easily change by modifying the NuttX
|
||||
configuration:
|
||||
|
||||
- Console on UART -> UART-to-USB converter
|
||||
- Platform: Windows with Cygwin
|
||||
- Toolchain: CodeSourcery for Windows
|
||||
|
||||
NOTES:
|
||||
1. This configuration has been used to test USB host functionaly. USB
|
||||
host is *not* enabled by default. If you will to enable USB host
|
||||
support in the NSH configuration, please modify the NuttX
|
||||
configuration as follows:
|
||||
|
||||
Drivers -> USB Host Driver Support
|
||||
CONFIG_USBHOST=y : General USB host support
|
||||
CONFIG_USBHOST_MSC=y : Mass storage class support
|
||||
CONFIG_USBHOST_INT_DISABLE=y : Not needed
|
||||
CONFIG_USBHOST_ISOC_DISABLE=y : Not needed
|
||||
|
||||
System Type -> Peripherals
|
||||
CONFIG_LPC31_USBOTG=y : Enable the USB OTG peripheral
|
||||
|
||||
System Type -> USB host configuration
|
||||
CONFIG_LPC31_EHCI_BUFSIZE=128
|
||||
CONFIG_LPC31_EHCI_PREALLOCATE=y
|
||||
|
||||
Library Routines
|
||||
CONFIG_SCHED_WORKQUEUE=y : Work queue support is needed
|
||||
|
||||
The USB monitor can also be enabled:
|
||||
|
||||
Drivers -> USB Host Driver Support
|
||||
CONFIG_USBHOST_TRACE=y
|
||||
CONFIG_USBHOST_TRACE_NRECORDS=128
|
||||
CONFIG_USBHOST_TRACE_VERBOSE=y
|
||||
|
||||
Application Configuration -> System Add-Ons
|
||||
CONFIG_SYSTEM_USBMONITOR=y
|
||||
CONFIG_SYSTEM_USBMONITOR_INTERVAL=1
|
||||
|
@ -354,8 +354,9 @@ CONFIG_FS_READABLE=y
|
||||
CONFIG_FS_WRITABLE=y
|
||||
# CONFIG_FS_RAMMAP is not set
|
||||
CONFIG_FS_FAT=y
|
||||
# CONFIG_FAT_LCNAMES is not set
|
||||
# CONFIG_FAT_LFN is not set
|
||||
CONFIG_FAT_LCNAMES=y
|
||||
CONFIG_FAT_LFN=y
|
||||
CONFIG_FAT_MAXFNAME=32
|
||||
# CONFIG_FS_FATTIME is not set
|
||||
# CONFIG_FAT_DMAMEMORY is not set
|
||||
# CONFIG_FS_NXFFS is not set
|
||||
|
@ -107,11 +107,8 @@ void lpc31_boardinitialize(void)
|
||||
* selected.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_SAMA5_UHPHS) || defined(CONFIG_SAMA5_UDPHS)
|
||||
if (lpc31_usbhost_bootinitialize)
|
||||
{
|
||||
lpc31_usbhost_bootinitialize();
|
||||
}
|
||||
#if defined(CONFIG_USBHOST) || defined(CONFIG_LPC31_USBOTG)
|
||||
lpc31_usbhost_bootinitialize();
|
||||
#endif
|
||||
|
||||
/* Configure on-board LEDs in all cases */
|
||||
|
@ -49,8 +49,14 @@
|
||||
# include <nuttx/mmcsd.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYSTEM_USBMONITOR
|
||||
# include <apps/usbmonitor.h>
|
||||
#endif
|
||||
|
||||
#include "lpc31_internal.h"
|
||||
|
||||
#include "lpc_h3131.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
@ -59,7 +65,9 @@
|
||||
|
||||
/* PORT and SLOT number probably depend on the board configuration */
|
||||
|
||||
#define NSH_HAVEMMCSD 1
|
||||
#define HAVE_MMCSD 1
|
||||
#define HAVE_USBHOST 1
|
||||
#define HAVE_USBMONTOR 1
|
||||
|
||||
#if defined(CONFIG_NSH_MMCSDSLOTNO) && CONFIG_NSH_MMCSDSLOTNO != 0
|
||||
# error "Only one MMC/SD slot"
|
||||
@ -74,13 +82,29 @@
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_DISABLE_MOUNTPOINT) || !defined(CONFIG_LPC31_MCI)
|
||||
# undef NSH_HAVEMMCSD
|
||||
# undef HAVE_MMCSD
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_NSH_MMCSDMINOR
|
||||
# define CONFIG_NSH_MMCSDMINOR 0
|
||||
#endif
|
||||
|
||||
/* Can't support USB host features if USB host is not enabled */
|
||||
|
||||
#if !defined(CONFIG_LPC31_USBOTG) || !defined(CONFIG_USBHOST)
|
||||
# undef HAVE_USBHOST
|
||||
#endif
|
||||
|
||||
/* Check if we need to support the USB monitor */
|
||||
|
||||
#ifndef HAVE_USBHOST
|
||||
# undef CONFIG_USBHOST_TRACE
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_SYSTEM_USBMONITOR) || !defined(CONFIG_USBHOST_TRACE)
|
||||
# undef HAVE_USBMONITOR
|
||||
#endif
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
@ -111,10 +135,14 @@
|
||||
|
||||
int nsh_archinitialize(void)
|
||||
{
|
||||
#ifdef NSH_HAVEMMCSD
|
||||
#ifdef HAVE_MMCSD
|
||||
FAR struct sdio_dev_s *sdio;
|
||||
#endif
|
||||
#if defined(HAVE_MMCSD) || defined(HAVE_USBHOST)
|
||||
int ret;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MMCSD
|
||||
/* First, get an instance of the SDIO interface */
|
||||
|
||||
message("nsh_archinitialize: Initializing SDIO slot %d\n",
|
||||
@ -146,5 +174,29 @@ int nsh_archinitialize(void)
|
||||
|
||||
sdio_mediachange(sdio, true);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_USBHOST
|
||||
/* Initialize USB host operation. lpc31_usbhost_initialize() starts a thread
|
||||
* will monitor for USB connection and disconnection events.
|
||||
*/
|
||||
|
||||
ret = lpc31_usbhost_initialize();
|
||||
if (ret != OK)
|
||||
{
|
||||
message("ERROR: Failed to initialize USB host: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_USBMONITOR
|
||||
/* Start the USB Monitor */
|
||||
|
||||
ret = usbmonitor_start(0, NULL);
|
||||
if (ret != OK)
|
||||
{
|
||||
message("nsh_archinitialize: Start USB monitor: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
@ -56,7 +56,7 @@
|
||||
#include "lpc31_internal.h"
|
||||
#include "lpc_h3131.h"
|
||||
|
||||
#if defined(CONFIG_LPC31_USBOTG) || defined(CONFIG_USBHOST)
|
||||
#if defined(CONFIG_LPC31_USBOTG) && defined(CONFIG_USBHOST)
|
||||
|
||||
/************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
@ -70,10 +70,6 @@
|
||||
# define CONFIG_USBHOST_STACKSIZE 1024
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_USBDEV
|
||||
# undef CONFIG_LPC31_USBOTG_RHPORT1
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Private Data
|
||||
************************************************************************************/
|
||||
@ -239,8 +235,9 @@ int lpc31_usbhost_initialize(void)
|
||||
* each platform that implements the OHCI or EHCI host interface
|
||||
*
|
||||
* Input Parameters:
|
||||
* rhport - Selects root hub port to be powered host interface. See SAM_RHPORT_*
|
||||
* definitions above.
|
||||
* rhport - Selects root hub port to be powered host interface. Since the LPC31
|
||||
* has only a downstream port, zero is the only possible value for this
|
||||
* parameter.
|
||||
* enable - true: enable VBUS power; false: disable VBUS power
|
||||
*
|
||||
* Returned Value:
|
||||
|
Loading…
Reference in New Issue
Block a user