Unverified Commit 1d6f66f8 authored by Earle F. Philhower, III's avatar Earle F. Philhower, III Committed by GitHub

Shrink flash and RAM usage even more (#627)

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.
parent 3fb8cbf3
No preview for this file type
...@@ -21,6 +21,7 @@ target_compile_definitions(pico PUBLIC ...@@ -21,6 +21,7 @@ target_compile_definitions(pico PUBLIC
target_compile_options(pico PUBLIC target_compile_options(pico PUBLIC
-fno-exceptions -fno-exceptions
-Os
$<$<COMPILE_LANGUAGE:CXX>:-fno-rtti> $<$<COMPILE_LANGUAGE:CXX>:-fno-rtti>
) )
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
#define CFG_TUD_HID (2) #define CFG_TUD_HID (2)
#define CFG_TUD_CDC (1) #define CFG_TUD_CDC (1)
#define CFG_TUD_MSC (0) #define CFG_TUD_MSC (0)
#define CFG_TUD_MIDI (1) #define CFG_TUD_MIDI (0)
#define CFG_TUD_VENDOR (0) #define CFG_TUD_VENDOR (0)
#define CFG_TUD_CDC_RX_BUFSIZE (256) #define CFG_TUD_CDC_RX_BUFSIZE (256)
......
...@@ -350,7 +350,7 @@ def main(): ...@@ -350,7 +350,7 @@ def main():
ser = serial.Serial(args.serial, 1200) ser = serial.Serial(args.serial, 1200)
ser.dtr = False ser.dtr = False
except: except:
print("Caught exception during reset!") pass # Ignore error in the case it is already in upload mode
except: except:
pass pass
if args.list: if args.list:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment