Merge commit 'e29f2b4fb95601291afced3af3731385be343988' into sam-update

# Conflicts:
#	.gitignore
#	src/include/swdptap.h
#	src/target/swdptap_generic.c
This commit is contained in:
Jason Kotzin 2022-08-01 21:45:01 -07:00
commit 16261813ca
12 changed files with 20 additions and 19 deletions

1
.gitignore vendored
View File

@ -17,4 +17,5 @@ tags
blackmagic_upgrade blackmagic_upgrade
*.exe *.exe
.DS_Store .DS_Store
.vscode
cscope.out cscope.out

View File

@ -64,12 +64,12 @@ ifndef TARGET
TARGET=blackmagic TARGET=blackmagic
endif endif
ifndef SWD_HL ifdef NO_OWN_LL
SRC += swdptap.c swdptap_generic.c SRC += jtagtap_generic.c swdptap_generic.c
endif endif
ifndef JTAG_HL ifndef OWN_HL
SRC += jtag_scan.c jtagtap.c jtagtap_generic.c SRC += jtag_scan.c jtagtap.c swdptap.c
endif endif
OBJ = $(SRC:.c=.o) OBJ = $(SRC:.c=.o)

View File

@ -21,7 +21,7 @@
#ifndef __GDB_IF_H #ifndef __GDB_IF_H
#define __GDB_IF_H #define __GDB_IF_H
#if !defined(LIBFTDI) #if !defined(PC_HOSTED)
#include <libopencm3/usb/usbd.h> #include <libopencm3/usb/usbd.h>
void gdb_usb_out_cb(usbd_device *dev, uint8_t ep); void gdb_usb_out_cb(usbd_device *dev, uint8_t ep);
#endif #endif

View File

@ -24,7 +24,7 @@
# error "Include 'general.h' instead" # error "Include 'general.h' instead"
#endif #endif
#if defined(LIBFTDI) #if defined(PC_HOSTED)
void platform_init(int argc, char **argv); void platform_init(int argc, char **argv);
#else #else
void platform_init(void); void platform_init(void);

View File

@ -23,7 +23,9 @@
int swdptap_init(void); int swdptap_init(void);
/* High level functions, provided as weak in swdptap_generic.c */ /* Low level functions, provided in swdptap_generic.c from the primitives
(indicate NO_OWN_LL in the Makefile.inc or libopencm specific in
platforms/common*/
uint32_t swdptap_seq_in(int ticks); uint32_t swdptap_seq_in(int ticks);
bool swdptap_seq_in_parity(uint32_t *data, int ticks); bool swdptap_seq_in_parity(uint32_t *data, int ticks);
void swdptap_seq_out(uint32_t MS, int ticks); void swdptap_seq_out(uint32_t MS, int ticks);

View File

@ -33,7 +33,7 @@
int int
main(int argc, char **argv) main(int argc, char **argv)
{ {
#if defined(LIBFTDI) #if defined(PC_HOSTED)
platform_init(argc, argv); platform_init(argc, argv);
#else #else
(void) argc; (void) argc;

View File

@ -2,6 +2,8 @@ CROSS_COMPILE ?= arm-none-eabi-
CC = $(CROSS_COMPILE)gcc CC = $(CROSS_COMPILE)gcc
OBJCOPY = $(CROSS_COMPILE)objcopy OBJCOPY = $(CROSS_COMPILE)objcopy
NO_OWN_LL = 1
ifeq ($(ENABLE_DEBUG), 1) ifeq ($(ENABLE_DEBUG), 1)
CFLAGS += -DDEBUG_ME CFLAGS += -DDEBUG_ME
CFLAGS += -DENABLE_DEBUG CFLAGS += -DENABLE_DEBUG

View File

@ -1,5 +1,5 @@
SYS = $(shell $(CC) -dumpmachine) SYS = $(shell $(CC) -dumpmachine)
CFLAGS += -DLIBFTDI -DENABLE_DEBUG CFLAGS += -DPC_HOSTED -DENABLE_DEBUG
LDFLAGS += -lftdi1 LDFLAGS += -lftdi1
ifneq (, $(findstring mingw, $(SYS))) ifneq (, $(findstring mingw, $(SYS)))
LDFLAGS += -lusb-1.0 -lws2_32 LDFLAGS += -lusb-1.0 -lws2_32

View File

@ -1,6 +1,6 @@
TARGET=blackmagic_stlinkv2 TARGET=blackmagic_stlinkv2
SYS = $(shell $(CC) -dumpmachine) SYS = $(shell $(CC) -dumpmachine)
CFLAGS += -DLIBFTDI -DSTLINKV2 -DJTAG_HL -DENABLE_DEBUG CFLAGS += -DPC_HOSTED -DSTLINKV2 -DJTAG_HL -DENABLE_DEBUG
CFLAGS +=-I ./target CFLAGS +=-I ./target
LDFLAGS += -lusb-1.0 LDFLAGS += -lusb-1.0
ifneq (, $(findstring mingw, $(SYS))) ifneq (, $(findstring mingw, $(SYS)))
@ -11,5 +11,4 @@ LDFLAGS += -lws2_32
endif endif
VPATH += platforms/pc VPATH += platforms/pc
SRC += timing.c stlinkv2.c SRC += timing.c stlinkv2.c
SWD_HL = 1 OWN_HL = 1
JTAG_HL = 1

View File

@ -101,8 +101,7 @@ swdptap_seq_in(int ticks)
return ret; return ret;
} }
bool __attribute__((weak)) bool swdptap_seq_in_parity(uint32_t *ret, int ticks)
swdptap_seq_in_parity(uint32_t *ret, int ticks)
{ {
uint32_t index = 1; uint32_t index = 1;
uint8_t parity = 0; uint8_t parity = 0;
@ -123,8 +122,7 @@ swdptap_seq_in_parity(uint32_t *ret, int ticks)
return parity; return parity;
} }
void __attribute__((weak)) void swdptap_seq_out(uint32_t MS, int ticks)
swdptap_seq_out(uint32_t MS, int ticks)
{ {
swdptap_set_out(); swdptap_set_out();
@ -134,8 +132,7 @@ swdptap_seq_out(uint32_t MS, int ticks)
} }
} }
void __attribute__((weak)) void swdptap_seq_out_parity(uint32_t MS, int ticks)
swdptap_seq_out_parity(uint32_t MS, int ticks)
{ {
uint8_t parity = 0; uint8_t parity = 0;

View File

@ -314,7 +314,7 @@ void target_detach(target *t)
{ {
t->detach(t); t->detach(t);
t->attached = false; t->attached = false;
#if defined(LIBFTDI) #if defined(PC_HOSTED)
# include "platform.h" # include "platform.h"
platform_buffer_flush(); platform_buffer_flush();
#endif #endif