Skip to content

Commit a6861ad

Browse files
committed
Merge branch 'main' of origin into ESP32-S3-DevKitC-1-N32R8
2 parents e5cfab0 + 5fb0333 commit a6861ad

File tree

452 files changed

+12616
-7420
lines changed

Some content is hidden

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

452 files changed

+12616
-7420
lines changed

.devcontainer/Readme.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Build CircuitPython in a Github-Devcontainer
2+
============================================
3+
4+
To build CircuitPython within a Github-Devcontainer, you need to perform
5+
the following steps.
6+
7+
1. checkout the code to a devcontainer
8+
9+
- click on the green "<> Code"-button
10+
- select the Codespaces-tab
11+
- choose "+ new with options..." from the "..."-menu
12+
- in the following screen select the branch and then
13+
- select ".devcontainer/cortex-m/devcontainer.json" instead
14+
of "Default Codespaces configuration"
15+
- update region as necessary
16+
- finally, click on the green "Create codespace" button
17+
18+
2. Your codespace is created. Cloning the images is quite fast, but
19+
preparing it for CircuitPython-development takes about 10 minutes.
20+
Note that this is a one-time task.
21+
22+
3. During creation, you can run the command
23+
`tail -f /workspaces/.codespaces/.persistedshare/creation.log`
24+
to see what is going on.
25+
26+
4. To actually build CircuitPython, run
27+
28+
cd ports/raspberrypi
29+
make -j $(nproc) BOARD=whatever TRANSLATION=xx_XX
30+
31+
This takes about 2m40s.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/universal
3+
{
4+
"name": "CircuitPython Cortex-M Build-Environment (base: Default Linux Universal)",
5+
"image": "mcr.microsoft.com/devcontainers/universal:2-linux",
6+
"postCreateCommand": ".devcontainer/cortex-m/on-create.sh",
7+
"remoteEnv": { "PATH": "/workspaces/gcc-arm-none-eabi/bin:${containerEnv:PATH}" }
8+
9+
// Features to add to the dev container. More info: https://containers.dev/features.
10+
// "features": {},
11+
12+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
13+
// "forwardPorts": [],
14+
15+
// Use 'postCreateCommand' to run commands after the container is created.
16+
// "postCreateCommand": "uname -a",
17+
18+
// Configure tool-specific properties.
19+
// "customizations": {},
20+
21+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
22+
// "remoteUser": "root"
23+
}

.devcontainer/cortex-m/on-create.sh

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/bin/bash
2+
# -----------------------------------------------------------------------------
3+
# on-create.sh: postCreateCommand-hook for devcontainer.json (Cortex-M build)
4+
#
5+
# Author: Bernhard Bablok
6+
#
7+
# -----------------------------------------------------------------------------
8+
9+
echo -e "[on-create.sh] downloading and installing gcc-arm-non-eabi toolchain"
10+
cd /workspaces
11+
wget -qO gcc-arm-none-eabi.tar.bz2 https://adafru.it/Pid
12+
tar -xjf gcc-arm-none-eabi.tar.bz2
13+
ln -s gcc-arm-none-eabi-10-2020-q4-major gcc-arm-none-eabi
14+
rm -f /workspaces/gcc-arm-none-eabi.tar.bz2
15+
export PATH=/workspaces/gcc-arm-none-eabi/bin:$PATH
16+
17+
# add repository and install tools
18+
echo -e "[on-create.sh] adding pybricks/ppa"
19+
sudo add-apt-repository -y ppa:pybricks/ppa
20+
echo -e "[on-create.sh] installing uncrustify and mtools"
21+
sudo apt-get -y install uncrustify mtools
22+
23+
# dosfstools >= 4.2 needed, standard repo only has 4.1
24+
echo -e "[on-create.sh] downloading and installing dosfstools"
25+
wget https://github.com/dosfstools/dosfstools/releases/download/v4.2/dosfstools-4.2.tar.gz
26+
tar -xzf dosfstools-4.2.tar.gz
27+
cd dosfstools-4.2/
28+
./configure
29+
make -j $(nproc)
30+
sudo make install
31+
cd /workspaces
32+
rm -fr /workspaces/dosfstools-4.2 /workspaces/dosfstools-4.2.tar.gz
33+
34+
# prepare source-code tree
35+
cd /workspaces/circuitpython/
36+
echo -e "[on-create.sh] fetching submodules"
37+
make fetch-submodules
38+
echo -e "[on-create.sh] fetching tags"
39+
git fetch --tags --recurse-submodules=no --shallow-since="2021-07-01" https://github.com/adafruit/circuitpython HEAD
40+
41+
# additional python requirements
42+
echo -e "[on-create.sh] pip-installing requirements"
43+
pip install --upgrade -r requirements-dev.txt
44+
pip install --upgrade -r requirements-doc.txt
45+
46+
# add pre-commit
47+
echo -e "[on-create.sh] installing pre-commit"
48+
pre-commit install
49+
50+
# create cross-compiler
51+
echo -e "[on-create.sh] building mpy-cross"
52+
make -j $(nproc) -C mpy-cross # time: about 36 sec
53+
54+
# that's it!
55+
echo -e "[on-create.sh] setup complete"
56+
57+
#commands to actually build CP:
58+
#cd ports/raspberrypi
59+
#time make -j $(nproc) BOARD=pimoroni_tufty2040 TRANSLATION=de_DE

0 commit comments

Comments
 (0)