cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F0 Audio device HardFault_Handler(); error problem.

MWask.1
Associate II

Hi,

I am currently trying to develop the Audio device on STM32F0 to stream audio data from USB to IS2 signal, although It worked without any issues on STM32F4 discovery board, when I am trying to apply same logic for Nucleo32 It does not seem to work at all. Windows displays the board like so:0693W000003BUJlQAO.png

I will try to describe my problem in more details; after successful compilation, while debugging, program stops on HardFault_Handler(); . Code part that seems to be error cause is in usbd_audio.c file in Middlewares section of the project.

0693W000003BUKAQA4.png

I tried to add more heap memory to solve this issue but changing it in the project does not seem to affect STM32F042K6TX_FLASH.ld and when I change it manually it gives an compilation error.

 0693W000003BUKKQA4.png

0693W000003BUKZQA4.png

The code is generated through STM32CubeMX, I have not done anything to it. Still I will attach them if someone would like to look through it.

Am I on good track? Did anyone had that issue before? Please share your thoughts.

15 REPLIES 15

Part claims to have 6KB of RAM, and you're accessing ~15KB deep into it.

You're buffer can't be 15360 bytes deep.

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

Can't have a 15KB buffer in a 6KB part, reevaluate

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

That's right, this MCU have no enough RAM.

MWask.1
Associate II

Oh thank you all for your time. Problem has been resolved.

Hello @MWask.1​ ,

Please share the way that solved your problem, it may be helpful for other community users.

Then, please select the post of user which is "Best Answer" or mark your post as answered the question,

Best Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

Hi @Imen DAHMEN​ ,

This uC can not be used as Audio device. The reason is not enough RAM as @Community member​  and @prain​  stated. To resolve the problem I switched to different STM32 with enough memory for the task.