Chapter 4. API Guides
(continued from previous page)
contains test fixtures (structs/functions to do test case set-up␣
,→and tear-down).
If there are no fixtures, this can be ommitted.
- <test_name>/
IDF applications which run the tests
- <test_name2>/
Further tests are possible.
The IDF applications inside host_test set the mocking configuration as described in the IDF unit test documen-
tation.
The NVS page unit test provides some illustration of how to control the mocks.
Requirements
• Installed IDF including all IDF requirements
• CMock requirements (Ruby)
• libbsd
The host tests have been tested on Ubuntu 20.04 with GCC version 9 and 10.
4.32 USB OTG Console
On chips with an integrated USB peripheral, it is possible to use USB Communication Device Class (CDC) to im-
plement the serial console, instead of using UART with an external USB-UART bridge chip. ESP32-S2 ROM code
contains a USB CDC implementation, which supports for some basic functionality without requiring the application
to include the USB stack:
• Bidirectional serial console, which can be used with IDF Monitor or another serial monitor
• Flashing using esptool.py and idf.py flash.
• Device Firmware Update (DFU) interface for flashing the device using dfu-util and idf.py dfu.
Note: At the moment, this “USB Console”feature is incompatible with TinyUSB stack. However, if TinyUSB is
used, it can provide its own CDC implementation.
4.32.1 Hardware Requirements
Connect ESP32-S2 to the USB port as follows
GPIO USB
20 D+ (green)
19 D- (white)
GND GND (black)
+5V (red)
Some development boards may offer a USB connector for the internal USB peripheral —in that case, no extra con-
nections are required.
4.32.2 Software Configuration
USB console feature can be enabled using CONFIG_ESP_CONSOLE_USB_CDC option in menuconfig tool (see
CONFIG_ESP_CONSOLE_UART).
Espressif Systems 1511
Submit Document Feedback
Release v4.4