Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FL-2263] Flasher service & RAM exec #1006

Merged
merged 128 commits into from
Apr 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
4178260
WIP on stripping fw
hedger Feb 10, 2022
f7d5454
Compact FW build - use RAM_EXEC=1 COMPACT=1 DEBUG=0
hedger Feb 10, 2022
9c38b64
Fixed uninitialized storage struct; small fixes to compact fw
hedger Feb 11, 2022
0ae4282
Flasher srv w/mocked flash ops
hedger Feb 22, 2022
51533eb
Fixed typos & accomodated FFF changes
hedger Feb 22, 2022
133c773
Nani?
hedger Feb 22, 2022
bc0ea84
Alternative fw startup branch
hedger Feb 24, 2022
1654504
Working load & jmp to RAM fw
hedger Mar 2, 2022
42bd684
+manifest processing for stage loader; + crc verification for stage p…
hedger Mar 2, 2022
45bbe61
Fixed questionable code & potential leaks
hedger Mar 2, 2022
e38b7e8
Lowered screen update rate; added radio stack update stubs; working d…
hedger Mar 2, 2022
fe1185c
Console EP with manifest & stage validation
hedger Mar 3, 2022
3e2ea6f
Added microtar lib; minor ui fixes for updater
hedger Mar 3, 2022
2f537ce
Removed microtar
hedger Mar 5, 2022
5be12af
Removed mtar #2
hedger Mar 5, 2022
ec23d75
Added a better version of microtar
hedger Mar 5, 2022
55e089a
TAR archive api; LFS backup & restore core
hedger Mar 10, 2022
d17f146
Recursive backup/restore
hedger Mar 12, 2022
55f1254
LFS worker thread
hedger Mar 15, 2022
ac71cc1
Added system apps to loader - not visible in UI; full update process …
hedger Mar 17, 2022
b471210
Typo fix
hedger Mar 17, 2022
1551439
Dropped BL & f6; tooling for updater WIP
hedger Mar 22, 2022
aaf2fd3
Minor py fixes
hedger Mar 23, 2022
ee23fe8
Merge remote-tracking branch 'remotes/origin/dev' into hedger/compactfw
hedger Mar 23, 2022
7eb6b77
Minor fixes to make it build after merge
hedger Mar 23, 2022
363ccb0
Ported flash workaround from BL + fixed visuals
hedger Mar 24, 2022
9448df7
Minor cleanup
hedger Mar 24, 2022
56c9918
Merge remote-tracking branch 'remotes/origin/dev' into hedger/compactfw
hedger Mar 24, 2022
8bc0df4
Chmod + loader app search fix
hedger Mar 24, 2022
9f08453
Python linter fix
hedger Mar 24, 2022
79cc918
More linter fixes
hedger Mar 24, 2022
da489db
Even more liter fixes.
hedger Mar 24, 2022
03b0e44
Newline fix
hedger Mar 24, 2022
75177be
Removed usb stuff & float read support for staged loader == -10% of b…
hedger Mar 24, 2022
7cf6101
Added backup/restore & update pb requests
hedger Mar 25, 2022
151638f
Added stub impl to RPC for backup/restore/update commands
hedger Mar 25, 2022
1e56ff6
Reworked TAR to use borrowed Storage api; slightly reduced build size…
hedger Mar 25, 2022
cfb966d
Moved backup&restore to storage
hedger Mar 25, 2022
6261744
Fixed new message types
hedger Mar 25, 2022
aca0fa8
Backup/restore/update RPC impl
hedger Mar 25, 2022
e681f94
Merge remote-tracking branch 'remotes/origin/dev' into hedger/compactfw
hedger Mar 25, 2022
c832993
Moved furi_hal_crc to LL; minor fixes
hedger Mar 25, 2022
8473bde
CRC HAL rework to LL
hedger Mar 25, 2022
2deaff8
Purging STM HAL
hedger Mar 25, 2022
d53a2d5
More cleanup & small fixes
hedger Mar 25, 2022
4231d74
hello, linter
hedger Mar 25, 2022
2008d7c
Merge remote-tracking branch 'remotes/origin/dev' into hedger/compactfw
hedger Mar 25, 2022
691274b
Brought back minimal DFU boot mode (no gui); additional crc state checks
hedger Mar 26, 2022
ec9f9f5
HAL->LL
hedger Mar 26, 2022
2d0e09e
Added splash screen, BROKEN usb function
hedger Mar 26, 2022
a4bbee2
Clock init rework WIP
hedger Mar 26, 2022
9b3918f
Stripped graphics from DFU mode
hedger Mar 26, 2022
ae39dbb
Temp fix for unused static fun
hedger Mar 26, 2022
fdea73a
WIP update picker - broken!
hedger Apr 1, 2022
ba9bc98
Fixed UI
hedger Apr 1, 2022
8e53f24
Bumping version
hedger Apr 1, 2022
614bffe
Fixed RTC setup
hedger Apr 1, 2022
41e53ef
Merge remote-tracking branch 'remotes/origin/dev' into hedger/compactfw
hedger Apr 2, 2022
47589db
Backup to update folder instead of ext root
hedger Apr 2, 2022
c377f6d
Removed unused scenes & more usb remnants from staged loader
hedger Apr 2, 2022
dde77b2
Hello, linter, my old friend
hedger Apr 2, 2022
1afd7d2
CI updates
hedger Apr 2, 2022
a1e1d39
Fixed update bundle name
hedger Apr 2, 2022
4eac3ff
Minor cleanup
hedger Apr 2, 2022
5bc9eca
Typo
hedger Apr 2, 2022
2fb0b20
Temporary restored USB handler
hedger Apr 2, 2022
678f24c
Attempt to prevent .text corruption
hedger Apr 2, 2022
8ab4803
Comments on how I spent this Saturday
hedger Apr 2, 2022
ce0a6e2
Added update file icon
hedger Apr 2, 2022
9c0af52
Documentation updates
hedger Apr 2, 2022
b163de6
Moved common code to lib folder
hedger Apr 3, 2022
b4bd027
Storage: more unit tests
DrZlo13 Apr 3, 2022
a3cc60e
Storage: blocking dir open, differentiate file and dir when freed.
DrZlo13 Apr 3, 2022
d064ca1
Merge remote-tracking branch 'remotes/origin/zlo/storage-open-dir-blo…
hedger Apr 3, 2022
d256f30
Major refactoring; added input processing to updater to allow retryin…
hedger Apr 3, 2022
86631ca
Removed re-init check for manifest
hedger Apr 3, 2022
efd57e3
Changed low-level path manipulation to toolbox/path.h; makefile clean…
hedger Apr 4, 2022
77460d7
Increased update worker stack size
hedger Apr 4, 2022
262904a
Text fixes in backup CLI
hedger Apr 4, 2022
bcc547c
Merge remote-tracking branch 'remotes/origin/dev' into hedger/compactfw
hedger Apr 4, 2022
52019f7
Displaying number of update stages to run; removed timeout in handlin…
hedger Apr 4, 2022
0b003fb
Merge remote-tracking branch 'remotes/origin/dev' into hedger/compactfw
hedger Apr 4, 2022
d9538aa
Bumping version
hedger Apr 4, 2022
ff972e5
Added thread cleanup for spawner thread
hedger Apr 5, 2022
ff48cbb
Updated build targets to exclude firmware bundle from 'ALL'
hedger Apr 7, 2022
57b6e82
Fixed makefile for update_package; skipping VCP init for update mode …
hedger Apr 8, 2022
855f411
Merge remote-tracking branch 'remotes/origin/dev' into hedger/compactfw
hedger Apr 8, 2022
31049b3
Switched github build from ALL to update_package
hedger Apr 8, 2022
c440736
Added +x for dist_update.sh
hedger Apr 8, 2022
365efe9
Changes as requested
hedger Apr 8, 2022
25b12fc
Removed leftovers
hedger Apr 8, 2022
ab3c9c0
Cli: add total heap size to "free" command
DrZlo13 Apr 8, 2022
83a00c7
Some comments
hedger Apr 8, 2022
c5650ed
Moved (RAM) suffix to build version instead of git commit no.
hedger Apr 8, 2022
c7c6ea1
DFU comment
hedger Apr 8, 2022
cb904a5
Some fixes suggested by clang-tidy
hedger Apr 10, 2022
6c8c917
Fixed recursive PREFIX macro
hedger Apr 10, 2022
c59c960
Tiny linter fix
hedger Apr 11, 2022
fc49486
Typo fix in backup creation
hedger Apr 11, 2022
aff6430
Merge branch 'dev' into hedger/compactfw
skotopes Apr 11, 2022
7c01397
Makefile: gather all new rules in updater namespace. FuriHal: rename …
skotopes Apr 11, 2022
ae831bd
Github: correct build target name in firmware build
skotopes Apr 11, 2022
e693fbd
FuriHal: move target switch to boot
skotopes Apr 11, 2022
da14015
Format sources and fix incorrect variable name
skotopes Apr 11, 2022
c8fb47e
Makefile: fix firmware flash
skotopes Apr 12, 2022
5316e64
Furi, FuriHal: move kernel start to furi, early init
skotopes Apr 12, 2022
87dea82
Drop bootloader related stuff
skotopes Apr 12, 2022
3751c0c
Drop cube. Drop bootloader linker script.
skotopes Apr 12, 2022
4ccf41f
Renamed update_hl, moved constants to #defines
hedger Apr 12, 2022
eb6b575
Moved update-related boot mode to separate bitfield
hedger Apr 12, 2022
be406bb
+Missing files
hedger Apr 12, 2022
eae61eb
Reworked updater cli to single entry point; fixed crash on tar cleanup
hedger Apr 12, 2022
d36c6cd
Added Python replacement for dist shell scripts
hedger Apr 12, 2022
4512c84
Linter fixes for dist.py +x
hedger Apr 12, 2022
62d274f
Fixes for environment suffix
hedger Apr 12, 2022
f9b5970
Dropped bash scripts
hedger Apr 12, 2022
09c2721
Added dirty build flag to version structure & interfaces
hedger Apr 12, 2022
a643cec
Version string escapes
hedger Apr 12, 2022
6a733f4
Fixed flag logic in dist.py; added support for App instances being im…
hedger Apr 13, 2022
2f562dd
Fixed fw address in ReadMe.md
hedger Apr 13, 2022
d437179
Rpc: fix crash on double screen start
skotopes Apr 12, 2022
ee34d6b
Return back original boot behavior and fix jump to system bootloader
skotopes Apr 13, 2022
05fbd43
Cleanup code, add error sequence for RTC
skotopes Apr 13, 2022
adca2de
Update firmware readme
skotopes Apr 13, 2022
dfc0e8f
FuriHal: drop boot, restructure RTC registers usage and add header re…
skotopes Apr 13, 2022
4f62226
Furi goes first
skotopes Apr 13, 2022
c8093ee
Toolchain: add ccache support
skotopes Apr 13, 2022
f96c53f
Renamed update bundle dir
hedger Apr 13, 2022
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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ applications/sd-filesystem/** @skotopes @DrZlo13
applications/subghz/** @skotopes @DrZlo13
applications/template/** @skotopes @DrZlo13
applications/tests/** @skotopes @DrZlo13
applications/updater/** @skotopes @DrZlo13 @hedger

# Assets and asset generator
assets/** @skotopes @DrZlo13
Expand Down
25 changes: 18 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
run: |
test -d artifacts && rm -rf artifacts || true
mkdir artifacts

- name: 'Generate suffix and folder name'
id: names
run: |
Expand All @@ -52,13 +52,13 @@ jobs:
fi
BRANCH_OR_TAG=${REF#refs/*/}
SHA=$(git rev-parse --short HEAD)

