AnsweredAssumed Answered

mistake in stm32f3xx_hal_pcd.c

Question asked by ln.thierry on Dec 8, 2015
Latest reply on Dec 10, 2015 by 68516
Hi,

STM32Cube_FW_F3_V1.3.0\Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_pcd.c

In the function below:

static HAL_StatusTypeDef PCD_EP_ISR_Handler(PCD_HandleTypeDef *hpcd)
    ...
line 455:
        /*multi-packet on the NON control OUT endpoint*/
        ep->xfer_count+=count;
        ep->xfer_buff+=count;
       
        if ((ep->xfer_len == 0) || (count < ep->maxpacket))
        {
          /* RX COMPLETE */
          HAL_PCD_DataOutStageCallback(hpcd, ep->num);
        }
        else
        {
          HAL_PCD_EP_Receive(hpcd, ep->num, ep->xfer_buff, ep->xfer_len);
        }
        
        
the condition ((ep->xfer_len == 0) || (count < ep->maxpacket)) is always true because count is always lower than ep->maxpacket. So the HAL_PCD_DataOutStageCallback is always called!
 
This mistake has little consequence, but this requires that the assembly of multi-packets are done at the highest level.



Outcomes