Without flushing STDOUT, the upload script's output aften are buffered
and not displayed until it completes. Add in flush commands to allow
the IDE to display status as it changes.
Stop the IDE from reporting large "Serial port not fount"-type errors after
every upload by delaying a bit before the uploader exits to give the OS/Pico
time to renegotiate.
Fixes flashing problems on certain Linux distros by checking all possible mount
locations instead of only the first one to be found.
Make 1200bps reset tickle more robust
Co-authored-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
Fixes#1140
````
Converting to uf2, output size: 134144, start address: 0x2000
ERROR: Unable to execute powershell or wmic commands, can't continue.
ERROR: Please make sure either PowerShell or WMIC is installed and in
your %PATH%.
````
Remove MIDI support from the core's main TinyUSB. MIDI is still supported
using the Adafruit TinyUSB library, just like before (the core never
did use it).
Compile the Pico-SDK using `-Os`
Remove unneeded warning in UF2 upload
Blink.ino shows a savings of 3.5KB flash and 400 bytes of RAM.
For comparison, with this PR blink.ino reports:
````
Sketch uses 49908 bytes (3%) of program storage space. Maximum is 1568768 bytes.
Global variables use 7024 bytes (2%) of dynamic memory, leaving 255120 bytes for local variables. Maximum is 262144 bytes.
````
As comparison, using the MBED core blink.ino reports:
````
Sketch uses 78882 bytes (0%) of program storage space. Maximum is 16777216 bytes.
Global variables use 42780 bytes (15%) of dynamic memory, leaving 227556 bytes for local variables. Maximum is 270336 bytes.
````
So, with this PR we use **37% less flash** and and **87% less RAM**
for simple sketches.
Fixes#609 and a niggling slowness in uploads. Try to find the drive
in a loop for 10 seconds, instead of only checking once after 10 seconds.
Avoid 100% CPU usage while waiting for Pico drive
Microsoft is deprecating WMIC, so fall back to a Powershell call in
case of failure to ruin WMIC.
Belt and suspenders, set PowerShell non-interactive mode and null STDIN.
Fixes#27
As @vslinuxdotnet discovered, sometimes the Pico firmware update emulated USB
stick does not get automounted under Linux. Add logic to attempt to use
standard tools to mount it to the uploader, only tried if no drives are
detected normally.
Sketch upload to serial port fails on macos because the Arduino IDE uses the callout device "/dev/cu". Adding recognition of "/dev/cu" to uf2conv.py makes the sketch upload work.