csbluechip / flipperzero_plugin_howto Goto Github PK
View Code? Open in Web Editor NEWA simple plugin for the FlipperZero written as a tutorial example [ie. excessive documentation & error handling]
License: MIT License
A simple plugin for the FlipperZero written as a tutorial example [ie. excessive documentation & error handling]
License: MIT License
Under heading "After the devkit is installed" first line of code sample:
cd ~/flipperZero/official//applications_user
should be:
cd ~/flipperZero/official/applications_user
right?
Thanks for your great work!
Upon attempting to compile the demo; with ./fbt fap_bc_demo.
The terminal returns:
PS C:\Users\MY_USER\flipperZero\official> ./fbt fap_bc_demo
CC applications_user\bc_demo\bc_demo.c
SDKCHK firmware\targets\f7\api_symbols.csv
applications_user\bc_demo\bc_demo.c: In function 'cbDraw':
applications_user\bc_demo\bc_demo.c:123:27: error: implicit declaration of function 'acquire_mutex' [-Werror=implicit-function-declaration]
123 | if ( !(state = (state_t*)acquire_mutex((ValueMutex*)ctx, 25)) ) return ;
| ^~~~~~~~~~~~~
applications_user\bc_demo\bc_demo.c:123:42: error: 'ValueMutex' undeclared (first use in this function)
123 | if ( !(state = (state_t*)acquire_mutex((ValueMutex*)ctx, 25)) ) return ;
| ^~~~~~~~~~
applications_user\bc_demo\bc_demo.c:123:42: note: each undeclared identifier is reported only once for each function it appears in
applications_user\bc_demo\bc_demo.c:123:53: error: expected expression before ')' token
123 | if ( !(state = (state_t*)acquire_mutex((ValueMutex*)ctx, 25)) ) return ;
| ^
applications_user\bc_demo\bc_demo.c:151:2: error: implicit declaration of function 'release_mutex' [-Werror=implicit-function-declaration]
151 | release_mutex((ValueMutex*)ctx, state);
| ^~~~~~~~~~~~~
applications_user\bc_demo\bc_demo.c:151:28: error: expected expression before ')' token
151 | release_mutex((ValueMutex*)ctx, state);
| ^
applications_user\bc_demo\bc_demo.c: In function 'bc_demo':
applications_user\bc_demo\bc_demo.c:530:2: error: unknown type name 'ValueMutex'
530 | ValueMutex mutex = {0};
| ^~~~~~~~~~
applications_user\bc_demo\bc_demo.c:579:7: error: implicit declaration of function 'init_mutex' [-Werror=implicit-function-declaration]
579 | if (!init_mutex(&mutex, state, sizeof(state))) {
| ^~~~~~~~~~
applications_user\bc_demo\bc_demo.c:639:29: error: implicit declaration of function 'acquire_mutex_block' [-Werror=implicit-function-declaration]
639 | if ( !(state = (state_t*)acquire_mutex_block(&mutex)) ) {
| ^~~~~~~~~~~~~~~~~~~
applications_user\bc_demo\bc_demo.c:710:11: error: request for member 'mutex' in something not a structure or union
710 | if (mutex.mutex) {
| ^
applications_user\bc_demo\bc_demo.c:711:3: error: implicit declaration of function 'delete_mutex' [-Werror=implicit-function-declaration]
711 | delete_mutex(&mutex);
| ^~~~~~~~~~~~
applications_user\bc_demo\bc_demo.c:712:8: error: request for member 'mutex' in something not a structure or union
712 | mutex.mutex = NULL;
| ^
cc1.exe: all warnings being treated as errors
scons: *** [build\f7-firmware-D\.extapps\bc_demo\bc_demo.o] Error 1
API version 19.0 is up to date
********** FBT ERRORS **********
build\f7-firmware-D\.extapps\bc_demo\bc_demo.o: Error 1
I am a total noob...
You say to build the fap:
cd ~/flipperZero/official/
./fbt firmware_bc_demo
But I guess you mean:
cd ~/flipperZero/official/
./fbt fap_bc_demo
Trying to get it running on my device, it builds ok with /fbt fap_bc_demo
, but the command:
./fbt launch_app APPSRC=bc_demo
fails with this python backtrace:
TypeError: cannot unpack non-iterable FlipperExternalAppInfo object:
File "/home/flipperzero-firmware/SConstruct", line 49:
firmware_env = distenv.AddFwProject(
File "/home/flipperzero-firmware/toolchain/x86_64-linux/python/lib/python3.9/site-packages/SCons/Util.py", line 737:
return self.method(*nargs, **kwargs)
File "/home/flipperzero-firmware/scripts/fbt_tools/fbt_dist.py", line 42:
project_env = env[fw_env_key] = create_fw_build_targets(base_env, fw_type)
File "/home/flipperzero-firmware/scripts/fbt_tools/fbt_dist.py", line 26:
return env.SConscript(
File "/home/flipperzero-firmware/toolchain/x86_64-linux/python/lib/python3.9/site-packages/SCons/Script/SConscript.py", line 597:
return _SConscript(self.fs, *files, **subst_kw)
File "/home/flipperzero-firmware/toolchain/x86_64-linux/python/lib/python3.9/site-packages/SCons/Script/SConscript.py", line 285:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "/home/flipperzero-firmware/firmware.scons", line 147:
fwenv["FW_EXTAPPS"] = SConscript(
File "/home/flipperzero-firmware/toolchain/x86_64-linux/python/lib/python3.9/site-packages/SCons/Script/SConscript.py", line 660:
return method(*args, **kw)
File "/home/flipperzero-firmware/toolchain/x86_64-linux/python/lib/python3.9/site-packages/SCons/Script/SConscript.py", line 597:
return _SConscript(self.fs, *files, **subst_kw)
File "/home/flipperzero-firmware/toolchain/x86_64-linux/python/lib/python3.9/site-packages/SCons/Script/SConscript.py", line 285:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "/home/flipperzero-firmware/site_scons/extapps.scons", line 101:
app_manifest, fap_file, app_validator = appenv.GetExtAppFromPath(appsrc)
Any idea?
After a fresh download on a newly installed machine (debian 12), ./fbt
generates this error:
PROTO assets/protobuf/application.proto
Traceback (most recent call last):
File "/home/fz/official/./lib/nanopb/generator/nanopb_generator.py", line 51, in <module>
from .proto import nanopb_pb2
ImportError: attempted relative import with no known parent package
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/fz/official/./lib/nanopb/generator/nanopb_generator.py", line 72, in <module>
import proto.nanopb_pb2 as nanopb_pb2
ModuleNotFoundError: No module named 'proto.nanopb_pb2'
scons: *** [build/f7-firmware-D/assets/compiled/application.pb.c] Error 1
********** FBT ERRORS **********
build/f7-firmware-D/assets/compiled/application.pb.c: Error 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.