[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avrdude-dev] EEPROM programming and page_erase
From: |
Hannes Weisbach |
Subject: |
[avrdude-dev] EEPROM programming and page_erase |
Date: |
Sun, 29 Jul 2012 14:47:57 +0200 |
Hi everyone,
when testing some code for avrftdi I came across a problem with EEPROM
programming: avrdude segfaults in avr.c:818 when calling pgm->page_erase (since
avrftdi does not define that function).
If flash is programmed at the same time when the EEPROM is programmed, there is
no problem, since a device erase is executed. Writing only EEPROM and using -e
also works.
First, should that call not be protected by checking if the function-pointer is
non-NULL? As far as I can tell it is an optional function.
Secondly, why is this function (page_erase) called at all? The devices I tested
(Mega32 and PWM3B) do not have a "page erase" command for EEPROM. The
datasheets state that EEPROM locations are erased when re-programmed: "An
EEPROM memory location is first automatically erased before new data is
written." (PWM3B datasheet, doc4317 p. 295).
pgm->page_erase() is called when auto_erase is true (avr.c:818). I would call
the behaviour of the EEPROM of the M32 and PWM3B "auto erase". Maybe this is a
mistake and should be if(!auto_erase)?
I would appreciate any comments.
Best regards,
Hannes
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [avrdude-dev] EEPROM programming and page_erase,
Hannes Weisbach <=