Open jcummings2 opened 3 years ago
thank you for detail issue report, please post your sketch as attached file for readability. Also I cannot reproduce your issue, since I don't have the MX25L25673G device. Please try to reproduce it with one of the Adafruit board without any hardware modification.
I have updated 1st post to make it easier to follow. but I still cannot reproduce your issue due to your sketch using additional flash device that I don't have. Can you try to reproduce this on one of adafruit M0 board that has on-board flash and update the sketch accordingly.
Here is a new msc_sdfat_bug.ino sketch and a new set of results run against an Adafruit Feather M0 Adalogger with a microSD card inserted. The sketch is based on the msc_sdfat.info sample.
Results follow the same naming convention as above. The results are almost all the same. Interestingly, I could only get the computer_none_brick_computer
scenario to behave correctly 1 out of the 3 times I ran it. With the external flash it appeared to behave correctly every time.
ready_chargerAmazon_none_computer_chargerAmazon.txt ready_chargerSamsung.txt ready_chargerSamsung_none_computer_chargerSamsung.txt ready_computer.txt ready_computer_none_brick_computer_0.txt ready_computer_none_brick_computer_1.txt ready_computer_none_brick_computer_2.txt ready_computer_none_chargerAmazon_computer.txt ready_computer_none_chargerSamsung_computer.txt ready_brick.txt ready_brick_computer_brick_0.txt ready_brick_none_computer_brick.txt ready_chargerAmazon.txt
most of other adafruit has external flash on board, is your Feather M0 an non-express version without spi flash on it ? Do you have any other M0, M4 board to test with.
most of other adafruit has external flash on board, is your Feather M0 an non-express version without spi flash on it ? Do you have any other M0, M4 board to test with.
Correct, the Feather M0's I have are the non-express version that do not have external flash onboard and I don't have any M4 boards. I believe the first firmware above should work with minor modifications to point at the onboard external flash.
Operating System
Windows 10 for host
Board
Adafruit Feather M0 with added flash and battery including switch
Firmware
This firmware is based on the msc_external_flash sample. It was run with the Adafruit TinyUSB library version 1.4.0.
msc_external_flash_bug.ino
See also alternate msc_sdfat_bug.ino firmware below for use on an Adafruit Feather M0 Adalogger.
What happened ?
As mentioned in discussion 597 The
tud_ready()
function sometimes incorrectly returns true if the board was first connected to a computer, disconnected then connected to a charge-only source.How to reproduce ?
To test a different sequence, delete the ready.txt file. I have attached several log files with file names denoting the connection order with devices separated by an underscore. Each connection (or lack thereof in the case of
none
) was for about 10 seconds. The names correspond to:Notice that I ran the
computer_none_brick_computer
scenario 3 times (file names ending in 0, 1 and 2). It is the only case that seemed to behave correctly. However, thebrick_none_computer_brick
case did not yield the desired results (I ran that one twice as well just to confirm).ready_chargerSamsung.txt ready_chargerSamsung_none_computer_chargerSamsung.txt ready_computer.txt ready_computer_none_brick_computer_0.txt ready_computer_none_brick_computer_1.txt ready_computer_none_brick_computer_2.txt ready_computer_none_chargerAmazon_computer.txt ready_computer_none_chargerSamsung_computer.txt ready_brick.txt ready_brick_none_computer_brick_0.txt ready_brick_none_computer_brick_1.txt ready_chargerAmazon.txt ready_chargerAmazon_none_computer_chargerAmazon.txt
Debug Log
Didn't capture but can re-run the pertinent scenario(s) if needed.
Screenshots
N/A