-
Notifications
You must be signed in to change notification settings - Fork 9
add dev-tool #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
add dev-tool #5
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
70a46ca
add dev-tool
Ar-Ray-code 831b958
update MROS2_DIR
Ar-Ray-code 8859257
update bash
Ar-Ray-code 967d9dc
Update README.md
Ar-Ray-code 71a55ce
remove `<br>` tag
Ar-Ray-code 6fc7978
remove mros2 automatic clone
Ar-Ray-code e3675e8
update dockerfile
Ar-Ray-code File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ build/ | |
sdkconfig | ||
*.old | ||
*.lock | ||
.env |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# mros2-esp32 dev-tool | ||
|
||
Building mros2-esp32 tool using docker. | ||
|
||
|
||
|
||
|
||
## Requirements | ||
|
||
- USB accessable docker-compose environment | ||
|
||
|
||
|
||
## Usage | ||
|
||
M5Stack CoreS3 | ||
|
||
```bash | ||
bash build_example.bash /dev/ttyACM0 ../../mros2-esp32 ../workspace/echoback_string esp32s3 | ||
``` | ||
|
||
|
||
### Arguments | ||
|
||
- 1: Serial port (default: `/dev/ttyUSB0`) | ||
- 2: Path to mros2-esp32 (default: `../../mros2-esp32`) | ||
- 3: Path to workspace (default: `../workspace/echoback_string`) | ||
- 4: Target board (esp32, esp32s2, esp32s3...) (default: `esp32`) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
SCRIPT_DIR=$(cd $(dirname $0); pwd) | ||
PORT=${1:-/dev/ttyUSB0} | ||
MROS2_DIR=${2:-${SCRIPT_DIR}/../../mros2-esp32} | ||
WORKSPACE=${3:-${SCRIPT_DIR}/../workspace/echoback_string} | ||
TARGET=${4:-esp32} | ||
|
||
echo "=====================" | ||
echo "PORT: ${PORT}" | ||
echo "MROS2_DIR: ${MROS2_DIR}" | ||
echo "WORKSPACE: ${WORKSPACE}" | ||
echo "TARGET: ${TARGET}" | ||
echo "=====================" | ||
|
||
rm -rf ${SCRIPT_DIR}/.env | ||
echo "PORT=${PORT}" > ${SCRIPT_DIR}/.env | ||
echo "MROS2_DIR=${MROS2_DIR}" >> ${SCRIPT_DIR}/.env | ||
echo "WORKSPACE=${WORKSPACE}" >> ${SCRIPT_DIR}/.env | ||
echo "TARGET=${TARGET}" >> ${SCRIPT_DIR}/.env | ||
|
||
cd ${SCRIPT_DIR} | ||
|
||
if [ ! -d ${MROS2_DIR} ]; then | ||
echo "mros2-esp32 directory not found." | ||
fi | ||
|
||
docker-compose up --build mros2_esp32 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: "3" | ||
services: | ||
mros2_esp32: | ||
build: | ||
context: ./docker | ||
dockerfile: esp_idf.dockerfile | ||
container_name: esp_idf | ||
volumes: | ||
- ${MROS2_DIR}:/mros2-esp32 | ||
- ${WORKSPACE}:/mros2-esp32/workspace/target | ||
devices: | ||
- ${PORT}:${PORT} | ||
environment: | ||
- PORT=${PORT} | ||
- TARGET=${TARGET} | ||
command: ["/tmp/build_mros2.bash"] | ||
env_file: | ||
- .env |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
SCRIPT_DIR=/mros2-esp32/workspace/target/ | ||
|
||
. /esp/esp-idf/export.sh | ||
|
||
cd ${SCRIPT_DIR} | ||
rm -rf ${SCRIPT_DIR}/build/ | ||
|
||
idf.py set-target ${TARGET} | ||
if [ $? -ne 0 ]; then | ||
echo "Failed to set target" | ||
exit 1 | ||
fi | ||
|
||
sed -i 's/CONFIG_LWIP_IPV6=y/CONFIG_LWIP_IPV6=n/g' ${SCRIPT_DIR}/sdkconfig | ||
|
||
idf.py build | ||
idf.py -p ${PORT} flash | ||
if [ $? -ne 0 ]; then | ||
echo "Failed to flash" | ||
exit 1 | ||
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM ubuntu:22.04 | ||
|
||
ENV TZ=Asia/Tokyo | ||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt update && apt install locales && \ | ||
locale-gen en_US en_US.UTF-8 && \ | ||
update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 && \ | ||
apt -y clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
ENV LANG=en_US.UTF-8 | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
git wget flex bison gperf python3 python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0 | ||
|
||
RUN mkdir -p /esp | ||
RUN cd /esp && git clone --recursive https://github.com/espressif/esp-idf.git -b v5.2-dev && \ | ||
cd /esp/esp-idf && \ | ||
./install.sh all | ||
|
||
RUN /bin/bash -c "source /esp/esp-idf/export.sh && \ | ||
pip3 install jinja2" | ||
|
||
COPY ./build_mros2.bash /tmp/build_mros2.bash |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.