Skip to content

Commit

Permalink
Version 1.2.
Browse files Browse the repository at this point in the history
All GUI utilities: detect insertion/removal of BMP.
All GUI utilities: online help.
All GUI utilities + BMScan: fix handling of gdbserver handshake (which changed in BMP firmware 1.9).
BMDebug: improvements in handling text received from the target.
Added a serial monitor (BMSerial).
  • Loading branch information
compuphase committed Dec 13, 2022
1 parent c00befe commit 614b26c
Show file tree
Hide file tree
Showing 52 changed files with 6,586 additions and 598 deletions.
Binary file modified BlackMagicProbe.pdf
Binary file not shown.
44 changes: 27 additions & 17 deletions source/Makefile.linux
Original file line number Diff line number Diff line change
Expand Up @@ -77,34 +77,37 @@ OBJLIST_BMDEBUG = bmdebug.o armdisasm.o bmcommon.o bmp-scan.o bmp-script.o \
nuklear_mousepointer.o nuklear_splitter.o nuklear_style.o \
nuklear_tooltip.o rs232.o serialmon.o specialfolder.o svd-support.o \
swotrace.o tcpip.o xmltractor.o decodectf.o parsetsdl.o \
findfont.o lodepng.o \
nuklear.o nuklear_glfw_gl2.o noc_file_dialog.o
findfont.o lodepng.o nuklear.o nuklear_glfw_gl2.o noc_file_dialog.o

OBJLIST_BMFLASH = bmflash.o bmcommon.o bmp-scan.o bmp-script.o bmp-support.o \
cksum.o crc32.o elf.o gdb-rsp.o guidriver.o ident.o minIni.o \
nuklear_mousepointer.o nuklear_style.o nuklear_tooltip.o \
nuklear_guide.o nuklear_mousepointer.o nuklear_style.o nuklear_tooltip.o \
picoro.o rs232.o specialfolder.o tcpip.o xmltractor.o \
findfont.o lodepng.o \
nuklear.o nuklear_glfw_gl2.o noc_file_dialog.o
findfont.o lodepng.o nuklear.o nuklear_glfw_gl2.o noc_file_dialog.o

OBJLIST_BMPROFILE = bmprofile.o bmcommon.o bmp-scan.o bmp-script.o \
bmp-support.o crc32.o decodectf.o demangle.o dwarf.o \
elf.o gdb-rsp.o guidriver.o mcu-info.o minIni.o \
parsetsdl.o picoro.o rs232.o specialfolder.o swotrace.o \
tcpip.o xmltractor.o nuklear_mousepointer.o \
tcpip.o xmltractor.o nuklear_guide.o nuklear_mousepointer.o \
nuklear_splitter.o nuklear_style.o nuklear_tooltip.o \
findfont.o lodepng.o \
nuklear.o nuklear_glfw_gl2.o noc_file_dialog.o
findfont.o lodepng.o nuklear.o nuklear_glfw_gl2.o noc_file_dialog.o

OBJLIST_BMSERIAL = bmserial.o guidriver.o minIni.o rs232.o \
specialfolder.o noc_file_dialog.o \
nuklear_guide.o nuklear_mousepointer.o nuklear_splitter.o \
nuklear_style.o nuklear_tooltip.o \
findfont.o lodepng.o nuklear.o nuklear_glfw_gl2.o

OBJLIST_BMTRACE = bmtrace.o bmcommon.o bmp-scan.o bmp-script.o bmp-support.o \
crc32.o demangle.o dwarf.o elf.o gdb-rsp.o guidriver.o mcu-info.o \
minIni.o nuklear_mousepointer.o nuklear_splitter.o nuklear_style.o \
nuklear_tooltip.o picoro.o rs232.o specialfolder.o swotrace.o \
tcpip.o xmltractor.o decodectf.o parsetsdl.o \
findfont.o lodepng.o \
nuklear.o nuklear_glfw_gl2.o noc_file_dialog.o
minIni.o nuklear_guide.o nuklear_mousepointer.o nuklear_splitter.o \
nuklear_style.o nuklear_tooltip.o picoro.o rs232.o specialfolder.o \
swotrace.o tcpip.o xmltractor.o decodectf.o parsetsdl.o \
findfont.o lodepng.o nuklear.o nuklear_glfw_gl2.o noc_file_dialog.o

