Arduino Forum

Development => Suggestions for the Arduino Project => Topic started by: smeezekitty on Jul 04, 2011, 08:29 am

Title: Upload without recompiling
Post by: smeezekitty on Jul 04, 2011, 08:29 am
I know it would seem fairly useless at first thought to have the IDE upload without recompiling but, there are various legitimate reasons especially since compiling is quite slow. Here is a non-exhaustive list of reasons I can think of:
Code: [Select]

* Uploading the exact "sketch" to multiple Arduinos
* Re-uploading if the Arduino looses the "sketch" somehow
* If you do low level compiler twiddling on the command line and you do not want to fool with AVRDUDE directly
* Debugging upload trouble without waiting for full compilation each time
* You accidentally hit the "Verify" button and you don't want to wait again  :smiley-mr-green:
* It would also allow more rapid switching between two "sketches" if they are already compatable

That said, I would think a(n) "Upload without compilation" should be added, even on the menu bar.


-edit: fixed title
Title: Re: Upload with recompiling
Post by: mmcp42 on Jul 04, 2011, 09:42 am
I agree
I have more sketches than Arduinos
often just want to (re)load another sketch

Also
I often, while developing, "compile" (verify) while making changes
once I'm happy I just want to upload, not compile again

so - gets my vote too!
Title: Re: Upload without recompiling
Post by: PaulS on Jul 04, 2011, 02:41 pm
Hold down the shift key when you press Upload sometime. You'll see that a temporary directory is used to hold the object files and hex files that are involved in the compilation process. Those files are deleted when the upload completes.

Quote
* Uploading the exact "sketch" to multiple Arduinos

Legitimate reason...

Quote
* Re-uploading if the Arduino looses the "sketch" somehow

If this happens, you need a new Arduino. The Arduino doesn't just randomly loose sketches.

Quote
* If you do low level compiler twiddling on the command line and you do not want to fool with AVRDUDE directly

Well, now, how are you going to do the first part without doing the second part? If you are comfortable doing the first part, you should be able to do the second part.

Quote
* Debugging upload trouble without waiting for full compilation each time

Either the Arduino is plugged in or it isn't. Either it is connected to the specified port or it isn't. How much troubleshooting does it take? If it takes much, use a smaller sketch with no libraries.

Quote
* You accidentally hit the "Verify" button and you don't want to wait again

Yeah, OK. Been there, done that.

Quote
* It would also allow more rapid switching between two "sketches" if they are already compatable

What does compatable mean? Every sketch is different.
Title: Re: Upload without recompiling
Post by: robtillaart on Jul 04, 2011, 08:39 pm

Quote
That said, I would think a(n) "Upload without compilation" should be added, even on the menu bar.


Google the AVRdude command, it can do just that. hold the shift key when uploading to see the details of the command.

Title: Re: Upload without recompiling
Post by: smeezekitty on Jul 04, 2011, 09:28 pm
Let me clarify. The GCC port to windows is SLOW. Compiling blink takes 60 seconds and bigger sketches longer. No there is nothing wrong with the computer. It has dual core and 2GB ram. MingW gcc is very slow as well. No excessive CPU consumption, just slow. Adding a upload button with would trivial by not deleting the hex file and running the avrdude command. It could be hidden on the pull down menu.
Title: Re: Upload without recompiling
Post by: retrolefty on Jul 04, 2011, 09:33 pm
Quote
Those files are deleted when the upload completes.


Deleted when upload completes, or when the IDE is closed? I could swear I dug down once using the temp folder path with windows file explorer and found the hex file that I had just uploaded?

Lefty

Title: Re: Upload without recompiling
Post by: CrossRoads on Jul 04, 2011, 09:37 pm
Compiling Blink takes 60 seconds for you!  Whoa!
My Sony Vaio/Vista with Core 2 Duo T6400, 2 GHz,does it in 9 seconds while playing MP3s.
You have some funny settings turned on or something?

Even this sketch only took 17 seconds:

Binary sketch size: 13836 bytes (of a 14336 byte maximum) (168 Deumilanove selected)

Binary sketch size: 13836 bytes (of a 30720 byte maximum) (327 Duemilanove selected)
Title: Re: Upload without recompiling
Post by: robtillaart on Jul 04, 2011, 09:41 pm

