Skip to content

Commit 91e06b5

Browse files
author
Kali
committed
update demo for FAP system
1 parent 21f2620 commit 91e06b5

File tree

4 files changed

+62
-40
lines changed

4 files changed

+62
-40
lines changed

CS.png

120 Bytes
Loading

README.md

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
1-
# FlipperZero_plugin_howto
1+
# FlipperZero_plugin_howto .. aka .. FlipperZero_FAP_howto
22
A simple plugin for the FlipperZero written as a tutorial example [ie. excessive documentation & error handling]
33

4+
If you wish to review this repository at the last point before the FAP update, use (this link)[https://github.com/csBlueChip/FlipperZero_plugin_howto/tree/21f2620035728cd04e1951c3f6a30de1cfe8a280]
5+
6+
# FAP Support Has Arrived! :)
7+
Since the move to FAP, your "plugins" are now known as "applications"
8+
* "Plugins" are
9+
* Compiled in to the kernel
10+
* Flashed as part of the firmware in the main SoC
11+
* Require the developer to edit/maintain `/applications/meta/applications.fam`
12+
* "Applications" are
13+
* Compiled as separate programs
14+
* Live on the SDCard
15+
* Do NOT require code edits outside their own directory
16+
17+
The upshot is easier development, and (essentailly) unlimited features on your Flipper!
18+
419
# If you have not yet installed the FlipperZero devkit
520
```
621
mkdir -p ~/flipperZero/official/
@@ -10,11 +25,19 @@ git clone --recursive https://github.com/flipperdevices/flipperzero-firmware.gi
1025
```
1126
...and wait while it downloads all the required tools and performs the first build of the code.
1227

28+
# Install the cutting-edge firmware on your Flipper
29+
`./fbt flash_usb_full`
30+
31+
`flash_usb` is used to install JUST the firmware<br/>
32+
`flash_usb_full` also installs the "resources" (images and such)<br/>
33+
34+
Be aware that since the introdcution of FAP, Applications are Resources.
35+
1336
# After the devkit is installed
1437
Assuming your devkit is in: `~/flipperZero/official/`<br/>
1538
...checkout this demo with:
1639
```
17-
cd ~/flipperZero/official//applications
40+
cd ~/flipperZero/official//applications_user
1841
mkdir bc_demo
1942
cd bc_demo
2043
git clone https://github.com/csBlueChip/FlipperZero_plugin_howto.git ./
@@ -24,26 +47,18 @@ git clone https://github.com/csBlueChip/FlipperZero_plugin_howto.git ./
2447
Compile with:
2548
```
2649
cd ~/flipperZero/official/
27-
./fbt
50+
./fbt firmware_bc_demo
2851
```
29-
...And/Or (Compile and) Flash with:
52+
...And/Or (Compile and) Upload with:
3053
```
3154
cd ~/flipperZero/official/
32-
./fbt flash_usb
55+
./fbt launch_app APPSRC=applications/bc_demo/
3356
```
34-
...Flashing will fail if the FlipperZero is running an app/plugin!
57+
...Flashing will fail if the FlipperZero is in the applications menu, or running an application!
3558

3659
# About the bc_demo code & documentation
3760
* Review the `README.txt` file for an overview of the code, and how to get started.
3861
* Take a look in `bc_demo.c` for, frankly, an abusive amount of commenting; and overkill error-handling.
3962

4063
The code is all M.I.T. Licensed ...take it ...use it ...butcher it ...polish it ...whatever. <br/>
4164
...If you do anything cool with it, I'd love to see your creation :)
42-
43-
# Compiling the demo
44-
You will need to add bc_demo to the system menu by editing `~/flipperZero/official//applications/meta/application.fam` in accordance with the intructions in `README.txt (Plugins) #2`<br>
45-
...then simply use the same compile & flash command we used previously:
46-
```
47-
cd ~/flipperZero/official/
48-
./fbt flash_usb
49-
```

README.txt

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
Resources
66
Meta-list of cool stuff. Includes forks with country restrictions removed
77
https://github.com/djsime1/awesome-flipperzero
8+
Fliiper FAP notes
9+
https://github.com/flipperdevices/flipperzero-firmware/blob/dev/documentation/AppsOnSDCard.md
810

911
Local docs
1012
You really should at least take a peek at the docs in this folder!
@@ -30,57 +32,54 @@ git clone --recursive https://github.com/flipperdevices/flipperzero-firmware.gi
3032
# Do NOT interrupt this process! (it can't recover if a partial zip has been downloaded)
3133
./fbt
3234

35+
3336
,----------.
3437
( Flashing )
3538
`----------'
3639

3740
# qv. documentation/fbt.md
38-
./fbt flash_usb
41+
./fbt flash_usb_full
3942

4043

41-
,---------.
42-
( Plugins )
43-
`---------'
44+
,--------------.
45+
( Applications )
46+
`--------------'
4447

4548
This readme should exist in a directory called 'bc_demo'
4649

47-
1. Move the bc_demo directory to applications/ [**]
50+
1. Move the bc_demo directory to applications_user/ [**]
4851

4952
Eg.
5053
/path/to/FlipperZero/
5154
+-- official/
52-
: +-- applications/ <-- plugins etc.
53-
: | +-- bc_demo/ <-- bc_demo has been added [**]
54-
: | | +-- README <-- this file
55-
: | | +-- application.fam <-- plugin ID file for OS
56-
: | | +-- bc_demo.c <-- excessively documented plugin code
55+
: +-- applications/ <-- system applications
56+
: |
57+
: +-- applications_user/ <-- user applications
58+
: | +-- bc_demo/ <-- bc_demo has been added [**]
59+
: | | +-- README <-- this file
60+
: | | +-- CS.png <-- plugin menu icon (10x10 pixels)
61+
: | | +-- application.fam <-- plugin ID file for OS
62+
: | | +-- bc_demo.stripped <--
63+
: | | +-- bc_demo.c <-- excessively documented plugin code
5764
: | |
58-
: | +-- gui/ <-- The GUI library
65+
: | +-- gui/ <-- The GUI library
5966
: | |
60-
: | +-- meta/ <-- System menu config file
61-
: | : +-- application.fam <-- ...
67+
: | +-- meta/ <-- System menu config file
68+
: | : +-- application.fam <-- ...
6269
: |
63-
: +-- documentation/ <-- Really, RTFMs, or at least skim them! Not kidding!
70+
: +-- documentation/ <-- Really, RTFMs, or at least skim them! Not kidding!
6471
: | +-- KeyCombo.md
6572
: | +-- OTA.md
6673
: | +-- fbt.md
6774
: | :
6875
: |
69-
: +-- furi/ <-- Flipper API
76+
: +-- furi/ <-- Flipper API
7077
: : +-- core/
7178
: :
7279

73-
2. Add the plugin to the menu system
80+
2. Rebuild the application
7481

75-
# Get plugin's "appid"
76-
grep appid ${FZTHIS}/applications/bc_demo/application.fam
77-
78-
# Add it to the menu somewhere
79-
# ...if you can't work out how, probably best give up now :/
80-
edit ${FZTHIS}/applications/meta/application.fam
81-
82-
3. Rebuild the firmware ...Sadly touching the meta/ folder triggers a rebuild of ALL appliations
83-
./fbt
82+
./fbt firmware_bc_demo
8483

8584

8685
,---------.
@@ -91,6 +90,9 @@ The demo code is *EXTENSIVELY* documented
9190

9291
--> application.fam
9392
# This holds the details required by the toolchain to compile it in (as a plugin)
93+
# And OPTIONALLY
94+
# The Application Category (top level directory)
95+
# The name of the menu icon (a 10x10 Black-on-White PNG)
9496

9597
--> err.h
9698
# Keep error numbers and strings tied together in a friendly way
@@ -206,3 +208,6 @@ The demo code is *EXTENSIVELY* documented
206208
+ cbDraw() [7b]
207209
<- O/S <- bc_demo
208210
# (Re-)Draw the whole canvas
211+
212+
--> bc_demo.stripped
213+
# Stripped (but not comment-free) version of bc_demo.c

application.fam

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
App(
22
appid="bc_demo",
33
name="Bluechip Demo",
4-
apptype=FlipperAppType.PLUGIN,
4+
apptype=FlipperAppType.EXTERNAL,
55
entry_point="bc_demo",
66
cdefines=["APP_BC_DEMO"],
77
requires=[
88
"gui",
99
],
1010
stack_size=2 * 1024,
1111
order=20,
12+
fap_icon="CS.png",
13+
fap_category="Cyborg Systems",
1214
)

0 commit comments

Comments
 (0)