High Speed USB problem - K70

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

High Speed USB problem - K70

1,420 Views
mjbcswitzerland
Specialist V

Hi All

A few months ago I worked on a USB-MSD project with the K70F150 on custom hardware and all went quite smoothly (also CDC and HID class tests looked basically OK, although not the focus).

Today I decided to run it on a K70F120 tower board and a TWR-SER2 with the same USB HS PHY on it (after adjusting the necessary settings) but it crashed in the USB HS initialisation. The problem is that when the code writes to the USBHS_EPCR0 register the program counter jumps to the address 0x00000000 and all registers (as displayed by the debugger) show the value 0x23000042 (all USB registers and any other peripheral registers display the same value) - all CPU registers display 0x00000000. In fact the value written to USBHS_EPCR0 doesn't matter and also a write of the same value in the debugger causes the effect (USBHS_EPCR1..USBHS_EPCR3 also cause this but writes to other USBHS registers are OK).

Since I didn't have this diffiulty with the other HW I am wondering what could be going on? Do write to the SUBHS_EPCRx registers cause the external PHY to be used and fail if this is not correctly connected? The dramatic failure seems unlikely though.

Any ideas??

Regards

Mark

Labels (2)
0 Kudos
3 Replies

765 Views
Monica
Senior Contributor III

Hello Mark,

were this suggestions helpful? Please keep us posted, we'd like to know :smileyhappy:

Best,

Monica.

0 Kudos

765 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Mark,

 

Are you implementing a bare-metal application? Have you referred to the High Speed example for K70 120 MHz device included on the USB Stack v4.1.1?

Additionally, MQX includes demo applications based on High Speed module for K60 and K70 120 MHz devices, and version 4.0.2 was released yesterday. You could use these applications as reference.

Hope this will be useful for you.

Best regards!

/Carlos

0 Kudos

765 Views
mjbcswitzerland
Specialist V

Hi Carlos

I have just tried the USB-CDC K70 project from V4.1.1 on my K70F120 board with SER-2 (using IAR)

1. The USBHS initialisation is performed but there are no accesses to the USBHS_EPCRx registers during the process. It looks as though access start only when enumeration takes place. If I stop the debugger after the initialisation and write any value (in the IAR debugger) to a USBHS_EPCRx register I get the same effect as I had before - debugger shows 0x23000042 in all peripheral registers and the debugger loses connection with the processor).

2. I connected a USB cable to the USBOTG connector and there was a beep as if enumeration was starting but then the debugger lost connection with the board.

3. I then repeated the process with a break point in the USBHS interrupt routine and connected and disconnected the USBOTG cable but it never arrived in the interrupt routine and didn't lose connection with the debugger. That is, I couldn't repeat 2 - but I can always reproduce 1. In fact the USB interface didn't seem to be working since there were no interrupts.

4. I modified the initialisation code so that it wrote 0 to USBHS_EPCR1 at the end of the initialisation (this register defaults to 0 so this should do nothing)

/* Initialize the USB Test Application */

TestApp_Init();

USBHS_EPCR(1) = 0; // test EPCR register access after initialisation

The result was that the processor stopped operating normally when this line was executed. PC jumped to 0x00000000 - interestingly all peripheral registers showed 0x00030007 in this case. The debugger then lost connection.

That means that using the V4.1.1 device initialisation results in about the same difficulty.

I suppose that if V4.1.1 has been tested in HS mode (I did have to set the HS flag option in the project and correct a line of code which failed compiling due to a missing casting) there must be something funny with the HW. As I wrote previously, the same code was operating (and has been operating for several months) on a custom board (that I don't have access to anymore). In fact there are a number of such boards operating in the field using the USBHS interface for USB-MSD based software updating (similar to that shown in this video Kinetis_USB_Loader.wmv - YouTube). I was hoping to verify the HS operation on the K70 tower kit but this doesn't look to be possible with the HW that I have (or could there be another explanation???).

Regards

Mark

P.S. This is below the uTasker USB stack and OS but is otherwise "bare-metal" if you wish.

0 Kudos