Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ ifeq ($(OS),Windows_NT)
MSPDEBUG_CC = $(CC)
BINARY = mspdebug.exe
ifneq ($(UNAME_O),Cygwin)
OS_LIBS = -lws2_32 -lregex
OS_LIBS = -lws2_32 -lregex -lftdi1
OS_CFLAGS = -D__Windows__ -DNO_SHELLCMD
RM = del
endif
ifneq (, $findstring(MINGW, $(UNAME_S)))
PORTS_CFLAGS := $(shell pkg-config --cflags libusb)
PORTS_LDFLAGS := $(shell pkg-config --libs libusb)
PORTS_CFLAGS := $(shell pkg-config --cflags libusb libftdi1)
PORTS_LDFLAGS := $(shell pkg-config --libs libusb libftdi1)
RM = rm -rf
endif
else
Expand All @@ -72,14 +72,14 @@ else

ifeq ($(UNAME_S),Darwin) # Mac OS X/MacPorts stuff
ifeq ($(shell fink -V > /dev/null 2>&1 && echo ok),ok)
PORTS_CFLAGS := $(shell pkg-config --cflags hidapi libusb)
PORTS_LDFLAGS := $(shell pkg-config --libs hidapi libusb) -ltermcap -pthread
PORTS_CFLAGS := $(shell pkg-config --cflags hidapi libusb libftdi1)
PORTS_LDFLAGS := $(shell pkg-config --libs hidapi libusb libftdi1) -ltermcap -pthread
else ifeq ($(shell brew --version > /dev/null 2>&1 && echo ok),ok)
PORTS_CFLAGS := $(shell pkg-config --cflags hidapi libusb)
PORTS_LDFLAGS := $(shell pkg-config --libs hidapi libusb) -framework IOKit -framework CoreFoundation
PORTS_CFLAGS := $(shell pkg-config --cflags hidapi libusb libftdi1)
PORTS_LDFLAGS := $(shell pkg-config --libs hidapi libusb libftdi1) -framework IOKit -framework CoreFoundation
else ifeq ($(shell port version > /dev/null 2>&1 && echo ok),ok)
PORTS_CFLAGS := $(shell pkg-config --cflags hidapi libusb)
PORTS_LDFLAGS := $(shell pkg-config --libs hidapi libusb) -framework IOKit -framework CoreFoundation
PORTS_CFLAGS := $(shell pkg-config --cflags hidapi libusb libftdi1)
PORTS_LDFLAGS := $(shell pkg-config --libs hidapi libusb libftdi1) -framework IOKit -framework CoreFoundation
else
PORTS_CFLAGS := -I/opt/local/include
PORTS_LDFLAGS := -L/opt/local/lib -lhidapi -framework IOKit -framework CoreFoundation
Expand All @@ -88,8 +88,8 @@ else
RF25000_OBJ += transport/rf2500hidapi.o
LDFLAGS =
else ifneq ($(filter $(UNAME_S),OpenBSD NetBSD DragonFly),)
PORTS_CFLAGS := $(shell pkg-config --cflags libusb)
PORTS_LDFLAGS := $(shell pkg-config --libs libusb) -ltermcap -pthread
PORTS_CFLAGS := $(shell pkg-config --cflags libusb libftdi1)
PORTS_LDFLAGS := $(shell pkg-config --libs libusb libftdi1) -ltermcap -pthread
else
PORTS_CFLAGS :=
PORTS_LDFLAGS :=
Expand Down Expand Up @@ -170,7 +170,7 @@ OBJ=\
util/gpio.o \
transport/cp210x.o \
transport/cdc_acm.o \
transport/ftdi.o \
transport/ftdi_serial.o \
transport/mehfet_xport.o \
transport/ti3410.o \
transport/comport.o \
Expand All @@ -193,6 +193,7 @@ OBJ=\
drivers/fet_olimex_db.o \
drivers/jtdev.o \
drivers/jtdev_bus_pirate.o \
drivers/jtdev_ftdi_bitbang.o \
drivers/jtdev_gpio.o \
drivers/jtaglib.o \
drivers/mehfet_proto.o \
Expand Down
11 changes: 8 additions & 3 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,19 @@ Compiling from source

Ensure that you have the necessary packages to compile programs that use
libusb (on Debian or Ubuntu systems, you might need to do apt-get
install libusb-dev | on Arch systems, you might need to do sudo
pacman -S libusb-compact). After that, unpack and compile the source code
with:
install libusb-dev libftdi-dev | on Arch systems, you might need to do sudo
pacman -S libusb-compact). As libusb-0.1 is used, you may also need to
install a compatibility layer for libusb-1.0 (for example,
libusb-compat-git on MSYS). After that, unpack and compile the source
code with:

tar xvfz mspdebug-version.tar.gz
cd mspdebug-version
make

On Windows systems with MSYS, you may also need to install a regex
implementation such as libgnurx.

On Debian Ubuntu systems sudo apt-get install libreadline-dev may be
required. On Arch systems sudo pacman -S readline may be required.
If you don't want GNU readline support, you can invoke make with:
Expand Down
2 changes: 1 addition & 1 deletion drivers/fet.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "fet_core.h"
#include "output.h"
#include "comport.h"
#include "ftdi.h"
#include "ftdi_serial.h"
#include "rf2500.h"
#include "ti3410.h"
#include "cp210x.h"
Expand Down
11 changes: 10 additions & 1 deletion drivers/jtdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,16 @@
#define JTDEV_H_

#include <stdint.h>
#include <stdbool.h>

struct jtdev_func;
struct jtdev {
int port;
union {
// anything that uses a file descriptor
int port;
// anything that uses an opaque pointer
void *handle;
};
uint8_t data_register;
uint8_t control_register;
int failed;
Expand All @@ -39,6 +45,7 @@ struct jtdev_func{
* field in the jtdev structure.
*/
int (*jtdev_open)(struct jtdev *p, const char *device);
int (*jtdev_open_ex)(struct jtdev *p, const char *device, const uint16_t *vid, const uint16_t *pid);
void (*jtdev_close)(struct jtdev *p);

/* Connect/release JTAG */
Expand Down Expand Up @@ -70,10 +77,12 @@ struct jtdev_func{
uint16_t (*jtdev_dr_shift_16)(struct jtdev *p, uint16_t dr);
void (*jtdev_tms_sequence)(struct jtdev *p, int bits, unsigned int value);
void (*jtdev_init_dap)(struct jtdev *p);
int (*jtdev_set_fast_baud)(struct jtdev *p, bool fast);
};

extern const struct jtdev_func jtdev_func_pif;
extern const struct jtdev_func jtdev_func_gpio;
extern const struct jtdev_func jtdev_func_bp;
extern const struct jtdev_func jtdev_func_ftdi_bitbang;

#endif
Loading