Skip to content

Commit

Permalink
Merge pull request #131 from meganetaaan/fix/130/flash-partition
Browse files Browse the repository at this point in the history
Make 8MB Flash settings OPT-IN
  • Loading branch information
meganetaaan committed Mar 5, 2023
2 parents a9a00ed + bb719e5 commit cfc1924
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 4 deletions.
19 changes: 19 additions & 0 deletions firmware/docs/flashing-firmware.md
Expand Up @@ -33,6 +33,8 @@ StackChan can change settings such as motor types and pin assignments from the m
| tts.host | Host name when TTS communicates with server | "localhost", "ttsserver.local", etc. |
| tts.port | Port number when TTS communicates with server | 1~65535 |

Additionally, you can specify the paths of other manifest files in a list format under the `"include"` key.

### Configuration Example: the Stack-chan M5Bottom Kit

This is an example configuration for running [Stack-chan Assembly Kit M5Bottom Version](https://mongonta.booth.pm/) distributed by Takao Akaki ([@mongonta0716](https://github.com/mongonta0716)) with the firmware in this repository. The M5Bottom version does not use a dedicated board, but connects to the M5Bottom port and servo.
Expand Down Expand Up @@ -67,6 +69,23 @@ When using Port.C of M5Stack Basic:

Reference: [About the firmware for Stack-chan M5Go Bottom version (Japanese)](https://raspberrypi.mongonta.com/softwares-for-stackchan/)

### Configuration example: increase mod write space

Moddable currently doesn't have an SD Card driver, so resources like audio and images are compiled and saved within the mod itself.
However, if you have a lot of audio files, the mod may not be able to write beyond the default partition size of 4MB on the stack chan due to limitations.

If you have a recent M5Stack with 16MB of Flash,
you can include the [stackchan/manifest_8mb_flash.json](. /stackchan/manifest_8mb_flash.json) file
to increase the size of the partition where the mod is saved.

Simply add the following code to your manifest file:

```json
{
"include": [". /manifest_8mb_flash.json"],
}
```

## Writing hosts

The following commands are used to build and write a host.
Expand Down
17 changes: 17 additions & 0 deletions firmware/docs/flashing-firmware_ja.md
Expand Up @@ -37,6 +37,8 @@
| tts.host | TTS がサーバと通信する場合のホスト名 | "localhost", "ttsserver.local" などの文字列 |
| tts.port | TTS がサーバと通信する場合のポート番号 | 1~65535 |

また、`"include"`キーの配下にリスト形式で他のマニフェストファイルのパスを指定できます。

### 設定例: スタックチャン M5Bottom版キットを動かす

紅木タカオ氏([@mongonta0716](https://github.com/mongonta0716))が頒布する
Expand Down Expand Up @@ -73,6 +75,21 @@ M5Stack BasicのPort.Cを使う場合:

参考: [スタックチャン M5GoBottom版のファームウェアについて \| M5Stack沼人の日記](https://raspberrypi.mongonta.com/softwares-for-stackchan/)

### 設定例: modの書き込み領域を増やす

2023年3月現在、ModdableはSD Cardのドライバが実装されていないため、音声や画像などのリソースはmodに含めてコンパイルして書き込む形になります。
多量の音声を含む場合、スタックチャンのデフォルトのパーティションサイズである4MBを上回ってmodが書き込めない場合があります。

最近のM5Stackは16MBのFlashを備えています。
その場合は[`stackchan/manifest_8mb_flash.json`](../stackchan/manifest_8mb_flash.json)をインクルードすることで、
modを書き込むパーティションの容量が大幅に増加します。

```json
{
"include": ["./manifest_8mb_flash.json"],
}
```

## ホストの書き込み

次のコマンドでホストの書き込みを行います。
Expand Down
5 changes: 1 addition & 4 deletions firmware/stackchan/manifest.json
@@ -1,8 +1,4 @@
{
"build": {
"SDKCONFIGPATH": "./sdkconfig",
"PARTITIONS_FILE": "./sdkconfig/customPartitions.csv"
},
"defines": {
"XS_MODS": 1
},
Expand Down Expand Up @@ -77,6 +73,7 @@
},
"platforms": {
"esp32/m5stack_core2": {
"include": ["./manifest_8mb_flash.json"],
"config": {
"driver": {
"pwmPan": 19,
Expand Down
6 changes: 6 additions & 0 deletions firmware/stackchan/manifest_8mb_flash.json
@@ -0,0 +1,6 @@
{
"build": {
"SDKCONFIGPATH": "./sdkconfig",
"PARTITIONS_FILE": "./sdkconfig/customPartitions.csv"
}
}

0 comments on commit cfc1924

Please sign in to comment.