If you stick with microSD cards (as I do it) the actual MTP_t4
https://github.com/WMXZ-EU/MTP_t4 is a reasonable solution.
Obviously feel free to follow the MTP responder thread or wait until Paul includes MTP to Teensyduino
I took a quick look at the GitHub repository and I will probably try implementing it later today. A few things still bother me:
1. The endpoint definitions are different between the T3 and T4 cores in usb_desc.h:
in the T4 Code:
Code:
#define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_UNUSED + ENDPOINT_TRANSMIT_INTERRUPT
#define ENDPOINT3_CONFIG ENDPOINT_RECEIVE_BULK + ENDPOINT_TRANSMIT_BULK
in the T3 Code:
Code:
#define MTP_INTERFACE 2 // MTP Disk
#define MTP_TX_ENDPOINT 4
#define MTP_TX_SIZE 64
#define MTP_RX_ENDPOINT 5
#define MTP_RX_SIZE 64
#define MTP_EVENT_ENDPOINT 6
#define MTP_EVENT_SIZE 32
#define MTP_EVENT_INTERVAL 10
#define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
#define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
#define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
#define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
#define ENDPOINT5_CONFIG ENDPOINT_RECEIVE_ONLY
#define ENDPOINT6_CONFIG ENDPOINT_TRANSMIT_ONLY
For the T4, one endpoint is used for both receive and transmit, while on the T3 side, there are separate endpoints for receive and transmit. Also, the defines for
the endpoints are different and depend on earlier #defines which are different. I wonder if it would be possible to set up both the T3 and T4 to use the same endpoint definitions---adjusting the earlier #defines as required. I ran across these issues a few days ago when I wanted to port the T4 version of MTP to the T3. I found that simply cutting the T4 defines and pasting into the T3 usb_desc.h required a lot of adjustments.
Another thing that would be nice---but I haven't figured out how to do it: Is there a way to add the new MTP descriptors to usb_desc.h without actually editing the file? I'm thinking of something like a "soft include" in usb_desc.h that would add the source from an external file if the file is present, but not cause the build to fail if the file is not present. It seems like it should be possible, but I have little experience with makefiles as I've relied on RADs like Arduino, C++ Builder, and IAR Embedded Workbench to handle the makefile generation for me. @luni proposed a similar solution in a post back in November:
Code:
#pragma once
#if __has_include("userConfig.h")
#include "userConfig.h"
#else
#include "defaultConfig.h"
#endif
Another point: I've seen references to "boards.local.txt" as a way to add to capabilities enumerated in "boards.txt". Is that capability defined and discussed somewhere?