cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with USB Host MSC FatFS with FreeRTOS on a Nucleo-H745

Sven1
Associate II

Hello,

I want to use USB-Host MSC with FreeRTOS on a STM32H745.

When I generate a project in CubeIDE (with integrated CubeMX) without FreeRTOS and add the few need lines (like the example from ControllersTech on YouTube) it works fine on a Nucleo-H745.

When I try it with FreeRTOS and change the needed details to work within a task there occure some problems.

For the first, in this case the USBH_UserProcess defined in USBH_Init is never called.

After changing the #define USBH_PROCESS_STACK_SIZE in usbh_conf.h to a value of 1024 it is a little bit better.

By default CubeIDE_MX sets this value to „0“ – it can’t be changed in CubeIDE_MX => Why??

After this USB seems to work in general:

I can mount an USB-Stick and f_getfree is also working.

But if the function f_stat is called the result is a HardFault.

I now, that in CubeMX there is a example for the 745-Evaluation-Board. I can’t test it cause I don't have the board.

Taking out the details of this example and transfer them to my project ist not easy, cause the CubeMX-Exmaples are build up in a complete different way – without .ioc-File. (… which by the way I think is a very bad idea in genreal !! ..)

Within an older project in AtollicTrueStudio with a H743-Nucleo-Board USB-MSC also works fine with FreeRTOS. But also from this example I cannot take the details over to my project in a way that i works.

So my question:

What shall I do, to get it run – within CubeIDE_MX and/or outside?

Does anyone has an example-project generated with CubeMX which works?

I need to use it in CubeMX cause this later will be part of a much bigger projekt where CubeMX is necessary for a lot of periheral-inits.

Thank you for your replies

P.S.:

Stack and Heap are on 0x2000 each, Vbus is on (green LED lights up) – as I said, without FreeRTOS it works fine…

1 REPLY 1
DK.7
Senior

Hi, did you find a solution?

I asking because I facing the same problem!

Except only I did not change the size of "USBH_PROCESS_STACK_SIZE".

PS - Everything works great on the version of CubeIDE V1.8.0 and same code doesn't work in CubeIDE 1.11.2