Hi all!
First of all thanks a lot for the great OS and MSD driver!
I'm trying to run code of DeusExMachina from https://github.com/Nomados/Chibios-16.x ... age-device but on ChibiOS 3.
I had to make only two changes (uncomment usbPrepareReceive/usbPrepareTransmit) and it works fine on Windows XP.
But not on Mac OS (10.9.5), dmesg doesn't show anything useful, in system info I see the device but it's "not configured".
Any ideas what to try, maybe need to change something else for ChibiOS 3?
Hardware is Pixhawk autopilot (https://pixhawk.org/modules/pixhawk) with STM32F427.
USB Mass Storage Device
- DeusExMachina
- Posts: 223
- Joined: Tue Apr 03, 2012 5:08 am
- Location: South Korea
- Has thanked: 3 times
- Been thanked: 3 times
Re: USB Mass Storage Device
@DrTon
Actually I have already solved this trouble with MacOS. Today I updated my code on github, please check it out again.
Actually I have already solved this trouble with MacOS. Today I updated my code on github, please check it out again.
Re: USB Mass Storage Device
@DeusExMachina
I have downloaded USB compliance tool USB20CV but I have no ideas
how to test exact device. What the hell are "test ID", "room number" and "test bed"?
Where I can find them?
I have downloaded USB compliance tool USB20CV but I have no ideas
how to test exact device. What the hell are "test ID", "room number" and "test bed"?
Where I can find them?
Re: USB Mass Storage Device
@DeusExMachina, thanks a lot, now it works fine!
But is it possible to run HighSpeed USB on STM32F427VI? Datasheet says that it's supported: "USB 2.0 high-speed/full-speed device/host/OTG controller with dedicated DMA, on-chip full-speed PHY and ULPI". Could you point me how to do this?
But is it possible to run HighSpeed USB on STM32F427VI? Datasheet says that it's supported: "USB 2.0 high-speed/full-speed device/host/OTG controller with dedicated DMA, on-chip full-speed PHY and ULPI". Could you point me how to do this?
- DeusExMachina
- Posts: 223
- Joined: Tue Apr 03, 2012 5:08 am
- Location: South Korea
- Has thanked: 3 times
- Been thanked: 3 times
Re: USB Mass Storage Device
barthess wrote:@DeusExMachina
I have downloaded USB compliance tool USB20CV but I have no ideas
how to test exact device. What the hell are "test ID", "room number" and "test bed"?
Where I can find them?
Do not care about these things, they are only for a verification report. If you want to put on "USB compatible" logo you have to pass a formal verification.
Last edited by DeusExMachina on Tue Oct 25, 2016 12:27 am, edited 1 time in total.
- DeusExMachina
- Posts: 223
- Joined: Tue Apr 03, 2012 5:08 am
- Location: South Korea
- Has thanked: 3 times
- Been thanked: 3 times
Re: USB Mass Storage Device
DrTon wrote:@DeusExMachina, thanks a lot, now it works fine!
But is it possible to run HighSpeed USB on STM32F427VI? Datasheet says that it's supported: "USB 2.0 high-speed/full-speed device/host/OTG controller with dedicated DMA, on-chip full-speed PHY and ULPI". Could you point me how to do this?
It is easy if you board has a HS PHY. You should enable USBD2 driver in mcuconf.h and redefine USBD symbol in usb_msd.h.
#define USBD USBD2
Thanks to Chibios HAL this driver is hardware-independent and works as a logical device.
Re: USB Mass Storage Device
Hello, I've run a short test today. -O3 compiled, same STM32F7+USB3320 hardware, same 633x SDCard, same SDIO/ULPI configuration, same host computer with an SSD :
dsigma Chibios version reads at 1.05 MB/s (??) and writes at 2.00MB/s (BLOCK_WRITE_ITTERATION_COUNT: 16) or 3.90 MB/s (BLOCK_WRITE_ITTERATION_COUNT: 32).
STM32CubeMX exported project with no changes reads at 7.80 MB/s and writes at 6.40 MB/s.
Is there an obvious difference I missed ? A define I forgot to enable ?
Thank you very much, Koen
dsigma Chibios version reads at 1.05 MB/s (??) and writes at 2.00MB/s (BLOCK_WRITE_ITTERATION_COUNT: 16) or 3.90 MB/s (BLOCK_WRITE_ITTERATION_COUNT: 32).
STM32CubeMX exported project with no changes reads at 7.80 MB/s and writes at 6.40 MB/s.
Is there an obvious difference I missed ? A define I forgot to enable ?
Thank you very much, Koen
- Giovanni
- Site Admin
- Posts: 14444
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1074 times
- Been thanked: 921 times
- Contact:
Re: USB Mass Storage Device
Hi,
Does the ST driver use DMA? ChibiOS USB driver uses a "pump" thread for moving data, perhaps the performance difference is there because other thread may slow down the USB thread that has very low priority (you may try to raise priority, it is configurable).
Rationale for use of a thread is that only HS OTG has DMA and the driver has to support both FS and HS. If it is proved that the problem is indeed lack of DMA use in the driver then a separate, HS-only, driver could be created.
Apparently both OTGs on the new STM32H7 have DMA so probably such a driver will be created anyway sometime next year, it could serve also as HS-only driver on the F4/F7.
Giovanni
Does the ST driver use DMA? ChibiOS USB driver uses a "pump" thread for moving data, perhaps the performance difference is there because other thread may slow down the USB thread that has very low priority (you may try to raise priority, it is configurable).
Rationale for use of a thread is that only HS OTG has DMA and the driver has to support both FS and HS. If it is proved that the problem is indeed lack of DMA use in the driver then a separate, HS-only, driver could be created.
Apparently both OTGs on the new STM32H7 have DMA so probably such a driver will be created anyway sometime next year, it could serve also as HS-only driver on the F4/F7.
Giovanni
Re: USB Mass Storage Device
For the sake of completeness, DeusExMachina version reads at 1MB/s and writes at 350kb/s.
Hello Giovanni, thank you for your answer. I'll look into it now.
Hello Giovanni, thank you for your answer. I'll look into it now.
Re: USB Mass Storage Device
ST uses multi-block read/write, dsigma chibios version uses multi-block write and single-block read, barthess chibios version uses single-block read/write.
Barthess chibios version (860kB/s / 400kB/s) was the most readable so I've edited it to try 32 blocks read/writes. It now reads at 4.60MB/s and writes at 3.50MB/s. So I'll look into modifying dsigma version to both read and write using its current ping-pong thingy.
STM32CubeMX test did not have any DMA in use, nor for SDIO, nor for HS-USB. And it is twice as fast. I'll look into it later.
Barthess chibios version (860kB/s / 400kB/s) was the most readable so I've edited it to try 32 blocks read/writes. It now reads at 4.60MB/s and writes at 3.50MB/s. So I'll look into modifying dsigma version to both read and write using its current ping-pong thingy.
STM32CubeMX test did not have any DMA in use, nor for SDIO, nor for HS-USB. And it is twice as fast. I'll look into it later.
Return to “Development and Feedback”
Who is online
Users browsing this forum: No registered users and 9 guests