Elco Elettronica

Problem with the TXSUSPEND/ TOKENBUSY bit in the MCF_USB_OTG_CTL register

Discussion created by Elco Elettronica on Jun 11, 2010
Latest reply on Jul 7, 2011 by Rui Faria

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.