Based on STM32 USB program development notes.pdf