Skip to content

Commit ef5fc4a

Browse files
committed
Initial commit with submodule
1 parent 0e3968c commit ef5fc4a

File tree

1,266 files changed

+499715
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,266 files changed

+499715
-0
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "components/esp-nn"]
2+
path = components/esp-nn
3+
url = https://github.com/espressif/esp-nn

CMakeLists.txt

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# For more information about build system see
2+
# https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html
3+
# The following five lines of boilerplate have to be in your project's
4+
# CMakeLists in this exact order for cmake to work correctly
5+
cmake_minimum_required(VERSION 3.16)
6+
7+
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
8+
project(wakeword)
9+
10+
idf_build_set_property(COMPILE_OPTIONS "-fdiagnostics-color=always" APPEND)
11+
idf_build_set_property(COMPILE_OPTIONS "-Wno-unused-variable" APPEND)
12+
idf_build_set_property(COMPILE_OPTIONS "-Wno-maybe-uninitialized" APPEND)
13+
idf_build_set_property(COMPILE_OPTIONS "-Wno-error=format=" APPEND)
14+
idf_build_set_property(COMPILE_OPTIONS "-Wno-unused-but-set-parameter" APPEND)
15+
idf_build_set_property(COMPILE_OPTIONS "-Wno-error=nonnull-compare" APPEND)
16+
idf_build_set_property(COMPILE_OPTIONS "-Wno-error=stringop-truncation" APPEND)
17+
idf_build_set_property(COMPILE_OPTIONS "-Wno-missing-field-initializers" APPEND)

README.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Key Word/Wake Word Detection for ESP32-S3-DevKitC-1
2+
3+
## Project highlights
4+
5+
* ML audio model easily created using [Edge Impulse](https://edgeimpulse.com/)
6+
* Default classification of key words 'yes' and 'no' with ESP32-S3
7+
* Use of latest esp-nn optimized neural network library
8+
* Audio processing using I2S microphone
9+
* Easy exchange of ML models thanks to standardized C++ library
10+
* Ideal template to program your own wake word or key word detection
11+
* Blinks green if 'yes' is detected, red if 'no' is detected
12+
13+
[Edge Impulse](https://edgeimpulse.com/) is an open-source platform for machine learning on edge devices.
14+
It allows developers to create and deploy ML models for their edge devices without
15+
requiring deep knowledge of machine learning or embedded systems.
16+
17+
### The Espressif [esp32-s3](https://www.espressif.com/sites/default/files/documentation/esp32-s3_datasheet_en.pdf) microcontroller is particularly well-suited for AI applications because it
18+
19+
* has a powerful dual-core processor with a 240 MHz clock frequency
20+
* has an integrated Neural Network Accelerator (NNA) that accelerates the processing of AI models
21+
* supports a wide range of interfaces and sensors
22+
23+
## Prerequisites
24+
25+
* ESP-IDF >= v5.0
26+
* [ESP-32-S3-DevKitC-1](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitc-1.html) or similar board
27+
* I2S microphone, e.g. [SKU 107990153](https://www.seeedstudio.com/Sipeed-I2S-Mic-for-MAIX-Dev-Boards-p-2887.html)
28+
29+
### Circuit Diagram
30+
31+
<img src="./docs/circuit_esp32-s3-devkitc-1.svg" width="500" height="400">
32+
33+
### Clone this repo with submodules
34+
35+
git clone --recurse-submodules https://github.com/klumw/keyword_detection.git

components/esp-nn

Submodule esp-nn added at 34e9713

dependencies.lock

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
dependencies:
2+
espressif/led_strip:
3+
component_hash: c240f82567a37357bef313f76b0df93cb2da025835e525006096ea7e0fd61b4f
4+
source:
5+
service_url: https://api.components.espressif.com/
6+
type: service
7+
version: 2.4.3
8+
idf:
9+
component_hash: null
10+
source:
11+
type: idf
12+
version: 5.1.1
13+
manifest_hash: 195a1bb59f9ece70c53e19f8d7747a564f51cc2ade4a1bda869953363a752c0e
14+
target: esp32s3
15+
version: 1.0.0

docs/circuit_esp32-s3-devkitc-1.svg

+13,340
Loading

main/CMakeLists.txt

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
set(CMAKE_CXX_STANDARD 11)
3+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
4+
5+
6+
set(EI_SDK_FOLDER ${CMAKE_CURRENT_LIST_DIR}/edge-impulse-sdk)
7+
8+
include(${EI_SDK_FOLDER}/cmake/utils.cmake)
9+
10+
11+
12+
RECURSIVE_FIND_FILE_APPEND(MODEL_SOURCE "tflite-model" "*.cpp")
13+
14+
RECURSIVE_FIND_FILE_APPEND(EI_SOURCE_FILES "${EI_SDK_FOLDER}/porting/espressif" "*.cpp")
15+
RECURSIVE_FIND_FILE_APPEND(EI_SOURCE_FILES "${EI_SDK_FOLDER}" "*.cpp")
16+
RECURSIVE_FIND_FILE_APPEND(EI_SOURCE_FILES "${EI_SDK_FOLDER}" "*.cc")
17+
RECURSIVE_FIND_FILE_APPEND(EI_SOURCE_FILES "${EI_SDK_FOLDER}" "*.s")
18+
RECURSIVE_FIND_FILE_APPEND(EI_SOURCE_FILES "${EI_SDK_FOLDER}/CMSIS/DSP/Source/TransformFunctions" "*.c")
19+
RECURSIVE_FIND_FILE_APPEND(EI_SOURCE_FILES "${EI_SDK_FOLDER}/CMSIS/DSP/Source/CommonTables" "*.c")
20+
RECURSIVE_FIND_FILE_APPEND(EI_SOURCE_FILES "${EI_SDK_FOLDER}/CMSIS/DSP/Source/BasicMathFunctions" "*.c")
21+
RECURSIVE_FIND_FILE_APPEND(EI_SOURCE_FILES "${EI_SDK_FOLDER}/CMSIS/DSP/Source/ComplexMathFunctions" "*.c")
22+
RECURSIVE_FIND_FILE_APPEND(EI_SOURCE_FILES "${EI_SDK_FOLDER}/CMSIS/DSP/Source/FastMathFunctions" "*.c")
23+
RECURSIVE_FIND_FILE_APPEND(EI_SOURCE_FILES "${EI_SDK_FOLDER}/CMSIS/DSP/Source/SupportFunctions" "*.c")
24+
RECURSIVE_FIND_FILE_APPEND(EI_SOURCE_FILES "${EI_SDK_FOLDER}/CMSIS/DSP/Source/MatrixFunctions" "*.c")
25+
RECURSIVE_FIND_FILE_APPEND(EI_SOURCE_FILES "${EI_SDK_FOLDER}/CMSIS/DSP/Source/StatisticsFunctions" "*.c")
26+
RECURSIVE_FIND_FILE_APPEND(EI_SOURCE_FILES "${EI_SDK_FOLDER}/CMSIS/NN/Source" "*.c")
27+
list(APPEND EI_SOURCE_FILES "${EI_SDK_FOLDER}/tensorflow/lite/c/common.c")
28+
29+
idf_component_register(SRCS "keyword.cpp" ${MODEL_SOURCE} ${EI_SOURCE_FILES} INCLUDE_DIRS ".")

main/Kconfig.projbuild

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
2+
3+
menu "I2S Configuration"
4+
choice I2S_NUM
5+
prompt "I2S number"
6+
default I2S_NUM_0
7+
help
8+
Defines the I2S port for microphone data input.
9+
10+
config I2S_NUM_0
11+
bool "I2S 0"
12+
config I2S_NUM_1
13+
bool "I2S 1"
14+
endchoice
15+
16+
config I2S_DATA_GPIO
17+
int "I2S Data GPIO number"
18+
default 2
19+
help
20+
Set the GPIO number used for transmitting/receiving data from I2S.
21+
22+
config I2S_WS_GPIO
23+
int "I2S Word select GPIO number"
24+
default 42
25+
help
26+
Set the GPIO number used for the word select line from I2S.
27+
28+
config I2S_CLK_GPIO
29+
int "I2S Clock GPIO number"
30+
default 41
31+
help
32+
Set the GPIO number used for the clock line from I2S.
33+
endmenu
34+
35+
36+
37+
menu "LED Configuration"
38+
39+
choice BLINK_LED
40+
prompt "Blink LED type"
41+
default BLINK_LED_GPIO if IDF_TARGET_ESP32
42+
default BLINK_LED_RMT
43+
help
44+
Defines the default peripheral for blink example
45+
46+
config BLINK_LED_GPIO
47+
bool "GPIO"
48+
config BLINK_LED_RMT
49+
bool "RMT - Addressable LED"
50+
endchoice
51+
52+
config BLINK_LED_RMT_CHANNEL
53+
depends on BLINK_LED_RMT
54+
int "RMT Channel"
55+
range 0 7
56+
default 0
57+
help
58+
Set the RMT peripheral channel.
59+
ESP32 RMT channel from 0 to 7
60+
ESP32-S2 RMT channel from 0 to 3
61+
ESP32-S3 RMT channel from 0 to 3
62+
ESP32-C3 RMT channel from 0 to 1
63+
64+
config BLINK_GPIO
65+
int "Blink GPIO number"
66+
range 0 48
67+
default 8 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32H2
68+
default 18 if IDF_TARGET_ESP32S2
69+
default 48 if IDF_TARGET_ESP32S3
70+
default 5
71+
help
72+
GPIO number (IOxx) to blink on and off or the RMT signal for the addressable LED.
73+
Some GPIOs are used for other purposes (flash connections, etc.) and cannot be used to blink.
74+
75+
config BLINK_PERIOD
76+
int "Blink period in ms"
77+
range 10 3600000
78+
default 1000
79+
help
80+
Define the blinking period in milliseconds.
81+
82+
endmenu

main/edge-impulse-sdk/.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
utensor/CTestTestfile.cmake
2+
utensor/cmake_install.cmake
3+
utensor/CMakeFiles/
4+
utensor/Makefile
5+
utensor/CMakeCache.txt
6+
utensor.lib
7+
utensor/libutensor.a
8+
*.o
9+
*.d

main/edge-impulse-sdk/.mbedignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
utensor/CMakeFiles/
2+
tensorflow/lite/micro/mbed/
3+
porting/arduino/
4+
porting/espressif/
5+
porting/himax/
6+
porting/posix/
7+
porting/silabs/
8+
porting/stm32-cubeai/
9+
porting/zephyr/
10+
classifier/ei_run_classifier_c*
11+
third_party/arc_mli_package/
12+
tensorflow-lite/

0 commit comments

Comments
 (0)