Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 13 of 13

Thread: Teensy 4.1 flash memory support (LittleFS)

  1. #1
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,009

    Question Teensy 4.1 flash memory support (LittleFS)

    I wasn't sure if this should go in the 1.54 beta 5 thread, or one of the other threads. I haven't been closely following a lot of the work that is going on.

    I was wondering where we are in terms of being able to use LittleFS memory and more easily move files to/from the memory.

    Ideally long term, I imagine what we want to do is have a mode that exports a removable USB filesystem, much like Adafruit does with their boards that support CircuitPython. Are we there yet, or do people see this might happen shortly? Even if it won't be available for a bit, is somebody working on this?

    Short term, it may be useful to hack Teensy Transfer to deal with QSPI flash and LittleFS. I glanced at my hacked version of Teensy Transfer that now supports the Teensy 4.x processors, and I suspect it won't be too much work. But I'd rather use a USB removable filesystem if it will be available soon.

    Also, I know one of the goals of 1.54 is to add a shim layer to interpose different filesystems, so that we don't have to have n different versions of the audio play from memory, SD card, flash memory, etc. functions. Do we have this in beta 5 or is it still WIP?

    Thanks in advance.

  2. #2
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    8,219
    Agreed. There should be a better way than TeensyTransfer.

  3. #3
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    13,700
    Quick read here - only 26 forum pages :: pjrc.com/threads/43050-MTP-Responder-Contribution

    Some version of this is WIP and has PR's AFAIK for possible TD 1.54 B6

    It allows Read/Write access to any LittleFS or Other.

    Not sure if the main source is this :: github.com/WMXZ-EU/MTP_t4

    Or perhaps one of the 5 branches here :: github.com/KurtE/MTP_t4

  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    13,700
    Inclusion seems to be beta 6 pending - note on PR inclusion 7 hours ago : github.com/PaulStoffregen/cores/pull/532

    @MM - does this MTP functionality address your issue? Allows PC over USB transfer of data from a Teensy from various sources.

  5. #5
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    6,712
    @MM - had the most luck with @KurtE's https://github.com/KurtE/MTP_t4/tree/SendObject_yield branch. He has made a bunch of changes but I haven't tried them yet. There seems to be a wall with file transfer size from the PC to the Teensy Flash. Haven't really touched MTP for quite a while now.

  6. #6
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,009
    Quote Originally Posted by defragster View Post
    Inclusion seems to be beta 6 pending - note on PR inclusion 7 hours ago : github.com/PaulStoffregen/cores/pull/532

    @MM - does this MTP functionality address your issue? Allows PC over USB transfer of data from a Teensy from various sources.
    Well, in theory it should work, but I had trouble getting to work.

    I downloaded https://github.com/PaulStoffregen/cores.git and replaced those files in a copy of my current Teensy 4.1.

    I used the mtp-test.ino example in KurtE's MTP_t4.git and installed it on my Teensy 4.1 (changing the USB type to MTP-disk).

    In running the script, I see a new USB type:
    Code:
    Bus 003 Device 048: ID 16c0:04d1 Van Ooijen Technische Informatica Teensy MTP Disk
    I expected the disk to be auto mounted on my Fedora 33, but it wasn't mounted.

    So with a little poking around, I tried:
    Code:
    $ sudo mount 'mtp://[usb:16c0,04d1]' ~/tmp/disk2
    The mount command hung and there were no files in ~/tmp/disk2.

    So if there are some hints of how to run it on a Linux system, it would be helpful.

  7. #7
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    13,700
    @MM - my hint and plan >> Wait for TD 1.54 B6

    I tested it early and saw some function - but improvements and edits with events and timing and dueling source trees and edit to base USB function (seremu, serial, usb1 or usb2, ???).

    Reading that thread there are too many moving pieces to assemble them by hand given the nature of the problems seen { and my spotty attention } before and after that made the changes needed.

    Once Beta 6 is 'tested/released' It will either be working right or better for future improvements from a common code base.

    ... So I've been ignoring it for other distractions - but will test in Beta 6 - or before if Paul exposes a set of updated CORES (libs?) expected to work before Beta 6 goes live to release.

  8. #8
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    6,712
    @MM

    If you are using Kurt's branch you will probably have to download the latest core as well. Don't know if you have it installed or not but you may need WMXZ USB2 library as well.

    Don't use Linux so can't be much help on that end.

    EDIT: one not @WMXZ's repository does work so maybe you should start with that before working off of @KurtE's. That's been the baseline. But again probably need updated core files as well. Paul did pull those changes in the core so as Tim said maybe wait for Beta6.

  9. #9
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    13,700
    No linux here - ( though did just see a WSL Windows update come through on latest 20H2 build ???). KurtE can use linux - not sure if he did - or what WMXZ tests on?

    Hopefully Paul gets the needed PR's for inclusion into CORES and beyond (libs?) as needed for a good start for function. It was posted as on his list now that T_4.1 card back and bootloader chip are in production. So suspect he'll test or hopefully pre-post as noted the intended parts to get the best of what KurtE and WMXZ have produced.

  10. #10
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,009
    I think I will wait until beta 6 comes out. Hopefully the necessary patches will be present. It is good to see the things coming together however.

  11. #11
    Senior Member wwatson's Avatar
    Join Date
    Aug 2017
    Posts
    421
    @MichaelMeissner - I use Ubuntu 18.04. it has been a while since I played with MTP_T4, but I did have it sort of working with Linux. Linux would auto mount all of the drives and I could copy files back and forth between the Teensy and Linux. But if I tried to delete files on the Teensy with MTP it would not actually delete the files. I was using Paul's breakout board with the memory board. With all of the development happening with file systems, I also am waiting for beta 6. Was thinking about trying to add USB Mass Storage to MTP but that seemed to be redundant as you could simply use a thumb drive to transfer files from the Teensy to a PC or the other way around.
    Anyway I do know it will work with Linux. Not sure whose version of MTP_T4 I was using. Have to find it

  12. #12
    Senior Member
    Join Date
    Jul 2014
    Posts
    3,117
    Quote Originally Posted by MichaelMeissner View Post
    So with a little poking around, I tried:
    Code:
    $ sudo mount 'mtp://[usb:16c0,04d1]' ~/tmp/disk2
    @MM, I do not use Linux, but when a colleague of mine used my system (early T3.6 version) on Linux (embedded Ubuntu derivative) and I was looking over his shoulders, the mount command was different, and there was also something about 'fuse'. If Covid allows I will ask him on Monday.

  13. #13
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,009
    Quote Originally Posted by WMXZ View Post
    @MM, I do not use Linux, but when a colleague of mine used my system (early T3.6 version) on Linux (embedded Ubuntu derivative) and I was looking over his shoulders, the mount command was different, and there was also something about 'fuse'. If Covid allows I will ask him on Monday.
    Thanks. I had no idea of what commands to use. FWIW, fuse is the layer to add user file systems, but I didn't see a fuse specific to mtp, and I was just trying the low level mount option. I just tried simple-mtpfs -l but it doesn't see that there are any RAW MTP devices.

Posting Permissions

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