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

Problem with W25qxx_WriteSector. For 4096 about 100 fail bytes #33

Open
WojtekPoland opened this issue Nov 13, 2021 · 0 comments
Open

Comments

@WojtekPoland
Copy link

Hi,

I have problem with W25qxx_WriteSector. Below you can read my unit test with this function. Very often during writing all sector (4096 bytes) I have about 100-120 mistakes.

void W25qxx_Unit_Test2 (void)
{
int i,j;
bool match;
uint8_t u8rbuf[4096];
uint8_t u8wbuf[4096] = {0xff,};

for(i=0; i<sizeof(u8wbuf); i++) u8wbuf[i] = 0xaa;
printf("\r\nW25qxx_Unit_Test2");
W25qxx_Init();
for (i=0; i<2; i++)
	{
		printf("\r\nW25qxx_EraseSector:%d",i);
		W25qxx_EraseSector(i);
	}

printf("\r\nTEST 1 TEST 1 TEST 1");
printf("\r\nW25qxx_Write_Sector: %d", 0);
W25qxx_WriteSector(u8wbuf, 0, 0, sizeof(u8wbuf));
W25qxx_ReadSector(u8rbuf, 0, 0, sizeof(u8rbuf));
match = true;
j = 0;
for (i=0; i<sizeof(u8rbuf); i++)
	{
		if (u8rbuf[i] != 0xaa)
			{
				match = false;
				j++;
				//break;
			}
	}
if (match) printf("\r\nData1 match");
else printf("\r\nData1 does not match!!! %d",j);
printf("\r\nW25qxx_Unit_Test2 Done... Get back to work");

}

I am using W25Q128 made by Winbond. In function W25qxx_Init i hade to add code:

while (id!=0xEF7018) id = W25qxx_ReadID();

Summary: my flash doesn`t work stable. Have any idea why?

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

1 participant