Tamas Vincze | 3 Dec 15:37 2010

Patch for ftdi_eeprom_decode()

Hi,

The attached patch initializes eeprom->size and fixes the address of the
high_current flag. It's against the Nov 29, 2010 git tree.

Tamas

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe <at> developer.intra2net.com   
Attachment (ftdi_eeprom_decode.patch): text/x-patch, 526 bytes
Uwe Bonnes | 6 Dec 17:38 2010
Picon

Re: Patch for ftdi_eeprom_decode()

>>>>> "Tamas" == Tamas Vincze <tom <at> vincze.org> writes:

    Tamas> Hi, The attached patch initializes eeprom->size and fixes the
    Tamas> address of the high_current flag. It's against the Nov 29, 2010
    Tamas> git tree.

What tree is the patch agains? 

Aren't these two unrelated changes?

eeprom->size should initalizes to zero via memset(eeprom,...) and the value
eeprom of zero should later trigger setting the right size after the size
has been determined with the erase procedure.

Bye
--

-- 
Uwe Bonnes                bon <at> elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------

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

Thomas Jarosch | 7 Dec 09:40 2010

Re: Patch for ftdi_eeprom_decode()

On Monday, 6. December 2010 17:38:31 Uwe Bonnes wrote:
> >>>>> "Tamas" == Tamas Vincze <tom <at> vincze.org> writes:
>     Tamas> Hi, The attached patch initializes eeprom->size and fixes the
>     Tamas> address of the high_current flag. It's against the Nov 29,
> 2010 Tamas> git tree.
> 
> What tree is the patch against?

Uwe, you were faster than me :)

The patch seems against libftdi 0.x as it matches
for the ftdi_eeprom_decode() function.

Regarding the "eeprom-new" branch of libftdi 1.x: I wanted to finish porting
the ftdi_eeprom tool and have been kept quite busy at $dayjob.
I hope I'll have time for it in the Christmas holidays.
If you want to give it a go yourself, feel free to do so.

Cheers,
Thomas

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

Tyler Cordrey | 16 Dec 20:42 2010

Trouble with libftdi on ARM

Hello,

I'm trying to use libftdi as a replacement for ftdi_sio on an ARM9 with 
linux. I'm using an older kernel that is provided with the board, it's 
2.6.21. I've got two FT4232H chips plugged into it, and I can comm. fine 
through them using the ftdi_sio module modified for this kernel version.

With libftdi, all of the functions return normally but nothing is read 
or written on the ports. All of the initialization functions return zero 
and write returns the number of bytes requested to be written. I've made 
sure that ftdi_sio is not loaded, and I've even tried using 
usb_detach_kernel_driver_np to make sure the module is not interfering. 
The strange thing is that it behaves the same when the module is loaded 
- no errors, same behavior.

Here is the code I am using to test: http://pastebin.com/FPz522k8. On my 
386 box it works fine, and fails if the ftdi_sio module is loaded.

I've got libusb version 0.1.10a and libftdi version 0.18. Is there 
anything about this configuration that might cause problems?

Thanks a lot for any suggestions.

Tyler

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

(Continue reading)

Spindler, Tyler L | 16 Dec 22:08 2010

RE: Trouble with libftdi on ARM

Depending on the architecture of the of ARM processor you are running
on, it may not get initialized properly.  It sounds like you aren't
loading ftdi_sio, so I'm not sure if this will help.

There was a bug that was recently fixed to address an issue with this
chip in a new version of the kernel.  You would need to patch to fix.  I
was using OpenWRT running on an ARM processor when I ran into the
FT2232/4232 issue.  Patches are included as well as tickets submitted
into the kernel in the link.

https://dev.openwrt.org/ticket/7365

Tyler

-----Original Message-----
From: Tyler Cordrey [mailto:tyler <at> marslabs.com] 
Sent: Thursday, December 16, 2010 1:43 PM
To: libftdi <at> developer.intra2net.com
Subject: Trouble with libftdi on ARM

Hello,

I'm trying to use libftdi as a replacement for ftdi_sio on an ARM9 with 
linux. I'm using an older kernel that is provided with the board, it's 
2.6.21. I've got two FT4232H chips plugged into it, and I can comm. fine

through them using the ftdi_sio module modified for this kernel version.

With libftdi, all of the functions return normally but nothing is read 
or written on the ports. All of the initialization functions return zero
(Continue reading)

Vladimir Yakovlev | 23 Dec 14:05 2010
Picon

[PATCH] Proper initialisation of interface A.

