Winbond W25Q512 Flash support

Status
Not open for further replies.

Sandro

Well-known member
Hi all,
as long as I know the W25Q512 flash memory chip has not official support here.
This 64MB chip responds with:
id[0]:239
id[1]:112
id[2]:56

I sarted adding few lines to capacity(...) function, in SerialFlashChip.cpp:

Code:
uint32_t SerialFlashChip::capacity(const uint8_t *id)
{
    uint32_t n = 1048576; // unknown chips, default to 1 MByte

    if (id[0] == ID0_ADESTO && id[1] == 0x89)
    {
        n = 1048576*16; //16MB
    }
    else if (id[2] >= 16 && id[2] <= 31)
    {
        n = 1ul << id[2];
    }
    else if (id[2] >= 32 && id[2] <= 37)
    {
        n = 1ul << (id[2] - 6);
    }
    else if ((id[0]==0 && id[1]==0 && id[2]==0) ||
             (id[0]==255 && id[1]==255 && id[2]==255))
    {
        n = 0;
    }


    // I added this new case
    else if (id[2] == 56) // 0x38
    {
     n = 1ul << 26; // 2^26 = 64M
     Serial.println("capacity: 64MB");
    }


    //Serial.printf("capacity %lu\n", n);
    return n;
}

And the only progress is that now the code should get the right value of capacity... but nothing else seems changed, writing files is still impossible. Anyone knows how far I'm from the goal?

Thanks in advance!
 
In SerialFlashDirectory.h, I noticed that check_signature() fails when attempts to write sig[0] = 0xFA96554C; adding some Serial.print the following SerialFlash.read(0, sig, 8) says that sig[0] is 0xFFFFFF4C... :confused:
 
Hi all,
as long as I know the W25Q512 flash memory chip has not official support here.

Actually the W25Q512 is a support by LittleFS. For complete list of supported chips check the LittleFS Readme: https://github.com/PaulStoffregen/LittleFS
Code:
NOR Flash
MFG	PART #	Size
Winbond	W25Q16JV*IQ/W25Q16FV	16Mb
...	W25Q32JV*IQ/W25Q32FV	32Mb
...	W25Q64JV*IQ/W25Q64FV	64Mb
...	W25Q128JV*IQ/W25Q128FV	128Mb
...	W25Q256JV*IQ	256Mb
...	Winbond W25Q512JV*IQ	512Mb
...	W25Q64JV*IM (DTR)	64Mb
...	W25Q128JV*IM (DTR)	128Mb
...	W25Q256JV*IM (DTR)	256Mb
...	W25Q512JV*IM (DTR)	512Mb
Adesto/Atmel	AT25SF041	4Mb
Spansion	S25FL208K	8Mb


NAND Flash
MFG	PART #	Size
Winbond	W25N01G	1Gb
...	W25N02G	2Gb
...	W25M02	2Gb


FRAM
MFG	PART #	Size
Cypress	CY15B108QN-40SXI	8Mb
...	FM25V10-G	1Mb
...	FM25V10-G rev1	1Mb
...	CY15B104Q-SXI	4Mb
ROHM	MR45V100A	1Mb
 
Hi, yes I know but unfortunately littleFS is not fast enough for my application; so my desire is using SerialFlash and the "basic" file system.
Basically there is a write error with this chip; reading its datasheet the instructions applied by SerialFlash apper correct... maybe there is something deeper to be tuned..
 
Hi, yes I know but unfortunately littleFS is not fast enough for my application; so my desire is using SerialFlash and the "basic" file system.
Basically there is a write error with this chip; reading its datasheet the instructions applied by SerialFlash apper correct... maybe there is something deeper to be tuned..

Never dug into the innards of SerialFlash so not sure I can help you on that you. One thing on this chip there is a Write Enable (06h) bit that has to get set before writing. You might want to check that.
 
Never dug into the innards of SerialFlash so not sure I can help you on that you. One thing on this chip there is a Write Enable (06h) bit that has to get set before writing. You might want to check that.
Hi mjs513, thank you for your suggestions; I didn't change the original Write Enable command:
Code:
CSASSERT();
SPIPORT.transfer(0x06);
CSRELEASE();
I compared the W25Q256 (which is supported by SerialFlash.h) and W25Q512 datasheets: the main commands and parameters seem identical..
 
Problem solved.. W25Q512 is perfectly working with SerialFlash without any change.. my fault, there was an error in a connection...
 
Problem solved.. W25Q512 is perfectly working with SerialFlash without any change.. my fault, there was an error in a connection...

Cool - glad you got it working. Should post your changes or issue a PR to update SerialFlash
 
Cool - glad you got it working. Should post your changes or issue a PR to update SerialFlash

Hi mjs512, I just forked SerialFlashChip.cpp with few additional lines which allow to recognize the W25Q512 and set the correct capacity value (64MB). Next days I'll check (and share here) the read/write performance of the chip compared to the W25Q256 (that I was using before this one).
Thank you!
 
I am also using this chip and would be quite interested with your results. I am especially interested in setting the teensy 4.0 up like a usb mass storage device in order to have a configuration text file for my program.
 
Hi mjs512, I just forked SerialFlashChip.cpp with few additional lines which allow to recognize the W25Q512 and set the correct capacity value (64MB). Next days I'll check (and share here) the read/write performance of the chip compared to the W25Q256 (that I was using before this one).
Thank you!

Checking again... SerialFlashChip.cpp does not need any change for W25Q512.

Just to correct the first post of this thread, using 25Q512JVFM the ID is:
id[0]:239
id[1]:112
id[2]:32 (not "56" that I had read with a wrong connection..)
 
Checking again... SerialFlashChip.cpp does not need any change for W25Q512.

Just to correct the first post of this thread, using 25Q512JVFM the ID is:
id[0]:239
id[1]:112
id[2]:32 (not "56" that I had read with a wrong connection..)

Great - will have to give it a try
 
I am also using this chip and would be quite interested with your results. I am especially interested in setting the teensy 4.0 up like a usb mass storage device in order to have a configuration text file for my program.

I did some tests, using the following setups:
a) T41@600MHz + W25Q256FVFG
b) T41@600MHz + W25Q512JVFM

Both setup run the same code, an audio application reading a bunch of contiguous audio-samples (2 bytes each), with many operations for each reading. Both Winbond chips contain the same file 0.RAW read by the code.
These are the performance:

Setup a)
reading and computing 64 samples: 64us
reading and computing 128 samples: 86us
reading and computing 256 samples: 136us

Setup b)
reading and computing 64 samples: 74us
reading and computing 128 samples: 97us
reading and computing 256 samples: 145us

So, the 64MB chip appears 10us slower than 32MB chip..
 
Status
Not open for further replies.
Back
Top