External flash component

hgptamn
Posts: 26
Joined: Mon Oct 16, 2017 4:47 pm

Re: External flash component

Postby hgptamn » Fri Mar 09, 2018 3:42 pm

I guess we've posted the reply at the same time :lol:
From what I see using native VSPI pins seem to get the write methods to work, but changing the SPI via GPIO MUX yields the same results that I was posting. Hmm...m

lllucius
Posts: 13
Joined: Sun Feb 11, 2018 9:02 am

Re: External flash component

Postby lllucius » Fri Mar 09, 2018 3:52 pm

Changing the speed from 40 to 20 produces good results:

Code: Select all

        .speed_mhz = 20,

Code: Select all

ERASE/WRITE/VERIFY Test...

       Bus
std    1-1-1
Flash size 16777216
Sector size 4096
Register 1 result binary = 00000010
 Register 1 result decimal = 2
Register 2 result binary = 00111100
 Register 2 result decimal = 60
Erase error code: 0
I should have suspected that from the beginning, but my aging grey matter ain't what it used to be. :-)

Must have something to do with the 26MHz "limit" when going through the GPIO matrix. But, comments in the SPI code seem to indicate that's only if using full-duplex comms, which we are not using.

Will experiment further.

lllucius
Posts: 13
Joined: Sun Feb 11, 2018 9:02 am

Re: External flash component

Postby lllucius » Fri Mar 09, 2018 6:02 pm

Nope, can't seem to get speed above 20MHz to work when going through the GPIO matrix. When using native pins, I can go all the way to 80MHz.

hgptamn, if you're still watching, can you try reducing the speed to 20 and test again?

User avatar
Vader_Mester
Posts: 300
Joined: Tue Dec 05, 2017 8:28 pm
Location: Hungary
Contact:

Re: External flash component

Postby Vader_Mester » Sat Mar 10, 2018 10:05 am

Illucius: I'll try to check your program again later, I need some resoldering, my CS wire came off :D

Code: Select all

task_t coffeeTask()
{
	while(atWork){
		if(!xStreamBufferIsEmpty(mug)){
			coffeeDrink(mug);
		} else {
			xTaskCreate(sBrew, "brew", 9000, &mug, 1, NULL);
			xSemaphoreTake(sCoffeeRdy, portMAX_DELAY);
		}
	}
	vTaskDelete(NULL);
}

hgptamn
Posts: 26
Joined: Mon Oct 16, 2017 4:47 pm

Re: External flash component

Postby hgptamn » Fri Mar 16, 2018 9:21 am

Sorry for the late response; I was out of country for the last week and didn't have the ESP32 with me.
I don't see how that bug got past me; I was very well aware of GPIO MUX frequency limitations... :oops:
I will check it right away and post an update.

Update 1: I'm getting some strange results; Once I sort out why so, I'll post another update.

Update 2: Apparently setting the SPI frequency to 20MHz still doesn't solve the issue, but fixes wrong register settings for register 1 and 2.

Code: Select all

ERASE/WRITE/VERIFY Test...

       Bus
std    1-1-1
Flash size 8388608
Sector size 4096
Erase error code: 0
Write error code: 0
Read error code: 0
addr = 0
erase/write/verify failed at block 0 offset 0
               unaliged write successful
dual   1-1-2
Flash size 8388608
Sector size 4096
Erase error code: 0
Write error code: 0
Read error code: 0
addr = 0
erase/write/verify failed at block 0 offset 0
               unaliged write successful
dio    1-2-2
Flash size 8388608
Sector size 4096
Erase error code: 0
Write error code: 0
Read error code: 0
addr = 0
erase/write/verify failed at block 0 offset 0
               unaliged write successful
quad   1-1-4
Flash size 8388608
Sector size 4096
Erase error code: 0
Write error code: 0
Read error code: 0
addr = 0
erase/write/verify failed at block 0 offset 0
               unaliged write failed
qio    1-4-4
Flash size 8388608
Sector size 4096
Erase error code: 0
Write error code: 0
Read error code: 0
addr = 0
erase/write/verify failed at block 0 offset 1
               unaliged write failed
qpi    4-4-4
Flash size 8388608
Sector size 4096
Erase error code: 0
Write error code: 0
Read error code: 0
addr = 0
erase/write/verify failed at block 0 offset 1
               unaliged write failed

Done...

hgptamn
Posts: 26
Joined: Mon Oct 16, 2017 4:47 pm

Re: External flash component

Postby hgptamn » Wed Mar 21, 2018 1:22 pm

@Veder_Mester
Did your experiments show better results?

User avatar
Vader_Mester
Posts: 300
Joined: Tue Dec 05, 2017 8:28 pm
Location: Hungary
Contact:

Re: External flash component

Postby Vader_Mester » Fri Mar 23, 2018 2:25 pm

Not yet, but I try. My problem is that my flash is actually a Winbond chip, but I check it further, when I find some time.

If you have updated anything in the code, please post it so I can see.

Vader[BEN]

Code: Select all

task_t coffeeTask()
{
	while(atWork){
		if(!xStreamBufferIsEmpty(mug)){
			coffeeDrink(mug);
		} else {
			xTaskCreate(sBrew, "brew", 9000, &mug, 1, NULL);
			xSemaphoreTake(sCoffeeRdy, portMAX_DELAY);
		}
	}
	vTaskDelete(NULL);
}

Who is online

Users browsing this forum: No registered users and 32 guests