Skip to content

HumpbackLab/AT32-WebISP

Repository files navigation

AT32 ISP Web UI

A browser-based firmware programming utility for AT32 microcontrollers using Web Serial API.

Build and Release

Features

  • 🌐 Browser-Based - No installation required, runs entirely in your browser
  • 📦 Single File Distribution - Built as a standalone HTML file for easy sharing
  • 🔌 Web Serial API - Direct USB-TTL communication without drivers
  • 📁 Multiple Format Support - Supports .bin, .hex, and .elf firmware files
  • Full Bootloader Control - Erase, program, and verify flash memory
  • 🎨 Modern UI - Clean, responsive interface built with React and Tailwind CSS

Quick Start

Option 1: Use Online Version (Recommended)

Visit https://humpbacklab.github.io/AT32-WebISP/ to use the app directly in your browser - no download required!

Option 2: Download Pre-built Release

  1. Download the latest index.html from Releases
  2. Open the file in a modern browser (Chrome or Edge recommended)
  3. Connect your AT32 device and start programming

Option 3: Build from Source

# Clone the repository
git clone https://github.com/HumpbackLab/AT32-WebISP.git
cd AT32-WebISP

# Install dependencies
npm install

# Build single-file HTML
npm run build

# Output will be in dist/index.html

Usage

Hardware Setup

  1. Enter Bootloader Mode

    • Connect BOOT0 pin to HIGH (3.3V)
    • Reset the microcontroller
    • The device will enter bootloader mode
  2. USB-TTL Connection

    • Connect USB-TTL adapter to your AT32's UART pins
    • Common configurations: UART1 (PA9/PA10) or UART3

Programming Steps

  1. Connect Device

    • Click "Connect Device" button
    • Select the correct serial port from the browser dialog
    • Default baud rate: 115200 (configurable)
  2. Load Firmware

    • Click "Select Firmware" and choose your file
    • Supported formats: .bin, .hex, .elf
  3. Program Flash

    • Full Chip Erase: Erase entire flash memory
    • Write to Flash: Program the selected firmware
    • Verify Flash: Verify written data matches firmware file

Supported Formats

Format Description Base Address
.bin Raw binary 0x08000000 (default)
.hex Intel HEX Extracted from file
.elf ELF executable Extracted from loadable segments

AT32 Bootloader Protocol

This tool implements the AT32 UART bootloader protocol with the following commands:

  • 0x00 - Get Commands
  • 0x01 - Get Version
  • 0x02 - Get ID
  • 0x11 - Read Memory
  • 0x21 - Go (Execute)
  • 0x31 - Write Memory
  • 0x44 - Extended Erase
  • 0xAC - Firmware CRC

Browser Compatibility

Requires a browser with Web Serial API support:

  • ✅ Chrome 89+
  • ✅ Edge 89+
  • ✅ Opera 75+
  • ❌ Firefox (not supported)
  • ❌ Safari (not supported)

Note: HTTPS or localhost is required for Web Serial API access.

Development

# Development server with hot reload
npm run dev

# Type checking
npm run lint

# Build for production
npm run build

Project Structure

AT32-WebISP/
├── src/
│   ├── App.tsx              # Main application component
│   ├── main.tsx             # Application entry point
│   ├── components/          # UI components
│   │   ├── Common.tsx       # Reusable UI elements
│   │   └── LogViewer.tsx    # System log viewer
│   ├── drivers/             # Protocol implementation
│   │   ├── AT32Protocol.ts  # AT32 bootloader protocol
│   │   └── SerialInterface.ts # Web Serial API wrapper
│   └── utils/
│       └── FileParsers.ts   # Firmware format parsers
├── .github/
│   └── workflows/
│       └── release.yml      # CI/CD workflow
└── vite.config.ts           # Build configuration

CI/CD

This project includes automated GitHub Actions workflow:

  • Trigger: Push to main branch
  • Actions:
    1. Build project as single HTML file
    2. Generate timestamped version tag
    3. Create GitHub Release with built file

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - feel free to use this project for any purpose.

Acknowledgments

Troubleshooting

"No compatible device found"

  • Ensure BOOT0 is HIGH before resetting
  • Check UART pin connections
  • Verify baud rate matches bootloader configuration

"Timeout reading response"

  • Reset the MCU and try reconnecting
  • Confirm correct UART pins (usually UART1 or UART3)
  • Try a different baud rate

"Permission denied" in browser

  • Use Chrome or Edge browser
  • Access via HTTPS or localhost
  • Grant serial port permissions when prompted

Related Projects


Made with ❤️ for the embedded development community

About

Browser-based firmware programming utility for AT32 microcontrollers using Web Serial API

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors