I have a target application using the STM32F405. On this board I have a USB port. To get started, I found some sample code written by someone for the STM32F4 Discovery board with a few lines of code for main, and the USB libraries (ub_lib) The project was written in Coocox OS.
I took this project, made a few changes for pin assignments, loaded it in Coocox and I was able to open a file on the USB, write data, close it with no problems on my target application board.
Now I want to use thiese same libraries on my program environment (Atollic TS) which is for all intents and purposes, almost the same as Coocox. I also have FreeRTOS running. So I planted the USB and FAT fs driver directories in, and in main.c, way before the scheduler starts, I put in the same 15 lines of code as the example file has.
Well, nothing could be easier, but nothing could be more difficult to figure out. The USB OTG seems to initialize OK, but it will not actually detect the USB device - it keeps returning “USB_MSC_DEV_DETACHED”, as if for some reason it doesn’t see it. But, this is only on my programming environment, and Coocox (as said) works fine on my same board.
I’ve verified system files such as clocks are all matching. It comes down to interrupts, and this is where I’m a t a loss to understand, and perhaps where the problem is. Does (would) FreeRTOS have anything to do with the way the interrupt handlers are set for the USB OTG? Where could I start looking to establish where the problem might be?
Has anyone else worked with USB OTG on this platform using FreeRTOS and expereinced this? Thanks for any suggestions or help.