OBJLIST_BMSCAN = bmscan.o bmp-scan.o tcpip.o
OBJLIST_BMSCAN = bmscan.o bmp-scan.o bmp-script.o bmp-support.o crc32.o elf.o \
gdb-rsp.o picoro.o rs232.o specialfolder.o tcpip.o xmltractor.o

OBJLIST_CALLTREE = calltree.o

Expand All @@ -113,11 +116,11 @@ OBJLIST_POSTLINK = elf-postlink.o elf.o
OBJLIST_TRACEGEN = tracegen.o parsetsdl.o


project: bmdebug bmflash bmprofile bmscan bmtrace calltree elf-postlink tracegen
project: bmdebug bmflash bmprofile bmscan bmserial bmtrace calltree elf-postlink tracegen

depend :
makedepend -b -fmakefile.dep $(OBJLIST_BMDEBUG:.o=.c) $(OBJLIST_BMFLASH:.o=.c) \
$(OBJLIST_BMPROFILE:.o=.c) $(OBJLIST_BMSCAN:.o=.c) \
$(OBJLIST_BMPROFILE:.o=.c) $(OBJLIST_BMSCAN:.o=.c) $(OBJLIST_BMSERIAL:.o=.c) \
$(OBJLIST_BMTRACE:.o=.c) $(OBJLIST_CALLTREE) \
$(OBJLIST_POSTLINK:.o=.c) $(OBJLIST_TRACEGEN:.o=.c)

Expand All @@ -136,6 +139,8 @@ bmprofile.o : bmprofile.c

bmscan.o : bmscan.c

bmserial.o : bmserial.c

bmtrace.o : bmtrace.c

bmp-scan.o : bmp-scan.c
Expand Down Expand Up @@ -180,6 +185,8 @@ noc_file_dialog.o : CFLAGS += -DNOC_FILE_DIALOG_GTK
noc_file_dialog.o : INCLUDE += `pkg-config --cflags gtk+-3.0`
noc_file_dialog.o : noc_file_dialog.c

nuklear_guide.o : nuklear_guide.c

nuklear_mousepointer.o : nuklear_mousepointer.c

nuklear_splitter.o : nuklear_splitter.c
Expand Down Expand Up @@ -219,11 +226,14 @@ bmdebug : $(OBJLIST_BMDEBUG)
$(LNK) $(LFLAGS) -o$@ $^ -lfontconfig -l$(GLFW_LIBNAME) -lGL -lm -lbsd -ldl -lpthread -lX11 -lxcb -lXau -lXdmcp `pkg-config --libs gtk+-3.0` -lusb-1.0

bmflash : $(OBJLIST_BMFLASH)
$(LNK) $(LFLAGS) -o$@ $^ -lfontconfig -l$(GLFW_LIBNAME) -lGL -lm -lbsd -ldl -lpthread -lX11 -lxcb -lXau -lXdmcp `pkg-config --libs gtk+-3.0`
$(LNK) $(LFLAGS) -o$@ $^ -lfontconfig -l$(GLFW_LIBNAME) -lGL -lm -lbsd -ldl -lpthread -lX11 -lxcb -lXau -lXdmcp `pkg-config --libs gtk+-3.0` -lusb-1.0

bmprofile : $(OBJLIST_BMPROFILE)
$(LNK) $(LFLAGS) -o$@ $^ -lfontconfig -l$(GLFW_LIBNAME) -lGL -lm -lbsd -ldl -lpthread -lX11 -lxcb -lXau -lXdmcp `pkg-config --libs gtk+-3.0` -lusb-1.0

bmserial : $(OBJLIST_BMSERIAL)
$(LNK) $(LFLAGS) -o$@ $^ -lfontconfig -l$(GLFW_LIBNAME) -lGL -lm -lbsd -ldl -lpthread -lX11 -lxcb -lXau -lXdmcp `pkg-config --libs gtk+-3.0` -lusb-1.0

bmtrace : $(OBJLIST_BMTRACE)
$(LNK) $(LFLAGS) -o$@ $^ -lfontconfig -l$(GLFW_LIBNAME) -lGL -lm -lbsd -ldl -lpthread -lX11 -lxcb -lXau -lXdmcp `pkg-config --libs gtk+-3.0` -lusb-1.0

