As I mentioned in the thread:
Recently I have been playing with the Arduino GIGA boards and was curious about how the Pro boards that are built with the STM32H747 compare, so I purchased a portenta H7 as well as the Hat Carrier and started to experiment with them. I am also very curious to see if it is easier to debug system level things like the USB Host drivers on these boards versus the GIGA.
So one of the first things I did was to start adding support for the Portenta H7 to some of the libraries a few of us have been playing with. Lots more details up in the GIGA area of the forum.
Some of the things I have added support to so far includes:
Some device classes, that are built on top of the USBHostMBed5 library. This includes, keyboards, mice, joysticks, USBToSerial adapters, Wacom Tablets. So far I have only tried out a few of them such as keyboards.
KurtE/GIGA_USBHostMBed5_devices: Some USB Host device extension to Arduino_USBHostMBed5 library (github.com)
KurtE/ILI9341_GIGA_n: Converted from ILI9341_t3n for the Arduino GIGA (github.com)
This is a port of my ILI9341_t3n library for the Teensy 3.x and 4.x. I have added support now for the Portenta, which appears to be working. I still need to try out my DMA based Asynchronous screen updates, which is working on the GIGA, but I have not tested yet on Portenta.
Here is an image of part of my current Desktop, which shows, three different boards, all running an Image viewer sketch I have that shows BMP, PING, and Tiff images on the display. Image shows it running on a Portenta H7 (botom right), GIGA lower left, and A teensy Micromod more upper right.
What I am now trying to understand, is why the performance of the different drives on the GIGA and Portenta are so slow.
That is for example, when I run the viewer on the Teensy Micromod, Currently the images are stored on an SD card that is being read using SDFat library with SDIO support for the Teensy:
Image size: 1716x1312 depth:24Scale: 1/6 Image Offsets (17, 11)
!!File:Sharon Barn.bmp Time:1817 writeRect calls:0
Image size: 400x320Scale: 1/1 Image Offsets (-40, -40)
!!File:Small-Drake.jpg Time:25 writeRect calls:0
Image size: 320x240 depth:24Scale: 1/1 Image Offsets (0, 0)
!!File:annie2.bmp Time:129 writeRect calls:0
Image size: 2560x1920Scale: 1/8 Image Offsets (0, 0)
!!File:DSC00040.JPG Time:478 writeRect calls:0
Loading image 'Sharon Birds.bmp'
Image size: 1656x1276 depth:24Scale: 1/6 Image Offsets (22, 14)
!!File:Sharon Birds.bmp Time:1612 writeRect calls:0
On the GIGA I have it running using USB Memory Stick. I will show the two slowest files:
Loading image '/usb/Sharon Barn.bmp'
Image size: 1716x1312 depth:24Scale: 6 Image Offsets (17, 11)
!!File:/usb/Sharon Barn.bmp Time:28777 writeRect calls:0
Loop looking for image file
Loading image '/usb/Sharon Birds.bmp'
Image size: 1656x1276 depth:24Scale: 6 Image Offsets (22, 14)
!!File:/usb/Sharon Birds.bmp Time:23550 writeRect calls:0
The version I have running on the Portenta, I have it setup that I can run with USB Stick or the SDIO SD card that is on the HAT, or using SDFat using external reader.
With USB mor or less same time as GIGA:
Loading image '/usb/Sharon Barn.bmp'
Image size: 1716x1312 depth:24Scale: 6 Image Offsets (17, 11)
!!File:/usb/Sharon Barn.bmp Time:29250 writeRect calls:0
Loop looking for image file
Loading image '/usb/Sharon Birds.bmp'
Image size: 1656x1276 depth:24Scale: 6 Image Offsets (22, 14)
!!File:/usb/Sharon Birds.bmp Time:24025 writeRect calls:0
Loop looking for image file
Image size: 1716x1312 depth:24Scale: 6 Image Offsets (17, 11)
!!File:/usb/Sharon Barn.bmp Time:29259 writeRect calls:0
Image size: 1656x1276 depth:24Scale: 6 Image Offsets (22, 14)
!!File:/usb/Sharon Birds.bmp Time:24050 writeRect calls:0
SDFat SPI at 30mhz -
Image size: 1716x1312 depth:24Scale: 6 Image Offsets (17, 11)
!!File:Sharon Barn.bmp Time:29339 writeRect calls:0
Image size: 1656x1276 depth:24Scale: 6 Image Offsets (22, 14)
!!File:Sharon Birds.bmp Time:27141 writeRect calls:0
SDIO using the libraries:
#include "SDMMCBlockDevice.h"
#include "FATFileSystem.h"
Image size: 1716x1312 depth:24Scale: 6 Image Offsets (17, 11)
!!File:/sd/Sharon Barn.bmp Time:18929 writeRect calls:0
So Loading the barn picture: On Teensy Micromod SDIO: 1.8 seconds, On GIGA and and Portenta: the USB and SD SPI takes about 30 seconds, the SDIO about 19 seconds.
Note: Currently my SDIO version on the Portenta, after a bit stops reading files. Maybe my wrapper class has a problem. I have a quick and dirty wrapper class that tries to convert all three different types of drives/drivers into some form of c++ class.
Currently it appears like both your USB Drive code for USB Host as well as your SDIO driver appears to be setup as old style C STDLIB interface instead of a c++ class. I was expecting that your file systems would be derived from some common base class, like the FS.h classes on the Teensy or the MBED classes, for File systems. But that is a different subject.
Now back to trying to understand where all of the time is being spent.
Suggestions?
Thanks
Kurt