espressif / arduino-esp32

Arduino core for the ESP32
GNU Lesser General Public License v2.1
13.62k stars 7.41k forks source link

ESP32-S3 Support #5594

Closed VojtechBartoska closed 2 years ago

VojtechBartoska commented 3 years ago

Adding support for ESP32-S3 chipset.

Please specify what's needed and tag issues which will be solved by this.

Update:

Testing is tracking here in Github Discussions if you want to help us, feel free to comment there :)

heipp commented 3 years ago

A fatal error occurred: This chip is ESP32-83(beta3) not ESP32-S3(beta2). Wrong --chip argument? This error occurred when I was make flash,why? My development board is ESP32S3

me-no-dev commented 3 years ago

@heipp there is no S3 support yet. You can not build for it.

chegewara commented 3 years ago

then hurry up, i just ordered few of those ;)

ozkarah commented 3 years ago

Hi, I appreciate your work. Are there any updates on this task? Or any planned finish date?

hoskam-l commented 3 years ago

I tried to compile the sample Hello World app and was given this error:

This chip is ESP32-S3(beta3) not ESP32. Wrong --chip argument?

So, we can't compile for the S3 yet? Is that right, Espressif is selling chips that you can't compile software for?

I know I'm such a noob. But I'm curious about how to eve set that value. (This might not even be the right place to ask such trivial question and I apologize)

Is it on this line of the python script?

@ttfw_idf.idf_example_test(env_tag='Example_GENERIC', target=['esp32', 'esp32c3'])

chegewara commented 3 years ago

This chip is ESP32-S3(beta3) not ESP32. Wrong --chip argument?

You have older version of S3 chip, it wont be supported in esp-idf soon and for sure not in arduino.

hoskam-l commented 3 years ago

Ahh, thanks. Very interesting.

chegewara commented 3 years ago

But, it is also my bad in answer here. That message you see is telling you that you have selected old esp32 chip/board and the chips is S3 (beta3). Currently there is no support for S3 anyway in arduino, and like i said earlier the support will be for S3 rev 0 and newer.

hoskam-l commented 3 years ago

I'm using the ESP-IDF, which I think did support S3 or at least had filesname included in the package that indicated S3 was supported.

In the command line I set as esp32s3 using :idf.py set-target esp32s3 and I get the error OP gets.

So beta3 is older than beta2?

How would I go about programming this without the esp-idf?

chegewara commented 3 years ago

You can use esp-idf with S3, S3-betax. The thing is that currently esp-idf master is supporting only S3 rev0, no longer S3-beta support. You still can use esp-idf , just i dont remember with which branch or v4.x. Maybe @igrr can help with answer

MartinPatarinski commented 2 years ago

The flash command works on the master branch. By default the release 4.3 of EPS-IDF is downloaded and it does not support esp32s3 officially. Below is the dependency described: image

gtjoseph commented 2 years ago

Back to the original topic though... arduino-esp32 still does NOT support the S3 even though esp-idf does.

afredsa commented 2 years ago

Hello, Sorry Quick questions for clarification The current release (2.0.1) says it is based on ESP-ID 4.4 (according to the release page). Is the S3 supported as stated in the previous pic? (sorry, I am not sure what is trying to be said.

I have ESP32-S3 of "Chip is ESP32D0WDQ6 (revision 0)" @chegewara said only S0 chips will be supported. Is this the S0 (or newer) chip required? And will this chip also be removed from support when the Rev 1 chips are released? (I assume it is as I am able to flash in ESP 4.4 (cl and ?vscode) but not Arudino or PIO yet).

Thank you for any help and patience with my perhaps noobish question.

Miraculix200 commented 2 years ago

2.0.1 is "S3 ready", but it's not selectable yet. I installed it and looked at the folders, and there's S3 files inside. But it's not in the boards.txt yet. So you can't select the board in Arduino IDE.

See https://github.com/espressif/arduino-esp32/tree/master/variants/esp32s3

VojtechBartoska commented 2 years ago

@Miraculix200 that folder is just initial preparation for S3 support.

Mchaney3 commented 2 years ago

I am currently using idf 4.4 and master and both work well with the S3. Arduino support will be amazing for this board. S3-C1n8r2 is the perfect board for all my projects.

What can we do to assist porting funtionality?

me-no-dev commented 2 years ago

we are already doing it :) stay put, support is around the corner.

bunalti commented 2 years ago

I am thinking about using S3 in next project, I see there already is a dedicated branch for this. Can I compile and flash using the software in esp32-s3-support branch ? When you plan to publish the support ? And lastly which chip versions should I get ?

me-no-dev commented 2 years ago

@bunalti

  1. Yes you can use that branch, but SPI and flashing from TinyUSB(USB-OTG) does not work currently. SPI is on the way, can't comment on the other. If you want to use the built-in USB, then do not select USB-OTG mode in the board menu.
  2. We will publish as soon as SPI is done and some basic tests have confirmed that the hardware is mostly working (can not promise that will not be any bugs at the beginning)
  3. You should get any MP version. Beta chips are not supported.
khoih-prog commented 2 years ago

These libraries created or updated to add support to new ESP32_S3 boards, using ESP32 core, esp32-s3-support branch, v2.0.2+. The lists will be updated gradually.

Modified Libraries

New Libraries

Many more to come.

gtjoseph commented 2 years ago

Thanks for the update!

ericlangel commented 2 years ago

USB Serial Example -> CDC is not working.

S3 native USB is not detected by Windows (10) as CDC Device

In Bootloader Mode the native USB is detected as CDC/JTAG with the stock firmware is S3 Devkit the USB was also detected as CDC

ewpa commented 2 years ago

Hello, any hints to get my 32 MB Flash ESP32-S3-WROOM-2 D3N32R8V working with this branch? Uploading any simple sketch results in a boot loop:

entry 0x403b61c0
assert failed: do_core_init startup.c:298 (flash_ret == ESP_OK)

Backtrace:0x40376b3e:0x3fceb1800x4037bd65:0x3fceb1a0 0x40381825:0x3fceb1c0 0x4200b58a:0x3fceb2f0 0x40376659:0x3fceb320 0x403bae57:0x3fceb350 0x403bb0de:0x3fceb380 0x403b6215:0x3fceb4b0 0x40045c01:0x3fceb570  |<-CORRUPTED
Rebooting...

Whereas the IDF v4.4 boots (with DIO):

I (222) cpu_start: ESP-IDF:          v4.4-172-g730ca0ea43-dirty
I (229) heap_init: Initializing. RAM available for dynamic allocation:
I (236) heap_init: At 3FC94AF8 len 0004B508 (301 KiB): D/IRAM
I (242) heap_init: At 3FCE0000 len 0000EE34 (59 KiB): STACK/DRAM
I (249) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (255) heap_init: At 600FE000 len 00002000 (8 KiB): RTCRAM
I (262) spi_flash: detected chip: mxic
W (266) spi_flash: Detected flash size > 16 MB, but access beyond 16 MB is not supported for this flash model yet.
I (277) spi_flash: flash io: dio
W (281) spi_flash: Detected size(32768k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
me-no-dev commented 2 years ago

@ewpa what options have you selected in the board menu?

me-no-dev commented 2 years ago

@ericlangel same question

codewitch-honey-crisis commented 2 years ago

Hi folks. I'm not sure if this is the right place to ask this, but how do I actually use the development branch of the Arduino framework for the S3? What url do I reference in Arduino IDE, or better yet, what do I include in platformio.ini to get it in there. Failing that, is there another way to use this branch? Forgive my ignorance.

ericlangel commented 2 years ago

@me-no-dev grafik

me-no-dev commented 2 years ago

@ericlangel to run the USB Serial example, you should switch the USB Mode to USB-OTG (that will use the USB peripheral and not the hardware CDC+JTAG)

@codewitch-honey-crisis you can start here

me-no-dev commented 2 years ago

@ericlangel BTW with what you have selected, you can just directly use Serial and it will be routed to the hardware CDC+JTAG

ericlangel commented 2 years ago

i just wanted to play a little bit with USB and UART (CP210x). Not sure if i already realized what is routed to which peripheral. And now its working.

So... to use internal USB for Serial you need to set USB-OTG

Maybe there should be a hint like DFU and MSC On Boot -> that USB OTG need to be set

so it sounds for DFU and MSC use OTG and for the other stuff like Serial dont use it

p.s. Upload with internal USB is actual not supported?

me-no-dev commented 2 years ago

there should not be a hint, because on the S3 there are 2 USB peripherals. One is integrated in hardware CDC+JTAG and the other is a full on USB-OTG peripheral that can be device or host. In both cases, depending on which USB is active "CDC on Boot" will route it to "Serial" and the hardware serial port becomes "Serial0", so for regular UART, you should disable CDC on Boot

ewpa commented 2 years ago

@ewpa what options have you selected in the board menu?

@me-no-dev please see below my options (hope image is okay). I tried changing many options already. Screenshot from 2022-02-16

ericlangel commented 2 years ago

@me-no-dev and what can i do with "hardware cdc + jtag"?

me-no-dev commented 2 years ago

@ewpa I think that your board uses OPI flash and PSRAM. You can try setting the proper values for FlashMode and PSRAM

@ericlangel you can use it instead of CP210x and UART0 to flash and communicate over USB.

ewpa commented 2 years ago

Thanks @me-no-dev setting PSRAM to OPI was enough to stop the boot loop.

surajdevs commented 2 years ago

Follow this link to get working Arduino ESP32-S3 support

https://github.com/surajdevs/ESP32-S3-Support/blob/main/README.md

surajdevs commented 2 years ago

@heipp there is no S3 support yet. You can not build for it. Here is a working compliable setup for Arduino ESP32-S3.

https://github.com/surajdevs/ESP32-S3-Support/blob/main/README.md

P-R-O-C-H-Y commented 2 years ago

@surajdevs There is official branch called esp32-s3-support. You can get ESP32-S3 working with this branch easily. No need to download from external links :)

