FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:

Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


New Bridgetek Community is now open

Please note that we have created the Bridgetek Community to discuss all Bridgetek products e.g. EVE, MCU.

Please follow this link and create a new user account to get started.

Bridgetek Community

Author Topic: FT230X Java D2xx eeprom write failed  (Read 10008 times)

Luk3

  • Newbie
  • *
  • Posts: 3
    • View Profile
FT230X Java D2xx eeprom write failed
« on: March 17, 2020, 11:08:39 AM »

Hello,

In my hardware I have used FT230X. PC software is developed in Java. I decided to add X series support to https://github.com/akuhtz/JavaFTD2XX
I have read eeprom with status OK but have problem with write to. Function FT_EEPROM_Program returns status 12 = FT_EEPROM_WRITE_FAILED but in FT_PROG I see new programmed values. Why this function returns error? What should I check?

Function prototype in FTD2XX interface:
Code: [Select]
int FT_EEPROM_Program(
        Pointer ftHandle, Structure eepromData, int eepromDataSize, Pointer Manufacturer, Pointer ManufacturerId,
        Pointer Description, Pointer SerialNumber);

My eeprom structure:

Code: [Select]
public class FT_EEPROM_HEADER extends Structure {
    public int deviceType = 0;
    public short vendorId;
    public short productId;
    public byte serNumEnable;
    public short maxPower;
    public byte selfPowered;
    public byte remoteWakeup;
    public byte pullDownEnable;
}

public class FT_EEPROM_X_SERIES extends Structure {
    public FT_EEPROM_HEADER header;
    public byte acSlowSlew;
    public byte acSchmittInput;
    public byte acDriveCurrent;
    public byte adSlowSlew;
    public byte adSchmittInput;
    public byte adDriveCurrent;
    public byte[] cBus = new byte[7];
    public byte invertTxd;
    public byte invertRxd;
    public byte invertRTS;
    public byte invertCTS;
    public byte invertDTR;
    public byte invertDSR;
    public byte invertDCD;
    public byte invertRI;
    public byte bcdEnable;
    public byte bcdForceCBusPWREN;
    public byte bcdDisableSleep;
    public short I2CSlaveAddress;
    public int I2CDeviceId;
    public byte I2CDisableSchmitt;
    public byte FT1248Cpol;
    public byte FT1248Lsb;
    public byte FT1248FlowControl;
    public byte RS485EchoSuppress;
    public byte powerSaveEnable;
    public byte driverType;

    public FT_EEPROM_X_SERIES() {
        this.header.deviceType = (short)DeviceType.DEVICE_X_SERIES.ordinal(); // 9
    }
}

Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 891
    • View Profile
Re: FT230X Java D2xx eeprom write failed
« Reply #1 on: March 20, 2020, 04:39:05 PM »

Hello,

Please see AN_428 D2XX EEPROM Programming Examples for some useful information.

Also refer to the D2XX Programmer's Guide.

FT_EEPROM_Read and FT_EEPROM_Program must be used with the FT_X Series.

If you send us an email I can send a simple code example. This forum is limited to 20000 characters so couldn't post it here.

Best Regards,
FTDI Community
Logged

Luk3

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: FT230X Java D2xx eeprom write failed
« Reply #2 on: March 23, 2020, 09:33:52 PM »

Thank you for reply. I have written an email.

I have created C++ console application in the Visual Studio and it works - FT_EEPROM_Program returns FT_OK, but in Java still FT_EEPROM_WRITE_FAILED.
Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 891
    • View Profile
Re: FT230X Java D2xx eeprom write failed
« Reply #3 on: March 24, 2020, 02:18:49 PM »

Hello,

OK we have received your email.

You can post any resolution here to help other customers.

Thanks,
FTDI Community
Logged

Luk3

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: FT230X Java D2xx eeprom write failed
« Reply #4 on: April 07, 2020, 08:38:50 PM »

I have solved the problem!

Problem was caused by other thread which is communicates with my device using uart. When the FT_EEPROM_PROGRAM function was invoked and other thread tried to read or write to uart then EEPROM_WRITE_FAILED was returned.
Logged