Need Help to use PSRAM with External efused Flash(16 MB)

pratik.yadav.455
Posts: 23
Joined: Thu Oct 26, 2017 7:34 am

Need Help to use PSRAM with External efused Flash(16 MB)

Postby pratik.yadav.455 » Fri Feb 23, 2018 6:16 am

Hello,

When i used efused 16 MB external flash with PSRAM my board is rebooting ,when i enable PSRAM in make menuconfig.When PSRAM option is disable my board works fine and able to acess both 4MB and 16 MB flash.

its shows back trace at psram_init() API.

I used External flash W25Q128FWSIG-SOIC8.

Is there any configuration required to use PSRAM when i am using efused external FLASH(use as default bootable flash )?

I looked following thread , but i cant find any solution regarding this issue.
viewtopic.php?f=12&t=2884

If anyone know about this issue let me know ASAP.

ESP_Sprite
Posts: 9761
Joined: Thu Nov 26, 2015 4:08 am

Re: Need Help to use PSRAM with External efused Flash(16 MB)

Postby ESP_Sprite » Sat Feb 24, 2018 3:46 am

If I'm understanding this correctly, you're using efuses to re-route the flash pins used so the module boots from a flash chip that is external, instead of the internal one? Then I'm afraid you cannot use the internal PSRAM anymore. The PSRAM shares its data lines with the flash, and your efuse redirection of those lines probably routed those lines away from the psram as well.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Need Help to use PSRAM with External efused Flash(16 MB)

Postby WiFive » Sat Feb 24, 2018 5:30 am

I'm pretty sure he only rerouted CS

viewtopic.php?f=12&t=4513&p=19711#p19700

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Need Help to use PSRAM with External efused Flash(16 MB)

Postby Ritesh » Sun Feb 25, 2018 5:10 pm

ESP_Sprite wrote:If I'm understanding this correctly, you're using efuses to re-route the flash pins used so the module boots from a flash chip that is external, instead of the internal one? Then I'm afraid you cannot use the internal PSRAM anymore. The PSRAM shares its data lines with the flash, and your efuse redirection of those lines probably routed those lines away from the psram as well.
Hi,

Myself Ritesh Prajapati, I am working with Pratik Yadav.

Let me clear exact scenario in details.

We have used ESP32-WROVER-I module for our development purpose in one of our product.

Initially, We had planned to use internal memory only but in later stage we decided to add external flash memory as per our product Requirement.

So, We have connected external SPI Flash Memory on same connection with module's internal flash memory except CS pin. We have used different pin for CS pin. And also PSRAM is configured same interface with different CS pin I believe.

So, We are now planning to move to external flash memory as bootable flash memory for our product.

So, Pratik has configured only SPI Flash related configurations as internal flash and CS pin as different GPIO.

I think that should work without any issue means can access external SPI Flash memory + PSRAM wherever required.

Let me know if we have did anything wrong in that EFUSE configurations or something like that.
Regards,
Ritesh Prajapati

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Need Help to use PSRAM with External efused Flash(16 MB)

Postby Ritesh » Sun Feb 25, 2018 5:33 pm

WiFive wrote:I'm pretty sure he only rerouted CS

viewtopic.php?f=12&t=4513&p=19711#p19700
Hi,

I have checked both queries and found that PSRAM will work only with flash CS as default GPIO11.

Let me correct if I am wrong.

Also, we had did all EFUSE parameter settings in which all settings are kept as same as internal except CS GPIO.
Regards,
Ritesh Prajapati

markwj
Posts: 90
Joined: Tue Mar 08, 2016 5:03 am

Re: Need Help to use PSRAM with External efused Flash(16 MB)

Postby markwj » Mon Feb 26, 2018 2:04 am

This is a rabbit hole that we went down, and lost about two months (on top of another three months chasing an SDCARD bug vs external flash).

The idea is great. Just use another GPIO for a CS line, add an external flash chip, and burn the eFuses. For the WROOM32, we got it to working ok (apart from the SD CARD issue which dragged on for months, and was finally resolved in a firmware update).

But, then we find that for large projects with both Wifi and Bluetooth stacks running, there just isn't enough RAM in the ESP32. So, how about SPI RAM...

For the WROVER, things get messy. Firstly, VDD_SDIO is 1.8v and both flash and ram needs to be 1.8v, and driven by 1.8v VDD_SDIO domain pins. GPIO 16 and 17 are used for the SPI RAM. So, that leaves no more free VDD_SDIO domain GPIOs. Secondly, VDD_SDIO is not exposed outside the module.

Solution is seemingly to add a second voltage regulator at 1.8v to power the external flash chip. Then, use a 3.3v->1.8v level converter to be able to use a 3.3v GPIO to control the CS of the 1.8v external flash.

Problem is that that level converter has a propogation delay. Couple that with the Espressif implementation of SPI RAM clock being delayed with respect to SPI flash clock, and we start to have timing issues on the CS pin. Then, the nail in the coffin is that the Espressif ESP IDF SPI RAM driver implementation hard-codes the SPI bus GPIOs (ignoring eFuses).

We didn't even start looking at low-power consumption (deep sleep, etc) - our external VDD_SDIO regulation isn't controlled by that, so we'd have to do something special with software powering down our external flash.

Sorry if this sounds negative, but it is just too much hassle. For low volume, it is easier to swallow the cost and use Analog Lamb WROVER modules with 16MB flash. Hopefully some other suppliers will come out with similar offerings (16MB flash 4MB ram WROVER modules) to bring some competition. Given the 50cents price difference in components, and so much hassle trying to use external flash, I've never understood why this is so difficult.

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Need Help to use PSRAM with External efused Flash(16 MB)

Postby Ritesh » Mon Feb 26, 2018 5:18 pm

Hi All,

As we changed SPI Flash Chip Select GPIO from internal to external CS GPIO into SPI PSRAM code defined. Now, We are able to access external Flash Memory + Internal Flash Memory + PSRAM.

So, PSRAM code needs to be changed and configurable as per EFUSE Chip Select Parameters.
Regards,
Ritesh Prajapati

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Need Help to use PSRAM with External efused Flash(16 MB)

Postby Ritesh » Tue Feb 27, 2018 9:23 pm

Hi All,

As per discussion with Espressif Systems Developer over email, They will include fix for this issue regarding PSRAM code specific to SPI bootable CS Pin configuration into stable 3.1 ESP32 IDF Release.

Thanks for your support for that.
Regards,
Ritesh Prajapati

Who is online

Users browsing this forum: No registered users and 99 guests