uisp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Uisp-dev] [RFC] stk500 ReadMem() fix


From: Theodore A. Roth
Subject: [Uisp-dev] [RFC] stk500 ReadMem() fix
Date: Wed, 29 May 2002 13:47:05 -0600 (MDT)

Hi,

The attached patch makes the stk500 ReadByte() and ReadMem() functions a 
bit more sane with respect to how they handle the various memory segments. 
I tested this with the terminal mode as such:

  address@hidden src]$ ./uisp -dprog=stk500 -dserial=/dev/stk500 
  -dpart=atmega128 --terminal
  Atmel AVR ATmega128 is found.
  Entering the AVR Terminal. ?-help, q-quit.
  avr>du 0x00
  flash $00000: 0c 94 46 00 0c 94 68 00 
  flash $00008: 0c 94 68 00 0c 94 68 00 
  flash $00010: 0c 94 68 00 0c 94 68 00 
  flash $00018: 0c 94 68 00 0c 94 68 00 
  avr>ss eeprom
  avr>du 0x00
  eeprom $00000: ff ff ff ff ff ff ff ff 
  eeprom $00008: ff ff ff ff ff ff ff ff 
  eeprom $00010: ff ff ff ff ff ff ff ff 
  eeprom $00018: ff ff ff ff ff ff ff ff 
  avr>ss flash
  avr>du 0x00
  flash $00000: 0c 94 46 00 0c 94 68 00 
  flash $00008: 0c 94 68 00 0c 94 68 00 
  flash $00010: 0c 94 68 00 0c 94 68 00 
  flash $00018: 0c 94 68 00 0c 94 68 00 
  avr>q
  Ouch.

Shall I apply this?

Of course, there's still a problem with updating the buffers if the data 
changes, but that might not be that big a deal for flash as for eeprom. I 
added a FIXME to the code to note this.

I think the same technique should also be applied to the
WriteByte()/FlushWriteBuffer() functions since the flash and eeprom
buffers are different sizes and there is only one buffer used for both.  
If this is acceptable, I'll keep on it.


Ted Roth

Attachment: uisp-stk500-readmem.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]