system
March 11, 2014, 10:59am
1
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.
I'd like:
have about 4k more
compile from arduino ide
find a way to upload to atmega
thanks.
system
March 11, 2014, 3:12pm
2
[SOLVED]
...still in testing but here my 50 cents:
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}
restart the Arduino Ide
from list of boards ---> Arduino Yún - full
compile the code, not upload (remember to check in the preferences option to see the compile process)
wait until compile is ended and copy the path where is the hex
copy the hex file to SD yun
connect via ssh to yun (ssh root@your_yun_name.local)
cd /mnt/sda1
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:
compile a simple sketch as blink (use Standard Yun as board type)
in the same way find the hex and upload it to SD
cd /mnt/sda1
merge-sketch-with-bootloader.lua Blink.cpp.hex
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.
bjarne
March 12, 2014, 5:31am
3
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.
system
March 12, 2014, 6:25pm
4
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.
bjarne
March 12, 2014, 7:22pm
5
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 =(
system
March 12, 2014, 8:34pm
6
bjarne
March 12, 2014, 9:03pm
7
Good find
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.