Hi-
I have problem to make my board enumerated after plugging USB connector into Windows PC. Windows shows nothing after a connection. My configuration is like:
OS: MQX 4.1.1
HW: MX20DX128VFM5
Tool: IAR and I-jet
BSP: k20d50m
My costumed board is driven by 8MHz crystal and +5v comes directly from PC USB port. The USB ID detection pin is tied to ground and +5V power is seen on the board after connecting to PC. After calculation my board should supply 48MHz to ARM core.
Code wise, I can see the device stack is initialized OK. However, in code below, I don't see start_app and start_transactions are TRUE.
/* call the periodic task function */ | ||
USB_CDC_Periodic_Task(); | ||
/*check whether enumeration is complete or not */ | ||
if((start_app==TRUE) && (start_transactions==TRUE)) |
No sure where to start the investigation, look at the clock init code in bsp_cm.c:
LDD_TError Cpu_SetClockConfiguration(LDD_TClockConfiguration ModeID)
{
if (ModeID > 0x02U) {
return ERR_RANGE; /* Undefined clock configuration requested requested */
}
switch (ModeID) {
case CPU_CLOCK_CONFIG_0:
...
case CPU_CLOCK_CONFIG_1:
...
case CPU_CLOCK_CONFIG_2:
...
}
...
}
Stepping through the clock init code, I see twice of settings are either config_0 and then config_1 (BSP_CLOCK_CONFIGURATION_AUTOTRPM and BSP_CLOCK_CONFIGURATION_DEFAULT?). From there, USB clock prescalers are USBDIV=1 and USBFRAC=0. Is it correct for USB FS?
My operation steps are:
1. connect my board to Windows PC USB port
2. Load code through IAR I-jet
Windows simply doesn't show anything after the step above? Where should I start to look into this issue?
解決済! 解決策の投稿を見る。
After some investigation work, it seems to be a memory allocation failure inside CDC device initialization due to tight 16KB RAM. But the enumeration issue is still there. Will ask in a different thread.
Thanks!
Hui
Hi Hui Shao,
http://cache.freescale.com/files/32bit/hardware_tools/schematics/TWRK20D50M_SCH.pdf?fr=gtl
This is the link for the twrk20d50 schematic file, could you please check the page 6? In this page you can find the hardware for the USB, could you please doble check it?
This is in order to isolate the issue, I am looking a hardward issue.
In addition, could you please try using the Virtual COM CDC example from MQX, you can find it at the next path:
C:\Freescale\Freescale_MQX_4_1\usb\device\examples\cdc\virtual_com
Have a great day,
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
After some investigation work, it seems to be a memory allocation failure inside CDC device initialization due to tight 16KB RAM. But the enumeration issue is still there. Will ask in a different thread.
Thanks!
Hui