Expand Down
27 changes: 21 additions & 6 deletions source/Makefile.mingw
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ OBJLIST_BMPROFILE = bmprofile.o bmcommon.o bmp-scan.o bmp-script.o \
strlcpy.o usb-support.o \
nuklear.o nuklear_gdip.o noc_file_dialog.o

OBJLIST_BMSERIAL = bmserial.o guidriver.o minIni.o rs232.o \
specialfolder.o noc_file_dialog.o \
nuklear_guide.o nuklear_mousepointer.o nuklear_splitter.o \
nuklear_style.o nuklear_tooltip.o \
findfont.o lodepng.o nuklear.o nuklear_gdip.o

OBJLIST_BMTRACE = bmtrace.o bmcommon.o bmp-scan.o bmp-script.o bmp-support.o \
crc32.o demangle.o dwarf.o elf.o gdb-rsp.o guidriver.o mcu-info.o \
minIni.o nuklear_mousepointer.o nuklear_splitter.o nuklear_style.o \
Expand All @@ -100,7 +106,8 @@ OBJLIST_BMTRACE = bmtrace.o bmcommon.o bmp-scan.o bmp-script.o bmp-support.o \
strlcpy.o usb-support.o \
nuklear.o nuklear_gdip.o noc_file_dialog.o

OBJLIST_BMSCAN = bmscan.o bmp-scan.o tcpip.o
OBJLIST_BMSCAN = bmscan.o bmp-scan.o bmp-script.o bmp-support.o crc32.o elf.o \
gdb-rsp.o picoro.o rs232.o specialfolder.o tcpip.o xmltractor.o

OBJLIST_CALLTREE = calltree.o

Expand All @@ -109,14 +116,15 @@ OBJLIST_POSTLINK = elf-postlink.o elf.o strlcpy.o
OBJLIST_TRACEGEN = tracegen.o parsetsdl.o strlcpy.o


project : bmdebug.exe bmflash.exe bmprofile.exe bmtrace.exe bmscan.exe \
project : bmdebug.exe bmflash.exe bmprofile.exe bmscan.exe bmserial.exe bmtrace.exe \
calltree.exe elf-postlink.exe tracegen.exe

depend :
makedepend -b -fmakefile.dep $(OBJLIST_BMDEBUG:.o=.c) $(OBJLIST_BMFLASH:.o=.c) \
$(OBJLIST_BMPROFILE:.o=.c) $(OBJLIST_BMSCAN:.o=.c) \
$(OBJLIST_BMTRACE:.o=.c) $(OBJLIST_CALLTREE:.o=.c) \
$(OBJLIST_POSTLINK:.o=.c) $(OBJLIST_TRACEGEN:.o=.c)
$(OBJLIST_BMSERIAL:.o=.c) $(OBJLIST_BMTRACE:.o=.c) \
$(OBJLIST_CALLTREE:.o=.c) $(OBJLIST_POSTLINK:.o=.c) \
$(OBJLIST_TRACEGEN:.o=.c)


##### C files #####
Expand All @@ -133,6 +141,8 @@ bmprofile.o : bmprofile.c

bmscan.o : bmscan.c

bmserial.o : bmserial.c

bmtrace.o : bmtrace.c

bmp-scan.o : bmp-scan.c
Expand Down Expand Up @@ -161,7 +171,7 @@ gdb-rsp.o : gdb-rsp.c

guidriver.o : guidriver.c

ident.o :ident.c
ident.o : ident.c

mcu-info.o : mcu-info.c

Expand All @@ -172,6 +182,8 @@ minIni.o : minIni.c
noc_file_dialog.o : CFLAGS += -DNOC_FILE_DIALOG_WIN32
noc_file_dialog.o : noc_file_dialog.c

nuklear_guide.o : nuklear_guide.c

nuklear_mousepointer.o : nuklear_mousepointer.c

nuklear_splitter.o : nuklear_splitter.c
Expand Down Expand Up @@ -228,9 +240,12 @@ bmdebug.exe : $(OBJLIST_BMDEBUG) bmdebug.res
bmflash.exe : $(OBJLIST_BMFLASH) bmflash.res
$(LNK) $(LFLAGS) $(LFLAGS_GUI) -o$@ $^ -lm -lcomdlg32 -lgdi32 -lgdiplus -lshlwapi -lws2_32

