11/26/2020 06:42 AM <DIR> .
11/26/2020 06:42 AM <DIR> ..
11/20/2020 06:09 AM 82,370 boards.txt
11/05/2020 07:03 AM <SYMLINKD> cores [d:\GitHub\cores]
11/01/2020 08:33 AM <DIR> cores_release
11/19/2020 03:59 PM 10,885 keywords.txt
11/19/2020 03:59 PM <DIR> libraries
11/26/2020 06:42 AM 6,878 platform.txt
11/26/2020 06:42 AM 6,263 platform.txt.notyqt
4 File(s) 106,396 bytes
5 Dir(s) 736,613,765,120 bytes free
C:\arduino-1.8.13\hardware\teensy\avr>
PS D:\GitHub\MTP_t4\scripts>
PS D:\GitHub\MTP_t4\scripts> .\MTPreset.ps1
.\MTPreset.ps1 : File D:\GitHub\MTP_t4\scripts\MTPreset.ps1 cannot be loaded. The file
D:\GitHub\MTP_t4\scripts\MTPreset.ps1 is not digitally signed. You cannot run this script on the current system. For
more information about running scripts and setting execution policy, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ .\MTPreset.ps1
+ ~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
PS D:\GitHub\MTP_t4\scripts>
Looks like by default scripts are not allowed to run by default on Window 10 client machines...
#if !__has_include("usb_mtp.h")
#include "usb1_mtp.h"
#endif
#undef USB_DESC_LIST_DEFINE
#include "usb_desc.h"
#if defined(__IMXRT1062__)
// following only while usb_mtp is not included in cores
#if __has_include("usb_mtp.h") || defined(_USE_USB_MTP_H_)
#include "usb_mtp.h"
#else
#include "usb1_mtp.h"
#endif
#endif
I don't know what MTPspiffs_t41 is, if it is another port of MTP then you should eliminate one (MTP_t4 or MTPspiffs_t41)But I think I have (core, MTP_t4, MTPspiffs_t41, LittleFS synced)... I just synced SD again, not sure what else.
Thanks
I don't know what MTPspiffs_t41 is, if it is another port of MTP then you should eliminate one (MTP_t4 or MTPspiffs_t41)
Not sure how Arduino searches the libraries.
if cores/Teensye for has usb_mtp.h included then my example code should not call usb1_mtl.h
So this explains @KurtE's problems.Does still use usb1_mtp.h .
#include "MTPspiffs.h"
#include "usb1_mtp.h"
MTPStorage_SPIFFS storage;
MTPD mtpd(&storage);
#if __has_include("usb_mtp.h") || defined(_USE_USB_MTP_H_)
#if defined(__IMXRT1062__)
// following only while usb_mtp is not included in cores
#if __has_include("usb_mtp.h") || defined(_USE_USB_MTP_H_)
#include "usb_mtp.h"
#else
#include "usb1_mtp.h"
#endif
#endif
while(!Serial);
while(!Serial && (millis() < 5000));
{ if(!spifs[ii].begin(lfs_cs[ii])) { Serial.printf("No SPIFlash storage(%d:%d)\n", ii, lfs_cs[ii]); while(1);}
#if USE_LFS_SPI==1
for(int ii=0; ii<nfs_spi;ii++)
{
if(!spifs[ii].begin(lfs_cs[ii])) {
Serial.printf("No SPIFlash storage(%d:%d) - skipping \n", ii, lfs_cs[ii]);
} else {
storage.addFilesystem(spifs[ii], lfs_spi_str[ii]);
uint64_t totalSize = spifs[ii].totalSize();
uint64_t usedSize = spifs[ii].usedSize();
Serial.printf("Storage %d %d %s ",ii,lfs_cs[ii],lfs_spi_str[ii]); Serial.print(totalSize); Serial.print(" "); Serial.println(usedSize);
}
}
#endif
I did this before with T3.6, an external button interrupt was used to break flag.Suggestions on the test sketch...
I try to avoid forever loops...
while (globaltime < 3000) { // elapsed millis globaltime
mtpd.loop();
while (connection) { // a boolean flag inserted in mtp.h after establishing connection
mtpd.loop();
if (f_Break) {
break;
}
}
if (f_Break) {
break;
}
}
@KurtE
the example is only meant to to have a test case for me and others and at the same time to give an example on how it could be used.
So, all what you say is fine, but IMHO it is an exercise to the user to adapt the examples to own configuration, OS and programming style.
e.g. I remove from all examples the millis()<xxxx clause, because I always want the program to wait on terminal while programming. For my production runs, I disable anyway the wait(!Serial); statement
Note, I believe I have a version of the code working with MTP Disk and SEREMU.
Simply the Interface numbers in usb_desc.h need to match the order of which the interface descriptors are output in usb_desc.c.
And in this case the SEREMU is output before MTP_DISK is EMU is 0 and MTP_DISK is 1.
a quick test did not work for me
(difficult to understand, why this would matter)
will try tomorrow morning again
Congrats on finding the list mis-order for function @KurtE <edit - crosspost > ... at least for your use case
As far as samples - simple samples are awesome when they work. But if it isn't something all users have on the same fixed pins it is nice to have the options called out - even if just comments!
For Example: I got a Prop Shield where the AMP burns hot years back - never got dealt with - thought I saw a loose solder shard between the ("TINY") AMP pins and knocked it loose. So I opened a Talkie Example - then another or two - ( I spent a lot of time with Talkie giving it an ASYNC QUE for sounds - and with Beta Prop Shield ) and looking at the sample that said PROP I had no idea what pins were what - final sketch uploaded though and seemed to work ... at least enough to feel the AMP too hot to touch still - but never did get sound. Would have had to resort to reading code - like does it use A21 or A22 DAC on T_3.6 ... @mjs513 did that sample and as labeled for PROP it did the right thing - though not hearing anything with another Prop LC ... speaker still quiet after a few minutes - reading code, alternate speaker , ... so not sure what I'm missing ...
@mjs513 - with TD1.54b5 ... Maybe Talkie on T_3.6 is broken ?
void setup() {
//voice.beginPWM(9); // specify PWM pin to be used
voice.beginPropShield(); // use if a propshield is attached using for talkie
delay(10);
voice.say(spDINER);
}
operator bool() { return usb_configuration; }
operator bool() { return usb_configuration && usb_seremu_online; }
#if defined(USB_MTPDISK_SERIAL)
while(!Serial); // comment if you do not want to wait for terminal
#else
while(!Serial.available()); // comment if you do not want to wait for terminal ( otherwise press any key to continue)
#endif
Serial.println("MTP_test");
Serial.println(usb_configuration);
Serial.println(usb_seremu_online);
MTP_test
1
0