LED blinking success but the board does not work

I am new to ESP32 and trying to learn how to use it and I’m trying to with a simple and basic project which is LED Blinking. I have ESP32-WROOM-32U and ESP32-C3-32S and both of them gets to me a success build and upload; however, the LED does not blinking. ESP32-C3-32S only works with espidf framework, so I am working with ESP32-WROOM-32U. I tried to use in both Arduino IDE and VSCode Platformio. and still did not get any conclusion. I went to Platformio in vscode and selected test form Advanced and it failed.

I tried in some other boards that works on my ESP32

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino

I also changed the pin of LED

#include <Arduino.h>

void setup(){
    pinMode(2, OUTPUT);

}

void loop(){
    digitalWrite(2,HIGH);
    delay(1000);
    digitalWrite(2,LOW);
    delay(1000);
}

And this is the outcome of test result.

Verbose mode can be enabled via `-v, --verbose` option
Collected 1 items

Processing * in esp32dev environment
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Building...
.pio\build\esp32dev\libFrameworkArduino.a(main.cpp.o):(.literal._Z8loopTaskPv+0x8): undefined reference to `setup()'
.pio\build\esp32dev\libFrameworkArduino.a(main.cpp.o):(.literal._Z8loopTaskPv+0xc): undefined reference to `loop()'     
.pio\build\esp32dev\libFrameworkArduino.a(main.cpp.o): In function `loopTask(void*)':
C:\Users\MSI\.platformio\packages\framework-arduinoespressif32\cores\esp32/main.cpp:18: undefined reference to `setup()'
C:\Users\MSI\.platformio\packages\framework-arduinoespressif32\cores\esp32/main.cpp:21: undefined reference to `loop()' 
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\esp32dev\firmware.elf] Error 1
========================================================================== [FAILED] Took 8.93 seconds ========================================================================== 

Test    Environment    Status    Duration
------  -------------  --------  ------------
*       esp32dev       FAILED    00:00:08.929
===================================================================== 1 failed, 0 succeeded in 00:00:08.929 ====================================================================="C:\Users\MSI\.platformio\penv\Scripts\platformio.exe 'test', '--environment', 'esp32dev'" terminal işlemi şu çıkış koduyla sonlandırıldı: 1.

Testing only makes sense if you explicitly put sources in the test/ folder and implement setup() and loop() and execute testcases. You don’t need this for regular uplading of this blinky firmware.

Are you sure you have IO2 connected to the LED? Does the LED manually light up when you apply a HIGH or LOW voltage on it?

Does changing this to platform = https://github.com/Jason2866/platform-espressif32.git make a difference?

I tried most of IO pins, and yes it is manually light up.

platform = https://github.com/Jason2866/platform-espressif32.git

gets to me this error:

Platform Manager: Installing git+https://github.com/Jason2866/platform-espressif32.git
Error: Please install Git client from https://git-scm.com/downloads

I went to the site and downloaded what it wanted from me. Then, pressed clean, build then uplaoad. All three got success but the LED just lights and does not blink.

Add monitor_speed = 115200 in the platformio.ini. Does the serial monitor task show any errors? (PlatformIO side bar → project tasks)

Nothing happens on Serial Monitor. It’s been some minutes and still says task is running.

Pressing the reset button makes no difference?

Nothing happens on VsCode, but it started working on Arduino IDE.

What exact core version are you using in the Arduino IDE? What are all your settings in the “Tools” menu?

Arduino IDE version is 1.8.19

Tools:
Board: DOIT ESP32 DEV KIT V1
Upload speed: 115200
Flash frequency: 80MHz
Core debug level: Nothing
Port: (Depends when I plug the device on my computer)

#include <driver/gpio.h>
// Include FreeRTOS for delay
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#define LED GPIO_NUM_2 // LED connected to GPIO2
extern "C"
{
    int app_main()
    {
        // Configure pin
        gpio_config_t io_conf;
        io_conf.intr_type = GPIO_INTR_DISABLE;
        io_conf.mode = GPIO_MODE_OUTPUT;
        io_conf.pin_bit_mask = (1ULL << LED);
        // io_conf.pull_down_en = 0;
        // io_conf.pull_up_en = 0;
        gpio_config(&io_conf);
        // Main loop
        while (true)
        {
            gpio_set_level(LED, 0);
            vTaskDelay(500 / portTICK_PERIOD_MS);
            gpio_set_level(LED, 1);
            vTaskDelay(500 / portTICK_PERIOD_MS);
        }
    }
}

This Code Works For Myself.