Reinit MQX 3.6.2 USB HOST stack

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Reinit MQX 3.6.2 USB HOST stack

跳至解决方案
2,024 次查看
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.

 

 

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,243 次查看
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 项奖励
回复
1 回复
1,244 次查看
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 项奖励
回复