[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Problem reading from EEPROM
From: |
Arthur Goldhammer |
Subject: |
Re: [avr-gcc-list] Problem reading from EEPROM |
Date: |
Mon, 14 Jul 2003 18:00:04 -0400 |
----- Original Message -----
From: "Jack Valmadre" <address@hidden>
To: <address@hidden>
Sent: Monday, July 14, 2003 5:31 PM
Subject: Re: [avr-gcc-list] Problem reading from EEPROM
> I am thinking of using EEPROM variables later in my program, if you could
> tell me how you prevented the EEPROM erasing when you loaded the program
on
> to the chip, that'd be a great help so that I don't run into any problems
in
> the near future (I'm kinda pressed for time).
> Thanks,
> Jack
>
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.
Art