Skip to content

Limit logging output on FreeBSD to something reasonable. #992

Closed

Description

@Crest

Thank you for giving feedback to the stlink project.

In order to allow developers and other contributors to isolate and target your respective issue, please take some time to fill out each of the following items appropriate to your specific problem:

  • Programmer/board type: [ALL] (e.g Stlink /v1, /v2, /v2-clone, /v2-1)
  • Programmer firmware version: [ALL] (e.g STSW-LINK007 2.27.15)
  • Operating system and version: [FreeBSD] (e.g Linux, Mac OS X, Windows)
  • Stlink tools version and/or git commit hash: [1.6.1 and newer] (e.g v1.1.0/git-c722056)
  • Stlink commandline tool name: [ALL] (e.g st-info, st-flash, st-util)
  • Target chip (and board if applicable): [ALL] (e.g STM32F402VG)

Futher we kindly ask you to describe the detected problem as detailed as possible and to add debug output if available, by using the following template:

The stlink library calls libusb_set_debug() on platforms with LIBUSB_API_VERSION < 0x01000106. FreeBSD includes its own implementation of the libusb API. The FreeBSD implementation of libusb_set_debug() enables very verbose tracing instead of normal logging suitable for everday use. It logs every libusb function call or USB transfer to standard output depending the enabled flags. This drowns out all normal output.

For example a simple st-info --probe returns this (on FreeBSD)
Commandline-Output:

% st-info --probe
LIBUSB_TRANSFER: sync I/O done
LIBUSB_TRANSFER: sync I/O done
LIBUSB_TRANSFER: sync I/O done
LIBUSB_TRANSFER: sync I/O done
LIBUSB_TRANSFER: sync I/O done
LIBUSB_TRANSFER: sync I/O done
LIBUSB_TRANSFER: sync I/O done
LIBUSB_TRANSFER: sync I/O done
LIBUSB_TRANSFER: sync I/O done
LIBUSB_TRANSFER: sync I/O done
LIBUSB_TRANSFER: sync I/O done
LIBUSB_TRANSFER: sync I/O done
LIBUSB_TRANSFER: sync I/O done
LIBUSB_TRANSFER: sync I/O done
LIBUSB_TRANSFER: sync I/O done
LIBUSB_TRANSFER: sync I/O done
LIBUSB_TRANSFER: sync I/O done
LIBUSB_TRANSFER: sync I/O done
LIBUSB_TRANSFER: sync I/O done
LIBUSB_TRANSFER: sync I/O done
Found 1 stlink programmers
 serial:     303637324646353035323530383237383637303733343039
 hla-serial: "\x30\x36\x37\x32\x46\x46\x35\x30\x35\x32\x35\x30\x38\x32\x37\x38\x36\x37\x30\x37\x33\x34\x30\x39"
 flash:      0 (pagesize: 0)
 sram:       0
 chipid:     0x0004

Expected/description:

I expected this instead of all the LIBUSB_* tracing:

Found 1 stlink programmers
 serial:     303637324646353035323530383237383637303733343039
 hla-serial: "\x30\x36\x37\x32\x46\x46\x35\x30\x35\x32\x35\x30\x38\x32\x37\x38\x36\x37\x30\x37\x33\x34\x30\x39"
 flash:      0 (pagesize: 0)
 sram:       0
 chipid:     0x0004

I came up with a patch to logging.c to silence libusb on FreeBSD by default (#993).

NOTICE: This bug report may be closed without further notice, if not enough information is provided!

Thank you for your support.

The stlink project maintainers

Metadata

Metadata

Assignees

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions