esp-idf: ESP32-S3 Blink example does not work (IDFGH-6927)

Environment

  • Development Kit: [ESP32-S3-DevKitC-1 v1.0, N32R8V]
  • Module or chip used: [ESP32–S3-WROOM-2]
  • IDF version: v4.4-351-g121ddb87e5
  • Build System: [idf.py]
  • Compiler version:xtensa-esp32-elf-gcc (crosstool-NG esp-2021r2-patch3) 8.4.0
  • Operating System: [macOS]
  • Using an IDE?: [VS Code]
  • Power Supply: [USB]

Problem Description

//Detailed problem description goes here. The on board RGB LED almost does not response.

Expected Behavior

The on board RGB LED should be on and off for every 1 second.

Actual Behavior

The RGB LED will change to white color when power up for the first time. Then it mostly does not change even I see a lot of on/off messages from terminal. Wait a while (around one minute or more), it will change to other random color. And this patten will repeat.

This problem just occurs to ESP32-S3. ESP32-S2 does not have problem.

Steps to reproduce

  1. Create an IDF project of Blink example using ESP32-S3
  2. Build and flash it.
  3. The problem occurs immediately

Debug Logs

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x18 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
Octal Flash Mode Enabled
For OPI Flash, Use Default Flash Boot Mode
mode:SLOW_RD, clock div:1
load:0x3fcd0108,len:0x1658
load:0x403b6000,len:0xb7c
load:0x403ba000,len:0x2f74
entry 0x403b6248
I (32) boot: ESP-IDF v4.4-351-g121ddb87e5 2nd stage bootloader
I (32) boot: compile time 04:32:14
I (32) boot: chip revision: 0
I (35) boot.esp32s3: Boot SPI Speed : 80MHz
I (40) boot.esp32s3: SPI Mode       : SLOW READ
I (45) boot.esp32s3: SPI Flash Size : 2MB
I (50) boot: Enabling RNG early entropy source...
I (55) boot: Partition Table:
I (59) boot: ## Label            Usage          Type ST Offset   Length
I (66) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (74) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (81) boot:  2 factory          factory app      00 00 00010000 00100000
I (89) boot: End of partition table
I (93) esp_image: segment 0: paddr=00010020 vaddr=3c020020 size=08958h ( 35160) map
I (109) esp_image: segment 1: paddr=00018980 vaddr=3fc91a10 size=02718h ( 10008) load
I (112) esp_image: segment 2: paddr=0001b0a0 vaddr=40374000 size=04f78h ( 20344) load
I (124) esp_image: segment 3: paddr=00020020 vaddr=42000020 size=189c0h (100800) map
I (150) esp_image: segment 4: paddr=000389e8 vaddr=40378f78 size=08a8ch ( 35468) load
I (160) esp_image: segment 5: paddr=0004147c vaddr=50000000 size=00010h (    16) load
I (166) boot: Loaded app from partition at offset 0x10000
I (166) boot: Disabling RNG early entropy source...
I (180) cpu_start: Pro cpu up.
I (181) cpu_start: Starting app cpu, entry point is 0x403751b8
0x403751b8: call_start_cpu1 at /Users/andy/esp/esp-idf/components/esp_system/port/cpu_start.c:160

