@@ -7,58 +7,73 @@ Dockerfile ported by Adafruit from the work of [@jcmvbkbc](https://gist.github.c
7
7
8
8
Please follow the next steps:
9
9
10
- 1 . Download or clone this repo, and then build the docker image:
10
+ 1 . Download or clone this repo
11
11
12
12
``` bash
13
- git clone https://github.com/hpsaturn/esp32s3-linux.git && cd esp32s3-linux
14
- docker build -t esp32-s3_linux .
13
+ git clone --recursive https://github.com/hpsaturn/esp32s3-linux.git && cd esp32s3-linux
15
14
```
16
15
17
- This step takes around ~ 35 minutes and needs ~ 20Gb:
18
-
19
- ![ ESP32S3 Linux image build] ( screenshots/docker_build.jpg )
20
-
21
- 2 . Run a container in a terminal
16
+ 2 . Then build the docker image:
22
17
23
18
``` bash
24
- docker run --name esp32s3build -it esp32-s3_linux
19
+ docker build --build-arg DOCKER_USER= $USER --build-arg DOCKER_USERID= $UID -t esp32linuxbase .
25
20
```
26
21
27
- 3 . In a second termintal, copy the binaries
22
+ 3 . Copy settings sample and configure it:
28
23
29
24
``` bash
30
- docker cp esp32s3build:/app/build/release/ bin_files
25
+ cp settings.cfg.default settings.cfg
31
26
```
32
27
33
- 4 . Stop the container
28
+ Possible settings:
34
29
35
30
``` bash
36
- docker stop esp32s3build
37
- ```
31
+ keep_toolchain=
32
+ keep_rootfs=
33
+ keep_buildroot=
34
+ keep_bootloader=
35
+ keep_etc=
36
+ ```
38
37
39
- # Upload
40
-
41
- You must have two tools installed in your system, [ ESPTool] ( https://docs.espressif.com/projects/esptool/en/latest/esp32/installation.html ) and [ Espressif IDF] ( https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/#installation ) . After that please upload the binaries using:
38
+ put ` y ` to enable some one like yes:
42
39
43
40
``` bash
44
- python esptool.py --chip esp32s3 -p YOUR-PORT-HERE -b 921600 --before=default_reset --after=hard_reset write_flash 0x0 bootloader.bin 0x10000 network_adapter.bin 0x8000 partition-table.bin
45
- ```
41
+ # keep_toolchain=y -- don't rebuild the toolchain, but rebuild everything else
42
+ # keep_rootfs=y -- don't reconfigure or rebuild rootfs from scratch. Would still apply overlay changes
43
+ # keep_buildroot=y -- don't redownload the buildroot, only git pull any updates into it
44
+ # keep_bootloader=y -- don't redownload the bootloader, only rebuild it
45
+ # keep_etc=y -- don't overwrite the /etc partition
46
+ ```
47
+
48
+ 4 . Run the build script of your preference, for example:
46
49
47
50
``` bash
48
- parttool.py write_partition --partition- name linux --input xipImage
51
+ docker run --rm -it -- name esp32s3linux --user= " $( id -u ) : $( id -g ) " -v ./esp32- linux-build:/app --env-file settings.cfg --device-cgroup-rule= ' c 166:* rmw ' --device=/dev/ttyACM0 esp32linuxbase ./rebuild-esp32s3-linux-wifi.sh
49
52
```
50
53
54
+ Keep in mind that you should change the --device to your USB device where is connected the ESP32S3.For a different script please check the directory ` esp32-linux-build ` .This step takes around ~ 35 minutes and needs ~ 20Gb:
55
+
56
+ ![ ESP32S3 Linux image build] ( screenshots/docker_build.jpg )
57
+
58
+ After that you should have this message:
59
+
60
+ ![ ESP32S3 Linux finish build] ( screenshots/docker_build_before_flash.jpg )
61
+
62
+ 5 . Open a different terminal and enter to the running container:
63
+
51
64
``` bash
52
- parttool.py write_partition --partition-name rootfs --input rootfs.cramfs
65
+ docker exec -it -u root esp32s3linux bash
53
66
```
54
67
55
- And the etc partition:¨ (skip it if you preserver your settings)
68
+ and change the docker USB device permissions:
56
69
57
70
``` bash
58
- parttool.py write_partition --partition-name etc --input build-buildroot-esp32s3/images/etc.jffs2
71
+ chmod 666 /dev/ttyACM0
59
72
```
60
73
61
- Alternative following this [ Adafruit guide] ( https://learn.adafruit.com/docker-esp32-s3-linux/docker-esp32-s3-linux-image ) .
74
+ 6 . Return to the main terminal and perform the flashing. And that's it!
75
+
76
+ ![ ESP32S3 Linux final flashing] ( screenshots/docker_flashing.jpg )
62
77
63
78
# Linux boot
64
79
@@ -124,9 +139,9 @@ keep_toolchain=y keep_rootfs=y keep_buildroot=y keep_bootloader=y keep_etc=y ./r
124
139
125
140
# TODO
126
141
127
- - [ ] Migrate to the last script version with build parameters
128
- - [ ] Freezing repositories to specific commit
129
- - [ ] Add provisioning stuff
142
+ - [x ] Migrate to the last script version with build parameters
143
+ - [x ] Freezing repositories to specific commit
144
+ - [x ] Add provisioning stuff (etc partition)
130
145
131
146
# Credits
132
147
0 commit comments