Skip to main content
Graduate
March 2, 2024
Question

USB Host MTP/PTP to digital camera

  • March 2, 2024
  • 2 replies
  • 4534 views

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

    This topic has been closed for replies.

    2 replies

    Explorer
    March 3, 2024

    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.

     

    PCu1Author
    Graduate
    March 3, 2024

    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

    Super User
    March 3, 2024

    Maybe a picture camera just does not understand what are .wav files and skips them in enumeration?

    Super User
    March 3, 2024

    Can you see the file that you've added in the interface of the camera itself?

    PCu1Author
    Graduate
    March 4, 2024

    Unfortunately it seems that you can only preview images/videos but not the file list on the camera itself...

    PCu1Author
    Graduate
    March 6, 2024

    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...

    Capture d'écran 2024-03-06 092447.png

    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?