So I have my unit tests working on the ESP32 using Unity. Great!
On my current dev board, I have to catch the boot mode on every upload. So, when I do a Upload
normally, I get to this part in the output:
Serial port /dev/cu.usbserial-0001
Connecting..................
and I have to be releasing the boot mode button on the dev kit to get my upload to go through, or else I get this error:
A fatal error occurred: Failed to connect to ESP32: Wrong boot mode detected (0x13)! The chip needs to be in download mode.
The problem with running tests from the UI, even in Verbose Test
, is that the Connecting...
part of the output doesn’t get printed. We just get:
Processing test_device_data_lib in esp_devkit environment
-------------------------------------------------------------------------------------------------------------------------------------------
Building & Uploading...
And it’s hard to know when it might be trying to upload.
The workaround for now is to run from the commandline with super-verbose.
pio test -e esp_devkit -vvv
Which will show when the connecting action happens.
This kind of sucks as a workflow. Also, if you ever clean the vvv mode is so verbose the terminal output is the bottleneck and you’re stuck with a very slow build.
Does any have suggestions on improving this workflow to make running tests easier? I would really like to just be able to hit the test button from the Platformio plugin in VS Code.