Skip to content

Commit bff45d8

Browse files
committed
initial
1 parent 3066871 commit bff45d8

File tree

9 files changed

+539
-0
lines changed

9 files changed

+539
-0
lines changed

.gitignore

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
.config
2+
*.o
3+
*.pyc
4+
5+
6+
# Example project files
7+
src/serprog/sdkconfig
8+
src/serprog/sdkconfig.old
9+
src/serprog/build
10+
src/serprog/managed_components/*
11+
src/serprog/trace
12+
13+
# emacs
14+
.dir-locals.el
15+
16+
# eclipse setting
17+
.settings
18+
19+
# vscode
20+
.vscode
21+
22+
# Doc build artifacts
23+
docs/*/_build/
24+
docs/*/doxygen-warning-log.txt
25+
docs/*/sphinx-warning-log.txt
26+
docs/*/sphinx-warning-log-sanitized.txt
27+
docs/*/xml/
28+
docs/*/xml_in/
29+
docs/*/man/
30+
docs/doxygen_sqlite3.db
31+
32+
# MacOS directory files
33+
.DS_Store
34+
35+
# Tools
36+
tools/factory_nvs_gen/*.bin
37+
tools/factory_nvs_gen/*.csv
38+
39+
# Patch files
40+
*.patch
41+
42+
#CTags
43+
tags
44+
45+
# Dependency lock files
46+
dependencies.lock

src/serprog/.devcontainer/Dockerfile

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
FROM espressif/idf
2+
3+
ARG DEBIAN_FRONTEND=nointeractive
4+
ARG CONTAINER_USER=esp
5+
ARG USER_UID=1000
6+
ARG USER_GID=$USER_UID
7+
8+
RUN apt-get update \
9+
&& apt install -y -q \
10+
cmake \
11+
git \
12+
hwdata \
13+
libglib2.0-0 \
14+
libnuma1 \
15+
libpixman-1-0 \
16+
linux-tools-virtual \
17+
&& rm -rf /var/lib/apt/lists/*
18+
19+
RUN update-alternatives --install /usr/local/bin/usbip usbip `ls /usr/lib/linux-tools/*/usbip | tail -n1` 20
20+
21+
# QEMU
22+
ENV QEMU_REL=esp-develop-20220919
23+
ENV QEMU_SHA256=f6565d3f0d1e463a63a7f81aec94cce62df662bd42fc7606de4b4418ed55f870
24+
ENV QEMU_DIST=qemu-${QEMU_REL}.tar.bz2
25+
ENV QEMU_URL=https://github.com/espressif/qemu/releases/download/${QEMU_REL}/${QEMU_DIST}
26+
27+
ENV LC_ALL=C.UTF-8
28+
ENV LANG=C.UTF-8
29+
30+
RUN wget --no-verbose ${QEMU_URL} \
31+
&& echo "${QEMU_SHA256} *${QEMU_DIST}" | sha256sum --check --strict - \
32+
&& tar -xf $QEMU_DIST -C /opt \
33+
&& rm ${QEMU_DIST}
34+
35+
ENV PATH=/opt/qemu/bin:${PATH}
36+
37+
RUN groupadd --gid $USER_GID $CONTAINER_USER \
38+
&& adduser --uid $USER_UID --gid $USER_GID --disabled-password --gecos "" ${CONTAINER_USER} \
39+
&& usermod -a -G dialout $CONTAINER_USER
40+
USER ${CONTAINER_USER}
41+
ENV USER=${CONTAINER_USER}
42+
WORKDIR /home/${CONTAINER_USER}
43+
44+
RUN echo "source /opt/esp/idf/export.sh > /dev/null 2>&1" >> ~/.bashrc
45+
46+
ENTRYPOINT [ "/opt/esp/entrypoint.sh" ]
47+
48+
CMD ["/bin/bash", "-c"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.183.0/containers/ubuntu
3+
{
4+
"name": "ESP-IDF QEMU",
5+
"build": {
6+
"dockerfile": "Dockerfile"
7+
},
8+
// Add the IDs of extensions you want installed when the container is created
9+
"workspaceMount": "source=${localWorkspaceFolder},target=${localWorkspaceFolder},type=bind",
10+
/* the path of workspace folder to be opened after container is running
11+
*/
12+
"workspaceFolder": "${localWorkspaceFolder}",
13+
"mounts": [
14+
"source=extensionCache,target=/root/.vscode-server/extensions,type=volume"
15+
],
16+
"customizations": {
17+
"vscode": {
18+
"settings": {
19+
"terminal.integrated.defaultProfile.linux": "bash",
20+
"idf.espIdfPath": "/opt/esp/idf",
21+
"idf.customExtraPaths": "",
22+
"idf.pythonBinPath": "/opt/esp/python_env/idf5.1_py3.8_env/bin/python",
23+
"idf.toolsPath": "/opt/esp",
24+
"idf.gitPath": "/usr/bin/git"
25+
},
26+
"extensions": [
27+
"ms-vscode.cpptools",
28+
"espressif.esp-idf-extension"
29+
],
30+
},
31+
"codespaces": {
32+
"settings": {
33+
"terminal.integrated.defaultProfile.linux": "bash",
34+
"idf.espIdfPath": "/opt/esp/idf",
35+
"idf.customExtraPaths": "",
36+
"idf.pythonBinPath": "/opt/esp/python_env/idf5.1_py3.8_env/bin/python",
37+
"idf.toolsPath": "/opt/esp",
38+
"idf.gitPath": "/usr/bin/git"
39+
},
40+
"extensions": [
41+
"ms-vscode.cpptools",
42+
"espressif.esp-idf-extension"
43+
],
44+
}
45+
},
46+
"runArgs": ["--privileged"]
47+
}

src/serprog/CMakeLists.txt

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# For more information about build system see
2+
# https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html
3+
# The following five lines of boilerplate have to be in your project's
4+
# CMakeLists in this exact order for cmake to work correctly
5+
cmake_minimum_required(VERSION 3.16)
6+
7+
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
8+
project(main)

src/serprog/main/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
idf_component_register(SRCS "main.c"
2+
INCLUDE_DIRS "."
3+
REQUIRES "vfs"
4+
REQUIRES "driver")

0 commit comments

Comments
 (0)