digistump / DigistumpArduino

Files to add Digistump support (Digispark, Pro, DigiX) to Arduino 1.6.X (1.6.5+)
934 stars 377 forks source link

Attiny-85 Uploading sketch without bootloader #112

Closed HarryWickham closed 4 years ago

HarryWickham commented 4 years ago

I have written a sketch but when I try to compile it I get the error:

Sketch uses 7520 bytes (125%) of program storage space. Maximum is 6012 bytes. Global variables use 72 bytes of dynamic memory. Sketch too big; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing it. Error compiling for board Digispark (Default - 16.5mhz).

And as the Attiny 85 has 8Kb of program storage, is there a way to upload this sketch without the 2Kb bootloader? Many thanks.

EDIT: I have switched one library for a smaller one and reduced it to use 6838 bytes. The libraries I am using are DigisparkOLED.h (https://github.com/digistump/DigistumpArduino/blob/master/digistump-avr/libraries/DigisparkOLED/DigisparkOLED.h) and Small_dht.h (https://mchp.blogspot.com/2016/11/wireless-dht22-sensor-20-using-attiny85.html)

pfeerick commented 4 years ago

I don't think so. And if you did, you would not be able to write another program to it, as the bootload is what presents the Digispark as a USB device and writes the new code to the Digispark. If you need to persue this path, I would be looking at ISCP/ISP programming of the attiny85 on the Digispark and possibly also using Spence Konde's ATTinyCore board support package.

On Sat, 4 Apr 2020, 7:01 am Harry Wickham, notifications@github.com wrote:

I have written a sketch but when I try to compile it I get the error:

Sketch uses 7520 bytes (125%) of program storage space. Maximum is 6012 bytes. Global variables use 72 bytes of dynamic memory. Sketch too big; see http://www.arduino.cc/en/Guide/Troubleshooting#size http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing it. Error compiling for board Digispark (Default - 16.5mhz).

And as the Attiny 85 has 8Kb of program storage, is there a way to upload this sketch without the 2Kb bootloader? Many thanks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/digistump/DigistumpArduino/issues/112, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJ66KP3E4VGC2F7Y6XLIHTRKZFC7ANCNFSM4L4OAR7Q .

HarryWickham commented 4 years ago

Many thanks for the reply, I will look into it in due course.

ArminJo commented 4 years ago

Use the optimized digistump version, it enables around 20% more FLASH.

ArminJo commented 4 years ago

Please could you be so kind and close the issue, since this repo is abandoned. Thank you! Armin