SkillAgentSearch skills...

SNANDer

SNANDer - Serial Nor/nAND/Eeprom programmeR (based on CH341A)

Install / Use

/learn @Droid-MAX/SNANDer
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

SNANDer

SNANDer - Serial Nor/nAND/Eeprom programmeR (based on CH341A)

ch341a-nextProgrammer

Requirements

  • gcc/mingw-w64, wget, make, and libusb-1.0-dev (via apt Command Line Tools)

Compiling for Linux

After installing the gcc and necessary tools, building snander is as simple as running the command:

make -C src/

After successful compilation, the target executable file will be generated in src folder.

Or you can choose static compile, building snander statically is as simple as running the command:

./build-for-linux.sh

After successful compilation, the target executable file will be generated in the build folder.

Compiling for Windows

After installing the mingw-w64 and necessary tools, building snander is as simple as running the included script:

./build-for-windows.sh

After successful compilation, the target executable file will be generated in the build folder, include x86 and x64 binaries.

Compiling for MacOS

After installing the necessary tools, building snander is as simple as running the included script:

./build-for-darwin.sh

After successful compilation, the target executable file will be generated in the build folder.

Compiling for OpenWrt IPK

First download OpenWrt SDK and extract it

    cd /path/to/your/sdk
    git clone https://github.com/Droid-MAX/SNANDer package/snander
    make menuconfig # Choose `snander` in section `Utilities`
    make package/snander/compile V=s

Usage

Using snander is straightforward:

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

  Usage:
 -h             display this message
 -d             disable internal ECC(use read and write page size + OOB size)
 -o <bytes>     manual set OOB size with disable internal ECC(default 0)
 -I             ECC ignore errors(for read test only)
 -k             Skip BAD pages, try to read or write in next page
 -L             print list support chips
 -i             read the chip ID info
 -E             select I2C EEPROM {24c01|24c02|24c04|24c08|24c16|24c32|24c64|24c128|24c256|24c512|24c1024}
                select Microwire EEPROM {93c06|93c16|93c46|93c56|93c66|93c76|93c86|93c96} (need SPI-to-MW adapter)
                select SPI EEPROM 25xxx {25010|25020|25040|25080|25160|25320|25640|25128|25256|25512|251024}
 -8             set organization 8-bit for Microwire EEPROM(default 16-bit) and set jumper on SPI-to-MW adapter
 -f <addr len>  set manual address size in bits for Microwire EEPROM(default auto)
 -s <bytes>     set page size from datasheet for fast write SPI EEPROM(default not use)
 -e             erase chip(full or use with -a [-l])
 -l <bytes>     manually set length
 -a <address>   manually set address
 -w <filename>  write chip with data from filename
 -r <filename>  read chip and save data to filename
 -v             verify after write on chip

For example:

  1. Get Flash info.
$ ./SNANDer -i

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

Found programmer device: WinChipHead (WCH) - CH341A
Device revision is 3.0.4
spi device id: ff c2 22 c2 22 (c222c222)
SPI NOR Flash Not Detected!
spi_nand_probe: mfr_id = 0xc2, dev_id = 0x22
Get Status Register 1: 0x38
Get Status Register 2: 0x10
Using Flash ECC.
Detected SPI NAND Flash: MXIC MX35LF2GE4AB, Flash Size: 256 MB
$
  1. Full erase flash with disable internal ECC check. Without OOB, page size 2112 bytes.
$ ./SNANDer -d -e

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

Found programmer device: WinChipHead (WCH) - CH341A
Device revision is 3.0.4
spi device id: ff c2 22 c2 22 (c222c222)
SPI NOR Flash Not Detected!
spi_nand_probe: mfr_id = 0xc2, dev_id = 0x22
Get Status Register 1: 0x00
Get Status Register 2: 0x11
Disable Flash ECC.
Detected SPI NAND Flash: MXIC MX35LF2GE4AB, Flash Size: 256 MB
ERASE:
Set full erase chip!
Erase addr = 0x0000000000000000, len = 0x0000000010800000
Erase 100% [276824064] of [276824064] bytes
Elapsed time: 3 seconds
Status: OK
$
  1. Write and verify flash with disable internal ECC check. Without OOB, page size 2112 bytes.
$ ./SNANDer -d -v -w ecc_2Gb_2K_64_flashimage_rfb1_ac2600.bin

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

Found programmer device: WinChipHead (WCH) - CH341A
Device revision is 3.0.4
spi device id: ff c2 22 c2 22 (c222c222)
SPI NOR Flash Not Detected!
spi_nand_probe: mfr_id = 0xc2, dev_id = 0x22
Get Status Register 1: 0x00
Get Status Register 2: 0x11
Disable Flash ECC.
Detected SPI NAND Flash: MXIC MX35LF2GE4AB, Flash Size: 256 MB
WRITE:
Write addr = 0x0000000000000000, len = 0x000000000E5A9D6F
Written 100% [240819567] of [240819567] bytes
Elapsed time: 4184 seconds
Status: OK
VERIFY:
Read addr = 0x0000000000000000, len = 0x000000000E5A9D6F
Read 100% [240819567] of [240819567] bytes
Elapsed time: 2047 seconds
Status: OK
$
  1. Read Microwire EEPROM Atmel 93C46 and save file.
$ ./SNANDer -E 93c46 -r test.bin

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

Found programmer device: WinChipHead (WCH) - CH341A
Device revision is 3.0.4
Microwire EEPROM chip: 93c46, Size: 64 bytes, Org: 16 bits, fix addr len: Auto
READ:
Read addr = 0x0000000000000000, len = 0x0000000000000080
Read_EEPROM_3wire: Set address len 6 bits
Read 100% [64] of [64] bytes
Read [128] bytes from [93c46] EEPROM address 0x00000000
Elapsed time: 0 seconds
Status: OK
  1. Write and verify Microwire EEPROM Atmel 93C46 from file.
$ ./SNANDer -E 93c46 -w test.bin -v

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

Found programmer device: WinChipHead (WCH) - CH341A
Device revision is 3.0.4
Microwire EEPROM chip: 93c46, Size: 64 bytes, Org: 16 bits, fix addr len: Auto
WRITE:
Write addr = 0x0000000000000000, len = 0x0000000000000080
Erase_EEPROM_3wire: Set address len 6 bits
Write_EEPROM_3wire: Set address len 6 bits
Written 100% [64] of [64] bytes
Wrote [128] bytes to [93c46] EEPROM address 0x00000000
Elapsed time: 1 seconds
Status: OK
VERIFY:
Read addr = 0x0000000000000000, len = 0x0000000000000080
Read_EEPROM_3wire: Set address len 6 bits
Read 100% [64] of [64] bytes
Read [128] bytes from [93c46] EEPROM address 0x00000000
Elapsed time: 1 seconds
Status: OK
  1. Write and verify SPI EEPROM Atmel AT25640B from file.
$ ./SNANDer -E 25640 -v -w test.bin

SNANDer - Serial Nor/nAND/Eeprom programmeR v.1.7.9 by McMCC <mcmcc_at_mail.ru>

Found programmer device: WinChipHead (WCH) - CH341A
Device revision is 3.0.4
SPI EEPROM chip: 25640, Size: 8192 bytes
WRITE:
Written addr = 0x0000000000000000, len = 0x0000000000002000
Wrote 100% [8192] bytes to [25640] EEPROM address 0x00000000
Elapsed time: 22 seconds
Status: OK
VERIFY:
Read addr = 0x0000000000000000, len = 0x0000000000002000
Read 100% [8192] bytes from [25640] EEPROM address 0x00000000
Elapsed time: 2 seconds
Status: OK
  1. Fast write and verify SPI EEPROM Atmel AT25640B from file with use page size. (Find out page size from datasheet on chip!!!)
$ ./SNANDer -E 25640 -v -w test.bin -s 32

SNANDer - Serial Nor/nAND/Eeprom programmeR v.1.7.9 by McMCC <mcmcc_at_mail.ru>

Found programmer device: WinChipHead (WCH) - CH341A
Device revision is 3.0.4
SPI EEPROM chip: 25640, Size: 8192 bytes
Setting page size 32B for write.
WRITE:
Write addr = 0x0000000000000000, len = 0x0000000000002000
Written 100% [8192] bytes to [25640] EEPROM address 0x00000000
Elapsed time: 1 seconds
Status: OK
VERIFY:
Read addr = 0x0000000000000000, len = 0x0000000000002000
Read 100% [8192] bytes from [25640] EEPROM address 0x00000000
Elapsed time: 2 seconds
Status: OK

