avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] Problem reading from EEPROM


From: Theodore A. Roth
Subject: Re: [avr-gcc-list] Problem reading from EEPROM
Date: Mon, 14 Jul 2003 15:44:10 -0700 (PDT)


On Mon, 14 Jul 2003, Arthur  Goldhammer wrote:

> Hi, Jack
> I'm using an STK200 with uisp. I have the following lines in my Makefile:
>
> PROGRAMMER = /usr/local/bin/uisp
> PROGFLAGS = -dprog=stk200
> ....
> install: $(PRG).srec
>  $(PROGRAMMER) $(PROGFLAGS) --erase
>  $(PROGRAMMER) $(PROGFLAGS) --upload if=$<
>  $(PROGRAMMER) $(PROGFLAGS) --verify if=$<
>  $(PROGRAMMER) $(PROGFLAGS) --segment=eeprom --upload if=$(PRG)_eeprom.srec
>  $(PROGRAMMER) $(PROGFLAGS) --segment=eeprom --verify if=$(PRG)_eeprom.srec
>
> This loads both the program and the EEPROM, where the data for the latter
> are distinguished by the _eeprom suffix, produced as follows in the
> Makefile:
>
> %_eeprom.srec: %.elf
>  $(OBJCOPY) -j .eeprom --change-section-lma .eeprom=0 -O srec $< $@
>
> I am not able to get uisp to load the program code and EEPROM independently.
> Even if I use --segment=flash on the --erase, the EEPROM seems to get
> erased. Using the AVR loader on Windows, I was able to load flash and EEPROM
> separately. I'm not sure why I can't get it to work with uisp. If anybody
> can tell me, I'd be grateful. In the meantime I've got the program working
> by this brute force method.

I'm a bit confused about exactly what you are saying that uisp can't
do that you can do in windows. Your makefile rules look like the
correct approach when using uisp.

Are you wanting to program both the flash and eeprom with a single
invocation of uisp?

I just checked the 8515 datasheet and the SPI Chip Erase will always
erase both the flash and the eeprom at the same time. Thus, you will
always have to reprogram the eeprom when the device is erased.

The mega128 (and I suspect other megas) has a fuse bit setting which
allows preserving the eeprom contents on a chip erase.

Ted Roth


reply via email to

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