Skip to content

Commit e22bb79

Browse files
committed
Merge branch 'main' of https://github.com/nanoframework/nf-interpreter into develop
2 parents 8d4a305 + 719ce37 commit e22bb79

File tree

1,968 files changed

+228809
-108255
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,968 files changed

+228809
-108255
lines changed

.devcontainer/All/Dockerfile.All

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM ghcr.io/nanoframework/dev-container-all:v2.56
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
FROM ubuntu:latest AS downloader
2+
RUN apt-get update \
3+
&& apt-get -y install --no-install-recommends apt-utils \
4+
&& apt-get install -y \
5+
curl \
6+
xz-utils \
7+
unzip \
8+
wget
9+
10+
RUN mkdir -p /tmp/dc-downloads /tmp/dc-extracted
11+
12+
ARG GCC_VERSION=13.3.rel1
13+
ARG GCC_URI=https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/$GCC_VERSION/binrel/arm-gnu-toolchain-$GCC_VERSION-x86_64-arm-none-eabi.tar.xz
14+
RUN mkdir -p /tmp/dc-downloads /tmp/dc-extracted/gcc \
15+
&& curl -o /tmp/dc-downloads/gcc-arm.tar.xz $GCC_URI \
16+
&& xz -d /tmp/dc-downloads/gcc-arm.tar.xz \
17+
&& tar -xvf /tmp/dc-downloads/gcc-arm.tar -C /tmp/dc-extracted/gcc --strip-components 1 \
18+
&& rm -rf /tmp/dc-extracted/gcc/share/doc/ /tmp/dc-extracted/gcc/share/gcc-arm-none-eabi/samples/
19+
20+
ARG CMAKE_VERSION=3.31.6
21+
ARG CMAKE_SCRIPT=https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-linux-x86_64.sh
22+
RUN wget $CMAKE_SCRIPT \
23+
-q -O /tmp/dc-downloads/cmake-install.sh \
24+
&& chmod u+x /tmp/dc-downloads/cmake-install.sh \
25+
&& mkdir -p /tmp/dc-extracted/cmake \
26+
&& /tmp/dc-downloads/cmake-install.sh --skip-license --prefix=/tmp/dc-extracted/cmake \
27+
&& rm /tmp/dc-downloads/cmake-install.sh
28+
29+
# This is TI XDC tools for linux. Check all versions here: https://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/rtsc/index.html
30+
ARG TI_TOOL_URL=https://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/rtsc/3_62_00_08/exports/xdccore/xdctools_3_62_00_08_core_linux.zip
31+
RUN mkdir -p /tmp/dc-extracted/titools \
32+
&& curl -o /tmp/dc-downloads/titools.zip $TI_TOOL_URL -L \
33+
&& unzip -d /tmp/dc-extracted/titools /tmp/dc-downloads/titools.zip
34+
35+
FROM python:3.11 AS devcontainer
36+
37+
# Avoid warnings by switching to noninteractive
38+
ENV DEBIAN_FRONTEND=noninteractive
39+
40+
# You can set up non-root user
41+
# ARG USERNAME=vscode
42+
# ARG USER_UID=1000
43+
# ARG USER_GID=$USER_UID
44+
45+
# Configure apt and install packages
46+
RUN apt-get update \
47+
&& apt-get -y install --no-install-recommends apt-utils dialog icu-devtools 2>&1 \
48+
&& apt-get install -y \
49+
git \
50+
git-lfs \
51+
git-svn \
52+
subversion \
53+
clang-format \
54+
curl \
55+
ninja-build \
56+
srecord \
57+
nodejs \
58+
libffi-dev
59+
60+
# Create needed directories
61+
RUN mkdir -p /usr/local/bin/gcc \
62+
&& mkdir -p /usr/local/bin/titools
63+
64+
# Clone ChibiOS repo
65+
# RUN git svn clone http://svn.code.sf.net/p/chibios/code/branches/stable_21.11.x -rHEAD ./sources/ChibiOs
66+
# Alternative source for those having issues with git svn downloads:
67+
RUN git clone --branch stable_21.11.x https://github.com/ArduPilot/ChibiOS.svn.git --depth 1 ./sources/ChibiOs
68+
69+
# Clone support repos for STM32 including Eclipse ThreadX (a.k.a. Azure RTOS)
70+
RUN git clone --branch nf-build https://github.com/nanoframework/STM32CubeL4.git --depth 1 ./sources/STM32CubeL4 \
71+
&& git clone --branch nf-build https://github.com/nanoframework/STM32CubeF7.git --depth 1 ./sources/STM32CubeF7 \
72+
&& git clone --branch nf-build https://github.com/nanoframework/STM32CubeF4.git --depth 1 ./sources/STM32CubeF4 \
73+
&& git clone --branch nf-build https://github.com/nanoframework/STM32CubeH7.git --depth 1 ./sources/STM32CubeH7 \
74+
&& git clone --branch chibios-21.11.x https://github.com/ChibiOS/ChibiOS-Contrib.git --depth 1 ./sources/ChibiOs-Contrib
75+
76+
# Clone repos for Eclipse ThreadX (a.k.a. Azure RTOS)
77+
RUN git clone --branch v6.4.0_rel --recursive https://github.com/eclipse-threadx/threadx.git --depth 1 ./sources/AzureRTOS \
78+
&& git clone --branch v6.3.0_rel --recursive https://github.com/eclipse-threadx/netxduo.git --depth 1 ./sources/NetxDuo
79+
80+
# Clone dependent repos (mbedtls, fatfs and littlefs)
81+
RUN git clone --branch R0.15 https://github.com/abbrev/fatfs.git --depth 1 ./sources/fatfs \
82+
&& git clone --branch v2.9.3 https://github.com/littlefs-project/littlefs --depth 1 ./sources/littlefs \
83+
&& git clone --branch mbedtls-3.6.0 https://github.com/ARMmbed/mbedtls.git --depth 1 ./sources/mbedtls \
84+
&& cd ./sources/mbedtls \
85+
&& git submodule update --init --recursive
86+
87+
# Clone FreeRTOS and what is needed for ESP32
88+
RUN git clone --branch V10.4.1-kernel-only https://github.com/FreeRTOS/FreeRTOS-Kernel.git --depth 1 ./sources/FreeRTOS \
89+
&& git clone --branch 5.5.1 https://github.com/ARM-software/CMSIS_5.git --depth 1 ./sources/CMSIS_5
90+
91+
# Clone lwIP for STM32 and NXP
92+
RUN git clone --branch STABLE-2_1_3_RELEASE https://github.com/lwip-tcpip/lwip.git --depth 1 ./sources/lwip
93+
94+
# Clone ESP-IDF
95+
RUN git clone --branch v5.2.3 https://github.com/espressif/esp-idf --depth 1 --recursive ./sources/esp-idf
96+
97+
# Clone what is needed for TI
98+
RUN git clone --branch 4.10.00.07 https://github.com/nanoframework/SimpleLink_CC32xx_SDK.git --depth 1 ./sources/SimpleLinkCC32 \
99+
# you can't use the nanoFramework repository as it's Windows only
100+
# && git clone --branch 3.61.00.16 https://github.com/nanoframework/TI_XDCTools.git --depth 1 ./sources/TI_XDCTools \
101+
&& git clone --branch 5.40.00.40 https://github.com/nanoframework/SimpleLink_CC13xx_26xx_SDK.git --depth 1 ./sources/SimpleLinkCC13 \
102+
&& git clone --branch 1.10.0 https://github.com/nanoframework/TI_SysConfig.git --depth 1 ./sources/TI_SysConfig \
103+
&& chmod +x ./sources/TI_SysConfig/sysconfig_cli.sh
104+
105+
# set gcc location
106+
ARG TMP_GCC_PATH=/usr/local/bin/gcc
107+
ENV ARM_GCC_PATH=$TMP_GCC_PATH/bin
108+
109+
# Copy from our other container
110+
COPY --from=downloader /tmp/dc-extracted/gcc $TMP_GCC_PATH
111+
COPY --from=downloader /tmp/dc-extracted/titools/xdctools_3_62_00_08_core /usr/local/bin/titools
112+
COPY --from=downloader /tmp/dc-extracted/cmake /usr/bin/cmake
113+
114+
ENV PATH=/usr/bin/cmake/bin:${PATH}
115+
116+
# Putting hex2dfu in the container
117+
ENV HEX2DFU_PATH=/usr/local/bin/hex2dfu
118+
119+
ARG HEX2DFU=https://github.com/nanoframework/hex2dfu/releases/latest/download/hex2dfu
120+
RUN mkdir -p $HEX2DFU_PATH \
121+
&& curl -o $HEX2DFU_PATH/hex2dfu $HEX2DFU -L \
122+
&& chmod +x $HEX2DFU_PATH/hex2dfu
123+
124+
# Creating static link python for pyhton3
125+
RUN ln -fs /usr/bin/python3 /usr/bin/python \
126+
&& pip3 install pyserial
127+
128+
# Install ESP-IDF
129+
ENV IDF_PATH=/sources/esp-idf
130+
ENV ESP_PATCH_VER=esp-13.2.0_20230928
131+
# This is now taking care in the following line
132+
# RUN python -m pip install -r $IDF_PATH/requirements.txt
133+
RUN $IDF_PATH/install.sh
134+
135+
ENV PATH=/root/.espressif/python_env/idf5.2_py3.11_env/bin:$PATH:\
136+
$IDF_PATH/components/esptool_py/esptool:\
137+
$IDF_PATH/components/espcoredump:\
138+
$IDF_PATH/components/partition_table/:\
139+
$IDF_PATH/tools/:\
140+
$IDF_PATH/components/app_update:\
141+
/root/.espressif/tools/xtensa-esp-elf/$ESP_PATCH_VER/xtensa-esp-elf/bin:\
142+
/root/.espressif/tools/riscv32-esp-elf/$ESP_PATCH_VER/riscv32-esp-elf/bin
143+
144+
# Clean up downloaded files
145+
RUN apt-get autoremove -y \
146+
&& apt-get clean -y \
147+
&& rm -rf /var/lib/apt/lists/*
148+
149+
# Switch back to dialog for any ad-hoc use of apt-get
150+
ENV DEBIAN_FRONTEND=dialog
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"name": "nanoFramework-All",
3+
// If you prefer, you can use the source files and adjust them where they are located,
4+
// To do this, change the "dockerFile" to use 'Dockerfile.All.SRC'.
5+
// This will allow you to customize and build the container source and add anything you may need on top.
6+
"dockerFile": "Dockerfile.All",
7+
"context": ".",
8+
"mounts": [
9+
// Bind the Unix socket the Docker daemon listens on by default
10+
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind",
11+
// Keep command history
12+
"source=nano-bashhistory,target=/home/vscode/commandhistory,type=volume",
13+
// OPTIONAL: Mount .azure folder for seamless az cli auth
14+
// "source=${env:HOME}${env:USERPROFILE}/.azure,target=/home/vscode/.azure,type=bind"
15+
],
16+
// Set the *default* container specific settings.json values on container create.
17+
"customizations": {
18+
"vscode": {
19+
"settings": {
20+
"cmake.preferredGenerators": [
21+
"Ninja"
22+
],
23+
"cmake.generator": "Ninja",
24+
"cmake.autoRestartBuild" : true,
25+
"cmake.configureSettings": {
26+
"CMAKE_MAKE_PROGRAM":"/usr/bin/ninja"
27+
},
28+
"cmake.configureOnOpen": false
29+
},
30+
// Add the IDs of extensions you want installed when the container is created.
31+
"extensions": [
32+
"ms-vsliveshare.vsliveshare-pack",
33+
"streetsidesoftware.code-spell-checker",
34+
"twxs.cmake",
35+
"ms-vscode.cmake-tools",
36+
"xaver.clang-format"
37+
]
38+
}
39+
},
40+
// You can pull all the repos with the latest changes, this is only valid if you are using the ./sources/Dockerfile.All containers
41+
// "postAttachCommand": "/usr/local/git-pull-repos.sh"
42+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
43+
// "forwardPorts": [],
44+
// This is needed to allow cloning repositories like the STM32 hal driver ones
45+
"postCreateCommand": "git config --global safe.directory '*'"
46+
// Uncomment to connect as a non-root user. See https: //aka.ms/vscode-remote/containers/non-root.
47+
// ,"remoteUser": "vscode"
48+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
echo "Pulling all the repos"
2+
cd /sources/STM32CubeL4
3+
git pull origin nf-build
4+
cd /sources/STM32CubeF7
5+
git pull origin nf-build
6+
cd /sources/STM32CubeF4
7+
git pull origin nf-build
8+
cd /sources/STM32CubeH7
9+
git pull origin nf-build
10+
cd /sources/AzureRTOS
11+
git pull
12+
cd /
13+
rm -rf /sources/ChibiOs
14+
git svn clone http://svn.code.sf.net/p/chibios/code/branches/stable_21.11.x -rHEAD /sources/ChibiOs
15+
cd /sources/ChibiOs-Contrib
16+
git pull origin chibios-21.11.x
17+
cd /sources/mbedtls
18+
git pull origin mbedtls-3.6.0
19+
git submodule update --init
20+
cd /sources/fatfs
21+
git pull origin R0.15
22+
cd /sources/FreeRTOS
23+
git pull origin V10.4.1-kernel-only
24+
cd /sources/CMSIS_5
25+
git pull origin 5.5.1
26+
cd /sources/lwip
27+
git pull origin STABLE-2_1_3_RELEASE
28+
cd /sources/littlefs
29+
git pull origin v2.9.3
30+
cd /sources/SimpleLinkCC32
31+
git pull origin 4.10.00.07
32+
cd /sources/SimpleLinkCC13
33+
git pull origin 4.20.01.04
34+
cd /sources/TI_SysConfig
35+
git pull origin 1.5.0
36+
echo "All repos pulled and up to date"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM ghcr.io/nanoframework/dev-container-azure-rtos:v1.33
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
FROM ubuntu:latest AS downloader
2+
RUN apt-get update \
3+
&& apt-get -y install --no-install-recommends apt-utils \
4+
&& apt-get install -y \
5+
curl \
6+
xz-utils \
7+
unzip \
8+
wget
9+
10+
RUN mkdir -p /tmp/dc-downloads /tmp/dc-extracted
11+
12+
ARG GCC_VERSION=13.3.rel1
13+
ARG GCC_URI=https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/$GCC_VERSION/binrel/arm-gnu-toolchain-$GCC_VERSION-x86_64-arm-none-eabi.tar.xz
14+
RUN mkdir -p /tmp/dc-downloads /tmp/dc-extracted/gcc \
15+
&& curl -o /tmp/dc-downloads/gcc-arm.tar.xz $GCC_URI \
16+
&& xz -d /tmp/dc-downloads/gcc-arm.tar.xz \
17+
&& tar -xvf /tmp/dc-downloads/gcc-arm.tar -C /tmp/dc-extracted/gcc --strip-components 1 \
18+
&& rm -rf /tmp/dc-extracted/gcc/share/doc/ /tmp/dc-extracted/gcc/share/gcc-arm-none-eabi/samples/
19+
20+
ARG CMAKE_VERSION=3.31.6
21+
ARG CMAKE_SCRIPT=https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-linux-x86_64.sh
22+
RUN wget $CMAKE_SCRIPT \
23+
-q -O /tmp/dc-downloads/cmake-install.sh \
24+
&& chmod u+x /tmp/dc-downloads/cmake-install.sh \
25+
&& mkdir -p /tmp/dc-extracted/cmake \
26+
&& /tmp/dc-downloads/cmake-install.sh --skip-license --prefix=/tmp/dc-extracted/cmake \
27+
&& rm /tmp/dc-downloads/cmake-install.sh
28+
29+
FROM ubuntu:latest AS devcontainer
30+
31+
# Avoid warnings by switching to noninteractive
32+
ENV DEBIAN_FRONTEND=noninteractive
33+
34+
# You can set up non-root user
35+
# ARG USERNAME=vscode
36+
# ARG USER_UID=1000
37+
# ARG USER_GID=$USER_UID
38+
39+
# Configure apt and install packages
40+
RUN apt-get update \
41+
&& apt-get -y install --no-install-recommends apt-utils dialog icu-devtools 2>&1 \
42+
&& apt-get install -y \
43+
git \
44+
git-svn \
45+
subversion \
46+
clang-format \
47+
curl \
48+
ninja-build \
49+
srecord
50+
51+
# Create needed directories
52+
RUN mkdir -p /usr/local/bin/gcc
53+
54+
# Clone ChibiOS repo (used for HAL)
55+
# RUN git svn clone http://svn.code.sf.net/p/chibios/code/branches/stable_21.11.x -rHEAD ./sources/ChibiOs
56+
# Alternative source for those having issues with git svn downloads:
57+
RUN git clone --branch stable_21.11.x https://github.com/ArduPilot/ChibiOS.svn.git --depth 1 ./sources/ChibiOs
58+
59+
# Clone repos for STM32
60+
RUN git clone --branch nf-build https://github.com/nanoframework/STM32CubeL4.git --depth 1 ./sources/STM32CubeL4 \
61+
&& git clone --branch nf-build https://github.com/nanoframework/STM32CubeF7.git --depth 1 ./sources/STM32CubeF7 \
62+
&& git clone --branch nf-build https://github.com/nanoframework/STM32CubeF4.git --depth 1 ./sources/STM32CubeF4 \
63+
&& git clone --branch nf-build https://github.com/nanoframework/STM32CubeH7.git --depth 1 ./sources/STM32CubeH7
64+
65+
# Clone repos for Eclipse ThreadX (a.k.a. Azure RTOS)
66+
RUN git clone --branch v6.4.0_rel --recursive https://github.com/eclipse-threadx/threadx.git --depth 1 ./sources/AzureRTOS \
67+
&& git clone --branch v6.4.0_rel --recursive https://github.com/eclipse-threadx/netxduo.git --depth 1 ./sources/NetxDuo
68+
69+
# Clone dependent repos (mbedtls, fatfs and littlefs)
70+
RUN git clone --branch R0.15 https://github.com/abbrev/fatfs.git --depth 1 ./sources/fatfs \
71+
&& git clone --branch v2.9.3 https://github.com/littlefs-project/littlefs --depth 1 ./sources/littlefs \
72+
&& git clone --branch mbedtls-3.6.0 https://github.com/ARMmbed/mbedtls.git --depth 1 ./sources/mbedtls \
73+
&& cd ./sources/mbedtls \
74+
&& git submodule update --init --recursive
75+
76+
# set gcc location
77+
ARG TMP_GCC_PATH=/usr/local/bin/gcc
78+
ENV ARM_GCC_PATH=$TMP_GCC_PATH/bin
79+
80+
# Copy from our other container
81+
COPY --from=downloader /tmp/dc-extracted/gcc $TMP_GCC_PATH
82+
COPY --from=downloader /tmp/dc-extracted/cmake /usr/bin/cmake
83+
84+
ENV PATH=/usr/bin/cmake/bin:${PATH}
85+
86+
# Putting hex2dfu in the container
87+
ENV HEX2DFU_PATH=/usr/local/bin/hex2dfu
88+
89+
ARG HEX2DFU=https://github.com/nanoframework/hex2dfu/releases/latest/download/hex2dfu
90+
RUN mkdir -p $HEX2DFU_PATH \
91+
&& curl -o $HEX2DFU_PATH/hex2dfu $HEX2DFU -L \
92+
&& chmod +x $HEX2DFU_PATH/hex2dfu
93+
94+
# Clean up downloaded files
95+
RUN apt-get autoremove -y \
96+
&& apt-get clean -y \
97+
&& rm -rf /var/lib/apt/lists/*
98+
99+
# Switch back to dialog for any ad-hoc use of apt-get
100+
ENV DEBIAN_FRONTEND=dialog
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"name": "nanoFramework-AzureRTOS",
3+
// If you prefer, you can use the source files and adjust them where they are located,
4+
// To do this, change the "dockerFile" to use 'Dockerfile.AzureRTOS.SRC'.
5+
// This will allow you to customize and build the container source and add anything you may need on top.
6+
"dockerFile": "Dockerfile.AzureRTOS",
7+
"context": ".",
8+
"mounts": [
9+
// Bind the Unix socket the Docker daemon listens on by default
10+
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind",
11+
// Keep command history
12+
"source=nano-bashhistory,target=/home/vscode/commandhistory,type=volume",
13+
// OPTIONAL: Mount .azure folder for seamless az cli auth
14+
// "source=${env:HOME}${env:USERPROFILE}/.azure,target=/home/vscode/.azure,type=bind"
15+
],
16+
// Set the *default* container specific settings.json values on container create.
17+
"customizations": {
18+
"vscode": {
19+
"settings": {
20+
"cmake.preferredGenerators": [
21+
"Ninja"
22+
],
23+
"cmake.generator": "Ninja",
24+
"cmake.autoRestartBuild" : true,
25+
"cmake.configureSettings": {
26+
"CMAKE_MAKE_PROGRAM":"/usr/bin/ninja"
27+
},
28+
"cmake.configureOnOpen": false
29+
},
30+
// Add the IDs of extensions you want installed when the container is created.
31+
"extensions": [
32+
"ms-vsliveshare.vsliveshare-pack",
33+
"streetsidesoftware.code-spell-checker",
34+
"twxs.cmake",
35+
"ms-vscode.cmake-tools",
36+
"xaver.clang-format"
37+
]
38+
}
39+
},
40+
// You can pull all the repos with the latest changes, this is only valid if you are using the ./sources/Dockerfile.All containers
41+
// "postAttachCommand": "/usr/local/git-pull-repos.sh"
42+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
43+
// "forwardPorts": [],
44+
// This is needed to allow cloning repositories like the STM32 hal driver ones
45+
"postCreateCommand": "git config --global safe.directory '*'"
46+
// Uncomment to connect as a non-root user. See https: //aka.ms/vscode-remote/containers/non-root.
47+
// ,"remoteUser": "vscode"
48+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM ghcr.io/nanoframework/dev-container-chibios:v1.34

0 commit comments

Comments
 (0)