M5222X OTG USB Controller

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

M5222X OTG USB Controller

1,996 Views
mjbcswitzerland
Specialist V
Hi All

I am presently working on a USB stack for the M5222X Coldfire devices and am rather surprised to 'discover' that the USB controller works with buffer descriptor tables in little-endian mode.

In fact I only worked it out after analysing the beta reference USB stack from Freescale / CMX. Although the buffer descriptor table is otherwise described in detail in the M52223 and M52211 users' guides this fact is no where to be found. It is therefore almost impossible to get the controller working using just the manual.

Any comments?

Regards

Mark

www.uTasker.com

Labels (1)
0 Kudos
Reply
5 Replies

735 Views
Mudwog
Contributor I

I have just started digging through the manual and the example code from CMX.  I found a place in the code where the buffer pointers are written into the BDT in Little Endian format.  I could not find anything in teh manual to confirm that. 

 

Now I'm wondering if the buffer status will be in Little Endian as well.  Does any body know?

 

0 Kudos
Reply

735 Views
mjbcswitzerland
Specialist V

Hi

 

Both the buffer descriptor data pointer and the control word are in little-endian format.

 

It is however not necessary to convert between big and little-endian when working with the control word since the defines for the bits and fields in it can simply be set to match the bit use. Eg.

 

#define TOK_PID_0                0x04000000#define BDT_STALL                0x04000000#define TOK_PID_1                0x08000000#define DTS                      0x08000000#define TOK_PID_2                0x10000000#define NINC                     0x10000000#define TOK_PID_3                0x20000000#define KEEP                     0x20000000#define DATA_1                   0x40000000#define OWN                      0x80000000#define USB_BYTE_CNT_MASK        0x0000ff03

 rather than the big-endia variant:

 

#define BE_TOK_PID_0         0x00000004#define BE_BDT_STALL         0x00000004#define BE_TOK_PID_1         0x00000008#define BE_DTS               0x00000008#define BE_TOK_PID_2         0x00000010#define BE_NINC              0x00000010#define BE_TOK_PID_3         0x00000020#define BE_KEEP              0x00000020#define BE_DATA_1            0x00000040#define BE_OWN               0x00000080#define BE_USB_BYTE_CNT_MASK 0x03ff0000

 

Regards

 

Mark

 

0 Kudos
Reply

735 Views
Mudwog
Contributor I

Thanks.

I wonder if the people who write the reference manuals look in the forums.

 

0 Kudos
Reply

735 Views
J2MEJediMaster
Specialist I

Normally they do not look in the forums. I do, and I strongly urge that your best course of action is to file a service request that reports the documentation error. This gets the problem logged into a database where it does get looked at by the docs people. Click here to go to the on-line service request page.

 

---Tom

0 Kudos
Reply

735 Views
SetAlias
Contributor I
Hi Mark....
                I agree with you...the user manual has no information about USB BDT  Little Endian Mode or Big Endian Mode.But if we observe the CMX code, the BDT working on Big Endian mode.
 
I have more doubts regarding Code warrior IDE, presently iam using version 5.7.0.Iam developing a simple USB firmware on MCf52223 EVB. If we creat a project we get a deafult files.What is the use of those files, specially "mcf5222x_vectors.s" file, in which USB Interrupt service routine "_USB_handler " was configured.When I intilaize the USB and enable the interrupt ,Iam not seeing the printf statements in "_USB_handler " function, when interrupts are generated.Once again I have to configure the new function for ISR.
 
 
0 Kudos
Reply