Author Topic: KINETIS, high-speed USB using external PHY on the ULPI buss  (Read 9921 times)

Offline svl

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
KINETIS, high-speed USB using external PHY on the ULPI buss
« on: November 18, 2012, 10:25:21 AM »
Hi

I am in progress of looking for the possibility of using the K60 in our new products instead of the Coldfire;-)
One of the things I notices was that the K60 has the possibility to run high-speed USB.
But from what I can find it requires an external USB PHY that is connected to the K60 using ULPI.

Has any has success making this combination and can the uTasker support this?

Regards
Steen

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: KINETIS, high-speed USB using external PHY on the ULPI buss
« Reply #1 on: November 18, 2012, 03:15:31 PM »
Hi Steen

I haven't used this capability yet.

Generally I don't know that there is any big advantage of HS USB in these types of devices based on the fact that the USB operation is quite interrupt intensive and so the throughput is limited well below the HS USB speed capabilities - maybe the larger packt size helps though to offset this.

Regards

Mark


Offline svl

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Re: KINETIS, high-speed USB using external PHY on the ULPI buss
« Reply #2 on: November 19, 2012, 10:35:55 AM »
Hi Mark

Had the feeling that this was the case, have not been able to find much info on the matter.
The reason for me to look for this possibility is that in my application we need to transfer between 1-20 MB from the PC to the systems connected uSD card over USB. And the faster the transfer can be done the better. ;D
Do you have any idea of what typical transfer speed I can expect if I use uTasker and map the uSD card in to the PC as a drive?

Regards
Steen

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: KINETIS, high-speed USB using external PHY on the ULPI buss
« Reply #3 on: November 19, 2012, 02:56:33 PM »
Hi Steen

I have no figures for the high speed mode but often it is the SD card writes that slow things down when transfering over FS USB.
When I monitor such transfers I see that the USB is waiting whenever the write is made. Therefore I also wonder how much HS USB will be able to increase.
I suppose that it also depends on the SD card type - they are classed according to their write speed.

Regards

Mark


Offline svl

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Re: KINETIS, high-speed USB using external PHY on the ULPI buss
« Reply #4 on: November 30, 2012, 07:42:52 PM »
Hi Mark

I have been running some test and must say that you are right;-)
For some reason the SD card are the slowest part when transferring data to it using USB.
I am using the SDHC interface on the Tower TWR. And when I try to just write a single file 2 MByte (From the RS232 interface) file I get a transfer rate of 245Kbyte.
I was expecting much higher transfer as the manual mention 200Mbps.
Have you been looking at the DMA option that the SDHC offers to see if this can offer higher speed?

Regards
Steen

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: KINETIS, high-speed USB using external PHY on the ULPI buss
« Reply #5 on: December 03, 2012, 02:04:57 PM »
Hi Steen

I did try using DMA mode on the Kinetis but had a difficulty with the DMA memory rights so didn't complete that part of the work at the time. In the meantime I think that I know how to solve it but again don't think that it would make much difference due to the fact that the data tranfer rate to the SD card is not critical (I didn't notice any performance advantages using DMA on an NXP ARM so didn't give this any priority). The utFAT interface is a "blocking" interface and so it can't continue until the SD card's write operation has completed; the transfer time is probably just as fast with or without DMA since the CPU doesn't do anything else during the process (only exception would be interrupts taking place but these are also short in comparison). The SD card's serial speed (4 bit width) is limited to about 25MHz (approx. 12MBytes per second) and so the CPU will be able to supply that rate just as well as DMA HW doing it and, as you have also seen, the transfer time is almost neglectible in comparison to the SD card's sector write speed.

Regards

Mark

Offline svl

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Re: KINETIS, high-speed USB using external PHY on the ULPI buss
« Reply #6 on: December 04, 2012, 09:19:39 PM »
Hi Mark

Thanks for that additional information.
One thing I do not understand is why I SD card that give 1,6Mbyte/s in write speed when connected to a PC using a USB converter and only 245Kbyte/s when connected to the KINETIS?
Is the current write limit as fast as you believe it should or ..

Regards
Steen



 

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: KINETIS, high-speed USB using external PHY on the ULPI buss
« Reply #7 on: December 05, 2012, 02:39:45 PM »
Hi Steen

I think that the PC has advantages in that it will have read the complete FAT from the SD card (when it was inserted) and have a backup of it in its RAM. When it writes it doesn't need to perform each FAT change directly to the card but instead can cache changes locally and only commit when absolutely necessary. Similar to a memory stick it is also advisable to remove the device by ejecting it so that the PC can first ensure that the content is fully synchronised - there may be changes that have't actually been written to the HW at the time.

See this discussion also http://www.utasker.com/forum/index.php?topic=1741.0  There are some methods to reduce the intermediate writes to the FAT although there may be some risks involved in an embedded system. Since the PC has a lot of RAM for caching and thus avoiding intermediate writes it will always have an advantage over an embedded system with limited resources.

At the moment I don't have an exact comparison of the USB use but it may be interesting to record the USB transfers in the two cases to identify where the most time is lost.

Regards

Mark