2024-03-30 02:26 AM
Hello Community!
Recently i have started working on USB MSC using RTOS. Im using USB HOST Library version 3.5.2 and latest version of CubeMx.
When im generating the code by selecting FreeRTOS CMSIS V2 and pulging my USB drive to CN13 connector then the Appli_state is always staying at APPLICATION_START state and not not going to APPLICATION_READY state.
but on other hand if im selecting FreeRTOS CMSIS V1 instead of V2 with keeping same configuration then USB Appli_state is changing imidiatly to APPLICATION_READY state when USB is getting connected to CN13 connetor.
Here im using STM32F746 NUCLEO board. if anyone knows what is the issue please reply.
Thank you!
Solved! Go to Solution.
2024-05-20 04:27 AM
I am now able to use USB as MSC Host with CMSIS V2. The only change I did was to increase the stack size for USB task to 1024.
I am using STM32CubeIDE Version: 1.15.1 and STM32CubeMX Version 6.11.1
Thankyou once again for your guidance and support.
2024-04-29 12:29 AM
Hello @JJhin.1
Even I am facing the same issue and I did try a lot but unable to get it working with CMSIS-V2. Either the application goes into Hard Fault or is stuck in infinite loop.
Have you successfully implemented it?
Please guide me accordingly.
Thankyou
2024-04-29 08:44 PM - edited 2024-05-02 12:07 AM
Hi @pitbull
In my case MSC host is working fine with FreeRTOS CMSIS V1 ... but when i trying same configuration for FreeRTOS CMSIS V2 then its Appli_State is not getting changed to READY_STATE.
For your case if its going to hardfault then there will be configuration issue.. if its stucking in some loop then debuge the code and try to find where it is getting stucked.
I'll recommend you to use lasted versions of MSC hoste library which is 3.5.2 but the latest version of CubeMX is using 3.4 version of library.
2024-04-30 12:24 AM
Hello @JJhin.1
Thankyou for your time and consideration.
I am currently using STM32 Cube IDE 1.13.1 with CubeMX 6.9 and one firmware using CMSIS V1 with working USB MSC Host and another firmware with CMSIS V2 where hardfault or infinite FreeRTOS loop occurs either when USB is connected or firmware enters first f_open() function.
Same code for USB and other functionalities is used in both the firmwares.
I am updating the IDE to latest version, I am currently using the USB host library provided at the github link https://github.com/STMicroelectronics/stm32_mw_usb_host which is version 3.5.2 as you mentioned.
Will try with the updated IDE and will keep you posted.
Thankyou once again.
2024-04-30 05:34 AM - edited 2024-05-02 12:16 AM
If your code is going to hardfault after f_open() .... then you have to check your file discriptor pointer .... before opening any file ... you must have to check Apli-state should equal to APLICATION_READY state .. after that only you have to maount the drive ... otherwise fault will generate.
Make shure new downloaded MSC host library should get copied into your device firmware repository.
2024-05-01 09:40 PM
Hello @JJhin.1
Sorry for the late reply I was on a holiday
Thankyou for your suggestions the USB library is working well in CMSIS V1 in the latest IDE and MX version and I am able to use USB as MSC.
Have not tested yet for CMSIS V2 but will surely try for it. Will keep you posted.
Thankyou again for your time and valuable guidance. It sure does help beginners like me.
2024-05-02 12:10 AM
Good to know that .. its working with CMSIS V1 =) try with CMSIS v2 ... plz inform me if it will work with CMSIS v2 or you found any solution for CMSIS v2.
2024-05-06 08:20 AM
Hello @JJhin.1
When you encounter a difference in behavior between different versions of a real-time operating system component, such as FreeRTOS CMSIS V1 versus V2, it can be due to various reasons, including changes in the API, differences in initialization code, or changes in how the middleware interacts with the underlying RTOS.
Here are some steps to troubleshoot the issue:
By systematically going through these steps, you should be able to identify and resolve the issue causing the Appli_state to remain in APPLICATION_START when using FreeRTOS CMSIS V2. If the problem persists, please provide more details on your setting project if possible, attach your .ioc file/configuration.
2024-05-06 09:53 PM
Thanks @nouirakh for replaying ...
i tried this with CubeMx 6.10.0 version 2 months before. i'll check again my code with procedures you you have given.
one thing letme know that, is there any extra settings i have to do for FreeRTOS CMSIS V2 in CubeMx? like you said that i have to check stack size... so how much minimum stack size should be there for CMSIS V2 ?
please check my ioc attached to this massage.
thanks & regards!
2024-05-20 04:27 AM