Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a USBX HOST PIMA reference code ? #132

Open
111llll111 opened this issue Jan 10, 2024 · 6 comments
Open

Is there a USBX HOST PIMA reference code ? #132

111llll111 opened this issue Jan 10, 2024 · 6 comments
Labels
feature New feature or enhancement request

Comments

@111llll111
Copy link

Hi ,

I need to use STM32H573 as a USB host to read and write Android phone files.

I registered the pima class, connected to the mobile phone to set the MTP function, enumeration failed, but the PTP function can be successfully enumerated.

I have not used PIMA function. What function code should I use to read and write files on my phone?

Do you have the usbx host pima reference code?

Thanks!

@111llll111 111llll111 added the feature New feature or enhancement request label Jan 10, 2024
@xiaocq2001
Copy link
Contributor

Define UX_PIMA_WITH_MTP_SUPPORT and compile again to enable MTP support.
PIMA manages files as objects, you can use object functions to access your files. Usually you should open a session, get object information, open it, read/write it then close it.

@111llll111
Copy link
Author

Hi
20240111142234

MTP mode still fails enumeration, PTP enumerates successfully.

I opened the macro definition UX_PIMA_WITH_MTP_SUPPORT ,But this macro definition only seems to work on the USB DEVICE side?

@111llll111
Copy link
Author

Hi CQ,

I would like to confirm whether these are the only file formats supported by MTP?

/* Define PIMA Object Format Codes.  */

#define UX_HOST_CLASS_PIMA_OFC_UNDEFINED                        0x3000
#define UX_HOST_CLASS_PIMA_OFC_ASSOCIATION                      0x3001
#define UX_HOST_CLASS_PIMA_OFC_SCRIPT                           0x3002
#define UX_HOST_CLASS_PIMA_OFC_EXECUTABLE                       0x3003
#define UX_HOST_CLASS_PIMA_OFC_TEXT                             0x3004
#define UX_HOST_CLASS_PIMA_OFC_HTML                             0x3005
#define UX_HOST_CLASS_PIMA_OFC_DPOF                             0x3006
#define UX_HOST_CLASS_PIMA_OFC_AIFF                             0x3007
#define UX_HOST_CLASS_PIMA_OFC_WAV                              0x3008
#define UX_HOST_CLASS_PIMA_OFC_MP3                              0x3009
#define UX_HOST_CLASS_PIMA_OFC_AVI                              0x300A
#define UX_HOST_CLASS_PIMA_OFC_MPEG                             0x300B
#define UX_HOST_CLASS_PIMA_OFC_ASF                              0x300C
#define UX_HOST_CLASS_PIMA_OFC_QT                               0x300D
#define UX_HOST_CLASS_PIMA_OFC_EXIF_JPEG                        0x3801
#define UX_HOST_CLASS_PIMA_OFC_TIFF_EP                          0x3802
#define UX_HOST_CLASS_PIMA_OFC_FLASHPIX                         0x3803
#define UX_HOST_CLASS_PIMA_OFC_BMP                              0x3804
#define UX_HOST_CLASS_PIMA_OFC_CIFF                             0x3805
#define UX_HOST_CLASS_PIMA_OFC_GIF                              0x3807
#define UX_HOST_CLASS_PIMA_OFC_JFIF                             0x3808
#define UX_HOST_CLASS_PIMA_OFC_PCD                              0x3809
#define UX_HOST_CLASS_PIMA_OFC_PICT                             0x380A
#define UX_HOST_CLASS_PIMA_OFC_PNG                              0x380B
#define UX_HOST_CLASS_PIMA_OFC_TIFF                             0x380D
#define UX_HOST_CLASS_PIMA_OFC_TIFF_IT                          0x380E
#define UX_HOST_CLASS_PIMA_OFC_JP2                              0x380F
#define UX_HOST_CLASS_PIMA_OFC_JPX                              0x3810

If I want to transfer zip files or bin files, is it not supported?

Thanks!

@xiaocq2001
Copy link
Contributor

The upper code is actually defined by PIMA 15740:2000.
I'm not sure if how your device reports zip or bin files, if they can be referenced in undefined code or some other codes you can use them.

@111llll111
Copy link
Author

Hi CQ,

Can you help us see why the MTP enumeration fails, but the PTP enumeration succeeds?

@xiaocq2001
Copy link
Contributor

Do you have traces for the enumerations to analyze?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or enhancement request
Projects
None yet
Development

No branches or pull requests

2 participants