Code Monkey home page Code Monkey logo

avr_boot's Introduction

avr_boot

SD card bootloader for atmega processors

As easy as it can get! I spent days with this. Hopefully you wont!

  • for any ATMega with 4096kb Bootloader
  • uses Petit FatFs R0.03 for FAT12, FAT16, FAT32
  • looks for FIRMWARE.BIN and flashes it nearly instantly
  • without any interference to your application
  • no CRC Check and no version bytes in EEPROM (see KISS)

Boards Manager installation

avr_boot is integrated in Arduino IDE version 1.6.4 or greater!!! See here for instructions.

Manual installation

This is with avr-gcc and avrdude under linux with an Atmega1284p and AVRISP mkII! Adaption to your case (WinAvr, another Atmega, another flash-tool) will not be complicated...

  • adapt Makefile
    • MCU_TARGET: Your atmegaXXX
    • BOOT_ADR: in bytes not words!
    • F_CPU: CPU Frequency (not critical. A higher value will work as well)
    • SD_CS_PORT: Data Register of the SD CS pin(see the datasheet for your microcontroller)
    • SD_CS_DDR: Data Direction Register of the SD CS pin
    • SD_CS_BIT: Bit of the SD CS pin
    • USE_LED: For debugging 0...deactivate or 1...active
    • USE_UART: For debugging 0...deactivate or divider (UBRR) for baudate see http://wormfood.net/avrbaudcalc.php
  • update spi_pins.h with the SPI pins of your microcontroller if not already defined
  • if using USE_LED adapt LED-pins in asmfunc.S
  • if you want to add FAT12 adapt pff/src/pffconfh.h (default ist FAT16 + FAT32)
  • if you want to support lower case filenames adapt pff/src/pffconfh.h (default is uppercase)
  • if you prefer another filename instead of FIRMWARE.BIN adapt main.c
  • make (you may need to do "sudo apt-get install avr-libc gcc-avr")
  • set fuses: avrdude -c avrispmkII -p m1284p -U hfuse:w:0xda:m
  • flash: avrdude -c avrispmkII -p m1284p -Uflash:w:./avr_boot.hex:i -Ulock:w:0x3F:m

Put your sketch on SD card

  • in Arduino IDE go to File > Preferences and check "Show verbose output during compiliation"
  • compile sketch and find the location of your /tmp/buildxxx/sketch.cpp.hex
  • make bin file: avr-objcopy -I ihex -O binary sketch.cpp.hex FIRMWARE.BIN
  • copy the file into the root of an SD (FAT16/FAT32)
  • put it into the SD slot of your ATmega
  • reset it
  • it might already have happend!

Bootloader sizes

Compiled under linux for atmega328p / atmega1284p

  • 3674 / 3724 bytes
  • 3984 / 4034 bytes debugging with USE_LED
  • 3992 / 4052 bytes debugging with USE_UART

