ESP_ping issue in v3.3-beta3

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

Re: ESP_ping issue in v3.3-beta3

Postby Ritesh » Mon Jun 17, 2019 4:16 am

thethinker wrote:
Sun Jun 16, 2019 5:39 pm
I found the issue !
Under menu config, if I enable any or both of the following two options, weird things such as the one I explained starts happening:
-- CONFIG_SPIRAM_CACHE_WORKAROUND

As soon as I turn it off, things start working again!! So between idf 3.1 and 3.3 someone has changed something in LWIP logic to be in this workaround and this is causing the trouble (I'm guessing my code is getting removed at per-compilelation by this option)

To give you some insight I'm using a PICO-D4 with modified psram code to bypass the "psram not supported" errors, but even when I upgrade to 4.0 master branch which supports psram for pico-d4 it still has this issue.
I also have my sdkconfig attached.

Unfortunately I don't have time to dig deeper right now, but app so I'm all good for now!
Great. Good findings..

This CONFIG_SPIRAM_CACHE_WORKAROUND is enabled by default if we enable PSRAM config?

Also, Would you please raise issue over ESP32 Github as well?



Espressif Team,

Would you please look into this and let us know is it really known issue after enabling that option? because we are also planning to use PSRAM into few of our projects. SO, it will be good if We know known issue regarding that it really an issue.

Please clarify form your end and send your valuable feedback for same.
Regards,
Ritesh Prajapati

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

Re: ESP_ping issue in v3.3-beta3

Postby ESP_Sprite » Mon Jun 17, 2019 4:41 am

Yes. If you disable the workaround, you can get issues cropping up with writes not completing: your program will crash and misbehave in weird and wonderful ways and you will be tearing your hair out because the issue is spurious and can't be easily traced. Believe me, I know from experience.

Not sure why disabling the workaround fixes this, but it's likely because it's a race condition and the workaround changes the timings slightly.

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

Re: ESP_ping issue in v3.3-beta3

Postby Ritesh » Mon Jun 17, 2019 5:09 am

ESP_Sprite wrote:
Mon Jun 17, 2019 4:41 am
Yes. If you disable the workaround, you can get issues cropping up with writes not completing: your program will crash and misbehave in weird and wonderful ways and you will be tearing your hair out because the issue is spurious and can't be easily traced. Believe me, I know from experience.

Not sure why disabling the workaround fixes this, but it's likely because it's a race condition and the workaround changes the timings slightly.
So, What can be possible reason for that? any idea for that? or you need more details regarding that?
Regards,
Ritesh Prajapati

thethinker
Posts: 53
Joined: Thu Mar 01, 2018 1:26 am

Re: ESP_ping issue in v3.3-beta3

Postby thethinker » Wed Jun 19, 2019 4:18 am

Yes, I have a better idea of where the issue is now. Like @ESP_Sprite mentioned, I knew that disabling the workaround will most likely cause unrecoverable issues in the future, and since my device is in the field, it will be hard to deal with. I dug a bit deeper, just messing around with sdkconfig parameters. It turns on out if I turn off the option that says:
CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST

And then turn the bank switching and cache workaround back on, things start to work properly as well.

So the real issue is somewhere in the LWIP stack or Wifi, they don't like to run on PSRAM!! Now it's going to be pretty hard to pin in down for me from here on....I'm not familiar with LWIP stack code and wifi so I'm just going to use PSRAM for everything other than these two :D

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

Re: ESP_ping issue in v3.3-beta3

Postby Ritesh » Wed Jun 19, 2019 5:27 am

thethinker wrote:
Wed Jun 19, 2019 4:18 am
Yes, I have a better idea of where the issue is now. Like @ESP_Sprite mentioned, I knew that disabling the workaround will most likely cause unrecoverable issues in the future, and since my device is in the field, it will be hard to deal with. I dug a bit deeper, just messing around with sdkconfig parameters. It turns on out if I turn off the option that says:
CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST

And then turn the bank switching and cache workaround back on, things start to work properly as well.

So the real issue is somewhere in the LWIP stack or Wifi, they don't like to run on PSRAM!! Now it's going to be pretty hard to pin in down for me from here on....I'm not familiar with LWIP stack code and wifi so I'm just going to use PSRAM for everything other than these two :D
Great. Good Findings.

So, Would you please let me know what will create impact if I enable and use PSRAM with existing IDF 3.2 or master? because we are planning to start to use PSRAM as per our requirements.

So, I just want to know that what i need to take care for that if i will use PSRAM from LWIP or WiFi related stuffs?

It is better to get response from ESP32 SDK Developers as well like ESP_Sprite or someone else who has developed that component into ESP32 IDF if possible.
Regards,
Ritesh Prajapati

Who is online

Users browsing this forum: Baidu [Spider], urbanze and 24 guests