AnsweredAssumed Answered

STM32F437 USB DataTx switches to hardfault handler

Question asked by Nys Frédéric on Aug 17, 2017
Latest reply on Aug 22, 2017 by Nys Frédéric

Hello everyone, I am new to the forum.


Currently I am busy working on a project that must use USB communication.

I therefore implemented the USB VCP library for a STM32F437 microcontroller.

I am able to communicate and receive data in USB from a PC. 


Unfortunately, I encounter a problem when I try to send a lot of data continuously. The program switches to hardfault handler after a few seconds of transmission.

I use the VCP_DataTx function.


Uint16_t VCP_DataTx (uint8_t * Buf, uint32_t Len)
Uint32_t i;

Pour (i = 0; i <Len; i ++) {
APP_Rx_Buffer [APP_Rx_ptr_in ++] = * (Buf + i);

/ * Pour éviter le débordement du tampon * /
Si (APP_Rx_ptr_in == APP_RX_DATA_SIZE) {
APP_Rx_ptr_in = 0;

Retour USBD_OK;


I was able to read some posts on different forums concerning a problem coming from the library.

Have you solved this type of problem? Do you have any examples?


Thank you for your reply