cancel
Showing results for 
Search instead for 
Did you mean: 

[STM32H750BX][QSPI] Issue with W25N01GVZEIG NAND Flash Driver

Hello,

Please, I am working on a Custom Project with STM32H7 platform and I am using a NAND Flash for Data Storage (W25N01GVZEIG). I can execute correctly all commands except :

  • (32h) Quad Program Data Load .

I can write using (02h) Program Data Load with SPI mode with no issues, but once I switch to Quad mode (32h) the data written is not correct, seems there is some bits corruption.

{0x11,0x22,0x44,0x88} is written {0x91,0x22,0x04,0x48}. I suspected the pinout first but the Quad read is working fine.

I saw a similar question QSPI of STM32L496A but didn't fix my issue.

Could you support on this?

Thanks,

Ayoub

16 REPLIES 16
hedinik
Associate II

Dear Ayoub,

I'm working on functions to read from W25N01GVZEIG and write to it but I have some issues with the them. Now, I'm trying to write a function which gets page address and column address, and data, to write that data in the certain address. Next, I want to read data. I use the following functions:

By w25qxx_peripheral I mean W25N01GVZEIG peripheral.

 

void my_write_page_function(w25qxx_peripheral* per, uint8_t * pBuffer,
uint16_t data_size,
uint16_t page_address)
{
 
W25qxx_WriteEnable(per);
HAL_GPIO_WritePin(per->cs_gpio, per->cs_pin, GPIO_PIN_RESET);
 
W25qxx_Spi(per, 0x02); //load data program
 
W25qxx_Spi(per, (page_address >> 😎 & 0xFF);
W25qxx_Spi(per, page_address & 0xFF);
 
for (int i = 0; i < data_size; i++)
{
W25qxx_Spi(per, pBuffer[i]);
}
 
// HAL_GPIO_WritePin(per->cs_gpio, per->cs_pin, GPIO_PIN_SET);
//
// HAL_GPIO_WritePin(per->cs_gpio, per->cs_pin, GPIO_PIN_RESET);
 
W25qxx_Spi(per, 0x10); //program execute
W25qxx_Spi(per, W25QXX_DUMMY_BYTE);
 
W25qxx_Spi(per, (page_address >> 😎 & 0xFF);
W25qxx_Spi(per, page_address & 0xFF);
 
HAL_GPIO_WritePin(per->cs_gpio, per->cs_pin, GPIO_PIN_RESET);
 
}
 
//###################################################################################################################
 
void my_read_page_function(w25qxx_peripheral* per, uint8_t * pBuffer,
uint16_t data_size,
uint16_t page_address)
{
HAL_GPIO_WritePin(per->cs_gpio, per->cs_pin, GPIO_PIN_RESET);
 
W25qxx_Spi(per, 0x13); //page data read
W25qxx_Spi(per, W25QXX_DUMMY_BYTE);
 
W25qxx_Spi(per, (page_address >> 😎 & 0xFF);
W25qxx_Spi(per, page_address & 0xFF);
 
// HAL_GPIO_WritePin(per->cs_gpio, per->cs_pin, GPIO_PIN_SET);
//
// HAL_Delay(25000);
//
// HAL_GPIO_WritePin(per->cs_gpio, per->cs_pin, GPIO_PIN_RESET);
 
W25qxx_Spi(per, 0x03); //read data
 
W25qxx_Spi(per, (page_address >> 😎 & 0xFF);
W25qxx_Spi(per, page_address & 0xFF);
 
W25qxx_Spi(per, W25QXX_DUMMY_BYTE);
 
HAL_GPIO_WritePin(per->cs_gpio, per->cs_pin, GPIO_PIN_SET);
 
 
}

 

 

Would you please send the functions? Thank you in advance.

How's it going to determine what's data, and what's the next command if the chip select doesn't transition?

https://datasheet.lcsc.com/lcsc/1809200036_Winbond-Elec-W25N01GVZEIG_C88868.pdf

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
hedinik
Associate II

thank you for your consideration. so you mean I have to uncomment following lines?

// HAL_GPIO_WritePin(per->cs_gpio, per->cs_pin, GPIO_PIN_SET);
//
// HAL_GPIO_WritePin(per->cs_gpio, per->cs_pin, GPIO_PIN_RESET);
 
I did it but it does not work :(

>>I did it but it does not work :(

Ok, but that's not very enlightening. But what DOES happen? You have a scope or logic analyzer on this? The signals at the pins functioning?

Do you have code to read the JEDEC ID off the part, going to be command 0x9F? Does that function? Does it return 0xFF patterns

There's like some minimal delay between rising and falling again on the CS, but you definitely can't go ploughing onward. The CS falling designates the start of a new command transaction.

BTW the thread is using the QSPI Peripheral

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Zakba.1
Senior

hello. could you solve your problem? If so would you please help me or send me a link to a working qspi driver for W25N01? I asked a Question W25N01xxxIG Driver for STM32H7 - STMicroelectronics Community

hedinik
Associate II

Hello Zakba.1
Actually I am working on standard SPI for W25N NAND memory. I don't know how the QSPU supposed to work. I have some problems with writing on this memory (Load program Data & Program Execute). Did you solve it?
Thank you.

hello hedinik

No, because I wanted to use it in memory-mapped mode But Tesla said that It couldn't be used in this mode so I gave it up. I decided to use W25q512 instead.