bmprofile.exe : $(OBJLIST_BMPROFILE)
bmprofile.exe : $(OBJLIST_BMPROFILE) bmprofile.res
$(LNK) $(LFLAGS) $(LFLAGS_GUI) -o$@ $^ -lm -lcomdlg32 -lgdi32 -lgdiplus -lsetupapi -lshlwapi -lws2_32

bmserial.exe : $(OBJLIST_BMSERIAL) bmserial.res
$(LNK) $(LFLAGS) $(LFLAGS_GUI) -o$@ $^ -lm -lcomdlg32 -lgdi32 -lgdiplus -lshlwapi -lws2_32

bmtrace.exe : $(OBJLIST_BMTRACE) bmtrace.res
$(LNK) $(LFLAGS) $(LFLAGS_GUI) -o$@ $^ -lm -lcomdlg32 -lgdi32 -lgdiplus -lsetupapi -lshlwapi -lws2_32

Expand Down
28 changes: 23 additions & 5 deletions source/Makefile.msvc
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ OBJLIST_BMPROFILE = bmprofile.obj bmcommon.obj bmp-scan.obj bmp-script.obj \
strlcpy.obj usb-support.obj \
nuklear.obj nuklear_gdip.obj noc_file_dialog.obj

OBJLIST_BMSERIAL = bmserial.obj guidriver.obj minIni.obj rs232.obj \
specialfolder.obj noc_file_dialog.obj \
nuklear_guide.obj nuklear_mousepointer.obj nuklear_splitter.obj \
nuklear_style.obj nuklear_tooltip.obj \
findfont.obj lodepng.obj nuklear.obj nuklear_gdip.obj

OBJLIST_BMTRACE = bmtrace.obj bmcommon.obj bmp-scan.obj bmp-script.obj bmp-support.obj \
crc32.obj demangle.obj dwarf.obj elf.obj gdb-rsp.obj guidriver.obj mcu-info.obj \
minIni.obj nuklear_mousepointer.obj nuklear_splitter.obj nuklear_style.obj \
Expand All @@ -95,7 +101,9 @@ OBJLIST_BMTRACE = bmtrace.obj bmcommon.obj bmp-scan.obj bmp-script.obj bmp-suppo
strlcpy.obj usb-support.obj \
nuklear.obj nuklear_gdip.obj noc_file_dialog.obj

OBJLIST_BMSCAN = bmscan.obj bmp-scan.obj tcpip.obj
OBJLIST_BMSCAN = bmscan.obj bmp-scan.obj bmp-script.obj bmp-support.obj crc32.obj \
elf.obj gdb-rsp.obj picoro.obj rs232.obj specialfolder.obj tcpip.obj \
xmltractor.obj

OBJLIST_CALLTREE = calltree.obj

Expand All @@ -104,12 +112,13 @@ OBJLIST_POSTLINK = elf-postlink.obj elf.obj strlcpy.obj
OBJLIST_TRACEGEN = tracegen.obj parsetsdl.obj strlcpy.obj


project : bmdebug.exe bmflash.exe bmprofile.exe bmtrace.exe bmscan.exe calltree.exe \
elf-postlink.exe tracegen.exe
project : bmdebug.exe bmflash.exe bmprofile.exe bmscan.exe bmserial.exe bmtrace.exe \
calltree.exe elf-postlink.exe tracegen.exe

depend :
makedepend -b -e -o.obj -fmakefile.dep $(OBJLIST_BMDEBUG:.obj=.c) $(OBJLIST_BMFLASH:.obj=.c) \
$(OBJLIST_BMPROFILE:.obj=.c) $(OBJLIST_BMTRACE:.obj=.c) $(OBJLIST_BMSCAN:.obj=.c) \
$(OBJLIST_BMPROFILE:.obj=.c) $(OBJLIST_BMSCAN:.obj=.c) \
$(OBJLIST_BMSERIAL:.obj=.c) $(OBJLIST_BMTRACE:.obj=.c) \
$(OBJLIST_CALLTREE:.obj=.c) $(OBJLIST_POSTLINK:.obj=.c) \
$(OBJLIST_TRACEGEN:.obj=.c)

Expand All @@ -128,6 +137,8 @@ bmprofile.obj : bmprofile.c

bmscan.obj : bmscan.c

bmserial.obj : bmserial.c

bmtrace.obj : bmtrace.c

bmp-scan.obj : bmp-scan.c
Expand Down Expand Up @@ -168,6 +179,8 @@ minIni.obj : minIni.c

noc_file_dialog.obj : noc_file_dialog.c

nuklear_guide.obj : nuklear_guide.c

nuklear_mousepointer.obj : nuklear_mousepointer.c

nuklear_splitter.obj : nuklear_splitter.c
Expand All @@ -186,6 +199,8 @@ serialmon.obj : serialmon.c

specialfolder.obj : specialfolder.c

strlcpy.obj : strlcpy.c

svd-support.obj : svd-support.c

swotrace.obj : swotrace.c
Expand Down Expand Up @@ -222,9 +237,12 @@ bmdebug.exe : $(OBJLIST_BMDEBUG) bmdebug.res
bmflash.exe : $(OBJLIST_BMFLASH) bmflash.res
$(LNK) $(LFLAGS_W) /ENTRY:mainCRTStartup /OUT:$@ $** advapi32.lib comdlg32.lib gdi32.lib gdiplus.lib user32.lib winmm.lib wsock32.lib shell32.lib shlwapi.lib

bmprofile.exe : $(OBJLIST_BMPROFILE) bmtrace.res
bmprofile.exe : $(OBJLIST_BMPROFILE) bmprofile.res
$(LNK) $(LFLAGS_W) /ENTRY:mainCRTStartup /OUT:$@ $** advapi32.lib comdlg32.lib gdi32.lib gdiplus.lib user32.lib winmm.lib wsock32.lib shell32.lib shlwapi.lib setupapi.lib

bmserial.exe : $(OBJLIST_BMSERIAL) bmserial.res
$(LNK) $(LFLAGS_W) /ENTRY:mainCRTStartup /OUT:$@ $** advapi32.lib comdlg32.lib gdi32.lib gdiplus.lib user32.lib winmm.lib wsock32.lib shell32.lib shlwapi.lib

bmtrace.exe : $(OBJLIST_BMTRACE) bmtrace.res
$(LNK) $(LFLAGS_W) /ENTRY:mainCRTStartup /OUT:$@ $** advapi32.lib comdlg32.lib gdi32.lib gdiplus.lib user32.lib winmm.lib wsock32.lib shell32.lib shlwapi.lib setupapi.lib

Expand Down
11 changes: 6 additions & 5 deletions source/bmcommon.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Common functions for bmdebug, bmflash and bmtrace.
* Common functions for bmdebug, bmflash, bmprofile and bmtrace.
*
* Copyright 2021 CompuPhase
* Copyright 2021-2022 CompuPhase
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,6 +16,7 @@
* limitations under the License.
*/
#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#if defined WIN32 || defined _WIN32
Expand Down Expand Up @@ -76,13 +77,13 @@ void clear_probelist(const char **probelist, int netprobe)
}
}

int get_configfile(char *filename, size_t maxsize, const char *basename)
bool get_configfile(char *filename, size_t maxsize, const char *basename)
{
assert(filename != NULL);
assert(maxsize > 0);
*filename = '\0';
if (!folder_AppConfig(filename, maxsize))
return 0;
return false;

strlcat(filename, DIR_SEPARATOR "BlackMagic", maxsize);
#if defined _WIN32
Expand All @@ -92,6 +93,6 @@ int get_configfile(char *filename, size_t maxsize, const char *basename)
#endif
strlcat(filename, DIR_SEPARATOR, maxsize);
strlcat(filename, basename, maxsize);
return 1;
return true;
}

6 changes: 3 additions & 3 deletions source/bmcommon.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Common functions for bmdebug, bmflash and bmtrace.
* Common functions for bmdebug, bmflash, bmprofile and bmtrace.
*
* Copyright 2021 CompuPhase
* Copyright 2021-2022 CompuPhase
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,6 +21,6 @@
const char **get_probelist(int *probe, int *netprobe);
void clear_probelist(const char **probelist, int netprobe);

int get_configfile(char *filename, size_t maxsize, const char *basename);
bool get_configfile(char *filename, size_t maxsize, const char *basename);

#endif /* _BMCOMMON_H */
Loading

0 comments on commit 614b26c

Please sign in to comment.