HardFault in USB_WritePacket()

Is it the same issue as this one - HardFault after receiver task read some mails

Have you tried the things that I suggested there?