diff --git a/doc/dump-mcu.py b/doc/dump-mcu.py index b17e281..9131acf 100644 --- a/doc/dump-mcu.py +++ b/doc/dump-mcu.py @@ -1,13 +1,13 @@ #!/usr/bin/env python3 # This curious script dumps all model info from STC-ISP. # Data is directly read from the binary. -# Offsets are for stc-isp-15xx-v6.85K.exe, sha1sum aa66e4c1ab49de27369b83c954a7c202acce0950 +# Offsets are for stc-isp-15xx-v6.86O.exe, sha1sum f70e317d758ef8c942613a8b0540147d7170589b -MCU_TABLE_OFFSET = 0x00064550 -MCU_TABLE_SIZE = 941 +MCU_TABLE_OFFSET = 0x0006ac80 +MCU_TABLE_SIZE = 984 MCU_RECORD_SIZE = 32 -MCU_NAMES_OFFSET = 0x0007e80c -MCU_NAMES_PTR_OFFSET = 0x0047e80c +MCU_NAMES_OFFSET = 0x00087810 +MCU_NAMES_PTR_OFFSET = 0x00487810 import struct import sys diff --git a/stcgal/models.py b/stcgal/models.py index 51dc475..e7eba31 100644 --- a/stcgal/models.py +++ b/stcgal/models.py @@ -32,14 +32,26 @@ class MCUModelDatabase: MCUModel = collections.namedtuple("MCUModel", ["name", "magic", "total", "code", "eeprom"]) models = ( - MCUModel(name='STC8F8K08S4A10', magic=0xf611, total=65536, code=8192, eeprom=57344), - MCUModel(name='STC8F8K16S4A10', magic=0xf612, total=65536, code=16384, eeprom=49152), - MCUModel(name='STC8F8K24S4A10', magic=0xf613, total=65536, code=24576, eeprom=40960), - MCUModel(name='STC8F8K32S4A10', magic=0xf614, total=65536, code=32768, eeprom=32768), - MCUModel(name='STC8F8K40S4A10', magic=0xf615, total=65536, code=40960, eeprom=24576), - MCUModel(name='STC8F8K48S4A10', magic=0xf616, total=65536, code=49152, eeprom=16384), - MCUModel(name='STC8F8K56S4A10', magic=0xf617, total=65536, code=57344, eeprom=8192), - MCUModel(name='STC8F8K64S4A10', magic=0xf618, total=65536, code=65024, eeprom=512), + MCUModel(name='STC8F1K02S2', magic=0xf661, total=20480, code=2048, eeprom=10240), + MCUModel(name='STC8F1K04S2', magic=0xf662, total=20480, code=4096, eeprom=8192), + MCUModel(name='STC8F1K06S2', magic=0xf663, total=20480, code=6144, eeprom=6144), + MCUModel(name='STC8F1K08S2', magic=0xf664, total=20480, code=8192, eeprom=4096), + MCUModel(name='STC8F1K10S2', magic=0xf665, total=20480, code=10240, eeprom=2048), + MCUModel(name='STC8F1K12S2', magic=0xf666, total=20480, code=12288, eeprom=0), + MCUModel(name='STC8F1K17S2', magic=0xf667, total=20480, code=17408, eeprom=0), + MCUModel(name='STC8F1K02', magic=0xf671, total=20480, code=2048, eeprom=10240), + MCUModel(name='STC8F1K04', magic=0xf672, total=20480, code=4096, eeprom=8192), + MCUModel(name='STC8F1K06', magic=0xf673, total=20480, code=6144, eeprom=6144), + MCUModel(name='STC8F1K08', magic=0xf674, total=20480, code=8192, eeprom=4096), + MCUModel(name='STC8F1K10', magic=0xf675, total=20480, code=10240, eeprom=2048), + MCUModel(name='STC8F1K12', magic=0xf676, total=20480, code=12288, eeprom=0), + MCUModel(name='STC8F1K17', magic=0xf677, total=20480, code=17408, eeprom=0), + MCUModel(name='STC15U4K16S4', magic=0xf580, total=65536, code=16384, eeprom=44032), + MCUModel(name='STC15U4K24S4', magic=0xf581, total=65536, code=24576, eeprom=35840), + MCUModel(name='STC15U4K32S4', magic=0xf582, total=65536, code=32768, eeprom=27648), + MCUModel(name='STC15U4K40S4', magic=0xf583, total=65536, code=40960, eeprom=19456), + MCUModel(name='STC15U4K48S4', magic=0xf584, total=65536, code=49152, eeprom=11264), + MCUModel(name='STC15U4K56S4', magic=0xf585, total=65536, code=57344, eeprom=3072), MCUModel(name='STC8A8K08S4A12', magic=0xf621, total=65536, code=8192, eeprom=57344), MCUModel(name='STC8A8K16S4A12', magic=0xf622, total=65536, code=16384, eeprom=49152), MCUModel(name='STC8A8K24S4A12', magic=0xf623, total=65536, code=24576, eeprom=40960), @@ -47,7 +59,26 @@ class MCUModelDatabase: MCUModel(name='STC8A8K40S4A12', magic=0xf625, total=65536, code=40960, eeprom=24576), MCUModel(name='STC8A8K48S4A12', magic=0xf626, total=65536, code=49152, eeprom=16384), MCUModel(name='STC8A8K56S4A12', magic=0xf627, total=65536, code=57344, eeprom=8192), + MCUModel(name='STC8A8K60S4A12', magic=0xf629, total=65536, code=61440, eeprom=4096), MCUModel(name='STC8A8K64S4A12', magic=0xf628, total=65536, code=65024, eeprom=512), + MCUModel(name='STC8A4K08S2A12', magic=0xf651, total=65536, code=8192, eeprom=57344), + MCUModel(name='STC8A4K16S2A12', magic=0xf652, total=65536, code=16384, eeprom=49152), + MCUModel(name='STC8A4K24S2A12', magic=0xf653, total=65536, code=24576, eeprom=40960), + MCUModel(name='STC8A4K32S2A12', magic=0xf654, total=65536, code=32768, eeprom=32768), + MCUModel(name='STC8A4K40S2A12', magic=0xf655, total=65536, code=40960, eeprom=24576), + MCUModel(name='STC8A4K48S2A12', magic=0xf656, total=65536, code=49152, eeprom=16384), + MCUModel(name='STC8A4K56S2A12', magic=0xf657, total=65536, code=57344, eeprom=8192), + MCUModel(name='STC8A4K60S2A12', magic=0xf659, total=65536, code=61440, eeprom=4096), + MCUModel(name='STC8A4K64S2A12', magic=0xf658, total=65536, code=65024, eeprom=512), + MCUModel(name='STC8F8K08S4A12', magic=0xf611, total=65536, code=8192, eeprom=57344), + MCUModel(name='STC8F8K16S4A12', magic=0xf612, total=65536, code=16384, eeprom=49152), + MCUModel(name='STC8F8K24S4A12', magic=0xf613, total=65536, code=24576, eeprom=40960), + MCUModel(name='STC8F8K32S4A12', magic=0xf614, total=65536, code=32768, eeprom=32768), + MCUModel(name='STC8F8K40S4A12', magic=0xf615, total=65536, code=40960, eeprom=24576), + MCUModel(name='STC8F8K48S4A12', magic=0xf616, total=65536, code=49152, eeprom=16384), + MCUModel(name='STC8F8K56S4A12', magic=0xf617, total=65536, code=57344, eeprom=8192), + MCUModel(name='STC8F8K60S4A12', magic=0xf619, total=65536, code=61440, eeprom=4096), + MCUModel(name='STC8F8K64S4A12', magic=0xf618, total=65536, code=65024, eeprom=512), MCUModel(name='STC8F2K08S4', magic=0xf631, total=65536, code=8192, eeprom=57344), MCUModel(name='STC8F2K16S4', magic=0xf632, total=65536, code=16384, eeprom=49152), MCUModel(name='STC8F2K24S4', magic=0xf633, total=65536, code=24576, eeprom=40960), @@ -55,7 +86,17 @@ class MCUModelDatabase: MCUModel(name='STC8F2K40S4', magic=0xf635, total=65536, code=40960, eeprom=24576), MCUModel(name='STC8F2K48S4', magic=0xf636, total=65536, code=49152, eeprom=16384), MCUModel(name='STC8F2K56S4', magic=0xf637, total=65536, code=57344, eeprom=8192), + MCUModel(name='STC8F2K60S4', magic=0xf639, total=65536, code=61440, eeprom=4096), MCUModel(name='STC8F2K64S4', magic=0xf638, total=65536, code=65024, eeprom=512), + MCUModel(name='STC8F2K08S2', magic=0xf641, total=65536, code=8192, eeprom=57344), + MCUModel(name='STC8F2K16S2', magic=0xf642, total=65536, code=16384, eeprom=49152), + MCUModel(name='STC8F2K24S2', magic=0xf643, total=65536, code=24576, eeprom=40960), + MCUModel(name='STC8F2K32S2', magic=0xf644, total=65536, code=32768, eeprom=32768), + MCUModel(name='STC8F2K40S2', magic=0xf645, total=65536, code=40960, eeprom=24576), + MCUModel(name='STC8F2K48S2', magic=0xf646, total=65536, code=49152, eeprom=16384), + MCUModel(name='STC8F2K56S2', magic=0xf647, total=65536, code=57344, eeprom=8192), + MCUModel(name='STC8F2K60S2', magic=0xf649, total=65536, code=61440, eeprom=4096), + MCUModel(name='STC8F2K64S2', magic=0xf648, total=65536, code=65024, eeprom=512), MCUModel(name='STC15H4K08S4', magic=0xf601, total=65536, code=8192, eeprom=57344), MCUModel(name='STC15H4K16S4', magic=0xf602, total=65536, code=16384, eeprom=49152), MCUModel(name='STC15H4K24S4', magic=0xf603, total=65536, code=24576, eeprom=40960), @@ -222,6 +263,7 @@ class MCUModelDatabase: MCUModel(name='STC15W412S', magic=0xf51c, total=16384, code=12288, eeprom=1024), MCUModel(name='IAP15W413S', magic=0xf55d, total=16384, code=13312, eeprom=0), MCUModel(name='IRC15W415S', magic=0xf55e, total=16384, code=15872, eeprom=0), + MCUModel(name='JX15W415S', magic=0xf55f, total=16384, code=15872, eeprom=0), MCUModel(name='STC15W401AS', magic=0xf52a, total=16384, code=1024, eeprom=12288), MCUModel(name='STC15W402AS', magic=0xf52b, total=16384, code=2048, eeprom=11264), MCUModel(name='STC15W404AS', magic=0xf51e, total=16384, code=4096, eeprom=9216), @@ -247,6 +289,7 @@ class MCUModelDatabase: MCUModel(name='STC15W4K48S4', magic=0xf527, total=65536, code=49152, eeprom=11264), MCUModel(name='STC15W4K56S4', magic=0xf528, total=65536, code=57344, eeprom=3072), MCUModel(name='IAP15W4K58S4', magic=0xf569, total=65536, code=59392, eeprom=0), + MCUModel(name='IAP15W4K58S4-Stu', magic=0xf56d, total=65536, code=59392, eeprom=0), MCUModel(name='IAP15W4K61S4', magic=0xf56a, total=65536, code=62464, eeprom=0), MCUModel(name='IRC15W4K63S4', magic=0xf56b, total=65536, code=65024, eeprom=0), MCUModel(name='U8W', magic=0xf56c, total=65536, code=62464, eeprom=0), @@ -975,6 +1018,7 @@ class MCUModelDatabase: MCUModel(name='STC90LE516AD', magic=0xf190, total=65536, code=63488, eeprom=0), # Warning, these definitions lack a valid eeprom size. + # XXX: It's unknown whether these actually exist, they were removed in STC-ISP. MCUModel(name='STC15F04AD', magic=0xd444, total=4096, code=4096, eeprom=0), MCUModel(name='STC15F06AD', magic=0xd446, total=6144, code=6144, eeprom=0), MCUModel(name='STC15F08AD', magic=0xd448, total=8192, code=8192, eeprom=0),