Open Source STC8G/STC8H ISP flash tool

Overview

stc8prog - STC MCU ISP flash tool

stc8prog is a command line flash programming tool for STC 8051 series microcontrollers, Currently, only STC8H/STC8G/STC8A8K64D4, STC15 (FWVER > 0x72) series are supported.

STC microcontrollers have an UART/USB based boot strap loader (BSL). It utilizes a packet-based protocol to flash the code memory and IAP memory over a serial link. This is referred to as in-system programming (ISP). This tool is built according to the ISP described in STC8H datasheet.

Tested MCU Types:

  • STC8A8K64S4A12
  • STC8A8K64D4
  • STC8G1K08A
  • STC8H1K08
  • STC8H3K32S2
  • STC8H3K64S4

How To Use

CLI Tool

Usage: stc8prog [options]...
  -h, --help            display this message
  -p, --port <device>   set device path
  -s, --speed <baud>    set download baudrate
  -f, --flash <file>    flash chip with data from hex file
  -e, --erase           erase the entire chip
  -d, --debug           enable debug output
  -v, --version         display version information

Baudrate options: 
   4800, 9600, 19200, 38400, 57600, 115200, 230400, 460800, 500000, 576000,
   921600, 1000000, 1152000, 1500000, 2000000, 2500000, 3000000, 3500000,
   4000000

Check

Communicate with MCU without changing anything. It will communicate in 2400 baud first, then switch to a higher baud for a second check

# 2400 baud -> 115200 baud
./stc8prog -p /dev/ttyUSB0

You can specify other baud with parameter -s

# 2400 baud -> 1152000 baud
./stc8prog -p /dev/ttyUSB0 -s 1152000

Erase Flash

This will erase the flash.

./stc8prog -p /dev/ttyUSB0 -e

Write Flash

Suggest to erase before writing flash

./stc8prog -p /dev/ttyUSB0 -e -f foo.hex

High baudrate will speed up the writing

./stc8prog -p /dev/ttyUSB0 -s 1152000 -e -f foo.hex

PlatformIO Integration

1. Add it to packages

By default PlatformIO places packages at /home/[username]/.platformio/packages, create a folder named tool-stc8prog under it, and place stc8prog executable under it.

2. Configurate platformio.ini

Create a new env in platformio.ini, it can be a clone of existing one, change the name and change upload_protocol option to custom, then configurate the rest accordingly, for example:

[env:stc8h3k32s2-stc8prog]
platform = intel_mcs51
board = stc8h3k32s2
upload_protocol = custom
upload_port = /dev/ttyUSB0
upload_flags =
    -p
    $UPLOAD_PORT
    -s
    1152000
    -e
upload_command = ${platformio.packages_dir}/tool-stc8prog/stc8prog $UPLOAD_FLAGS -f $SOURCE

If you want to make this env default, set it to default_envs

[platformio]
default_envs = stc8h3k32s2-stc8prog

For more options, please read platformio section_env_upload

3. First time upload

You can trigger upload with hotkey Ctrl+Alt+U.

If there are any erros and you want to see more detailed logs, run it in the verbose way:

  • Click PlatformIO icon in the left navigation panel
  • Expand [your env name] in PROJECT TASKS
  • Expand Advanced
  • Click Verbose Upload, this will output the full log of all commands

Build From Source

Install DEV-tools

sudo apt install build-essential

Checkout the project

git clone https://github.com/IOsetting/stc8prog.git

Compile the project

