Skip to content

Commit

Permalink
add Build CircuitPython
Browse files Browse the repository at this point in the history
  • Loading branch information
wemos committed Sep 2, 2022
1 parent e4a761d commit 9c69bf0
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/en/tutorials/index_circuitpython.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ CircuitPython Tutorials
Get started with CircuitPython [S2 series] <s2/get_started_with_circuitpython_s2>
Get started with CircuitPython [C3 series] <c3/get_started_with_circuitpython_c3>
Get started with CircuitPython [S3 series] <s3/get_started_with_circuitpython_s3>
Build CircuitPython <others/build_circuitpython>



Expand Down
115 changes: 115 additions & 0 deletions docs/en/tutorials/others/build_circuitpython.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
Build CircuitPython
===================================

Fetch the Code to Build
-------------------------

.. highlight:: bash

::

git clone https://github.com/adafruit/circuitpython.git
cd circuitpython
make fetch-submodules

Install Required Packages
-----------------------------------

.. highlight:: bash

::

# Install needed Python packages from pypi.org.
pip3 install --upgrade -r requirements-dev.txt
pip3 install --upgrade -r requirements-doc.txt

sudo apt install ninja-build cmake python-is-python3

Install pre-commit
-----------------------------------

.. highlight:: bash

::
cd circuitpython
# You only need to do this once in each clone.
pre-commit install

Build mpy-cross
-----------------------------------

.. highlight:: bash

::
make -C mpy-cross

Set ESP-IDF
-----------------------------------

.. highlight:: bash

::

# Download tools

cd ports/espressif
./esp-idf/install.sh

.. highlight:: bash

::

# Do this in each new terminal.
# Set up the correct PATH and other environment variables.

cd ports/espressif
source esp-idf/export.sh

Build your board
-----------------------------------

.. highlight:: bash

::

make BOARD=lolin_s2_mini

Use All Your CPUs When Building
-----------------------------------

.. highlight:: bash

::

getconf _NPROCESSORS_ONLN
12
# This CPU has 6 cores and 12 threads.

.. highlight:: bash

::

#Use 12 threads

make -j12 BOARD=lolin_s2_mini

Updating Your Repo
-----------------------------------

.. highlight:: bash

::

git pull
# only if necessary, from the top level directory
make fetch-submodules
# Then make again.

Links
-----------------------------------

* `Adafruit Build CircuitPython <https://learn.adafruit.com/building-circuitpython/build-circuitpython>`_
* `Espressif Builds <https://learn.adafruit.com/building-circuitpython/espressif-build>`_

0 comments on commit 9c69bf0

Please sign in to comment.