Skip to content

Commit edb11be

Browse files
Update docs
1 parent c919777 commit edb11be

File tree

3 files changed

+25
-38
lines changed

3 files changed

+25
-38
lines changed

docs/os-development/compiling.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,19 @@
1212
1313
<pre>
1414
```
15-
./scripts/build_mpos.sh <target system> <build type (prod or dev)> [optional target device]
15+
./scripts/build_mpos.sh <target system>
1616
```
1717
</pre>
1818
1919
**Target systems**: `esp32`, `unix` (= Linux) and `macOS`
2020
21-
**Build types**:
22-
23-
- A `prod` build includes the complete filesystem that's "frozen" into the build, so it's fast and all ready to go but the files in /lib and /builtin will be read-only.
24-
- A `dev` build comes without a filesystem, so it's perfect for power users that want to work on MicroPythonOS internals. There's a simple script that will copy all the necessary files over later, and these will be writeable.
25-
26-
_Note_: for unix and macOS systems, only `dev` has been tested. The `prod` builds might have issues but should be made to work soon.
27-
28-
**Target devices**: `waveshare-esp32-s3-touch-lcd-2` or `fri3d-2024`
29-
3021
**Examples**:
3122
3223
<pre>
3324
```
34-
./scripts/build_mpos.sh esp32 prod fri3d-2024
35-
./scripts/build_mpos.sh esp32 dev waveshare-esp32-s3-touch-lcd-2
36-
./scripts/build_mpos.sh esp32 unix dev
37-
./scripts/build_mpos.sh esp32 macOS dev
25+
./scripts/build_mpos.sh esp32
26+
./scripts/build_mpos.sh unix
27+
./scripts/build_mpos.sh macOS
3828
```
3929
</pre>
4030

docs/os-development/installing-on-esp32.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,20 @@ But if you need to install a version that's not available there, or you built yo
44

55
1. **Get the firmware**
66

7-
- Download a release binary (e.g., `MicroPythonOS_fri3d-2024_prod_0.2.1.bin`, `MicroPythonOS_waveshare-esp32-s3-touch-lcd-2_prod_0.2.1.bin`, etc.)
7+
- Download a release binary (e.g., `MicroPythonOS_esp32_0.5.0.bin`)
88
- Or build your own [on MacOS](macos.md) or [Linux](linux.md)
99

1010
2. **Put the ESP32 in Bootloader Mode**
1111

1212
If you're already in MicroPythonOS: go to Settings - Restart to Bootloader - Bootloader - Save.
1313

