Reinit MQX 3.6.2 USB HOST stack

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Reinit MQX 3.6.2 USB HOST stack

ソリューションへジャンプ
1,737件の閲覧回数
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 解決策
956件の閲覧回数
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 返信
957件の閲覧回数
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 件の賞賛
返信