package: add libftdi support
PATCH 1/2 package: add libftdi support
needed by openocd
--- package/Config.in | 1 + package/libftdi/Config.in | 18 ++++++++ .../libftdi/libftdi-0.19-01_pkgconfig_libusb.patch | 47 ++++++++++++++++++++ package/libftdi/libftdi.mk | 23 ++++++++++ 4 files changed, 89 insertions(+), 0 deletions(-) create mode 100644 package/libftdi/Config.in create mode 100644 package/libftdi/libftdi-0.19-01_pkgconfig_libusb.patch create mode 100644 package/libftdi/libftdi.mk
package/Config.in +1 -0
@@ -301,6 +301,7 @@ menu "Hardware handling" source "package/libaio/Config.in" source "package/libraw1394/Config.in" source "package/tslib/Config.in" +source "package/libftdi/Config.in" source "package/libhid/Config.in" source "package/libiqrf/Config.in" source "package/libusb/Config.in"
package/libftdi/Config.in new file +18 -0
@@ -0,0 +1,18 @@ +config BR2_PACKAGE_LIBFTDI + bool "libftdi" + select BR2_PACKAGE_LIBUSB + select BR2_PACKAGE_LIBUSB_COMPAT + help + Userspace access to FTDI USB interface chips + + http://www.intra2net.com/en/developer/libftdi/index.php + +if BR2_PACKAGE_LIBFTDI + +config BR2_PACKAGE_LIBTFDI_CPP + depends on BR2_INSTALL_LIBSTDCPP + bool "C++ Binding" + help + C++ Binding + +endif # BR2_PACKAGE_LIBFTDI
package/libftdi/libftdi-0.19-01_pkgconfig_libusb.patch new file +47 -0
47 lines not on this page · raw message
package/libftdi/libftdi.mk new file +23 -0
@@ -0,0 +1,23 @@ +############################################################# +# +# libftdi +# +############################################################# +LIBFTDI_VERSION = 0.19 +LIBFTDI_SOURCE = libftdi-$(LIBFTDI_VERSION).tar.gz +LIBFTDI_SITE = http://www.intra2net.com/en/developer/libftdi/download/ +LIBFTDI_DEPENDENCIES = libusb-compat libusb +LIBFTDI_INSTALL_STAGING = YES + +LIBFTDI_AUTORECONF = YES + +LIBFDTI_CONF_OPT = --without-examples + +# configure detect it automaticaly so we need to force it +ifeq ($(BR2_PACKAGE_LIBTFDI_CPP),y) +LIBFDTI_CONF_OPT += --enable-libftdipp +else +LIBFDTI_CONF_OPT += --disable-libftdipp +endif + +$(eval $(call AUTOTARGETS,package,libftdi))
Signature · 1 line
1.7.5.4
PATCH 2/2 package: add openocd support
with only the following Adapters
- FTDI FT2xxx/FT4xxx
- J-Link (Segger and Atmel SAM-ICE)
- Versaloon-Link JTAG Adapter
--- package/Config.in | 1 + package/openocd/Config.in | 29 +++++++++++++++++ ...s-compilation-host-libsub-was-used-before.patch | 33 ++++++++++++++++++++ package/openocd/openocd-force_jimtcl_static.patch | 22 +++++++++++++ package/openocd/openocd.mk | 32 +++++++++++++++++++ 5 files changed, 117 insertions(+), 0 deletions(-) create mode 100644 package/openocd/Config.in create mode 100644 package/openocd/openocd-0001-fix-cross-compilation-host-libsub-was-used-before.patch create mode 100644 package/openocd/openocd-force_jimtcl_static.patch create mode 100644 package/openocd/openocd.mk
package/Config.in +1 -0
@@ -190,6 +190,7 @@ source "package/memtester/Config.in" source "package/mtd/Config.in" source "package/ntfs-3g/Config.in" source "package/ntfsprogs/Config.in" +source "package/openocd/Config.in" source "package/pciutils/Config.in" source "package/rng-tools/Config.in" source "package/sdparm/Config.in"
package/openocd/Config.in new file +29 -0
@@ -0,0 +1,29 @@ +menuconfig BR2_PACKAGE_OPENOCD + bool "OpenOCD" + select BR2_PACKAGE_LIBUSB + select BR2_PACKAGE_LIBUSB_COMPAT + help + OpenOCD - Open On-Chip Debugger + + http://openocd.berlios.de/web/ + +if BR2_PACKAGE_OPENOCD + +comment "Adapters" + +config BR2_PACKAGE_OPENOCD_FT2XXX + bool "FT2xxx/FT4xxx Based JTAG Programmer" + select BR2_PACKAGE_LIBFTDI + help + Enable building support for FT2232 based devices + using the libftdi driver, opensource alternate of FTD2XX + +config BR2_PACKAGE_OPENOCD_JLINK + bool "Segger J-Link JTAG Programmer" + help + Segger J-Link JTAG Programmer and clone such as Atmel SAM-ICE + +config BR2_PACKAGE_OPENOCD_VSLLINK + bool "Versaloon-Link JTAG Programmr" + +endif # BR2_PACKAGE_OPENOCD
package/openocd/openocd-0001-fix-cross-compilation-host-libsub-was-used-before.patch new file +33 -0
@@ -0,0 +1,33 @@ +From 3728c4af7f6303ccedab56ec220797f8f290580e Mon Sep 17 00:00:00 2001 +From: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +Date: Wed, 10 Aug 2011 00:17:29 +0800 +Subject: [PATCH] fix cross compilation: host libsub was used before + +tested in buildroot + +Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +--- + configure.in | 7 +++++-- + 1 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/configure.in b/configure.in +index dfa1e8f..cfe2218 100644 +--- a/configure.in ++++ b/configure.in +@@ -1046,8 +1046,11 @@ build_usb=no + if test $build_jlink = yes -o $build_vsllink = yes -o $build_usbprog = yes -o \ + $build_rlink = yes -o $build_ulink = yes -o $build_armjtagew = yes + then +- AC_CHECK_HEADERS([usb.h],[], +- [AC_MSG_ERROR([usb.h is required to build some OpenOCD driver(s)])]) ++ dnl check for libusb ++ PKG_CHECK_MODULES(LIBUSB, libusb >= 0.1.11) ++ CFLAGS="$CFLAGS $LIBUSB_CFLAGS" ++ LDFLAGS="$LFFLAGS $LIBUSB_LDFLAGS" ++ LIBS="$LIBS $LIBUSB_LIBS" + build_usb=yes + fi + +-- +1.7.5.4 +
package/openocd/openocd-force_jimtcl_static.patch new file +22 -0
@@ -0,0 +1,22 @@ +--- + jimtcl/auto.def | 5 ----- + 1 file changed, 5 deletions(-) + +Index: b/jimtcl/auto.def +=================================================================== +--- a/jimtcl/auto.def ++++ b/jimtcl/auto.def +@@ -148,13 +148,8 @@ if {[opt-bool references]} { + msg-result "Enabling references" + define JIM_REFERENCES + } +-if {[opt-bool shared with-jim-shared]} { +- msg-result "Building shared library" +- define JIM_LIBTYPE shared +-} else { + msg-result "Building static library" + define JIM_LIBTYPE static +-} + if {[opt-bool install-jim]} { + define install_jim 1 + } else {
package/openocd/openocd.mk new file +32 -0
@@ -0,0 +1,32 @@ +############################################################# +# +# openocd +# +############################################################# +OPENOCD_VERSION:=0.5.0 +OPENOCD_SOURCE = openocd-$(OPENOCD_VERSION).tar.bz2 +OPENOCD_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/project/openocd/openocd/$(OPENOCD_VERSION) + +OPENOCD_AUTORECONF = YES +OPENOCD_CONF_OPT = \ + --oldincludedir=$(STAGING_DIR)/usr/include \ + --includedir=$(STAGING_DIR)/usr/include \ + --disable-doxygen-html \ + --enable-dummy + +OPENOCD_DEPENDENCIES = libusb-compat + +# Adapters +ifeq ($(BR2_PACKAGE_OPENOCD_FT2XXX),y) +OPENOCD_CONF_OPT += --enable-ft2232_libftdi +endif + +ifeq ($(BR2_PACKAGE_OPENOCD_JLINK),y) +OPENOCD_CONF_OPT += --enable-jlink +endif + +ifeq ($(BR2_PACKAGE_OPENOCD_VSLLINK),y) +OPENOCD_CONF_OPT += --enable-vsllink +endif + +$(eval $(call AUTOTARGETS,package,openocd))
Signature · 1 line
1.7.5.4
PATCH 2/2 package: add openocd support
Quoted 9 lines · Jean-Christophe PLAGNIOL-VILLARD
with only the following Adapters
- FTDI FT2xxx/FT4xxx
- J-Link (Segger and Atmel SAM-ICE)
- Versaloon-Link JTAG AdapterSigned-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc Nicolas Ferre <[email protected]>Cc Patrice Vilchez <[email protected]>---
no comment
Best Regards,
J.
PATCH 2/2 package: add openocd support
In reply to Jean-Christophe PLAGNIOL-VILLARDHello,
Le Tue, 9 Aug 2011 19:39:21 +0200,
Jean-Christophe PLAGNIOL-VILLARD <[email protected]> a ?crit :
package/openocd/openocd.mk line 13
Quoted 2 lines
package/openocd/openocd.mk new file +2
-0+ --oldincludedir=$(STAGING_DIR)/usr/include \ + --includedir=$(STAGING_DIR)/usr/include \
Why are those options needed?
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH 2/2 package: add openocd support
Quoted 9 lines · Thomas Petazzoni
Hello,
Le Tue, 9 Aug 2011 19:39:21 +0200,
Jean-Christophe PLAGNIOL-VILLARD <[email protected]> a ?crit :package/openocd/openocd.mk line 13
Quoted 2 lines
package/openocd/openocd.mk new file +2
-0+ --oldincludedir=$(STAGING_DIR)/usr/include \ + --includedir=$(STAGING_DIR)/usr/include \Why are those options needed?
without openocd looks for /usr/include
Best Regards,
J.
PATCH 2/2 package: add openocd support
In reply to Jean-Christophe PLAGNIOL-VILLARDQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"JC" == Jean-Christophe PLAGNIOL-VILLARD <[email protected]> writes:
JC> with only the following Adapters
JC> - FTDI FT2xxx/FT4xxx JC> - J-Link (Segger and Atmel SAM-ICE) JC> - Versaloon-Link JTAG Adapter
Doesn't seem to build here:
grep OPENOCD .config
BR2_PACKAGE_OPENOCD=y
# BR2_PACKAGE_OPENOCD_FT2XXX is not set
# BR2_PACKAGE_OPENOCD_JLINK is not set
# BR2_PACKAGE_OPENOCD_VSLLINK is not set
/home/peko/source/buildroot/output/host/usr/bin/arm-unknown-linux-uclibcgnueabi-gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../src -I../../../src -DPKGDATADIR=\"/usr/share/openocd\" -DPKGLIBDIR=\"/usr/lib/openocd\" -I../../../jimtcl -I../../../jimtcl -pipe -Os -I/home/peko/source/buildroot/output/host/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include -Wall -Wstrict-prototypes -Wformat-security -Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls -Werror -MT bitbang.lo -MD -MP -MF .deps/bitbang.Tpo -c bitbang.c -fPIC -DPIC -o .libs/bitbang.o In file included from ../../../src/jtag/jtag.h:26,
from driver.c:34:
../../../src/helper/binarybuffer.h: In function 'buf_set_u32':../../../src/helper/binarybuffer.h:52: error: 'for' loop initial declaration used outside C99 mode ../../../src/helper/binarybuffer.h: In function 'buf_get_u32':../../../src/helper/binarybuffer.h:82: error: 'for' loop initial declaration used outside C99 mode In file included from ../../../src/jtag/jtag.h:26,
from ../../../src/jtag/interface.h:29,
from bitbang.c:28:../../../src/helper/binarybuffer.h: In function 'buf_set_u32':../../../src/helper/binarybuffer.h:52: error: 'for' loop initial declaration used outside C99 mode ../../../src/helper/binarybuffer.h: In function 'buf_get_u32':../../../src/helper/binarybuffer.h:82: error: 'for' loop initial declaration used outside C99 mode driver.c: In function 'interface_jtag_add_ir_scan':
driver.c:100: error: 'for' loop initial declaration used outside C99 mode driver.c: In function 'interface_jtag_add_dr_scan':
driver.c:142: error: 'for' loop initial declaration used outside C99 mode driver.c:167: error: redefinition of 'tap'
driver.c:142: error: previous definition of 'tap' was here
Any idea? If it isn't supposed to build if none of the drivers are enabled, then we need to ensure this cannot happen in Kconfig.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 2/2 package: add openocd support
Quoted 25 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"JC" == Jean-Christophe PLAGNIOL-VILLARD <[email protected]> writes:
JC> with only the following Adapters
JC> - FTDI FT2xxx/FT4xxx JC> - J-Link (Segger and Atmel SAM-ICE) JC> - Versaloon-Link JTAG AdapterDoesn't seem to build here:
grep OPENOCD .config
BR2_PACKAGE_OPENOCD=y
#BR2_PACKAGE_OPENOCD_FT2XXXis not set
#BR2_PACKAGE_OPENOCD_JLINKis not set
#BR2_PACKAGE_OPENOCD_VSLLINKis not set
/home/peko/source/buildroot/output/host/usr/bin/arm-unknown-linux-uclibcgnueabi-gcc-DHAVE_CONFIG_H -I. -I../../.. -I../../../src -I../../../src -DPKGDATADIR=\"/usr/share/openocd\" -DPKGLIBDIR=\"/usr/lib/openocd\" -I../../../jimtcl -I../../../jimtcl -pipe -Os -I/home/peko/source/buildroot/output/host/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include -Wall -Wstrict-prototypes -Wformat-security -Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls -Werror -MT bitbang.lo -MD -MP -MF .deps/bitbang.Tpo -cbitbang.c-fPIC -DPIC -o.libs/bitbang.oIn file included from../../../src/jtag/jtag.h:26,from driver.c:34:
../../../src/helper/binarybuffer.h: In function 'buf_set_u32':../../../src/helper/binarybuffer.h:52: error: 'for' loop initial declaration used outside C99 mode../../../src/helper/binarybuffer.h: In function 'buf_get_u32':../../../src/helper/binarybuffer.h:82: error: 'for' loop initial declaration used outside C99 mode In file included from../../../src/jtag/jtag.h:26,from ../../../src/jtag/interface.h:29, from bitbang.c:28:
Quoted 10 lines
../../../src/helper/binarybuffer.h: In function 'buf_set_u32':../../../src/helper/binarybuffer.h:52: error: 'for' loop initial declaration used outside C99 mode../../../src/helper/binarybuffer.h: In function 'buf_get_u32':../../../src/helper/binarybuffer.h:82: error: 'for' loop initial declaration used outside C99 modedriver.c: In function 'interface_jtag_add_ir_scan':
driver.c:100: error: 'for' loop initial declaration used outside C99 modedriver.c: In function 'interface_jtag_add_dr_scan':
driver.c:142: error: 'for' loop initial declaration used outside C99 mode driver.c:167: error: redefinition of 'tap'
driver.c:142: error: previous definition of 'tap' was here
I never see those error
I build it on arm target and no issue now I rebuild it against the HEAD and foud one issue on xscale support
I'll send a fix patch
Quoted 3 lines
Any idea? If it isn't supposed to build if none of the drivers are enabled, then we need to ensure this cannot happen in
Kconfig.
no issue as you can
Best Regards,
J.
PATCH v2 2/2 package: add openocd support
In reply to Jean-Christophe PLAGNIOL-VILLARDwith only the following Adapters
- FTDI FT2xxx/FT4xxx
- J-Link (Segger and Atmel SAM-ICE)
- Versaloon-Link JTAG Adapter
build for arm target
---
v2:
add xscale fix
Best Regards,
J.
package/Config.in | 1 + package/openocd/Config.in | 29 +++++++++++++++++ ...s-compilation-host-libsub-was-used-before.patch | 33 ++++++++++++++++++++ ...002-fix-xscale-uninitialise-breakpoint_pc.patch | 20 ++++++++++++ package/openocd/openocd-force_jimtcl_static.patch | 22 +++++++++++++ package/openocd/openocd.mk | 32 +++++++++++++++++++ 6 files changed, 137 insertions(+), 0 deletions(-) create mode 100644 package/openocd/Config.in create mode 100644 package/openocd/openocd-0001-fix-cross-compilation-host-libsub-was-used-before.patch create mode 100644 package/openocd/openocd-0002-fix-xscale-uninitialise-breakpoint_pc.patch create mode 100644 package/openocd/openocd-force_jimtcl_static.patch create mode 100644 package/openocd/openocd.mk
package/Config.in +1 -0
@@ -191,6 +191,7 @@ source "package/memtester/Config.in" source "package/mtd/Config.in" source "package/ntfs-3g/Config.in" source "package/ntfsprogs/Config.in" +source "package/openocd/Config.in" source "package/pciutils/Config.in" source "package/rng-tools/Config.in" source "package/sdparm/Config.in"
package/openocd/Config.in new file +29 -0
@@ -0,0 +1,29 @@ +menuconfig BR2_PACKAGE_OPENOCD + bool "OpenOCD" + select BR2_PACKAGE_LIBUSB + select BR2_PACKAGE_LIBUSB_COMPAT + help + OpenOCD - Open On-Chip Debugger + + http://openocd.berlios.de/web/ + +if BR2_PACKAGE_OPENOCD + +comment "Adapters" + +config BR2_PACKAGE_OPENOCD_FT2XXX + bool "FT2xxx/FT4xxx Based JTAG Programmer" + select BR2_PACKAGE_LIBFTDI + help + Enable building support for FT2232 based devices + using the libftdi driver, opensource alternate of FTD2XX + +config BR2_PACKAGE_OPENOCD_JLINK + bool "Segger J-Link JTAG Programmer" + help + Segger J-Link JTAG Programmer and clone such as Atmel SAM-ICE + +config BR2_PACKAGE_OPENOCD_VSLLINK + bool "Versaloon-Link JTAG Programmr" + +endif # BR2_PACKAGE_OPENOCD
package/openocd/openocd-0001-fix-cross-compilation-host-libsub-was-used-before.patch new file +33 -0
@@ -0,0 +1,33 @@ +From 3728c4af7f6303ccedab56ec220797f8f290580e Mon Sep 17 00:00:00 2001 +From: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +Date: Wed, 10 Aug 2011 00:17:29 +0800 +Subject: [PATCH] fix cross compilation: host libsub was used before + +tested in buildroot + +Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +--- + configure.in | 7 +++++-- + 1 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/configure.in b/configure.in +index dfa1e8f..cfe2218 100644 +--- a/configure.in ++++ b/configure.in +@@ -1046,8 +1046,11 @@ build_usb=no + if test $build_jlink = yes -o $build_vsllink = yes -o $build_usbprog = yes -o \ + $build_rlink = yes -o $build_ulink = yes -o $build_armjtagew = yes + then +- AC_CHECK_HEADERS([usb.h],[], +- [AC_MSG_ERROR([usb.h is required to build some OpenOCD driver(s)])]) ++ dnl check for libusb ++ PKG_CHECK_MODULES(LIBUSB, libusb >= 0.1.11) ++ CFLAGS="$CFLAGS $LIBUSB_CFLAGS" ++ LDFLAGS="$LFFLAGS $LIBUSB_LDFLAGS" ++ LIBS="$LIBS $LIBUSB_LIBS" + build_usb=yes + fi + +-- +1.7.5.4 +
package/openocd/openocd-0002-fix-xscale-uninitialise-breakpoint_pc.patch new file +20 -0
@@ -0,0 +1,20 @@ +xscale: fix uninitialise breakpoint_pc + +Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +--- + src/target/xscale.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: b/src/target/xscale.c +=================================================================== +--- a/src/target/xscale.c ++++ b/src/target/xscale.c +@@ -2811,7 +2811,7 @@ static int xscale_analyze_trace(struct t + struct xscale_common *xscale = target_to_xscale(target); + struct xscale_trace_data *trace_data = xscale->trace.data; + int i, retval; +- uint32_t breakpoint_pc; ++ uint32_t breakpoint_pc = 0; + struct arm_instruction instruction; + uint32_t current_pc = 0; /* initialized when address determined */ +
package/openocd/openocd-force_jimtcl_static.patch new file +22 -0
@@ -0,0 +1,22 @@ +--- + jimtcl/auto.def | 5 ----- + 1 file changed, 5 deletions(-) + +Index: b/jimtcl/auto.def +=================================================================== +--- a/jimtcl/auto.def ++++ b/jimtcl/auto.def +@@ -148,13 +148,8 @@ if {[opt-bool references]} { + msg-result "Enabling references" + define JIM_REFERENCES + } +-if {[opt-bool shared with-jim-shared]} { +- msg-result "Building shared library" +- define JIM_LIBTYPE shared +-} else { + msg-result "Building static library" + define JIM_LIBTYPE static +-} + if {[opt-bool install-jim]} { + define install_jim 1 + } else {
package/openocd/openocd.mk new file +32 -0
@@ -0,0 +1,32 @@ +############################################################# +# +# openocd +# +############################################################# +OPENOCD_VERSION:=0.5.0 +OPENOCD_SOURCE = openocd-$(OPENOCD_VERSION).tar.bz2 +OPENOCD_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/project/openocd/openocd/$(OPENOCD_VERSION) + +OPENOCD_AUTORECONF = YES +OPENOCD_CONF_OPT = \ + --oldincludedir=$(STAGING_DIR)/usr/include \ + --includedir=$(STAGING_DIR)/usr/include \ + --disable-doxygen-html \ + --enable-dummy + +OPENOCD_DEPENDENCIES = libusb-compat + +# Adapters +ifeq ($(BR2_PACKAGE_OPENOCD_FT2XXX),y) +OPENOCD_CONF_OPT += --enable-ft2232_libftdi +endif + +ifeq ($(BR2_PACKAGE_OPENOCD_JLINK),y) +OPENOCD_CONF_OPT += --enable-jlink +endif + +ifeq ($(BR2_PACKAGE_OPENOCD_VSLLINK),y) +OPENOCD_CONF_OPT += --enable-vsllink +endif + +$(eval $(call AUTOTARGETS,package,openocd))
Signature · 1 line
1.7.5.4
PATCH v2 2/2 package: add openocd support
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"JC" == Jean-Christophe PLAGNIOL-VILLARD <[email protected]> writes:
JC> with only the following Adapters
JC> - FTDI FT2xxx/FT4xxx JC> - J-Link (Segger and Atmel SAM-ICE) JC> - Versaloon-Link JTAG Adapter
JC> build for arm target
JC> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> JC> Cc: Nicolas Ferre <[email protected]>
JC> Cc: Patrice Vilchez <[email protected]>
JC> ---
JC> v2:
JC> add xscale fix
Still same error:
libtool: compile: /home/peko/source/buildroot/output/host/usr/bin/arm-unknown-linux-uclibcgnueabi-gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../src -I../../../src -DPKGDATADIR=\"/usr/share/openocd\" -DPKGLIBDIR=\"/usr/lib/openocd\" -I../../../jimtcl -I../../../jimtcl -pipe -Os -I/home/peko/source/buildroot/output/host/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include -Wall -Wstrict-prototypes -Wformat-security -Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls -Werror -MT bitbang.lo -MD -MP -MF .deps/bitbang.Tpo -c bitbang.c -fPIC -DPIC -o .libs/bitbang.o In file included from ../../../src/jtag/jtag.h:26,
from driver.c:34:
../../../src/helper/binarybuffer.h: In function 'buf_set_u32':../../../src/helper/binarybuffer.h:52: error: 'for' loop initial declaration used outside C99 mode
This is with a trivial defconfig:
BR2_arm=y
BR2_arm926t=y
BR2_PACKAGE_OPENOCD=y
E.G. to reproduce stick those 3 lines in .config and run
yes '' | make oldconfig
make
Next to that I have a few minor comments:
JC> +++ b/package/openocd/Config.in
JC> @@ -0,0 +1,29 @@
JC> +menuconfig BR2_PACKAGE_OPENOCD
Please use config rather than menuconfig to not create a submenu, making it harder for people to get an overview.
JC> + bool "OpenOCD"
We normally keep the short name in lower case.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v2 2/2 package: add openocd support
Quoted 25 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"JC" == Jean-Christophe PLAGNIOL-VILLARD <[email protected]> writes:
JC> with only the following Adapters
JC> - FTDI FT2xxx/FT4xxx JC> - J-Link (Segger and Atmel SAM-ICE) JC> - Versaloon-Link JTAG AdapterJC> build for arm target
JC> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> JC> Cc: Nicolas Ferre <[email protected]>
JC> Cc: Patrice Vilchez <[email protected]>
JC> ---
JC> v2:JC> add xscale fix
Still same error:
libtool: compile:
/home/peko/source/buildroot/output/host/usr/bin/arm-unknown-linux-uclibcgnueabi-gcc-DHAVE_CONFIG_H -I. -I../../.. -I../../../src -I../../../src -DPKGDATADIR=\"/usr/share/openocd\" -DPKGLIBDIR=\"/usr/lib/openocd\" -I../../../jimtcl -I../../../jimtcl -pipe -Os -I/home/peko/source/buildroot/output/host/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include -Wall -Wstrict-prototypes -Wformat-security -Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls -Werror -MT bitbang.lo -MD -MP -MF .deps/bitbang.Tpo -cbitbang.c-fPIC -DPIC -o.libs/bitbang.oIn file included from../../../src/jtag/jtag.h:26,from driver.c:34:
../../../src/helper/binarybuffer.h: In function 'buf_set_u32':../../../src/helper/binarybuffer.h:52: error: 'for' loop initial declaration used outside C99 mode
Quoted 7 lines
This is with a trivial defconfig:
BR2_arm=y
BR2_arm926t=y
BR2_PACKAGE_OPENOCD=yE.G. to reproduce stick those 3 lines in .config and run
which version of gcc do you use?
Quoted 10 lines
yes '' | make oldconfig
makeNext to that I have a few minor comments:
JC> +++ b/package/openocd/Config.in
JC> @@ -0,0 +1,29 @@
JC> +menuconfigBR2_PACKAGE_OPENOCD
Quoted 6 lines
Please use config rather than menuconfig to not create a submenu, making it harder for people to get an overview.
JC> + bool "OpenOCD"
We normally keep the short name in lower case.
The name of the project is OpenOCD so I want to keep it that way
Best Regards,
J.
PATCH v2 2/2 package: add openocd support
Quoted 9 lines
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Jean-Christophe" == Jean-Christophe PLAGNIOL-VILLARD <[email protected]> writes:
This is with a trivial defconfig:
BR2_arm=y
BR2_arm926t=y
BR2_PACKAGE_OPENOCD=yE.G. to reproduce stick those 3 lines in .config and run
Jean-Christophe> which version of gcc do you use?
Like the config says, the default version (4.3.6).
Signature · 1 line
Bye, Peter Korsgaard
PATCH v2 2/2 package: add openocd support
Quoted 8 lines · Peter Korsgaard
Quoted 8 lines
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Jean-Christophe" == Jean-Christophe PLAGNIOL-VILLARD <[email protected]> writes:
This is with a trivial defconfig:
BR2_arm=y
BR2_arm926t=y
BR2_PACKAGE_OPENOCD=y
Quoted 5 lines
Quoted 1 line
Quoted 1 line
E.G. to reproduce stick those 3 lines in .config and run
Jean-Christophe> which version of gcc do you use?
Like the config says, the default version (4.3.6).
I've found the issue on the codesourcery toolchains and pc too no need to specify we use gnu99 standard
but with buildroot gcc we need so I update it
Best Regards,
J.
PATCH v3 2/2 package: add openocd support
In reply to Jean-Christophe PLAGNIOL-VILLARDwith only the following Adapters
- FTDI FT2xxx/FT4xxx
- J-Link (Segger and Atmel SAM-ICE)
- Versaloon-Link JTAG Adapter
---
Hi,
v2:
xscacle fix
v3:
force gnu99 as gcc standard
Best Regards,
J.
package/Config.in | 1 + package/openocd/Config.in | 29 +++++++++++++++++ ...s-compilation-host-libsub-was-used-before.patch | 33 ++++++++++++++++++++ ...002-fix-xscale-uninitialise-breakpoint_pc.patch | 20 ++++++++++++ package/openocd/openocd-0003-force-gnu99.patch | 19 +++++++++++ .../openocd/openocd-0004-force_jimtcl_static.patch | 25 +++++++++++++++ package/openocd/openocd.mk | 32 +++++++++++++++++++ 7 files changed, 159 insertions(+), 0 deletions(-) create mode 100644 package/openocd/Config.in create mode 100644 package/openocd/openocd-0001-fix-cross-compilation-host-libsub-was-used-before.patch create mode 100644 package/openocd/openocd-0002-fix-xscale-uninitialise-breakpoint_pc.patch create mode 100644 package/openocd/openocd-0003-force-gnu99.patch create mode 100644 package/openocd/openocd-0004-force_jimtcl_static.patch create mode 100644 package/openocd/openocd.mk
package/Config.in +1 -0
@@ -191,6 +191,7 @@ source "package/memtester/Config.in" source "package/mtd/Config.in" source "package/ntfs-3g/Config.in" source "package/ntfsprogs/Config.in" +source "package/openocd/Config.in" source "package/pciutils/Config.in" source "package/rng-tools/Config.in" source "package/sdparm/Config.in"
package/openocd/Config.in new file +29 -0
@@ -0,0 +1,29 @@ +menuconfig BR2_PACKAGE_OPENOCD + bool "OpenOCD" + select BR2_PACKAGE_LIBUSB + select BR2_PACKAGE_LIBUSB_COMPAT + help + OpenOCD - Open On-Chip Debugger + + http://openocd.berlios.de/web/ + +if BR2_PACKAGE_OPENOCD + +comment "Adapters" + +config BR2_PACKAGE_OPENOCD_FT2XXX + bool "FT2xxx/FT4xxx Based JTAG Programmer" + select BR2_PACKAGE_LIBFTDI + help + Enable building support for FT2232 based devices + using the libftdi driver, opensource alternate of FTD2XX + +config BR2_PACKAGE_OPENOCD_JLINK + bool "Segger J-Link JTAG Programmer" + help + Segger J-Link JTAG Programmer and clone such as Atmel SAM-ICE + +config BR2_PACKAGE_OPENOCD_VSLLINK + bool "Versaloon-Link JTAG Programmr" + +endif # BR2_PACKAGE_OPENOCD
package/openocd/openocd-0001-fix-cross-compilation-host-libsub-was-used-before.patch new file +33 -0
@@ -0,0 +1,33 @@ +From 3728c4af7f6303ccedab56ec220797f8f290580e Mon Sep 17 00:00:00 2001 +From: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +Date: Wed, 10 Aug 2011 00:17:29 +0800 +Subject: [PATCH] fix cross compilation: host libsub was used before + +tested in buildroot + +Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +--- + configure.in | 7 +++++-- + 1 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/configure.in b/configure.in +index dfa1e8f..cfe2218 100644 +--- a/configure.in ++++ b/configure.in +@@ -1046,8 +1046,11 @@ build_usb=no + if test $build_jlink = yes -o $build_vsllink = yes -o $build_usbprog = yes -o \ + $build_rlink = yes -o $build_ulink = yes -o $build_armjtagew = yes + then +- AC_CHECK_HEADERS([usb.h],[], +- [AC_MSG_ERROR([usb.h is required to build some OpenOCD driver(s)])]) ++ dnl check for libusb ++ PKG_CHECK_MODULES(LIBUSB, libusb >= 0.1.11) ++ CFLAGS="$CFLAGS $LIBUSB_CFLAGS" ++ LDFLAGS="$LFFLAGS $LIBUSB_LDFLAGS" ++ LIBS="$LIBS $LIBUSB_LIBS" + build_usb=yes + fi + +-- +1.7.5.4 +
package/openocd/openocd-0002-fix-xscale-uninitialise-breakpoint_pc.patch new file +20 -0
@@ -0,0 +1,20 @@ +xscale: fix uninitialise breakpoint_pc + +Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +--- + src/target/xscale.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: b/src/target/xscale.c +=================================================================== +--- a/src/target/xscale.c ++++ b/src/target/xscale.c +@@ -2811,7 +2811,7 @@ static int xscale_analyze_trace(struct t + struct xscale_common *xscale = target_to_xscale(target); + struct xscale_trace_data *trace_data = xscale->trace.data; + int i, retval; +- uint32_t breakpoint_pc; ++ uint32_t breakpoint_pc = 0; + struct arm_instruction instruction; + uint32_t current_pc = 0; /* initialized when address determined */ +
package/openocd/openocd-0003-force-gnu99.patch new file +19 -0
@@ -0,0 +1,19 @@ +force gnu99 + +Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +--- + configure.in | 1 + + 1 file changed, 1 insertion(+) + +Index: b/configure.in +=================================================================== +--- a/configure.in ++++ b/configure.in +@@ -28,6 +28,7 @@ AC_DISABLE_SHARED + AC_PROG_LIBTOOL + AC_SUBST(LIBTOOL_DEPS) + ++CFLAGS="$CFLAGS -std=gnu99" + + dnl configure checks required for Jim files (these are obsolete w/ C99) + AC_C_CONST
package/openocd/openocd-0004-force_jimtcl_static.patch new file +25 -0
@@ -0,0 +1,25 @@ +force jimtcl to build static + +Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +--- + jimtcl/auto.def | 5 ----- + 1 file changed, 5 deletions(-) + +Index: b/jimtcl/auto.def +=================================================================== +--- a/jimtcl/auto.def ++++ b/jimtcl/auto.def +@@ -148,13 +148,8 @@ if {[opt-bool references]} { + msg-result "Enabling references" + define JIM_REFERENCES + } +-if {[opt-bool shared with-jim-shared]} { +- msg-result "Building shared library" +- define JIM_LIBTYPE shared +-} else { + msg-result "Building static library" + define JIM_LIBTYPE static +-} + if {[opt-bool install-jim]} { + define install_jim 1 + } else {
package/openocd/openocd.mk new file +32 -0
@@ -0,0 +1,32 @@ +############################################################# +# +# openocd +# +############################################################# +OPENOCD_VERSION:=0.5.0 +OPENOCD_SOURCE = openocd-$(OPENOCD_VERSION).tar.bz2 +OPENOCD_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/project/openocd/openocd/$(OPENOCD_VERSION) + +OPENOCD_AUTORECONF = YES +OPENOCD_CONF_OPT = \ + --oldincludedir=$(STAGING_DIR)/usr/include \ + --includedir=$(STAGING_DIR)/usr/include \ + --disable-doxygen-html \ + --enable-dummy + +OPENOCD_DEPENDENCIES = libusb-compat + +# Adapters +ifeq ($(BR2_PACKAGE_OPENOCD_FT2XXX),y) +OPENOCD_CONF_OPT += --enable-ft2232_libftdi +endif + +ifeq ($(BR2_PACKAGE_OPENOCD_JLINK),y) +OPENOCD_CONF_OPT += --enable-jlink +endif + +ifeq ($(BR2_PACKAGE_OPENOCD_VSLLINK),y) +OPENOCD_CONF_OPT += --enable-vsllink +endif + +$(eval $(call AUTOTARGETS,package,openocd))
Signature · 1 line
1.7.5.4
PATCH v3 2/2 package: add openocd support
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Jean-Christophe" == Jean-Christophe PLAGNIOL-VILLARD <[email protected]> writes:
Jean-Christophe> with only the following Adapters
Jean-Christophe> - FTDI FT2xxx/FT4xxx Jean-Christophe> - J-Link (Segger and Atmel SAM-ICE) Jean-Christophe> - Versaloon-Link JTAG Adapter
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/2 package: add libftdi support
In reply to Jean-Christophe PLAGNIOL-VILLARDQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"JC" == Jean-Christophe PLAGNIOL-VILLARD <[email protected]> writes:
JC> needed by openocd
JC> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> JC> Cc: Nicolas Ferre <[email protected]>
JC> Cc: Patrice Vilchez <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard