Forum Rule: Always post complete source code & details to reproduce any issue!
Page 4 of 4 FirstFirst ... 2 3 4
Results 76 to 86 of 86

Thread: MTP Responder Contribution

  1. #76
    Senior Member brtaylor's Avatar
    Join Date
    Mar 2016
    Location
    Portland, OR
    Posts
    538
    Trying out MTP Responder. Shows up fine on Windows 10 using a Teensy 3.6 with the built-in SD running MTP Blinky with the patch mentioned in the PR applied. I can create folders, but not rename them (i.e. I can make some "New Folder"). Any clues to fix that so the folders / files can be renamed and manipulated in Windows Explorer? Thanks!

  2. #77
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,432
    Quote Originally Posted by brtaylor View Post
    Trying out MTP Responder. Shows up fine on Windows 10 using a Teensy 3.6 with the built-in SD running MTP Blinky with the patch mentioned in the PR applied. I can create folders, but not rename them (i.e. I can make some "New Folder"). Any clues to fix that so the folders / files can be renamed and manipulated in Windows Explorer? Thanks!
    If you look up the code, you will see that rename (aka move) is not implemented.

  3. #78
    Senior Member brtaylor's Avatar
    Join Date
    Mar 2016
    Location
    Portland, OR
    Posts
    538
    Quote Originally Posted by WMXZ View Post
    If you look up the code, you will see that rename (aka move) is not implemented.
    Thanks for that bit of information!

  4. #79
    Senior Member
    Join Date
    Oct 2015
    Location
    Vermont, USA
    Posts
    198
    Hey, this is super cool! It seems to work well for me on my Teensy 3.6. Thanks for making it happen and for "MTP (Experimental)" getting pulled into the mainline Teensyduino that we all download by default.

    The downside, of course, is that we lose Serial when we are in MTP mode. And by "lose Serial", I mean that I can't seem to invoke usb_serial_class methods (like dtr()).

    I've seen in other threads that altering the USB modes is not that hard (certainly not as hard as getting MTP to work in the first place!). Is there any chance that someone here with some skills could do the edit to the USB modes to add serial to the MTP mode and do the pull request to Paul?

    (note: I see no reason to have MTP mode *without* Serial, so I would simply add serial to the existing MTP mode. This means that we wouldn't be adding yet another entry in the USB menu. But, others might have other opinions.)

    Thanks for the great work! I'd be happy to help as a tester!

    Chip
    Last edited by chipaudette; 11-09-2019 at 10:43 PM.

  5. #80
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,432
    Chip,
    The original version of he MTP has serial and not seremu
    https://github.com/yoonghm/MTP/blob/master/usb_desc.h
    Not clear why Paul has chosen to use seremu.
    Also not clear (forgot) if and what we have changed in the original code, apart from using Paul's stock usb_desc.h

  6. #81
    Senior Member
    Join Date
    Sep 2015
    Location
    Taiwan, Asai. (Traditional Chinese)
    Posts
    158
    Hello, following also,

    had anyone successfully tested MTP on teensy 4.0?

    Thanks

  7. #82
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,432
    Got MTP Responder working on T4
    code may be found on GitHub/WMXZ/MTP_t4

    directory "copy-of-core" contains modification of core library
    until they are merged and distributed with TD these file need to be copied to cores/teensy4

    PR requested to update core

  8. #83
    Senior Member
    Join Date
    Dec 2013
    Posts
    243
    WOW !!! Thank you WMXZ !!, now we need Teensyduino 1.50 beta with the "MTP Disk (Experimental)" in the Tools.

  9. #84
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,432
    Quote Originally Posted by Chris O. View Post
    WOW !!! Thank you WMXZ !!, now we need Teensyduino 1.50 beta with the "MTP Disk (Experimental)" in the Tools.
    Until then, you can uncomment the relative lines in boards.txt

  10. #85
    Junior Member
    Join Date
    Oct 2018
    Posts
    11
    Many thanks to wolfmanjm for getting this to work on Linux. I had all but given up!

    Also, thank you to WMXZ for trying it with Teensy 4. I can't get it to work yet, but hopefully will soon.

    Compiling the example mtp-test started with errors in files mtp_storage.cpp (line 35) and mtp_storage.h (line 40) stating "SdFat-Beta.h not found". Needed to edit those lines to "SdFat.h"

    Now the errors are:

    Code:
    In file included from /tmp/arduino_build_954478/sketch/main.cpp:4:0:
    /home/dean/Desktop/arduino-1.8.9/hardware/teensy/avr/libraries/MTP_t4-master/src/MTP.h:64:70: warning: 'used' attribute ignored [-Wattributes]
       uint8_t data_buffer[MTP_RX_SIZE] __attribute__ ((used, aligned(32)));
                                                                          ^
    /home/dean/Desktop/arduino-1.8.9/hardware/teensy/avr/libraries/MTP_t4-master/src/MTP_Storage.cpp: In member function 'void MTPStorage_SD::ScanDir(uint32_t)':
    /home/dean/Desktop/arduino-1.8.9/hardware/teensy/avr/libraries/MTP_t4-master/src/MTP_Storage.cpp:180:37: error: conversion from 'FsFile' to non-scalar type 'File {aka File32}' requested
             File child = f_.openNextFile();
                                         ^
    /home/dean/Desktop/arduino-1.8.9/hardware/teensy/avr/libraries/MTP_t4-master/src/MTP_Storage.cpp: In member function 'virtual uint32_t MTPStorage_SD::Create(uint32_t, bool, const char*)':
    /home/dean/Desktop/arduino-1.8.9/hardware/teensy/avr/libraries/MTP_t4-master/src/MTP_Storage.cpp:333:38: warning: large integer implicitly truncated to unsigned type [-Woverflow]
           OpenFileByIndex(ret, FILE_WRITE);
                                          ^
    In file included from /home/dean/Desktop/arduino-1.8.9/hardware/teensy/avr/libraries/MTP_t4-master/src/MTP.cpp:30:0:
    /home/dean/Desktop/arduino-1.8.9/hardware/teensy/avr/libraries/MTP_t4-master/src/MTP.h:64:70: warning: 'used' attribute ignored [-Wattributes]
       uint8_t data_buffer[MTP_RX_SIZE] __attribute__ ((used, aligned(32)));
                                                                          ^
    /home/dean/Desktop/arduino-1.8.9/hardware/teensy/avr/libraries/MTP_t4-master/src/MTP.cpp: In member function 'void MTPD::read_until_short_packet()':
    /home/dean/Desktop/arduino-1.8.9/hardware/teensy/avr/libraries/MTP_t4-master/src/MTP.cpp:431:42: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
             done = *((uint32_t *) data_buffer) < MTP_RX_SIZE;
                                              ^
    Error compiling for board Teensy 4.0.
    This is beyond my capabilities unfortunately.

    The TeensySdioDemo example provided in the beta version of SdFat works fine.

  11. #86
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,432
    Quote Originally Posted by xenington View Post
    "SdFat-Beta.h not found"
    This is a consequence of using SdFat-Beta together with SdFat.
    Please open SdFat-Beta and rename SdFat.h into SdFat-Beta.h

    You can use also SdFat (as you do) but then there is no ExFat support (which my application needs) and the "FsFile" must be converted to "File".

    At the moment I still debug some issues with copying files from PC to Teensy and to make sure it still works also on T3.6.
    keep an eye on Github updates.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •