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

0.54.0 FT230x EEPROM API inaccuracies #351

Open
timothy-lee2415 opened this issue Aug 9, 2023 · 2 comments
Open

0.54.0 FT230x EEPROM API inaccuracies #351

timothy-lee2415 opened this issue Aug 9, 2023 · 2 comments

Comments

@timothy-lee2415
Copy link

Using pyftdi to bitbang on the FT230x CBUS pins. I want to check if CBUS functions are set to GPIO, and if not, set them to GPIO in EEPROM so I can use the cbus gpio APIs. I ran into a number of issues along with some inaccuracies with the APIs:
Doing:
` ftdi = Ftdi()
ftdi.open_from_url("ftdi://ftdi:ft-x:/1")
if ftdi.has_cbus:
print("Found CBUS enabled FTDI 230x")

eeprom = FtdiEeprom()
eeprom.connect(ftdi)
eeprom.set_property("cbus_func_0", "GPIO")
eeprom.set_property("cbus_func_1", "GPIO")
eeprom.set_property("cbus_func_2", "GPIO")
eeprom.set_property("cbus_func_3", "GPIO")
print(eeprom.commit(dry_run=False))
eeprom.reset_device()
eeprom.dump_config()`
  • eeprom.commit always returns false even if one of the above options is changed. e.g. if I write DRIVE0 with eeprom.set_property and commit, eeprom.commit still returns False. This is an issue since I need to be able to tell if settings were changed or not so I can avoid doing a lengthy reset. Some kind of get_property API would be incredibly useful here.
  • eeprom.sync() doesn't seem to apply the EEPROM changes, only after a device reset do the settings take place.
@eblot
Copy link
Owner

eblot commented Aug 12, 2023

Yeap, EEPROM support is mostly broken. Patches accepted.

@JonathonReinhart
Copy link

I also just noticed that Eeprom.commit() always returns the value of the dry_run argument:

return dry_run

Assuming self._ftdi.overwrite_eeprom(self._eeprom, dry_run=dry_run) does the right thing, it seems this should be:

        return not dry_run

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

3 participants