You can download the hexfile after uploading it with AVRdude too ........

Quote
Let me clarify. The GCC port to windows is SLOW.

Try ubuntu as second OS ... ?
Is it faster?
Title: Re: Upload without recompiling
Post by: smeezekitty on Jul 04, 2011, 11:23 pm

Compiling Blink takes 60 seconds for you!  Whoa!
My Sony Vaio/Vista with Core 2 Duo T6400, 2 GHz,does it in 9 seconds while playing MP3s.
You have some funny settings turned on or something?

Even this sketch only took 17 seconds:

Binary sketch size: 13836 bytes (of a 14336 byte maximum) (168 Deumilanove selected)

Binary sketch size: 13836 bytes (of a 30720 byte maximum) (327 Duemilanove selected)


I just timed it with a stop watch. Compiling blink took 56s and uploading took 8s.
CPU usage at the time was ~70% and ram usage ~49%.
When uploading sketches that take 25K+ (Audio file encoded in it for playing), it took well over 3 min.
Also, the hex files and objects are NOT deleted until you close the IDE making this very plausible and trivial to add.
Title: Re: Upload without recompiling
Post by: CrossRoads on Jul 04, 2011, 11:38 pm
Well, there's 2 data points at opposite extremes.
I only have a standard install of -0021. Have you done mods to yours?
Title: Re: Upload without recompiling
Post by: smeezekitty on Jul 05, 2011, 12:22 am

Well, there's 2 data points at opposite extremes.

What two data points? The two sketches or the upload and compile?
Quote

I only have a standard install of -0021. Have you done mods to yours?

No "mods" but it is installed in a non-default directory.
Title: Re: Upload without recompiling
Post by: CrossRoads on Jul 05, 2011, 01:00 am
Data points - my 9 seconds and your 1 minute to compile Blink. I don't think it should take that long.
Title: Re: Upload without recompiling
Post by: smeezekitty on Jul 05, 2011, 01:12 am

Data points - my 9 seconds and your 1 minute to compile Blink. I don't think it should take that long.

Definitely not. But a upload without compile could still be useful at these speeds.
Title: Re: Upload without recompiling
Post by: robtillaart on Jul 05, 2011, 04:13 pm

@smeezekitty

Can you check in the taskmanager if the compiler starts swapping memory to disk and back?

What other apps do you run simultaneous with the IDE?

How much memory has your computer?
Title: Re: Upload without recompiling
Post by: smeezekitty on Jul 05, 2011, 08:56 pm


@smeezekitty

Can you check in the taskmanager if the compiler starts swapping memory to disk and back?

How whould I know?
Quote

What other apps do you run simultaneous with the IDE?

Firefox + taskmanager + calculator + windows (file) explorer. but 116 processes.
Quote

How much memory has your computer?

Two gigabytes. Usually sits around half used.

CPU usage when idle = 33% 65-80% when compiling
Memory when idle = 51% 55-60% when compiling
The computer is fairly fast running things other then compiling and is usable during compiling.
[/quote]
Title: Re: Upload without recompiling
Post by: cyclegadget on Jul 05, 2011, 10:30 pm

My computer at home runs in the low 30's on processes and the one I am sitting at is at 49. You have a lot of add-ons running or something to be show above 100!

Mark
Title: Re: Upload without recompiling
Post by: robtillaart on Jul 05, 2011, 10:35 pm

- sounds not like too much apps or so, although firefox can be a killer app
- disk usage is not extreme either.

Do you have a virusscanner in the background?

which version of the IDE?

Title: Re: Upload without recompiling
Post by: smeezekitty on Jul 06, 2011, 12:04 am


- sounds not like too much apps or so, although firefox can be a killer app

Yes. Firefox is the reason the CPU is not 1%
Quote

Do you have a virusscanner in the background?

Yes
Quote

which version of the IDE?



0021
Title: Re: Upload without recompiling
Post by: mowcius on Jul 06, 2011, 10:20 am
Quote
If this happens, you need a new Arduino. The Arduino doesn't just randomly loose sketches.

The Arduino Uno bootloader shipped with the first batch can cause arduino boards to not remember their sketch but that just means you need to load the new bootloader.

I think that an 'upload from hex' could be quite useful - Yes we can do it with another program but that's not the point.

