Can I safely run without the bootloader?

Hi I have a sketch which would fit on the yun but doesn't because the bootloader takes 4k of the available 32K (that is more than 12%) :fearful: I know there is probably more than 4K to save in my sketch but ...... As I don't plan to connect the yun to my PC for a upload (I always use the web way) I wonder whether I need the bootloader at all. The bootloader is added with the script once uploaded to the yun. I was wondering: What would be the drawback of replacing the script with a empty script? In other words:Does the bootloader do something that is needed by the sketch? Best regards Jantje

Arduino Yun's AR9331 could be in-system programmer for AVR. Some one can burn sketches using it without bootloader. However I could not find any info at Google.

Confirm. If you can deal with the consequences (not being able to reflash from usb) you can indeed flash without first merging the bootloader

great :-) thanks for the confirmation Jantje

I also mostly flash over LAN or Wifi and therefore don't need the USB-Flash... Can you give a little more details? How do you disable it? Which script's contents do you delete?

And in case: Can this be reverted by repasting the content into that script?

This is part of a the srcipt I run once on each yun

#deactivate the bootloader 
mv ./usr/bin/merge-sketch-with-bootloader.lua ./usr/bin/merge-sketch-with-bootloader.lua.org
echo "#!/bin/ash" >/usr/bin/merge-sketch-with-bootloader.lua.noBootLoader
echo return 0 >>/usr/bin/merge-sketch-with-bootloader.lua.noBootLoader
chmod +x /usr/bin/merge-sketch-with-bootloader.lua.noBootLoader
cp /usr/bin/merge-sketch-with-bootloader.lua.noBootLoader /usr/bin/merge-sketch-with-bootloader.lua

to enable the bootloader again run

cp /usr/bin/merge-sketch-with-bootloader.lua.org /usr/bin/merge-sketch-with-bootloader.lua

Note that if you use the arduino IDE you will have to change the boards.txt because the IDE will not allow you to use to big sketches.
I would go for a new board (FI yunWithoutBootloader) copy everything of yun and change the available space.

Best regards
Jantje

I used your tip and it worked great…but I needed to revert it to debug some hanging issues I had (due to YunServer+SoftSerial).

But somehow the reverting doesn’t work ! I can’t flash anything to the YUN over USB anylonger !!
If I try to upload anything over USB to the Yun I get a neverending very fast blinking on the RX and TX -Leds (even if no components are connected to the yun) and the Yun hangs immediately (but doesn’t reboot).

This was what I had done:

  1. First I had to remove the starting-“dots”/“points” infront of both “/usr” in the “mv ./usr/bin…”-line of your code,
    because that gave me errors.
  2. Then I ran your first script-code as a shell script (with “sh filename” over
    Terminal/SSH without any permission changes etc.) and it didn’t return any error.
  3. In the board.txt (located at /Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/ on my Mac) I made a new board this way (see picture):
  4. Then I flashed a sketch of about 31k over Wifi with the IDE and it worked (besides my YunServer+SoftSerial-hanging-issue).
  5. Later I wanted to revert back and used your reverting script (also as shell in SSH)

Did I do anything wrong?!

After you undid the change did you upload a sketch via wifi? If not that is why it is not working. Best regards Jantje