Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / test_driver / esp32 / README.md
1 # CHIP Tests on Device
2
3 An appplication that runs CHIP's unit tests on ESP32 device or QEMU.
4
5 ---
6
7 -   [CHIP Tests on Device](#chip-tests-on-device)
8     -   [Supported Devices](#supported-devices)
9     -   [Building the Application](#building-the-application)
10         -   [To build the application, follow these steps:](#to-build-the-application-follow-these-steps)
11             -   [Using QEMU](#using-qemu)
12
13 ---
14
15 ## Supported Devices
16
17 The CHIP application is intended to work on
18 [ESP32-DevKitC](https://www.espressif.com/en/products/hardware/esp32-devkitc/overview),
19 [QEMU](https://github.com/espressif/qemu), and the
20 [M5Stack](http://m5stack.com). Support for the [M5Stack](http://m5stack.com) is
21 still a Work in Progress.
22
23 ## Building the Application
24
25 Building the application requires the use of the Espressif ESP32 IoT Development
26 Framework and the xtensa-esp32-elf toolchain.
27
28 The `chip-build` Docker container and VSCode devcontainer has these components
29 pre-installed, so you can skip this step. To install these components manually,
30 follow these steps:
31
32 -   Clone the Espressif ESP-IDF and checkout release/v4.2 branch
33
34           $ mkdir -p ${HOME}/tools
35           $ cd ${HOME}/tools
36           $ git clone https://github.com/espressif/esp-idf.git
37           $ cd esp-idf
38           $ git checkout release/v4.2
39           $ git submodule update --init
40           $ export IDF_PATH=${HOME}/tools/esp-idf
41           $ ./install.sh
42
43 -   Clone and build ESP32 QEMU
44
45           $ mkdir -p ${HOME}/tools
46           $ cd ${HOME}/tools
47           $ git clone --progress https://github.com/espressif/qemu.git qemu_esp32
48           $ cd qemu_esp32
49           $ ./configure --target-list=xtensa-softmmu --enable-debug --enable-sanitizers --disable-strip --disable-user --disable-capstone    $ --disable-vnc --disable-sdl --disable-gtk
50           $ make -j8
51           $ export QEMU_ESP32=${HOME}/tools/qemu_esp32/xtensa-softmmu/qemu-system-xtensa
52
53 ### To build the application, follow these steps:
54
55 #### Using QEMU
56
57 -   Setup ESP32 QEMU. This will build QEMU and install necessary artifacts to
58     run unit tests.
59
60           $ source idf.sh
61           $ ./qemu_setup.sh
62
63 -   Run specific unit tests
64
65           $ idf make -C build/chip/src/crypto/tests check