2024-09-09 02:13 PM
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!
2024-09-09 02:26 PM
MTP is extension of PTP, so you can start from MTP host examples.
2024-09-09 02:34 PM
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.
2024-09-09 02:38 PM - edited 2024-09-09 02:41 PM
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:
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.
2024-09-09 02:44 PM
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?
2024-09-09 02:49 PM - edited 2024-09-09 02:52 PM
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.
2024-09-09 03:18 PM
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.
2024-09-09 04:47 PM
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().