Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit logging output on FreeBSD to something reasonable. #992

Closed
Crest opened this issue Jun 21, 2020 · 0 comments · Fixed by #993
Closed

Limit logging output on FreeBSD to something reasonable. #992

Crest opened this issue Jun 21, 2020 · 0 comments · Fixed by #993

Comments

@Crest
Copy link
Contributor

Crest commented Jun 21, 2020

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

@Nightwalker-87 Nightwalker-87 added this to the v1.6.2 milestone Jun 21, 2020
@Nightwalker-87 Nightwalker-87 added this to To do in Release v1.7.0 via automation Jun 21, 2020
@Nightwalker-87 Nightwalker-87 moved this from To do to Review in progress in Release v1.7.0 Jun 21, 2020
@Nightwalker-87 Nightwalker-87 linked a pull request Jun 21, 2020 that will close this issue
Release v1.7.0 automation moved this from Review in progress to Done Jun 21, 2020
@stlink-org stlink-org locked as resolved and limited conversation to collaborators Dec 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants