Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A question about SerialFlashUnknownJedec exception when using W25Q256 #29

Open
klemdev opened this issue Jul 10, 2023 · 2 comments
Open

Comments

@klemdev
Copy link

klemdev commented Jul 10, 2023

Hi.

I am a bit stuck and would really appreciate any hint related to my issue:

  1. I have a script for FLASH programming through FTDI (FT2232H) and it works without any problem with W25Q32
  2. But when I try it with W25Q256, I get:
  File "/home/admin/.local/lib/python3.9/site-packages/spiflash/serialflash.py", line 228, in get_from_controller
    flash = SerialFlashManager._get_flash(spi, jedec)
  File "/home/admin/.local/lib/python3.9/site-packages/spiflash/serialflash.py", line 271, in _get_flash
    raise SerialFlashUnknownJedec(jedec)
spiflash.serialflash.SerialFlashUnknownJedec: Unknown flash device: b'ef4019'

My code looks something like (FTDI_URL=ftdi://0x0403:0x6010:FT6CCSY8/1):

spi_master = SpiController()
spi_master.configure(FTDI_URL, cs_count=1, debug=False)
spi_slave = spi_master.get_port(cs=0, freq=6E6, mode=0)

spi_master.set_gpio_direction(0b11010000, 0b11010000)
sleep(0.001)

# Send init value.
spi_master.write_gpio(64)
sleep(0.5)

# Soft reset.
# Enable reset.
spi_cmd = array('B', (0x66,))
spi_slave.exchange(spi_cmd)
# Reset device.
spi_cmd = array('B', (0x99,))
spi_slave.exchange(spi_cmd)

try:
    flash = SerialFlashManager.get_from_controller(spi_master, 0, 6E6)
...
...

Does that mean this device is not supported or I am doing something wrong?

Thank you in advance for any suggestion.

@eblot
Copy link
Owner

eblot commented Jul 12, 2023

Flash devices are often different, even in a specific series. They are added once tested, as it may not be only about a different storage size.

Patches are welcomed :)

@klemdev
Copy link
Author

klemdev commented Jul 25, 2023

Sorry for late reply @eblot

Thank you very much for clarifying this.
It works using Efinix GUI which runs Python scripts under the hood for flashing. Should probably look what they are doing there.
Will let you know if I manage to find a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants