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.