All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Unified CLI command - All commands now use single
bmlentry point with subcommandsbmlab-flash→bml flashbmlab-rtt→bml rttbmlab-erase→bml erasebmlab-scan→bml scan
- Shell autocompletion - Added
argcompletedependency for tab completion support- Enable with:
eval "$(register-python-argcomplete bml)"
- Enable with:
- Help on no arguments - Running
bmlwithout arguments now displays usage help with examples - RTT infinite read by default - RTT command now reads indefinitely by default (timeout=0), use
-tto set a specific timeout
- workflow
- Removed docker. Now uses our packaged bmlab-toolkit image for CI jobs
- Publish workflow checks
pyproject.tomlversion matches git tag before publishing
- workflow
- New CI workflow
publish.ymlfor publishing to PyPI on tag push
- New CI workflow
- Parallel RTT monitoring - Multiple devices can now be monitored simultaneously via RTT
--ipparameter accepts multiple IP addresses for parallel network RTT reading--serialparameter accepts multiple serial numbers for sequential USB RTT reading- Uses
ProcessPoolExecutorfor true parallel execution (avoiding pylink thread-safety issues) --output-dirparameter required for multiple devices, logs saved per device- Log files named by device:
rtt_192_168_3_100.logorrtt_serial_123456.log - Single device mode outputs to terminal (no
--output-dirneeded) - Example:
bmlab-rtt --ip 192.168.1.100 192.168.1.101 --output-dir logs --timeout 60 - Example:
bmlab-rtt --serial 123456 789012 --mcu STM32F103RE --output-dir logs --timeout 30
- Parallel device flashing - Multiple devices can now be flashed simultaneously
--ipparameter now accepts multiple IP addresses for parallel network flashing--serialparameter now accepts multiple serial numbers for sequential USB flashing- Uses
ProcessPoolExecutorfor true parallel execution (separate processes per device) - Each device gets isolated pylink state, preventing conflicts
- Real-time progress reporting with ✓/✗ indicators per device
- Summary report showing success/failure counts
- Example:
bmlab-flash firmware.bin --ip 192.168.1.100 192.168.1.101 192.168.1.102 - Example:
bmlab-flash firmware.bin --serial 123456 789012 345678
- Smart execution strategy based on connection type:
- Network devices (--ip): Parallel flashing using ProcessPoolExecutor
- USB devices (--serial): Sequential flashing to avoid USB driver conflicts
- Auto-detection still works for single device scenarios
- Unified device output format - Same format for single or multiple devices
- Added 500ms delay after each flash operation for proper device release
- New CI workflow
test-flash.ymlfor testing parallel flashing functionality - Tests for single device flashing (USB serial and network IP)
- Tests for multiple device flashing (2 and 3 devices in parallel)
- Tests for auto-detection and MCU parameter handling
- Network scanning now correctly detects target MCU for all devices:
- Added thread lock (
threading.Lock) to serialize JLink connections during parallel scanning - Prevents state conflicts in pylink library when multiple threads connect simultaneously
- Previously parallel scans could incorrectly detect STM32F765ZG instead of actual STM32F103RE
- Added 500ms delay after disconnect to ensure device is fully released
- Added thread lock (
- CI workflow improvements:
- Removed excessive debug output from test steps
- Simplified Docker container setup and cleanup
- Fixed validation logic: removed redundant device counting, only validate target MCU and IPs
- Added network cleanup before creation to prevent "pool overlaps" errors
- Strict validation restored: exactly 3 STM32F103RE devices required at specified IPs
- Network scanning: target detection is now serialized with lock protection
- Port checks remain parallel for speed
- Target MCU detection runs sequentially to prevent pylink state conflicts
- Renamed
bmlab-jlink-rtttobmlab-rtt- Command renamed to support multiple programmers- Added
--programmer(-p) parameter to select programmer type (default: jlink) - Follows the same pattern as
bmlab-flashcommand - Updated all documentation, examples, and launch configurations
- Old command name
bmlab-jlink-rttis no longer available
- Added
- Improved resilience of network scanning for JLink Remote Server:
- Added parallel scanning with limited concurrency (using
concurrent.futures.ThreadPoolExecutor). - Added socket timeout to avoid hanging on unresponsive IPs.
- Added parallel scanning with limited concurrency (using
- launch.json can now run the CLI via
"module": "bmlab_toolkit.scan_cli"for correct relative import functionality.
- Properly close J-Link connection after each IP scan (using
finally+_disconnect_target()). - Explicit error and exception handling when connecting to the target device.
- Network Scanning for JLink Remote Servers -
bmlab-scannow supports scanning IP networks- New
--networkparameter accepts CIDR notation (e.g.,192.168.1.0/24) - New
--start-ipand--end-ipparameters for specifying IP range by last octet - Sequential scanning to avoid segmentation faults
- Socket-based pre-check (port 19020) before attempting JLink connection
- Automatic target detection for remote servers
- Example:
bmlab-scan --network 192.168.1.0/24 --start-ip 100 --end-ip 150
- New
- Communication timeout errors during network scan - Added proper exception handling for timeout errors during JLink disconnect in network scanning
- Serial key error in network scan - Fixed output logic to properly separate network scan results from USB scan results
- Unified Logging Control - Added
--log-level(-l) parameter to all CLI tools- Supports DEBUG, INFO, WARNING (default), ERROR levels
- Available in
bmlab-flash,bmlab-jlink-rtt, andbmlab-erase - Programmatic API:
log_levelparameter inJLinkProgrammer.__init__()
- Removed
do_verifyparameter - Flash verification is always enabled (built into pylink flash_file) - Removed
-v/--verboseflags - Replaced with--log-levelfor consistent logging control - Improved RTT workflow -
start_rtt()now handles connection and reset automatically- No need to manually call
_connect_target()before RTT operations - Simplified RTT CLI code
- No need to manually call
- Communication timeout errors suppressed - Changed pylink logger to CRITICAL level to hide harmless timeout errors during disconnect
- RTT connection loss detection - RTT read errors now properly disconnect instead of infinite error loop
- Graceful exit when JLinkRemoteServer is closed
- Clear error message: "RTT connection lost"
- Better error handling - RTT read exceptions are propagated to allow proper cleanup
- Linux Segmentation Fault with IP Connections - Fixed critical bug causing segfault on Linux when using
bmlab-jlink-rtt --ip- Skip USB device enumeration for IP connections (not applicable for network JLink)
- Skip
set_tif()andconnect()calls for IP connections (handled by JLink Remote Server) - Skip
reset()operation for IP connections to avoid crashes - IP connections now use remote server's existing target connection instead of attempting reconnection
- Improved IP connection handling for better stability on Linux systems
- IP connections now display "Remote Target" as MCU name when not explicitly specified
-
Command-line interface with
bmlab-flashcommand -
bmlab-erasecommand for erasing device flash memory -
erase()method in Programmer base class and JLinkProgrammer implementation -
Device erase CLI with support for auto-detection and manual configuration
-
Support for erasing via IP address connection
-
RTT Message Sending - Added retry logic for RTT write operations
bmlab-jlink-rttCLI command for real-time device communicationstart_rtt()method to initiate RTT communicationstop_rtt()method to stop RTT communicationrtt_read()method to read data from RTT buffersrtt_write()method to write data to RTT buffers- Support for custom RTT control block addresses
- Configurable timeouts and delays
--msg-retriesparameter (default: 10) for configurable retry attempts- Automatic retry with 1-second delay between attempts
- Warning message if all retry attempts fail
- Verbose mode shows retry attempts and success status
-
RTT CLI Features:
- Auto-detection of JLink serial and MCU (or specify explicitly)
- Configurable read timeout (default 10s, 0 for indefinite)
- Send messages to device via
--msgparameter - Configurable message send delay with
--msg-timeout - Optional target reset control (
--reset/--no-reset) - Verbose mode for debugging with
-vflag - Escape sequence support in messages (e.g.,
\n,\t)
-
Network JLink Support - Added ability to connect to JLink via IP address
--ipparameter in bothbmlab-flashandbmlab-jlink-rttCLI commandsip_addrparameter inJLinkProgrammerconstructor- Connection format:
jlink.open(ip_addr="192.168.1.100:19020") - When using IP connection, MCU parameter is not required
--serialand--ipare mutually exclusive parameters- Full support for flashing and RTT communication over network