flybeyond commented 2 years ago

BLE doesn't work in S3. Here I posted an issue #6319. Some symbols missed in libbt.a.

ericlangel commented 2 years ago

@flybeyond use NimBLE just tested Version 1.3.7 on the S3 and its working without problems

flybeyond commented 2 years ago

@flybeyond use NimBLE just tested Version 1.3.7 on the S3 and its working without problems

I tried NimBLE_Sever, this is output:

C:\Users\xxx\Documents\Arduino\libraries\NimBLE-Arduino\src\NimBLEDevice.cpp: In static member function 'static void NimBLEDevice::init(const string&)': C:\Users\xxx\Documents\Arduino\libraries\NimBLE-Arduino\src\NimBLEDevice.cpp:763:16: error: 'struct esp_bt_controller_config_t' has no member named 'mode' bt_cfg.mode = ESP_BT_MODE_BLE; ^~~~ C:\Users\xxx\Documents\Arduino\libraries\NimBLE-Arduino\src\NimBLEDevice.cpp:764:16: error: 'struct esp_bt_controller_config_t' has no member named 'ble_max_conn'; did you mean 'ble_max_act'? bt_cfg.ble_max_conn = CONFIG_BT_NIMBLE_MAX_CONNECTIONS; ^~~~ ble_max_act exit status 1 Error compiling for board ESP32S3 Dev Module.

ericlangel commented 2 years ago

did you used the latest Nimble Version 1.3.7?

with an older version i had the same output

flybeyond commented 2 years ago

This is what I used. image

ericlangel commented 2 years ago

i use the same,

but i had some trouble to update it. In the end i copied the release manually. maybe you having a similar issue

flybeyond commented 2 years ago

@ericlangel The issue is resolved by recent commit. Thanks a lot for your help.

HYXianghua commented 2 years ago

Esp-idf 4.4-ESP32 S3 In the function uint32_t ledc_get_freq(ledc_mode_t speed_mode, ledc_timer_t timer_num) The clock_Divider in the formula when the frequency is returned is 0 and is used as the denominator Causes a direct restart when using this function Prompt message "IntegerDivideByZero"

HYXianghua commented 2 years ago

Esp idf-4.4 ESP32S3 When sampling with ADC Digi esp_err_t adc_digi_read_bytes(uint8_t buf, uint32_t length_max, uint32_t out_length, uint32_t timeout_ms); All the data read is zero, even when using the official example, and the all related functions return ESP_OK

syedhayi commented 2 years ago

Can anyone please mention the steps for getting started with esp32s3 in arduino with brief explanation?

lbernstone commented 2 years ago

The instructions for installation are the same for esp32-s3 as for the rest of the chips. However, you cannot use the board manager for the s3 until 2.0.3 is released, so you would need to install with the git instructions.

syedhayi commented 2 years ago

@lbernstone Hello, Thank you for your reply. I tried with git instruction in Ubuntu but ESP32S3 board doesn't shown up. also couldn't find esp32s3 in board.txt file. Is there any other instruction on how to program esp32s3 using arduino IDE?