Skip to content

scalpelspace/pyblasher

Repository files navigation

pyblasher

black_formatter

Python based basic firmware flash and utility tool.


Table of Contents

1 Overview

1.1 PyBlasher Graphical User Interface (GUI)

PyBlasher runs in GUI mode by default.

gui_image.png

1.2 PyBlasher Command Line Interface (CLI)

To manually run the CLI run use the -c or --cli flag.

python3 main.py --cli  # py instead of "python3" for Windows.

2 Flashing Firmware

There are 2 primary operating modes that affect USB-to-UART bootloader flashing:

  1. Default: Handsfree programming.
  2. Modified: Manual BOOT0 control.
    • BOOT0 is disconnected either buy a hardware slide switch or jumper.
    • Users using the modified mode will have additional steps, format of the additional steps shown below:
      1. For modified boards: Example step only required for Manual BOOT0 control.

Steps:

  1. If not done so already, download the Silicon Labs's VCP CP210x USB to UART Bridge VCP Drivers.

  2. For modified boards: Manually short or close the BOOT0 jumper.

  3. Connect your desktop computer to the dev board's USB-C.

  4. Run PyBlasher.

  5. PyBlasher should find the connected port automatically at the top.

    1. COMxx for Windows.
    2. /dev/tty.usbserial-* for macOS.
    3. /dev/ttyUSB* for Linux.
    • If not found, reconnect to the dev board's USB-C and click the Refresh ports button.
    • If there is more than 1 board connected, you can click the top button and cycle through the port options.
  6. Drag and drop the firmware .bin file or browse manually.

  7. Click the Flash firmware button.

    • Firmware flashing will begin, the UART RX and UART TX leds should flash throughout the process.
  8. Upon completion of flashing, the dev board will auto reset.

  9. For modified boards: Re-open the BOOT0 jumper and reset the STM32 MCU (short NRST to ground) to begin running the firmware.

2.3 Manual Port Finding

Windows:

  1. Open Device Manager.
  2. Under Ports (COM & LPT) find the COMx port named something along the lines of Silicon Labs CP210x USB to UART Bridge (COMx).

macOS: Open a terminal and enter the following command:

ls /dev/tty.* /dev/cu.*
  • The expected name is similar to /dev/tty.usbserial-*.

Linux: Open a terminal and enter the following command:

dmesg | grep tty
  • The expected name is /dev/ttyUSB*.

3 Dev Notes

3.1 Deprecated PyInstaller Workflow

The PyInstaller macOS, Windows, Linux builds workflow is saved in docs/pyinstaller.yaml for reference.

  • Discontinued use due to fatal error on Windows build related to Kivy and OpenGL versions, see issue #2.

The badge markdown would be as follows:

![pyinstaller](https://github.com/scalpelspace/pyblasher/actions/workflows/pyinstaller.yaml/badge.svg)

3.2 PyInstaller Build

Based on YouTube: Convert GUI App to Real Program - Python to exe to setup wizard by PythonSimplified.

3.2.1 PyInstaller single file executable

Windows:

pyinstaller --name PyBlasher --onefile --windowed --icon=assets/icon.ico --hidden-import=win32timezone main.py

macOS:

pyinstaller --name PyBlasher --onedir --windowed --icon assets/icon.icns main.py

Hidden imports ensures explicit inclusion of required dependencies.

3.2.2 Inno Setup

Setup file compiled via: Inno Setup.

About

Python based basic firmware flash and utility tool

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages