This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

RL-USB host + Flash File + Keil RTX LPC1788

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

Parents
  • 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

Reply
  • 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

Children
No data