Codeplug EEPROM 128 byte alignment when uploading from CPS

Discussions related to the firmware code development
Post Reply
oh1fss
Posts: 11
Joined: Mon May 04, 2020 11:53 am

Codeplug EEPROM 128 byte alignment when uploading from CPS

Post by oh1fss » Tue May 19, 2020 12:20 pm

I have looked at function WriteEEPROM() in OpenGD77Form.cs. The function uploads EEPROM data to GD-77 in chunks of MAX_TRANSFER_SIZE (32 bytes) but on every 128 byte boundary it begins a new chunk.

Why is this necessary? If we begin a new chunk every 32 bytes, a new chunk will be started every 128 bytes as well?

One EEPROM block begins at 0x00E0 which is not aligned on a 128 byte boundary. The other EEPROM start address is 0x7500 which is aligned on a 128 byte boundary. They both are aligned on 32 byte boundaries.

Flash memory upload uses "prepare", "send" and "write" operations to update the flash memory in 4096 byte blocks. For EEPROM there are no "prepare" or "write" operations, just "send".

VK3KYY
Posts: 2426
Joined: Sat Nov 16, 2019 3:25 am
Location: Melbourne, Australia
Contact:

Re: Codeplug EEPROM 128 byte alignment when uploading from CPS

Post by VK3KYY » Tue May 19, 2020 9:43 pm

I don’t know, but. Check the EEPROM data sheet, I think it has some limitations

oh1fss
Posts: 11
Joined: Mon May 04, 2020 11:53 am

Re: Codeplug EEPROM 128 byte alignment when uploading from CPS

Post by oh1fss » Wed May 20, 2020 4:47 am

File OpenGD77-master/docs/data_sheets/Atmel-8720-SEEPROM-AT24C512C-Datasheet.pdf says:

"128-byte Page Write Mode Partial Page Writes Allowed"

When I look at file OpenGD77-master/firmware/source/hardware/EEPROM.c it looks like function EEPROM_Write() handles 128 byte boundaries so that the caller does not have to care about it. That function calls helper function _EEPROM_Write() (note the leading underscore) which has the following comment:

Code: Select all

/* This was the original EEPROM_Write function, but its now been wrapped by the new EEPROM_Write
 * While calls this function as necessary to handle write across 128 byte page boundaries
 * and also for writes larger than 128 bytes.
 */
I guess the "While" should be "which".

So far I have not found where the EEPROM_Write() function is called?

Post Reply