Documentation for “Zerocat Chipflasher” as of Sat, 29 Mar 2025 14:42:10 +0100
Repository:
Version: v2.1.6-0-c57b46eb4
Branch: master
Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2016 Parallax Inc. DBA Parallax Semiconductor. Version 1.00.78 Compiling... ../../firmware2/src/SPIflash.spin |-ASCII.spin |-blocksizes.spin Done. Program size is 4220 bytes ______________________________________________________________________________ ********************************************************* File starts here *** Zerocat Chipflasher --- Flash free firmware, kick the Management Engine. Copyright (C) 2020, 2021, 2022, 2024, 2025 Kai Mertens File SPIflash.spin --- Provide flags, commands, methods to access selected SPI flash chips. This file is part of Zerocat Chipflasher. See end of file for terms of use. ****************************************************************************** # Interface Description Object "../../firmware2/src/SPIflash" Interface: PUB init PUB set_record(n) PUB get_record : PUB inc : PUB dec : PUB get_ID : PUB get_MID : PUB id2record(testid) : PUB CE : PUB iscommand(cmdnum) : PUB isvolatile : PUB iswritable(ireg) : PUB isotp(ireg) : PUB isinfo(ireg) : PUB get_size : PUB isstatic(ireg) : PUB ptr_bitnames(ireg) : PUB ptr_names : PUB protection_sectors : PUB digits : Program: 1051 Longs Variable: 1 Longs # Loaded Objects # Constants ## SPI Command Set -- Flag Numbers (0..31) in second LONG * Status Register Commands * Read Commands * Program and Erase Commands * Protection Commands * NOP Flag * Power and Identification Commands * SPI Command Set0 -- Basic Flag Register Template Atmel AT26DF Family does not provide XAB_RES and X90_REMS! ## SPI Command Set, extended -- Flag Numbers (32..63) in first LONG * Status Register Commands * Security on Macronix (MXIC) * Security on Winbond * Sector Protection on Atmel AT26DF Family * Misc ## SPI Command Bytes, as collected across multiple datasheets * Basic Command Bytes, understood by all SPI flash chips * Basic Command Bytes, understood by modern SPI flash chips * SPI Command Byte 'Read JEDEC Device ID' * SPI Command Bytes, found on Microchip SST25VF016B * SPI Command Bytes, found on Macronix chips (MXIC) * SPI Command Bytes, found on Atmel AT26DFxxx and ATmel AT25DFxxx * SPI Command Bytes, found on Winbond W25Q-types ## SPI Flash Database * Number of records in the chip database * Last record in the chip database (which must provide empty data) * Record string sizes in bytes * Size of record in bytes * Record offsets in bytes * Horizontal Tab * Not Applicable, N_A, (TRUE) ## JEDEC_IDs * Manufacturer IDs ... * Chips with static status register ... * Chips with volatile status register ... # Globals * Active Record # Functions _________ PUB init Initialize memory. __________________ PUB set_record(n) Set active record number. __________________ PUB get_record : Get active record number. ___________ PUB inc : Increase record. Return 0 if last record. ___________ PUB dec : Decrease record. Cycle back to last record. ______________ PUB get_ID : Return JEDEC_ID of active record. _______________ PUB get_MID : Return manufacturer ID of active record. Return 0 if last record. _________________________ PUB id2record(testid) : Lookup record for a given ID. __________ PUB CE : Query CE command in respect to chip's capabilities, return N_A (TRUE) if no erase command is available. _________________________ PUB iscommand(cmdnum) : Check whether cmdnum is set in command set of current record. Return TRUE or FALSE. Return FALSE for last record. __________________ PUB isvolatile : Return >is_volatile< register information for specified record. Return FALSE for last record. ________________________ PUB iswritable(ireg) : Return >is_writable< register bit information for specified record. Return FALSE for last record. ___________________ PUB isotp(ireg) : Return >is_otp< register bit information for specified record. Return FALSE for last record. ____________________ PUB isinfo(ireg) : Return >is_info< register bit information for specified record. Return FALSE for last record. ________________ PUB get_size : Return size of the chip of the specified record. Return N_A (TRUE) for last record. ______________________ PUB isstatic(ireg) : Return >is_static< register bit information for the specified record. Return 1 for last record, avoid >is_volatile< condition at start of program. __________________________ PUB ptr_bitnames(ireg) : Return pointer to start of indexed bitnames string for the specified record. Return NULL pointer for last record. _________________ PUB ptr_names : Return pointer to start of names string for the specified record. Return NULL pointer for last record. __________________________ PUB protection_sectors : Return maximal number of protection sectors, or N_A (TRUE) if not applicable. Return 0 for last record. SPI flash AT26DF081A is not exactly supported. ______________ PUB digits : Return number of digits in respect to chip size for specified record. Return 0 for last record. # Data: Struct CHIPSPEC, Collection of Chips * CHIPSPEC Member Description * CHIPSPEC Related Constants (See CON Block) * CHIPSPEC Access Examples * CHIPSPEC Record Template * CHIPSPEC Records (20) - Rec#0: EN25QH32 - Rec#1: EN25QH64 - Rec#2: MX25L8005 (MX25L8006E) - Rec#3: MX25L1605D (MX25L1606E) - Rec#4: MX25L3205D (MX25L3206E) - Rec#5: MX25L6405D (MX25L6406E, MX25L6445E) - Rec#6: MX25L12835E - Rec#7: W25X40 - Rec#8: W25X64 - Rec#9: W25Q16.V - Rec#10: W25Q32.V - Rec#11: W25Q64.V - Rec#12: W25Q128.V - Rec#13: AT26DF161 - Rec#14: AT26DF321 - Rec#15: AT25DF641 - Rec#16: SST25VF080B - Rec#17: SST25VF016B - Rec#18: Unspecified Chip - Rec#19: Last Record ****************************************************************************** Terms of Use: Zerocat Chipflasher is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Zerocat Chipflasher is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Zerocat Chipflasher. If not, see <http://www.gnu.org/licenses/>. ************************************************************** End of File ***