K60 USB_LDD code fails enumeration when executing from FLASH

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

K60 USB_LDD code fails enumeration when executing from FLASH

跳至解决方案
700 次查看
georgesmith
Contributor I

I am using a custom board with the MK60DX256VLL10 running at 96 MHz.  The bareboard projects are built using CodeWarrior 11.0 and Processor Expert's USB_LDD component.  I have tried two different projects:  one is a CDC serial port, the other is a USB mass storage device.  The issue that I have is that both work correctly without any issues when I build for RAM and execute them using the debugger.  If I build (the exact same code) for flash and execute from the flash the enumeration process proceeds to the point where the PC sends the first setup packet for GET_DEVICE_DESCRIPTOR.  There is no response from our board and usbtrace shows a USBD_STATUS_XACT_ERROR(0xC0000011) on the PC side.

Any ideas on what the problem could be?  Has this Processor Expert code ever been tested as a FLASH build on a similar processor/speed?

One other note, I have enabled the OnDeviceError event and never see any errors as far as the USB_LDD component is concerned.

标签 (2)
0 项奖励
1 解答
534 次查看
mjbcswitzerland
Specialist V

Hi George

You can get bullet-proof (industrial quality) USB-CDC for the K60 at
http://www.utasker.com/kinetis/TWR-K60D100M.html
http://www.utasker.com/kinetis/TWR-K60N512.html
(use the free open source version if you don't require any support)

Otherwise try setting the USB bus master's flash access rights since the examples may restrict to RAM operation for some accesses (like descriptors). For the K60 this is using
FMC_PFAPR |= FMC_PFAPR_M4AP_RD;
for the 100MHz K60 or
FMC_PFAPR |= FMC_PFAPR_M3AP_RD;
if it is a version with FPU.

Regards

Mark

在原帖中查看解决方案

3 回复数
534 次查看
georgesmith
Contributor I

That was indeed the problem and now everything is working correctly.  A big thank you to Mark Butcher and Fang Li for your expertise and assistance.

0 项奖励
534 次查看
miduo
NXP Employee
NXP Employee

Hello,

Well, the problem here is the access to flash. The Flash Memory Controller (FMC) protects master USB FS/LS port to access to flash in its default mode, So you should set the USB bus master's flash access rights as Mark mentioned.

0 项奖励
535 次查看
mjbcswitzerland
Specialist V

Hi George

You can get bullet-proof (industrial quality) USB-CDC for the K60 at
http://www.utasker.com/kinetis/TWR-K60D100M.html
http://www.utasker.com/kinetis/TWR-K60N512.html
(use the free open source version if you don't require any support)

Otherwise try setting the USB bus master's flash access rights since the examples may restrict to RAM operation for some accesses (like descriptors). For the K60 this is using
FMC_PFAPR |= FMC_PFAPR_M4AP_RD;
for the 100MHz K60 or
FMC_PFAPR |= FMC_PFAPR_M3AP_RD;
if it is a version with FPU.

Regards

Mark