2024-03-02 01:23 PM
Hello,
I'm testing the STM3240G-eval with the USB host MTP. The goal is to retrieve the photo from a canon EOS 100.
The camera uses PTP protocol.
As the demonstration code read .wav file, I wrote a wav file to the root of the SD card.
The digital camera is recognised but when the code arrives on USBH_MTP_GetObjectHandles(&hUSBHost, 0, PTP_OFC_WAV, 0xFFFFFFFF, &WavHandles), no file is returned.
Perhaps I should replace the USH_MTP_xx function by USBH_PTP_xx ?
Any idea?
Pierre
2024-03-03 05:24 AM
Hi @PCu1 ,
You need to check your device (Canon EOS 100) which class support MTP or PTP.
do you have an usb trace of enumeration phase.
2024-03-03 08:17 AM
Hi @Mohamed_AYED ,
Following the documentation, the Canon supports PTP. (class 0x06)
It is confirmed with the STM32 MTP example demo because it passes the comparison level. And also I captured some informations with USBtreeview when the camera is connected with the PC that confirm class 0x06.
I have an Logic Salae analyser but it will be RAW data packet. I don't know if it can help. Do you have a tool suggestion?
Pierre
2024-03-03 08:20 AM
Maybe a picture camera just does not understand what are .wav files and skips them in enumeration?
2024-03-03 08:56 AM
Yes may be...
But I already changed this line with the JPEG filter and I added a jpeg image on the root of the SD card (if the STM32 can't read in /DCIM/... subdirectory):
USBH_MTP_GetObjectHandles(&hUSBHost, 0, PTP_OFC_EXIF_JPEG, 0xFFFFFFFF, &WavHandles)
No positive results...
2024-03-03 03:16 PM
Can you see the file that you've added in the interface of the camera itself?
2024-03-04 12:16 AM
Unfortunately it seems that you can only preview images/videos but not the file list on the camera itself...
2024-03-06 01:05 AM - edited 2024-03-06 02:12 AM
If I change the "object format code" by PTP_OFC_Association I can get the directories list on the SD card.
At least the Canon answers/understands some requests...
I tried with Object format code between 0x3000 and 0x3810 without success.
May be the Canon restricts the access on root and allows on DCIM directory.
Is it possible in USB-PTP to navigate in subdirectories?