STM32F750N8H6 with USB (MSC HOST) RTOS not working

I am using stm32f750n8h6 with USB as a msc host so i have tried with f4 series and its working fine without rtos but when f7 series with rtos its stucked with LUN after this not working so i don’t know wha exactly the problem so please help me to resolve this problem.
thank you.

Can you break the code in the debugger and see what it is doing when it appears stuck? Also, have you defined configASSERT and enabled stack overflow checking as described here - FreeRTOS - Open Source RTOS Kernel for small embedded systems?

Hello,
Thanks for the reply, yes i tried to debug it and its stuck in logical unit number switch case like after printing LUN it gets stuck in usbh_msc.c file

and control not enter to inquiry vendor it gives me USBH_BUSY error
so i am new to this stm32 stuff and for the past week i am facing this issue please help me to resolve this.
thank you.

Sorry i didn’t define any configASSERT and not enabling stack overflow.

I’d strongly recommend to define configASSERT and enable stack overflow checking. Next, to narrow down, can you disable USB and see if the code works without that.

Hello Gaurav,
Thanks for the reply,

Disable the USB means i didn’t get like how can disable the USB device.??

The code that you shared, seems to be handling some USB related stuff. You must be initializing USB somewhere in code? I just meant to comment that out.

Yes, in main.c while generating code itself with calling MX_USB_HOST_Init();
Screenshot 2022-11-05 090922
is that need to comment.??
if so it will not call any
static void USBH_UserProcess (USBH_HandleTypeDef *phost, uint8_t id);
in usb_host.c
so i am little bit confused.
thank you.

Yes.

This is just to confirm that the problem is with the USB part.

Yes, i have tried by commenting the usb initialization then nothing is printed it’s fully blanked. so what should i do know.??

Do you print anything in your task? If your task definition is StartDefaultTask as you shared above, there is no print statement there. Does the printing work without FreeRTOS?

Have you done the following that I asked before -

  1. Break the code in debugger?
  2. Define configASSERT.
  3. Enable stack overflow checking.

i have done 1 & 3 but i didn’t find any configASSERT in the configuration setting .
so please tell me that how we can define configASSERT.

Yes, i didn’t print anything in the default task . i will print something and let me the status.
thank you.

i went on the link and in freertosconfig.h file i defined like this because already
//header file. */
//#define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); for( ;; );}

was defined since i comment this and define as
#define configASSERT ( x ) if( ( x ) == 0 ) vAssertCalled( FILE, LINE )
but it gives me error like this

Have you defined vAssertCalled function? If not, use the following definition -

#define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); for( ;; );}

As you can see y default
#define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); for( ;; );}
defined so i think no need to define it.

Great.

Let us know whatever you find.