I (0) cpu_start: App cpu up.
I (195) cpu_start: Pro cpu start user code
I (195) cpu_start: cpu freq: 160000000
I (195) cpu_start: Application information:
I (198) cpu_start: Project name:     blink
I (202) cpu_start: App version:      1
I (207) cpu_start: Compile time:     Mar 11 2022 04:31:56
I (213) cpu_start: ELF file SHA256:  0665a6b0e5f5d903...
I (219) cpu_start: ESP-IDF:          v4.4-351-g121ddb87e5
I (225) heap_init: Initializing. RAM available for dynamic allocation:
I (232) heap_init: At 3FC94B50 len 0004B4B0 (301 KiB): D/IRAM
I (238) heap_init: At 3FCE0000 len 0000EE34 (59 KiB): STACK/DRAM
I (245) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (251) heap_init: At 600FE000 len 00002000 (8 KiB): RTCRAM
I (258) spi_flash: detected chip: mxic
W (262) spi_flash: Detected flash size > 16 MB, but access beyond 16 MB is not supported for this flash model yet.
I (273) spi_flash: flash io: dio
W (277) spi_flash: Detected size(32768k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (291) sleep: Configure to isolate all GPIO pins in sleep state
I (297) sleep: Enable automatic switching of GPIO sleep configuration
I (305) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (325) example: Example configured to blink addressable LED!
I (325) example: Turning the LED OFF!
I (1335) example: Turning the LED ON!

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 1
  • Comments: 68 (11 by maintainers)

Most upvoted comments

In case this helps others using the N32R8V variant of the ESP32-S3-DevKitC-1 (v 1.1), I found that the CONFIG_BLINK_GPIO needs to be using pin 38, not the default 48. You can set this using the terminal cmd idf.py menuconfig, selecting “Example Configuration” and changing “Blink GPIO Number” to 38.

Finally got the reason why it failed. The board (ESP32-S3-DevKitC-1 v1.0, N32R8V) from Espressif may have problem.

The waveform from ESP32-S3, measured from the LED control signal pin solder pad (not from the header pin). PWM High is too low at around 1.88V https://ibb.co/7Nry8F2

For ESP32-S2, it is around 3.1V with the same testing condition above. https://ibb.co/ZSD2TTL

The two waveforms overlapped image: https://ibb.co/5Ywxf87

Do recent boards have similar problem? The board is also not recognized by RainMaker during claiming procedure.

Can you also test it using the LED Strip Example?

Be sure to configure the GPIO to 48 in case of the ESP32-S3-DevKitC-1.

While testing it on the LOLIN S3 Pro, I had to enable the USB CDC On Boot and select the ESP32S3 Dev Module instead of LOLIN S3 Pro, and also the LED, at least for me, doesn’t seem to be a RGB LED but a GRB LED. So, I had to do some changes:


#define RGB_PIN 38

void setup() {
  neopixelWrite(RGB_PIN, 0, 0, 0);  // ALWAYS TURN NEOPIXEL OFF AT FIRST !!
  Serial.begin(2000000);
}

void loop() {
  Serial.println("ALL COLORS!");
  neopixelWrite(RGB_PIN, RGB_BRIGHTNESS, RGB_BRIGHTNESS, RGB_BRIGHTNESS);  // Red
  delay(1000);
  Serial.println("OFF!");
  neopixelWrite(RGB_PIN, 0, 0, 0);  // Off / black
  delay(1000);
  Serial.println("GREEN!");
  neopixelWrite(RGB_PIN, RGB_BRIGHTNESS, 0, 0);  // GREEN
  delay(1000);
  Serial.println("RED!");
  neopixelWrite(RGB_PIN, 0, RGB_BRIGHTNESS, 0);  // RED
  delay(1000);
  Serial.println("BLUE!");
  neopixelWrite(RGB_PIN, 0, 0, RGB_BRIGHTNESS);  // BLUE
  delay(1000);
  Serial.println("OFF!");
  neopixelWrite(RGB_PIN, 0, 0, 0);  // Off / black
  delay(1000);
}

I had the same issue, I tried example projects as is, didn’t work. The solution is simple for dev boards, you can just look at your board above RGB LED itself, there is a text with GPIO where this LED is connected. Update in BlinkRGB example RGB_BUILTIN to your pin number and that’s it.

IMG_7243 Large

#define RGB_PIN 38

void setup() {
  // No need to initialize the RGB LED
}

// the loop function runs over and over again forever
void loop() {
  neopixelWrite(RGB_PIN,RGB_BRIGHTNESS,RGB_BRIGHTNESS,RGB_BRIGHTNESS); // Red
  delay(1000);
  neopixelWrite(RGB_PIN,0,0,0); // Off / black
  delay(1000);

  neopixelWrite(RGB_PIN,RGB_BRIGHTNESS,0,0); // Red
  delay(1000);
  neopixelWrite(RGB_PIN,0,RGB_BRIGHTNESS,0); // Green
  delay(1000);
  neopixelWrite(RGB_PIN,0,0,RGB_BRIGHTNESS); // Blue
  delay(1000);
  neopixelWrite(RGB_PIN,0,0,0); // Off / black
  delay(1000);
}

My board was not working too, but after I connected it (image below), and now it’s working.

image

code: https://github.com/espressif/arduino-esp32/blob/master/libraries/ESP32/examples/GPIO/BlinkRGB/BlinkRGB.ino

I’ve figured out, I had to add an additional line #define RGB_BUILTIN 38 and now it works 👍

@maned3v The LED on this board is not a simple LED, but it is a NeoPixel LED, which needs to be programmed via a serial interface. I guess the Arduino init code (which is not called from your VSC code) does the programming, that’s why it works. You need to initialize the LED with the appropriate function, and use neopixelWrite instead of digitalWrite.

@bhoffman17 Please note that while the LED power supply voltage is 3.3V (so the LED is bright), but the communication line is only 1.8V. According to the datasheet this pin belongs to the VDD_SPI power domain, which is 1.8V on this particular board (ESP32-S3-DevKitC-1-N32R8V). Other boards with 3.3V SPI flash voltage are not affected.

The issues is related with 1.8v VDD_SPI, the ESP32-S3-WROOM-2 is 1.8v SPI Flash and PSRAM, the GPIO 48 & 47 is powered from VDD_SPI and it can’t be changed to other power domain, so the voltage of GPIO48 & 47 is limited on 1.8v .

@pedrominatel Yes, the configuration is correct, GPIO48 is selected. The signal on the pin is correct, just the level is too low. Please find attached the sdkconfig file.

sdkconfig.zip

Can you check the value of the R17? image Is the one close to the RGB LED: image

It should be 0R. You can try to remove it and make a soldering jumper for testing.

With both external WB2812B and on-board LED are connected to GPIO48. As I said before, on-board LED always works while external one never works.

Then I remove external one from GPIO48. The on-board LED is not normal immediately.

PS: Connecting the external strip back to GPIO48, the on-board one works again.

PPS: I found in order to make on-board LED work, 5V must be supplied to the external strip. Without 5V and only control and ground connected to the board does not help.

@pedrominatel I have only one ESP32-S3-DevKitC (N32R8V) which was ordered in Feb from Espressif China. But the factory pre-loaded firmware works perfectly to control the RGB LED with different color. And the LED works exactly like ESP32-S2 boards pre-loaded firmware.

I will try. to test LED Strip example.