微處理器 - STMicroelectronics STM8S001 - 解決stm8flash ... Tries exceeded問題



Workaround(一次unlock後,執行兩次flash即可燒錄成功),如果是unlock都失敗,那此顆IC無用武之地

all:
    sdasstm8 -o main.s
    sdldstm8 -ni -b home=0x8000 -b cseg=0x8080 -b data=0x0001 -b sseg=0xffff main.rel

unlock:
    sudo stm8flash -c stlinkv2 -p stm8s001j3 -u

flash:
    sudo stm8flash -c stlinkv2 -p stm8s001j3 -w main.ihx

clean:
    rm -rf main.rel main.ihx