Enhancement #1079
Network Programming Support
0%
Description
Flesh out a system for network programming of tools. Perhaps look into how the Colony bootloader works as well as what the ATTiny2313 documentation says on bootloading or writing to program flash.
History
#1 Updated by Kevin Woo about 13 years ago
We need to use the Self-Programming Flash feature of the ATTIny2313. Page 155 of the datasheet.
Notes from the datasheet:
- Need to make sure the SELFPRGEN fuse is set
- Write to the flash 1 page at a time
- Fill temp page buffer
- Erase the page to write (Page Erase)
- Write the buffer to the page (Page Write)
- Erasing a page
- Set page address in the Z-pointer (ZH + ZL, Z[15:0])
- Write 0x03 to SPMCSR and immediately execute SPM ASM instruction
- Writing a temp page
- Set up address in Z-pointer
- Put data in R1:R0
- Write 0x01 to SPMCSR and execute SPM ASM instruction
- Do not do any EEPROM writes as it will erase the temp page
- Writing a page
- Set up the page address in Z-pointer
- Write 0x5 in SPMCSR and execute SPM ASM instruction
- Must be page aligned address
- Will pull the data from the temp buffer
Notes about setting fuses:
This page describes how to set/read the fuses through AVRDUDE pretty clearly. We have to convert them to hex ourselves.
http://electrons.psychogenic.com/modules/arms/art/14/AVRFusesHOWTOGuide.php
Note that the self-program enable fuse is located in the efuse section, not fuseh or fusel as all the standard fuses.
#2 Updated by Kevin Woo about 13 years ago
AVR-LIBC seems to have some macros to make this easier: http://www.nongnu.org/avr-libc/user-manual/group__avr__boot.html
#3 Updated by Kevin Woo about 13 years ago
512byte boot loader. We can probably modify this. It's setup to use the uart protocol I believe. Need to login to avrfreaks to see it though.
#4 Updated by Kevin Woo about 13 years ago
- Status changed from Assigned to Fixed
Network programming is implemented and works.