Open Source STC MCU ISP flash tool
Go to file
Grigori Goronzy d5b35cf43d Rename stc15 and stc15x protocols
The protocol originally named "stc15" is only used for two early STC15
series, i.e. STC15F104/STC15F204. All other STC15 series appear to
use a different protocol. So switch around names similary to "stc12"
vs "stc12a".

In conclusion:
- "stc15a" is used only for STC15xx04E(A)
- "stc15" is used for all other currently tested STC15 MCUs
2015-11-22 17:45:31 +01:00
doc Update MCU database 2015-11-21 00:41:30 +01:00
README.md Add IAP15F2K61S2 to compatibility list 2015-11-22 17:36:06 +01:00
stcgal.py Rename stc15 and stc15x protocols 2015-11-22 17:45:31 +01:00
TODO.md Update TODO 2015-11-21 00:40:15 +01:00

stcgal - STC MCU flash tool

stcgal is a command line flash programming tool for STC MCU Ltd. [1] 8051 compatible microcontrollers. The name was inspired by avrdude [2].

STC microcontrollers have a UART based boot strap loader (BSL). It utilizes a packet-based protocol to flash the code memory and IAP memory. The BSL is also used to configure various (fuse-like) device options. Unfortunately, this protocol is not publicly documented and STC only provide a (crude) Windows GUI application for programming.

stcgal is a full-featured replacement for STC's Windows software; it is very portable and suitable for automation.

[1] http://stcmcu.com/ [2] http://www.nongnu.org/avrdude/

Supported MCU models

stcgal should fully support STC 89/90/10/11/12/15 series MCUs.

So far, stcgal was tested with the following MCU models:

  • STC89C52RC (BSL version: 4.3C)
  • STC12C2052AD (BSL version: 5.8D)
  • STC12C5A60S2 (BSL version: 6.2I)
  • STC11F08XE (BSL version: 6.5M)
  • STC15F104E (BSL version: 6.7Q)
  • STC15F204EA (BSL version: 6.7R)
  • STC15L104W (BSL version: 7.1Q)
  • IAP15F2K61S2 (BSL version: 7.1S)

More compatibility testing is going to happen soon.

Features

  • Display part info
  • Program flash memory
  • Program IAP/EEPROM
  • Set device options
  • Read unique device ID (STC 10/11/12/15)
  • Trim RC oscillator frequency (STC 15)

Installation

stcgal requires Python 3.2 (or later) and pySerial. Apart from that, no particular installation is required.

Usage

See stcgal.py -h for usage information.

Please note that stcgal only handles raw binary encoded files at this point. You can easily convert common Intel HEX files with objcopy -I ihex -O binary input.hex output.bin.

BSL Protocol

The text files in the doc/ subdirectory provide an overview over the reverse engineered protocols used by the BSLs. For more details, please read the source code.

License

stcgal is published under the MIT license.