Hi,
Anybody has used the RL-USB Host + Flash File System with the Keil RTX operating system? I am able to detect the USB host insertion in a task using:
__task void usb_host (void) { int dummy=0; for(;;){ usbh_engine(); if (usbh_msc_status () == __TRUE) { dummy |=0x01; retv = finit (NULL); // Wait until the MSD is ready if (retv == 1) { dummy |=0x01; } else { dummy |=0x01; } } } }
As soon as the finit function is called I get the the HardFault_Handler(). Looking a the call stack the rt_mut_wait() is the function before the fault happen.
I am using LPC1788 Cortex-M3 processor.
Any idea what is the cause of this problem?
Thanks
Hello
Did you ever find the solution to this problem? I have got the same issue.
Richard
I have managed to get it to work if the USB memory stick is initialised before initialising the OS. To initialise the USB memory stick, I used the MSD_init() function from the MSD_File demo.
If anyone could explain to me why it works when initialised before the OS that would be great!
Thanks,
Because task can start executing after OS initialization and it starts talking to uninitialized USB peripheral what of course is not a proper way to go.
I encountered this issue. The problem is the task stack is large enough by default (200) to handle the USB engine polling function. However, it is not sufficient for initializing the flash file system (and subsequently the MSD class device). Create the task with a user stack of 800 and you should be fine. If memory management is an issue, set an event for a bigger task to perform the initialization function. All the best,
Bryan