Skip to content

Commit

Permalink
Flash: cmdlen constructor arg renamed cmd5.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterhinch committed Jun 10, 2020
1 parent e8a29df commit 55f62ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions flash/FLASH.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@ Arguments. In most cases only the first two mandatory args are required:
5. `sec_size=4096` Chip sector size.
6. `block_size=9` The block size reported to the filesystem. The size in bytes
is `2**block_size` so is 512 bytes by default.
7. `cmdset=None` Flash chips can support two low level command sets, an old 4
7. `cmd5=None` Flash chips can support two low level command sets, an old 4
byte set and a newer 5 byte set capable of supporting a larger address
space. By default if the size read from the chip's ID is <= 4096KiB the 4 byte
set is used oterwise the 5 byte set is adopted. This works for supported
chips. Setting `cmdset` `True` forces 5 byte commands, `False` forces 4 byte.
chips. Setting `cmd5` `True` forces 5 byte commands, `False` forces 4 byte.
This override is necessary for certain chip types (e.g. WinBond W25Q64FV).

Size values (KiB):
Expand Down
4 changes: 2 additions & 2 deletions flash/flash_spi.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
class FLASH(FlashDevice):

def __init__(self, spi, cspins, size=None, verbose=True,
sec_size=_SEC_SIZE, block_size=9, cmdset=None):
sec_size=_SEC_SIZE, block_size=9, cmd5=None):
self._spi = spi
self._cspins = cspins
self._ccs = None # Chip select Pin object for current chip
Expand All @@ -43,7 +43,7 @@ def __init__(self, spi, cspins, size=None, verbose=True,
super().__init__(block_size, len(cspins), size * 1024, sec_size)

# Select the correct command set
if (cmdset is None and size <= 4096) or (cmdset == False):
if (cmd5 is None and size <= 4096) or (cmd5 == False):
self._cmds = _CMDS3BA
self._cmdlen = 4
else:
Expand Down

0 comments on commit 55f62ce

Please sign in to comment.