Commit 09ac7168 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Added instructions on how to download the bootloader, patch it and program it...

Added instructions on how to download the bootloader, patch it and program it into the microcontroller.
Added the bootloader patches.
parent d515f6f3
......@@ -34,10 +34,23 @@ $(PROJECT).elf: $(OBJS)
$(CC) -c $(CFLAGS) -I$(INCLUDE_DIR) -o $@ $<
download: $(MAIN_OUT_HEX)
avrdude -c avrisp2 -P usb -p m8 -U flash:w:$(PROJECT).hex
avrdude -c avrisp2 -P usb -p m8 -U eeprom:w:$(PROJECT)_eeprom.hex
avrdude -c avr109 -P /dev/ttyUSB0 -p m8 -b 9600 -U flash:w:$(PROJECT).hex
avrdude -c avr109 -P /dev/ttyUSB0 -p m8 -b 9600 -U eeprom:w:$(PROJECT)_eeprom.hex
bootloader: bootloader_hex
$(MAKE) -C remote-controlled-socket/uc/avrprog_boot_v0_85/ program
rm -rf remote-controller-socket
bootloader_hex:
@if [ ! -d "./remote-controlled-socket" ] ; then \
echo "AVR bootloader not found"; \
hg clone https://bitbucket.org/befi/remote-controlled-socket; \
patch remote-controlled-socket/uc/avrprog_boot_v0_85/main.c < patches/main.c.patch; \
patch remote-controlled-socket/uc/avrprog_boot_v0_85/makefile < patches/makefile.patch; \
fi
$(MAKE) -C remote-controlled-socket/uc/avrprog_boot_v0_85/
clean:
rm $(PROJECT).*
rm $(PROJECT)_eeprom.*
rm $(OBJS)
rm -rf remote-controlled-socket
diff -r 407d6aac41dc uc/avrprog_boot_v0_85/main.c
--- a/uc/avrprog_boot_v0_85/main.c Sun Apr 01 13:47:42 2012 +0200
+++ b/uc/avrprog_boot_v0_85/main.c Wed Oct 21 08:31:52 2015 +0200
@@ -51,7 +51,8 @@
#endif
/* UART Baudrate */
- #define BAUDRATE 19200
+#define BAUDRATE 9600
+// #define BAUDRATE 19200
// #define BAUDRATE 19200
//#define BAUDRATE 115200
diff -r 407d6aac41dc uc/avrprog_boot_v0_85/makefile
--- a/uc/avrprog_boot_v0_85/makefile Sun Apr 01 13:47:42 2012 +0200
+++ b/uc/avrprog_boot_v0_85/makefile Wed Oct 21 08:32:01 2015 +0200
@@ -60,7 +60,7 @@
## NO! BOOTSIZE=128
## NO! BOOTSIZE=256
BOOTSIZE=512
-##BOOTSIZE=1024
+## BOOTSIZE=1024
## BOOTSIZE=2048
# /* Select if bootloader should include the inverrupt-vectors
@@ -405,7 +405,7 @@
AVRDUDE_PORT = usb # programmer connected to serial device
#AVRDUDE_PORT = /dev/ttyS0 # programmer connected to serial device
-AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex -U lfuse:w:0xe4:m -U hfuse:w:0xda:m
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex -U lfuse:w:0xef:m -U hfuse:w:0xda:m
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment