Hosted: Print version with "-h" and "-t" option.

This commit is contained in:
Uwe Bonnes 2020-11-08 21:24:28 +01:00 committed by UweBonnes
parent 3ee31473c6
commit e6823f39de
5 changed files with 14 additions and 11 deletions

View File

@ -37,7 +37,7 @@
#include "adiv5.h"
int remote_init(bool verbose)
int remote_init(void)
{
char construct[REMOTE_MAX_MSG_SIZE];
int c = snprintf(construct, REMOTE_MAX_MSG_SIZE, "%s", REMOTE_START_STR);
@ -49,9 +49,8 @@ int remote_init(bool verbose)
c ? (char *)&(construct[1]) : "unknown");
return -1;
}
if (verbose)
DEBUG_WARN("Remote is %s\n", &construct[1]);
return 0;
DEBUG_PROBE("Remote is %s\n", &construct[1]);
return 0;
}
bool remote_target_get_power(void)

View File

@ -29,7 +29,7 @@
int platform_buffer_write(const uint8_t *data, int size);
int platform_buffer_read(uint8_t *data, int size);
int remote_init(bool verbose);
int remote_init(void);
int remote_swdptap_init(swd_proc_t *swd_proc);
int remote_jtagtap_init(jtag_proc_t *jtag_proc);
bool remote_target_get_power(void);

View File

@ -36,6 +36,7 @@
#include "ftdi_bmp.h"
#include "jlink.h"
#include "cmsis_dap.h"
#include "version.h"
#define VENDOR_ID_STLINK 0x0483
#define PRODUCT_ID_STLINK_MASK 0xffe0
@ -302,14 +303,16 @@ void platform_init(int argc, char **argv)
} else if (find_debuggers(&cl_opts, &info)) {
exit(-1);
}
DEBUG_WARN("Using %04x:%04x %s %s %s\n", info.vid, info.pid, info.serial,
DEBUG_INFO("BMP hosted %s\n for ST-Link V2/3, CMSIS_DAP, JLINK and "
"LIBFTDI/MPSSE\n", FIRMWARE_VERSION);
DEBUG_INFO("Using %04x:%04x %s %s\n %s\n", info.vid, info.pid, info.serial,
info.manufacturer,
info.product);
switch (info.bmp_type) {
case BMP_TYPE_BMP:
if (serial_open(&cl_opts, info.serial))
exit(-1);
remote_init(true);
remote_init();
break;
case BMP_TYPE_STLINKV2:
if (stlink_init( &info))

View File

@ -436,7 +436,8 @@ static void stlink_version(bmp_info_t *info)
Stlink.ver_swim = (version >> 0) & 0x3f;
}
}
DEBUG_INFO("V%dJ%d",Stlink.ver_stlink, Stlink.ver_jtag);
DEBUG_INFO("STLink firmware version: V%dJ%d",Stlink.ver_stlink,
Stlink.ver_jtag);
if (Stlink.ver_hw == 30) {
DEBUG_INFO("M%dB%dS%d", Stlink.ver_mass, Stlink.ver_bridge, Stlink.ver_swim);
} else if (Stlink.ver_hw == 20) {

View File

@ -28,7 +28,7 @@
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#include "version.h"
#include "target.h"
#include "target_internal.h"
@ -116,8 +116,8 @@ static void bmp_munmap(struct mmap_data *map)
static void cl_help(char **argv, BMP_CL_OPTIONS_t *opt)
{
DEBUG_WARN("%s for: \n", opt->opt_idstring);
DEBUG_WARN("\tBMP Firmware, ST-Link V2/3, CMSIS_DAP, JLINK and "
"LIBFTDI/MPSSE\n\n");
DEBUG_WARN("\tBMP hosted %s\n\t\tfor ST-Link V2/3, CMSIS_DAP, JLINK and "
"LIBFTDI/MPSSE\n\n", FIRMWARE_VERSION);
DEBUG_WARN("Usage: %s [options]\n", argv[0]);
DEBUG_WARN("\t-h\t\t: This help.\n");
DEBUG_WARN("\t-v[bitmask]\t: Increasing verbosity. Bitmask:\n");