K60 USB_LDD code fails enumeration when executing from FLASH

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

K60 USB_LDD code fails enumeration when executing from FLASH

ソリューションへジャンプ
1,755件の閲覧回数
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 解決策
1,589件の閲覧回数
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 返答(返信)
1,589件の閲覧回数
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 件の賞賛
返信
1,589件の閲覧回数
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 件の賞賛
返信
1,590件の閲覧回数
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