stm32f7/h7/l4 OTG host: Adam porters fix for STM32 FS/HS probably should be applied to STM32 F7, H7, and L4 OTG host which are very similar.

This commit is contained in:
Gregory Nutt 2019-09-08 06:50:47 -06:00
parent 5b4516d291
commit 726ea3c8a9
3 changed files with 12 additions and 3 deletions

View File

@ -2200,6 +2200,7 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx,
size_t xfrlen;
ssize_t xfrd;
int ret;
bool zlp;
/* Loop until the transfer completes (i.e., buflen is decremented to zero)
* or a fatal error occurs (any error other than a simple NAK)
@ -2208,8 +2209,9 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx,
chan = &priv->chan[chidx];
start = clock_systimer();
xfrd = 0;
zlp = (buflen == 0);
while (buflen > 0)
while (buflen > 0 || zlp)
{
/* Transfer one packet at a time. The hardware is capable of queueing
* multiple OUT packets, but I just haven't figured out how to handle
@ -2286,6 +2288,7 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx,
buffer += xfrlen;
buflen -= xfrlen;
xfrd += chan->xfrd;
zlp = false;
}
}

View File

@ -2205,6 +2205,7 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx,
size_t xfrlen;
ssize_t xfrd;
int ret;
bool zlp;
/* Loop until the transfer completes (i.e., buflen is decremented to zero)
* or a fatal error occurs (any error other than a simple NAK)
@ -2213,8 +2214,9 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx,
chan = &priv->chan[chidx];
start = clock_systimer();
xfrd = 0;
zlp = (buflen == 0);
while (buflen > 0)
while (buflen > 0 || zlp)
{
/* Transfer one packet at a time. The hardware is capable of queueing
* multiple OUT packets, but I just haven't figured out how to handle
@ -2291,6 +2293,7 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx,
buffer += xfrlen;
buflen -= xfrlen;
xfrd += chan->xfrd;
zlp = false;
}
}

View File

@ -2205,6 +2205,7 @@ static ssize_t stm32l4_out_transfer(FAR struct stm32l4_usbhost_s *priv,
size_t xfrlen;
ssize_t xfrd;
int ret;
bool zlp;
/* Loop until the transfer completes (i.e., buflen is decremented to zero)
* or a fatal error occurs (any error other than a simple NAK)
@ -2213,8 +2214,9 @@ static ssize_t stm32l4_out_transfer(FAR struct stm32l4_usbhost_s *priv,
chan = &priv->chan[chidx];
start = clock_systimer();
xfrd = 0;
zlp = (buflen == 0);
while (buflen > 0)
while (buflen > 0 || zlp)
{
/* Transfer one packet at a time. The hardware is capable of queueing
* multiple OUT packets, but I just haven't figured out how to handle
@ -2291,6 +2293,7 @@ static ssize_t stm32l4_out_transfer(FAR struct stm32l4_usbhost_s *priv,
buffer += xfrlen;
buflen -= xfrlen;
xfrd += chan->xfrd;
zlp = false;
}
}