if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
SUFFIX=${BRANCH_OR_TAG//\//_}
else
SUFFIX=${BRANCH_OR_TAG//\//_}-$(date +'%d%m%Y')-${SHA}
fi

echo "WORKFLOW_BRANCH_OR_TAG=${BRANCH_OR_TAG}" >> $GITHUB_ENV
echo "DIST_SUFFIX=${SUFFIX}" >> $GITHUB_ENV
echo "::set-output name=artifacts-path::${BRANCH_OR_TAG}"
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
set -e
for TARGET in ${TARGETS}
do
make TARGET=${TARGET} ${{ startsWith(github.ref, 'refs/tags') && 'DEBUG=0 COMPACT=1' || '' }}
make updater_package TARGET=${TARGET} ${{ startsWith(github.ref, 'refs/tags') && 'DEBUG=0 COMPACT=1' || '' }}
done

- name: 'Move upload files'
Expand All @@ -100,6 +100,17 @@ jobs:
mv dist/${TARGET}/* artifacts/
done

- name: 'Bundle self-update package'
if: ${{ !github.event.pull_request.head.repo.fork }}
run: |
set -e
for UPDATEBUNDLE in artifacts/*/
do
BUNDLE_NAME=`echo $UPDATEBUNDLE | cut -d'/' -f2`
echo Packaging ${BUNDLE_NAME}
tar czpf artifacts/flipper-z-${BUNDLE_NAME}.tgz -C artifacts ${BUNDLE_NAME}
done

- name: 'Bundle resources'
if: ${{ !github.event.pull_request.head.repo.fork }}
run: |
Expand Down Expand Up @@ -175,7 +186,7 @@ jobs:

- name: 'Build docker image'
uses: ./.github/actions/docker

- name: 'Generate suffix and folder name'
id: names
run: |
Expand All @@ -185,13 +196,13 @@ jobs:
fi
BRANCH_OR_TAG=${REF#refs/*/}
SHA=$(git rev-parse --short HEAD)

if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
SUFFIX=${BRANCH_OR_TAG//\//_}
else
SUFFIX=${BRANCH_OR_TAG//\//_}-$(date +'%d%m%Y')-${SHA}
fi

echo "WORKFLOW_BRANCH_OR_TAG=${BRANCH_OR_TAG}" >> $GITHUB_ENV
echo "DIST_SUFFIX=${SUFFIX}" >> $GITHUB_ENV

Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@
[submodule "lib/FreeRTOS-Kernel"]
path = lib/FreeRTOS-Kernel
url = https://github.com/FreeRTOS/FreeRTOS-Kernel.git
[submodule "lib/microtar"]
path = lib/microtar
url = https://github.com/amachronic/microtar.git
52 changes: 27 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
PROJECT_ROOT := $(abspath $(dir $(abspath $(firstword $(MAKEFILE_LIST)))))

include $(PROJECT_ROOT)/make/git.mk

COPRO_DIR := $(PROJECT_ROOT)/lib/STM32CubeWB/Projects/STM32WB_Copro_Wireless_Binaries/STM32WB5x

PROJECT_SOURCE_DIRECTORIES := \
$(PROJECT_ROOT)/applications \
$(PROJECT_ROOT)/bootloader/src \
$(PROJECT_ROOT)/bootloader/targets \
$(PROJECT_ROOT)/core \
$(PROJECT_ROOT)/firmware/targets \
$(PROJECT_ROOT)/lib/app-template \
$(PROJECT_ROOT)/lib/app-scened-template \
$(PROJECT_ROOT)/lib/common-api \
$(PROJECT_ROOT)/lib/cyfral \
$(PROJECT_ROOT)/lib/drivers \
$(PROJECT_ROOT)/lib/flipper_file \
$(PROJECT_ROOT)/lib/infrared \
Expand All @@ -34,18 +34,18 @@ endif
include $(PROJECT_ROOT)/make/defaults.mk

.PHONY: all
all: bootloader_all firmware_all
@$(PROJECT_ROOT)/scripts/dist.sh
all: firmware_all
@$(PROJECT_ROOT)/scripts/dist.py copy -t $(TARGET) -p firmware -s $(DIST_SUFFIX)

.PHONY: whole
whole: flash_radio bootloader_flash firmware_flash
whole: flash_radio firmware_flash

.PHONY: clean
clean: bootloader_clean firmware_clean
clean: firmware_clean updater_clean
@rm -rf $(PROJECT_ROOT)/dist/$(TARGET)

.PHONY: flash
flash: bootloader_flash firmware_flash
flash: firmware_flash

.PHONY: debug
debug:
Expand All @@ -60,36 +60,38 @@ wipe:
@$(PROJECT_ROOT)/scripts/flash.py wipe
@$(PROJECT_ROOT)/scripts/ob.py set

.PHONY: bootloader_all
bootloader_all:
@$(MAKE) -C $(PROJECT_ROOT)/bootloader -j$(NPROCS) all

.PHONY: firmware_all
firmware_all:
@$(MAKE) -C $(PROJECT_ROOT)/firmware -j$(NPROCS) all

.PHONY: bootloader_clean
bootloader_clean:
@$(MAKE) -C $(PROJECT_ROOT)/bootloader -j$(NPROCS) clean

.PHONY: firmware_clean
firmware_clean:
@$(MAKE) -C $(PROJECT_ROOT)/firmware -j$(NPROCS) clean

.PHONY: bootloader_flash
bootloader_flash:
ifeq ($(FORCE), 1)
@rm $(PROJECT_ROOT)/bootloader/.obj/f*/flash || true
endif
@$(MAKE) -C $(PROJECT_ROOT)/bootloader -j$(NPROCS) flash

.PHONY: firmware_flash
firmware_flash:
ifeq ($(FORCE), 1)
@rm $(PROJECT_ROOT)/firmware/.obj/f*/flash || true
@rm $(PROJECT_ROOT)/firmware/.obj/f*-firmware/flash || true
endif
@$(MAKE) -C $(PROJECT_ROOT)/firmware -j$(NPROCS) flash


.PHONY: updater
updater:
@$(MAKE) -C $(PROJECT_ROOT)/firmware -j$(NPROCS) RAM_EXEC=1 all

.PHONY: updater_clean
updater_clean:
@$(MAKE) -C $(PROJECT_ROOT)/firmware -j$(NPROCS) RAM_EXEC=1 clean

.PHONY: updater_debug
updater_debug:
@$(MAKE) -C $(PROJECT_ROOT)/firmware -j$(NPROCS) RAM_EXEC=1 debug

.PHONY: updater_package
updater_package: firmware_all updater
@$(PROJECT_ROOT)/scripts/dist.py copy -t $(TARGET) -p firmware updater -s $(DIST_SUFFIX) --bundlever "$(VERSION_STRING)"

.PHONY: flash_radio
flash_radio:
@$(PROJECT_ROOT)/scripts/flash.py core2radio 0x080D7000 $(COPRO_DIR)/stm32wb5x_BLE_Stack_light_fw.bin
Expand All @@ -100,7 +102,7 @@ flash_radio_fus:
@echo
@echo "================ DON'T DO IT ================"
@echo "= Flashing FUS is going to erase secure enclave ="
@echo "= You will loose ability to use encrypted assets ="
@echo "= You will lose ability to use encrypted assets ="
@echo "= type 'find / -exec rm -rf {} \;' ="
@echo "= In case if you still want to continue ="
@echo "================ JUST DON'T ================"
Expand Down
6 changes: 2 additions & 4 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@ Our goal is to create nice and clean code with good documentation, to make it a

[Get Latest Firmware from Update Server](https://update.flipperzero.one/)

Flipper Zero's firmware consists of three components:
Flipper Zero's firmware consists of two components:

- Core2 firmware set - proprietary components by ST: FUS + radio stack. FUS is flashed at factory and you should never update it.
- Core1 Bootloader - controls basic hardware initialization and loads firmware.
- Core1 Firmware - HAL + OS + Drivers + Applications.

All 3 of them must be flashed in order described.

## With STLink

### Core1 Bootloader + Firmware
### Core1 Firmware

Prerequisites:

Expand Down Expand Up @@ -144,7 +143,6 @@ make whole

- `applications` - Applications and services used in firmware
- `assets` - Assets used by applications and services
- `bootloader` - Bootloader source code
- `core` - Furi Core: os level primitives and helpers
- `debug` - Debug tool: GDB-plugins, SVD-file and etc
- `docker` - Docker image sources (used for firmware build automation)
Expand Down
1 change: 1 addition & 0 deletions applications/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
- `system` - System settings, tools and API
- `tests` - Unit tests and etc
- `u2f` - U2F Application
- `updater` - Update service & application

- `application.c` - Firmware application list source
- `application.h` - Firmware application list header
Expand Down
36 changes: 3 additions & 33 deletions applications/about/about.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,10 @@ static DialogMessageButton fw_version_screen(DialogsApp* dialogs, DialogMessage*
} else {
string_cat_printf(
buffer,
"%s [%s]\n%s [%s]\n[%d] %s",
"%s [%s]\n%s%s [%s]\n[%d] %s",
version_get_version(ver),
version_get_builddate(ver),
version_get_dirty_flag(ver) ? "[!] " : "",
version_get_githash(ver),
version_get_gitbranchnum(ver),
version_get_target(ver),
Expand All @@ -135,45 +136,14 @@ static DialogMessageButton fw_version_screen(DialogsApp* dialogs, DialogMessage*
return result;
}

static DialogMessageButton bootloader_version_screen(DialogsApp* dialogs, DialogMessage* message) {
DialogMessageButton result;
string_t buffer;
string_init(buffer);
const Version* ver = furi_hal_version_get_bootloader_version();

if(!ver) {
string_cat_printf(buffer, "No info\n");
} else {
string_cat_printf(
buffer,
"%s [%s]\n%s [%s]\n[%d] %s",
version_get_version(ver),
version_get_builddate(ver),
version_get_githash(ver),
version_get_gitbranchnum(ver),
version_get_target(ver),
version_get_gitbranch(ver));
}

dialog_message_set_header(message, "Boot Version info:", 0, 0, AlignLeft, AlignTop);
dialog_message_set_text(message, string_get_cstr(buffer), 0, 13, AlignLeft, AlignTop);
result = dialog_message_show(dialogs, message);
dialog_message_set_text(message, NULL, 0, 0, AlignLeft, AlignTop);
dialog_message_set_header(message, NULL, 0, 0, AlignLeft, AlignTop);
string_clear(buffer);

return result;
}

const AboutDialogScreen about_screens[] = {
product_screen,
compliance_screen,
address_screen,
icon1_screen,
icon2_screen,
hw_version_screen,
fw_version_screen,
bootloader_version_screen};
fw_version_screen};

const size_t about_screens_count = sizeof(about_screens) / sizeof(AboutDialogScreen);

Expand Down
29 changes: 28 additions & 1 deletion applications/applications.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ extern int32_t notification_srv(void* p);
extern int32_t power_srv(void* p);
extern int32_t storage_srv(void* p);
extern int32_t desktop_srv(void* p);
extern int32_t updater_srv(void* p);

// Apps
extern int32_t accessor_app(void* p);
Expand Down Expand Up @@ -58,6 +59,7 @@ extern void storage_on_system_start();
extern void subghz_on_system_start();
extern void power_on_system_start();
extern void unit_tests_on_system_start();
extern void updater_on_system_start();

// Settings
extern int32_t notification_settings_app(void* p);
Expand Down Expand Up @@ -91,6 +93,9 @@ const FlipperApplication FLIPPER_SERVICES[] = {
#endif

#ifdef SRV_DESKTOP
#ifdef SRV_UPDATER
#error SRV_UPDATER and SRV_DESKTOP are mutually exclusive!
#endif
{.app = desktop_srv, .name = "DesktopSrv", .stack_size = 2048, .icon = NULL},
#endif

Expand All @@ -117,10 +122,28 @@ const FlipperApplication FLIPPER_SERVICES[] = {
#ifdef SRV_STORAGE
{.app = storage_srv, .name = "StorageSrv", .stack_size = 3072, .icon = NULL},
#endif

#ifdef SRV_UPDATER
#ifdef SRV_DESKTOP
#error SRV_UPDATER and SRV_DESKTOP are mutually exclusive!
#endif
{.app = updater_srv, .name = "UpdaterSrv", .stack_size = 2048, .icon = NULL},
#endif
};

const size_t FLIPPER_SERVICES_COUNT = sizeof(FLIPPER_SERVICES) / sizeof(FlipperApplication);

const FlipperApplication FLIPPER_SYSTEM_APPS[] = {
#ifdef APP_UPDATER
#ifdef SRV_UPDATER
#error APP_UPDATER and SRV_UPDATER are mutually exclusive!
#endif
{.app = updater_srv, .name = "UpdaterApp", .stack_size = 2048, .icon = NULL},
#endif
};

const size_t FLIPPER_SYSTEM_APPS_COUNT = sizeof(FLIPPER_SERVICES) / sizeof(FlipperApplication);

// Main menu APP
const FlipperApplication FLIPPER_APPS[] = {

Expand Down Expand Up @@ -199,6 +222,10 @@ const FlipperOnStartHook FLIPPER_ON_SYSTEM_START[] = {
#ifdef APP_UNIT_TESTS
unit_tests_on_system_start,
#endif

#ifdef APP_UPDATER
updater_on_system_start,
#endif
};

const size_t FLIPPER_ON_SYSTEM_START_COUNT =
Expand Down Expand Up @@ -326,4 +353,4 @@ const FlipperApplication FLIPPER_SETTINGS_APPS[] = {
};

const size_t FLIPPER_SETTINGS_APPS_COUNT =
sizeof(FLIPPER_SETTINGS_APPS) / sizeof(FlipperApplication);
sizeof(FLIPPER_SETTINGS_APPS) / sizeof(FlipperApplication);
8 changes: 7 additions & 1 deletion applications/applications.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ extern const size_t FLIPPER_PLUGINS_COUNT;
extern const FlipperApplication FLIPPER_DEBUG_APPS[];
extern const size_t FLIPPER_DEBUG_APPS_COUNT;

/* System apps
* Can only be spawned by loader by name
*/
extern const FlipperApplication FLIPPER_SYSTEM_APPS[];
extern const size_t FLIPPER_SYSTEM_APPS_COUNT;

/* Seperate scene app holder
* Spawned by loader
*/
Expand All @@ -55,4 +61,4 @@ extern const FlipperApplication FLIPPER_ARCHIVE;
* Spawned by loader
*/
extern const FlipperApplication FLIPPER_SETTINGS_APPS[];
extern const size_t FLIPPER_SETTINGS_APPS_COUNT;
extern const size_t FLIPPER_SETTINGS_APPS_COUNT;
Loading