Skip to main content
ABhat.7
Associate III
April 22, 2021
Question

stm32cube f1 master usb host msc not working

  • April 22, 2021
  • 3 replies
  • 1582 views

i try to implement stm32f10c example on a custom board with stm32f107 as my controller but it causing the controller to always goes in to hard fault please suggest what to do

This topic has been closed for replies.

3 replies

Technical Moderator
April 22, 2021

Hello @ABhat.7​ ,

Which Cube package version are you using ? Make sure that you are using the version V1.8.1 (that contains USB update) or upper.

Have you made any changes on the provided example?

Check the heap and stack sizes defined in the startup.s (should be increased).

Please mark my answer as best by clicking on the "Select as Best" button if it helped.

If you still need help, feel free to ask your question in more detail.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".Thanks Imen
ABhat.7
ABhat.7Author
Associate III
April 22, 2021

please find my attached .ioc file , i am using v4.3 of cube mx and also increase the stack and heap size accordingly but cannot understand that every time is debug the code i found my application state as start even though i have connected the usb as per hardware point of view i have connected a resistor divider across v bus so that supply is less than 5v please suggest what i am doing wrong

Tesla DeLorean
Guru
April 22, 2021

Use an effective Hard Fault Handler and debug the situation..

Stack or Heap size issues?

In any case you're going to have to get a lot more into the details to understand why it is not working.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
ABhat.7
ABhat.7Author
Associate III
April 22, 2021

i have already does it but it causing the same situation so i decide to create my own project in cubemx and after increasing heap and stack size also my appli state is always application start which i noticed during debug please suggest what i am doing wrong.

Technical Moderator
April 27, 2021

Hi @ABhat.7​ ,

Sorry for the delay to answer you, as I'm working from home and I haven't the STM32F107 board at home.

But, after checking your ioc file, there are some warnings to configure USB parameters in the Platform Settings Tab.

When running your project, I get several errors and warnings.

0693W00000AMcw2QAD.jpg 

I recommend you to use the CubeF1 version V1.8.1 or upper (as contains USB update and enhancements) and refer to the USB MSC example with STM32CubeF1 MCU package:

STM32Cube_FW_F1_V1.x.x\Projects\STM3210C_EVAL\Applications\USB_Host\MSC_Standalone

You can use the example code provided and compare the code/functions with yours. 

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".Thanks Imen
ABhat.7
ABhat.7Author
Associate III
May 8, 2021

hi @Imen DAHMEN​ I have to implement USB MSc with stm32f107 but today I notice that if I am using a pen drive of 16 GB and above it not log the file during debug i notice my appli state is start i similar do not understand why it happened as I have increase heap and stack size.