cd stc8prog
make
Comments
  • feat: extension of the --reset option to alternatively accept an exte…

    feat: extension of the --reset option to alternatively accept an exte…

    …rnal command to reset or power cycle the MCU

    The --reset option alternatively accepts an external command, which resets or power cycles the MCU, e.g.:

    stc8prog -p /dev/ttyUSB0 -r tools/koradctl /dev/ttyACM3 off-on \; -e -f obj/ledtest.ihx
    Loading hex file:    Loaded 363 bytes between: 0000 to 0171
    Opening port /dev/ttyUSB0: done
    Running reset command and waiting for MCU: detected
    MCU type: STC8G1K08A-8PIN
    Protocol: STC8G/8H
    F/W version: 7.3.12U
    IRC frequency(Hz): unadjusted
    Switching to 115200 baud, chip: set, host: set, ping: succ
    Erasing chip: succ
    Writing flash, size 370: 100.00% done
    

    The command must be terminated with a semicolon.

    For the above example I used a STC8G1K08A 8pin MCU on a breadboard powered by a Korad KD3005P lab power supply. The command "koradctl" is a very simple Python program:

    #!/usr/bin/python3
    # Very simple control script for Korad KD3005P Lab Power Supply
    
    import argparse
    import serial
    import time
    
    commands = ('ident', 'on', 'off', 'off-on')
    
    parser = argparse.ArgumentParser()
    parser.add_argument("port", help="serial device, e.g. /dev/ttyACM0")
    parser.add_argument("command", choices=commands, help="command to execute")
    args = parser.parse_args()
    
    with serial.Serial(args.port, timeout=1) as port:
        if args.command == 'ident':
            port.write(b'*IDN?')
            print(port.read(30).decode('ascii'))
        elif args.command == 'on':
            port.write(b'OUT1')
        elif args.command == 'off':
            port.write(b'OUT0')
        elif args.command == 'off-on':
            port.write(b'OUT0')
            time.sleep(1)
            port.write(b'OUT1')
    
    

    The new feature has only been tested on Linux.

    opened by nochtli 4
  • unsupported protocol: 0000 on STC15W204S

    unsupported protocol: 0000 on STC15W204S

    I'm probably doing something wrong, but I don't know what.

    System: Kernel: 5.4.0-120-generic x86_64 bits: 64 compiler: gcc v: 9.4.0 Desktop: Cinnamon 5.2.7 wm: muffin dm: LightDM Distro: Linux Mint 20.3 Una base: Ubuntu 20.04 focal Interface: genuine FTDI that works okay with other STC microcontrollers (and ATMEL chips, etc)

    ./stc8prog -p /dev/ttyUSB0 -d Opening port /dev/ttyUSB0: done Waiting for MCU, please cycle power: read 1 bytes: 0x46 | flag:1 read 4 bytes: 0xb9 | flag:2 0x68 | flag:3 0x00 | flag:4 0x34 | sum:009C, count:46, index:0 flag:5 read 3 bytes: 0x50 | sum:00EC, index:1, count:46 flag:5 0x8f | sum:017B, index:2, count:46 flag:5 0x43 | sum:01BE, index:3, count:46 flag:5 read 3 bytes: 0x7a | sum:0238, index:4, count:46 flag:5 0x9e | sum:02D6, index:5, count:46 flag:5 0xf7 | sum:03CD, index:6, count:46 flag:5 read 4 bytes: 0xba | sum:0487, index:7, count:46 flag:5 0x9f | sum:0526, index:8, count:46 flag:5 0x00 | sum:0526, index:9, count:46 flag:5 0x5b | sum:0581, index:10, count:46 flag:5 read 3 bytes: 0xa0 | sum:0621, index:11, count:46 flag:5 0x40 | sum:0661, index:12, count:46 flag:5 0xfd | sum:075E, index:13, count:46 flag:5 read 4 bytes: 0x27 | sum:0785, index:14, count:46 flag:5 0x46 | sum:07CB, index:15, count:46 flag:5 0x00 | sum:07CB, index:16, count:46 flag:5 0x00 | sum:07CB, index:17, count:46 flag:5 read 3 bytes: 0x72 | sum:083D, index:18, count:46 flag:5 0x54 | sum:0891, index:19, count:46 flag:5 0x00 | sum:0891, index:20, count:46 flag:5 read 4 bytes: 0xf5 | sum:0986, index:21, count:46 flag:5 0x14 | sum:099A, index:22, count:46 flag:5 0x05 | sum:099F, index:23, count:46 flag:5 0x06 | sum:09A5, index:24, count:46 flag:5 read 3 bytes: 0x70 | sum:0A15, index:25, count:46 flag:5 0x9e | sum:0AB3, index:26, count:46 flag:5 0x02 | sum:0AB5, index:27, count:46 flag:5 read 4 bytes: 0x1a | sum:0ACF, index:28, count:46 flag:5 0x20 | sum:0AEF, index:29, count:46 flag:5 0x21 | sum:0B10, index:30, count:46 flag:5 0x23 | sum:0B33, index:31, count:46 flag:5 read 3 bytes: 0x20 | sum:0B53, index:32, count:46 flag:5 0x00 | sum:0B53, index:33, count:46 flag:5 0x14 | sum:0B67, index:34, count:46 flag:5 read 4 bytes: 0x10 | sum:0B77, index:35, count:46 flag:5 0x04 | sum:0B7B, index:36, count:46 flag:5 0xea | sum:0C65, index:37, count:46 flag:5 0xec | sum:0D51, index:38, count:46 flag:5 read 3 bytes: 0x9e | sum:0DEF, index:39, count:46 flag:5 0xff | sum:0EEE, index:40, count:46 flag:5 0xff | sum:0FED, index:41, count:46 flag:5 read 4 bytes: 0xff | sum:10EC, index:42, count:46 flag:5 0x21 | sum:110D, index:43, count:46 flag:5 0x11 | sum:111E, index:44, count:46 flag:5 0x11 | sum:112F, index:45, count:46 flag:5 read 3 bytes: 0x11 | sum:1140, index:46, count:46 flag:6 0x11 | sum: 0x11 flag:7 0x40 | sum check: 0x40 flag:8 read 1 bytes: 0x16 | end byte reached flag:9 50 8F 43 7A 9E F7 BA 9F 00 5B A0 40 FD 27 46 00 00 72 54 00 F5 14 05 06 70 9E 02 1A 20 21 23 20 00 14 10 04 EA EC 9E FF FF FF 21 11 11 11 detected MCU type: STC15W204S Protocol: unsupported protocol: 0000

    opened by ceptimus 4
  • STC8G1K08A-8PIN 7.3.12U on MacOS: doesn't flash

    STC8G1K08A-8PIN 7.3.12U on MacOS: doesn't flash

    Even though macOS isn't supported, I was able to compile the binary using Linux termios.c dep.

    Testing on STC8G1K08A-8PIN was initially promising:

    ./stc8prog -p /dev/cu.usbserial-1440                                         
    Opening port /dev/cu.usbserial-1440: done
    Waiting for MCU, please cycle power: detected
    MCU type: STC8G1K08A-8PIN
    Protocol: STC8G/8H
    F/W version: 7.3.12U
    IRC frequency(Hz): 11061600
    Switching to 115200 baud, chip: set, host: set, ping: succ
    

    However, upon trying to flash an actual firmware, I stumbled upon this issue where the MCU just won't reply back:

    ./stc8prog -p /dev/cu.usbserial-1440 -d -f ../projects/blink/test.hex 
    Loading hex file:    Loaded 134 bytes between: 0000 to 0085
    02 00 06 02 00 6F 75 81 07 12 00 82 E5 82 60 03 02 00 03 79 00 E9 44 00 60 1B 7A 00 90 00 86 78 00 75 A0 00 E4 93 F2 A3 08 B8 00 02 05 A0 D9 F4 DA F2 75 A0 FF E4 78 FF F6 D8 FD 78 00 E8 44 00 60 0A 79 00 75 A0 00 E4 F3 09 D8 FC 78 00 E8 44 00 60 0C 79 00 90 00 00 E4 F0 A3 D8 FC D9 FA 02 00 03 7F 36 7E 0E 7D 1D DF FE DE FC DD FA 22 53 B1 F7 43 B2 08 B2 B3 12 00 62 12 00 62 12 00 62 80 F3 75 82 00 22 
    Opening port /dev/cu.usbserial-1440: done
    Waiting for MCU, please cycle power: .............................................................................................................................................................read 3 bytes:
    0x46 | flag:1
    0xb9 | flag:2
    0x68 | flag:3
    read 3 bytes:
    0x00 | flag:4
    0x38 | sum:00A0, count:50, index:0 flag:5
    0x50 | sum:00F0, index:1, count:50 flag:5
    read 3 bytes:
    0x00 | sum:00F0, index:2, count:50 flag:5
    0xa8 | sum:0198, index:3, count:50 flag:5
    0xc9 | sum:0261, index:4, count:50 flag:5
    read 3 bytes:
    0x60 | sum:02C1, index:5, count:50 flag:5
    0x99 | sum:035A, index:6, count:50 flag:5
    0x00 | sum:035A, index:7, count:50 flag:5
    read 2 bytes:
    0x02 | sum:035C, index:8, count:50 flag:5
    0xff | sum:045B, index:9, count:50 flag:5
    read 3 bytes:
    0xff | sum:055A, index:10, count:50 flag:5
    0xff | sum:0659, index:11, count:50 flag:5
    0xbf | sum:0718, index:12, count:50 flag:5
    read 2 bytes:
    0xff | sum:0817, index:13, count:50 flag:5
    0x26 | sum:083D, index:14, count:50 flag:5
    read 3 bytes:
    0xea | sum:0927, index:15, count:50 flag:5
    0xf7 | sum:0A1E, index:16, count:50 flag:5
    0x20 | sum:0A3E, index:17, count:50 flag:5
    read 2 bytes:
    0x73 | sum:0AB1, index:18, count:50 flag:5
    0x55 | sum:0B06, index:19, count:50 flag:5
    read 3 bytes:
    0x00 | sum:0B06, index:20, count:50 flag:5
    0xf7 | sum:0BFD, index:21, count:50 flag:5
    0x94 | sum:0C91, index:22, count:50 flag:5
    read 3 bytes:
    0x0c | sum:0C9D, index:23, count:50 flag:5
    0x8a | sum:0D27, index:24, count:50 flag:5
    0x16 | sum:0D3D, index:25, count:50 flag:5
    read 2 bytes:
    0x97 | sum:0DD4, index:26, count:50 flag:5
    0xbf | sum:0E93, index:27, count:50 flag:5
    read 3 bytes:
    0x10 | sum:0EA3, index:28, count:50 flag:5
    0x20 | sum:0EC3, index:29, count:50 flag:5
    0x20 | sum:0EE3, index:30, count:50 flag:5
    read 2 bytes:
    0xff | sum:0FE2, index:31, count:50 flag:5
    0x00 | sum:0FE2, index:32, count:50 flag:5
    read 2 bytes:
    0x30 | sum:1012, index:33, count:50 flag:5
    0x00 | sum:1012, index:34, count:50 flag:5
    read 3 bytes:
    0x20 | sum:1032, index:35, count:50 flag:5
    0x04 | sum:1036, index:36, count:50 flag:5
    0xa5 | sum:10DB, index:37, count:50 flag:5
    read 2 bytes:
    0x21 | sum:10FC, index:38, count:50 flag:5
    0x07 | sum:1103, index:39, count:50 flag:5
    read 3 bytes:
    0x02 | sum:1105, index:40, count:50 flag:5
    0x01 | sum:1106, index:41, count:50 flag:5
    0xff | sum:1205, index:42, count:50 flag:5
    read 2 bytes:
    0x65 | sum:126A, index:43, count:50 flag:5
    0x1c | sum:1286, index:44, count:50 flag:5
    read 3 bytes:
    0x43 | sum:12C9, index:45, count:50 flag:5
    0x6d | sum:1336, index:46, count:50 flag:5
    0x89 | sum:13BF, index:47, count:50 flag:5
    read 2 bytes:
    0xa2 | sum:1461, index:48, count:50 flag:5
    0xd0 | sum:1531, index:49, count:50 flag:5
    read 3 bytes:
    0xd0 | sum:1601, index:50, count:50 flag:6
    0x16 | sum: 0x16 flag:7
    0x01 | sum check: 0x01 flag:8
    read 1 bytes:
    0x16 | end byte reached flag:9
    50 00 A8 C9 60 99 00 02 FF FF FF BF FF 26 EA F7 20 73 55 00 F7 94 0C 8A 16 97 BF 10 20 20 FF 00 30 00 20 04 A5 21 07 02 01 FF 65 1C 43 6D 89 A2 D0 D0 
    detected
    MCU type: STC8G1K08A-8PIN
    Protocol: STC8G/8H
    F/W version: 7.3.12U
    IRC frequency(Hz): 11061600
    Switching to 115200 baud, chip: TX: 46 B9 6A 00 0E 01 60 40 FF CC 00 00 97 03 7B 16 
    ........read 1 bytes:
    0x46 | flag:1
    read 3 bytes:
    0xb9 | flag:2
    0x68 | flag:3
    0x00 | flag:4
    read 2 bytes:
    0x07 | sum:006F, count:1, index:0 flag:5
    0x01 | sum:0070, index:1, count:1 flag:6
    read 2 bytes:
    0x00 | sum: 0x00 flag:7
    0x70 | sum check: 0x70 flag:8
    read 1 bytes:
    0x16 | end byte reached flag:9
    01 
    set, host: set, ping: TX: 46 B9 6A 00 0B 05 00 00 5A A5 01 79 16 
    .read 9 bytes:
    0x46 | flag:1
    0xb9 | flag:2
    0x68 | flag:3
    0x00 | flag:4
    0x07 | sum:006F, count:1, index:0 flag:5
    0x05 | sum:0074, index:1, count:1 flag:6
    0x00 | sum: 0x00 flag:7
    0x74 | sum check: 0x74 flag:8
    0x16 | end byte reached flag:9
    05 
    succ
    Writing flash, size 134:   0.00%TX: 46 B9 6A 00 8B 22 00 00 5A A5 02 00 06 02 00 6F 75 81 07 12 00 82 E5 82 60 03 02 00 03 79 00 E9 44 00 60 1B 7A 00 90 00 86 78 00 75 A0 00 E4 93 F2 A3 08 B8 00 02 05 A0 D9 F4 DA F2 75 A0 FF E4 78 FF F6 D8 FD 78 00 E8 44 00 60 0A 79 00 75 A0 00 E4 F3 09 D8 FC 78 00 E8 44 00 60 0C 79 00 90 00 00 E4 F0 A3 D8 FC D9 FA 02 00 03 7F 36 7E 0E 7D 1D DF FE DE FC DD FA 22 53 B1 F7 43 B2 08 B2 B3 12 00 62 12 00 62 12 00 62 38 43 16 
    .read nothing
    .read nothing
    .read nothing
    .read nothing
    .read nothing
    .read nothing
    .read nothing
    .read nothing
    .read nothing
    .read nothing
    TX: 46 B9 6A 00 11 22 00 80 5A A5 80 F3 75 82 00 22 04 A8 16 
    .read nothing
    .read nothing
    .read nothing
    .read nothing
    .read nothing
    .read nothing
    .read nothing
    .read nothing
    .read nothing
    .read nothing
     done
    

    Additionally I tested the erase feature, which actually worked. I flashed a simple blinky via STC-ISP and after erasing it stopped executing, so I assume it actually erased the flash contents:

    ./stc8prog -p /dev/cu.usbserial-1440 -e -d 
    Opening port /dev/cu.usbserial-1440: done
    Waiting for MCU, please cycle power: ..........................................................................................read 1 bytes:
    0xff | flag:0
    ......................................................read 3 bytes:
    0x46 | flag:1
    0xb9 | flag:2
    0x68 | flag:3
    read 2 bytes:
    0x00 | flag:4
    0x38 | sum:00A0, count:50, index:0 flag:5
    read 3 bytes:
    0x50 | sum:00F0, index:1, count:50 flag:5
    0x00 | sum:00F0, index:2, count:50 flag:5
    0xa8 | sum:0198, index:3, count:50 flag:5
    read 2 bytes:
    0xc9 | sum:0261, index:4, count:50 flag:5
    0x60 | sum:02C1, index:5, count:50 flag:5
    read 2 bytes:
    0x99 | sum:035A, index:6, count:50 flag:5
    0x00 | sum:035A, index:7, count:50 flag:5
    read 3 bytes:
    0x02 | sum:035C, index:8, count:50 flag:5
    0xff | sum:045B, index:9, count:50 flag:5
    0xff | sum:055A, index:10, count:50 flag:5
    read 2 bytes:
    0xff | sum:0659, index:11, count:50 flag:5
    0xbf | sum:0718, index:12, count:50 flag:5
    read 3 bytes:
    0xff | sum:0817, index:13, count:50 flag:5
    0x26 | sum:083D, index:14, count:50 flag:5
    0xea | sum:0927, index:15, count:50 flag:5
    read 2 bytes:
    0xf7 | sum:0A1E, index:16, count:50 flag:5
    0x20 | sum:0A3E, index:17, count:50 flag:5
    read 2 bytes:
    0x73 | sum:0AB1, index:18, count:50 flag:5
    0x55 | sum:0B06, index:19, count:50 flag:5
    read 3 bytes:
    0x00 | sum:0B06, index:20, count:50 flag:5
    0xf7 | sum:0BFD, index:21, count:50 flag:5
    0x94 | sum:0C91, index:22, count:50 flag:5
    read 2 bytes:
    0x0c | sum:0C9D, index:23, count:50 flag:5
    0x8a | sum:0D27, index:24, count:50 flag:5
    read 3 bytes:
    0x16 | sum:0D3D, index:25, count:50 flag:5
    0x97 | sum:0DD4, index:26, count:50 flag:5
    0xbf | sum:0E93, index:27, count:50 flag:5
    read 3 bytes:
    0x10 | sum:0EA3, index:28, count:50 flag:5
    0x20 | sum:0EC3, index:29, count:50 flag:5
    0x20 | sum:0EE3, index:30, count:50 flag:5
    read 3 bytes:
    0xff | sum:0FE2, index:31, count:50 flag:5
    0x00 | sum:0FE2, index:32, count:50 flag:5
    0x30 | sum:1012, index:33, count:50 flag:5
    read 2 bytes:
    0x00 | sum:1012, index:34, count:50 flag:5
    0x20 | sum:1032, index:35, count:50 flag:5
    read 3 bytes:
    0x04 | sum:1036, index:36, count:50 flag:5
    0xa5 | sum:10DB, index:37, count:50 flag:5
    0x21 | sum:10FC, index:38, count:50 flag:5
    read 2 bytes:
    0x07 | sum:1103, index:39, count:50 flag:5
    0x02 | sum:1105, index:40, count:50 flag:5
    read 3 bytes:
    0x01 | sum:1106, index:41, count:50 flag:5
    0xff | sum:1205, index:42, count:50 flag:5
    0x65 | sum:126A, index:43, count:50 flag:5
    read 2 bytes:
    0x1c | sum:1286, index:44, count:50 flag:5
    0x43 | sum:12C9, index:45, count:50 flag:5
    read 2 bytes:
    0x6d | sum:1336, index:46, count:50 flag:5
    0x89 | sum:13BF, index:47, count:50 flag:5
    read 3 bytes:
    0xa2 | sum:1461, index:48, count:50 flag:5
    0xd0 | sum:1531, index:49, count:50 flag:5
    0xd0 | sum:1601, index:50, count:50 flag:6
    read 2 bytes:
    0x16 | sum: 0x16 flag:7
    0x01 | sum check: 0x01 flag:8
    read 1 bytes:
    0x16 | end byte reached flag:9
    50 00 A8 C9 60 99 00 02 FF FF FF BF FF 26 EA F7 20 73 55 00 F7 94 0C 8A 16 97 BF 10 20 20 FF 00 30 00 20 04 A5 21 07 02 01 FF 65 1C 43 6D 89 A2 D0 D0 
    detected
    MCU type: STC8G1K08A-8PIN
    Protocol: STC8G/8H
    F/W version: 7.3.12U
    IRC frequency(Hz): 11061600
    Switching to 115200 baud, chip: TX: 46 B9 6A 00 0E 01 60 40 FF CC 00 00 97 03 7B 16 
    ........read 2 bytes:
    0x46 | flag:1
    0xb9 | flag:2
    read 2 bytes:
    0x68 | flag:3
    0x00 | flag:4
    read 3 bytes:
    0x07 | sum:006F, count:1, index:0 flag:5
    0x01 | sum:0070, index:1, count:1 flag:6
    0x00 | sum: 0x00 flag:7
    read 2 bytes:
    0x70 | sum check: 0x70 flag:8
    0x16 | end byte reached flag:9
    01 
    set, host: set, ping: TX: 46 B9 6A 00 0B 05 00 00 5A A5 01 79 16 
    .read 9 bytes:
    0x46 | flag:1
    0xb9 | flag:2
    0x68 | flag:3
    0x00 | flag:4
    0x07 | sum:006F, count:1, index:0 flag:5
    0x05 | sum:0074, index:1, count:1 flag:6
    0x00 | sum: 0x00 flag:7
    0x74 | sum check: 0x74 flag:8
    0x16 | end byte reached flag:9
    05 
    succ
    Erasing chip: TX: 46 B9 6A 00 0B 03 00 00 5A A5 01 77 16 
    ...............read 16 bytes:
    0x46 | flag:1
    0xb9 | flag:2
    0x68 | flag:3
    0x00 | flag:4
    0x0e | sum:0076, count:8, index:0 flag:5
    0x03 | sum:0079, index:1, count:8 flag:5
    0xf7 | sum:0170, index:2, count:8 flag:5
    0x94 | sum:0204, index:3, count:8 flag:5
    0xc3 | sum:02C7, index:4, count:8 flag:5
    0xa9 | sum:0370, index:5, count:8 flag:5
    0x08 | sum:0378, index:6, count:8 flag:5
    0x27 | sum:039F, index:7, count:8 flag:5
    0xde | sum:047D, index:8, count:8 flag:6
    0x04 | sum: 0x04 flag:7
    0x7d | sum check: 0x7D flag:8
    0x16 | end byte reached flag:9
    03 F7 94 C3 A9 08 27 DE 
    succ
    

    I know it was never stated that this was supposed to work on macOS, but maybe it's not something macOS related or the problem is something really simple that we can easily fix. I can assist from my side in case you need any further details or help. Thanks!

    EDIT: I've also tried using different baudrates from 300 up to 115200, didn't help.

    opened by Darwinnn 3
  • build on macOS

    build on macOS

    The project builds perfectly with Linux termios serial dependency, however macOS' headers lack some of the predefined baudrates which I had to redefine in termios.c. Amended Makefile to make it aware of Darwin target OS. Added build instructions in README.md

    Tested on latest macOS 12.6 and STC8G1K08A-8PIN

    opened by Darwinnn 1
  • Windows support

    Windows support

    Now stc8prog could be compiled in Windows under Cygwin to work under Windows environment.

    For more reliable firmware uploading while reset option is applied, mcu resetting could be performed up to 3 times if no mcu has been detected in a given time.

    Project structure has changed - added folders with source.

    Changed Makefile to use system environment variables.

    opened by egan-ru 1
  • feat(reset): add possibility to reset the MCU before flashing by pull…

    feat(reset): add possibility to reset the MCU before flashing by pull…

    Most of usb-uart converters have dtr pin. It's can be used to reset the MCU before flashing to remove unnecessary physical operations. To make reset by dtr flag 'r' added.

    opened by egan-ru 1
  • how to use auto-download-schematics?

    how to use auto-download-schematics?

    hello i beginners for stc and i see document but, i have questions how to use auto-download-schematics?

    have device connect to usb port and connect mcu pin ?

    thankyou

    opened by Witawat 1
  • [Windows]Opening port COM16: can not open port

    [Windows]Opening port COM16: can not open port

    I compiled stc8prog with Cygwin64 but the software can not open the COM port on Windows. I tried both way and it doesn't work. The MinGW version that I managed to compile also doesn't connect.

    Tested on ARM-DAPLink and a genuine FT2232. Both of them don't work.

    Honoka@Honoka ~/stc8prog
    $ ./stc8prog.exe -p /dev/ttyS15
    Opening port /dev/ttyS15: can not open port
    
    Honoka@Honoka ~/stc8prog
    $ ./stc8prog.exe -p COM16
    Opening port COM16: can not open port
    
    opened by LovelyA72 1
  • Feat(firc calibration): feature request.

    Feat(firc calibration): feature request.

    feature

    [i]When using the download software provided by STC to download the user program, the system will automatically set the VRTRIM and IRTRIM registers according to the frequency set by the user.[/i] - stc8h datasheet, 7.4.4 Interpretation of high precision parameters in chip.

    possible solution

    Port the calibration routine from stcgal.

    opened by egan-ru 1
Releases(1.4)
Owner
IOsetting
Have fun!
IOsetting
This software brings you the possibility to Read and Write the internal Flash of the Nordic nRF52 series with an ESP32

ESP32 nRF52 SWD flasher This software brings you the possibility to Read and Write the internal Flash of the Nordic nRF52 series with an ESP32 using t

null 140 Dec 31, 2022
pre-built coreboot images and documentation on how to flash them for Thinkpad Laptops

Skulls - not quite Heads pre-built coreboot images with an easy installation process Skulls makes it easy to install an unlocked, up-to-date and easy

Martin Kepplinger 514 Jan 3, 2023
flashrom is a utility for detecting, reading, writing, verifying and erasing flash chips

flashrom is a utility for detecting, reading, writing, verifying and erasing flash chips

null 614 Dec 26, 2022
Flash-DBSim Simulation System

Flash-DBSim Simulation System Flash-DBSim is a simulation tool for evaluating Flash-based database algorithms used for flash-based researches, we'd li

Baroquer 1 Jan 18, 2022
This is a set of utilities that allow you to read, write or erase SPI flash chips using a Raspberry Pi Pico (RP2040) chip.

Pico SPI Utilities This is a set of utilities that allow you to read, write or erase SPI flash chips using a Raspberry Pi Pico (RP2040) chip. While th

Two Bean Development 2 Aug 7, 2022
Everdrive application for backup/restore XBAND SRAM & (Flash) ROM

XBAND Swiss Army knife (xband_sak) xband_sak is an Everdrive MD (including clones) RAM application for the Sega Mega Drive/Genesis with the following

null 4 Dec 13, 2022
Free,Open-Source,Cross-platform agent and Post-exploiton tool written in Golang and C++, the architecture and usage like Cobalt Strike

Khepri Free,Open-Source,Cross-platform agent and Post-exploiton tool written in Golang and C++ Description Khepri is a Cross-platform agent, the archi

Young 1.4k Jan 3, 2023
The FLIP Fluids addon is a tool that helps you set up, run, and render high quality liquid fluid effects all within Blender, the free and open source 3D creation suite.

FLIP Fluids The FLIP Fluids addon is a tool that helps you set up, run, and render liquid simulation effects. Our custom built fluid engine is based a

Ryan Guy 1.4k Dec 22, 2022
Open-source and open-hardware scientific RPN calculator

OpenRPNCalc Open-source and open-hardware scientific RPN calculator Introduction OpenRPNCalc is a scientific calculator based on STM32 microcontroller

Anton Poluektov 152 Dec 23, 2022
A fully-functional open source and open hardware mechanical USB computer keyboard with only three keys!

