The issue regarding the inability to enable GPIO48 on the ESP32S3

Asunar2
Posts: 2
Joined: Wed Sep 04, 2024 9:34 am

The issue regarding the inability to enable GPIO48 on the ESP32S3

Postby Asunar2 » Wed Sep 04, 2024 9:53 am

Hello everyone, when I was programming my ESP32S3 using the esp-idf software, I found that my ESP32S3 does not support operations on GPIO48. However, the ESP32S3 I have does physically bring out IO48, which is connected to the 2812 RGB LED module. I can currently control the LED lights to change color by inputting a signal to it. But the problem is that the development board is outputting information that the GPIO number is unsupported, which confuses me. I have consulted the chip design manual, but there is no section that explains the redefinition of GPIO48. Can anyone help me analyze why this is happening? Here is my source code and the output information from the 32S3:
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x2b (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3810,len:0x178c
load:0x403c9700,len:0x4
load:0x403c9704,len:0xcbc
load:0x403cc700,len:0x2d98
entry 0x403c9914
I (27) boot: ESP-IDF v5.2 2nd stage bootloader
I (27) boot: compile time Sep 4 2024 17:00:09
I (27) boot: Multicore bootloader
I (30) boot: chip revision: v0.2
I (34) boot.esp32s3: Boot SPI Speed : 80MHz
I (38) boot.esp32s3: SPI Mode : DIO
I (43) boot.esp32s3: SPI Flash Size : 2MB
I (48) boot: Enabling RNG early entropy source...
I (53) boot: Partition Table:
I (57) boot: ## Label Usage Type ST Offset Length
I (64) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (72) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (79) boot: 2 factory factory app 00 00 00010000 00100000
I (87) boot: End of partition table
I (91) esp_image: segment 0: paddr=00010020 vaddr=3c020020 size=0cf44h ( 53060) map
I (109) esp_image: segment 1: paddr=0001cf6c vaddr=3fc91d00 size=028d0h ( 10448) load
I (111) esp_image: segment 2: paddr=0001f844 vaddr=40374000 size=007d4h ( 2004) load
I (117) esp_image: segment 3: paddr=00020020 vaddr=42000020 size=19260h (103008) map
I (143) esp_image: segment 4: paddr=00039288 vaddr=403747d4 size=0d4f8h ( 54520) load
I (161) boot: Loaded app from partition at offset 0x10000
I (161) boot: Disabling RNG early entropy source...
I (172) cpu_start: Multicore app
I (183) cpu_start: Pro cpu start user code
I (183) cpu_start: cpu freq: 160000000 Hz
I (183) cpu_start: Application information:
I (186) cpu_start: Project name: hello_world
I (191) cpu_start: App version: 1
I (195) cpu_start: Compile time: Sep 4 2024 16:59:59
I (202) cpu_start: ELF file SHA256: 1ed1a3b41...
I (207) cpu_start: ESP-IDF: v5.2
I (212) cpu_start: Min chip rev: v0.0
I (216) cpu_start: Max chip rev: v0.99
I (221) cpu_start: Chip rev: v0.2
I (226) heap_init: Initializing. RAM available for dynamic allocation:
I (233) heap_init: At 3FC94EA0 len 00054870 (338 KiB): RAM
I (239) heap_init: At 3FCE9710 len 00005724 (21 KiB): RAM
I (245) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (251) heap_init: At 600FE010 len 00001FD8 (7 KiB): RTCRAM
I (259) spi_flash: detected chip: generic
I (262) spi_flash: flash io: dio
W (266) spi_flash: Detected size(16384k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (280) sleep: Configure to isolate all GPIO pins in sleep state
I (286) sleep: Enable automatic switching of GPIO sleep configuration
I (294) main_task: Started on CPU0
I (304) main_task: Calling app_main()
E (304) gpio: GPIO_PIN mask error
I (304) main_task: Returned from app_main()



And this is my source code:



#include <stdio.h>
#include"freertos/FreeRTOS.h"
#include"freertos/task.h"
#include"driver/gpio.h"

#define LED_GPIO GPIO_NUM_48

void led_run_task(void*param)
{
int gpio_level = 0;
while (1)
{
gpio_level = gpio_level?0:1;
gpio_set_level(LED_GPIO,gpio_level);/* code */
vTaskDelay(pdMS_TO_TICKS(500));
}

}

void app_main(void)
{
gpio_config_t led_cfg = {
.pin_bit_mask=(1<<LED_GPIO),
.pull_up_en = GPIO_PULLUP_DISABLE,
.pull_down_en = GPIO_PULLDOWN_DISABLE,
.mode = GPIO_MODE_OUTPUT,
.intr_type = GPIO_INTR_DISABLE,

};
gpio_config(&led_cfg);

xTaskCreatePinnedToCore(led_run_task,"led",2048,NULL,3,NULL,1);
}
Thanks!! :shock:

ESP_Sprite
Posts: 9568
Joined: Thu Nov 26, 2015 4:08 am

Re: The issue regarding the inability to enable GPIO48 on the ESP32S3

Postby ESP_Sprite » Thu Sep 05, 2024 1:59 am

Change it to

Code: Select all

 .pin_bit_mask=(1ULL<<LED_GPIO),
The compiler likely gave you a warning about this.

Asunar2
Posts: 2
Joined: Wed Sep 04, 2024 9:34 am

Re: The issue regarding the inability to enable GPIO48 on the ESP32S3

Postby Asunar2 » Thu Sep 05, 2024 2:41 am

Thank you, the issue has been resolved.

Who is online

Users browsing this forum: No registered users and 23 guests