Write correct ftdi->in_ep and others when initialising interface A.
Without it you can not switch back to interface A, after B.
In sequence A-B-A, B stuck forewer.
---
 src/ftdi.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/ftdi.c b/src/ftdi.c
index 9cf425f..b0415eb 100644
--- a/src/ftdi.c
+++ b/src/ftdi.c
 <at>  <at>  -133,10 +133,7  <at>  <at>  int ftdi_init(struct ftdi_context *ftdi)
     ftdi->writebuffer_chunksize = 4096;
     ftdi->max_packet_size = 0;

-    ftdi->interface = 0;
-    ftdi->index = 0;
-    ftdi->in_ep = 0x02;
-    ftdi->out_ep = 0x81;
+    ftdi_set_interface(ftdi, INTERFACE_ANY);
     ftdi->bitbang_mode = 1; /* when bitbang is enabled this holds the number of the mode  */

     ftdi->error_str = NULL;
 <at>  <at>  -202,7 +199,10  <at>  <at>  int ftdi_set_interface(struct ftdi_context *ftdi, enum ftdi_interface interface)
     {
         case INTERFACE_ANY:
         case INTERFACE_A:
-            /* ftdi_usb_open_desc cares to set the right index, depending on the found chip */
+            ftdi->interface = 0;
+            ftdi->index     = INTERFACE_A;
(Continue reading)

"Morgane Vallée (aeris)" | 23 Dec 14:30 2010
Picon

ftdi_eeprom 1.0

Hello,

I modify ftdi_eeprom for libtfdi 1.0 to work good and more easy to use 
(for me).

You can find this at 
http://www.milkymist.org/wiki/index.php?title=Working_ftdi_eeprom

it's not really good, but if it can help you...

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

Thomas Jarosch | 30 Dec 10:11 2010

Re: [PATCH] Proper initialisation of interface A.

Hello Vladimir,

On Thursday, 23. December 2010 14:05:42 Vladimir Yakovlev wrote:
>  <at>  <at>  -133,10 +133,7  <at>  <at>  int ftdi_init(struct ftdi_context *ftdi)
>      ftdi->writebuffer_chunksize = 4096;
>      ftdi->max_packet_size = 0;
> 
> -    ftdi->interface = 0;
> -    ftdi->index = 0;
> -    ftdi->in_ep = 0x02;
> -    ftdi->out_ep = 0x81;
> +    ftdi_set_interface(ftdi, INTERFACE_ANY);
>      ftdi->bitbang_mode = 1; /* when bitbang is enabled this holds the
> number of the mode  */
> 
>      ftdi->error_str = NULL;
>  <at>  <at>  -202,7 +199,10  <at>  <at>  int ftdi_set_interface(struct ftdi_context *ftdi,
> enum ftdi_interface interface) {
>          case INTERFACE_ANY:
>          case INTERFACE_A:
> -            /* ftdi_usb_open_desc cares to set the right index,
> depending on the found chip */ +            ftdi->interface = 0;
> +            ftdi->index     = INTERFACE_A;
> +            ftdi->in_ep     = 0x02;
> +            ftdi->out_ep    = 0x81;
>              break;
>          case INTERFACE_B:
>              ftdi->interface = 1;

Thanks for your patch, applied!
(Continue reading)

Thomas Jarosch | 30 Dec 10:17 2010

Re: ftdi_eeprom 1.0

Hello Morgane,

On Thursday, 23. December 2010 14:30:19 Morgane Vallée (aeris) wrote:
> I modify ftdi_eeprom for libtfdi 1.0 to work good and more easy to use
> (for me).
> 
> You can find this at
> http://www.milkymist.org/wiki/index.php?title=Working_ftdi_eeprom
> 
> it's not really good, but if it can help you...

Thanks for letting me know. What exactly did you change?

I tried to diff it against the "main" version but there
where too many changes to list.

Cheers,
Thomas

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

Vladimir Yakovlev | 30 Dec 13:33 2010
Picon

Re: [PATCH] Proper initialisation of interface A.

> Small remark about the older BM type chips: It will also set the
> ftdi->index to "1" for the old chips.
>
> According to my very ancient documentation, an index of zero (=default
> interface) will be remapped to one (=SIOA). I verified it works by modifying
> libftdi 0.x with "ftdi->index = 1" and run it on old hardware.
>
> There's also code in ftdi_usb_open_dev() to set interface A,
> maybe we can get rid of that?

This code do nothing (tested on FT2232H). Index alyaws set to 0, even
without my patch by ftdi_init()
You can remove it.

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


Gmane