The function CDC_Receive_HS() is not meant to be exited until all data is copied from the USB stack.
Is there a way to not do this? I am not using an operating system, so not leaving the function means blocking every way to empty the buffers to copy into!? This makes transferring a firmware via VCP impossible, because there is no way to implement client/device side flow control.
jiang.peng mentioned the same issue in his last post here: "STM32L476 USB CDC VCOM PC cannnot send large amount data to device"