The SoC model is ESP32-S3 and it is using a 16MB external flash memory and an 8MB external PSRAM IC. The SPI FLASH/PSRAM configuration is 4 data lines in QUAD mode.
At boot time the FLASH/PSRAM and operation mode are correctly recognized.
For one of the tests, I want to light 3 LEDs whose cathode are connected directly to GPIO33-35. LED's anodes are connected to a 3.3 V source thru a separate resistance for each LED.
The LEDs setting is like below:
- /* GPIO TEST */
- void set_gpio(void) {
- gpio_config_t io_conf;
- // Bit mask for the pins
- io_conf.pin_bit_mask = (1ULL << GPIO_NUM_33)|(1ULL << GPIO_NUM_34)|(1ULL << GPIO_NUM_35)|(1ULL << GPIO_NUM_40);
- // Set as an open-drain output pin.
- io_conf.mode = GPIO_MODE_OUTPUT_OD;
- // No pull-up/pull-down resistors.
- io_conf.pull_up_en = GPIO_PULLUP_DISABLE;
- io_conf.pull_down_en = GPIO_PULLDOWN_DISABLE;
- // No interrupt enabled.
- io_conf.intr_type = GPIO_INTR_DISABLE;
- // Configure the GPIO with the settings.
- gpio_config(&io_conf);
- }
Then I have created a task to blink the LEDs every 5 seconds:
- void gpio_task(void* arg) {
- for(;;) {
- gpio_set_level(GPIO_NUM_33, 0);
- gpio_set_level(GPIO_NUM_34, 0);
- gpio_set_level(GPIO_NUM_35, 0);
- gpio_set_level(GPIO_NUM_40, 0);
- vTaskDelay(pdMS_TO_TICKS(5000));
- gpio_set_level(GPIO_NUM_33, 1);
- gpio_set_level(GPIO_NUM_34, 1);
- gpio_set_level(GPIO_NUM_35, 1);
- gpio_set_level(GPIO_NUM_40, 1);
- vTaskDelay(pdMS_TO_TICKS(5000));
- }
- }
When the LEDs are not connected, GPIOs output is always 0 but once connected the LEDs are OFF. So, even when GPIO output is 0 there is not current coming into GPIO ports to turn LEDs ON.
I have read ESP32-S3 datasheet, reference manual and from it I understand that when SPI FLASH/PSRAM operate as 4 lines data in quad mode, GPIO33 to GPIO37 can be used. However I am struggling to set it correctly to be able to use them.
Please, can anybody guide me how to proceed with this? Evidently I am doing something wrong cannot realize myself.
Also, can anybody confirm that I can certainly use GPIO33-37 as outputs to light a LED?
Any help or advise would be greatly appreciated.
Thank you