blob: 73915f8ee3639970034524ec9c7792e6806c5502 [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>Espressif ESP32-C6 &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-C6-DevKitC-1" href="boards/esp32c6-devkit/index.html" />
<link rel="prev" title="ESP32-C3 DevKit" href="../esp32c3/boards/esp32c3-devkit/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="../../arm64/index.html">ARM64</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../avr/index.html">Microchip AVR</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../ceva/index.html">CEVA</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../hc/index.html">HC</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../mips/index.html">MIPS</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../misco/index.html">Misoc</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../or1k/index.html">OpenRISC</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../renesas/index.html">Renesas</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">RISC-V</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../bl602/index.html">Bouffalo Lab BL602</a></li>
<li class="toctree-l3"><a class="reference internal" href="../bl808/index.html">Bouffalo Lab BL808</a></li>
<li class="toctree-l3"><a class="reference internal" href="../c906/index.html">THEAD C906</a></li>
<li class="toctree-l3"><a class="reference internal" href="../esp32c3/index.html">Espressif ESP32-C3</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">Espressif ESP32-C6</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#esp32-c6-toolchain">ESP32-C6 Toolchain</a><ul>
<li class="toctree-l5"><a class="reference internal" href="#installing">Installing</a></li>
</ul>
</li>
<li class="toctree-l4"><a class="reference internal" href="#second-stage-bootloader-and-partition-table">Second stage bootloader and partition table</a></li>
<li class="toctree-l4"><a class="reference internal" href="#building-and-flashing">Building and flashing</a></li>
<li class="toctree-l4"><a class="reference internal" href="#peripheral-support">Peripheral Support</a></li>
<li class="toctree-l4"><a class="reference internal" href="#supported-boards">Supported Boards</a><ul>
<li class="toctree-l5"><a class="reference internal" href="boards/esp32c6-devkit/index.html">ESP32-C6-DevKitC-1</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../fe310/index.html">SiFive FE310</a></li>
<li class="toctree-l3"><a class="reference internal" href="../hpm6750/index.html">Hpmicro HPM6750</a></li>
<li class="toctree-l3"><a class="reference internal" href="../jh7110/index.html">StarFive JH7110</a></li>
<li class="toctree-l3"><a class="reference internal" href="../k210/index.html">Kendryte K210</a></li>
<li class="toctree-l3"><a class="reference internal" href="../k230/index.html">Kendryte K230</a></li>
<li class="toctree-l3"><a class="reference internal" href="../litex/index.html">Enjoy Digital LiteX FPGA’s</a></li>
<li class="toctree-l3"><a class="reference internal" href="../mpfs/index.html">Microchip PolarFire® SoC FPGA’s (MPFS)</a></li>
<li class="toctree-l3"><a class="reference internal" href="../qemu-rv/index.html">QEMU Generic RV32/RV64</a></li>
<li class="toctree-l3"><a class="reference internal" href="../rv32m1/index.html">NXP RV32M1</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../sim/index.html">Simulators</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../sparc/index.html">SPARC</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../x86/index.html">Intel 80x86</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../x86_64/index.html">Intel 80x86_64</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../xtensa/index.html">Xtensa</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../z16/index.html">Z16</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../z80/index.html">Z80</a></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="../../../implementation/index.html">Implementation Details</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">RISC-V</a></li>
<li class="breadcrumb-item active">Espressif ESP32-C6</li>
<li class="wy-breadcrumbs-aside">
<a href="../../../_sources/platforms/risc-v/esp32c6/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="espressif-esp32-c6">
<h1>Espressif ESP32-C6<a class="headerlink" href="#espressif-esp32-c6" title="Permalink to this heading"></a></h1>
<p>The ESP32-C6 is an ultra-low-power and highly integrated SoC with a RISC-V
core and supports 2.4 GHz Wi-Fi 6, Bluetooth 5 (LE) and the 802.15.4 protocol.</p>
<ul class="simple">
<li><p>Address Space
- 800 KB of internal memory address space accessed from the instruction bus
- 560 KB of internal memory address space accessed from the data bus
- 1016 KB of peripheral address space
- 8 MB of external memory virtual address space accessed from the instruction bus
- 8 MB of external memory virtual address space accessed from the data bus
- 480 KB of internal DMA address space</p></li>
<li><p>Internal Memory
- 320 KB ROM
- 512 KB SRAM (16 KB can be configured as Cache)
- 16 KB of SRAM in RTC</p></li>
<li><p>External Memory
- Up to 16 MB of external flash</p></li>
<li><p>Peripherals
- 35 peripherals</p></li>
<li><p>GDMA
- 7 modules are capable of DMA operations.</p></li>
</ul>
<section id="esp32-c6-toolchain">
<h2>ESP32-C6 Toolchain<a class="headerlink" href="#esp32-c6-toolchain" title="Permalink to this heading"></a></h2>
<p>A generic RISC-V toolchain can be used to build ESP32-C6 projects. It’s recommended to use the same
toolchain used by NuttX CI. Please refer to the Docker
<a class="reference external" href="https://github.com/apache/nuttx/tree/master/tools/ci/docker/linux/Dockerfile">container</a> and
check for the current compiler version being used. For instance:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>###############################################################################
# Build image for tool required by RISCV builds
###############################################################################
FROM nuttx-toolchain-base AS nuttx-toolchain-riscv
# Download the latest RISCV GCC toolchain prebuilt by xPack
RUN mkdir riscv-none-elf-gcc &amp;&amp; \
curl -s -L &quot;https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v12.3.0-2/xpack-riscv-none-elf-gcc-12.3.0-2-linux-x64.tar.gz&quot; \
| tar -C riscv-none-elf-gcc --strip-components 1 -xz
</pre></div>
</div>
<p>It uses the xPack’s prebuilt toolchain based on GCC 12.3.0.</p>
<section id="installing">
<h3>Installing<a class="headerlink" href="#installing" title="Permalink to this heading"></a></h3>
<p>First, create a directory to hold the toolchain:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>mkdir<span class="w"> </span>-p<span class="w"> </span>/path/to/your/toolchain/riscv-none-elf-gcc
</pre></div>
</div>
<p>Download and extract toolchain:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>curl<span class="w"> </span>-s<span class="w"> </span>-L<span class="w"> </span><span class="s2">&quot;https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v12.3.0-2/xpack-riscv-none-elf-gcc-12.3.0-2-linux-x64.tar.gz&quot;</span><span class="w"> </span><span class="se">\</span>
<span class="p">|</span><span class="w"> </span>tar<span class="w"> </span>-C<span class="w"> </span>/path/to/your/toolchain/riscv-none-elf-gcc<span class="w"> </span>--strip-components<span class="w"> </span><span class="m">1</span><span class="w"> </span>-xz
</pre></div>
</div>
<p>Add the toolchain to your <cite>PATH</cite>:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span><span class="nb">echo</span><span class="w"> </span><span class="s2">&quot;export PATH=/path/to/your/toolchain/riscv-none-elf-gcc/bin:</span><span class="nv">$PATH</span><span class="s2">&quot;</span><span class="w"> </span>&gt;&gt;<span class="w"> </span>~/.bashrc
</pre></div>
</div>
<p>You can edit your shell’s rc files if you don’t use bash.</p>
</section>
</section>
<section id="second-stage-bootloader-and-partition-table">
<h2>Second stage bootloader and partition table<a class="headerlink" href="#second-stage-bootloader-and-partition-table" title="Permalink to this heading"></a></h2>
<p>The NuttX port for now relies on IDF’s second stage bootloader to carry on some hardware
initializations. The binaries for the bootloader and the partition table can be found in
this repository: <a class="reference external" href="https://github.com/espressif/esp-nuttx-bootloader">https://github.com/espressif/esp-nuttx-bootloader</a>
That repository contains a dummy IDF project that’s used to build the bootloader and
partition table, these are then presented as Github assets and can be downloaded
from: <a class="reference external" href="https://github.com/espressif/esp-nuttx-bootloader/releases">https://github.com/espressif/esp-nuttx-bootloader/releases</a>
Download <code class="docutils literal notranslate"><span class="pre">bootloader-esp32c6.bin</span></code> and <code class="docutils literal notranslate"><span class="pre">partition-table-esp32c6.bin</span></code> and place them
in a folder, the path to this folder will be used later to program them. This
can be: <code class="docutils literal notranslate"><span class="pre">../esp-bins</span></code></p>
</section>
<section id="building-and-flashing">
<h2>Building and flashing<a class="headerlink" href="#building-and-flashing" title="Permalink to this heading"></a></h2>
<p>First make sure that <code class="docutils literal notranslate"><span class="pre">esptool.py</span></code> is installed. This tool is used to convert
the ELF to a compatible ESP32-C6 image and to flash the image into the board.
It can be installed with: <code class="docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">esptool</span></code>.</p>
<p>Configure the NuttX project: <code class="docutils literal notranslate"><span class="pre">./tools/configure.sh</span> <span class="pre">esp32c6-devkit:nsh</span></code>
Run <code class="docutils literal notranslate"><span class="pre">make</span></code> to build the project. Note that the conversion mentioned above is
included in the build process.
The <code class="docutils literal notranslate"><span class="pre">esptool.py</span></code> command to flash all the binaries is:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>esptool.py --chip esp32c6 --port /dev/ttyUSBXX --baud 921600 write_flash 0x0 bootloader.bin 0x8000 partition-table.bin 0x10000 nuttx.bin
</pre></div>
</div>
<p>However, this is also included in the build process and we can build and flash with:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>make flash ESPTOOL_PORT=&lt;port&gt; ESPTOOL_BINDIR=../esp-bins
</pre></div>
</div>
<p>Where <code class="docutils literal notranslate"><span class="pre">&lt;port&gt;</span></code> is typically <code class="docutils literal notranslate"><span class="pre">/dev/ttyUSB0</span></code> or similar and <code class="docutils literal notranslate"><span class="pre">../esp-bins</span></code> is
the path to the folder containing the bootloader and the partition table
for the ESP32-C6 as explained above.
Note that this step is required only one time. Once the bootloader and partition
table are flashed, we don’t need to flash them again. So subsequent builds
would just require: <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">flash</span> <span class="pre">ESPTOOL_PORT=/dev/ttyUSBXX</span></code></p>
</section>
<section id="peripheral-support">
<h2>Peripheral Support<a class="headerlink" href="#peripheral-support" title="Permalink to this heading"></a></h2>
<p>The following list indicates the state of peripherals’ support in NuttX:</p>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>Peripheral</p></th>
<th class="head"><p>Support</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>ADC</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-odd"><td><p>AES</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-even"><td><p>Bluetooth</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-odd"><td><p>CAN/TWAI</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-even"><td><p>DMA</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-odd"><td><p>ECC</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-even"><td><p>eFuse</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-odd"><td><p>GPIO</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-even"><td><p>HMAC</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-odd"><td><p>I2C</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-even"><td><p>I2S</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-odd"><td><p>Int. Temp.</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-even"><td><p>LED</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-odd"><td><p>LED_PWM</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-even"><td><p>MCPWM</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-odd"><td><p>Pulse Counter</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-even"><td><p>RMT</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-odd"><td><p>RNG</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-even"><td><p>RSA</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-odd"><td><p>RTC</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-even"><td><p>SD/MMC</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-odd"><td><p>SDIO</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-even"><td><p>SHA</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-odd"><td><p>SPI</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-even"><td><p>SPIFLASH</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-odd"><td><p>Timers</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-even"><td><p>UART</p></td>
<td><p>Yes</p></td>
</tr>
<tr class="row-odd"><td><p>Watchdog</p></td>
<td><p>Yes</p></td>
</tr>
<tr class="row-even"><td><p>Wifi</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-odd"><td><p>XTS</p></td>
<td><p>No</p></td>
</tr>
</tbody>
</table>
</section>
<section id="supported-boards">
<h2>Supported Boards<a class="headerlink" href="#supported-boards" title="Permalink to this heading"></a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="boards/esp32c6-devkit/index.html">ESP32-C6-DevKitC-1</a></li>
</ul>
</div>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="../esp32c3/boards/esp32c3-devkit/index.html" class="btn btn-neutral float-left" title="ESP32-C3 DevKit" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="boards/esp32c6-devkit/index.html" class="btn btn-neutral float-right" title="ESP32-C6-DevKitC-1" 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 2023, The Apache Software Foundation.</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>