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

Thread: Teensy 3.6: Can I see the microSD as a pendrive?

  1. #1

    Teensy 3.6: Can I see the microSD as a pendrive?

    Hi guys,
    I'm working on a cataloguer that will store on the internal SD of my Teensy v3.6 some log files.... after a run Ill have to remove the microSD and read the content from my PC/MAC... is there a way to not remove the microSD and see its content just connecting the Teensy to the USB as a pendrive?

  2. #2
    Yes, but the code is still at experimental level.

    Search this forum for MTP RESPONDER.

    I found I had to disable the MTP interupt whenever accessing the SD card for logging or my logs would stop as soon as this interupt fired.

  3. #3
    wow! That's really ineresting!
    I'll give it a look thanks.

    So if I understood I have to disable MTP interrupt while writing on the SD card and re-enabling it when finished correct?
    What about the USB port: can I still use it to program the device and to get the Serial dump messages?
    My tipical scenario could be:
    I connect my Teensy to the bike and it will log on the SD card some info and I can also read some value or configure parameters via Serial interface...
    After one or more runs I'll disconenct the Teensy and when back at home I'd like to copy the files from SD card in a simple way (now I have to remove the card and put on a card reader).
    I have a menu on the Serial interface so I can decide to enable or disable the MTP via menu if needed or any other idea is appreciate

  4. #4
    I have only done limited testing so far, but from my experience, yes you can do all that you want to do.
    If you make sure all of your SD card access starts with an interupt disable and finishes with an interupt enable, then all is well. Not yet tried serial comms while logging ( I use a switch on my car to start and stop logging, then connect PC to download logfile after a session )

    You may find that you do not need to start/stop the interupt if you are not using folders and are writing to a single location on the root of the SD card. I have folders for date and time and for binary and ascii data, and my very wild guess is that folder traversing for logging and MTP are conflicting. I have tried adding SD Class instances to avoid this conflict, but drowned myself though lack of coding ability & understanding.

    When browsing files through the USB/MTP interface on a computer, I found at times I could not delete multiple files and/or folders. Siingle item deletes were OK so for me this issue is painful but acceptable.

  5. #5
    Thanks you so much!
    I'm trying the MTP and it seems to works fine but if I write a file on SD while the Teensy is connected to the PC I can't see the new file even if I refresh with F5 key... if I disconnect and reconnect the Teensy it comes up.

    Is this issue what you have solved disabling the interrupt? How to disable and reenable that interrupts?

  6. #6
    No - this issue with modifications to SD files by the Teensy not being seen by the PC I think is normal behaviour and is not solved by disabling re-enabling the interupt.
    (This is OK for my application as I am either logging, or downloading, but never both together.)

  7. #7
    Ok, I think it will be fine olso for me!

    My datalogger also have a menu that I access via COM serial and Putty.... is it possible to use both MTP and Serial communication with Putty?

  8. #8
    Sorry I have not tried putty or other OS's other than Win7. I am interested in anything you discover though so please post any success or limitations you find.

  9. #9
    Ok, keep in touch!

  10. #10
    Just testing and... I can't find a way to modify or overwrite a file contained in the SD from the Windows fiel explorere.
    I'm able to remove files but if I open a file (I have a configuration file fro my app) and modify its content I loose the modification....

    Any idea?

  11. #11
    Tested and same result here. Workaround is drag config file from SD to windows desktop, file edit and save to desktop, drag file to SD and the modifications are there OK.

  12. #12
    I've tried copying the file do desktop, modifying and replace on the SD but I got an empty file....

Posting Permissions

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