libftdi Archives

Subject: Re: Configuring CBUSX_CLK24

From: Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Cc: Yegor Yefremov <yegorslists@xxxxxxxxxxxxxx>
Date: Thu, 20 Apr 2017 18:17:57 +0200
Hi Yegor,

On Tuesday, 18 April 2017 11:47:50 CEST Yegor Yefremov wrote:
> I'm configuring FTX ftdi.CBUS_FUNCTION_0 to ftdi.CBUSX_CLK24 in Linux
> (ARM machine). After this ttyUSB0 gets disconnected, I can either
> rebind it or reload the FTDI drive. Everything as expected. The
> problem is, that I get 24MHz output only if I really reboot my ARM
> machine.
> 
> How can I activate 24MHz without rebooting?
> 
> My code snippet for programming 24MHz:
> 
> if ftdi.set_eeprom_value(context, ftdi.CBUS_FUNCTION_0, ftdi.CBUSX_CLK24) !=
> 0: print("Failed to set CBUS_FUNCTION_0")
>     return False
> 
> # prepare EEPROM buffer for writing
> if ftdi.eeprom_build(context) < 0:
>     print("Failed to build EEPROM")
>     return False
> 
> # finally write EEPROM
> if ftdi.write_eeprom(context) != 0:
>     print("Failed to write EEPROM")
>     return False
> 
> # close FTDI device
> if ftdi.usb_close(context) != 0:
>     print("Failed to close FTDI device")
>     return False

do you really need to reboot the host
or does re-plugging the device also help?

Did you try to call ftdi_usb_reset() after flashing?

Thought ftdi_usb_open() calls that internally anyway.

Cheers,
Thomas


--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread