Problem with the TXSUSPEND/ TOKENBUSY bit in the MCF_USB_OTG_CTL register

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

Problem with the TXSUSPEND/ TOKENBUSY bit in the MCF_USB_OTG_CTL register

1,321 Views
elel
Contributor III

Hi Everybody

 

I'm using an mcf52259.

 

I'm trying to develop the USB host functionality without using the MQX driver, because I want to use theese functions into a bootloader.

 

My goal it's to put the S19 file on a pen-drive, plug the pen-drive into my board, and than read the file and perform the software update.

 

I'm able to reach when the pen drive it's attach to my board, but I've a problem when I try to send the first token to the pen drive.

I reach the TXSUSPEND/ TOKENBUSY bit in the MCF_USB_OTG_CTL register always high.

 

I've read on the mcf52259 reference manual that, when the usb module is set in host mode, the high state of that bit means that the usb module it's executing a token, but I found this bit setted before I perform the first token. So I don't know why it's set, maybe I think I've missed something in the initialization process, but I can't understand where I'm wrong.

 

Anyone have any suggestion about it?

 

I've attached my code to this post.

 

Thanks in advance.

 

Stefano

 

 

Labels (1)
Tags (1)
0 Kudos
3 Replies

375 Views
elel
Contributor III

Hi Everybody.

 

I've fixed my problem, I was doing a wrong initialization of the bdt value because there was an error in the macro that I wrote for swapping the variable.

The effect was that I was able to send the first token, the communication went wrong because the data I sended were wrong, and then the bit TOKENBUSY state didn't goes low anymore.

 

But now I've another problem:

 

When I try to done the data stage comunication of the control comunication done for reading the pen-drive descriptor, the pen-drive return me a stall everytime.

 

I've debugged my code and the mqx host driver code, and I've compared the value of the registers and the value of the data I send between my code and mqx code; and they are the same.

 

I' ve also saw that I'm executing the code from a main, and in my code I've all interrupt disabled and only one main(in my code I don't manage tasks), instead the mqx creates a task, and exdecutes all the operation from there,  and also uses the usb interrupt for checking the attach event, the detach event, and the token-done event.

 

So I think that the difference between my usb comunication and the usb comunication done by the mqx is the timing of access to the usb register, but it's only a suggestion.


Anyone have already managed this problem? and can tell me where I'm wrong?

 

Best Regards.

 

Stefano


0 Kudos

375 Views
JuroV
NXP Employee
NXP Employee

Hi Stefano, which HW do you use?

We are facing one STALL issue on EHCI driver.

0 Kudos

375 Views
RuiFaria
Contributor III

Hi Jurov,

The STALL issue on EHCI driver is already solved or there is any incompatibility problem with EHCI?

Apparently, my project works fine when it is forced to use UHCI or OHCI drivers instead of EHCI. It has enumeration problems when it is used EHCI driver.

 

Thanks

0 Kudos