78 Commits

Author SHA1 Message Date
Willy-JL
4d247f276c SDK: Better support for cmsis-dap --nobuild 2025-04-23 06:40:45 +01:00
Willy-JL
b1a13107de SDK: Improve CLI debugging setup 2025-04-23 02:58:33 +01:00
Willy-JL
7f46fe5d5c Merge remote-tracking branch 'ofw/dev' into mntm-dev --nobuild 2025-04-03 06:19:15 +01:00
Anna Antonenko
13333edd30 [FL-3954, FL-3955] New CLI architecture (#4111)
* feat: FuriThread stdin

* ci: fix f18

* feat: stdio callback context

* feat: FuriPipe

* POTENTIALLY EXPLOSIVE pipe welding

* fix: non-explosive welding

* Revert welding

* docs: furi_pipe

* feat: pipe event loop integration

* update f18 sdk

* f18

* docs: make doxygen happy

* fix: event loop not triggering when pipe attached to stdio

* fix: partial stdout in pipe

* allow simultaneous in and out subscription in event loop

* feat: vcp i/o

* feat: cli ansi stuffs and history

* feat: more line editing

* working but slow cli rewrite

* restore previous speed after 4 days of debugging 🥲

* fix: cli_app_should_stop

* fix: cli and event_loop memory leaks

* style: remove commented out code

* ci: fix pvs warnings

* fix: unit tests, event_loop crash

* ci: fix build

* ci: silence pvs warning

* feat: cli gpio

* ci: fix formatting

* Fix memory leak during event loop unsubscription

* Event better memory leak fix

* feat: cli completions

* Merge remote-tracking branch 'origin/dev' into portasynthinca3/3928-cli-threads

* merge fixups

* temporarily exclude speaker_debug app

* pvs and unit tests fixups

* feat: commands in fals

* move commands out of flash, code cleanup

* ci: fix errors

* fix: run commands in buffer when stopping session

* speedup cli file transfer

* fix f18

* separate cli_shell into modules

* fix pvs warning

* fix qflipper refusing to connect

* remove temp debug logs

* remove erroneous conclusion

* Fix memory leak during event loop unsubscription

* Event better memory leak fix

* unit test for the fix

* improve thread stdio callback signatures

* pipe stdout timeout

* update api symbols

* fix f18, formatting

* fix pvs warnings

* increase stack size, hope to fix unit tests

* cli: revert flag changes

* cli: fix formatting

* cli, fbt: loopback perf benchmark

* thread, event_loop: subscribing to thread flags

* cli: signal internal events using thread flags, improve performance

* fix f18, formatting

* event_loop: fix crash

* storage_cli: increase write_chunk buffer size again

* cli: explanation for order=0

* thread, event_loop: thread flags callback refactor

* cli: increase stack size

* cli: rename cli_app_should_stop -> cli_is_pipe_broken_or_is_etx_next_char

* cli: use plain array instead of mlib for history

* cli: prepend file name to static fns

* cli: fix formatting

* cli_shell: increase stack size

* cli: fix rpc lockup

* cli: better lockup fix

* cli: fix f18

* fix merge

---------

Co-authored-by: Georgii Surkov <georgii.surkov@outlook.com>
Co-authored-by: あく <alleteam@gmail.com>
2025-04-02 22:10:10 +04:00
Willy-JL
28ccf15ece Fix attaching debugger while paused 2025-03-02 03:31:46 +00:00
Willy-JL
54378dfbe0 No more linting extapps, tired of merge conflicts --nobuild 2025-01-20 23:59:17 +00:00
Willy-JL
afdeb312e6 Update apps --nobuild
- FlipSocial: Bug fixes (by jblanked)
- FlipWiFi: Bug fixes (by jblanked)
- KeyCopier: Support for formats AR4, M1, AM7, Y2, Y11, S22, NA25, CO88, LW4, LW5, NA12, RU45, H75, B102, Y159, KA14, YM63, SFIC, RV (by HonestLocksmith)
- Picopass: Save SR as legacy from saved menu (by bettse)
- Pokemon Trade Tool: Bug fixes (by kbembedded)
- uPython: Optimized speaker note constants to save space (by ofabel)
- WebCrawler: New BROWSE option to read HTML pages, many bugfixes (by jblanked)
2025-01-20 23:24:36 +00:00
Willy-JL
a7e9e3955c "Failed to parse source file AST" shut up linter --nobuild 2024-11-21 07:30:01 +00:00
Willy-JL
16859a41b9 Merge remote-tracking branch 'ofw/dev' into mntm-dev 2024-09-06 02:00:42 +02:00
あく
62bbf406be Debug: use proper hook for handle_exit in flipperapps (#3842)
* Debug: use proper hook for handle_exit in flipperapps
* fbt: flash firmware for `blackmagic` target

Co-authored-by: hedger <hedger@nanode.su>
Co-authored-by: Georgii Surkov <37121527+gsurkov@users.noreply.github.com>
2024-09-05 19:55:43 +01:00
Willy-JL
314554fe3b FBT: Only format images in firmware, not ext apps
It was formatting demo screenshots too
There might a better way to detect only icons, but not formatting also means less merge conflicts
2024-08-12 18:33:09 +02:00
Willy-JL
c412d00c3a Merge commit '0b19fd29e665484223bcae5d53f339b832c4c9a1' into yeet-lfs 2024-08-12 18:29:05 +02:00
Sean Skyhawk
41fcead710 Images linting: ensure that all images conform specification (#3802)
* Change all icons to be white background
* assets: re-processed all *.png images to 1-bit
* assets: also stripped profile data from .pngs
* assets: also stripped datetime from metadata (`-define png:exclude-chunks=date,time`)
* scripts: added image linter and formatter; fbt: added `lint_img` && `format_img` targets; github: integrated image lint step into CI
* scripts: imglint: fixed deprecation warning
* images: applied `format_img`
* fbt: added `lint_all` and `format_all` targets; docs: updated for new targets

Co-authored-by: hedger <hedger@nanode.su>
Co-authored-by: hedger <hedger@users.noreply.github.com>
2024-08-07 11:57:32 +09:00
Willy-JL
02f7207d28 Merge remote-tracking branch 'ofw/dev' into mntm-dev 2024-07-15 22:18:35 +01:00
hedger
1a8f6dbed8 toolchain: v38; clangd as default language server (#3774)
* libs: removed cxxheaderparser submodule, expecting one from toolchain
* toolchain: v38
* vscode: now using clangd from toolchain
* vscode: clangd path in config is now generated by fbt
* vscode, fbt: improved clangd path generation
* fbt: fixed LANG_SERVER handling; switched to clangd as default
* vscode: removed deprecated options from config
* ufbt: project template: updated clang-format, added clangd config
* ufbt: now using clangd as default language server
* ufbt: now using clangd as default language server
2024-07-15 10:56:21 +09:00
Willy-JL
514171d0c5 Merge branch 'dev' of https://github.com/flipperdevices/flipperzero-firmware into mntm-dev 2024-04-02 15:36:43 +01:00
hedger
d32f195557 fbt: fixed missing FBT_FAP_DEBUG_ELF_ROOT to dist env (#3563) 2024-04-02 20:30:42 +09:00
Willy-JL
46ec8e2b8e Merge branch 'dev' of https://github.com/flipperdevices/flipperzero-firmware into mntm-dev 2024-03-22 21:24:42 +00:00
hedger
6947d3dea2 BLE/GAP fixes (#3533)
* hal: fixed ble_gap race on queue init
* fbt: removed deprecated path_as_posix
* hal: fixed inconsistencies between f7/f18 APIs
* hal: fixed excessively strict event handler re-init checks

Co-authored-by: あく <alleteam@gmail.com>
2024-03-22 21:36:05 +09:00
Willy-JL
d610e20060 Merge branch 'dev' of https://github.com/flipperdevices/flipperzero-firmware into mntm-dev 2024-03-21 02:07:27 +00:00
Silent
4039ccbcca fbt/ufbt: Ensure POSIX paths are passed to GDB on all platforms (#3360)
* fbt/ufbt: Ensure POSIX paths are passed to GDB on all platforms
  GDB heavily dislikes forward slashes from Windows paths and strips
  them internally instead of normalizing them. Account for this by
  passing POSIX paths explicitly.
* fbt: different approach for posix path handling
* fbt, ufbt: further fixes for path handling
* fbt: explicit path stringification
* linter fixes

Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: hedger <hedger@nanode.su>
Co-authored-by: あく <alleteam@gmail.com>
2024-03-21 07:36:38 +09:00
hedger
ee36c66572 fbt: doxygen target (#3510)
* fbt: doxygen target
* github: adjustments for doxygen
* github: always generate docs, only upload for dev
* doxygen: fixed exclusion path for awesome-css
* github: stricter check for push ref
* github: bumped action version to fix node.js deprecation
* github: added PVS report url to workflow summary
* github: pvs: reworked report URL handling
* github: added size report to summary
* docs: added `doxygen` target
* fbt: common naming scheme for COMSTR
* Documentation: fix warnings and errors
* Doxygen: stricter warning checks
* fbt: "doxy" target, opens generated doxygen documentation in browser
* github: doxygen: now using edge (1.10) version

Co-authored-by: あく <alleteam@gmail.com>
2024-03-21 01:32:53 +09:00
Willy-JL
061f19ddf9 Merge branch 'dev' of https://github.com/flipperdevices/flipperzero-firmware into dev 2024-03-03 04:17:32 +00:00
Sergei Gavrilov
4b7ca736d6 WiFi board: fixed update script on Windows (unfortunately also Mac and Linux) (#3485)
* WiFi board update: windows fix

* Scripts: add python\Scripts to the path

* Windows: another way to call esptool

* Aaaaaand once more!

* logz

* wifi board scripts: udev rule, dev channel

* fbt: added ARGS variable for passing extra options to certain scripts; removed `devboard_flash_dev` in favor of `devboard_flash ARGS="-c dev"`

* fbt: fully removed `devboard_flash_dev

* scripts: wifi_board.py: cleanup

* ufbt: ported ARGS for supported targets to ufbt

* docs: updated for ARGS=...

---------

Co-authored-by: hedger <hedger@nanode.su>
Co-authored-by: hedger <hedger@users.noreply.github.com>
2024-03-01 15:58:15 +04:00
Willy-JL
4ce344ff82 Merge branch 'dev' of https://github.com/DarkFlippers/unleashed-firmware into dev 2024-01-13 02:36:39 +00:00
MX
81efe25a6e Merge branch 'ofw_dev' into dev 2024-01-12 15:39:40 +03:00
hedger
0789cbdefa assets: checking limits on image size; ufbt: cdb target (#3359)
* scripts: assets: checking limits on image size
* ufbt: added "cdb" target for regenerating; also generating cdb on "vscode_dist"
* fbt: now also creating cdb for vscode_dist

Co-authored-by: あく <alleteam@gmail.com>
2024-01-12 17:58:37 +09:00
Willy-JL
1620dc011c Fix handling spaces in path
found by @LeeroysHub
2023-12-10 02:30:45 +00:00
Willy-JL
05ae0dbf14 Merge branch 'dev' of https://github.com/flipperdevices/flipperzero-firmware into dev 2023-12-02 06:09:01 +00:00
MX
00ceb2cd5d Merge branch 'ofw_dev' into dev 2023-12-01 20:29:16 +03:00
hedger
890c9e87ce [FL-3690] Libraries cleanup; u2f crypto rework to use mbedtls (#3234)
* examples: plugins: utilize fal_embedded
* libs: removed fnv1a_hash
* furi: added FURI_PACKED; apps, libs: changed to use FURI_PACKED
* lib: mbedtls: using custom config
* lib: toolbox: removed md5, switched to mbedtls
* targets: f18: link fix
* lib: added mbedtls_cfg.h
* apps: nfc: explicit dependency on libmbedtls
* u2f: reworking to mbedtls
* u2f: replaced sha256 & hmac with mbedtls
* u2f: functional rework using mbedtls
* libs: dropped micro-ecc
* u2f: dropped old implementation
* toolbox: removed sha256 impl
* mcheck() for mbedtls
* libs: removed libmisc; split into smaller libs
* apps: debug: fixed display_test
* apps: include cleanups
* fbt: fixed VERSIONCOMSTR
* furi: added FURI_CHECK_RETURN
* lib: removed qrcode
* cleanup
* fbt: lint_py+format_py: fixed excessive command length
* api: Removed bzero from f7
* api: Removed bzero from f18
* Bump API Symbols

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-12-01 18:16:48 +09:00
MX
a64c9534e2 Merge branch 'ofw_dev' into dev 2023-11-17 02:20:27 +03:00
Willy-JL
a4d01d5d88 Merge branch 'dev' of https://github.com/flipperdevices/flipperzero-firmware into xfw-dev 2023-11-16 02:19:28 +00:00
hedger
98d5718ec9 fbt: improvements (#3217)
* fbt: changed cdefines & lib handling for external apps; added extra checks for app manifest fields; moved around AppsC generator
* fbt: commandline fixes for spaces in paths
* fbt: fixed stringification for FAP_VERSION
* fbt: Removed excessive quoting for gdb
* docs: update for cdefines; fbt: typo fix
* fbt: enforcing at least 2 components in app version=

Co-authored-by: あく <alleteam@gmail.com>
2023-11-16 01:27:35 +09:00
Willy-JL
418f44fef1 Merge branch 'dev' of https://github.com/flipperdevices/flipperzero-firmware into xfw-dev 2023-11-12 02:56:30 +00:00
MX
32e2cbe60a Merge branch 'ofw_dev' into nfcrefactoring 2023-11-08 15:14:30 +04:00
hedger
0d94abf856 fbt: dist improvements (#3186)
* fbt: MENUEXTERNAL apps now respect build configuration; fixed `fap_deploy`
* fbt, ufbt: better message for missing app manifests (shows real paths)

Co-authored-by: あく <alleteam@gmail.com>
2023-11-02 22:28:39 +09:00
MX
bee48f483c Merge branch 'ofw_dev' into nfcrefactoring 2023-11-01 21:07:33 +03:00
hedger
917410a0a8 [FL-3629] fbt: reworked assets & resources handling (#3160)
* fbt: reworking targets & assets handling WIP
* fbt: dist fixes
* fbt: moved SD card resources to owning apps
* unit_tests: moved resources to app folder
* github: updated unit_tests paths
* github: packaging fixes
* unit_tests: fixes
* fbt: assets: internal cleanup
* fbt: reworked assets handling
* github: unit_tests: reintroducing fixes
* minor cleanup
* fbt: naming changes to reflect private nature of scons tools
* fbt: resources: fixed dist archive paths
* docs: updated paths
* docs: updated more paths
* docs: included "resources" parameter in app manifest docs; updated assets readme
* updated gitignore for assets
* github: updated action versions
* unit_tests: restored timeout; scripts: assets: logging changes
* gh: don't upload desktop animations for unit test run

Co-authored-by: あく <alleteam@gmail.com>
2023-10-31 00:17:30 +09:00
MX
8f5ea2be83 Merge branch 'ofw_dev' into dev 2023-09-19 17:27:48 +03:00
あく
338fc3afea New clock switch schema, fixes random core2 crashes (#3008)
* Updated stack to 1.17.0

* hal: ble: Fixed stack config

* Bumped stack version in config

* scripts: added validation of copro stack version in update bundles

* Copro: update to 1.17.2

* FuriHal: adjust tick frequency for HSE as sys clk

* FuriHal: adjust systick reload on sys clock change

* Sync api and format sources

* scripts: updated ob.data for newer stack

* FuriHal: return core2 hse pll transition on deep sleep

* FuriHal: cleanup ble glue

* FuriHal: rework ble glue, allow shci_send in critical section

* FuriHal: sync api symbols

* FuriHal: cleanup BLE glue, remove unused garbage and duplicate declarations

* FuriHal: BLE glue cleanup, 2nd iteration

* FuriHal: hide tick drift reports under FURI_HAL_OS_DEBUG

* Lib: sync stm32wb_copro with latest dev

* FuriHal: ble-glue, slightly less editable device name and duplicate definition cleanup

* FuriHal: update ble config options, enable some optimizations and ext adv

* FuriHal: update clock switch method documentation

* FuriHal: better SNBRSA bug workaround fix

* FuriHal: complete comment about tick skew

* FuriHal: proper condition in clock hsi2hse transition

* FuriHal: move PLL start to hse2pll routine, fix lockup caused by core2 switching to HSE before us

* FuriHal: explicit HSE start before switch

* FuriHal: fix documentation and move flash latency change to later stage, remove duplicate LL_RCC_SetRFWKPClockSource call

---------

Co-authored-by: hedger <hedger@nanode.su>
Co-authored-by: hedger <hedger@users.noreply.github.com>
2023-09-19 18:22:21 +04:00
MX
20593d56c0 Merge branch 'ofw-dev' into dev 2023-08-22 21:53:50 +03:00
hedger
ace0901125 [FL-3486,FL-3392] fbt: various improvements and bug fixes (#2982)
* fbt: extapps: compact debug format for .faps
* fbt: sdk: fixed symbol cache regen logic for removed-only symbols
* lib: elf_file: early .fap file handle release
* fbt: extapps: added FAP_VERSION define for application environments
* github: added appsymbols artifact
* api: updates for f18
* github: fixed early fap_dist
* fbt: added flash_dap
* ufbt: added flash_dap
* fbt: reworked flash target; scripts: program.py->fwflash.py and changes
* vscode: updated configuration
* scripts: fwflash.py: ugly fixes for ufbt
* scripts: fwflash.py: cleanup
* fbt: flash: always use .elf file
* scripts: fwflash: fixed elf file path

Co-authored-by: あく <alleteam@gmail.com>
2023-08-23 03:33:10 +09:00
MX
15ac511dea Merge branch 'ofw-dev' into dev 2023-08-16 16:52:43 +03:00
dogtopus
a7f0f5ad27 Improve vscode clangd experience (#2431)
* Improve vscode clangd experience

- Resolve and use absolute path for the toolchain. This allows clangd to use compile_commands.json file without running under fbtenv, simplifies setup for vscode clangd extension. As a side effect, a rebuild is needed to update compile_commands.json after moving the source tree.
- Add the recommended default settings of the extension to settings.json.

* Use build/latest for compile-commands-dir

This makes it behave closer to c-cpp-properties.

* Reformat crosscc.py

This is a PEP-8 violation but black seems to enforce it

* Bypass --query-driver

This has some security implications as it grants clangd the ability to execute any executables anywhere while trying to probe a compiler based on CDB. However it's very hard to do this the safe and intended way without resorting to config generation due to reason listed in #2431. Besides that we already have workspace trust so what could go wrong? ;)

* Add an option for vscode_dist to switch between clangd and cpptools

This will install different extensions.json tuned for either clangd or cpptools based on user selection. It will also install c_cpp_properties.json when using cpptools since clangd doesn't use this file.

The root .gitignore now also doesn't accidentally ignore everything under the .vscode directory.

* Use absolute path for .vscode gitignore

Turns out the previously used "relative" paths aren't even valid gitignore patterns and to actually do what it means one needs to use the absolute paths instead.

* Handle variable parsing in commandline.scons

commandline.scons is the place where all other command line parsing happens. Move LANG_SERVER variable parsing there and add a constraint to make the code more consistent.

---------

Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: hedger <hedger@nanode.su>
2023-08-16 05:23:09 +04:00
Sergey Gavrilov
3aad84aa70 FBT: devboard_flash to update WiFi devboard (#2968) 2023-08-11 17:56:13 +03:00
Sergey Gavrilov
c40e4ba01e FBT: devboard_flash to update WiFi devboard (#2968) 2023-08-10 18:53:12 +09:00
MX
18220515b5 Merge branch 'ofw-dev' into dev 2023-06-08 14:58:46 +03:00
hedger
436194e6c7 [FL-3346] fbt: added Flipper selection when multiple are connected over USB (#2723)
* fbt: added Flipper selection when multiple are connected over USB
* scripts: serial_cli: added --port (-p) option
2023-06-08 13:47:27 +09:00
MX
face4bd3c7 Merge branch 'fz-dev' into dev 2023-05-09 18:28:46 +03:00