Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 47 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,52 @@ pre-commit install
- **Right-click** on the file you want to upload in the side panel (or folder/project view).
- In the context menu that appears, select **Upload File to Pico**

#### 11. Run the Script
> You don't need all files on board. You only need: app, config, lib, utils directories and main.py

- **Right-click** on the file you want to run In Mpy Remote Workspace.
#### 11. Run the Program

- **Right-click** on the main.py in Mpy Remote Workspace.
- In the context menu that appears, select **run current file on Pico**

> Alternatively, right-click main.py in the MicroPython Remote Workspace, then click the Run button at the bottom.

### How to freeze code and make firmware for raspberry pi pico W board

#### 1. Git clone micropython repo

```
git clone https://github.com/micropython/micropython.git
```

#### 2. Go inside cloned directory and build the MicroPython cross-compiler

```
cd micropython
make -C mpy-cross
```

#### 3. Build the firmware

```
make BOARD=RPI_PICO_W submodules
make BOARD=RPI_PICO_W clean
make -j $(nproc) BOARD=RPI_PICO_W FROZEN_MANIFEST=/path/to/manifest.py/file/inside/ISMU/directory
```

> The ISMU directory contains two manifest files. One includes main.py (manifest_release.py) to auto-start the program on power-up, while the other excludes it so you can run the code manually from an IDE.

#### 4. Deploying firmware to the device

Firmware can be deployed to the device by putting it into bootloader mode
(hold down BOOTSEL while powering on or resetting) and then either copying
`firmware.uf2` to the USB mass storage device that appears.

> You can find firmware.uf2 inside build-RPI_PICO_W directory. (schematic path : micropython/ports/rp2/build-RPI_PICO_W)

#### 5. Cleaning unnecessary files from Mpy Remote Workplace

After loading compiled code to firmware, you don't need anymore app, lib, utils directories and main.py(if you used manifest_release.py), so you can remove it from there. In config directory you need to have: char_map.json, lang.py(font), lang.json(language file).

### How to make lang.py - font file for project

todo
Empty file added app/__init__.py
Empty file.
4 changes: 2 additions & 2 deletions app/selection_management/selection_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from utils.error_handler import set_error_and_raise
from utils.singleton_decorator import singleton

SELECTION_PATH = "app/selection_management/selection.json"
TEMP_SELECTION_PATH = "app/selection_management/selection.tmp"
SELECTION_PATH = "/config/selection.json"
TEMP_SELECTION_PATH = "/config/selection.tmp"


class TripInfo:
Expand Down
8 changes: 8 additions & 0 deletions manifest_debug.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
include("$(PORT_DIR)/boards/manifest.py")

package("app", opt=2)
package("utils", opt=2)

module("microdot.py", base_path="lib", opt=2)
module("sh1106.py", base_path="lib", opt=2)
module("writer.py", base_path="lib", opt=2)
9 changes: 9 additions & 0 deletions manifest_release.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
include("$(PORT_DIR)/boards/manifest.py")

package("app", opt=2)
package("utils", opt=2)

module("microdot.py", base_path="lib", opt=2)
module("sh1106.py", base_path="lib", opt=2)
module("writer.py", base_path="lib", opt=2)
module("main.py", opt=2)
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ exclude = [
"lib/",
"config/",
"typings/",
"manifest_debug.py",
"manifest_release.py",
]
preview = true

Expand Down
Empty file added utils/__init__.py
Empty file.
Loading