Relative Content

Tag Archive for embeddedusbstm32microcontrollerhal

USB in STM32 microcontroller – HAL_PCD_EP_Receive does not write the data into buffer

I’m developing an STM32-based USB device. It has to receive some data via bulk endpoint 2. So I’m calling HAL_PCD_EP_Receive function, giving it pointer to a buffer (audio_data), then sending the data from the host.
Then the DataOutStage callback is fired, it knows that it has received 16 bytes of data (it is not specified anywhere in the device code), but the data itself is not in the buffer I’ve provided – the buffer contains only zeros.