SAMA5 UDPHS: Some very early debug corrections. Not yet working.

This commit is contained in:
Gregory Nutt 2013-09-02 12:26:15 -06:00
parent 742e89783b
commit c162cca9e8
3 changed files with 18 additions and 6 deletions

View File

@ -2862,7 +2862,7 @@ static void sam_epset_reset(struct sam_usbdev_s *priv, uint16_t epset)
/* Reset each endpoint in the set */
for (epno = 0, bit = 1, epset &= SAM_EPSET_ALL;
epno < SAM_UDPHS_NENDPOINTS || epset == 0;
epno < SAM_UDPHS_NENDPOINTS && epset != 0;
epno++, bit <<= 1)
{
/* Is this endpoint in the set? */
@ -3754,7 +3754,7 @@ static void sam_reset(struct sam_usbdev_s *priv)
sam_epset_reset(priv, SAM_EPSET_ALL);
sam_ep_configure_internal(&priv->eplist[EP0], &g_ep0desc);
/* Reset endpoints */
/* Reset endpoint data structures */
for (epno = 0; epno < SAM_UDPHS_NENDPOINTS; epno++)
{
@ -3779,7 +3779,6 @@ static void sam_reset(struct sam_usbdev_s *priv)
/* Re-configure the USB controller in its initial, unconnected state */
sam_reset(priv);
priv->usbdev.speed = USB_SPEED_FULL;
sam_dumpep(priv, EP0);
}
@ -3847,7 +3846,7 @@ static void sam_hw_setup(struct sam_usbdev_s *priv)
/* Initialize DMA channels */
for (i = 1; i < SAM_UDPHS_NDMACHANNELS; i++)
for (i = 1; i <= SAM_UDPHS_NDMACHANNELS; i++)
{
/* Stop any DMA transfer */
@ -3867,9 +3866,9 @@ static void sam_hw_setup(struct sam_usbdev_s *priv)
sam_putreg(regval, SAM_UDPHS_DMACONTROL(i));
}
/* Initialize DMA channels */
/* Initialize Endpoints */
for (i = 1; i < SAM_UDPHS_NENDPOINTS; i++)
for (i = 0; i < SAM_UDPHS_NENDPOINTS; i++)
{
/* Disable endpoint */

View File

@ -1241,6 +1241,15 @@ Configurations
Device Drivers -> USB Device Driver Support
CONFIG_CDCACM=y : Enable the CDC/ACM device
The following setting enables an example that can can be used to
control the CDC/ACM device. It will add two new NSH commands:
(1) sercon will connect the USB serial device (creating /dev/ttyACM0),
and (2) serdis which will disconnect the USB serial device (destroying
/dev/ttyACM0).
Application Configuration -> Examples:
CONFIG_EXAMPLES_CDCACM=y : Enable an CDC/ACM example
STATUS:
2013-7-19: This configuration (as do the others) run at 396MHz.
The SAMA5D3 can run at 536MHz. I still need to figure out the

View File

@ -535,6 +535,7 @@ static struct usbdev_req_s *cdcacm_allocreq(FAR struct usbdev_ep_s *ep,
req = NULL;
}
}
return req;
}
@ -978,6 +979,7 @@ static int cdcacm_bind(FAR struct usbdevclass_driver_s *driver,
ret = -ENODEV;
goto errout;
}
priv->epintin->priv = priv;
/* Pre-allocate the IN bulk endpoint */
@ -989,6 +991,7 @@ static int cdcacm_bind(FAR struct usbdevclass_driver_s *driver,
ret = -ENODEV;
goto errout;
}
priv->epbulkin->priv = priv;
/* Pre-allocate the OUT bulk endpoint */
@ -1000,6 +1003,7 @@ static int cdcacm_bind(FAR struct usbdevclass_driver_s *driver,
ret = -ENODEV;
goto errout;
}
priv->epbulkout->priv = priv;
/* Pre-allocate read requests */