Reinit MQX 3.6.2 USB HOST stack

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Reinit MQX 3.6.2 USB HOST stack

Jump to solution
1,262 Views
admin
Specialist II

Hi!

in a system with MCF52259+MQX+MFS+USB HOST if an error occurs  when installing my usb mass storage I want ro reinit the usb system without reset my hardware. How can I do? 

When my system detecting an usb mass storage if usb_filesystem_install fails I want to reinit the usb stack without reset my board so I can restarting with an usb attach event. Is there an usb register to write or an MQX function for this purpose?

 

Thank in advance for any suggestions.

 

 

Labels (1)
Tags (1)
0 Kudos
1 Solution
481 Views
JuroV
NXP Employee
NXP Employee

    /* Reset USB peripheral */

    reg_ptr->USBOTG.USBTRC0 |= USB_USBTRC0_USBRESET_MASK;
    /* Wait while resetting */
    while (reg_ptr->USBOTG.USBTRC0 & USB_USBTRC0_USBRESET_MASK)
    {}

 

There is one issue. MCF5225 does not support USB peripheral reset, this code is from MCF51MM.

 

The next thing is to switch off and switch on Vbus, look at: _bsp_usb_io_init in gpio_init.c, you have there:

    //reg_ptr->GPIO.PORTUA |= MCF5225_GPIO_PORTxP3; // turn Vbus off

Un-comment it.

 

View solution in original post

0 Kudos
1 Reply
482 Views
JuroV
NXP Employee
NXP Employee

    /* Reset USB peripheral */

    reg_ptr->USBOTG.USBTRC0 |= USB_USBTRC0_USBRESET_MASK;
    /* Wait while resetting */
    while (reg_ptr->USBOTG.USBTRC0 & USB_USBTRC0_USBRESET_MASK)
    {}

 

There is one issue. MCF5225 does not support USB peripheral reset, this code is from MCF51MM.

 

The next thing is to switch off and switch on Vbus, look at: _bsp_usb_io_init in gpio_init.c, you have there:

    //reg_ptr->GPIO.PORTUA |= MCF5225_GPIO_PORTxP3; // turn Vbus off

Un-comment it.

 

0 Kudos