Project

General

Profile

Enhancement #1079

Network Programming Support

Added by Kevin Woo about 14 years ago. Updated about 14 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
Target version:
-
Start date:
02/03/2010
Due date:
% Done:

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 14 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
    1. Fill temp page buffer
    2. Erase the page to write (Page Erase)
    3. Write the buffer to the page (Page Write)
  • Erasing a page
    1. Set page address in the Z-pointer (ZH + ZL, Z[15:0])
    2. Write 0x03 to SPMCSR and immediately execute SPM ASM instruction
  • Writing a temp page
    1. Set up address in Z-pointer
    2. Put data in R1:R0
    3. 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
    1. Set up the page address in Z-pointer
    2. 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 14 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 14 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.

http://www.avrfreaks.net/index.php?module=Freaks%20Academy&func=viewItem&item_type=project&item_id=625

#4 Updated by Kevin Woo about 14 years ago

  • Status changed from Assigned to Fixed

Network programming is implemented and works.

Also available in: Atom PDF