-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Increase SD card speed #166
Comments
I retried using Maixduino with following script to test SD card speed.
This gave me at |
Hello @Vinschni , could you please share the code you used to write image to sd card. I don't seem to get that. |
I wrote following class to allow continuous recording of jpg files at ~12 fps with MaixPy to SD.` I assume porting LittleFS to MaixPy or repairing recording of binary files would make MaixPy a valid platform for recording frames at a decend speed > 15 fps @qvga RGB. (see https://github.com/sipeed/MaixPy/issues/164)
|
@
I have seen a strange code in sdcard.c : Maybe the speed of SDCard are limited by this code. |
Current status
Current SD card image writing speed is 12 fps and far below capture fps of > 20.
Higher recording speed is required.
Rationale
Recording images to SD is crucial for in-device data collection when building an realtime neural network IoT device. Our algorithm runs with 18 fps currently, but we are not capable of recording images at the same rate, to feed them for in system offline verification into our algorithm to validate our work in the lab.
Things we tried
Writing single JPG images (4.8kB) to SD card with constant speed is possible if for each 100 images a new folder is created.
I achieve 12 fps ==> 57,7 kByte/s speed.
I tried following things to investigate speed or increase it:
sdcard.c
spi_init()
called in everysd_write_data
|sd_read_data
|sd_write_data_dma
|sd_read_data_dma
insdcard.c
==> Did not increase writing speed
-O2
instead of current-Os
==> Did not helpI inspected the STM32 HAL SD card implementation (here) and my conclusion is that we operate in low speed mode.
A switch to a high speed mode, e.g. up to 50 MHz is achieved here.
As a thight loop on maixduino achieves > 10 times higher throughput i assume SD card is not kept busy in MicroPython probably.
Any hints what the bottleneck of the current MaixPy SD card writing implementation is?
The text was updated successfully, but these errors were encountered: