EEMPROM Error with ATtiny1634

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

EEMPROM Error with ATtiny1634

Bernhard Rittirsch
Hi,

I' trying to write an .eep, and get always: "verification error, first mismatch at byte 0x0000"

I was hunting the problem down to with this small code sequence (_writeNumber outputs a byte via the UART):

uint8_t test[5]    EEMEM =  { 3, 4, 5, 6, 7};
uint8_t test2[128]     EEMEM =  { 9, 8, 9, 9, 9};

(...)

 _writeNumber (eeprom_read_byte(&test[1]));
 _writeNumber ((uint8_t)(int)&test[1]);
 _writeNumber (eeprom_read_byte(&test2[1]));
 _writeNumber ((uint8_t)(int)&test2[1]);
 
 eeprom_write_byte (&test[1], 25);
 eeprom_write_byte (&test2[1], 26);
 
 _writeNumber (eeprom_read_byte(&test[1]));
 _writeNumber ((uint8_t)(int)&test[1]);
 _writeNumber (eeprom_read_byte(&test2[1]));
 _writeNumber ((uint8_t)(int)&test2[1]);

I get the following output:
000129 >> test value 2 in EEPROM address 129: is 0, should be 4
004001 >> test2 value 2 in EEPROM address 1: is 4, should be 8
025129 >> just to proove the EEPROM is not currupt - writing address 129 from code works
026001 >> just to proove the EEPROM is not currupt - writing address 1 from code works

It seems like the bytes starting with address 128 get actually written from address 0. Testing the same code with a ATmega1284 works like a charm, hence I assume the .eep file is correct (created with avr-gcc). I was investigating already a bit in the avrdude.conf, but cannot verify if the problem comes from there or from elsewhere. Attached the eep file, and the relevant conf section.

Many thanks for any hint...

best regards,
muli

_______________________________________________
AVR-chat mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avr-chat

