Skip to content

Commit

Permalink
Merge branch 'release-candidate' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
skotopes committed Dec 15, 2021
2 parents 1060f7b + 5a0f7e2 commit 06ad321
Show file tree
Hide file tree
Showing 293 changed files with 9,345 additions and 3,764 deletions.
24 changes: 13 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,16 @@ jobs:
echo "::set-output name=short-hash::${SHA}"
echo "::set-output name=default-target::${DEFAULT_TARGET}"
- name: 'Bundle scripts'
if: ${{ !github.event.pull_request.head.repo.fork }}
run: |
tar czpf artifacts/flipper-z-any-scripts-${{steps.names.outputs.suffix}}.tgz scripts
- name: 'Build the firmware in docker'
uses: ./.github/actions/docker
with:
run: |
set -e
for TARGET in ${TARGETS}
do
make TARGET=${TARGET}
Expand All @@ -87,11 +93,18 @@ jobs:
uses: ./.github/actions/docker
with:
run: |
set -e
for TARGET in ${TARGETS}
do
mv dist/${TARGET}/* artifacts/
done
- name: 'Bundle resources'
if: ${{ !github.event.pull_request.head.repo.fork }}
run: |
./scripts/assets.py manifest assets/resources
tar czpf artifacts/flipper-z-any-resources-${{steps.names.outputs.suffix}}.tgz -C assets resources
- name: 'Bundle core2 firmware'
if: ${{ !github.event.pull_request.head.repo.fork }}
run: |
Expand All @@ -100,17 +113,6 @@ jobs:
./scripts/assets.py copro lib/STM32CubeWB core2_firmware STM32WB5x
tar czpf artifacts/flipper-z-any-core2_firmware-${{steps.names.outputs.suffix}}.tgz core2_firmware
- name: 'Bundle scripts'
if: ${{ !github.event.pull_request.head.repo.fork }}
run: |
tar czpf artifacts/flipper-z-any-scripts-${{steps.names.outputs.suffix}}.tgz scripts
- name: 'Bundle resources'
if: ${{ !github.event.pull_request.head.repo.fork }}
run: |
./scripts/assets.py manifest assets/resources
tar czpf artifacts/flipper-z-any-resources-${{steps.names.outputs.suffix}}.tgz -C assets resources
- name: 'Upload artifacts to update server'
if: ${{ !github.event.pull_request.head.repo.fork }}
uses: burnett01/[email protected]
Expand Down
3 changes: 2 additions & 1 deletion Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ brew "protobuf"
brew "heatshrink"
brew "open-ocd"
brew "clang-format"
brew "dfu-util"
brew "dfu-util"
brew "imagemagick"
33 changes: 17 additions & 16 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,40 @@ Our goal is to create nice and clean code with good documentation, to make it a

Flipper Zero's firmware consists of three components:

- Core2 firmware set - proprietary components by ST: FUS + radio stack.
- Core1 Bootloader - controls basic hardware initialization and loads firmware
- Core1 Firmware - HAL + OS + Drivers + Applications
- 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

### Core2 flashing procedures
### Core1 Bootloader + Firmware

Prerequisites:

- Linux / macOS
- Terminal
- STM32_Programmer_CLI added to $PATH
- [arm-gcc-none-eabi](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads)
- openocd

One liner: `./flash_core2_ble.sh`
One liner: `make flash`

### Core1 Bootloader + Firmware
### Core2 flashing procedures

Prerequisites:

- Linux / macOS
- Terminal
- [arm-gcc-none-eabi](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads)
- openocd
- STM32_Programmer_CLI (v2.5.0) added to $PATH

One liner: `./flash_core1_main.sh`
One liner: `make flash_radio`

## With USB DFU

1. Download latest [Firmware](https://update.flipperzero.one)

2. Reboot Flipper to Bootloader
2. Reboot Flipper to Bootloader
- Press and hold `← Left` + `↩ Back` for reset
- Release `↩ Back` and keep holding `← Left` until blue LED lights up
- Release `← Left`
Expand All @@ -61,9 +61,10 @@ One liner: `./flash_core1_main.sh`

1. Install [Docker Engine and Docker Compose](https://www.docker.com/get-started)
2. Prepare the container:
```sh
docker-compose up -d
```

```sh
docker-compose up -d
```

## Compile everything

Expand Down Expand Up @@ -148,7 +149,7 @@ make whole
* cli - Console service
* debug_tools - different tools that we use on factory and for debug
* dialogs - service for showing GUI dialogs
* dolphin - dolphin service and supplientary apps
* dolphin - dolphin service and supplementary apps
* gpio-tester - GPIO control application
* gui - GUI service
* ibutton - ibutton application, onewire keys and more
Expand Down Expand Up @@ -187,7 +188,7 @@ make whole
* app-scened-template - scened template app library
* app-template - template app library
* callback-connector - callback connector library
* common-api - common api delaration library
* common-api - common api declaration library
* cyfral - cyfral library
* drivers - drivers that we wrote
* fatfs - external storage file system
Expand Down
11 changes: 10 additions & 1 deletion applications/applications.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ extern int32_t keypad_test_app(void* p);
extern int32_t lfrfid_app(void* p);
extern int32_t lfrfid_debug_app(void* p);
extern int32_t nfc_app(void* p);
extern int32_t passport_app(void* p);
extern int32_t scened_app(void* p);
extern int32_t storage_test_app(void* p);
extern int32_t subghz_app(void* p);
extern int32_t usb_mouse_app(void* p);
extern int32_t usb_test_app(void* p);
extern int32_t vibro_test_app(void* p);
extern int32_t ble_keyboard_app(void* p);

// Plugins
extern int32_t music_player_app(void* p);
Expand Down Expand Up @@ -151,7 +153,6 @@ const FlipperApplication FLIPPER_APPS[] = {
#ifdef APP_BAD_USB
{.app = bad_usb_app, .name = "Bad USB", .stack_size = 2048, .icon = &A_BadUsb_14},
#endif

};

const size_t FLIPPER_APPS_COUNT = sizeof(FLIPPER_APPS) / sizeof(FlipperApplication);
Expand Down Expand Up @@ -218,6 +219,10 @@ const size_t FLIPPER_PLUGINS_COUNT = sizeof(FLIPPER_PLUGINS) / sizeof(FlipperApp

// Plugin menu
const FlipperApplication FLIPPER_DEBUG_APPS[] = {
#ifdef APP_BLE_KEYBOARD
{.app = ble_keyboard_app, .name = "BLE keyboard demo", .stack_size = 1024, .icon = NULL},
#endif

#ifdef APP_BLINK
{.app = blink_test_app, .name = "Blink Test", .stack_size = 1024, .icon = NULL},
#endif
Expand Down Expand Up @@ -303,6 +308,10 @@ const FlipperApplication FLIPPER_SETTINGS_APPS[] = {
{.app = desktop_settings_app, .name = "Desktop", .stack_size = 1024, .icon = NULL},
#endif

#ifdef APP_PASSPORT
{.app = passport_app, .name = "Passport", .stack_size = 1024, .icon = NULL},
#endif

#ifdef APP_ABOUT
{.app = about_settings_app, .name = "About", .stack_size = 1024, .icon = NULL},
#endif
Expand Down
20 changes: 19 additions & 1 deletion applications/applications.mk
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ APP_LF_RFID = 1
APP_NFC = 1
APP_SUBGHZ = 1
APP_ABOUT = 1
APP_PASSPORT = 1

# Plugins
APP_MUSIC_PLAYER = 1
Expand All @@ -46,7 +47,7 @@ APP_SD_TEST = 1
APP_VIBRO_TEST = 1
APP_USB_TEST = 1
APP_DISPLAY_TEST = 1

APP_BLE_KEYBOARD = 1
APP_USB_MOUSE = 1
APP_BAD_USB = 1
APP_UART_ECHO = 1
Expand Down Expand Up @@ -100,6 +101,13 @@ SRV_GUI = 1
endif


APP_PASSPORT ?= 0
ifeq ($(APP_PASSPORT), 1)
CFLAGS += -DAPP_PASSPORT
SRV_GUI = 1
endif


APP_LF_RFID ?= 0
ifeq ($(APP_LF_RFID), 1)
CFLAGS += -DAPP_LF_RFID
Expand Down Expand Up @@ -159,6 +167,12 @@ CFLAGS += -DAPP_BAD_USB
SRV_GUI = 1
endif

APP_BLE_KEYBOARD ?=0
ifeq ($(APP_BLE_KEYBOARD), 1)
CFLAGS += -DAPP_BLE_KEYBOARD
SRV_GUI = 1
endif

APP_KEYPAD_TEST ?= 0
ifeq ($(APP_KEYPAD_TEST), 1)
CFLAGS += -DAPP_KEYPAD_TEST
Expand Down Expand Up @@ -223,6 +237,10 @@ endif
SRV_DOLPHIN ?= 0
ifeq ($(SRV_DOLPHIN), 1)
CFLAGS += -DSRV_DOLPHIN
SRV_DOLPHIN_STATE_DEBUG ?= 0
ifeq ($(SRV_DOLPHIN_STATE_DEBUG), 1)
CFLAGS += -DSRV_DOLPHIN_STATE_DEBUG
endif
endif


Expand Down
Loading

0 comments on commit 06ad321

Please sign in to comment.