Hi there,

First of all, thanks for great software!

We're using OpenOCD for flashing and debugging Cortex boards on daily basis (linux).
The use of the DCC channel has proven valuable to us on older ARMs, so right now I'm compiling the trunk (0b263763f5dfa9e26c14bdb920be281a9bd4f468 as of today) as there have been Cortex DCC patches.
This gives me build errors however.

I am compiling using libftdi.
$ pkg-config --modversion libftdi
0.19

Here's the sequence:

$ ./bootstrap
...
$ ./configure --enable-ft2232_libftdi
...
$ make
...
ft2232.c: In function 'ft2232_device_is_highspeed':
ft2232.c:610:21: error: 'TYPE_232H' undeclared (first use in this function)
ft2232.c:610:21: note: each undeclared identifier is reported only once for each function it appears in
ft2232.c:614:1: error: control reaches end of non-void function [-Werror=return-type]
...

Following this, ./configure finds that I have a highspeed USB device, defining BUILD_FT2232_HIGHSPEED.
Looking at ft2232.c, I find peculiarities:

134: #ifndef BUILD_FT2232_HIGHSPEED
135:  #if BUILD_FT2232_FTD2XX == 1
136:    enum { FT_DEVICE_2232H = 6, FT_DEVICE_4232H, FT_DEVICE_232H };
137:  #elif BUILD_FT2232_LIBFTDI == 1
138:     enum ftdi_chip_type { TYPE_2232H = 4, TYPE_4232H = 5, TYPE_232H = 6 };
139:  #endif
140: #endif
...
599: static bool ft2232_device_is_highspeed(void)
600: {
601: #if BUILD_FT2232_FTD2XX == 1
602:     return (ftdi_device == FT_DEVICE_2232H) || (ftdi_device == FT_DEVICE_4232H)
603:  #ifdef HAS_ENUM_FT232H
604:         || (ftdi_device == FT_DEVICE_232H)
605:  #endif
606:     ;
607: #elif BUILD_FT2232_LIBFTDI == 1
608:     return (ftdi_device == TYPE_2232H || ftdi_device == TYPE_4232H
609:  #ifdef HAS_ENUM_FT232H
610:         || ftdi_device == TYPE_232H
611:  #endif
612:     );
613: #endif
614: }

So, if BUILD_FT2232_HIGHSPEED is defined, TYPE_232H is never defined, hence the compilation failure. However, it is weird - it seems TYPE_2232H and TYPE_4232H _are_ defined as I get no errors on these. Where those definitions come from I have no idea - the libftdi itself perhaps?

Making following change will make it compile and seem to work after some initial testings:

607: #elif BUILD_FT2232_LIBFTDI == 1
608:     return (ftdi_device == TYPE_2232H || ftdi_device == TYPE_4232H
+     #ifndef BUILD_FT2232_HIGHSPEED
609:  #ifdef HAS_ENUM_FT232H
610:         || ftdi_device == TYPE_232H
611:  #endif
+     #endif
612:     );
613: #endif

If this is a plain stupidity from my side, I do beg you pardon. If you need any other info, please let me know.

Many thanks,

Peter

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to