Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
スタックチャンで複数アプリを切り替えるテクニック
Search
Takao Akaki
July 31, 2023
Programming
940
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
スタックチャンで複数アプリを切り替えるテクニック
2023/7/29 スタックチャン お誕生日会 2023のLTで、M5Stack-SD-Updaterの概要を説明した時のスライドです。
Takao Akaki
July 31, 2023
More Decks by Takao Akaki
See All by Takao Akaki
2026.6.27 お誕生日会で配布された透明シェルを交換する際の注意点について
mongonta0716
0
270
2025.5.4 M5Stack スタックチャンの活用方法(2025最新版)
mongonta0716
0
1.2k
スタックチャンに外部スピーカーを接続する方法
mongonta0716
0
880
2022.10.23 メタル #スタックチャン を作ってみた。
mongonta0716
0
2.6k
2022.09.23 メタルスタックチャンを作ってみた
mongonta0716
2
990
2022.7.23 スタックチャン誕生日会
mongonta0716
0
680
Other Decks in Programming
See All in Programming
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
400
続・コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions-again
handlename
0
160
SFCで実現する病院・医療システムの動的組み立て式UI
koukimiura
1
150
AI時代のシニアエンジニアとは
yosuke_furukawa
PRO
13
11k
[Dev Group Paris Octobre 26] Agentforce, SIforce, Claudeforce, Slackbot… on s'y retrouve ?
nabondance
0
120
最近”作らせてる” ローカルAIアプリの話
akit37
0
530
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
210
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
310
Performance Optimization With LLMs
xleitix
0
230
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
310
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
250
Modernizing iOS Apps
seyfoyun
0
140
Featured
See All Featured
Embracing the Ebb and Flow
colly
88
5.2k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Facilitating Awesome Meetings
lara
57
7.2k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
330
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.4k
The Curse of the Amulet
leimatthew05
3
16k
Practical Orchestrator
shlominoach
192
12k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
290
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
520
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
510
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
730
Transcript
スタックチャンで複数アプリを 切り替えるテクニック M5Stack-SD-Updaterの使い方 Arduino-Frameworkで利用できます。 5分なので概要だけです。 2023/7/29 タカオ
自己紹介 名前 タカオ(Twitter: @mongonta555) 職業 スタックチャン職人 M5Stackのドキュメント要員
スタックチャンと出会って2年で26人になりました。 BOOTHでスタックチャン タカオ版組み立てキットを頒布しています。 (見送った人数は 2023/7/29現在 579人) https://mongonta.booth.pm
ESP32上で複数のアプリを切り替えて使うことが 可能になります。 スタックチャンに限りません。 ArduinoFrameworkで利用できます。 相互に切り替えを行うには、各アプリにSD- Updaterの組み込みが必要です。 M5Stack-SD-Updaterとは https://github.com/tobozo/M5Stack-SD-Updater Tobozo Tagada(@TobozoTagada)氏が公開しているArduinoライブラリです。
M5Stack-SD-Updaterを使うメリット 1つのアプリで複数の機能を盛り込んだ場合にありがちな、ヒープメモリ不足 を気にしなくて済む。 複数の機能を同一コード内に持たずに済むので、複雑にならない。 M5Stack-SD-Updaterを使うデメリット SDやSPIFFSからバイナリを読み込むので切り替えには時間がかかる。 →
2つのアプリの切り替えであれば速くするテクニックもある。 プログラムを変更した場合、生成したbinも置き換える必要がある。 → あらかじめ、プログラムにbinを保存する機能を盛り込んでおくと楽
仕組み ESP32(S3等含む)はOTA(Over The Air)という仕組みを持っていて、ファームウェア(アプリ)を WiFi経由で書き換えることが可能です。 その仕組みを利用してSPIFFSやSD上にあるbinファイルをFlashに読み込んで 動作しているファームウェア(アプリ)を切り替えるという仕組みです。
仕組み上、app0とapp1のそれそれのサイズを超えるアプリは使用することができません。 Name 16MB(Core/2/S3等) 8MB(AtomS3等) 4MB(Atom,StickC等) build_partition default_16MB.csv default_8MB.csv default.csv nvs 5,000 5,000 5,000 otadata 2,000 2,000 2,000 app0 640,000 330,000 140,000 app1 640,000 330,000 140,000 spiffs 360,000 180,000 160,000 coredump 10,000 10,000 10,000 ESP32のFlashメモリのパーティションレイアウト(単位:byte)
簡単に言うと、、、 SDカードやSPIFFS(M5Stack内蔵Flashメ モリの一部)に書き込んだbinファイル を相互に切り替えることが可能です。 AIスタックチャン センサー値の表示 アプリ Bluetoothスピーカー スタックチャン AIStackchan.bin
BTStackchan.bin Sensor.bin ランチャーアプリ(menu.bin) AIスタックチャン BTSPK センサー アプリ
Binの用意の仕方 1.ArduinoIDEでバイナリビルド 2.VSCode+PlatformIOからコピー 3.アプリから書き込む方法
Binの用意の仕方① ArduinoIDEでバイナリコンパイル メニューから「スケッチ」→「コンパイル済みバイナリをエクスポート」 を選ぶとbin形式のファイルを生成することができます。 (Arduino1.8.xでは「コンパイルしたバイナリを出力」)
Binの用意の仕方② VSCode+PlatformIOからコピー Buildを実行すると、 .pio/build/(選択したenv名のフォルダ) の下にfirmware.binとファイルができます。 そのファイルをコピーして名前を変更して ください。
Binの用意の仕方③ アプリに書き込み機能を組み込む 多分これが一番楽です。 下記のようなコードをアプリに組み込みます。 例では、BtnAをダブルクリックをするとSPIFFSに書き込みます。
M5Stack-SD-Updaterの注意事項 binのファイル名は半角英数字のみで短めに。 あまり長すぎると、エラーが出て読み込めません。 SPIFFSを使う場合はフォーマットできてないとエラーになる場合がある。 その場合は一度Eraseしてから書き込んでみましょう。
ご清聴ありがとうございました。