I am using CodeWarrior 6.3 C Compiler for Coldfire MCF52223 on the Freescale M52223EVB Development board. I need to use the processor USB interface in Host mode. My software is based on the CMX routines (Host Demo) downloaded from Freescale Web Site.
My problems is:
1) In the reference manual of the MCF52223 about chapter “22.214.171.124 Frame Number Register Low/High (FRM_NUML, FRM_NUMH)” the descriptor is errata. (it is the same of 126.96.36.199).
2) In the demo code CMX I have discovered a bug in this loop in subroutine “usb_host_start_transaction(..)” in the file “usb_host.c”
elapsed &= ((1<<11)-1);
} while(elapsed < my_device.eps[ep].interval);
my_device.eps[ep].last_due += my_device.eps[ep].interval;
my_device.eps[ep].last_due &= ((1<<11)-1);
It seems that the MCF_USB_FRM_NUM register, sometimes returns invalid values. So the elapsed time between two transactions may be less than desired , so the device stops working.