Skip to main content
Rogers.Gary
Senior II
March 31, 2019
Question

USB and FreeRTOS in STM32L4

  • March 31, 2019
  • 3 replies
  • 824 views

Hope someone that has implemented FreeRTOS with USB can provide advice on what specifically needs to be changed in the USB Host code to allow the USB to operate in the RTOS environment. I have USB functioning on the target board, without FreeRTOS. When I bring in FreeRTOS (using CubeMX), it breaks and does not operate. I have any user code protected in the delimited sections. I also tried in tick/tickless modes.

Why would CubeMX add in FreeRTOS and break the perfectly good USB interface? I guess CubeMX will give you one or the other, not both.

Any suggestions or references would be appreciated, thanks!

This topic has been closed for replies.

3 replies

Rogers.Gary
Senior II
March 31, 2019

Working.

kurta999
Senior
March 31, 2019

I just use a buffer where I copy data received from USB and afterwards process it in an RTOS task, that's all. Reply can be done from task without any problem.

Rogers.Gary
Senior II
March 31, 2019

It just was not working, period. I had to do a few things - set the VBUS pin (PA9), set interrupt priorities, and finally, create the interrupt handler. I did not want Cube to do the USB setup after 3 unsuccessful attempts. Just created it manually and it now functions flawlessly.

Thanks, I understand your answer, but I do not use USB "live" in my application, all my processing starts before the scheduler starts (off-loading PRAM memory) .