Tested successfully on

  • ATmega168
  • ATmega328P
  • ATmega32u4
  • ATmega1284P
  • ATmega2560 (see issue #2)

Serial support - Help wanted

it should not be impossible to fit a normal serial bootloader (with automatic baudrate detection?) into the remaining bytes ... help is appreciated!

KISS

If you wish you can add CRC Check or versioning with EEPROM but I prefere to keep things simple. avr_boot will reflash your FIRMWARE.BIN as long as it is present. Is this a problem? No! It happens nearly instantly and only differing bytes are flashed really. You may consider putting your logic into your application and perform a CRC Check after the fact to inform the user and delete or rename FIRMWARE.BIN

Thanks to

Alternatives

... call me stupid, but I passed several days debugging those - without success ...

avr_boot's People

Contributors

per1234 avatar zevero avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

avr_boot's Issues

ATmega4809 support?

Might be interesting. I will try to maybe get it compiled on the chip once I manage to sort out my gcc-avr problems

Make file not compiling with WinAVR 20100110

Just changed a couple things in the make file. USE_LED set to 1, CS pin changed, all typical. but when doing 'make' in command line it gets to the .text part and comes up with an error 1.
here is the output
rm -rf *.o avr_boot.elf *.eps *.bak *.a *.bin rm -rf pff/src/*.o uart/*.o rm -rf *.lst *.map rm -rf avr_boot.hex avr-gcc -gdwarf-2 -Wall -Os -mcall-prologues -ffunction-sections -fdata-sections -mmcu=atmega1284p -std=c99 -DBOOT_ADR=0x1F000 -DF_CPU=16000000 -DUSE_LED=1 -DUSE_UART=0 -DCS_PIN=4 -DVARIANT_1284P=0 -c -o main.o main.c avr-gcc -gdwarf-2 -Wall -Os -mcall-prologues -ffunction-sections -fdata-sections -mmcu=atmega1284p -std=c99 -DBOOT_ADR=0x1F000 -DF_CPU=16000000 -DUSE_LED=1 -DUSE_UART=0 -DCS_PIN=4 -DVARIANT_1284P=0 -c -o pff/src/pff.o pff/src/pff. c avr-gcc -gdwarf-2 -Wall -Os -mcall-prologues -ffunction-sections -fdata-sections -mmcu=atmega1284p -std=c99 -DBOOT_ADR=0x1F000 -DF_CPU=16000000 -DUSE_LED=1 -DUSE_UART=0 -DCS_PIN=4 -DVARIANT_1284P=0 -c -o diskio.o diskio.c avr-gcc -c -mmcu=atmega1284p -I. -x assembler-with-cpp -Wa,-adhlns=asmfunc.lst, -gstabs -DBOOT_ADR=0x1F000 -DF_CPU=16000000 -DUSE_LED=1 -DUSE_UART=0 -DCS_P IN=4 -DVARIANT_1284P=0 asmfunc.S -o asmfunc.o avr-gcc -gdwarf-2 -Wall -Os -mcall-prologues -ffunction-sections -fdata-sections -mmcu=atmega1284p -std=c99 -DBOOT_ADR=0x1F000 -DF_CPU=16000000 -DUSE_LED=1 -DUSE_UART=0 -DCS_PIN=4 -DVARIANT_1284P=0 -Wl,-Map,avr_boot.map -Wl,--gc-sec tions -Wl,--section-start,.text=0x1F000 -o avr_boot.elf main.o pff/src/pff.o di skio.o asmfunc.o c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/bin/ld.exe: address 0x2013c of avr_boot.elf section .text is not within region text c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/bin/ld.exe: address 0x2013c of avr_boot.elf section .text is not within region text make: *** [avr_boot.elf] Error 1

Any ideas why?

Can't compile for ATmega64A, 128, 128A, 32, 32A

I wanted to try to add Arduino IDE support for more boards but ran into compiler errors with most of them.

These results are using the latest avr_boot with avr-gcc 6.1.0 but I've tried 4.8.1-arduino5, 4.9.2-atmel3.5.3-arduino2, and 5.1.0 and can't compile these MCUs with any of them. All the other MCUs I've tried compile fine, including ATmega64.

I modified asmfunc.S to define the pins as shown at: https://github.com/per1234/avr_boot/commit/7a4349fe525447cb3e338f00601b5dae8e907686

All makefile parameters other than MCU_TARGET and BOOT_ADR were left at the original values.

Any ideas? These are the last low hanging fruit for Arduino IDE support I'm aware of since they have a large enough boot size and established pin mappings(in the case of ATmega32/A, already included in the package).

With:

MCU_TARGET    = atmega64a
BOOT_ADR      = 0xF000

I get:

rm -rf *.o avr_boot.elf *.eps *.bak *.a *.bin
rm -rf pff/src/*.o uart/*.o
rm -rf *.lst *.map 
rm -rf avr_boot.hex
avr-gcc -gdwarf-2 -Wall -Os -mcall-prologues -ffunction-sections -fdata-sections -mmcu=atmega64a -std=c99 -DBOOT_ADR=0xF000 -DF_CPU=16000000   -DUSE_LED=0  -DUSE_UART=0  -DCS_PIN=4  -DVARIANT_1284P=0    -c -o main.o main.c
main.c: In function 'get_mcusr':
main.c:41:175: error: 'MCUSR' undeclared (first use in this function)
 uint8_t mcusr_mirror __attribute__ ((section (".noinit")));void get_mcusr(void) __attribute__((naked)) __attribute__((section(".init3")));void get_mcusr(void){mcusr_mirror = MCUSR;MCUSR = 0;wdt_disable();}
                                                                                                                                                                               ^~~~~
main.c:41:175: note: each undeclared identifier is reported only once for each function it appears in
make: *** [main.o] Error 1

With:

MCU_TARGET    = atmega128
BOOT_ADR      = 0x1F000

I get:

rm -rf *.o avr_boot.elf *.eps *.bak *.a *.bin
rm -rf pff/src/*.o uart/*.o
rm -rf *.lst *.map 
rm -rf avr_boot.hex
avr-gcc -gdwarf-2 -Wall -Os -mcall-prologues -ffunction-sections -fdata-sections -mmcu=atmega128 -std=c99 -DBOOT_ADR=0x1F000 -DF_CPU=16000000   -DUSE_LED=0  -DUSE_UART=0  -DCS_PIN=4  -DVARIANT_1284P=0    -c -o main.o main.c
main.c: In function 'get_mcusr':
main.c:41:175: error: attempt to use poisoned "MCUSR"
 uint8_t mcusr_mirror __attribute__ ((section (".noinit")));void get_mcusr(void) __attribute__((naked)) __attribute__((section(".init3")));void get_mcusr(void){mcusr_mirror = MCUSR;MCUSR = 0;wdt_disable();}
                                                                                                                                                                               ^
main.c:41:175: error: 'MCUSR' undeclared (first use in this function)
 uint8_t mcusr_mirror __attribute__ ((section (".noinit")));void get_mcusr(void) __attribute__((naked)) __attribute__((section(".init3")));void get_mcusr(void){mcusr_mirror = MCUSR;MCUSR = 0;wdt_disable();}
                                                                                                                                                                               ^~~~~
main.c:41:175: note: each undeclared identifier is reported only once for each function it appears in
main.c:41:181: error: attempt to use poisoned "MCUSR"
 uint8_t mcusr_mirror __attribute__ ((section (".noinit")));void get_mcusr(void) __attribute__((naked)) __attribute__((section(".init3")));void get_mcusr(void){mcusr_mirror = MCUSR;MCUSR = 0;wdt_disable();}
                                                                                                                                                                                     ^
make: *** [main.o] Error 1

With:

MCU_TARGET    = atmega128a
BOOT_ADR      = 0x1F000
rm -rf *.o avr_boot.elf *.eps *.bak *.a *.bin
rm -rf pff/src/*.o uart/*.o
rm -rf *.lst *.map 
rm -rf avr_boot.hex
avr-gcc -gdwarf-2 -Wall -Os -mcall-prologues -ffunction-sections -fdata-sections -mmcu=atmega128a -std=c99 -DBOOT_ADR=0x1F000 -DF_CPU=16000000   -DUSE_LED=0  -DUSE_UART=0  -DCS_PIN=4  -DVARIANT_1284P=0    -c -o main.o main.c
main.c: In function 'get_mcusr':
main.c:41:175: error: 'MCUSR' undeclared (first use in this function)
 uint8_t mcusr_mirror __attribute__ ((section (".noinit")));void get_mcusr(void) __attribute__((naked)) __attribute__((section(".init3")));void get_mcusr(void){mcusr_mirror = MCUSR;MCUSR = 0;wdt_disable();}
                                                                                                                                                                               ^~~~~
main.c:41:175: note: each undeclared identifier is reported only once for each function it appears in
make: *** [main.o] Error 1

With:

MCU_TARGET    = atmega32
BOOT_ADR      = 0x7000

I get:

rm -rf *.o avr_boot.elf *.eps *.bak *.a *.bin
rm -rf pff/src/*.o uart/*.o
rm -rf *.lst *.map 
rm -rf avr_boot.hex
avr-gcc -gdwarf-2 -Wall -Os -mcall-prologues -ffunction-sections -fdata-sections -mmcu=atmega32 -std=c99 -DBOOT_ADR=0x7000 -DF_CPU=16000000   -DUSE_LED=0  -DUSE_UART=0  -DCS_PIN=4  -DVARIANT_1284P=0    -c -o main.o main.c
avr-gcc -gdwarf-2 -Wall -Os -mcall-prologues -ffunction-sections -fdata-sections -mmcu=atmega32 -std=c99 -DBOOT_ADR=0x7000 -DF_CPU=16000000   -DUSE_LED=0  -DUSE_UART=0  -DCS_PIN=4  -DVARIANT_1284P=0    -c -o pff/src/pff.o pff/src/pff.c
pff/src/pff.c: In function 'get_fat':
pff/src/pff.c:379:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   return LD_WORD(buf);
   ^~~~~~
pff/src/pff.c:384:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   return LD_DWORD(buf) & 0x0FFFFFFF;
   ^~~~~~
pff/src/pff.c: In function 'pf_mount':
pff/src/pff.c:775:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
     bsect = LD_DWORD(&buf[8]); /* Partition offset in LBA */
     ^~~~~
avr-gcc -gdwarf-2 -Wall -Os -mcall-prologues -ffunction-sections -fdata-sections -mmcu=atmega32 -std=c99 -DBOOT_ADR=0x7000 -DF_CPU=16000000   -DUSE_LED=0  -DUSE_UART=0  -DCS_PIN=4  -DVARIANT_1284P=0    -c -o diskio.o diskio.c
avr-gcc -c -mmcu=atmega32 -I. -x assembler-with-cpp -Wa,-adhlns=asmfunc.lst,-gstabs -DBOOT_ADR=0x7000 -DF_CPU=16000000   -DUSE_LED=0  -DUSE_UART=0  -DCS_PIN=4  -DVARIANT_1284P=0  asmfunc.S -o asmfunc.o
avr-gcc -gdwarf-2 -Wall -Os -mcall-prologues -ffunction-sections -fdata-sections -mmcu=atmega32 -std=c99 -DBOOT_ADR=0x7000 -DF_CPU=16000000   -DUSE_LED=0  -DUSE_UART=0  -DCS_PIN=4  -DVARIANT_1284P=0  -Wl,-Map,avr_boot.map -Wl,--gc-sections -Wl,--section-start,.text=0x7000 -o avr_boot.elf main.o pff/src/pff.o diskio.o asmfunc.o 
asmfunc.o: In function `flash_erase':
asmfunc.S:366: undefined reference to `SPMCSR'
asmfunc.S:366: undefined reference to `SPMCSR'
asmfunc.S:366: undefined reference to `SPMCSR'
asmfunc.o: In function `flash_write':
asmfunc.S:399: undefined reference to `SPMCSR'
asmfunc.S:399: undefined reference to `SPMCSR'
asmfunc.o:asmfunc.S:399: more undefined references to `SPMCSR' follow
collect2.exe: error: ld returned 1 exit status
make: *** [avr_boot.elf] Error 1

With:

MCU_TARGET    = atmega32a
BOOT_ADR      = 0x7000

I get:

rm -rf *.o avr_boot.elf *.eps *.bak *.a *.bin
rm -rf pff/src/*.o uart/*.o
rm -rf *.lst *.map 
rm -rf avr_boot.hex
avr-gcc -gdwarf-2 -Wall -Os -mcall-prologues -ffunction-sections -fdata-sections -mmcu=atmega32a -std=c99 -DBOOT_ADR=0x7000 -DF_CPU=16000000   -DUSE_LED=0  -DUSE_UART=0  -DCS_PIN=4  -DVARIANT_1284P=0    -c -o main.o main.c
main.c: In function 'get_mcusr':
main.c:41:175: error: 'MCUSR' undeclared (first use in this function)
 uint8_t mcusr_mirror __attribute__ ((section (".noinit")));void get_mcusr(void) __attribute__((naked)) __attribute__((section(".init3")));void get_mcusr(void){mcusr_mirror = MCUSR;MCUSR = 0;wdt_disable();}
                                                                                                                                                                               ^~~~~
main.c:41:175: note: each undeclared identifier is reported only once for each function it appears in
make: *** [main.o] Error 1

Set low a pin before bootloading

Hi, on my board to enable the SD card, i need to set low the digital pin 4 (PD4)
there is a way to do this before the bootloader try to access the sd?
Second question, can you provide the configuration of the Makefile for the atmega328p?

Thanks man, i really appreciate your work 👍

Bootlooping after Watchdog reset

I am trying to reset the micro with a WDT in order to load the new code into memory, without physically having to push reset. The WDT reset method works fine on the optiboot bootloader, but gets wildly stuck with avr_boot. (LED flashes very fast) I installed the 328p bootloader through the IDE, so I'm not sure if that build includes the WDT fix or not.

I'll build it from source and see if that helps.

File not mounted

Hello,

I´m having the issue that the bootloader cannot mount the sd card.

fresult = pf_mount(&Fatfs); /* Initialize file system */ if (fresult != FR_OK) { /* File System could not be mounted */
fresult is FR_NOT_READY

Here are my def;
MCU_TARGET = atmega1284p BOOT_ADR = 0x1F000 F_CPU = 14745600 SD_CS_PORT = PORTB SD_CS_DDR = DDRB SD_CS_BIT = 1

is there anything else i have to check oder edit? Does anyone else have the same error?
With the arduino cardinfo example program everything works fine, here is also the infos that the cardinfo program outputs

Initializing SD card...Wiring is correct and a card is present.

Card type: SD2
Clusters: 61268
Blocks x Cluster: 64
Total Blocks: 3921152

Volume type is: FAT16
Volume size (Kb): 1960576
Volume size (Mb): 1914
Volume size (Gb): 1.87

Files found on the card (name, date and size in bytes):
SYSTEM1/ 2019-02-08 09:41:40
INDEXE
1 2019-02-08 09:41:40 76
WPSETT~1.DAT 2019-02-08 09:41:42 12
FIRMWARE.BIN 2019-02-18 13:54:38 61112`

SAMD21 support?

How about supporting SAMD21/Arduino Zero?! Or does anyone know of a bootloader for this controller that is able to flash/update via sdcard?!

avr boot SD Bootloader for Arduino

details
(1) using a UNO real not copy
(2) setup installation of avr_boot by Zevero Version 1.3.0
(3) Operating system Windows 10
(4) Arduino IDE 1.8.10
(5) installation method (as per instructions ##installation)

Issues
(1) create folder and save Arduion sketch
(2) export compiled binary file from IDE to folder
(3) rename binary file from select XXXXX.ino.arduino_standard HEX file to XXXXX HEX file
(4) create BIN file as per MakeBin via several different downloaded programs (1.avr_boot-gh-pages and the other one " Arduino Hex2Bin Converter ( end result same from all) compared via NotePad++ and renaming as FIRMWARE.BIN
(5) NOW this is where the question is raised (not sure if the size is the problem??)
(6) carry out all of the above on a sketch size no more than 12KB and all works great
(7) carry out al of the above on the same sketch that has more info size 17 KB. and I get nothing.(does not upload)
(8) end result is to control a DMD screen by arduino
(9) NO PROBLEMS when I use USB to upload the sketch direct from the IDE
(10) I can upload the initial portion of the sketch which is straight forward simple
when I add the next step of the loop which has strings and calculation in it (it does not work)

can any person shine some light on the problem
Note: I would class myself as some Knowledge but still very green
Thank you in advance
kevenG

Can't compile for ATmega640/1280/2560 with SD CS pin on PORTH or higher

command:

make MCU_TARGET=atmega1280 BOOT_ADR=0x1F000 F_CPU=8000000 SD_CS_PORT=PORTH SD_CS_DDR=DDRH SD_CS_BIT=5 USE_LED=0 USE_UART=0 ADDED_CFLAGS="-Wextra -Wno-strict-aliasing" TARGET=$(MCU_TARGET)_cs8_$(F_CPU)L

avr-gcc 6.0.1 error message:

asmfunc.S: Assembler messages:
asmfunc.S:86: Error: operand out of range: 225
asmfunc.S:124: Error: operand out of range: 226
asmfunc.S:138: Error: operand out of range: 226

avr-gcc 4.9.2-atmel3.5.3-arduino2 message:

asmfunc.S: Assembler messages:
asmfunc.S:86: Error: number must be positive and less than 32
asmfunc.S:124: Error: number must be positive and less than 32
asmfunc.S:138: Error: number must be positive and less than 32

This was trying to build for SD CS Arduino pin 8 but I get similar errors for any bit on any port above G.

I haven't had much luck searching for information on this. The best I've found is http://www.nongnu.org/avr-libc/user-manual/group__avr__sfr__notes.html but I've tried every combination of the fixes listed and still couldn't compile but I'm just basically working on it randomly since I don't really understand what the problem is.

Question: Is it possible to use Software Spi?

Hi all! I have a project with an Atmega328P and I am using the hardware SPI pins for a different purpose. Is it possible to use non-standard pins to flash a new bootloader from a SD card?

SD Bootloader

Hi zevero,

I have been working on a project and would like to be able to flash my 1284P from SD card for updates, I have loaded your avr_boot, firstly i am unable to select standard pinout as it will not compile, so i left it set as avr-developers.com, this must be different from standard as it my program although runs and loads does not run as it should (i was using the mightycore bootloader before), if i reload that, the code runs fine.
Using avr_boot, I created BIN file as instructed and tried to load it , i moved my SD card CS to pin 10 (as i thought you should not use pin 4 on the 1284P the SS pin as a CS)
However the hex file does not load, it just boots up as before with program not operating as it should, when i reload Mighty Core (standard pin), my project runs fine. am i doing something wrong or is there another library to use? i tried downloading the Mighty 1284P standard as in your option selection, i just get a boards.txt error.

here is a copy of the error if i select standard Mighty1284P

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0xc pc=0x4a75b7]

goroutine 1 [running]:
panic(0x54ef00, 0x12080030)
/home/jenkins/go/src/runtime/panic.go:500 +0x331
arduino.cc/builder.(*SetupBuildProperties).Run(0x614ef0, 0x120ce000, 0x0, 0x0)
/home/jenkins/workspace/arduino-builder-all-cross/src/arduino.cc/builder/setup_build_properties.go:84 +0xfa7
arduino.cc/builder.(*ContainerSetupHardwareToolsLibsSketchAndProps).Run(0x614ef0, 0x120ce000, 0x0, 0x0)
/home/jenkins/workspace/arduino-builder-all-cross/src/arduino.cc/builder/container_setup.go:59 +0x2b6
arduino.cc/builder.runCommands(0x120ce000, 0x12089dc0, 0x3, 0x3, 0x1, 0x0, 0x0)
/home/jenkins/workspace/arduino-builder-all-cross/src/arduino.cc/builder/builder.go:191 +0xe2
arduino.cc/builder.(*ParseHardwareAndDumpBuildProperties).Run(0x12089dec, 0x120ce000, 0x0, 0x0)
/home/jenkins/workspace/arduino-builder-all-cross/src/arduino.cc/builder/builder.go:180 +0xdc
arduino.cc/builder.RunParseHardwareAndDumpBuildProperties(0x120ce000, 0x0, 0x0)
/home/jenkins/workspace/arduino-builder-all-cross/src/arduino.cc/builder/builder.go:227 +0x35
main.main()
/home/jenkins/workspace/arduino-builder-all-cross/src/arduino.cc/arduino-builder/main.go:329 +0xf78
C:\Program Files (x86)\Arduino\arduino-builder returned 2

Error compiling for board ATmega1284/P.

Kind Regards

Jono

Boot Reset vector

Hello Falks,

I was trying to use this with my ATMega1284P, however first run going smoothly which loads the bin file in my SD card, for some reason subsequent resets does not kick start the bootloader and therefore does not load any more bin files from the SD card.

Is this something to do with the Boot Reset Vector?

Any idea how can I continue to use the bootloader so that any time a FIRMWARE.BIN on SD card will get loaded upon reset (and from the program I can delete the BIN file)

To note, I was using the boards manager installation on Arduino 1.8.1

Cheers,
Las

Question: Is it possible to choose between .hex files?

Hello guys i´ve been working on a embedded project that switches modules of different functions, but the code on the mega is too large to integrat all of modules functions and to to write it again, so i´ve been wondering if i can set the bootloader to determine what module the system is using so it can change between the .hex files store on the SD. Whet do you guys think?

Very confused about manual instalation

Well, sorry about this question, but I´m realy stucked.

I´m trying to manual installation (after a successful Arduino IDE install). Manual installation necessary cause I´m trying to customize the bootloader for arduboy.

I´m using Arduino Pro Micro 32u4

Here is my makefile ...

MCU_TARGET = atmega32u4
BOOT_ADR = 0x3800
F_CPU = 16000000
SD_CS_PORT = PORTB # Data Register of the SD CS pin
SD_CS_DDR = DDRB # Data Direction Register of the SD CS pin
SD_CS_BIT = 3 # Bit of the SD CS pin
USE_LED = 0 # Debug with two (defined in asmfunc.S)
USE_UART = 0 # Debug on Serial. 0 ...

I have a lot of doubts here, so :

BOOT_ADDR - Using http://eleccelerator.com/fusecalc/fusecalc.php?chip=atmega32u4&LOW=42&HIGH=99&EXTENDED=FF&LOCKBIT=FF

SD_CS - My CS port is 10, so after reading
https://www.arduino.cc/en/Reference/PortManipulation
I supposed the correct config for makefile is the values describe before

FUSES: I dont know what is that, sorry. Use default values for HIGH
-U hfuse:w:0x99:m

Avrdude works OK with premade images from https://zevero.github.io/avr_boot/package_zevero_avr_boot_index.json

Any help is appreciated

Thanks

ATmega2560 support

We are looking for someone looking deeper into ATmega2560 support!

This is copied from @per1234 in Issue #1

I managed to get the ATmega2560 to load a program from the SD card but it's far from ideal. I discovered the program will run under these circumstances:

  • Set high fuse to DB instead of DA to disable the Boot Reset vector(BOOTRST=1).
    • The standard Arduino boards.txt enables the Boot Reset vector(BOOTRST=0) as does your hfuse setting in README.md.
  • Use Atmel AVRISP mkII to Burn Bootloader instead of USPasp.
    • I normally use my USBasp due to the mkII not working correctly for Burn Bootloader with current versions of Arduino IDE for me without some ugly workarounds.
  • Press the reset button after powering the board with the SD card attached.
    • The program has been loaded into the MCU flash but doesn't run until the reset button is pressed. With the other boards the program begins to run immediately after it has been loaded from the SD card.

After the program has been loaded from the SD no other programs will load from the SD card until the bootloader is burned again. If I change any of the above conditions it doesn't work. With all of these conditions it works consistently. I have no idea what this means, it's a bit more advanced than my current skill level.

Confused about the Use / Non Use with AVR

First this project is amazing thanks,
Can see a big warning sign saying not compatible with AVR boards.

I have a freetronics Eleven Arduino board that I would really like to get this running on,
This freetonics board is usually programmed from Arduino IDE as a a Uno board.
The processor is ATmega328P. All ATmega328P chips from microchip seem to be AVR?

Had no problem installing into Arduino IDE. When trying to push into board would not burn boot loader directly,
Can see I need a ISP which I will pick up tomorrow and try again.

Should this work with a Standard Arduino Uno board? Any info you can provide would be amazing. Thanks.

Add support for Standard Serial Programming

Currently not supported. I'm hoping to add this functionality myself here soon. Any Help is welcome. I'm going to Look at the Optiboot code and see what I can scavenge out of it to fill the gap. any issues I might want to know about before digging in? Will start a new fork soon and submit a pull request when i know it works. Thanks.

Which File To Take When Exporting Compiled Binary?

Hello, first off, love the project.

I have a custom wrapper around avr dude for flashing all my projects, which I use to flash bootloaders and programs.

I needed to compile a version of this since I use a different pin for sd card, so I do that and then flash the bootloader.

When I am making updates to the program, I use export compiled binary and then the avr-objcopy.

However, the export compiled binary gives two files using your board manager, one labeled with bootloader which is larger.

Which file am I meant to take, or does it not matter?

Changing CS to Pin 14

Hi for my project I have the CS Line wired to Pin 14 for the SD Card. I'm a bit of a newbie here to changing bootloaders. Can some one give me a clue to exactly what needs changing to make this work. The CPU is a 328p 3,3v Device.
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.