ArminJo / micronucleus-firmware

Fork for the firmware / digispark part of the micronucleus repository
Other
81 stars 20 forks source link

drop strings to save 28 bytes #10

Closed nerdralph closed 4 years ago

nerdralph commented 4 years ago

Although mn doesn't use vendor, product, or configuration strings, it still builds in string0 (language string descriptor). Removing this code, saves 28 bytes. You can test it without actually removing the code by changing the config: #define USB_CFG_DESCR_PROPS_STRINGS 1

drawkula commented 4 years ago

Please let some space be there for making them unique on the bus (serial number?).

nerdralph commented 4 years ago

Please let some space be there for making them unique on the bus (serial number?).

What would be the point of that? The upload tool only supports one device with the bootloader being plugged in.

drawkula commented 4 years ago

...and the USB information for using e.g. a T85 as USB serial is different and hides elsewhere?

nerdralph commented 4 years ago

...and the USB information for using e.g. a T85 as USB serial is different and hides elsewhere?

WTF are you talking about? Micronucleus is a bootloader, not a USB-CDC implementation.

drawkula commented 4 years ago

You're soooo friendly. Thanks!

Ho-Ro commented 4 years ago

@nerdralph Good proposal!

I've built a test version (default setup) with #define USB_CFG_DESCR_PROPS_STRINGS 1 and its size drops under the page boundary -> 64 more bytes: Available space for user applications: 6650 bytes

Building Micronucleus configuration: t85_test
Size of binary hexfile. Use the data size to calculate the bootloader address:
   text    data     bss     dec     hex filename
      0    1514       0    1514     5ea main.hex

Building Micronucleus configuration: t85_default
Size of binary hexfile. Use the data size to calculate the bootloader address:
   text    data     bss     dec     hex filename
      0    1542       0    1542     606 main.hex

System: debian stable, gcc version 5.4.0 (GCC)