From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Aug 19 04:30:02 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45593106568C for ; Wed, 19 Aug 2009 04:30:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 22D3A8FC41 for ; Wed, 19 Aug 2009 04:30:02 +0000 (UTC) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n7J4U1q6042011 for ; Wed, 19 Aug 2009 04:30:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n7J4U1Uu042010; Wed, 19 Aug 2009 04:30:01 GMT (envelope-from gnats) Resent-Date: Wed, 19 Aug 2009 04:30:01 GMT Resent-Message-Id: <200908190430.n7J4U1Uu042010@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Robert Jenssen Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 213D7106568B for ; Wed, 19 Aug 2009 04:21:19 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 110E78FC41 for ; Wed, 19 Aug 2009 04:21:19 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n7J4LImb058622 for ; Wed, 19 Aug 2009 04:21:18 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n7J4LIeh058621; Wed, 19 Aug 2009 04:21:18 GMT (envelope-from nobody) Message-Id: <200908190421.n7J4LIeh058621@www.freebsd.org> Date: Wed, 19 Aug 2009 04:21:18 GMT From: Robert Jenssen To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/137945: openocd-0.2.0 fails to find ATMEL SAM-ICE as Segger jlink X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2009 04:30:02 -0000 >Number: 137945 >Category: ports >Synopsis: openocd-0.2.0 fails to find ATMEL SAM-ICE as Segger jlink >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Aug 19 04:30:00 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Robert Jenssen >Release: FreeBSD 7-Stable >Organization: >Environment: FreeBSD kraken.wollstonecraft 7.2-STABLE FreeBSD 7.2-STABLE #0: Sun Aug 16 23:51:27 EST 2009 root@kraken.wollstonecraft:/usr/obj/usr/src/sys/KRAKEN i386 >Description: Thanks for updating the openocd port. I find that the original source needs to be patched to work with the ATMEL SAM-ICE (a.k.a. Segger jlink) on FreeBSD. In the attached patch the extra find_jlink_device() and usb_open() calls in openocd-0.2.0/src/jtag/jlink.c:jlink_usb_open() are #ifdef'ed out. There is a lengthy thread at: http://lists.berlios.de/pipermail/openocd-development/2009-July/009397.html FreeBSD isn't mentioned. It seems there is a portability problem in libusb. >How-To-Repeat: I am using an ATMEL AT91SAM7S-EK baord with the ATMEL SAM-ICE JTAG emulator. Using the following samice.cfg: # Daemon configuration telnet_port 4444 gdb_port 3333 # Interface is SAM-ICE interface jlink jtag_khz 0 reset_config srst_only srst_pulls_trst set _CHIPNAME sam7s256 set _ENDIAN little set _CPUTAPID 0x3f0f0f0f set _TARGETNAME [format "%s.cpu" $_CHIPNAME] jtag newtap $_CHIPNAME cpu \ -irlen 4 \ -ircapture 0x1 \ -irmask 0xf \ -expected-id $_CPUTAPID target create $_TARGETNAME arm7tdmi \ -endian $_ENDIAN \ -chain-position $_TARGETNAME \ -variant arm7tdmi \ -work-area-virt 0 \ -work-area-phys 0x00200000 \ -work-area-size 0x4000 \ -work-area-backup 0 # Commands performed after a reset-init event $_TARGETNAME configure -event reset-init { mww 0xfffffd44 0x00008000 mww 0xfffffd08 0xa5000001 mww 0xfffffc20 0x00000601 sleep 100 mww 0xfffffc30 0x00000001 sleep 1000 mww 0xffffff60 0x003c0100 sleep 100 } flash bank at91sam7 0 0 0 0 0 arm7_9 fast_memory_access enable armv4_5 core_state arm init halt # end of samice.cfg I run: /usr/local/bin/openocd -f ./samice.cfg Open On-Chip Debugger 0.2.0 (2009-08-19-13:58) Release $URL: http://svn.berlios.de/svnroot/repos/openocd/tags/openocd-0.2.0/src/openocd.c $ For bug reports, read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS RCLK - adaptive fast memory access is enabled core state: ARM Error: Cannot find jlink Interface! Please check connection and permissions. Runtime error, file "./samice.cfg", line 47: >Fix: Patch with the attached file and recompile giving: /usr/local/arm-toolchain/bin/openocd -f ./samice.cfg Open On-Chip Debugger 0.2.0 (2009-08-03-16:55) Release $URL: http://svn.berlios.de/svnroot/repos/openocd/tags/openocd-0.2.0/src/openocd.c $ For bug reports, read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS RCLK - adaptive fast memory access is enabled core state: ARM Info : J-Link initialization started / target CPU reset initiated Info : J-Link ARM V8 compiled Jun 30 2009 11:00:16 Info : JLink caps 0xb9ff7bbf Info : JLink hw version 80000 Info : JLink max mem block 9792 Info : Vref = 3.280 TCK = 1 TDI = 0 TDO = 1 TMS = 0 SRST = 0 TRST = 0 Info : J-Link JTAG Interface ready Info : JTAG tap: sam7s256.cpu tap/device found: 0x3f0f0f0f (mfg: 0x787, part: 0xf0f0, ver: 0x3) Info : JTAG Tap/device matched target state: halted target halted in ARM state due to breakpoint, current mode: Supervisor cpsr: 0x40000053 pc: 0x00101a18 Patch attached with submission follows: *** openocd-0.2.0/src/jtag/jlink.c.orig 2009-08-03 15:28:39.000000000 +1000 --- openocd-0.2.0/src/jtag/jlink.c 2009-08-03 15:29:01.000000000 +1000 *************** *** 891,896 **** --- 891,897 ---- * test them carefully on all platforms before committing them! */ + #if 0 #if IS_WIN32 == 0 usb_reset(result->usb_handle); *************** *** 918,924 **** result->usb_handle = usb_open(dev); #endif ! #endif if (result->usb_handle) --- 919,925 ---- result->usb_handle = usb_open(dev); #endif ! #endif #endif if (result->usb_handle) >Release-Note: >Audit-Trail: >Unformatted: