Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FtdiEeprom: missing "chip" option byte will make FT_PROG erase the EEPROM(!) #402

Open
mikrodust-henrikp opened this issue Feb 12, 2025 · 1 comment

Comments

@mikrodust-henrikp
Copy link

Hi there!

Was thinking of fixing this and pushing a PR but I'm unsure what's the correct fix and where...

The company I currently work for has a custom device with a few FT2232H chips on it which arrive from the factory with blank EEPROMs. We have used pyftdi to program them (I guess switching to FT_PROG on Windows would have been a wise choice but..it worked so..) but I noticed that if I opened FT_PROG on Windows and just did "Scan and parse.." the EEPROMs on all the FT2232H chips that had been programmed with pyftdi were erased(!) by FT_PROG.

So I spent some time debugging this and found that the "chip" property needs to be set. In our case, to 0x56 (since we have a 93LC56 attached to the 2232h). Setting that option makes the eeprom survive being scanned by FT_PROG.

The documentation maybe should also mention that erasing the EEPROM with erase byte 0xFF should only be done if you don't plan on calling initialize() because a lot of options that are not set by pyftdi will have meanings with 0xFF, so erasing with 0x00 seems to be a more sane choice.

And...it seems that bit 0x80 should always be set in "self_powered" option, now only the 0x40 mask is set when setting that option, but FT_PROG and other tools seems to always set the msb in that byte, and FT_PROG also doesn't recognize that the device is self powered when the byte is set to 0x40, but does if it's 0xC0.

@eblot
Copy link
Owner

eblot commented Feb 12, 2025

Hi,

Well to be honest I have not worked on this project for several months, as my spare free time is reduced to zero.

You can submit a patch/PR, maybe some other users can give it a try and provide some feedback. I can have a look at it as well, but I have really not time to test it at the moment unfortunately.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants