Hi SET, Am 22.10.2015 um 21:11 schrieb Salvador Eduardo Tropea: > Hi! > > I'm trying to include some data inside the EEPROM generated by ftdi_eeprom > tool. > I modified the ftdi_eeprom tool and libftdi to: > > 1) Support a "--build-eeprom" command line option that just generates the > EEPROM image (only flashed if --flash-eeprom is provided) > 2) Support two configuration options: > - user_data_addr an integer indicating the offset where we want to put the > user provided data. > - user_data_file a string indicating the filename that contains the binary > data to be added. > 3) Extended libftdi API to store the above mentioned data inside the eeprom > struct. > 4) Extended ftdi_eeprom_build to include this data. > > I'm attaching the output of "git diff". > Is this patch acceptable? > > Regards, SET > > PS: I fixed a couple of computations that assumed the EEPROM size is 128.
thanks for your patch! It looks quite good and just needs a few minor tweaks: - ftdi_eeprom: Warn the user if the supplied user data is too big for the storage area. Right now we silently truncate it. - Do we need to hardcode the hex offsets in "free_start"? Could we also do "free_start += 1;" and so on? - Hardcoding of 128 byte limit again in this line: if (eeprom->size>128) user_area_size+=eeprom->size-128; ? Would be good to add a comment here that explains why it's there. - Why not ftdi_error_return() in dangerous cases like this: fprintf(stderr,"Warning, user data overlaps the strings area!\n"); ? - ftdi_set_eeprom_user_buf() -> rename to "ftdi_set_eeprom_user_data()" Let me know what you think. Cheers, Thomas -- libftdi - see http://www.intra2net.com/en/developer/libftdi for details. To unsubscribe send a mail to [email protected]