And of course a better location for the hex would be good too.
Title: Re: Upload without recompiling
Post by: CrossRoads on Jul 06, 2011, 03:08 pm
@mowcius,
any thoughts on smeezekitty's really slow compile times? See Replys #8,9 in this thread. 56 seconds to compile "blink" sketch?
Title: Re: Upload without recompiling
Post by: mowcius on Jul 06, 2011, 03:16 pm
I'm afraid I've got no idea on that - my 1.8Ghz with 1GB RAM only takes 15 seconds or so to compile blink (or similar - haven't timed it)

I haven't seen any solutions anywhere else either.
Title: Re: Upload without recompiling
Post by: smeezekitty on Jul 07, 2011, 09:39 am
I don't really mind the delay because I use it to work on hardware etc. But uploading without recompiling would be very helpful.
Title: Re: Upload without recompiling
Post by: superman54f on Nov 09, 2018, 11:26 am
i think he forgot to change board type or maybe he choose wrong board on the tools> board
and check also the comport.
Title: Re: Upload without recompiling
Post by: AndyDev on Mar 06, 2019, 02:26 am
From what I can work out the buttons are "Verify/Compile" and "Upload", however their functions are "Verify/Compile" and "Verify/Compile/Upload" it's a bit frustrating. At least an 'On Upload dont recompile if sketch unchanged' checkbox would be nice in preferences, or have the buttons do what they say, or maybe a 3rd or something.
Title: Re: Upload without recompiling
Post by: Marttyn on May 10, 2019, 08:32 pm
I fully support this. We had to deploy the same program to 10 Arduino Mega. Compile took about 1 minute on each upload, even when the HEX was not changed.
Is there any program that can upload an HEX that is simple enough and with GUI? Dont want to mess with fuses, clock speeds or anything... just select which arduino, which port, the HEX file, and upload. Would be great, at least if the Arduino IDE dont have any interest on this topic.
Title: Re: Upload without recompiling
Post by: Marttyn on May 10, 2019, 09:17 pm
Found this: http://www.hobbytronics.co.uk/arduino-xloader
Also changing IDE to Visual Studio or Atmel Studio gives much more freedom...
Quite tired of Arduino IDE.
Title: Re: Upload without recompiling
Post by: eahenle on May 13, 2019, 09:22 pm
You ever run into a problem, search the internet high and low for solutions, and determine that it's basically been ignored by the developers for most of a decade?

How is this still an issue?  There is no option anywhere in IDE 1.8.9 to prevent the wanton deletion of the compiled result, or to in any way force the use of the most recent successful compilation.  Every time I want to upload to a board, the IDE chooses to recompile.  Even if there hasn't been a single changed character anywhere in any source code, even if it's to the same board, even if the board has been powered on since before the last compilation and the same uploader has been connected continuously, the program will recompile in its entirety.  This happens for every board, every programmer, and every sketch, and it happens for every installation of the IDE on every computer I can get my hands on.

I need to program a number of boards with identical code, in an application that lends itself to frequent problems during upload.  Having to recompile the code (and all libraries) for every single attempt is completely ridiculous, especially given that this has been a known problem for 8 or 9 years.  Right now, my plan is to export the .hex and upload it using different software... but the point of an IDE is supposed to be that you do not need other software.
Title: Re: Upload without recompiling
Post by: Romonaga on Jul 01, 2019, 08:48 pm
Let me clarify. The GCC port to windows is SLOW. Compiling blink takes 60 seconds and bigger sketches longer. No there is nothing wrong with the computer. It has dual core and 2GB ram. MingW gcc is very slow as well. No excessive CPU consumption, just slow. Adding a upload button with would trivial by not deleting the hex file and running the avrdude command. It could be hidden on the pull down menu.
Hmmm,

I run
Linux at home, my machine while a file server is not particularly fast, I have never seen a compile time that large.


However, I will agree, it would be nice if no changes were made to NOT recompile.  It is a pain and if my compile times matched yours I would be wanting this changed as well.
Title: Re: Upload without recompiling
Post by: westfw on Jul 05, 2019, 08:17 am
Quote
Every time I want to upload to a board, the IDE chooses to recompile.
It shouldn't.   Changes were made "quite some time ago" not to completely recompile the same sketch, and somewhat more recently to avoid recompiling the core, even if the sketch has changed.
Mine windows install does this, unless you change board type or exit the IDE.  Recently. I've been more worried about not having a "clean" function that would for-sure recompile everything.

Here's a log (somewhat edited so that it fits.) (See the highlighted RED parts.)
I guess there are parts that still don't need to be done, but it's certainly inaccurate to say that the situation has not improved in a decade....


...\arduino-builder ...
...\arduino-builder ...
Using board 'uno' from platform in folder: ...\hardware\arduino\avr
Using core 'arduino' from platform in folder: ...\hardware\arduino\avr
Detecting libraries used...
".../avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10807 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\standard" "C:\\Users\\billw\\AppData\\Local\\Temp\\arduino_build_117157\\sketch\\BarometricPressureWebServer.ino.cpp" -o nul
".../avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10807 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\standard" "-IC:\\Program Files (x86)\\Arduino\\libraries\\Ethernet\\src" "C:\\Users\\billw\\AppData\\Local\\Temp\\arduino_build_117157\\sketch\\BarometricPressureWebServer.ino.cpp" -o nul
".../avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10807 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\standard" "-IC:\\Program Files (x86)\\Arduino\\libraries\\Ethernet\\src" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "C:\\Users\\billw\\AppData\\Local\\Temp\\arduino_build_117157\\sketch\\BarometricPressureWebServer.ino.cpp" -o nul

Using cached library dependencies for file: ...\libraries\Ethernet\src\Dhcp.cpp
Using cached library dependencies for file: ...\libraries\Ethernet\src\Dns.cpp
Using cached library dependencies for file: ...\libraries\Ethernet\src\Ethernet.cpp
Using cached library dependencies for file: ...\libraries\Ethernet\src\EthernetClient.cpp
Using cached library dependencies for file: ...\libraries\Ethernet\src\EthernetServer.cpp
Using cached library dependencies for file: ...\libraries\Ethernet\src\EthernetUdp.cpp
Using cached library dependencies for file: ...\libraries\Ethernet\src\socket.cpp
Using cached library dependencies for file: ...\libraries\Ethernet\src\utility\w5100.cpp
Using cached library dependencies for file: ...\hardware\arduino\avr\libraries\SPI\src\SPI.cpp

Generating function prototypes...
".../avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10807 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\standard" "-IC:\\Program Files (x86)\\Arduino\\libraries\\Ethernet\\src" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "C:\\Users\\billw\\AppData\\Local\\Temp\\arduino_build_117157\\sketch\\BarometricPressureWebServer.ino.cpp" -o "C:\\Users\\billw\\AppData\\Local\\Temp\\arduino_build_117157\\preproc\\ctags_target_for_gcc_minus_e.cpp"
"C:\\Program Files (x86)\\Arduino\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\billw\\AppData\\Local\\Temp\\arduino_build_117157\\preproc\\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
".../avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10807 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\standard" "-IC:\\Program Files (x86)\\Arduino\\libraries\\Ethernet\\src" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "C:\\Users\\billw\\AppData\\Local\\Temp\\arduino_build_117157\\sketch\\BarometricPressureWebServer.ino.cpp" -o "C:\\Users\\billw\\AppData\\Local\\Temp\\arduino_build_117157\\sketch\\BarometricPressureWebServer.ino.cpp.o"
Compiling libraries...
Compiling library "Ethernet"
Using previously compiled file: C:...7\libraries\Ethernet\Dhcp.cpp.o
Using previously compiled file: C:...7\libraries\Ethernet\EthernetServer.cpp.o
Using previously compiled file: C:...7\libraries\Ethernet\EthernetUdp.cpp.o
Using previously compiled file: C:...7\libraries\Ethernet\Ethernet.cpp.o
Using previously compiled file: C:...7\libraries\Ethernet\socket.cpp.o
Using previously compiled file: C:...7\libraries\Ethernet\Dns.cpp.o
Using previously compiled file: C:...7\libraries\Ethernet\EthernetClient.cpp.o
Using previously compiled file: C:...7\libraries\Ethernet\utility\w5100.cpp.o

Compiling library "SPI"
Using previously compiled file: C:...7\libraries\SPI\SPI.cpp.o

Compiling core...
Using precompiled core: ...\Temp\arduino_cache_36981\core\core_arduino_avr_uno_0c812875ac70eb4a9b385d8fb077f54c.a