Skip to main content
Visitor II
February 7, 2025
Question

File Hierarchy problem in MTP

  • February 7, 2025
  • 1 reply
  • 510 views

Hello.
I am using USBX pima_mtp device class.
The project uses the example from @example with some changes:

  • Storage type was changed to ierarchical.
  • Added support for image type associations.
  • MTP functions were implemented in ux_device_pima_mtp.c Each object is assigned a corresponding parent object, and when a request is received for get_object_references. An array of the corresponding structure is sent, which is described in the MTP specification v1.1 document.

Writing to the storage root occurs correctly. I can upload and download files without problems. But I encountered 2 problems:

  • Can't copy files to folders that are in the storage root. Copying to the root itself occurs successfully. the Windows host shows a pop-up window with the error "Cannot write to this location", although the rights to write to the folder object are not limited, as well as the rights of the storage. On the Linux host, it is not possible to copy even to the root.
  • When writing to new folders that are in the storage root manually (hardcode, or file system commands, via a serial port), Windows Explorer does not display them, in Linux, the hierarchy is displayed correctly.

 

Are there any examples of working with Associations in USBX?
Has anyone encountered similar problems and successfully solved them?

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    April 16, 2025

    Hi @root__1 

    Could you please attach a screenshot of the error? Additionally, if you have made any changes to the provided example, could you detail your modifications?