If the unit tests pass, let’s take a look at the build results.
- Is the size of the compiled firmware appropriate for the device and partition definition you are using?
You should be able to see the final size of the build in the terminal output.
Since the flash size appears to be 4MB, the default partition configuration limits the firmware size to 1,310,720 bytes.
The contents of your platformio.ini file are crucial for determining this.
⇒ Please provide the full content of this file if possible.
If the partition size does not match the size of your compiled firmware, it will not function correctly.
If you need to adjust the partition size, you can, for example, download max_app_4MB.csv from arduino-esp32/tools/partitions at master · espressif/arduino-esp32 · GitHub and explicitly specify it in your platformio.ini.
I have attached two screenshots from a recent project of mine; please note that since I am using Ubuntu, you will need to adjust the file paths to the Windows format.
For more information on handling partitions, please refer to the following documentation:

