blob: 0291d6e9cbb2fb8681be99fefa3a3922f2a3d1c4 [file] [log] [blame]
<!--
Documentation/_templates/layout.html
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership. The
ASF licenses this file to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance with the
License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
-->
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ESP32-AUDIO-KIT &mdash; NuttX latest documentation</title>
<link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../../../../_static/copybutton.css" type="text/css" />
<link rel="stylesheet" href="../../../../../_static/tabs.css" type="text/css" />
<link rel="stylesheet" href="../../../../../_static/custom.css" type="text/css" />
<link rel="shortcut icon" href="../../../../../_static/favicon.ico"/>
<!--[if lt IE 9]>
<script src="../../../../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script src="../../../../../_static/jquery.js"></script>
<script src="../../../../../_static/_sphinx_javascript_frameworks_compat.js"></script>
<script data-url_root="../../../../../" id="documentation_options" src="../../../../../_static/documentation_options.js"></script>
<script src="../../../../../_static/doctools.js"></script>
<script src="../../../../../_static/sphinx_highlight.js"></script>
<script src="../../../../../_static/clipboard.min.js"></script>
<script src="../../../../../_static/copybutton.js"></script>
<script src="../../../../../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../../../../../genindex.html" />
<link rel="search" title="Search" href="../../../../../search.html" />
<link rel="next" title="ESP32 DevKitC" href="../esp32-devkitc/index.html" />
<link rel="prev" title="Espressif ESP32" href="../../index.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../../../../index.html" class="icon icon-home"> NuttX
</a>
<!-- this version selector is quite ugly, should be probably replaced by something
more modern -->
<div class="version-selector">
<select onchange="javascript:location.href = this.value;">
<option value="../../../../../../latest" selected="selected">latest</option>
<option value="../../../../../../10.0.0" >10.0.0</option>
<option value="../../../../../../10.0.1" >10.0.1</option>
<option value="../../../../../../10.1.0" >10.1.0</option>
<option value="../../../../../../10.2.0" >10.2.0</option>
<option value="../../../../../../10.3.0" >10.3.0</option>
<option value="../../../../../../11.0.0" >11.0.0</option>
<option value="../../../../../../12.0.0" >12.0.0</option>
<option value="../../../../../../12.1.0" >12.1.0</option>
<option value="../../../../../../12.2.0" >12.2.0</option>
<option value="../../../../../../12.2.1" >12.2.1</option>
<option value="../../../../../../12.3.0" >12.3.0</option>
<option value="../../../../../../12.4.0" >12.4.0</option>
<option value="../../../../../../12.5.0" >12.5.0</option>
<option value="../../../../../../12.5.1" >12.5.1</option>
</select>
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../../../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Table of Contents</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../../../index.html">Home</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../introduction/index.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../quickstart/index.html">Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../contributing/index.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../introduction/inviolables.html">The Inviolable Principles of NuttX</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../../../index.html">Supported Platforms</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../../../arm/index.html">ARM</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../../avr/index.html">AVR8</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../../risc-v/index.html">RISC-V</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../../sim/index.html">Simulators</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../../../index.html">Xtensa</a><ul class="current">
<li class="toctree-l3 current"><a class="reference internal" href="../../index.html">Espressif ESP32</a><ul class="current">
<li class="toctree-l4"><a class="reference internal" href="../../index.html#toolchain">Toolchain</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../index.html#flashing">Flashing</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../index.html#peripheral-support">Peripheral Support</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../index.html#memory-map">Memory Map</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../index.html#bit-timers">64-bit Timers</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../index.html#watchdog-timers">Watchdog Timers</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../index.html#smp">SMP</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../index.html#wi-fi">Wi-Fi</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../index.html#wi-fi-softap">Wi-Fi SoftAP</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../index.html#bluetooth">Bluetooth</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../index.html#i2s">I2S</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../index.html#using-qemu">Using QEMU</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../index.html#secure-boot-and-flash-encryption">Secure Boot and Flash Encryption</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../index.html#things-to-do">Things to Do</a></li>
<li class="toctree-l4 current"><a class="reference internal" href="../../index.html#supported-boards">Supported Boards</a><ul class="current">
<li class="toctree-l5 current"><a class="current reference internal" href="#">ESP32-AUDIO-KIT</a></li>
<li class="toctree-l5"><a class="reference internal" href="../esp32-devkitc/index.html">ESP32 DevKitC</a></li>
<li class="toctree-l5"><a class="reference internal" href="../esp32-ethernet-kit/index.html">ESP32-Ethernet-Kit V1.2</a></li>
<li class="toctree-l5"><a class="reference internal" href="../esp32-lyrat/index.html">ESP32-LyraT V4.3</a></li>
<li class="toctree-l5"><a class="reference internal" href="../esp32-pico-kit/index.html">ESP32-PICO-KIT V4</a></li>
<li class="toctree-l5"><a class="reference internal" href="../esp32-wrover-kit/index.html">ESP-WROVER-KIT</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../esp32s2/index.html">Espressif ESP32-S2</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../esp32s3/index.html">Espressif ESP32-S3</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../components/index.html">OS Components</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../applications/index.html">Applications</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../reference/index.html">API Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../faq/index.html">FAQ</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../guides/index.html">Guides</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../glossary.html">Glossary</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../../../index.html">NuttX</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../../../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="../../../../index.html">Supported Platforms</a></li>
<li class="breadcrumb-item"><a href="../../../index.html">Xtensa</a></li>
<li class="breadcrumb-item"><a href="../../index.html">Espressif ESP32</a></li>
<li class="breadcrumb-item active">ESP32-AUDIO-KIT</li>
<li class="wy-breadcrumbs-aside">
<a href="../../../../../_sources/platforms/xtensa/esp32/boards/esp32-audio-kit/index.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="esp32-audio-kit">
<h1>ESP32-AUDIO-KIT<a class="headerlink" href="#esp32-audio-kit" title="Permalink to this heading"></a></h1>
<p>The <a class="reference external" href="https://docs.ai-thinker.com/en/esp32-audio-kit">Ai-Thinker ESP32 Audio Kit</a> is a development board for the ESP32 SoC from Espressif, based on Ai-Thinker ESP32-A1S audio module.</p>
<table class="docutils align-center">
<tbody>
<tr class="row-odd"><td><figure class="align-center" id="id1">
<img alt="../../../../../_images/esp32-audio-kit.png" src="../../../../../_images/esp32-audio-kit.png" />
<figcaption>
<p><span class="caption-text">Ai-Thinker ESP32 Audio Kit board</span><a class="headerlink" href="#id1" title="Permalink to this image"></a></p>
</figcaption>
</figure>
</td>
</tr>
</tbody>
</table>
<section id="features">
<h2>Features<a class="headerlink" href="#features" title="Permalink to this heading"></a></h2>
<blockquote>
<div><ul class="simple">
<li><p>ESP32-A1S module</p></li>
<li><p>Audio Earphones Output</p></li>
<li><p>Audio LINEIN Input</p></li>
<li><p>2 Microphones in the board (stereo audio input)</p></li>
<li><p>8 Buttons in the boards (1 RST Button and 7 user buttons)</p></li>
<li><p>MicroSD card slot</p></li>
</ul>
</div></blockquote>
<p>Some of the ESP32 I/O pins are broken out to the board’s pin header.</p>
</section>
<section id="serial-console">
<h2>Serial Console<a class="headerlink" href="#serial-console" title="Permalink to this heading"></a></h2>
<p>UART0 is, by default, the serial console. It connects to the on-board
Silabs CP2102 converter and is available on the USB connector (UART label).</p>
<p>It will show up as /dev/ttyUSB[n] where [n] normally is 0 if you don’t have
another USB/Serial adapter connected in your computer.</p>
</section>
<section id="buttons-and-leds">
<h2>Buttons and LEDs<a class="headerlink" href="#buttons-and-leds" title="Permalink to this heading"></a></h2>
<section id="board-buttons">
<h3>Board Buttons<a class="headerlink" href="#board-buttons" title="Permalink to this heading"></a></h3>
<p>There are eight buttons labeled as RST, BOOT, KEY1..KEY6.
The RST button is not available to software.</p>
<p>The BOOT button is connected to IO0. On reset it is used as a strapping
pin to determine whether the chip boots normally or into the serial
bootloader. After reset, however, the BOOT button can be used for software
input.</p>
</section>
<section id="board-leds">
<h3>Board LEDs<a class="headerlink" href="#board-leds" title="Permalink to this heading"></a></h3>
<p>There are several on-board LEDs for that indicate the presence of power
and USB activity.</p>
</section>
</section>
<section id="i-o-mapping">
<h2>I/O Mapping<a class="headerlink" href="#i-o-mapping" title="Permalink to this heading"></a></h2>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>I/O</p></th>
<th class="head"><p>Signal</p></th>
<th class="head"><p>Notes</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>0</p></td>
<td><p>BOOT Button</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>2</p></td>
<td><p>DATA0 SDCard</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>4</p></td>
<td><p>DATA1 SDCard</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>5</p></td>
<td><p>KEY6 Button</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>12</p></td>
<td><p>DATA2 SDCard</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>13</p></td>
<td><p>KEY2 Button/DATA3 SDCard</p></td>
<td><p>(DIP Switch)</p></td>
</tr>
<tr class="row-even"><td><p>14</p></td>
<td><p>CLK SDCard</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>15</p></td>
<td><p>CMD SDCard/JTAG MTDO</p></td>
<td><p>(DIP Switch)</p></td>
</tr>
<tr class="row-even"><td><p>18</p></td>
<td><p>KEY5 Button</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>19</p></td>
<td><p>KEY3 Button/LED5</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>21</p></td>
<td><p>CTRL Audio AMP</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>22</p></td>
<td><p>LED4</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>23</p></td>
<td><p>KEY4 Button</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>34</p></td>
<td><p>SDCard Detect</p></td>
<td></td>
</tr>
<tr class="row-even"><td><p>36</p></td>
<td><p>KEY1 Button</p></td>
<td></td>
</tr>
</tbody>
</table>
</section>
<section id="configurations">
<h2>Configurations<a class="headerlink" href="#configurations" title="Permalink to this heading"></a></h2>
<p>All of the configurations presented below can be tested by running the following commands:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ ./tools/configure.sh esp32-audio-kit:&lt;config_name&gt;
$ make flash ESPTOOL_PORT=/dev/ttyUSB0 -j
</pre></div>
</div>
<p>Where &lt;config_name&gt; is the name of board configuration you want to use, i.e.: nsh, buttons, wifi…
Then use a serial console terminal like <code class="docutils literal notranslate"><span class="pre">minicom</span></code> or <code class="docutils literal notranslate"><span class="pre">picocom</span></code> configured to 115200 8N1.</p>
<section id="audio">
<h3>audio<a class="headerlink" href="#audio" title="Permalink to this heading"></a></h3>
<p>This configuration uses the I2S0 peripheral and the ES8388 audio codec
present on the ESP32-Audio-Kit board to play an audio file streamed over
HTTP while connected to a Wi-Fi network.</p>
<p><strong>Simple HTTP server</strong></p>
<p>Prepare a PCM-encoded (<cite>.wav</cite>) audio file with 16 bits/sample (sampled at
44.1kHz). This file must be placed into a folder in a computer that could
be accessed on the same Wi-Fi network the ESP32 will be connecting to.</p>
<p>Python provides a simple HTTP server. <cite>cd</cite> to the audio file folder on the
PC and run:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ python3 -m http.server
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/)
</pre></div>
</div>
<p>Look for your PC IP address and test playing the prepared audio on your
browser:</p>
<figure class="align-center">
<img alt="../../../../../_images/esp32-audio-config-file1.png" src="../../../../../_images/esp32-audio-config-file1.png" />
</figure>
<p>After successfully built and flashed, connect the board to the Wi-Fi network:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ nsh&gt; wapi psk wlan0 mypasswd 3
$ nsh&gt; wapi essid wlan0 myssid 1
$ nsh&gt; renew wlan0
</pre></div>
</div>
<p>Once connected, open NuttX’s player and play the file according to its file
name and the IP address of the HTTP server (For example <cite>tone.wav</cite> and
<cite>192.168.1.239:8000</cite>, respectively):</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ nsh&gt; nxplayer
$ nxplayer&gt; play http://192.168.1.239:8000/tone.wav
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The codec implementation on the LyraT board was validated using 16-bit,
44.1kHz WAV files. Other configurations might not work as expected.</p>
</div>
</section>
<section id="nsh">
<h3>nsh<a class="headerlink" href="#nsh" title="Permalink to this heading"></a></h3>
<p>Basic NuttShell configuration (console enabled in UART0, exposed via
USB connection by means of FT2232HL converter, at 115200 bps).</p>
</section>
<section id="wifi">
<h3>wifi<a class="headerlink" href="#wifi" title="Permalink to this heading"></a></h3>
<p>Enables Wi-Fi support. You can define your credentials this way:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ make menuconfig
-&gt; Application Configuration
-&gt; Network Utilities
-&gt; Network initialization (NETUTILS_NETINIT [=y])
-&gt; WAPI Configuration
</pre></div>
</div>
<p>Or if you don’t want to keep it saved in the firmware you can do it
at runtime:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>nsh&gt; wapi psk wlan0 mypasswd 3
nsh&gt; wapi essid wlan0 myssid 1
nsh&gt; renew wlan0
</pre></div>
</div>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>Please refer to <a class="reference internal" href="../../index.html#esp32-wi-fi-sta"><span class="std std-ref">ESP32 Wi-Fi Station Mode</span></a>
for more information.</p>
</div>
</section>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="../../index.html" class="btn btn-neutral float-left" title="Espressif ESP32" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="../esp32-devkitc/index.html" class="btn btn-neutral float-right" title="ESP32 DevKitC" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2020, The Apache Software Foundation.</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>