STM32F103 逻辑分析仪等
buck50 is open-source firmware that turns a "Blue Pill" STM32F103 development board (widely available for approx. US$1.50) into a multi-purpose test and measurement instrument, including:
configure commandlogic commandoscope commanddump commandtrigger commandmonitor commandlines configurationadcN configurationsnumbers command(*)gpio commandusart commandspi commandi2c commandipc configurationpty configurationsocket configurationpulse command(*)reset commandbuck50: Test and measurement firmware for "Blue Pill" STM32F103 development board
Copyright (C) 2019,2020 Mark R. Rubin aka "thanks4opensource"
This file is part of buck50.
The buck50 program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The buck50 program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the buck50 program. If not, see
buck50 is provided as ready-to-flash files in ELF (buck50.elf), binary (buck50.bin), and Intel hex (buck50.hex) formats in addition to source code (see Building from source, below).
Instructions on how to flash code onto microcontrollers such as the STM32F103 are beyond the scope of this document. Briefly, the STM32F103 cannot be flashed via its USB port (except 3), so other techniques must be employed.
Probably the best method is via the "Blue Pill" SWD port (see Hardware connections, below) using either a Black Magic Probe (website, wiki) or an ST-Link (website) or clone thereof (Google search). Note that the former is used with GDB from the GNU Arm Embedded Toolchain and the latter either with GDB or stlink (GitHub repository) among other software front ends.
Alternately, the "Blue Pill" can be flashed via its USART1 serial port (RX on port PA10, TX on PA9, see below). This typically requires a USB-to-serial converter
(Google search) (or, ironically, another already-flashed "buck50" 4) as modern host computers rarely include an RS-232 port. Instructions and software required for doing so can be found at the stm32flash SourceForge website, this tutorial web page, and/or a GitHub wiki, among other resources. If using a serial port method remember to change the BOOT0 jumper (see directly below) back to its "0" position after flashing with it set to "1".
The following is a highly simplified, edited version of the incredibly useful image created by Rasmus Friis Kjeldsen 5, available at (direct link: ). The edited and original versions are included in this repository under terms in compliance with the original's license.
WARNING! Incorrect hookups to the "Blue Pill" (or any other microcontroller's) ports may cause permanent damage. Examples: Connecting a push-pull output port directly to a positive voltage source or ground sink, or to another push-pull output on the same or different MCU set to the opposite polarity. Readers of this document and users of the firmware it describes assume all responsibility for their actions.
The buck50 firmware configures and uses the "Blue Pill" STM32F103 GPIO ports as follows. Note that many pins have multiple uses depending on which buck50.py host command is in effect, including changing roles to be either inputs, outputs, or bidirectional.
Pin(s) Type Purpose buck50.py commands
====== ============================== ================================= ==================
PB4-11 input weak pull-down digital input logic, monitor
PB10,11 in/out open-drain I2C i2c, monitor
PA0-7 output push-pull digital output numbers, gpio
PA0-7 input analog analog input oscope, monitor
PA1-3 output push-pull digital pulse outputs pulse
PA0 input weak pull-up usart CTS usart
PA1 output push-pull usart RTS usart
PA2 output push-pull usart TX usart
PA3 input weak pull-up usart RX usart
PA4 output push-pull SPI select output (master) spi, monitor
PA4 input floating SPI select input (slave) spi, monitor
PA5 output push-pull SPI clock (master) spi, monitor
PA5 input floating SPI clock (slave) spi, monitor
PA6 input floating/pull-up/-down SPI MISO spi, monitor
PA7 output push-pull SPI MOSI spi, monitor
PA8 output push-pull USART clock (synchronous) usart, monitor
PA9 output push-pull USART TX usart, monitor
PA10 input weak pullup USART RX usart, monitor
PB13 output push-pull sampling indicator, sync logic, oscope
PB14 output open-drain external/ganged trigger logic, oscope
PB15 output open-drain external/ganged trigger ack logic, oscope
PC13 output open-drain status/fault/sampling/triggering , logic, oscope
PA11 output open-drain USB negative (do not connect)
PA12 output open-drain USB positive (do not connect) See logic, monitor, numbers, spi, and usart, below.
reset blink command (used to identify physical device)暂无开放 Issues,或尚未同步最近议题。