Notifications
Clear all

ESP32 Woes

20 Posts
3 Users
3 Likes
861 Views
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

Posted by: @zander

@inq That is not going well.  Just getting a working IDE to work with these ESP32's is a pain.

Can you elaborate? I program esp32's all the time using the Arduino IDE with no problems. What issues are you encountering?

I thought I'd start a new thread.  As you are about to see this is not a simple problem.  If you're able to help, it might help more than me and no one would find it in the bowels of that other thread. 😉 I want to preface this with... I don't have any problems using a first generation ESP32 with non-WiFi code or even the ESP32-CAM that seems to give people fits.

 

I'm having troubles on multiple levels and have been scouring the Internet for info.  This is a relatively new version of development board that I thought since Espressif actually designed the chip and the board, it would be well supported.

This being:  https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitc-1.html .  Note how it has two USB-C ports.  I'm only guess, but one seems to be for compiling/uploading and the other to debug.

image

 

Not that I expected a vendor to actually know anything about their product, but so far the vendor has been less than helpful.

https://www.ebay.com/itm/175731198587

 

So here are the issues I'm facing:

(1) Memory - The specific version I have has 16MB of flash memory and 8MB of PSRam.  I know what to do with the flash memory, but I'm not sure how the 8MB of PSRam differs from the regular ram used by the MPU.  

(2) Arduino IDE - The Arduino IDE does not seem to support this model directly (yet).   In the short time I've used the boards library, the developer has updated it three times.  There is the generic module, however, I can't seem to find any useful documentation that describes the parameters and how various settings effect the build.  For instance, purely by blog posts I discover the port to use and settings to allow the Arduino IDE to upload and see serial output.  That alone took a day or two to ferret out.  The defaults don't cut it on either USB port.

image

(3) Partitioning - There are no options for my configuration.  I was trying to use LittleFS for a file system as Internet says its more reliable than FATFS.  I finally determined that by using the first setting with 1.5MB Spiffs does in fact allow me to create 1.5MB LittleFS, but no other option works.  And there are no options to use the full 16MB as is able on the ESP8266 Pro with 16MB or flash.  The two 16MB options don't work on SPIFFS or LittleFS.  The documentation on LittleFS has seemed to lapse as the Open Source developer for it has lost interest due to all the grief he gets over dealing with every fripp'n changes Espressif seems to dump on the market every other month.  Although LittleFS is now considered part of the Arduino Core ESP32 library, it doesn't work on all models.

image

(4) Arduino Core Boards Library - You all may not know but the Core library allowing to run the Espressif boards is not Espressif.  They only half-heartedly support Arduino IDE development.  It turns out, that the Arduino layer on top of the ESP-IDF handicaps the base technology simply so we can use the setup(), loop() mentality that we're used to.  This becomes very problematic when using Espressif based code.  Sample problems from Espressif (particularly those that I use with the ESP8266) are at a lower level.  Although they compile and upload from Arduino IDE fine, they exception right away.  Espressif uses a daemon with a continual loop to check WiFi, Bluetooth, low-level comms like I2C and SPI and throw events that must be registered for to receive in user code.  This is very much like Windows programming for those familiar with it.  However in the Arduino IDE using this kind of code structure seems to break the layer Arduino Core library code mentality

(5) New IDE - Because of all the above problems, I have attempted to embrace using Visual Studio Code and working with the ESP-IDF library directly, thus punting all the Arduino Core code.  Although the examples are for this exact case, the IDE differences and the hundreds of setting required to access the specific boards has so far alluded me into any successful compile and upload to my board.

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Quote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6988
 

@Inq I might be losing it, but I do NOT think you have the boards file loaded. See attached pic, it is the 2nd last line. I have no such thing as ESP32 Arduino, is that the new NANO ESP32?

My boards shows esp32 and then the top line is esp32S3 Dev

Screenshot 2023 08 06 at 13.21.47
Screenshot 2023 08 06 at 13.22.41

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
huckOhio reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6988
 

@Inq IIRC, PSRAM is an add on part that is accessed via SPI. I found this in the Tech Ref Manual. Not sure if that helps.

Screenshot 2023 08 06 at 13.42.35

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6988
 

@Inq Did you not see this?

Screenshot 2023 08 06 at 13.47.02
Screenshot 2023 08 06 at 13.45.57

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6988
 

@Inq I think I missed sending a reply. Check out my boards entries. Also I think I missed posting a couple bits of info re PSRAM.

Screenshot 2023 08 06 at 13.58.54
Screenshot 2023 08 06 at 13.39.07
Screenshot 2023 08 06 at 13.42.35

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6988
 

@Inq Don't know if you saw this page. There are a couple of things there you might find interesting.

https://www.espressif.com/en/products/devkits/esp-eye/overview

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

@zander,

This was the total list of available ESP32 type boards.  I don't know why mine has ESP32 Arduino as the boards manager library and yours only has esp32.  Mine is version 2.0.11 and shows to be the latest or maybe because you are on a Mac, it displays differently.  Don't know.  The fact that there are almost 200 flavors of ESP32 and none are exactly the same as my board is just crazy!  My top line is also ESP32S3 Dev Module.  However, I think that is the catch-all of all S3 type boards.  At least that is the way they do the ESP8266.  The generic is at top and specific ones are below.  There is no ESP32-S3-DevKitC-1 selection (yet) and none show a 16MB SPIFFS or LittleFS option EVEN THOUGH SPIFFS has be deprecated for a long time and LittleFS is the default file system for ESP development.

image

Posted by: @zander

@Inq IIRC, PSRAM is an add on part that is accessed via SPI. I found this in the Tech Ref Manual. Not sure if that helps.

Well... that says how it's accessed, but it doesn't say what it's for.  There is RAM that is for runtime time code, stack and heap.  There is FLASH that can be configured to hold the program code, the OTA space for the second instance of program code and the rest used for a file system... SPIFFS, LittleFS or FATFS.  

I have no idea what the PSRAM is for or how it is commonly used. 

Posted by: @zander

@Inq Did you not see this?

Screenshot 2023 08 06 at 13.47.02
Screenshot 2023 08 06 at 13.45.57

The two USB-C ports are labeled USB and COM.  I did find that I need to use the one labeled USB, but... the defaults settings failed to upload AND be able to see output on the Serial Monitor window.  Only after much gnashing of teeth and many blog postings did I find a combination of settings that finally did both.  I don't believe I have the correct settings... especially if I want to use the debugger, but that is of lesser concern at the moment.

And even then, sometimes if starts the upload process and then fails.  Like now... it gets to 26% then decides now that the port is not configured.  

image

The fact that even after this many years that the Arduino IDE still requires it to RE-COMPILE the code to try uploading again even though no code or settings have changed blows my mind.  Really!  

Finally... after putting the cord on the COM port it successfully uploaded, but would not output to the Serial Monitor.  After moving it back to the USB port and resetting the module I finally get some output.  But as shown, there is 16MB of flash, but can only configure up to 1.4MB of file system in LittleFS.

image

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6988
 

@Inq Here is a peek at future ESP offerings, P4, H2, C6. SOme are available now, some are at the sample stage. Lot's of goodies, but not sure if any or some is relevant for you. 

https://www.electronicsweekly.com/news/products/micros/espressif-adopts-risc-v-for-next-gen-eps32s-adds-wi-fi-6-and-bt-5-2023-01/

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

Posted by: @zander

@Inq Here is a peek at future ESP offerings, P4, H2, C6. SOme are available now, some are at the sample stage. Lot's of goodies, but not sure if any or some is relevant for you. 

https://www.electronicsweekly.com/news/products/micros/espressif-adopts-risc-v-for-next-gen-eps32s-adds-wi-fi-6-and-bt-5-2023-01/

I think this continual feature creep of new boards is not being handled in a timely manner on the Arduino IDE.  That is why I'm trying out the Visual Studio Code option which is how Espressif developers build it.  As stated earlier, Arduino Core is trying to convert a truly multi-threaded, event based operating system into a crude procedural programming environment.  It's like running Windows and forcing a DOS interface on it. 😆 

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

Posted by: @zander

Lot's of goodies, but not sure if any or some is relevant for you. 

> https://www.electronicsweekly.com/news/products/micros/espressif-adopts-risc-v-for-next-gen-eps32s-adds-wi-fi-6-and-bt-5-2023-01/

It looks like the P4 would be of interest but only if I can get the S3 I have now working.

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6988
 

@inq From time to time I dream of a day when the esp32 boards are listed in alphabetical sequence, but then I wake up. If we are using the same boards file and the same IDE (doesn't matter about OS) then the Boards should display the same.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6988
 

@inq Are you sure? I thought they used IDF

That is why I'm trying out the Visual Studio Code option which is how Espressif developers build it.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6988
 

@inq Hmm, mysterious how the boards entry is different. No idea why. Is that a typo re vers, latest is 2.1.1

Version: 2.1.1
Date: 2023-07-03T07:51:40.946Z
CLI Version: 0.32.3

Copyright © 2023 Arduino SA

Just for chuckles, I searched the boards filr for 'ESP32 Arduino' and it is NOT found. I attached a pic of the start of the json file on the assumption the name that shows on the boards menu is somewhere in the first few lines. After I finish this post I will edit the boards file and change esp32 to esp32-ron and see what happens after reloading the IDE.

There are 27 occurrences of littleFS.

See pic for the 2 esp32 board entries. That is ver 2.0.11, the IDE is 2.1.1

How to use PSRAM. https://thingpulse.com/esp32-how-to-use-psram/

NOTE there are some 'interesting' links on that page including an issue.

I thought I posted the doc re what USB port does what.

As far as an upload failing part way through, I have often seen that when I forgot to disconnect the Serial output before doing an upload.

ABSOLUTLY, there is NO reason to do a re-compile. We had that under control more than 40 years ago! I wonder if nobody has posted an issue about it? I will see if I can find the right GitHub entry to post later today. I am guessing you know how to use CLI. If so, you could set up a cmd file to do just a link. OR maybe they don't keep all the library object files. They are created with the temp bit and are subsequently deleted when the process completes. Off the top of my head, I don't see a danger in changing that behaviour other than disk space issues (use OneDrive or equivalent). We just need to find the compile switch to change the behaviour if it exists. Does anybody know or at least know where all the switches are documented? 

Don't mean to be a jerk, but are you sure you have PSRAM?

Not sure what this means, but under packages you will see the mklittlefs entry.

LittleFS may not be supported under IDE 2. See the nerd under 8266 littlefs.

Have you installed the littlefs tool in the tools dir under Arduino?

Screenshot 2023 08 06 at 15.26.36
Screenshot 2023 08 06 at 15.45.25

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
Inq reacted
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
 

Posted by: @zander

Posted by: @zander

 

@Inq IIRC, PSRAM is an add on part that is accessed via SPI. I found this in the Tech Ref Manual. Not sure if that helps.

 

 

Well... that says how it's accessed, but it doesn't say what it's for.

I presume its used the same as PSRAM on the Teensy 4 boards, large arrays etc.  This link mentions it and shows a simple use at the bottom of the linked page.  If you dig a bit I think you should find some more example arduino IDE based code examples for the Teensy and I assume it works the same on the ESP32's  (Never used it myself)

https://www.pjrc.com/store/psram.html


   
Inq reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6988
 

@byron FYI @Inq Thanks, I suspect you are right, I will have a look after I figure out this littleFS issue.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Page 1 / 2