McMCCRU / SNANDer

SNANDer - Serial Nor/nAND/Eeprom programmeR (based on CH341A)
GNU General Public License v2.0
243 stars 65 forks source link

'-a' flag will write to rest space of the whole chip by default. #24

Open ltrsunny opened 2 years ago

ltrsunny commented 2 years ago
PS D:\> .\SNANDer-Windows-64bit.exe -i

SNANDer - Serial Nor/nAND/Eeprom programmeR v.1.7.5 by McMCC <mcmcc@mail.ru>
Found programmer device: WinChipHead (WCH) - CH341A
Device revision is 3.0.4
spi_nand_probe: mfr_id = 0xef, dev_id = 0xaa, dev_id_2 = 0x21
Get Status Register 1: 0x7c
Get Status Register 2: 0x18
Using Flash ECC.
Detected SPI NAND Flash: WINBOND W25N01G, Flash Size: 128 MB
PS D:\> .\SNANDer-Windows-64bit.exe -e

SNANDer - Serial Nor/nAND/Eeprom programmeR v.1.7.5 by McMCC <mcmcc@mail.ru>

Found programmer device: WinChipHead (WCH) - CH341A
Device revision is 3.0.4
spi_nand_probe: mfr_id = 0xef, dev_id = 0xaa, dev_id_2 = 0x21
Get Status Register 1: 0x81
Get Status Register 2: 0x18
Using Flash ECC.
Detected SPI NAND Flash: WINBOND W25N01G, Flash Size: 128 MB
ERASE:
Set full erase chip!
Erase addr = 0x0000000000000000, len = 0x0000000008000000
Erase 100% [134217728] of [134217728] bytes
Elapsed time: 2 seconds
Status: OK
PS D:\> .\SNANDer-Windows-64bit.exe -w GCIS.bin

SNANDer - Serial Nor/nAND/Eeprom programmeR v.1.7.5 by McMCC <mcmcc@mail.ru>

Found programmer device: WinChipHead (WCH) - CH341A
Device revision is 3.0.4
spi_nand_probe: mfr_id = 0xef, dev_id = 0xaa, dev_id_2 = 0x21
Get Status Register 1: 0x81
Get Status Register 2: 0x18
Using Flash ECC.
Detected SPI NAND Flash: WINBOND W25N01G, Flash Size: 128 MB
WRITE:
Write addr = 0x0000000000000000, len = 0x0000000000000800
Written 100% [2048] of [2048] bytes
Elapsed time: 1 seconds
Status: OK
PS D:\> .\SNANDer-Windows-64bit.exe -w IPL.bin -a 0x140000

SNANDer - Serial Nor/nAND/Eeprom programmeR v.1.7.5 by McMCC <mcmcc@mail.ru>

Found programmer device: WinChipHead (WCH) - CH341A
Device revision is 3.0.4
spi_nand_probe: mfr_id = 0xef, dev_id = 0xaa, dev_id_2 = 0x21
Get Status Register 1: 0x81
Get Status Register 2: 0x18
Using Flash ECC.
Detected SPI NAND Flash: WINBOND W25N01G, Flash Size: 128 MB
WRITE:
Write addr = 0x0000000000140000, len = 0x0000000007EC0000
Written 1% [1609728] of [132907008] bytes

And there is no way to turn it off.

McMCCRU commented 2 years ago

Hi! You need to use the -l option if you don't want to write to rest space of the whole chip.

ltrsunny commented 2 years ago

Hi! You need to use the -l option if you don't want to write to rest space of the whole chip.

Thanks, it works!

Is there any easy method to get the filesize in Windows' cli(in *.bat) and pass it to -l option?