Supported Chips

SPI NAND Flash Support List:
001. GIGADEVICE GD5F1GQ4UA
002. GIGADEVICE GD5F2GQ4UA
003. GIGADEVICE GD5F1GQ4UB
004. GIGADEVICE GD5F1GQ4RE
005. GIGADEVICE GD5F1GQ4UC
006. GIGADEVICE GD5F1GQ4UE
007. GIGADEVICE GD5F1GQ5UE
008. GIGADEVICE GD5F1GQ5RE
009. GIGADEVICE GD5F2GQ5UE
010. GIGADEVICE GD5F2GQ5RE
011. GIGADEVICE GD5F1GM7UE
012. GIGADEVICE GD5F1GM7RE
013. GIGADEVICE GD5F2GM7UE
014. GIGADEVICE GD5F2GM7RE
015. GIGADEVICE GD5F2GQ4UB
016. GIGADEVICE GD5F2GQ4UE
017. GIGADEVICE GD5F2GQ4UC
018. GIGADEVICE GD5F4GQ4UB
019. GIGADEVICE GD5F4GQ4UC
020. ESMT F50D1G41LB(2M)
021. ESMT F50L512
022. ESMT F50L1G
023. ESMT F50L1G41LB
024. ESMT F50L2G41LB
025. WINBOND W25N01KV
026. WINBOND W25N01KW
027. WINBOND W25N01GV
028. WINBOND W25N01GW
029. WINBOND W25N02KV
030. WINBOND W25N04KV
031. WINBOND W25N04KW
032. WINBOND W25M02GV
033. MXIC MX35LF1GE4AB
034. MXIC MX35LF2GE4AB
035. MXIC MX35LF2G14AC
036. MXIC MX35UF1G14AC
037. MXIC MX35UF2G14AC
038. MXIC MX35LF2GE4AD
039. MXIC MX35LF1G24AD
040. MXIC MX35LF2G24AD
041. MXIC MX35LF4G24AD
042. MXIC MX35LF2G24AD-Z4I8
043. MXIC MX35LF4G24AD-Z4I8
044. MXIC MX35UF1GE4AD
045. MXIC MX35UF2GE4AD
046. MXIC MX35UF4GE4AD
047. ZENTEL A5U12A21ASC
048. ZENTEL A5U1GA21BWS
049. ETRON EM73C044SNB
050. ETRON EM73C044SND
051. ETRON EM73C044SNF
052. ETRON EM73C044VCA
053. ETRON EM73C044VCD
054. ETRON EM73D044VCA
055. ETRON EM73D044VCB
056. ETRON EM73D044VCD
057. ETRON EM73D044VCG
058. ETRON EM73D044VCH
059. ETRON EM73D044SNA
060. ETRON EM73D044SNC
061. ETRON EM73D044SND
062. ETRON EM73D044SNF
063. ETRON EM73E044SNA
064. TOSHIBA TC58CVG0S3H
065. KIOXIA TC58CVG0S3HRAIJ
066. TOSHIBA TC58CVG1S3H
067. TOSHIBA TC58CVG2S0H
068. KIOXIA TC58CVG2S0HRAIJ
069. MICRON MT29F1G01AA
070. MICRON MT29F2G01AA
071. MICRON MT29F4G01AA
072. MICRON MT29F1G01AB
073. MICRON MT29F2G01ABA
074. MICRON MT29F2G01ABB
075. MICRON MT29F4G01ABA
076. MICRON MT29F4G01ABB
077. MICRON MT29F4G01AD
078. HEYANG HYF1GQ4UAACAE
079. HEYANG HYF2GQ4UAACAE
080. HEYANG HYF2GQ4UHCCAE
081. HEYANG HYF1GQ4UDACAE
082. HEYANG HYF2GQ4UDACAE
083. HEYANG HYF1GQ4UTACAE
084. HEYANG HYF2GQ4UTACAE
085. PN PN26G01A-X
086. PN PN26G02A-X
087. PN PN26Q01A-X
088. ATO ATO25D1GA
089. ATO ATO25D2GA
090. ATO ATO25D2GB
091. FM FM25S01
092. FM FM2

Related Skills

View on GitHub
GitHub Stars202
CategoryDevelopment
Updated1d ago
Forks66

Languages

C

Security Score

95/100

Audited on Mar 27, 2026

No findings