14-
Otherwise, physically keep the "BOOT" (sometimes labeled "START") button pressed while briefly pressing the "RESET" button.
14+
Otherwise, physically keep the "BOOT" (sometimes labeled "START") button pressed while powering up the board.
15+
This is explained in more detail at [the webinstaller](https://install.micropythonos.com/)
1516

1617
3. **Flash the firmware**
1718

1819
```
19-
~/.espressif/python_env/idf5.2_py3.9_env/bin/python -m esptool --chip esp32s3 write_flash 0x0 firmware_file.bin
20+
~/.espressif/python_env/idf5.2_py3.9_env/bin/python -m esptool --chip esp32s3 write_flash 0 firmware_file.bin
2021
```
2122
2223
Add the `--erase-all` option if you want to erase the entire flash memory, so that no old files or apps will remain.
@@ -33,36 +34,30 @@ But if you need to install a version that's not available there, or you built yo
3334
lvgl_micropython/lib/micropython/tools/mpremote/mpremote.py
3435
```
3536
36-
5. **Populate the filesystem** (only for "dev" builds)
37+
5. **Populate the filesystem** (only for development)
3738
38-
The "dev" builds come without a filesystem so you probably want to copy:
39+
In development, you probably want to override the "frozen" libraries and apps that are compiled in, and replace them with source files, which you can edit.
3940
40-
- the whole internal_filesystem/ folder, including main.py
41-
- the appropriate device-specific internal_filesystem/boot*.py file to /boot.py on the device
42-
4341
There's a convenient script that will do this for you.
4442
4543
Usage:
4644
4745
<pre>
4846
```
49-
./scripts/install.sh <target device>
47+
./scripts/install.sh
5048
```
5149
</pre>
5250
53-
**Target devices**: waveshare-esp32-s3-touch-lcd-2 or fri3d-2024
5451
55-
Examples:
52+
Example:
5653
5754
<pre>
5855
```
59-
./scripts/install.sh fri3d-2024
60-
./scripts/install.sh waveshare-esp32-s3-touch-lcd-2
56+
./scripts/install.sh
6157
```
6258
</pre>
6359
6460
6561
## Notes
6662
67-
- A "dev" build without frozen files is quite a bit slower when starting apps because all the libraries need to be compiled at runtime.
6863
- Ensure your ESP32 is compatible (see [Supported Hardware](../getting-started/supported-hardware.md)). If it's not, then you might need the [Porting Guide](../os-development/porting-guide.md).

docs/os-development/porting-guide.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,26 @@ If you prefer to have the porting work done for you and you're open to making a
1010

1111
## What to write
1212

13-
By design, the only device-specific code for MicroPythonOS is found in the ```internal_filesystem/boot*.py``` files.
13+
By design, the only device-specific code for MicroPythonOS is found in the ```internal_filesystem/lib/mpos/board/<boardname>.py``` files.
14+
1415

1516
## Steps to port to a new device
1617

1718
1. Compile [lvgl_micropython](https://github.com/lvgl-micropython/lvgl_micropython) for the new device.
1819

1920
The goal is to have it boot and show a MicroPython REPL shell on the serial line.
2021

21-
Take a look at our [build_mpos.sh](https://github.com/MicroPythonOS/MicroPythonOS/blob/main/scripts/build_mpos.sh) script. A "dev" build (without any "frozen" filesystem) is preferred as this will still change a lot.
22+
Take a look at our [build_mpos.sh](https://github.com/MicroPythonOS/MicroPythonOS/blob/main/scripts/build_mpos.sh) script.
2223

2324
Also go over the [official lvgl_micropython documentation](https://github.com/lvgl-micropython/lvgl_micropython/blob/main/README.md) for porting instructions. If you're in luck, your device is already listed in the esp32 BOARD list. Otherwise use a generic one like `BOARD=ESP32_GENERIC` with `BOARD_VARIANT=SPIRAM` or `BOARD=ESP32_GENERIC_S3` with `BOARD_VARIANT=SPIRAM_OCT` if it has an SPIRAM.
2425

2526
2. Figure out how to initialize the display for the new device
2627

27-
Use the MicroPython REPL shell on the serial port to type or paste (CTRL-E) MicroPython code.
28+
Use the MicroPython REPL shell on the serial port to type or paste (CTRL-E) MicroPython code manually at first to see what works.
2829

29-
Check out how it's done for the [Waveshare 2 inch Touch Screen](https://github.com/MicroPythonOS/MicroPythonOS/blob/main/internal_filesystem/boot.py) and for the [Fri3d Camp 2024 Badge](https://github.com/MicroPythonOS/MicroPythonOS/blob/main/internal_filesystem/boot_fri3d-2024.py). You essentially need to set the correct pins to which the display is connected (like `LCD_SCLK`, `LCD_MOSI`, `LCD_MOSI` etc.) and also set the resolution of the display (`TFT_HOR_RES`, `TFT_VER_RE`S).
30+
Take a look at [```waveshare_esp32_s3_touch_lcd_2.py```](https://github.com/MicroPythonOS/MicroPythonOS/blob/main/internal_filesystem/lib/mpos/board/waveshare_esp32_s3_touch_lcd_2.py) or [```fri3d_2024.py```](https://github.com/MicroPythonOS/MicroPythonOS/blob/main/internal_filesystem/lib/mpos/board/fri3d-2024.py).
31+
32+
You essentially need to set the correct pins to which the display is connected (like `LCD_SCLK`, `LCD_MOSI`, `LCD_MOSI` etc.) and also set the resolution of the display (`TFT_HOR_RES`, `TFT_VER_RE`S).
3033

3134
After a failed attempt, reset the device to make sure the hardware is in a known initial state again.
3235

@@ -47,17 +50,16 @@ By design, the only device-specific code for MicroPythonOS is found in the ```in
4750
```
4851
</pre>
4952

50-
3. Put the initialization code in a custom boot_...py file for your device
53+
3. Put the initialization code in a custom ```<boardname>.py``` file for your device
5154

52-
4. Copy the custom boot_...py file and the generic MicroPythonOS files to your device (see [install.sh](https://github.com/MicroPythonOS/MicroPythonOS/blob/main/scripts/install.sh)
55+
4. Copy the custom ```<boardname>.py``` file and the generic MicroPythonOS files to your device (see [install.sh](https://github.com/MicroPythonOS/MicroPythonOS/blob/main/scripts/install.sh)
5356

54-
After reset, your custom boot_...py file should initialize the display and then MicroPythonOS should start, run the launcher, which shows the icons etc.
57+
After reset, your custom ```<boardname>.py``` file should initialize the display and then MicroPythonOS should start, run the launcher, which shows the icons etc.
5558

5659
5. Add more hardware support
5760

58-
If your device has a touch screen, check out how it's initialized for the [Waveshare 2 inch Touch Screen](https://github.com/MicroPythonOS/MicroPythonOS/blob/main/internal_filesystem/boot.py).
59-
If it has buttons for input, check out the KeyPad code for the [Fri3d Camp 2024 Badge](https://github.com/MicroPythonOS/MicroPythonOS/blob/main/internal_filesystem/boot_fri3d-2024.py).
61+
If your device has a touch screen, check out how it's initialized for the [Waveshare 2 inch Touch Screen](https://github.com/MicroPythonOS/MicroPythonOS/blob/main/internal_filesystem/lib/mpos/board/waveshare_esp32_s3_touch_lcd_2.py). If it has buttons for input, check out the KeyPad code for the [Fri3d Camp 2024 Badge](https://github.com/MicroPythonOS/MicroPythonOS/blob/main/internal_filesystem/lib/mpos/board/fri3d-2024.py).
6062

6163
Now you should be able to control the device, connect to WiFi and install more apps from the AppStore.
6264

63-
This would be a good time to create a pull-request to merge your boot_...py file into the main codebase so the support becomes official!
65+
This would be a good time to create a pull-request to merge your ```<boardname>.py``` file into the main codebase so the support becomes official!

0 commit comments

Comments
 (0)