-- yun without bootloader on atmega is possible? [SOLVED]

Hi,
Is it possible to upload sketch without bootloader?

Could be a solution add a new "YUN-without-bootloader" on boards.txt configuration to have more space, compile from ide, copy to sd the hex and then burn via ssh without merge the bootloader?

...I mean... I've read so many forum/tutorial that I'm little confused. :slight_smile:

I'd like:

  • have about 4k more
  • compile from arduino ide
  • find a way to upload to atmega

thanks.

[SOLVED]
...still in testing but here my 50 cents:

  1. edit the boards.txt
    (on mac is here ---> /Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/avr my ide is 1.5.5)

I add a copy of yun board change only the upload maxium size.

##############################################################

yunB.name=Arduino Yún - full
yunB.upload.via_ssh=true

yunB.vid.0=0x2341
yunB.pid.0=0x0041
yunB.vid.1=0x2341
yunB.pid.1=0x8041
yunB.upload.tool=avrdude
yunB.upload.protocol=avr109
yunB.upload.maximum_size=32768
yunB.upload.maximum_data_size=2560
yunB.upload.speed=57600
yunB.upload.disable_flushing=true
yunB.upload.use_1200bps_touch=true
yunB.upload.wait_for_upload_port=true

yunB.bootloader.tool=avrdude
yunB.bootloader.low_fuses=0xff
yunB.bootloader.high_fuses=0xd8
yunB.bootloader.extended_fuses=0xfb
yunB.bootloader.file=caterina/Caterina-Yun.hex
yunB.bootloader.unlock_bits=0x3F
yunB.bootloader.lock_bits=0x2F

yunB.build.mcu=atmega32u4
yunB.build.f_cpu=16000000L
yunB.build.vid=0x2341
yunB.build.pid=0x8041
yunB.build.usb_product="Arduino Yun"
yunB.build.board=AVR_YUN
yunB.build.core=arduino
yunB.build.variant=yun
yunB.build.extra_flags={build.usb_flags}
  1. restart the Arduino Ide
  2. from list of boards ---> Arduino Yún - full
  3. compile the code, not upload (remember to check in the preferences option to see the compile process)
  4. wait until compile is ended and copy the path where is the hex
  5. copy the hex file to SD yun
  6. connect via ssh to yun (ssh root@your_yun_name.local)
  7. cd /mnt/sda1
  8. run-avrdude your_compiled_file.hex

obviously no more bootloader in atmega (so you can't upload as usual via usb from ide), but.... is simply to restore:

  1. compile a simple sketch as blink (use Standard Yun as board type)
  2. in the same way find the hex and upload it to SD
  3. cd /mnt/sda1
  4. merge-sketch-with-bootloader.lua Blink.cpp.hex
  5. run-avrdude Blink.cpp.hex

...in this way you have again the standard bootloader on atmega and the blink sketch.
After this you can upload again from ide, as usual.

PLEASE READ THIS
I have 2 Yun , 1 is to test.
Seems all ok, but I can't say that you could be brick... so... pay attention.

Thanks, this could be useful as I am always running up against the memory limit.

But I wonder, is there something the boot loader does, that I now should be doing myself in setup()?
Like handling watchdog, etc.

Really don't know.

I'm still testing, there is something not clear.... I mean... near 30k start make something different, and bridge doesn't answer as expected.

Still try to understand if something on code.

One thing I have learned to watch out for is RAM. It seems that if I have too many strings and such, I can suddenly get weird behavior, like I change something, and something totally unrelated stops working. I am thinking that is related to running out of heap at run time and overwriting variables. Unfortunately I have not found a way to see how much run-time heap is being used =(

Mmmmm... nice hint.
I found this, could be usueful?

--> http://playground.arduino.cc/Main/CorruptArrayVariablesAndMemory#.UyDE71HFlMg
--> Arduino Playground - AvailableMemory

Tomorrow I test it and I'll report.

Good find :slight_smile:

Especially the second link has a function freeRam(), which could prove very useful. I might play with it a bit when I get a chance.