-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The bootloader seams to doesn't work at all with my version of avrdude #321
Comments
You should need "-c arduino" to talk to optiboot. Avrdude's stk500v1 support was changed a long time ago to use "raw spi commands" for a lot of the functions (like "read signature"), and optiboot doesn't support those... |
BURNING Optiboot (precompiled optiboot_atmega328p) bootloader via avrdude on the cmdline: ... avrdude: Device signature = 0x1e950f (probably m328p) UPLOADING Blink.ino to Arduino Uno Board with Optiboot precompiled bootloader (optiboot_atmega328.hex) using avrdude on the cmdline: Burning and uploading with the scheme above does work reproducible!!! |
By the way my self compiled version (with gcc-11.1.0) of optiboot works too. |
Oh! I'd heard that newer avr-gccs were generally producing larger code; are you confirming that it's still under 512 bytes even in gcc11? That's useful data! |
Recently when I was working on a modified version of HoodLoader I had issues dealing the size of bootloader compiled with gcc10.1. NicoHood/HoodLoader2#93 |
Sorry, I had forgotten to answer your question whether the code produced with newer avr-gcc fits into 512 bytes (256 words) sized bootsection. The answer is yes, optiboot compiled for atmega328p fits into 512 bytes bootsection with each of them, gcc5.4.0 or gcc11.1.0, which results in a code size of 492 respectively 494 bytes. Besides the version of avr-gcc I used was 11.1.0 and NOT 10.1 as I wrote in my last post. To make it easy to compare the output between these two versions of avr-gcc, I compiled Optiboot for all targets listed in the makeall scripts one time with gcc5.4.0 and another time with gcc11.1.0. The output of the compilation process is resided in optiboot/bootloaders/optiboot/compilelog..txt. |
Comparison between gcc5 and gcc10: Virtual-Java/optiboot@mint-gcc5...Virtual-Java:arch-gcc10 |
Compiling (avrgcc-5.4) and flashing (1.) the original optibootloader for/to atmega328 was no problem, but uploading e.g. Blink.ino.hex to a device that contains optiboot (2.) doesn't work (with my version of avrdude). However uploading Blink.ino.hex (avrdude via cmdline) to a mcu with the Arduino IDE's optiboot-version on it is successful!! My Fuses for optiboot (m328p) are shown in 3.).
1.)
~/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino18/bin/avrdude -C ~/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino18/etc/avrdude.conf -c usbasp -p atmega328p -P usb -e -u -U efuse:w:0xFE:m -U hfuse:w:0xDE:m -U lfuse:w:0xFF:m -U flash:w:optiboot_atmega328.hex -U lock:w:0x2f:m
2.)
/home/jonathan/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/home/jonathan/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -patmega328p -c stk500v1 -P /dev/ttyACM0 -b9600 -D -Uflash:w:/tmp/arduino_build_259003/Blink.ino.hex:i
... Varef : 0.3 V
Oscillator : 28.800 kHz
SCK period : 3.3 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.03s
avrdude: Device signature = 0x000000 (retrying)
Reading | ################################################## | 100% 0.04s
avrdude: Device signature = 0x000000 (retrying)
Reading | ################################################## | 100% 0.04s
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.
avrdude done. Thank you.
3.)
~/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino18/bin/avrdude -C ~/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino18/etc/avrdude.conf -c usbasp -p atmega328p -P usb -b 115200 -U efuse:r:-:i -U hfuse:r:-:i -U lfuse:r:-:i -U lock:r:-:i -v
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as DE
avrdude: safemode: efuse reads as FE
avrdude: safemode: Fuses OK (E:FE, H:DE, L:FF)
The text was updated successfully, but these errors were encountered: