Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP32S2 /S3 #2801

Closed
ssk73 opened this issue Jan 11, 2024 · 23 comments
Closed

ESP32S2 /S3 #2801

ssk73 opened this issue Jan 11, 2024 · 23 comments

Comments

@ssk73
Copy link

ssk73 commented Jan 11, 2024

Issue

Hi!
Is it possible to run the project on an ESP32S2 /S3 ? We want to design a custom hardware for it, and we need a few extra GPIOs. We are thinking about S2 but I couldn't find any information on whether it would run. Does the code use the second core anywhere? And what about S3R8? Is the embedded PSRAM compatible?

@ssk73 ssk73 changed the title ESP32S2 ESP32S2 /S3 Jan 11, 2024
@jomjol
Copy link
Owner

jomjol commented Jan 14, 2024

If you're planning to make a custom hardware, can you contact me on my email? (see readme.md)

Thanks, jomjol

@argetlam-coder
Copy link

I am currently trying to get the project to run on a Freenove ESP32-S3-WROOM because I also need more GPIOs. I need these to send the data via a LoRaWan module.
A few minor changes to the code are necessary so that the project can be compiled for the ESP32-S3. The SmartLeds library needs to be updated and the reading of the board temperature needs to be adapted.
In addition, the GPIO pins used must be adapted, as the Freenove board has a different pinout than the ESP32CAM boards.
The software is now running on my board. Access to the PSRAM, the camera and the SD card works.

@sclel016
Copy link

Any chance that the changes you made for the S3 could be upstreamed? Those S3 boards are pretty cheap on Aliexpress (~$15).

@jomjol
Copy link
Owner

jomjol commented Jan 24, 2024

Currently not plans to do so (and no resources :-) )

@jomjol jomjol closed this as completed Jan 24, 2024
@Slider0007
Copy link
Collaborator

Slider0007 commented Jan 29, 2024

I am currently trying to get the project to run on a Freenove ESP32-S3-WROOM because I also need more GPIOs. I need these to send the data via a LoRaWan module. A few minor changes to the code are necessary so that the project can be compiled for the ESP32-S3. The SmartLeds library needs to be updated and the reading of the board temperature needs to be adapted. In addition, the GPIO pins used must be adapted, as the Freenove board has a different pinout than the ESP32CAM boards. The software is now running on my board. Access to the PSRAM, the camera and the SD card works.

@argetlam-coder: I also did some tests with an ESP32S3 board which I got in hand recently (https://www.seeedstudio.com/XIAO-ESP32S3-Sense-p-5639.html). Like you described only a few mods are needed to get basic operation. The board is nicely compact but it's running quite hot and then WIFI is getting kind of slower with some noticeable hickups. I tried to reduce CPU speed to 160Mhz which makes it more robust, but still I'm not fully convinced. Comparing just the pure processing speed it's operating way quicker (Processing time of one of the demo images @240Mhz: 6-8s, @160Mz: 9-11s, ESP32CAM @ 160Mhz: 20-21s)
What are your experiences in terms of temperature and WIFI performance with this kind of MCU?

@IceIJJuice
Copy link

В настоящее время я пытаюсь запустить проект на Freenove ESP32-S3-WROOM, потому что мне также нужно больше GPIO. Они нужны мне для отправки данных через модуль LoRaWan. Необходимо внести несколько незначительных изменений в код, чтобы проект можно было скомпилировать для ESP32-S3. Необходимо обновить библиотеку SmartLeds и адаптировать показания температуры платы. Кроме того, используемые контакты GPIO должны быть адаптированы, так как плата Freenove имеет другую распиновку, чем платы ESP32CAM. Теперь программное обеспечение работает на моей плате. Доступ к PSRAM, камере и SD-карте работает.

Can you tell me what exactly needs to be changed to make ESP32-S3 work?

@argetlam-coder
Copy link

В настоящее время я пытаюсь запустить проект на Freenove ESP32-S3-WROOM, потому что мне также нужно больше GPIO. Они нужны мне для отправки данных через модуль LoRaWan. Необходимо внести несколько незначительных изменений в код, чтобы проект можно было скомпилировать для ESP32-S3. Необходимо обновить библиотеку SmartLeds и адаптировать показания температуры платы. Кроме того, используемые контакты GPIO должны быть адаптированы, так как плата Freenove имеет другую распиновку, чем платы ESP32CAM. Теперь программное обеспечение работает на моей плате. Доступ к PSRAM, камере и SD-карте работает.

Can you tell me what exactly needs to be changed to make ESP32-S3 work?

I have published my changes in this branch. These are all the changes that are necessary for the code to be compiled for the ESP32-S3. In addition, the pinout must be adapted to the corresponding board.

@argetlam-coder
Copy link

I am currently trying to get the project to run on a Freenove ESP32-S3-WROOM because I also need more GPIOs. I need these to send the data via a LoRaWan module. A few minor changes to the code are necessary so that the project can be compiled for the ESP32-S3. The SmartLeds library needs to be updated and the reading of the board temperature needs to be adapted. In addition, the GPIO pins used must be adapted, as the Freenove board has a different pinout than the ESP32CAM boards. The software is now running on my board. Access to the PSRAM, the camera and the SD card works.

@argetlam-coder: I also did some tests with an ESP32S3 board which I got in hand recently (https://www.seeedstudio.com/XIAO-ESP32S3-Sense-p-5639.html). Like you described only a few mods are needed to get basic operation. The board is nicely compact but it's running quite hot and then WIFI is getting kind of slower with some noticeable hickups. I tried to reduce CPU speed to 160Mhz which makes it more robust, but still I'm not fully convinced. Comparing just the pure processing speed it's operating way quicker (Processing time of one of the demo images @240Mhz: 6-8s, @160Mz: 9-11s, ESP32CAM @ 160Mhz: 20-21s) What are your experiences in terms of temperature and WIFI performance with this kind of MCU?

The processing time for me is also around 9-11s. My board seems to stay relatively cool and yet the Weinterface is sometimes very slow. However, I then see some error messages from the web server in the console. I'll have to take a closer look at this problem.

@frustreermeneer
Copy link

@argetlam-coder I'm trying to run your branch but i think i'm missing the correct board definition for platformio?
When i do get it to start, i get an sd card init error.

@argetlam-coder
Copy link

@argetlam-coder I'm trying to run your branch but i think i'm missing the correct board definition for platformio? When i do get it to start, i get an sd card init error.

PlatformIO does not have a board definition for the Freenove board. I found a board definition on the internet and adapted it slightly. Here is the file: freenove_esp32_s3_wroom.json

In order to run AI-On-The-Edge on the Freenove board, the pin assignment in the code must be adapted. Take a look at this branch of mine. It contains the changes that are necessary for the camera, the SD card and the PSRAM to work on the Freenove board.

However, the internal LED does not work automatically. For this to work, the GPIO section in the config.ini on the SD card must be adjusted as follows

[GPIO]
;MainTopicMQTT = wasserzaehler/GPIO
;IO0 = input disabled 10 false false 
;IO1 = input disabled 10 false false 
;IO3 = input disabled 10 false false 
;IO4 = built-in-led disabled 10 false false 
;IO12 = input-pullup disabled 10 false false 
;IO13 = input-pullup disabled 10 false false
IO48 = built-in-flash-ws281x disabled 10 false false 
LEDType = WS2812
LEDNumbers = 1
LEDColor = 150 150 150 

@mlinzner
Copy link

mlinzner commented Apr 1, 2024

@argetlam-coder I'm running into the following issues when running your esp32-s3 branch on my Seeedstudio ESP32S3.

Rebooting...
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40376565
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3818,len:0xbac
load:0x403c9700,len:0x4
load:0x403c9704,len:0x9c8
load:0x403cc700,len:0x2a4c
entry 0x403c9874
I (307) cpu_start: Multicore app
E (308) quad_psram: PSRAM ID read error: 0x00ffffff, PSRAM chip not found or not supported, or wrong PSRAM line mode
E (309) cpu_start: Failed to init external RAM, needed for external .bss segment

abort() was called at PC 0x40375fe0 on core 0

So I'm thinking I need to apply more changes to make sure the PSRAM works fine. Do you have any points for me on how to be debug what is going wrong? Thanks!

@friedpa
Copy link

friedpa commented Apr 1, 2024

Unfortunately a lot of ESP32s are shipped with a defect PSRAM. You will find a lot of threads with this issue. Do you have another ESP32 to try?
Otherwise I would recommend to look into the White List of Hardware which is working, the HW is really cheap.

@argetlam-coder
Copy link

argetlam-coder commented Apr 1, 2024

@argetlam-coder I'm running into the following issues when running your esp32-s3 branch on my Seeedstudio ESP32S3.

Rebooting...
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40376565
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3818,len:0xbac
load:0x403c9700,len:0x4
load:0x403c9704,len:0x9c8
load:0x403cc700,len:0x2a4c
entry 0x403c9874
I (307) cpu_start: Multicore app
E (308) quad_psram: PSRAM ID read error: 0x00ffffff, PSRAM chip not found or not supported, or wrong PSRAM line mode
E (309) cpu_start: Failed to init external RAM, needed for external .bss segment

abort() was called at PC 0x40375fe0 on core 0

So I'm thinking I need to apply more changes to make sure the PSRAM works fine. Do you have any points for me on how to be debug what is going wrong? Thanks!

Have you configured the pins of your board in defines.h? The pinout of your board is different from mine. I could not find out which pins the PSRAM uses on your board. Maybe these are pins that are used for the SD card or the camera on my board.

However, the camera has not worked for me since I merged the last changes from the upstream project into my branch.

There is a new place in the code where a GPIO pin is hardcoded (which is used by the camera in my case). However, I don't yet know exactly whether this is the cause.

@argetlam-coder
Copy link

I forgot to mention this part of the code. This is where the pins for the SD card reader are defined. At the moment there is only one exception for my board. The ESP32-Cam boards use the default configuration.

@mlinzner
Copy link

mlinzner commented Apr 2, 2024

Thanks, I did adjust the pins (turns out it's a bit difficult to find the pinout for this board, but using the sample projects and schematics I think I got there). I also adjusted the platformio config and switched to the seeed_xiao_esp32s3 board definition.

I still see the same issue, though. It happens immediately after rebooting, so I'm questioning if the PSRAM indeed is broken as @friedpa suggested, or if something else needs to be adjusted as well. I believe it happens on or before the esp_psram_init() call in extern "C" void app_main(void).

@argetlam-coder
Copy link

I also experimented a little with the settings in menuconfig on my board. Check whether the option Support for external, SPI-connected RAM is activated under Component config->ESP PSRAM. If this is the case, check which mode is selected in the SPI RAM config submenu. Octal is selected in my case.

@mlinzner
Copy link

mlinzner commented Apr 7, 2024

Wow, thanks so much for that tip! My SPI RAM Config was on Quad mode. I switched it to Octal and now the app is properly starting. It seems though that I'm not a 100% there with the pin configuration, because the SD card is not working correctly. But at least I have proper feedback now ;)

@BoxedBrain
Copy link

Hi @mlinzner, would you mind sharing your binary? I would love to give this board a try. Thanks!

@mlinzner
Copy link

mlinzner commented Jul 3, 2024

Hi @mlinzner, would you mind sharing your binary? I would love to give this board a try. Thanks!

I used the the add-esp32-s3-board-support branch from argetlam-coder's fork. In addition I changed the platformio config to this config and played around with the pin definitions based on camera_pins.h and board schematics but in the end I gave up.

I could not get the SD card to work and I'm not sure if it is the type of SD card, size of the card (I only found a 16GB raspberry pi card, which should work fine with the board, but you never know) or still some faulty pin config.

@Slider0007
Copy link
Collaborator

Slider0007 commented Jul 3, 2024

@BoxedBrain @mlinzner

If you're interested to sneak in I added support of Seeedstudio XIAO ESP32S3 Sense to the latest develop version of my personal repository (https://github.com/Slider0007/AI-on-the-edge-device/tree/develop) which is a forked version of this repo. The latest develop version can also be dowloaded pre-compiled from here: https://github.com/Slider0007/AI-on-the-edge-device/actions/runs/9756504174.

Note:
There will be no offical support for this forked version. Installation and OTA update process is identical to jomjol software package but no web installer support. Be aware that APIs and some config parameter are slightly different to jomjol's software. I recommend a clean installation from scratch.

Recommendation hardware-wise:
Use a small heatsink on the back of the device because it's running quite hot which results in a reduced responsiveness. --> Slider0007#155

This board is running nicely without any issues for a some months now...

@dondic
Copy link

dondic commented Jul 10, 2024

Tell me what I'm doing wrong. 😿

  1. Seeedstudio XIAO ESP32S3 Sense.
  2. Taking AI-on-the-edge-device__manual-setup__xiao-esp32s3-sense__SLFork_develop.zip, latest artifact from your repo.
  3. esptool erase_flash - SUCCESS
    esptool write_flash 0x01000 bootloader.bin 0x08000 partitions.bin 0x10000 firmware.bin - SUCCESS
  4. Result - no AP is visible
  5. Manually put files to sd card (FAT32, 32kB cluster), change wlan.ini SSID, pass - still no connection to network.
  6. PSU - 2A 5V

BTW, after FW update, device connects - disconnects from pc. With stock FW - does not disconnect.

@BoxedBrain @mlinzner

If you're interested to sneak in I added support of Seeedstudio XIAO ESP32S3 Sense to the latest develop version of my personal repository (https://github.com/Slider0007/AI-on-the-edge-device/tree/develop) which is a forked version of this repo. The latest develop version can also be dowloaded pre-compiled from here: https://github.com/Slider0007/AI-on-the-edge-device/actions/runs/9756504174.

Note: There will be no offical support for this forked version. Installation and OTA update process is identical to jomjol software package but no web installer support. Be aware that APIs and some config parameter are slightly different to jomjol's software. I recommend a clean installation from scratch.

Recommendation hardware-wise: Use a small heatsink on the back of the device because it's running quite hot which results in a reduced responsiveness. --> Slider0007#155

This board is running nicely without any issues for a some months now...

@Slider0007
Copy link
Collaborator

Slider0007 commented Jul 10, 2024

@dondic

esptool erase_flash - SUCCESS
esptool write_flash 0x01000 bootloader.bin 0x08000 partitions.bin 0x10000 firmware.bin - SUCCESS

You have to flash the bootloader to address 0x0. This is different to vanilla ESP32.

https://docs.espressif.com/projects/esp-idf/en/stable/esp32s3/api-guides/bootloader.html

@dondic
Copy link

dondic commented Jul 11, 2024

3. esptool write_flash 0x01000 bootloader.bin 0x08000 partitions.bin 0x10000 firmware.bin

Thank you! Works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests