cancel
Showing results for 
Search instead for 
Did you mean: 

USB PTP API documentation

alsierraromero
Associate II

Hello,

I'm trying to do a proof of concept using the STM32429I-EVAL1, which basically sends a PTP command to a camera. All the USB host library documentation only covers MTP, but there is nothing about PTP. I understand that this board offers out of the box support for MTP, but in the "MTP_Standalone" project example, the files "usbh_mtp_ptp.h" and "usbh_mtp_ptp.c" are part of the projects and the function USBH_PTP_SendRequest, seems to be what I need to send a specific PTP command, but there is no documentation about those functions. I'd appreciate a bit of guidance on this.
Thank you!

7 REPLIES 7
Pavel A.
Evangelist III

MTP is extension of PTP, so you can start from MTP host examples.

 

Hi Pavel,

The reason why I'm asking for guidance here is because I already went through that documentation and there is nothing there about the APIs I referenced in my previous message. 

Pavel A.
Evangelist III

Let me google copilot this for you.

Q: where is documentation on picture transfer protocol (PTP)?

A: 

You can find detailed documentation on the Picture Transfer Protocol (PTP) from several sources:

  1. Imaging.org: This site provides a comprehensive overview of PTP, including its history, transport implementations, and vendor extensions1.
  2. Wikipedia: The Wikipedia page on PTP offers a summary of the protocol’s development, its standardization, and its applications2.
  3. ISO Standards: The official ISO 15740:2013 standard for PTP can be accessed through the ISO website2.
  4. CIPA: The Camera & Imaging Products Association provides documentation on PTP over IP networks3.

 

Q: Isn't PTP described in some USB.org standard?

A:Yes, the Picture Transfer Protocol (PTP) is described in the USB Still Image Capture Device Definition, which is part of the USB.org standards. Specifically, it is detailed in the USB Still Image Capture Device Definition, Revision 1.0, which outlines how PTP is used for transferring images over USB connections.

 

Source: Conversation with Copilot, 10/09/2024
 
 

I'm glad you know how Google and Copilot works, but that is not what I'm asking. I'm reaching out to the STMicro forum with the hope that the people that work for STMicro can shed some light on how their HW/FW works. Can you please pretend to care and read my first message and at least try to help me?

 

Pavel A.
Evangelist III

Yes I've read your first message. Can you build the host MTP host example and connect a PTP device to it? It is expected at least to start enumeration, parse descriptors and so on.

Azure/Eclipse USBX supports PTP and PictBridge, it's worth to check there too.

 

alsierraromero
Associate II

I've built the MTP Standalone example and connected the dev kit to the camera. The camera is recognized by the DK and everything works as is intended in the example.
I've also modified the example code, because I need to send a PTP command. The MTP APIs that appear in the document UM1720 page 34, don't work for what I'm trying to do, because they are specific to the transfer of media. The only function that seems to be useful for that purpose is USBH_PTP_SendRequest, which I found going through the "usbh_mtp_ptp.h" and "usbh_mtp_ptp.c" files in the example folder. There is no documentation about those PAIs as I mentioned before. Unfortunately, the modified example does not work and I'm not sure if it's because I'm incorrectly using the argument of type PTP_ContainerTypedef or because I need to use the function USBH_PTP_GetResponseas well. 

Pavel A.
Evangelist III

Hmm indeed UM1720 does not document USBH_PTP_SendRequest, USBH_PTP_GetResponse. Not great (( But as you've already found, usbh_mtp_ptp.c gives clues about sending and receiving requests. See for example flow of USBH_PTP_GetStorageInfo().