avrdude.conf (8K) Download Attachment
RS232_TINY1634.eep (540 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: EEMPROM Error with ATtiny1634

georg.chambert@telia.com
Hi, Im, of cause, not fully following yr system;  but 

what do y want to achive with .. [1] in yr write statements ?  

/g
----Ursprungligt meddelande----
Från : [hidden email]
Datum : 2018-01-28 - 01:11 (V)
Till : [hidden email]
Ämne : [avr-chat] EEMPROM Error with ATtiny1634

Hi,

I' trying to write an .eep, and get always: "verification error, first mismatch at byte 0x0000"

I was hunting the problem down to with this small code sequence (_writeNumber outputs a byte via the UART):

uint8_t test[5]    EEMEM =  { 3, 4, 5, 6, 7};
uint8_t test2[128]     EEMEM =  { 9, 8, 9, 9, 9};

(...)

 _writeNumber (eeprom_read_byte(&test[1]));
 _writeNumber ((uint8_t)(int)&test[1]);
 _writeNumber (eeprom_read_byte(&test2[1]));
 _writeNumber ((uint8_t)(int)&test2[1]);
 
 eeprom_write_byte (&test[1], 25);
 eeprom_write_byte (&test2[1], 26);
 
 _writeNumber (eeprom_read_byte(&test[1]));
 _writeNumber ((uint8_t)(int)&test[1]);
 _writeNumber (eeprom_read_byte(&test2[1]));
 _writeNumber ((uint8_t)(int)&test2[1]);

I get the following output:
000129 >> test value 2 in EEPROM address 129: is 0, should be 4
004001 >> test2 value 2 in EEPROM address 1: is 4, should be 8
025129 >> just to proove the EEPROM is not currupt - writing address 129 from code works
026001 >> just to proove the EEPROM is not currupt - writing address 1 from code works

It seems like the bytes starting with address 128 get actually written from address 0. Testing the same code with a ATmega1284 works like a charm, hence I assume the .eep file is correct (created with avr-gcc). I was investigating already a bit in the avrdude.conf, but cannot verify if the problem comes from there or from elsewhere. Attached the eep file, and the relevant conf section.

Many thanks for any hint...

best regards,
muli



_______________________________________________
AVR-chat mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avr-chat
Reply | Threaded
Open this post in threaded view
|

Re: EEMPROM Error with ATtiny1634

Martin Stejskal
Maybe lock fuses?
 Best regards
  Martin

2018-01-28 20:04 GMT+01:00 [hidden email] <[hidden email]>:
Hi, Im, of cause, not fully following yr system;  but 

what do y want to achive with .. [1] in yr write statements ?  

/g
----Ursprungligt meddelande----
Från : [hidden email]
Datum : 2018-01-28 - 01:11 (V)
Till : [hidden email]
Ämne : [avr-chat] EEMPROM Error with ATtiny1634


Hi,

I' trying to write an .eep, and get always: "verification error, first mismatch at byte 0x0000"

I was hunting the problem down to with this small code sequence (_writeNumber outputs a byte via the UART):

uint8_t test[5]    EEMEM =  { 3, 4, 5, 6, 7};
uint8_t test2[128]     EEMEM =  { 9, 8, 9, 9, 9};

(...)

 _writeNumber (eeprom_read_byte(&test[1]));
 _writeNumber ((uint8_t)(int)&test[1]);
 _writeNumber (eeprom_read_byte(&test2[1]));
 _writeNumber ((uint8_t)(int)&test2[1]);
 
 eeprom_write_byte (&test[1], 25);
 eeprom_write_byte (&test2[1], 26);
 
 _writeNumber (eeprom_read_byte(&test[1]));
 _writeNumber ((uint8_t)(int)&test[1]);
 _writeNumber (eeprom_read_byte(&test2[1]));
 _writeNumber ((uint8_t)(int)&test2[1]);

I get the following output:
000129 >> test value 2 in EEPROM address 129: is 0, should be 4
004001 >> test2 value 2 in EEPROM address 1: is 4, should be 8
025129 >> just to proove the EEPROM is not currupt - writing address 129 from code works
026001 >> just to proove the EEPROM is not currupt - writing address 1 from code works

It seems like the bytes starting with address 128 get actually written from address 0. Testing the same code with a ATmega1284 works like a charm, hence I assume the .eep file is correct (created with avr-gcc). I was investigating already a bit in the avrdude.conf, but cannot verify if the problem comes from there or from elsewhere. Attached the eep file, and the relevant conf section.

Many thanks for any hint...

best regards,
muli



_______________________________________________
AVR-chat mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avr-chat



_______________________________________________
AVR-chat mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avr-chat
Reply | Threaded
Open this post in threaded view
|

Re: EEMPROM Error with ATtiny1634

Bernhard Rittirsch
In reply to this post by georg.chambert@telia.com
Hi Georg,

the write statements are just there for debug purpose... to prove that programming the eeprom via avrdude is overwriting bytes 0-127 when bytes 128... are written. But writing eeprom byte 129 from code works well, hence the chip is correct. Hence I guess somehoe the conf file is wrong?

thanks,
muli

2018-01-28 20:04 GMT+01:00 [hidden email] <[hidden email]>:
Hi, Im, of cause, not fully following yr system;  but 

what do y want to achive with .. [1] in yr write statements ?  

/g
----Ursprungligt meddelande----
Från : [hidden email]
Datum : 2018-01-28 - 01:11 (V)
Till : [hidden email]
Ämne : [avr-chat] EEMPROM Error with ATtiny1634


Hi,

I' trying to write an .eep, and get always: "verification error, first mismatch at byte 0x0000"

I was hunting the problem down to with this small code sequence (_writeNumber outputs a byte via the UART):

uint8_t test[5]    EEMEM =  { 3, 4, 5, 6, 7};
uint8_t test2[128]     EEMEM =  { 9, 8, 9, 9, 9};

(...)

 _writeNumber (eeprom_read_byte(&test[1]));
 _writeNumber ((uint8_t)(int)&test[1]);
 _writeNumber (eeprom_read_byte(&test2[1]));
 _writeNumber ((uint8_t)(int)&test2[1]);
 
 eeprom_write_byte (&test[1], 25);
 eeprom_write_byte (&test2[1], 26);
 
 _writeNumber (eeprom_read_byte(&test[1]));
 _writeNumber ((uint8_t)(int)&test[1]);
 _writeNumber (eeprom_read_byte(&test2[1]));
 _writeNumber ((uint8_t)(int)&test2[1]);

I get the following output:
000129 >> test value 2 in EEPROM address 129: is 0, should be 4
004001 >> test2 value 2 in EEPROM address 1: is 4, should be 8
025129 >> just to proove the EEPROM is not currupt - writing address 129 from code works
026001 >> just to proove the EEPROM is not currupt - writing address 1 from code works

It seems like the bytes starting with address 128 get actually written from address 0. Testing the same code with a ATmega1284 works like a charm, hence I assume the .eep file is correct (created with avr-gcc). I was investigating already a bit in the avrdude.conf, but cannot verify if the problem comes from there or from elsewhere. Attached the eep file, and the relevant conf section.

Many thanks for any hint...

best regards,
muli




_______________________________________________
AVR-chat mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avr-chat
Reply | Threaded
Open this post in threaded view
|

Re: EEMPROM Error with ATtiny1634

Erik Christiansen-2
In reply to this post by Bernhard Rittirsch
On 28.01.18 01:11, Bernhard Rittirsch wrote:
> I' trying to write an .eep, and get always: "verification error, first
> mismatch at byte 0x0000"

To cross-check on what the debug code is printing to the serial port,
I'd use avrdude -t -U eeprom:w:filename.eep , followed by a :r: to check
the eeprom contents directly. If there's a mismatch, then it's a dud
device or an avrdude bug. (Possibly config, as you surmise. But more
testing first. ;)

If that confirms faulty eeprom writing, then I'd compare the ATtiny1634
conf with another ATtiny of similar vintage and eeprom size. Nearly two
decades ago, I had to tweak one (Either the ATmega64 or 16, AFAIR.)

Erik

_______________________________________________
AVR-chat mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avr-chat
Reply | Threaded
Open this post in threaded view
|

Re: EEMPROM Error with ATtiny1634

georg.chambert@telia.com
So how goes it ?
from the timestamp I figure you are in US, or night worker ;)

/georg

----- Original Message -----
From: "Erik Christiansen" <[hidden email]>
To: <[hidden email]>
Sent: Friday, February 02, 2018 3:49 AM
Subject: Re: [avr-chat] EEMPROM Error with ATtiny1634


> On 28.01.18 01:11, Bernhard Rittirsch wrote:
>> I' trying to write an .eep, and get always: "verification error, first
>> mismatch at byte 0x0000"
>
> To cross-check on what the debug code is printing to the serial port,
> I'd use avrdude -t -U eeprom:w:filename.eep , followed by a :r: to check
> the eeprom contents directly. If there's a mismatch, then it's a dud
> device or an avrdude bug. (Possibly config, as you surmise. But more
> testing first. ;)
>
> If that confirms faulty eeprom writing, then I'd compare the ATtiny1634
> conf with another ATtiny of similar vintage and eeprom size. Nearly two
> decades ago, I had to tweak one (Either the ATmega64 or 16, AFAIR.)
>
> Erik
>
> _______________________________________________
> AVR-chat mailing list
> [hidden email]
> https://lists.nongnu.org/mailman/listinfo/avr-chat

_______________________________________________
AVR-chat mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avr-chat