ports/154517: New port devel/mspdebug - TI MSP430 development board interface

Peter Jeremy peterjeremy at acm.org
Sat Feb 5 03:45:27 UTC 2011


On 2011-Feb-05 01:15:42 +0000, nox at FreeBSD.org wrote:
>Needs more work for 7.x:

Sorry, I didn't have any way to test it there.  Try the following
replacement shar (which fixes Makefile and files/patch-Makefile).

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	mspdebug
#	mspdebug/Makefile
#	mspdebug/distinfo
#	mspdebug/files
#	mspdebug/files/patch-Makefile
#	mspdebug/files/patch-bsl.c
#	mspdebug/files/patch-elf32.c
#	mspdebug/files/patch-olimex.c
#	mspdebug/files/patch-rf2500.c
#	mspdebug/files/patch-uif.c
#	mspdebug/files/patch-usbutil.c
#	mspdebug/pkg-descr
#
echo c - mspdebug
mkdir -p mspdebug > /dev/null 2>&1
echo x - mspdebug/Makefile
sed 's/^X//' >mspdebug/Makefile << '62f54ccedb42232168dd717570103d55'
X# New ports collection makefile for:	mspdebug
X# Date created:				30 Jan 2011
X# Whom:					Peter Jeremy <peterjeremy at acm.org>
X#
X# $FreeBSD$
X#
X# Based on the OpenBSD port by:		Jasper Lievisse Adriaanse <jasper at openbsd.org>
X
XPORTNAME=		mspdebug
XPORTVERSION=		0.13
XCATEGORIES=		devel
XMASTER_SITES=		SF/${PORTNAME}
X
XMAINTAINER=		peterjeremy at acm.org
XCOMMENT=		Debugger for use with MSP 430 MCUs
X
XLICENSE=		GPLv2
X
XMAN1=			mspdebug.1
XUSE_GMAKE=		yes
X
XPLIST_FILES=		bin/mspdebug
X
X.include <bsd.port.pre.mk>
X
X.if ${OSVERSION} < 800069
XLIB_DEPENDS+=		usb:${PORTSDIR}/devel/libusb
X.endif
X
Xdo-install:
X	${INSTALL_PROGRAM} ${WRKSRC}/mspdebug ${PREFIX}/bin
X	${INSTALL_MAN} ${WRKSRC}/mspdebug.man ${PREFIX}/man/man1/mspdebug.1
X
X.include <bsd.port.post.mk>
62f54ccedb42232168dd717570103d55
echo x - mspdebug/distinfo
sed 's/^X//' >mspdebug/distinfo << 'f99fcc0913256d8e68f3931eae8dfbcc'
XSHA256 (mspdebug-0.13.tar.gz) = 7f77cbe2bab245cf50647a2bd23e803fe22e2d21a2b0953e0551ebf3e72fc48e
XSIZE (mspdebug-0.13.tar.gz) = 91556
f99fcc0913256d8e68f3931eae8dfbcc
echo c - mspdebug/files
mkdir -p mspdebug/files > /dev/null 2>&1
echo x - mspdebug/files/patch-Makefile
sed 's/^X//' >mspdebug/files/patch-Makefile << '6e63685a3a2d2925bc3686d0cd6c0e13'
X--- Makefile.orig	2010-11-09 08:40:57.000000000 +1100
X+++ Makefile	2011-02-05 12:36:25.710676671 +1100
X@@ -26,17 +26,27 @@
X 	READLINE_LIBS =
X else
X 	READLINE_CFLAGS = -DUSE_READLINE
X-	READLINE_LIBS = -lreadline
X+	READLINE_LIBS = -lreadline -ltermcap
X endif
X 
X-# Mac OS X/MacPorts stuff
X UNAME := $(shell sh -c 'uname -s')
X-ifeq ($(UNAME),Darwin)
X-	MACPORTS_CFLAGS = -I/opt/local/include
X-	MACPORTS_LDFLAGS = -L/opt/local/lib
X+ifeq ($(UNAME),Darwin) # Mac OS X/MacPorts stuff
X+	PORTS_CFLAGS = -I/opt/local/include
X+	PORTS_LDFLAGS = -L/opt/local/lib
X else
X-	MACPORTS_CFLAGS =
X-	MACPORTS_LDFLAGS =
X+  ifeq ($(UNAME),OpenBSD) # OpenBSD Ports stuff
X+	PORTS_CFLAGS = `pkg-config --cflags libelf libusb`
X+	PORTS_LDFLAGS = `pkg-config --libs libelf libusb`
X+  else
X+    ifeq ($(UNAME),FreeBSD) # FreeBSD Ports stuff
X+# This is only needed prior to FreeBSD 8.x to find libusb
X+	PORTS_CFLAGS = -I${LOCALBASE}/include
X+	PORTS_LDFLAGS = -L${LOCALBASE}/lib
X+    else
X+	PORTS_CFLAGS =
X+	PORTS_LDFLAGS =
X+    endif
X+  endif
X endif
X 
X MSPDEBUG_CFLAGS = -O1 -Wall -Wno-char-subscripts -ggdb
X@@ -60,7 +70,7 @@
X 	  reader.o vector.o output_util.o expr.o fet_error.o binfile.o \
X 	  fet_db.o usbutil.o titext.o srec.o device.o coff.o opdb.o output.o \
X 	  cmddb.o stdcmd.o prog.o flash_bsl.o
X-	$(CC) $(LDFLAGS) $(MACPORTS_LDFLAGS) -o $@ $^ -lusb $(READLINE_LIBS)
X+	$(CC) $(LDFLAGS) $(PORTS_LDFLAGS) -o $@ $^ -lusb $(READLINE_LIBS)
X 
X .c.o:
X-	$(CC) $(CFLAGS) $(MACPORTS_CFLAGS) $(READLINE_CFLAGS) $(MSPDEBUG_CFLAGS) -o $@ -c $*.c
X+	$(CC) $(CFLAGS) $(PORTS_CFLAGS) $(READLINE_CFLAGS) $(MSPDEBUG_CFLAGS) -o $@ -c $*.c
6e63685a3a2d2925bc3686d0cd6c0e13
echo x - mspdebug/files/patch-bsl.c
sed 's/^X//' >mspdebug/files/patch-bsl.c << '9802d07c5d8f6fdd1f522640f5960228'
X--- bsl.c.orig	Mon Nov  8 22:40:57 2010
X+++ bsl.c	Thu Dec  2 13:05:14 2010
X@@ -31,7 +31,7 @@
X #include "output.h"
X #include "fet_error.h"
X 
X-#ifdef __APPLE__
X+#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__)
X #define B460800 460800
X #endif
X 
9802d07c5d8f6fdd1f522640f5960228
echo x - mspdebug/files/patch-elf32.c
sed 's/^X//' >mspdebug/files/patch-elf32.c << 'a3ac942f09e28aa939d3cfe3fd58c6b5'
X--- elf32.c.orig	Wed Aug  4 04:08:43 2010
X+++ elf32.c	Thu Aug 12 12:51:04 2010
X@@ -19,7 +19,7 @@
X #include <stdlib.h>
X #include <errno.h>
X #include <string.h>
X-#ifdef __APPLE__
X+#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__)
X #include <libelf.h>
X #else
X #include <elf.h>
a3ac942f09e28aa939d3cfe3fd58c6b5
echo x - mspdebug/files/patch-olimex.c
sed 's/^X//' >mspdebug/files/patch-olimex.c << '6a36b910c5ce323065940949d86e8378'
X--- olimex.c.orig	2010-11-09 08:40:57.000000000 +1100
X+++ olimex.c	2011-01-23 20:52:02.005008013 +1100
X@@ -20,6 +20,7 @@
X #include <stdio.h>
X #include <string.h>
X #include <usb.h>
X+#include <stdlib.h>
X 
X #include "olimex.h"
X #include "util.h"
X@@ -66,7 +67,7 @@
X static int open_interface(struct olimex_transport *tr,
X 			  struct usb_device *dev, int ino)
X {
X-#if !(defined (__APPLE__) || defined(WIN32))
X+#if defined(__linux__)
X 	int drv;
X 	char drName[256];
X #endif
X@@ -82,7 +83,7 @@
X 		return -1;
X 	}
X 
X-#if !(defined(__APPLE__) || defined(WIN32))
X+#if defined(__linux__)
X 	drv = usb_get_driver_np(tr->handle, tr->int_number, drName,
X 				sizeof(drName));
X 	printc(__FILE__" : driver %d\n", drv);
6a36b910c5ce323065940949d86e8378
echo x - mspdebug/files/patch-rf2500.c
sed 's/^X//' >mspdebug/files/patch-rf2500.c << 'f4d7e98f698abe17fa25c94360c102f5'
X--- rf2500.c.orig	2010-11-09 08:40:57.000000000 +1100
X+++ rf2500.c	2011-01-23 20:51:40.771589070 +1100
X@@ -19,6 +19,7 @@
X #include <stdio.h>
X #include <string.h>
X #include <usb.h>
X+#include <stdlib.h>
X 
X #include "rf2500.h"
X #include "util.h"
X@@ -67,7 +68,7 @@
X 		return -1;
X 	}
X 
X-#if !(defined(__APPLE__) || defined(WIN32))
X+#if !(defined(__APPLE__) || defined(WIN32) || defined(__OpenBSD__) || defined(__FreeBSD__))
X 	if (usb_detach_kernel_driver_np(tr->handle, tr->int_number) < 0)
X 		pr_error("rf2500: warning: can't "
X 			"detach kernel driver");
X@@ -221,7 +222,7 @@
X #ifndef __APPLE__
X 	while (usb_bulk_read(tr->handle, USB_FET_IN_EP,
X 			     buf, sizeof(buf),
X-			     100) >= 0);
X+			     100) > 0);
X #endif
X 
X 	return (transport_t)tr;
f4d7e98f698abe17fa25c94360c102f5
echo x - mspdebug/files/patch-uif.c
sed 's/^X//' >mspdebug/files/patch-uif.c << 'b4f3352a4f860c2acf42c0f7108ced7d'
X--- uif.c.orig	Mon Nov  8 22:40:57 2010
X+++ uif.c	Thu Dec  2 13:05:36 2010
X@@ -25,7 +25,9 @@
X #include <unistd.h>
X #include <termios.h>
X 
X+#if defined(__linux__)
X #include <linux/serial.h>
X+#endif
X #include <sys/ioctl.h>
X #include <fcntl.h>
X 
X@@ -33,7 +35,7 @@
X #include "util.h"
X #include "output.h"
X 
X-#ifdef __APPLE__
X+#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__)
X #define B460800 460800
X #define B500000 500000
X #endif
X@@ -85,6 +87,7 @@ static void serial_destroy(transport_t tr_base)
X 	free(tr);
X }
X 
X+#if defined(__linux__)
X static int open_olimex_iso(const char *device)
X {
X         int fd = open(device, O_RDWR | O_NOCTTY);
X@@ -112,6 +115,7 @@ static int open_olimex_iso(const char *device)
X 
X         return fd;
X }
X+#endif
X 
X transport_t uif_open(const char *device, uif_type_t type)
X {
X@@ -138,8 +142,12 @@ transport_t uif_open(const char *device, uif_type_t ty
X 		break;
X 
X 	case UIF_TYPE_OLIMEX_ISO:
X+#if defined(__linux__)
X 		printc("Trying to open Olimex (ISO) on %s...\n", device);
X 		tr->serial_fd = open_olimex_iso(device);
X+#else
X+		printc_err("uif_open: ioctl TIOCSSERIAL not supported on this platform\n");
X+#endif
X 		break;
X 	}
X 
b4f3352a4f860c2acf42c0f7108ced7d
echo x - mspdebug/files/patch-usbutil.c
sed 's/^X//' >mspdebug/files/patch-usbutil.c << '9a370be533e0e10cd3f3b256f99d53d0'
X--- usbutil.c.orig	2010-11-09 08:40:57.000000000 +1100
X+++ usbutil.c	2011-01-23 20:53:11.561100726 +1100
X@@ -17,6 +17,7 @@
X  */
X 
X #include <stdio.h>
X+#include <stdlib.h>
X #include <string.h>
X #include "usbutil.h"
X #include "util.h"
9a370be533e0e10cd3f3b256f99d53d0
echo x - mspdebug/pkg-descr
sed 's/^X//' >mspdebug/pkg-descr << 'b2998e4ab3d0d37f96b600b4851c1f6f'
XMSPDebug is a free debugger for use with MSP430 MCUs. It supports
XFET430UIF, eZ430, RF2500 and Olimex MSP-JTAG-TINY programmers. It can be
Xused as a proxy for gdb or as an independent debugger with support for
Xprogramming, disassembly and reverse engineering.
X
XWWW: http://mspdebug.sourceforge.net/
b2998e4ab3d0d37f96b600b4851c1f6f
exit


-- 
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-ports-bugs/attachments/20110205/6edf5f63/attachment.sig>


More information about the freebsd-ports-bugs mailing list