threeboard threeboard is a fully-functional open source and open hardware mechanical USB computer keyboard with only three keys. It supports multiple

Conor Taylor 98 Dec 9, 2022
Open Source Cheat for Apex Legends, designed for ease of use. Made to understand reversing of Apex Legends and respawn's modified source engine as well as their Easy Anti Cheat Implementation.

Apex-Legends-SDK Open Source Cheat for Apex Legends, designed for ease of use. Made to understand reversing of Apex Legends and respawn's modified sou

null 111 Jan 8, 2023
Sourcetrail - free and open-source interactive source explorer

Sourcetrail Important Note: This project was archived by the original autors and maintainers of Sourcetrail by the end of 2021. If you want to know mo

Coati Software 13.1k Jan 1, 2023
Single source file ASTC texture decompression in C++ (derived from Google's open source Android project)

astc_dec astc_dec is a single source file ASTC texture decompressor with the Apache 2.0 license, derived from Google's open source Android sources. Th

Rich Geldreich 29 Dec 5, 2022
6D - Pose Annotation Tool (6D-PAT) - is a tool that allows the user to load a set of images and also a set of 3D models and annotate where in the 2D image the 3D object ist placed.

6D - Pose Annotation Tool (6D-PAT) For detiled explanations checkout the WikiPage. What is it? With 6D-PAT you can create 6D annotations on images for

Florian Blume 71 Nov 20, 2022
Pyramid is a free, open GUI tool for offline shader validation and analysis

Pyramid is a free, open GUI tool for offline shader validation and analysis. The UI takes HLSL or GLSL as input, and runs them through various shader compilers and static analyzers.

null 277 Dec 20, 2022
Icopack - A simple command line tool to create multi-frame ICO files from PNG source images

Optidash is a modern, AI-powered image optimization and processing API. We will drastically speed-up your websites and save you money on bandwidth and

Optidash AI 61 Jul 27, 2022
First open source android modding library for Geometry Dash Based on Hooking-and-Patching-android-template

Android-ML First open source android modding library for Geometry Dash Based on Hooking-and-Patching-android-template Installation Download this githu

BlackTea ML 21 Jul 17, 2022
OpenTibiaBR - Canary Project is a free and open-source MMORPG server emulator written in C++.

OpenTibiaBR - Canary Project is a free and open-source MMORPG server emulator written in C++. It is a fork of the OTServBR-Global project. To connect to the server and to take a stable experience, you can use our own client or tibia client and if you want to edit something, check our customized tools.

OpenTibiaBR 104 Dec 28, 2022
DRAGEN open-source mapper

Dragmap Dragmap is the Dragen mapper/aligner Open Source Software. Installation Prerequisites Compilation was tested on CentOS 7 C++11 compatible comp

Illumina 115 Dec 14, 2022