PlummersSoftwareLLC / NightDriverStrip

NightDriver client for ESP32
https://plummerssoftwarellc.github.io/NightDriverStrip/
GNU General Public License v3.0
1.29k stars 210 forks source link

E (2148) esp_core_dump_flash: Core dump flash config is corrupted! CRC=0x7bd5c66f instead of 0x0 #598

Closed fanno closed 5 months ago

fanno commented 5 months ago

I appoligize in advance if this is not where i should be looking for the "support" / guidance on this

Bug report

Hello i am getting this in the log/consol after following the guide.

is the esp32 broken?

i install with: ESP32-S3-DevKitC-1 / Panlee

ELF file SHA256: 5b8c8f93c30f4511

E (2148) esp_core_dump_flash: Core dump flash config is corrupted! CRC=0x7bd5c66f instead of 0x0
Rebooting...
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x403799af
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x44c
load:0x403c9700,len:0xbd8
load:0x403cc700,len:0x2a80
entry 0x403c98d0
E (274) esp_core_dump_flash: No core dump partition found!
E (274) esp_core_dump_flash: No core dump partition found!
E (276) psram: PSRAM ID read erro2'��Replacing Idle Tasks with TaskManager...
(I) (PrintOutputHeader)(C1) NightDriverStrip
(I) 
(I) (PrintOutputHeader)(C1) ------------------------------------------------------------------------------------------------------------
(I) (PrintOutputHeader)(C1) M5STICKC: 0, USE_M5DISPLAY: 0, USE_OLED: 0, USE_TFTSPI: 1, USE_LCD: 0, USE_AUDIO: 0, ENABLE_REMOTE: 0
(I) (PrintOutputHeader)(C1) ESP32 PSRAM Init: FAIL
(I) (PrintOutputHeader)(C1) Version 40: Wifi SSID: "" - ESP32 Free Memory: 301308, PSRAM:0, PSRAM Free: 0
(I) (PrintOutputHeader)(C1) ESP32 Clock Freq : 240 MHz
(I) (setup)(C1) Startup!
(I) (setup)(C1) Starting DebugLoopTaskEntry
>> Launching Debug Thread.  Mem: 301308, LargestBlk: 270324, PSRAM Free: 0/0, (W) (ReadWiFiConfig)(C1) Retrieved SSID and Password from NVS: "", "********"
(W) (setup)(C1) Starting ImprovSerial for ESP32-S3
[   630][E][vfs_api.cpp:182] remove(): /improv.log does not exists or is directory
(I) (setup)(C1) Sending Improv packet to declare we're up. Ignore any IMPROV lines that follow this one.
IMPROV�
>> Launching JSON Writer Thread.  Mem: 292548, LargestBlk: 270324, PSRAM Free: 0/0, (W) (DeviceConfig)(C1) DeviceConfig could not be loaded from JSON, using defaults
(W) (NotifyJSONWriterThread)(C1) >> Notifying JSON Writer Thread
(W) (setup)(C1) Creating TFT Screen
[  1075][E][esp32-hal-gpio.c:102] __pinMode(): Invalid pin selected
E (1080) gpio: gpio_set_level(227): GPIO output gpio_num error
[  1087][E][esp32-hal-gpio.c:102] __pinMode(): Invalid pin selected
E (1092) gpio: gpio_set_level(227): GPIO output gpio_num error
E (1104) gpio: gpio_set_level(227): GPIO output gpio_num error
E (1125) gpio: gpio_set_level(227): GPIO output gpio_num error
(W) (InitializeHardware)(C1) Allocating LEDStripGFX for channel 0
(I) (AddLEDsToFastLED)(C1) Adding LEDs to FastLED...
(I) (AddLEDsToFastLED)(C1) Adding 1152 LEDs to pin 5 from channel 0 on FastLED.
(I) (SetupBufferManagers)(C1) Could allocate 1231068 buffers but limiting it to 500
(I) 
(W) (SetupBufferManagers)(C1) Reserving 500 LED buffers for a total of 1744000 bytes...
Guru Meditation Error: Core  1 panic'ed (StoreProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x420116ad  PS      : 0x00060430  A0      : 0x820117cc  A1      : 0x3fceba80  
A2      : 0x0000006d  A3      : 0x00000010  A4      : 0x00000000  A5      : 0x3fcf7a60  
A6      : 0x00000001  A7      : 0x3fcf7a90  A8      : 0x820116a6  A9      : 0x3fceba60  
A10     : 0x00000000  A11     : 0x3fcdfb64  A12     : 0x3fcc3eec  A13     : 0x00000400  
A14     : 0x3fcdfa04  A15     : 0x3fcdfbfc  SAR     : 0x0000001e  EXCCAUSE: 0x0000001d  
EXCVADDR: 0x00000004  LBEG    : 0x40056f08  LEND    : 0x40056f12  LCOUNT  : 0x00000000  

Backtrace: 0x420116aa:0x3fceba80 0x420117c9:0x3fcebac0 0x42011839:0x3fcebaf0 0x42011ac9:0x3fcebb20 0x420127fb:0x3fcebb50 0x42029932:0x3fcebc10

Problem

Steps i have only tried with 1 ESP32 i dont wanna break others incase this is breaking the ESP

  1. using https://plummerssoftwarellc.github.io/NightDriverStrip/
  2. chose type ESP32-S3-DevKitC-1
  3. chose Panlee
  4. cant get the wifi config to pop up (its posible i am doing some thing wrong)

I eraced the device when i installed the first time ? was that correct ?

Example before going here i loaded a simple webserver on the ESP

Notes This is my first time trying to get in to this project after getting the hardware.

smiliea commented 5 months ago

I believe you are out of memory. Try reducing the amount of visualizations and features. I seriously doubt your ESP-32 is broken.

On Tue, Jan 23, 2024 at 5:33 PM Morten Hundevad @.***> wrote:

I appoligize in advance if this is not where i should be looking for the "support" / guidance on this Bug report

Hello i am getting this in the log/consol after following the guide.

is the esp32 broken?

i install with: ESP32-S3-DevKitC-1 / Panlee

ELF file SHA256: 5b8c8f93c30f4511

E (2148) esp_core_dump_flash: Core dump flash config is corrupted! CRC=0x7bd5c66f instead of 0x0 Rebooting... ESP-ROM:esp32s3-20210327 Build:Mar 27 2021 rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT) Saved PC:0x403799af SPIWP:0xee mode:DIO, clock div:1 load:0x3fce3808,len:0x44c load:0x403c9700,len:0xbd8 load:0x403cc700,len:0x2a80 entry 0x403c98d0 E (274) esp_core_dump_flash: No core dump partition found! E (274) esp_core_dump_flash: No core dump partition found! E (276) psram: PSRAM ID read erro2'��Replacing Idle Tasks with TaskManager... (I) (PrintOutputHeader)(C1) NightDriverStrip (I) (I) (PrintOutputHeader)(C1) ------------------------------------------------------------------------------------------------------------ (I) (PrintOutputHeader)(C1) M5STICKC: 0, USE_M5DISPLAY: 0, USE_OLED: 0, USE_TFTSPI: 1, USE_LCD: 0, USE_AUDIO: 0, ENABLE_REMOTE: 0 (I) (PrintOutputHeader)(C1) ESP32 PSRAM Init: FAIL (I) (PrintOutputHeader)(C1) Version 40: Wifi SSID: "" - ESP32 Free Memory: 301308, PSRAM:0, PSRAM Free: 0 (I) (PrintOutputHeader)(C1) ESP32 Clock Freq : 240 MHz (I) (setup)(C1) Startup! (I) (setup)(C1) Starting DebugLoopTaskEntry

Launching Debug Thread. Mem: 301308, LargestBlk: 270324, PSRAM Free: 0/0, (W) (ReadWiFiConfig)(C1) Retrieved SSID and Password from NVS: "", "****" (W) (setup)(C1) Starting ImprovSerial for ESP32-S3 [ 630][E][vfs_api.cpp:182] remove(): /improv.log does not exists or is directory (I) (setup)(C1) Sending Improv packet to declare we're up. Ignore any IMPROV lines that follow this one. IMPROV����� Launching JSON Writer Thread. Mem: 292548, LargestBlk: 270324, PSRAM Free: 0/0, (W) (DeviceConfig)(C1) DeviceConfig could not be loaded from JSON, using defaults (W) (NotifyJSONWriterThread)(C1) >> Notifying JSON Writer Thread (W) (setup)(C1) Creating TFT Screen [ 1075][E][esp32-hal-gpio.c:102] __pinMode(): Invalid pin selected E (1080) gpio: gpio_set_level(227): GPIO output gpio_num error [ 1087][E][esp32-hal-gpio.c:102] __pinMode(): Invalid pin selected E (1092) gpio: gpio_set_level(227): GPIO output gpio_num error E (1104) gpio: gpio_set_level(227): GPIO output gpio_num error E (1125) gpio: gpio_set_level(227): GPIO output gpio_num error (W) (InitializeHardware)(C1) Allocating LEDStripGFX for channel 0 (I) (AddLEDsToFastLED)(C1) Adding LEDs to FastLED... (I) (AddLEDsToFastLED)(C1) Adding 1152 LEDs to pin 5 from channel 0 on FastLED. (I) (SetupBufferManagers)(C1) Could allocate 1231068 buffers but limiting it to 500 (I) (W) (SetupBufferManagers)(C1) Reserving 500 LED buffers for a total of 1744000 bytes... Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled.

Core 1 register dump: PC : 0x420116ad PS : 0x00060430 A0 : 0x820117cc A1 : 0x3fceba80 A2 : 0x0000006d A3 : 0x00000010 A4 : 0x00000000 A5 : 0x3fcf7a60 A6 : 0x00000001 A7 : 0x3fcf7a90 A8 : 0x820116a6 A9 : 0x3fceba60 A10 : 0x00000000 A11 : 0x3fcdfb64 A12 : 0x3fcc3eec A13 : 0x00000400 A14 : 0x3fcdfa04 A15 : 0x3fcdfbfc SAR : 0x0000001e EXCCAUSE: 0x0000001d EXCVADDR: 0x00000004 LBEG : 0x40056f08 LEND : 0x40056f12 LCOUNT : 0x00000000

Backtrace: 0x420116aa:0x3fceba80 0x420117c9:0x3fcebac0 0x42011839:0x3fcebaf0 0x42011ac9:0x3fcebb20 0x420127fb:0x3fcebb50 0x42029932:0x3fcebc10

Problem

Steps i have only tried with 1 ESP32 i dont wanna break others incase this is breaking the ESP

  1. using https://plummerssoftwarellc.github.io/NightDriverStrip/
  2. chose type ESP32-S3-DevKitC-1
  3. chose Panlee
  4. cant get the wifi config to pop up (its posible i am doing some thing wrong)

I eraced the device when i installed the first time ? was that correct ?

Example before going here i loaded a simple webserver on the ESP

Notes This is my first time trying to get in to this project after getting the hardware.

— Reply to this email directly, view it on GitHub https://github.com/PlummersSoftwareLLC/NightDriverStrip/issues/598, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF2ATVHULREFS5ICHSIFCI3YQBCDRAVCNFSM6AAAAABCH2TE7OVHI2DSMVQWIX3LMV43ASLTON2WKOZSGA4TOMJVGQZTEMY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

robertlipe commented 5 months ago

YOu have a couple of red flags.

1) The absence of a core dump thing is just choice of the original filesystem creators. I'll be contributing new partition tables soon for the larger devices that will add these. The problem is that it necessarily reformats the "disk" to change this, so adding that one line of code to add a crash dump pulls in a whole lot of issues that I've been kicking around. That work has been in progress a long time because there are a number of sticky issues.

2) You actually have a configuration issue that would have been detected by code I was working oblast night. :-) It looks like you're trying to turn on PSRAM, but it's "broken" - most often, this is caused by hooking other things to the pins that are used for the SPI controller. See the good description at https://github.com/atomic14/esp32-s3-pinouts?tab=readme-ov-file#psram (His videos are good, too.)

2a) Data used to support that theory: E (276) psram: PSRAM ID read erro2

3) You need to enable the stack decoder in your platformio configuration order to have a usable stack trace.

4) This is worrying:

E (1092) gpio: gpio_set_level(227): GPIO output gpio_num error

That doesn't show up on my S3 builds.

5) 1152 LEDs on one strand isn't crazy, but be aware that math prevents you from pushing them much about 30 Hz, so if you much higher, the effects will start to get chunky.

It sounds liek this is your introduction. I'd definitely try starting with a smaller configuration.

As a concluding punchline, we know this is related to PSRAM somehow. Your configuration is requesting 1.744.000 bytes. Without PSRAM, you're only going to ever have tiny fraction of that amount. So you need to build a simpler configuration that doesn't NEED psram or you need to figure out sy the psraminit is failing. (My money says that you have something else connected to the SPI lines.)

Actually burning up an ESP32 isn't possible, but it takes things like putting 12V where 3.3V is supposed to be, overdriving output pins, even though they tend to have inline current resistors, etc. It's not like some chips where you can make a mistake flashing images and crap on the bootloaders badly enough that you have to attach a JTAG or sacrifice a VIC-20 to the Byte Gods or whatever to get it unstuck. They're pretty awesome chips.

RJL

On Tue, Jan 23, 2024 at 5:33 PM Morten Hundevad @.***> wrote:

I appoligize in advance if this is not where i should be looking for the "support" / guidance on this Bug report

Hello i am getting this in the log/consol after following the guide.

is the esp32 broken?

i install with: ESP32-S3-DevKitC-1 / Panlee

ELF file SHA256: 5b8c8f93c30f4511

E (2148) esp_core_dump_flash: Core dump flash config is corrupted! CRC=0x7bd5c66f instead of 0x0 Rebooting... ESP-ROM:esp32s3-20210327 Build:Mar 27 2021 rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT) Saved PC:0x403799af SPIWP:0xee mode:DIO, clock div:1 load:0x3fce3808,len:0x44c load:0x403c9700,len:0xbd8 load:0x403cc700,len:0x2a80 entry 0x403c98d0 E (274) esp_core_dump_flash: No core dump partition found! E (274) esp_core_dump_flash: No core dump partition found! E (276) psram: PSRAM ID read erro2'��Replacing Idle Tasks with TaskManager... (I) (PrintOutputHeader)(C1) NightDriverStrip (I) (I) (PrintOutputHeader)(C1) ------------------------------------------------------------------------------------------------------------ (I) (PrintOutputHeader)(C1) M5STICKC: 0, USE_M5DISPLAY: 0, USE_OLED: 0, USE_TFTSPI: 1, USE_LCD: 0, USE_AUDIO: 0, ENABLE_REMOTE: 0 (I) (PrintOutputHeader)(C1) ESP32 PSRAM Init: FAIL (I) (PrintOutputHeader)(C1) Version 40: Wifi SSID: "" - ESP32 Free Memory: 301308, PSRAM:0, PSRAM Free: 0 (I) (PrintOutputHeader)(C1) ESP32 Clock Freq : 240 MHz (I) (setup)(C1) Startup! (I) (setup)(C1) Starting DebugLoopTaskEntry

Launching Debug Thread. Mem: 301308, LargestBlk: 270324, PSRAM Free: 0/0, (W) (ReadWiFiConfig)(C1) Retrieved SSID and Password from NVS: "", "****" (W) (setup)(C1) Starting ImprovSerial for ESP32-S3 [ 630][E][vfs_api.cpp:182] remove(): /improv.log does not exists or is directory (I) (setup)(C1) Sending Improv packet to declare we're up. Ignore any IMPROV lines that follow this one. IMPROV����� Launching JSON Writer Thread. Mem: 292548, LargestBlk: 270324, PSRAM Free: 0/0, (W) (DeviceConfig)(C1) DeviceConfig could not be loaded from JSON, using defaults (W) (NotifyJSONWriterThread)(C1) >> Notifying JSON Writer Thread (W) (setup)(C1) Creating TFT Screen [ 1075][E][esp32-hal-gpio.c:102] __pinMode(): Invalid pin selected E (1080) gpio: gpio_set_level(227): GPIO output gpio_num error [ 1087][E][esp32-hal-gpio.c:102] __pinMode(): Invalid pin selected E (1092) gpio: gpio_set_level(227): GPIO output gpio_num error E (1104) gpio: gpio_set_level(227): GPIO output gpio_num error E (1125) gpio: gpio_set_level(227): GPIO output gpio_num error (W) (InitializeHardware)(C1) Allocating LEDStripGFX for channel 0 (I) (AddLEDsToFastLED)(C1) Adding LEDs to FastLED... (I) (AddLEDsToFastLED)(C1) Adding 1152 LEDs to pin 5 from channel 0 on FastLED. (I) (SetupBufferManagers)(C1) Could allocate 1231068 buffers but limiting it to 500 (I) (W) (SetupBufferManagers)(C1) Reserving 500 LED buffers for a total of 1744000 bytes... Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled.

Core 1 register dump: PC : 0x420116ad PS : 0x00060430 A0 : 0x820117cc A1 : 0x3fceba80 A2 : 0x0000006d A3 : 0x00000010 A4 : 0x00000000 A5 : 0x3fcf7a60 A6 : 0x00000001 A7 : 0x3fcf7a90 A8 : 0x820116a6 A9 : 0x3fceba60 A10 : 0x00000000 A11 : 0x3fcdfb64 A12 : 0x3fcc3eec A13 : 0x00000400 A14 : 0x3fcdfa04 A15 : 0x3fcdfbfc SAR : 0x0000001e EXCCAUSE: 0x0000001d EXCVADDR: 0x00000004 LBEG : 0x40056f08 LEND : 0x40056f12 LCOUNT : 0x00000000

Backtrace: 0x420116aa:0x3fceba80 0x420117c9:0x3fcebac0 0x42011839:0x3fcebaf0 0x42011ac9:0x3fcebb20 0x420127fb:0x3fcebb50 0x42029932:0x3fcebc10

Problem

Steps i have only tried with 1 ESP32 i dont wanna break others incase this is breaking the ESP

  1. using https://plummerssoftwarellc.github.io/NightDriverStrip/
  2. chose type ESP32-S3-DevKitC-1
  3. chose Panlee
  4. cant get the wifi config to pop up (its posible i am doing some thing wrong)

I eraced the device when i installed the first time ? was that correct ?

Example before going here i loaded a simple webserver on the ESP

Notes This is my first time trying to get in to this project after getting the hardware.

— Reply to this email directly, view it on GitHub https://github.com/PlummersSoftwareLLC/NightDriverStrip/issues/598, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCSD363PCGYIXLXIENXRDTYQBCDLAVCNFSM6AAAAABCH2TE7OVHI2DSMVQWIX3LMV43ASLTON2WKOZSGA4TOMJVGQZTEMY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

fanno commented 5 months ago

Hello both of you for replying

Thanks for taking your time to reply with feedback

@smiliea as to memory, its not something i "add" i followed the webinstaller guide but perhaps the board is just not supported properly due to some of the things that @robertlipe maybe brought up.

@robertlipe Currently nothing is hooped up to the dev board. (i am aware the dev board it self hooks things up to pins) I know 1 pin is properly the on board neo pixel or what ever its called. pehaps that is it.

the board is a: TZT ESP32-S3-DevKitC-1 ESP32-S3 WiFi Bluetooth-compatible BLE 5.0 Mesh Development Board ESP32 Wireless Module N16R8

that is why on: https://plummerssoftwarellc.github.io/NightDriverStrip/ i chose : ESP32-S3-DevKitC-1 / Panlee (only option)

If something NEED to be hooked up that is fine. and i will need to read further, i just started guide and tried the web installer.

Other than trying to use the web installer i have not done anything. (started from the top of the README)

I figured web-installer would be a good start off point. Perhaps that is not a option with the board i got..and i need to dig a little more. and combine and such my self that is eventually my goal i just wanted to do "baby" steps.

in case i missed something i will comment on the points further:

  1. I am not sure what this means. If you think its relevant to this. I will have to read on it more. but form complete read it sounds like 2, 4 and 5 may be more of interest ? as its web installed and no config change ?

  2. Could be because the dev board has something hooped up to a pin that cause a conflict? 2a. i have no comment on this one, other that i tried to look a bit at the link you provided (did not read it all yet) other than the psram parts i could find there

  3. if its something i "need" to do i would have to build my self i would assume since i used web-installer.

  4. I am clueless about this one,

  5. I did not my self attempt to "add" the led's but here is where i guess perhaps my board is simply not supported by the web-installer ? or something and i need to work building my self or what not. ?

Thanks again for your time and long and impressive reply.

fanno commented 5 months ago

Hello

I have managed to compile in vscode took some learning but thats the fun part.

I read a bit on the PSRAM after trying to disable it it is working.

in [env:panlee] build_flags i added: -DENABLE_WIFI=1 -DENABLE_WEBSERVER=1

and removed: ${psram_flags.build_flags}

and that made it all compile and run (no actual strip connected yet)

For modules that include Octal PSRAM (any module that has 8MB PSRAM) you MUST NOT use GPIO35, GPIO36 or GPIO37.

in [env:panlee] i do not see any of this pins used

i got a magnifuing glass my eyes are not what they used to be on the cover plade of the esp32 it says: ESP32-S3-WROVER-I as i said earlier the webside listing was: TZT ESP32-S3-DevKitC-1 ESP32-S3 WiFi Bluetooth-compatible BLE 5.0 Mesh Development Board ESP32 Wireless Module N16R8

from googling ESP32-WROVER-I (NO S3) i can find models with psram

is it possible that this model just do NOT have psram ?

if so did i buy the "wrong" model ? is PSRAM recommended?

I can se HEAP and DMA are both around 95 %

fanno commented 5 months ago

Just a thought, since this is a option that pehaps is board dependend could a option on the webinstalled be

PSRAM / noPSRAM ? so that the option is there for somone who might have same issue as me that maybe dont have the "skills/will" to compile manually ect.

just a idea. its something i could look in to my self aswell i just have something else i wanna look in to first.

fanno commented 5 months ago

i read it wrong it was ESP32-WROOM-I i open another from package and the text was more clear.

it looks like WROOM is without psram ? is that correct ?

robertlipe commented 5 months ago

I'm in mobile, but there are WROOMs without psram inside the "can" (the part inside the certified radio part) but that can have perfectly functional ram chips (usually quad. Or slower) attached to the SPI pins and that have the right fuses. Blow . To tell the startup I'm bios to tell startup code. To recognize additional ram and configure it into the paging/VM code.

This is why more than the number on the can matters.

It's. Also. Probably one of the biggest problems of the esp32. Ecosystem is that actually figuring out what you have in your hands is often so stinking hard. It doesn't help that so many vendors have badly translated doc, if any at all, and often change what's in the box without changing the part numbers or description.

It's. A. Big problem for us and any other project. Trying to support random things. Called "esp32-simething".

Trivia: withing the next quarter or two we'll see the first esp32. Shipments that aren't even 32-bit parts.. ESP32 s. Claim to fame. Was a. 32bit.part.wjtn radios. Esp32-p4 is a. 63 but part... Without radios.

On Thu, Jan 25, 2024, 12:25 PM Morten Hundevad @.***> wrote:

i read it wrong it was ESP32-WROOM-I i open another from package and the text was more clear.

it looks like WROOM is without psram ? is that correct ?

— Reply to this email directly, view it on GitHub https://github.com/PlummersSoftwareLLC/NightDriverStrip/issues/598#issuecomment-1910756915, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCSD37VNZ4YR277ZRP7FMDYQKPSRAVCNFSM6AAAAABCH2TE7OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJQG42TMOJRGU . You are receiving this because you were mentioned.Message ID: @.***>

fanno commented 5 months ago

I see your points, and again thanks for your time.

I am a bit confused. just realize i get this in the. compiler: (both CDS and in a new test project i made (from google sources)) CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32-s3-devkitc-1.html PLATFORM: Espressif 32 (6.5.0) > Espressif ESP32-S3-DevKitC-1-N8 (8 MB QD, No PSRAM)

source code:

#include <Arduino.h>

void setup() {
  Serial.begin(115200);
}

void loop() {
  delay(5000);
  log_d("Total heap: %d", ESP.getHeapSize());
  log_d("Free heap: %d", ESP.getFreeHeap());
  log_d("Total PSRAM: %d", ESP.getPsramSize());
  log_d("Free PSRAM: %d", ESP.getFreePsram());
}

test1 config:

[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
monitor_speed = 115200
build_flags = -DCORE_DEBUG_LEVEL=5
              -DBOARD_HAS_PSRAM
              -mfix-esp32-psram-cache-issue

test1 result:

E (84) psram: PSRAM ID read error: 0x00ffffff, PSRAM chip not found or not supported, or wrong PSRAM line mode
[    83][W][esp32-hal-psram.c:71] psramInit(): PSRAM init failed!
[  5108][D][main.cpp:9] loop(): Total heap: 398468
[  5109][D][main.cpp:10] loop(): Free heap: 373192
[  5109][D][main.cpp:11] loop(): Total PSRAM: 0
[  5111][D][main.cpp:12] loop(): Free PSRAM: 0

test 2 config:

[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
monitor_speed = 115200
build_flags = -DCORE_DEBUG_LEVEL=5
              -DBOARD_HAS_PSRAM
              -mfix-esp32-psram-cache-issue
board_build.arduino.memory_type = dio_opi      

test2 result:

[    85][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled
[  5104][D][main.cpp:9] loop(): Total heap: 396900
[  5104][D][main.cpp:10] loop(): Free heap: 371848
[  5104][D][main.cpp:11] loop(): Total PSRAM: 8386279
[  5107][D][main.cpp:12] loop(): Free PSRAM: 8386019

i have tried adding this to the NDS but the webinterface atleast still show NAN (fresh clone with nothing but secret.h and board_build.arduino.memory_type = dio_opi added to panlee)

Som i have comflicting info but that matches what you talk about in the previous post (about the eccosystem).

could the webreport NAN even tho its actuarly there? as my demo app suggest its there.

BOARD_HAS_PSRAM and USE_PSRAM appear to be on in the active config so i suspect is is on

what is strange tho is that the app no longer crashes when trying to use PSRAM before i would get a the error that started this. i tried doing a fresh clone and just schose panlee that cause the issue earlier i cant recreate it anymore

can changes have be made to the esp32 that is not overwritten when you you send "firmware" ?

from the "clean buuld with only board_build.arduino.memory_type = dio_opi added

Launching Drawing Thread. Mem: 149204, LargestBlk: 139252, PSRAM Free: 0/0, (W) (DrawLoopTaskEntry)(C1) >> DrawLoopTaskEntry

Some images as "prof" and explain a bit. i hope. billede billede

Once again sorry if i am "spamming", and feel free to let me know if i should be posting some where else. (i am trying to learn)

robertlipe commented 5 months ago

Hi, Morten.

On Thu, Jan 25, 2024 at 4:40 PM Morten Hundevad @.***> wrote:

I see your points, and again thanks for your time.

I am a bit confused. just realize i get this in the. compiler: (both CDS and in a new test project i

You use acronyms I don't recognize, but I think we can get this over the finish line.

made (from google sources)) CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32-s3-devkitc-1.html PLATFORM: Espressif 32 (6.5.0) > Espressif ESP32-S3-DevKitC-1-N8 (8 MB QD, No PSRAM)

So here you've told it to use a board configuration specifying NO psram. That's OK, but hold that thought.

source code:

include

void setup() { Serial.begin(115200); }

void loop() { delay(5000); log_d("Total heap: %d", ESP.getHeapSize()); log_d("Free heap: %d", ESP.getFreeHeap()); log_d("Total PSRAM: %d", ESP.getPsramSize()); log_d("Free PSRAM: %d", ESP.getFreePsram()); }

I'd have expected this to fail because psramInit() isn't being called, but we see evidence below that something somewhere is calling it behind yur back. Good thing, because that probably made this conversation shorter.

test1 config:

[env:esp32-s3-devkitc-1] platform = espressif32 board = esp32-s3-devkitc-1 framework = arduino monitor_speed = 115200 build_flags = -DCORE_DEBUG_LEVEL=5 -DBOARD_HAS_PSRAM

  • -mfix-esp32-psram-cache-issue*

test1 result:

E (84) psram: PSRAM ID read error: 0x00ffffff, PSRAM chip not found or not supported, or wrong PSRAM line mode

That's actually a better error than it used to be and is giving you a key hint. The hint is that the psram isn't being configured correctly. There's more to it than psramInit().

[ 83][W][esp32-hal-psram.c:71] psramInit(): PSRAM init failed!

So that's the file calling psramInit() for you. We should thank it on your behalf.

[ 5108][D][main.cpp:9] loop(): Total heap: 398468 [ 5109][D][main.cpp:10] loop(): Free heap: 373192 [ 5109][D][main.cpp:11] loop(): Total PSRAM: 0 [ 5111][D][main.cpp:12] loop(): Free PSRAM: 0

So that's what we expect. A few hundred K of on-die memory and NO psram - because it knows it doesnt work and it's helpfully NOT trying to use it. It used to try to use it, even if a couple of bits were missing, as you can see is the case above. That, as a practical matter, never works. It gave the illusion of trying to work, but reading garbage and that's absolutely worse.

test 2 config:

[env:esp32-s3-devkitc-1] platform = espressif32 board = esp32-s3-devkitc-1 framework = arduino monitor_speed = 115200 build_flags = -DCORE_DEBUG_LEVEL=5 -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue board_build.arduino.memory_type = dio_opi

Two things here. The "fix cache issue" thing is a workaround for the REV0 ESP32-nothing chips. Those chips have been out of circulation for a while and the last time I saw Espressif staff comment on the issue, that workaround was never actually totally effective and they just gave up on it. While it helped, there were still issues.

It's never needed on S3 and it has some performance cost. It is my strong belief that you can delete that without issue.

The second line is canceling out the "you told it you have a board without PSRAM" issue. Here you've told it that you have Dual SPI flash (pretty normal - flash is only so fast) and Octal SPI RAM. I remember deep-diving this and think I remember all 8, 16MB, & 32MB RAM parts made by Espressif having Octal and the 2MB parts (which seem to be pretty rare) using octal.

Qio flash is actually more common, but it's likely that undershooting is OK.

However, once you derive from the right base, this should be provided by the board definition itself. It's finding that base definition that can be tricky.

Where do those board definitions come from in the IDE? It's a combination of the pin definitions from: https://github.com/iotechbugs/esp32-arduino/tree/master/variants ... but the more comprehensive stuff is in Platformio JSON files: https://github.com/platformio/platform-espressif32/tree/develop/boards

Unfortunately, matching one of these to a random $4.32 board you purchased from Ali can be a huge pain which leads people to paper over them like you just have.

The boards I've been using are closer to https://github.com/platformio/platform-espressif32/pull/1270/files This has the advantage of getting the flash ram for my boards correct, too.

Honestly, finding a configuration for the exact combination of CPU core, flash/ram size/size and all pin definitions is kind of a hassle, so I tend to end up writing my own configurations and stuffing them into custom_robertl.ini where I can jam my own boards with my own flags and move on. I thought I submitted a PR that was basically like 1270 for the YD boards, but I can't find evidence of this.

test2 result:

[ 85][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled [ 5104][D][main.cpp:9] loop(): Total heap: 396900 [ 5104][D][main.cpp:10] loop(): Free heap: 371848 [ 5104][D][main.cpp:11] loop(): Total PSRAM: 8386279 [ 5107][D][main.cpp:12] loop(): Free PSRAM: 8386019

Yay! That's the happy place. In MY version, we now do an additional RAM test on startup because I've had to diagnose a caes of "almost working" PSRAM and I have one board (with a tag on it so it's quarrantined) that seems to have broken PSRAM and fails the test. That PR goes to NightDriver soon-ish, but I have another whole family of S3 boards (the Luatos board) that I want to stabilize at the same time.

i have tried adding this to the NDS but the webinterface atleast still show NAN (fresh clone with nothing but secret.h and board_build.arduino.memory_type = dio_opi added to panlee)

I don't know what NAN is.

Please don't submit your patch to us (I'll vote to reject it) but for your configuration, either patch in the "fix" above or just add -DBOARD_HAS_PSRAM, confirm that you don't get nastygrams from psramInit and that our own memory tests shows that you have 8,000,000-ish bytes of PSRAM. We have announcements on boot and then evry few (five?) seconds.

src/main.cpp: debugI(" PSRAM Total:%u, PSRAM Free: %u.", src/main.cpp: debugI("ESP32 PSRAM not configured."); [ ... ] src/main.cpp:#if USE_PSRAM src/main.cpp: strOutput += str_sprintf(", PSRAM Free: %u/%u, ", ESP.getFreePsram(), ESP.getPsramSize()); src/main.cpp: strOutput += "PSRAM: not configured";

Som i have comflicting info but that matches what you talk about in the previous post (about the eccosystem).

About it being possible, but messy? Yes, exactly. :-)

could the webreport NAN even tho its actuarly there? as my demo app suggest its there.

Let's get your PSRAM situation happy and passing all the tests.

I think you're saying the web interface isn't working.

I don't really know what a PANLEE is. I think it's one of these: https://www.robotshop.com/products/smart-panlee-esp32-s3-dev-board-wt32-4-3-smart-serial-lcd-display-module

If you look in platform.ini, you'll see that it configures a bunch of hardware like a screen and stuff that you probably don't have if you have a relateively bare module.

I don't think I see any pins being used that are on the Do Not Use lists from, say, https://www.atomic14.com/2023/11/21/esp32-s3-pins.html but it's definitely going to try to wiggle a bunch of pins that probably aren't connected and likely be unhappy when finding pins that don't wiggle back.

Reconfiguring the SPI freq when your memory happens on be on SPI is definitely a bold move. Scary!

BOARD_HAS_PSRAM and USE_PSRAM appear to be on in the active config so i suspect is is on

My own S3 boards that are like the YD use configurations like:

E=esp32-s3-devkitc-1-n16r8v

E=yd-esp32-s3-demo

and entries like: ; Bare development module with Uses ESP32-S3-WROOM-1 module as N8R2 or N16R8 ; Specifically https://www.aliexpress.us/item/3256805600763040.html ; Picture shows "YD-ESP32-S3", but actual silk screen sayd "YD-ESP32-23" ; Probably a clone of https://www.aliexpress.us/item/3256805600763040.html ; This is hard for us to get right when Platformio itself screws this up. [dev_yd-esp32-s3] extends = esp32-s3-devkitc-1-n16r8v build_flags = ${dev_esp32-s3.build_flags}

; YD-ESP32-S3 [env:yd-esp32-s3-demo] extends = dev_yd-esp32-s3 build_flags = -DDEMO=1 -DENABLE_WIFI=1 ${dev_yd-esp32-s3.build_flags}

And here's esp32-s3-devkitc-1-n16r8v.json file:

{ "build": { "arduino":{ "ldscript": "esp32s3_out.ld", "partitions": "default_16MB.csv" }, "core": "esp32", "extra_flags": [ "-DARDUINO_ESP32S3_DEV", "-DARDUINO_USB_MODE=1", "-DARDUINO_RUNNING_CORE=1", "-DARDUINO_EVENT_RUNNING_CORE=1" ], "f_cpu": "240000000L", "f_flash": "80000000L", "flash_mode": "qio", "hwids": [ [ "0x303A", "0x1001" ] ], "mcu": "esp32s3", "variant": "esp32s3" }, "connectivity": [ "wifi" ], "debug": { "default_tool": "esp-builtin", "onboard_tools": [ "esp-builtin" ], "openocd_target": "esp32s3.cfg" }, "frameworks": [ "arduino", "espidf" ], "name": "Espressif ESP32-S3-DevKitC-1-N16R8V (16 MB QD, WITH PSRAM)", "upload": { "flash_size": "16MB", "maximum_ram_size": 327680, "maximum_size": 16777216, "require_upload_port": true, "speed": 460800 }, "url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitc-1.html", "vendor": "Espressif"}

... though I haven't submitted this as a PR yet because I have other work tangled in with it. (Plus it's still wrong in some minor ways, like the URL and comments being lies.) I think it'll serve as a recipe for basic happiness of getting DEMO running out of PIN5 or whatever it is without all the LED stuff.

what is strange tho is that the app no longer crashes when trying to use PSRAM before i would get a the error that started this.

A wise man once said:

As a concluding punchline, we know this is related to PSRAM somehow. Your configuration is requesting 1.744.000 bytes. Without PSRAM, you're only going to ever have tiny fraction of that amount. So you need to build a simpler configuration that doesn't NEED psram or you need to figure out sy the psraminit is failing. (My money says that you have something else connected to the SPI lines.)

It looks like I'd have lost my money, but the punchline was right, even though you never did post the decoded stack traces we asked for. Your PSRAM configuration was broken. We tried to use it and crashed when the PSRAM wasn't there.

i tried doing a fresh clone and just schose panlee that cause the issue earlier i cant recreate it anymore

can changes have be made to the esp32 that is not overwritten when you you send "firmware" ?

Yes (there's a filesystem "disk image" on the chip) but I don't think this is it.

from the "clean buuld with only board_build.arduino.memory_type = dio_opi added

Launching Drawing Thread. Mem: 149204, LargestBlk: 139252, PSRAM Free: 0/0, (W) (DrawLoopTaskEntry)(C1) >> DrawLoopTaskEntry

Some images as "prof" and explain a bit. i hope. billede.png (view on web) https://github.com/PlummersSoftwareLLC/NightDriverStrip/assets/63506/b0780603-a933-4cbd-ab0d-10a06ad73ff4 billede.png (view on web) https://github.com/PlummersSoftwareLLC/NightDriverStrip/assets/63506/0a09e887-89cc-4d06-aa36-c71d38199f37

Once again sorry if i am "spamming", and feel free to let me know if i should be posting some where else. (i am trying to learn)

I'm just the bartender, but IMO this is a perfectly reasonable conversation to have here. There are just too many variations flying around so it seems like we have to debug every one of them a few lines at a time.

Let's skip past the "get the chip type right in your SDK" part and focus on just the two flags that are key. (We'll worry about the 16MB filesystm later.) If you don't actually have a panlee, let's go with just theese flags dpo_opi (probably qpi_opi) -DUSE_PSRAM (tells us to use it) -DDBOARD_HAS_PSRAM (tells the OS that it's there and should use it)

Dial that in and confirm that your tiny little test program is happy. Derive from a simpler board, like the configurations I outlined or adafruit_feather_esp32s3

If I were king, i'd remove all the psram stuff from our ini file and insist on using the right board files, but the retest cost of "fixing" that would be me ordering one of everything and that's just not in my toy budget.

I think you're really close! The existence proof of PSRAM working shows that you're almost in a happy place. I'd bet my yd-esp32-s3-demo should Just Work for you.

It does seem like I've had this basic discussion often enough that I should probably cleave my "solve everything with the S3 boards" part from "make commodity YD-style boards just work and add a DEMO configuration" part. I'll stew on that during my next hacking opportunity. I "just" need to get at least yd-n16rr8 and the luatos boards running. The luatos boards are a pain because they don't use the Espressif "cans" and the psram configuration is thus slightly different.

Oh, and the UART situation is different on the boards like YD that have two USB ports (a real uart and the S3's on CDC/ACM uart) and one port (luatos has one port and a teeensy little switch).

RJL

Message ID: <PlummersSoftwareLLC/NightDriverStrip/issues/598/1911112699@ github.com>

robertlipe commented 5 months ago

Also, looking at platformio, they don't list a single board with > 2MB of psram and only a few of those. There's a year-old bugreport that they're closing all contributions against, but not accepting the PRs.

I don't know if it applies to ESP, but the Platformio guys have kind of an ongoing tiff with the board makers have a running tiff with some of the silicon vendors. They think the chip vendors should be helping to foot the development bill - in cash, not code - and have been aggressively blocking some motion. (I think rp2040 is the most visibly affected platform...) So there may be some non-technical reasons at play on why Platformio works badly on any modern ESP32 parts. :-(

I learned a somewhat hard lesson just yesterday that the pinout for the DevKit-C-1 is different for -S3 than for -nothing. Make sense. There are more pins...But my socket "helpfully" connected all the ground pins together and I had pins dangling off the end. It wasn't pretty, but I got the power killed before the chip got TOO hot.

On Thu, Jan 25, 2024 at 6:23 PM Robert Lipe @.***> wrote:

Hi, Morten.

On Thu, Jan 25, 2024 at 4:40 PM Morten Hundevad @.***> wrote:

I see your points, and again thanks for your time.

I am a bit confused. just realize i get this in the. compiler: (both CDS and in a new test project i

You use acronyms I don't recognize, but I think we can get this over the finish line.

made (from google sources)) CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32-s3-devkitc-1.html PLATFORM: Espressif 32 (6.5.0) > Espressif ESP32-S3-DevKitC-1-N8 (8 MB QD, No PSRAM)

So here you've told it to use a board configuration specifying NO psram. That's OK, but hold that thought.

source code:

include

void setup() { Serial.begin(115200); }

void loop() { delay(5000); log_d("Total heap: %d", ESP.getHeapSize()); log_d("Free heap: %d", ESP.getFreeHeap()); log_d("Total PSRAM: %d", ESP.getPsramSize()); log_d("Free PSRAM: %d", ESP.getFreePsram()); }

I'd have expected this to fail because psramInit() isn't being called, but we see evidence below that something somewhere is calling it behind yur back. Good thing, because that probably made this conversation shorter.

test1 config:

[env:esp32-s3-devkitc-1] platform = espressif32 board = esp32-s3-devkitc-1 framework = arduino monitor_speed = 115200 build_flags = -DCORE_DEBUG_LEVEL=5 -DBOARD_HAS_PSRAM

  • -mfix-esp32-psram-cache-issue*

test1 result:

E (84) psram: PSRAM ID read error: 0x00ffffff, PSRAM chip not found or not supported, or wrong PSRAM line mode

That's actually a better error than it used to be and is giving you a key hint. The hint is that the psram isn't being configured correctly. There's more to it than psramInit().

[ 83][W][esp32-hal-psram.c:71] psramInit(): PSRAM init failed!

So that's the file calling psramInit() for you. We should thank it on your behalf.

[ 5108][D][main.cpp:9] loop(): Total heap: 398468 [ 5109][D][main.cpp:10] loop(): Free heap: 373192 [ 5109][D][main.cpp:11] loop(): Total PSRAM: 0 [ 5111][D][main.cpp:12] loop(): Free PSRAM: 0

So that's what we expect. A few hundred K of on-die memory and NO psram - because it knows it doesnt work and it's helpfully NOT trying to use it. It used to try to use it, even if a couple of bits were missing, as you can see is the case above. That, as a practical matter, never works. It gave the illusion of trying to work, but reading garbage and that's absolutely worse.

test 2 config:

[env:esp32-s3-devkitc-1] platform = espressif32 board = esp32-s3-devkitc-1 framework = arduino monitor_speed = 115200 build_flags = -DCORE_DEBUG_LEVEL=5 -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue board_build.arduino.memory_type = dio_opi

Two things here. The "fix cache issue" thing is a workaround for the REV0 ESP32-nothing chips. Those chips have been out of circulation for a while and the last time I saw Espressif staff comment on the issue, that workaround was never actually totally effective and they just gave up on it. While it helped, there were still issues.

It's never needed on S3 and it has some performance cost. It is my strong belief that you can delete that without issue.

The second line is canceling out the "you told it you have a board without PSRAM" issue. Here you've told it that you have Dual SPI flash (pretty normal - flash is only so fast) and Octal SPI RAM. I remember deep-diving this and think I remember all 8, 16MB, & 32MB RAM parts made by Espressif having Octal and the 2MB parts (which seem to be pretty rare) using octal.

Qio flash is actually more common, but it's likely that undershooting is OK.

However, once you derive from the right base, this should be provided by the board definition itself. It's finding that base definition that can be tricky.

Where do those board definitions come from in the IDE? It's a combination of the pin definitions from: https://github.com/iotechbugs/esp32-arduino/tree/master/variants ... but the more comprehensive stuff is in Platformio JSON files: https://github.com/platformio/platform-espressif32/tree/develop/boards

Unfortunately, matching one of these to a random $4.32 board you purchased from Ali can be a huge pain which leads people to paper over them like you just have.

The boards I've been using are closer to https://github.com/platformio/platform-espressif32/pull/1270/files This has the advantage of getting the flash ram for my boards correct, too.

Honestly, finding a configuration for the exact combination of CPU core, flash/ram size/size and all pin definitions is kind of a hassle, so I tend to end up writing my own configurations and stuffing them into custom_robertl.ini where I can jam my own boards with my own flags and move on. I thought I submitted a PR that was basically like 1270 for the YD boards, but I can't find evidence of this.

test2 result:

[ 85][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled [ 5104][D][main.cpp:9] loop(): Total heap: 396900 [ 5104][D][main.cpp:10] loop(): Free heap: 371848 [ 5104][D][main.cpp:11] loop(): Total PSRAM: 8386279 [ 5107][D][main.cpp:12] loop(): Free PSRAM: 8386019

Yay! That's the happy place. In MY version, we now do an additional RAM test on startup because I've had to diagnose a caes of "almost working" PSRAM and I have one board (with a tag on it so it's quarrantined) that seems to have broken PSRAM and fails the test. That PR goes to NightDriver soon-ish, but I have another whole family of S3 boards (the Luatos board) that I want to stabilize at the same time.

i have tried adding this to the NDS but the webinterface atleast still show NAN (fresh clone with nothing but secret.h and board_build.arduino.memory_type = dio_opi added to panlee)

I don't know what NAN is.

Please don't submit your patch to us (I'll vote to reject it) but for your configuration, either patch in the "fix" above or just add -DBOARD_HAS_PSRAM, confirm that you don't get nastygrams from psramInit and that our own memory tests shows that you have 8,000,000-ish bytes of PSRAM. We have announcements on boot and then evry few (five?) seconds.

src/main.cpp: debugI(" PSRAM Total:%u, PSRAM Free: %u.", src/main.cpp: debugI("ESP32 PSRAM not configured."); [ ... ] src/main.cpp:#if USE_PSRAM src/main.cpp: strOutput += str_sprintf(", PSRAM Free: %u/%u, ", ESP.getFreePsram(), ESP.getPsramSize()); src/main.cpp: strOutput += "PSRAM: not configured";

Som i have comflicting info but that matches what you talk about in the previous post (about the eccosystem).

About it being possible, but messy? Yes, exactly. :-)

could the webreport NAN even tho its actuarly there? as my demo app suggest its there.

Let's get your PSRAM situation happy and passing all the tests.

I think you're saying the web interface isn't working.

I don't really know what a PANLEE is. I think it's one of these: https://www.robotshop.com/products/smart-panlee-esp32-s3-dev-board-wt32-4-3-smart-serial-lcd-display-module

If you look in platform.ini, you'll see that it configures a bunch of hardware like a screen and stuff that you probably don't have if you have a relateively bare module.

I don't think I see any pins being used that are on the Do Not Use lists from, say, https://www.atomic14.com/2023/11/21/esp32-s3-pins.html but it's definitely going to try to wiggle a bunch of pins that probably aren't connected and likely be unhappy when finding pins that don't wiggle back.

Reconfiguring the SPI freq when your memory happens on be on SPI is definitely a bold move. Scary!

BOARD_HAS_PSRAM and USE_PSRAM appear to be on in the active config so i suspect is is on

My own S3 boards that are like the YD use configurations like:

E=esp32-s3-devkitc-1-n16r8v

E=yd-esp32-s3-demo

and entries like: ; Bare development module with Uses ESP32-S3-WROOM-1 module as N8R2 or N16R8 ; Specifically https://www.aliexpress.us/item/3256805600763040.html ; Picture shows "YD-ESP32-S3", but actual silk screen sayd "YD-ESP32-23" ; Probably a clone of https://www.aliexpress.us/item/3256805600763040.html ; This is hard for us to get right when Platformio itself screws this up. [dev_yd-esp32-s3] extends = esp32-s3-devkitc-1-n16r8v build_flags = ${dev_esp32-s3.build_flags}

; YD-ESP32-S3 [env:yd-esp32-s3-demo] extends = dev_yd-esp32-s3 build_flags = -DDEMO=1 -DENABLE_WIFI=1 ${dev_yd-esp32-s3.build_flags}

And here's esp32-s3-devkitc-1-n16r8v.json file:

{ "build": { "arduino":{ "ldscript": "esp32s3_out.ld", "partitions": "default_16MB.csv" }, "core": "esp32", "extra_flags": [ "-DARDUINO_ESP32S3_DEV", "-DARDUINO_USB_MODE=1", "-DARDUINO_RUNNING_CORE=1", "-DARDUINO_EVENT_RUNNING_CORE=1" ], "f_cpu": "240000000L", "f_flash": "80000000L", "flash_mode": "qio", "hwids": [ [ "0x303A", "0x1001" ] ], "mcu": "esp32s3", "variant": "esp32s3" }, "connectivity": [ "wifi" ], "debug": { "default_tool": "esp-builtin", "onboard_tools": [ "esp-builtin" ], "openocd_target": "esp32s3.cfg" }, "frameworks": [ "arduino", "espidf" ], "name": "Espressif ESP32-S3-DevKitC-1-N16R8V (16 MB QD, WITH PSRAM)", "upload": { "flash_size": "16MB", "maximum_ram_size": 327680, "maximum_size": 16777216, "require_upload_port": true, "speed": 460800 }, "url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitc-1.html", "vendor": "Espressif"}

... though I haven't submitted this as a PR yet because I have other work tangled in with it. (Plus it's still wrong in some minor ways, like the URL and comments being lies.) I think it'll serve as a recipe for basic happiness of getting DEMO running out of PIN5 or whatever it is without all the LED stuff.

what is strange tho is that the app no longer crashes when trying to use PSRAM before i would get a the error that started this.

A wise man once said:

As a concluding punchline, we know this is related to PSRAM somehow. Your configuration is requesting 1.744.000 bytes. Without PSRAM, you're only going to ever have tiny fraction of that amount. So you need to build a simpler configuration that doesn't NEED psram or you need to figure out sy the psraminit is failing. (My money says that you have something else connected to the SPI lines.)

It looks like I'd have lost my money, but the punchline was right, even though you never did post the decoded stack traces we asked for. Your PSRAM configuration was broken. We tried to use it and crashed when the PSRAM wasn't there.

i tried doing a fresh clone and just schose panlee that cause the issue earlier i cant recreate it anymore

can changes have be made to the esp32 that is not overwritten when you you send "firmware" ?

Yes (there's a filesystem "disk image" on the chip) but I don't think this is it.

from the "clean buuld with only board_build.arduino.memory_type = dio_opi added

Launching Drawing Thread. Mem: 149204, LargestBlk: 139252, PSRAM Free: 0/0, (W) (DrawLoopTaskEntry)(C1) >> DrawLoopTaskEntry

Some images as "prof" and explain a bit. i hope. billede.png (view on web) https://github.com/PlummersSoftwareLLC/NightDriverStrip/assets/63506/b0780603-a933-4cbd-ab0d-10a06ad73ff4 billede.png (view on web) https://github.com/PlummersSoftwareLLC/NightDriverStrip/assets/63506/0a09e887-89cc-4d06-aa36-c71d38199f37

Once again sorry if i am "spamming", and feel free to let me know if i should be posting some where else. (i am trying to learn)

I'm just the bartender, but IMO this is a perfectly reasonable conversation to have here. There are just too many variations flying around so it seems like we have to debug every one of them a few lines at a time.

Let's skip past the "get the chip type right in your SDK" part and focus on just the two flags that are key. (We'll worry about the 16MB filesystm later.) If you don't actually have a panlee, let's go with just theese flags dpo_opi (probably qpi_opi) -DUSE_PSRAM (tells us to use it) -DDBOARD_HAS_PSRAM (tells the OS that it's there and should use it)

Dial that in and confirm that your tiny little test program is happy. Derive from a simpler board, like the configurations I outlined or adafruit_feather_esp32s3

If I were king, i'd remove all the psram stuff from our ini file and insist on using the right board files, but the retest cost of "fixing" that would be me ordering one of everything and that's just not in my toy budget.

I think you're really close! The existence proof of PSRAM working shows that you're almost in a happy place. I'd bet my yd-esp32-s3-demo should Just Work for you.

It does seem like I've had this basic discussion often enough that I should probably cleave my "solve everything with the S3 boards" part from "make commodity YD-style boards just work and add a DEMO configuration" part. I'll stew on that during my next hacking opportunity. I "just" need to get at least yd-n16rr8 and the luatos boards running. The luatos boards are a pain because they don't use the Espressif "cans" and the psram configuration is thus slightly different.

Oh, and the UART situation is different on the boards like YD that have two USB ports (a real uart and the S3's on CDC/ACM uart) and one port (luatos has one port and a teeensy little switch).

RJL

Message ID: <PlummersSoftwareLLC/NightDriverStrip/issues/598/1911112699@ github.com>

fanno commented 5 months ago

Thanks once again for taking the time to help i cant stress enough how much i appreciate it.

You said -DDBOARD_HAS_PSRAM, i assume its type and shuld be -DBOARD_HAS_PSRAM is this correct or should there be Dx2

JSON FILE/BOARD when trying to use the board you provided. I created the json file you providede inside (esp32-s3-devkitc-1-n16r8v.json) c:\Users\MOHU.platformio\platforms\espressif32\boards\

from reading https://docs.platformio.org/en/stable/platforms/creating_board.html I am getting: Error: BoardConfig: Board is not defined

or is this folder for something else, or do i need to do something different with the file.

when trying it with the nightdriverstrip

[env:demo2]
extends         = dev_yd-esp32-s3
build_flags     = -DDEMO=1
                  -DENABLE_WIFI=1
                  -DBOARD_HAS_PSRAM 
                  -DUSE_PSRAM
                  ${dev_yd-esp32-s3.build_flags}
board_build.arduino.memory_type = dio_opi          

A bit more experimentation on the tiny demo app i made, i changed the code with 1 line to test:

void loop() {
  delay(5000);
  log_d("Total heap: %d", ESP.getHeapSize());
  log_d("Free heap: %d", ESP.getFreeHeap());
  log_d("Total PSRAM: %d", ESP.getPsramSize());
  log_d("Free PSRAM: %d", ESP.getFreePsram());

  byte* psdRamBuffer = (byte*)ps_malloc(1000);

}

result:

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x44c
load:0x403c9700,len:0xbd8
load:0x403cc700,len:0x2a80
entry 0x403c98d0
[    85][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled
[  5104][D][main.cpp:9] loop(): Total heap: 396900
[  5104][D][main.cpp:10] loop(): Free heap: 371848
[  5104][D][main.cpp:11] loop(): Total PSRAM: 8386279
[  5107][D][main.cpp:12] loop(): Free PSRAM: 8386019 <<<<<<<<<<<<
[ 10112][D][main.cpp:9] loop(): Total heap: 396900
[ 10112][D][main.cpp:10] loop(): Free heap: 371848
[ 10112][D][main.cpp:11] loop(): Total PSRAM: 8386263
[ 10115][D][main.cpp:12] loop(): Free PSRAM: 8385003 <<<<<<<<<<<<
[ 15119][D][main.cpp:9] loop(): Total heap: 396900
[ 15119][D][main.cpp:10] loop(): Free heap: 371848
[ 15119][D][main.cpp:11] loop(): Total PSRAM: 8386247
[ 15122][D][main.cpp:12] loop(): Free PSRAM: 8383987 <<<<<<<<<<<<

I added the ps_malloc, and i can see everytime it loops it Free PSRAM goes down by a bit over 1000 (i assume the overhead above 1000 has to do with referance data/pointer or something to the data.)

so maybe i am confused or asking the wrong question. if it appear its working in the tiny app i made why would the board_build.arduino.memory_type = dio_opi not work with say enc:demo when adding -DBOARD_HAS_PSRAM,- DUSE_PSRAM

you also asked about the nastygram from init is there anything special you need for that ? created demo2 below

[env:demo2]
extends         = dev_esp32-s3
build_flags     = -DDEMO=1
                  -DCORE_DEBUG_LEVEL=5
                  -DENABLE_WIFI=1
                  -DBOARD_HAS_PSRAM 
                  -DUSE_PSRAM
                  ${dev_yd-esp32-s3.build_flags}
board_build.arduino.memory_type = dio_opi           

results: (this is with board_build.arduino.memory_type = dio_opi but PSram show as 0/0 when not using this as well (initiallt app crashed but now i cant recreate that as i said earlier.))

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x44c
load:0x403c9700,len:0xbd8
load:0x403cc700,len:0x2a80
entry 0x403c98d0
E (273) esp_core_dump_flash: No core dump partition found!
E (273) esp_core_dump_flash: No core dump partition found!
Replacing Idle Tasks with TaskManager...
(I) (PrintOutputHeader)(C1) NightDriverStrip
(I)
(I) (PrintOutputHeader)(C1) ------------------------------------------------------------------------------------------------------------
(I) (PrintOutputHeader)(C1) M5STICKC: 0, USE_M5DISPLAY: 0, USE_OLED: 0, USE_TFTSPI: 0, USE_LCD: 0, USE_AUDIO: 0, ENABLE_REMOTE: 0
(I) (PrintOutputHeader)(C1) Version 40: Wifi SSID: "******************" - ESP32 Free Memory: 302724, PSRAM:0, PSRAM Free: 0
(I) (PrintOutputHeader)(C1) ESP32 Clock Freq : 240 MHz
(I) (setup)(C1) Startup!
(I) (setup)(C1) Starting DebugLoopTaskEntry
>> Launching Debug Thread.  Mem: 302724, LargestBlk: 270324, PSRAM Free: 0/0, (W) (ReadWiFiConfig)(C1) Retrieved SSID and Password from NVS: "******************", "********"
(W) (setup)(C1) Starting ImprovSerial for ESP32-S3
[   634][E][vfs_api.cpp:182] remove(): /improv.log does not exists or is directory
(I) (setup)(C1) Sending Improv packet to declare we're up. Ignore any IMPROV lines that follow this one.
IMPROV�
>> Launching JSON Writer Thread.  Mem: 293964, LargestBlk: 270324, PSRAM Free: 0/0, (I) (LoadJSONFile)(C1) Attempting to read JSON file /device.cfg
(I) (DeviceConfig)(C1) Loading DeviceConfig from JSON
(W) (InitializeHardware)(C1) Allocating LEDStripGFX for channel 0
(I) (AddLEDsToFastLED)(C1) Adding LEDs to FastLED...
(I) (AddLEDsToFastLED)(C1) Adding 1152 LEDs to pin 5 from channel 0 on FastLED.
(W) (SetupBufferManagers)(C1) Reserving 37 LED buffers for a total of 129056 bytes...
(W) (InitEffectsManager)(C1) InitEffectsManager...
(I) (LoadJSONFile)(C1) Attempting to read JSON file /effects.cfg
(I) (InitEffectsManager)(C1) Creating EffectManager from JSON config
(I) (ReadCurrentEffectIndex)(C1) Attempting to read file /current.cfg
>> Launching Drawing Thread.  Mem: 149212, LargestBlk: 139252, PSRAM Free: 0/0, (W) (DrawLoopTaskEntry)(C1) >> DrawLoopTaskEntry
(W)
(W) (DrawLoopTaskEntry)(C1) Entering main drawect to WiFi.I) (setup)(C1) Making initial attempt to connect to WiFi.
(I) (ConnectToWiFi)(C1) WiFi credentials passed for SSID "******************"
(I) (ConnectToWiFi)(C1) Setting host name to ESP32-S3-ND1...
(W) (ConnectToWiFi)(C1) Connecting to Wifi SSID: "******************" - ESP32 Free Memory: 92280, PSRAM:0, PSRAM Free: 0
(W)
(W) (ConnectToWiFi)(C1) Not yet connected to WiFi, waiting...
>> Launching Network Thread.  Mem: 92224, LargestBlk: 81908, PSRAM Free: 0/0, >> Launching Socket Thread.  Mem: 78040, LargestBlk: 69620, PSRAM Free: 0/0, (W) (NotifyJSONWriterThread)(C1) >> Notifying JSON Writer Thread
(W) (ConnectToWiFi)(C1) Not yet connected to WiFi, waiting...
(W) (ConnectToWiFi)(C1) Not yet connected to WiFi, waiting...
(I) (loop)(C1) Sending Improv packets to indicate WiFi is connected. Ignore any IMPROV lines that follow this one.
IMPROV�
IMPROVhttp://192.168.87.123G
(W) (ConnectToWiFi)(C1) Connected to AP with BSSID: "08:9B:B9:E5:3F:4A", received IP: 192.168.87.123
(I) (ConnectToWiFi)(C1) Starting/restarting Socket Server...
(W) (ProcessIncomingConnectionsLoop)(C1) Error accepting data!
(W) (SocketServerTaskEntry)(C1) Socket connection closed.  Retrying...
(I)
I)
tToWiFi)(C1) Socket server started.
(I) (ConnectToWiFi)(C1) Publishing OTA...
(I) (SaveToJSONFile)(C0) Number of bytes written to JSON file /effects.cfg: 128
(I) (ConnectToWiFi)(C1) Setting Clock...
[  4439][E][WiFiUdp.cpp:221] parsePacket(): could not receive data: 9
(W) (UpdateClockFromWeb)(C1) NTP clock: Raw values sec=459991403, usec=107100
(I) (UpdateClockFromWeb)(C1) Old Time: 4.272090, New Time: 1706286452.107100, Delta: 1706286447.835010
(I) (UpdateClockFromWeb)(C1) Adjusting time by 1706286447.835010 to 1706286452.107100
(I) (UpdateClockFromWeb)(C1) NTP clock: response received, updated time to: 1706286452.107100, DELTA: 1706286447.835010
(I)
(I) (ConnectToWiFi)(C1) Starting Web Server...
(I) (begin)(C1) Embedded html file size: 507
(I) (begin)(C1) Embedded jsx file size: 15320
(I) (begin)(C1) Embedded ico file size: 6471
(I) (begin)(C1) Embedded timezones file size: 18359
(I) (begin)(C1) Connecting Web Endpoints
(I) (begin)(C1) HTTP server started
(I) (ConnectToWiFi)(C1) Web Server begin called!
(I) (loop)(C1) WiFi: WL_CONNECTED, IP: 192.168.87.123, Mem: 36084, LargestBlk: 26100, PSRAM Free: 0/0, LED FPS: 21 LED Bright: 100%, LED Watts: 30, Buffer: 0/37, CPU: 007%, 019%, FreeDraw: 0.020
(I) (loop)(C1) WiFi: WL_CONNECTED, IP: 192.168.87.123, Mem: 37556, LargestBlk: 26100, PSRAM Free: 0/0, LED FPS: 19 LED Bright: 100%, LED Watts: 30, Buffer: 0/37, CPU: 000%, 002%, FreeDraw: 0.009
(I) (loop)(C1) WiFi: WL_CONNECTED, IP: 192.168.87.123, Mem: 37556, LargestBlk: 26100, PSRAM Free: 0/0, LED FPS: 24 LED Bright: 100%, LED Watts: 30, Buffer: 0/37, CPU: 001%, 003%, FreeDraw: 0.016
(I) (loop)(C1) WiFi: WL_CONNECTED, IP: 192.168.87.123, Mem: 36748, LargestBlk: 26100, PSRAM Free: 0/0, LED FPS: 19 LED Bright: 100%, LED Watts: 30, Buffer: 0/37, CPU: 001%, 002%, FreeDraw: 0.030
(W) (NotifyJSONWriterThread)(C1) >> Notifying JSON Writer Thread
(I) (WriteCurrentEffectIndexFile)(C0) Number of bytes written to file /current.cfg: 1
(I) (loop)(C1) WiFi: WL_CONNECTED, IP: 192.168.87.123, Mem: 37556, LargestBlk: 26100, PSRAM Free: 0/0, LED FPS: 18 LED Bright: 100%, LED Watts: 30, Buffer: 0/37, CPU: 001%, 002%, FreeDraw: 0.009
(I) (loop)(C1) WiFi: WL_CONNECTED, IP: 192.168.87.123, Mem: 37556, LargestBlk: 26100, PSRAM Free: 0/0, LED FPS: 22 LED Bright: 100%, LED Watts: 30, Buffer: 0/37, CPU: 001%, 002%, FreeDraw: 0.009
(I) (loop)(C1) WiFi: WL_CONNECTED, IP: 192.168.87.123, Mem: 37556, LargestBlk: 26100, PSRAM Free: 0/0, LED FPS: 23 LED Bright: 100%, LED Watts: 30, Buffer: 0/37, CPU: 000%, 002%, FreeDraw: 0.015
(I) (loop)(C1) WiFi: WL_CONNECTED, IP: 192.168.87.123, Mem: 37556, LargestBlk: 26100, PSRAM Free: 0/0, LED FPS: 19 LED Bright: 100%, LED Watts: 30, Buffer: 0/37, CPU: 001%, 002%, FreeDraw: 0.006
(W) (NotifyJSONWriterThread)(C1) >> Notifying JSON Writer Thread
(I) (WriteCurrentEffectIndexFile)(C0) Number of bytes written to file /current.cfg: 1
(I) (loop)(C1) WiFi: WL_CONNECTED, IP: 192.168.87.123, Mem: 37556, LargestBlk: 26100, PSRAM Free: 0/0, LED FPS: 19 LED Bright: 100%, LED Watts: 30, Buffer: 0/37, CPU: 000%, 002%, FreeDraw: 0.016
(I) (loop)(C1) WiFi: WL_CONNECTED, IP: 192.168.87.123, Mem: 37556, LargestBlk: 26100, PSRAM Free: 0/0, LED FPS: 20 LED Bright: 100%, LED Watts: 30, Buffer: 0/37, CPU: 001%, 002%, FreeDraw: 0.031
(I) (loop)(C1) WiFi: WL_CONNECTED, IP: 192.168.87.123, Mem: 37556, LargestBlk: 26100, PSRAM Free: 0/0, LED FPS: 15 LED Bright: 100%, LED Watts: 30, Buffer: 0/37, CPU: 001%, 001%, FreeDraw: 0.030
(I) (loop)(C1) WiFi: WL_CONNECTED, IP: 192.168.87.123, Mem: 37556, LargestBlk: 26100, PSRAM Free: 0/0, LED FPS: 15 LED Bright: 100%, LED Watts: 30, Buffer: 0/37, CPU: 000%, 002%, FreeDraw: 0.012

I am sure i have not addressed everything in your previous message. i figured i would put this out as i go throw everytihng in your reply further.

-Morten

fanno commented 5 months ago

Ok i think i founed something. (maybe)

in main.cpp -> void PrintOutputHeader()

    #if USE_PSRAM
        debugI("ESP32 PSRAM Init: %s", psramInit() ? "OK" : "FAIL");
    #endif

when i edit the file and have selected the env:demo2 slightly modifyed config off to and added PSRAM as show in previous message ESP32 PSRAM Init: ...... do not appear in the log so USE_PSRAM must be 0 ?

This would be why the crash do not happen anymore as it dont try to use it. ? and why its showing 0/0?

How can this be ? i was under the impressin such things cant be redefined "runtime" or could there be something else at foot i am missing.

fanno commented 5 months ago

Now i am really confused.

i added: (in PrintOutputHeader)

    debugI("TestTestTest"); <<<<<<<<<<<<<<<<

    #if USE_PSRAM
        debugI("ESP32 PSRAM Init: %s", psramInit() ? "OK" : "FAIL");
    #endif

this also do not appear. i also tried changing some of the exsisting ones.

Can i make changes without them getting compiled ? i have tried clean and build then upload no chance.

this also explains some how why the i am not able to recreate the issue i guess.

robertlipe commented 5 months ago

On Fri, Jan 26, 2024 at 10:43 AM Morten Hundevad @.***> wrote:

Thanks once again for taking the time to help i cant stress enough how much i appreciate it.

You said -DDBOARD_HAS_PSRAM, i assume its type and shuld be -DBOARD_HAS_PSRAM is this correct or should there be Dx2

One. I'm, unfortunately, a human. You're wise to check the nonsense I spew. :-)

I added the ps_malloc, and i can see everytime it loops it Free PSRAM goes down by a bit over 1000 (i assume the overhead above 1000 has to do with referance data/pointer or something to the data.)

Yes, overhead is expected.

so maybe i am confused or asking the wrong question. if it appear its working in the tiny app i made why would the board_build.arduino.memory_type = dio_opi not work with say enc:demo when adding -DBOARD_HAS_PSRAM,- DUSE_PSRAM

you also asked about the nastygram from init is there anything special you need for that ? created demo2 below

[env:demo2] extends = dev_esp32-s3 build_flags = -DDEMO=1 -DCORE_DEBUG_LEVEL=5 -DENABLE_WIFI=1 -DBOARD_HAS_PSRAM -DUSE_PSRAM ${dev_yd-esp32-s3.build_flags} board_build.arduino.memory_type = dio_opi

[ ... ]

(I) (PrintOutputHeader)(C1) ------------------------------------------------------------------------------------------------------------ (I) (PrintOutputHeader)(C1) M5STICKC: 0, USE_M5DISPLAY: 0, USE_OLED: 0, USE_TFTSPI: 0, USE_LCD: 0, USE_AUDIO: 0, ENABLE_REMOTE: 0 (I) (PrintOutputHeader)(C1) Version 40: Wifi SSID: "**" - ESP32 Free Memory: 302724, PSRAM:0, PSRAM Free: 0 (I) (PrintOutputHeader)(C1) ESP32 Clock Freq : 240 MHz (I) (setup)(C1) Startup!

I've actually "fixed" this annoyance in my local tree, but what you're seeing corresponds to the top of src/main.cc in PrintOutputHeader()

debugI("------------------------------------------------------------------------------------------------------------"); debugI("M5STICKC: %d, USE_M5DISPLAY: %d, USE_OLED: %d, USE_TFTSPI: %d, USE_LCD: %d, USE_AUDIO: %d, ENABLE_REMOTE: %d", M5STICKC, USE_M5DISPLAY, USE_OLED, USE_TFTSPI, USE_LCD, ENABLE_AUDIO, ENABLE_REMOTE);

#if USE_PSRAM

If that code is being built with PSRAM, that PSRAM Init line should print SOMETHING, pass or fail. Where did it go?

Somehow, I don't think you're building, running, or uploading the code you think you are. Maybe you're building one version and uploading another or the upload isi failing and you're still running an old version or something.

I've spent days debugging code that wasn't what I was building. It's the stuff that'll test your sanity. At soem point, you start adding debug prints of gibberish or making the first line of main "abort" or something crazy and the program sails on. Then, you cry....

l attempt to connect to WiFi.

(I) (ConnectToWiFi)(C1) Setting Clock...[ 4439][E][WiFiUdp.cpp:221] parsePacket(): could not receive data: 9 (W) (UpdateClockFromWeb)(C1) NTP clock: Raw values sec=459991403, usec=107100 (I) (UpdateClockFromWeb)(C1) Old Time: 4.272090, New Time: 1706286452.107100, Delta: 1706286447.835010

That's weird, but I know that 1.7bn is about the right answer from NTP. But that's not the downfall of anythhing, I don't think.

The rest of this looks really sane.

Do a build with -v pio run -v -e demo2 and see if you can see the compile proceeding with -DUSE_PSRAM

you'll have to catch it before it barfs up eleventy billion lines of ... somethign. I'e meant to track that down and just haven't.

put a coulple of debugI("Here I am on line %d", LINE) kind of lines inside and and so you KNOW that you're looking at the source that matches that you've built. Do it inside and out that USE_PSRAM

Message ID: <PlummersSoftwareLLC/NightDriverStrip/issues/598/1912361393@

github.com>

robertlipe commented 5 months ago

I should have read ahead. You're coming to the same "WTH?" conclusion that I did.

Are you perhaps doing something like a pio run build -e demo2 ; pio run upload -e demo ? Do you possibly have multiple boards on your system on /dev/ttyblahblah1 and you're flashing one and testing another on /dev/tty/blahblah2 ?

Try the sugar pills (probably harmless, but if it helps, great) of a pio run clean -e WHATEVER to force everything to get rebuilt. Heck, rename the entire .pio directory and force ABSOLUTELY EVERYTHING to get rebuilt - that way if you're uploading something else, at least it'll disappear.

I'm on the wrong computer to verify the syntax, but also try an erase of the device flash. That'll at least ensure the device is holding nothing so if your upload process is subtly failing, you'll at least know it. The syntax is something like:

esptool erase flash (maybe it's flash erase...) -p your serial device.

You really are int eh land of 'question everything'. It's frustrating!

RJL

On Fri, Jan 26, 2024 at 12:32 PM Morten Hundevad @.***> wrote:

Now i am really confused.

i added: (in PrintOutputHeader)

debugI("TestTestTest"); <<<<<<<<<<<<<<<<

#if USE_PSRAM
    debugI("ESP32 PSRAM Init: %s", psramInit() ? "OK" : "FAIL");
#endif

this also do not appear. i also tried changing some of the exsisting ones.

Can i make changes without them getting compiled ? i have tried clean and build then upload no chance.

this also explains some how why the i am not able to recreate the issue i guess.

— Reply to this email directly, view it on GitHub https://github.com/PlummersSoftwareLLC/NightDriverStrip/issues/598#issuecomment-1912507813, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCSD36TLOY4OMOJUI262PLYQPZC3AVCNFSM6AAAAABCH2TE7OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJSGUYDOOBRGM . You are receiving this because you were mentioned.Message ID: @.***>

fanno commented 5 months ago

I did test "demo" earlier (a while ago), so if you by /dev/.... refere to a image fine on the esp or something then yes i guess it could be there

I did try to run the clean and i also but i did try delete content of build and build_cache I not tried rename the whole .pio

The command was/is: (for the demo2 of cause.) Executing task: C:\Users\MOHU.platformio\penv\Scripts\platformio.exe run --target upload --environment demo2

I Did look in to "esptool erase flash" but then i stumbel on ability to: Hold reset 3 sec > power on > hole for another 5 sec > release (resulting in a reset) BuT in looking back its obvious that it did not work.

I ran: pio run --target erase --environment demo2 then i recompiled and it was updated.

!!! SUCCESS SUCCESS SUCCESS SUCCESS !!!

[env:demo2]
extends         = dev_esp32-s3
build_flags     = -DDEMO=1
                  -DCORE_DEBUG_LEVEL=5
                  ${dev_yd-esp32-s3.build_flags}
                  ${psram_flags.build_flags}

results in:

(I) (PrintOutputHeader)(C1) TestTestTest <<<<<<<<<<<<<<<
(I) (PrintOutputHeader)(C1) ESP32 PSRAM Init: FAIL
...
>> Launching JSON Writer Thread.  Mem: 342240, LargestBlk: 311284, PSRAM Free: 0/0, (W) (DeviceConfig)(C1) DeviceConfig could not be loaded from JSON, using defaults

test 2:

[env:demo2]
extends         = dev_esp32-s3
build_flags     = -DDEMO=1
                  -DCORE_DEBUG_LEVEL=5
                  ${dev_yd-esp32-s3.build_flags}
                  ${psram_flags.build_flags}
board_build.arduino.memory_type = dio_opi <<< only change

results in:

(I) (PrintOutputHeader)(C1) TestTestTest
(I) (PrintOutputHeader)(C1) ESP32 PSRAM Init: OK <<<<<<<<<<<<<<<
...
>> Launching JSON Writer Thread.  Mem: 341080, LargestBlk: 311284, PSRAM Free: 8385827/8386231, (W) (DeviceConfig)(C1) DeviceConfig could not be loaded from JSON, using defaults

conclusion so far: board_build.arduino.memory_type = dio_opi Would most likely have been the only thing i really needed to add. (with ofcause ${psram_flags.build_flags})

as to cause i am a bit curious maybe you have some insights. I did Play around with OTA flash at some point. i wonder if that could be a "cause" for needing the erase..

I could/would close the issue now, but i would like you ask you one more thing if i may.

Ofcause if using OTA you cant erase the or it would remove the OTA feature. (because its some how part of the existing image on the device in running in the Loop) But in deve face where the esp32 is not installed "in the addict" or anything like that. Is there a way to set it up so it always do the erase first.

Now to the question. To at least ensure this wont ever happen again in a dev face. or is your experiance that this in general should not happen. It was a fun tho of cause also frustrating issue and wasted your time. (tho i have to say i enjoy a challenge)

Is there a way i can make it always erase when preforming a upload again i am aware i could properly not do this when using OTA uploads.

But when i am using USB it would be nice i don't have to do it manually now that i know it "could" be needed i kinda just always wanna do it so i don't do something similar again (lesson learned).

If that is not the case, is there a way to "auto" increment a build "number" that i could then put in the to debug so i could with that verify if its old or new. (some kind of sanity check)

Thanks again for you patience I also thank you for putting up with my "spam" and my bad spelling i am dyslectic and then English is not my first language

Iceing on the cake: billede (after adding webserver)

P.S. I hope i can in the near future find something to contribute to the project.

robertlipe commented 5 months ago

It's late (~3am) and I'm about to retire for hte day, but since you're up...

Yay! YOu got it working!

I remember writing up one of my "war and peace" descriptions where trying to use OTA got my board stuck in a situation where I could upload code to it, but it kept running old code. I can't find it immediately right now, but OTA was definitely my own trip to this strangeness. (I suspect it's something like we're updating to partition 1 but the device is booting from partition 2 or something like that...) Personally, I just kind of learned to not use OTA in this project, though I know Dave swears by it.

When I was doing OS work I learned to include _DATE and TIME into the build of my personal kernels and if they were more than 10 minutes old (or something) add some kind of "WARNING: this is not a super-fresh build" or something to the boot. Then if I was booting from B: instead of A: (whatever) I at least KNEW I was running old code.

So you're at a happy place now, right?

...though you'd understandably be happier if we didn't torment our S3 users for our own entertainment....I've received that meesage. I get it. :-)

On Sat, Jan 27, 2024 at 2:40 AM Morten Hundevad @.***> wrote:

I did test "demo" earlier (a while ago), so if you by /dev/.... refere to a image fine on the esp or something then yes i guess it could be there

I did try to run the clean and i also but i did try delete content of build and build_cache I not tried rename the whole .pio

The command was/is: (for the demo2 of cause.) Executing task: C:\Users\MOHU.platformio\penv\Scripts\platformio.exe run --target upload --environment demo2

I Did look in to "esptool erase flash" but then i stumbel on ability to: Hold reset 3 sec > power on > hole for another 5 sec > release (resulting in a reset) BuT in looking back its obvious that it did not work.

I ran: pio run --target erase --environment demo2 then i recompiled and it was updated.

!!! SUCCESS SUCCESS SUCCESS SUCCESS !!!

[env:demo2] extends = dev_esp32-s3 build_flags = -DDEMO=1 -DCORE_DEBUG_LEVEL=5 ${dev_yd-esp32-s3.build_flags} ${psram_flags.build_flags}

results in:

(I) (PrintOutputHeader)(C1) TestTestTest <<<<<<<<<<<<<<< (I) (PrintOutputHeader)(C1) ESP32 PSRAM Init: FAIL ...

Launching JSON Writer Thread. Mem: 342240, LargestBlk: 311284, PSRAM Free: 0/0, (W) (DeviceConfig)(C1) DeviceConfig could not be loaded from JSON, using defaults

test 2:

[env:demo2] extends = dev_esp32-s3 build_flags = -DDEMO=1 -DCORE_DEBUG_LEVEL=5 ${dev_yd-esp32-s3.build_flags} ${psram_flags.build_flags} board_build.arduino.memory_type = dio_opi <<< only change

results in:

(I) (PrintOutputHeader)(C1) TestTestTest (I) (PrintOutputHeader)(C1) ESP32 PSRAM Init: OK <<<<<<<<<<<<<<< ...

Launching JSON Writer Thread. Mem: 341080, LargestBlk: 311284, PSRAM Free: 8385827/8386231, (W) (DeviceConfig)(C1) DeviceConfig could not be loaded from JSON, using defaults

conclusion so far: board_build.arduino.memory_type = dio_opi Would most likely have been the only thing i really needed to add. (with ofcause ${psram_flags.build_flags})

as to cause i am a bit curious maybe you have some insights. I did Play around with OTA flash at some point. i wonder if that could be a "cause" for needing the erase..

I could/would close the issue now, but i would like you ask you one more thing if i may.

Ofcause if using OTA you cant erase the or it would remove the OTA feature. (because its some how part of the existing image on the device in running in the Loop) But in deve face where the esp32 is not installed "in the addict" or anything like that. Is there a way to set it up so it always do the erase first.

Now to the question. To at least ensure this wont ever happen again in a dev face. or is your experiance that this in general should not happen. It was a fun tho of cause also frustrating issue and wasted your time. (tho i have to say i enjoy a challenge)

Is there a way i can make it always erase when preforming a upload again i am aware i could properly not do this when using OTA uploads.

But when i am using USB it would be nice i don't have to do it manually now that i know it "could" be needed i kinda just always wanna do it so i don't do something similar again (lesson learned).

If that is not the case, is there a way to "auto" increment a build "number" that i could then put in the to debug so i could with that verify if its old or new. (some kind of sanity check)

Thanks again for you patience I also thank you for putting up with my "spam" and my bad spelling i am dyslectic and then English is not my first language

Iceing on the cake: billede.png (view on web) https://github.com/PlummersSoftwareLLC/NightDriverStrip/assets/63506/52d07a72-56a9-4ddd-b8a8-8b964f647ba8 (after adding webserver)

P.S. I hope i can in the near future fine something to contribute to the project.

— Reply to this email directly, view it on GitHub https://github.com/PlummersSoftwareLLC/NightDriverStrip/issues/598#issuecomment-1913078669, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCSD33CI7JB7NFTNMATSPLYQS4QVAVCNFSM6AAAAABCH2TE7OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJTGA3TQNRWHE . You are receiving this because you were mentioned.Message ID: @.***>

robertlipe commented 5 months ago

AHA!

https://github.com/PlummersSoftwareLLC/NightDriverStrip/discussions/449

Generated exactly zero responses from others, but other than the compressed timeline (you spent days instead of hours) see if the basic replay of events - uploading code, but running an old version of the code - seems at all familiar.

RJL

On Sat, Jan 27, 2024 at 3:09 AM Robert Lipe @.***> wrote:

It's late (~3am) and I'm about to retire for hte day, but since you're up...

Yay! YOu got it working!

I remember writing up one of my "war and peace" descriptions where trying to use OTA got my board stuck in a situation where I could upload code to it, but it kept running old code. I can't find it immediately right now, but OTA was definitely my own trip to this strangeness. (I suspect it's something like we're updating to partition 1 but the device is booting from partition 2 or something like that...) Personally, I just kind of learned to not use OTA in this project, though I know Dave swears by it.

When I was doing OS work I learned to include _DATE and TIME into the build of my personal kernels and if they were more than 10 minutes old (or something) add some kind of "WARNING: this is not a super-fresh build" or something to the boot. Then if I was booting from B: instead of A: (whatever) I at least KNEW I was running old code.

So you're at a happy place now, right?

...though you'd understandably be happier if we didn't torment our S3 users for our own entertainment....I've received that meesage. I get it. :-)

On Sat, Jan 27, 2024 at 2:40 AM Morten Hundevad @.***> wrote:

I did test "demo" earlier (a while ago), so if you by /dev/.... refere to a image fine on the esp or something then yes i guess it could be there

I did try to run the clean and i also but i did try delete content of build and build_cache I not tried rename the whole .pio

The command was/is: (for the demo2 of cause.) Executing task: C:\Users\MOHU.platformio\penv\Scripts\platformio.exe run --target upload --environment demo2

I Did look in to "esptool erase flash" but then i stumbel on ability to: Hold reset 3 sec > power on > hole for another 5 sec > release (resulting in a reset) BuT in looking back its obvious that it did not work.

I ran: pio run --target erase --environment demo2 then i recompiled and it was updated.

!!! SUCCESS SUCCESS SUCCESS SUCCESS !!!

[env:demo2] extends = dev_esp32-s3 build_flags = -DDEMO=1 -DCORE_DEBUG_LEVEL=5 ${dev_yd-esp32-s3.build_flags} ${psram_flags.build_flags}

results in:

(I) (PrintOutputHeader)(C1) TestTestTest <<<<<<<<<<<<<<< (I) (PrintOutputHeader)(C1) ESP32 PSRAM Init: FAIL ...

Launching JSON Writer Thread. Mem: 342240, LargestBlk: 311284, PSRAM Free: 0/0, (W) (DeviceConfig)(C1) DeviceConfig could not be loaded from JSON, using defaults

test 2:

[env:demo2] extends = dev_esp32-s3 build_flags = -DDEMO=1 -DCORE_DEBUG_LEVEL=5 ${dev_yd-esp32-s3.build_flags} ${psram_flags.build_flags} board_build.arduino.memory_type = dio_opi <<< only change

results in:

(I) (PrintOutputHeader)(C1) TestTestTest (I) (PrintOutputHeader)(C1) ESP32 PSRAM Init: OK <<<<<<<<<<<<<<< ...

Launching JSON Writer Thread. Mem: 341080, LargestBlk: 311284, PSRAM Free: 8385827/8386231, (W) (DeviceConfig)(C1) DeviceConfig could not be loaded from JSON, using defaults

conclusion so far: board_build.arduino.memory_type = dio_opi Would most likely have been the only thing i really needed to add. (with ofcause ${psram_flags.build_flags})

as to cause i am a bit curious maybe you have some insights. I did Play around with OTA flash at some point. i wonder if that could be a "cause" for needing the erase..

I could/would close the issue now, but i would like you ask you one more thing if i may.

Ofcause if using OTA you cant erase the or it would remove the OTA feature. (because its some how part of the existing image on the device in running in the Loop) But in deve face where the esp32 is not installed "in the addict" or anything like that. Is there a way to set it up so it always do the erase first.

Now to the question. To at least ensure this wont ever happen again in a dev face. or is your experiance that this in general should not happen. It was a fun tho of cause also frustrating issue and wasted your time. (tho i have to say i enjoy a challenge)

Is there a way i can make it always erase when preforming a upload again i am aware i could properly not do this when using OTA uploads.

But when i am using USB it would be nice i don't have to do it manually now that i know it "could" be needed i kinda just always wanna do it so i don't do something similar again (lesson learned).

If that is not the case, is there a way to "auto" increment a build "number" that i could then put in the to debug so i could with that verify if its old or new. (some kind of sanity check)

Thanks again for you patience I also thank you for putting up with my "spam" and my bad spelling i am dyslectic and then English is not my first language

Iceing on the cake: billede.png (view on web) https://github.com/PlummersSoftwareLLC/NightDriverStrip/assets/63506/52d07a72-56a9-4ddd-b8a8-8b964f647ba8 (after adding webserver)

P.S. I hope i can in the near future fine something to contribute to the project.

— Reply to this email directly, view it on GitHub https://github.com/PlummersSoftwareLLC/NightDriverStrip/issues/598#issuecomment-1913078669, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCSD33CI7JB7NFTNMATSPLYQS4QVAVCNFSM6AAAAABCH2TE7OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJTGA3TQNRWHE . You are receiving this because you were mentioned.Message ID: @.***>

fanno commented 5 months ago

You are correct i am in my happy place.

Lesson learned i just wont use OTA unless i am putting the device up in the addict. (or some other place its hard to get to)

rbergen commented 5 months ago

@fanno I'm only commenting on this typo because it's particularly unfortunate, but I'm sure you mean "up in the attic".

fanno commented 5 months ago

lol i had to look it up i see how thats a problem, thanks and yes that is what i mean.