cancel
Showing results for 
Search instead for 
Did you mean: 

NUCLEO-F746ZG USB device MSC example going into HardFault Exception.

SIBIN THOMAS
Associate II

Hello Everyone,

I am using NUCLEO-F746ZG having STM32F746ZG mcu. I was trying the USB device - MSC_Standalone example provided with stm32cubef7. I am using SW4STM32 to compile the example code. The device detects the SD card but when i connect it to the PC via micro USB, device code gets stuck in HardFault exception handler and mass storage is not created on the SD card. Any suggestion would be helpful.

Thanks.

1 REPLY 1

Make sure the stack is sufficiently large, and there is a heap if malloc() is used.

NULL check pointers, and enable asserts.

Use a proper Hard Fault Handler so you can isolate the instructions/registers causing the fault.

Instrument the USB and SDMMC stacks to output telemetry via USART/SWV so you can trace functionality and interaction without the debug breaking real-time constraints.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..