Unit Testing not working on ESP32 (test port not automatically recognized)
See original GitHub issueWhat kind of issue is this?
- PlatformIO Core. If you’ve found a bug, please provide an information below.
You can erase any parts of this template not applicable to your Issue.
Configuration
Operating system: Win10 x64
PlatformIO Version (platformio --version
): version 5.2.1b4
Description of problem
Unit testing for an ESP32 hangs at the “Testing…” phase.
Steps to Reproduce
- Create new blank ESP32 project
- Add
test/simple_test.cpp
from below - Use the project task “Advanced -> Test”
Actual Results
Writing at 0x0003fafb... (100 %)
Wrote 210992 bytes (108452 compressed) at 0x00010000 in 3.1 seconds (effective 536.3 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
Testing...
If you don't see any output for the first 10 secs, please reset board (press reset button)
(hangs forever)
Expected Results
Successfull unit test result.
If problems with PlatformIO Build System:
The content of platformio.ini
:
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
Source file to reproduce issue:
test\simple_test.cpp
#include <Arduino.h>
#include <unity.h>
void test_led_builtin_pin_number(void) {
TEST_ASSERT_EQUAL(13, 13);
}
void setup() {
delay(3000);
UNITY_BEGIN();
RUN_TEST(test_led_builtin_pin_number);
UNITY_END(); // stop unit testing
}
void loop() { }
Additional info
- The board is a standard https://www.amazon.de/ESP-32S-ESP32-Development-Bluetooth-Antennenmodul/dp/B071JR9WS9
pio test
locks up so that it can’t even killed by Ctrl+C, must be killed in the taskmanager- Increasing the
delay()
does not help - Explicitly setting
test_speed = 115200
does not help - Modifying
setup()
toSerial.begin(115200); Serial.print("\n\n");
does not help (separates bootloader output from test output) - Setting DTR / RTS states with
pio test --monitor-dtr <0/1> --monitor-rts <0/1>
does not help - Pressing the reset button on the board does not help
- Looking at the serial output after the testing has been aborted at the waiting phase gives
Issue Analytics
- State:
- Created 2 years ago
- Comments:19 (10 by maintainers)
Top Results From Across the Web
Auto Detect of COM Port with ESP32-S3 not working
It means that PlatformIO found the port. Autodetection works as expected. Could you try to erase flash and upload again?
Read more >ESP32 not recognized by PC. No COM port problem!
I just purchased a new ESp32 yesterday and have exactly the same problem..I can see the USB connection and the correct port. The...
Read more >ESP32 Troubleshooting Guide | Random Nerd Tutorials
The ESP32 has a few problems when you are trying to upload new sketches or ... If you don't see your ESP's COM...
Read more >Unit Testing in ESP32 - Technical Documents
These tests use the Unity unit test framework. They can be integrated into an ESP-IDF component by placing them in the component's test...
Read more >(SOLVED!) Esp32 devkit v1 not loading sketch - Arduino Forum
I am having a problem loading a sketch with arduino IDE Having tried ... Did you do the tests with nothing connected to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ivankravets
Works perfectly 💯 🥇
@ivankravets Created 4263