Hi @Eric-Katzfey,
We had some finds.
Here's what we've understood so far:
- Two things are needed to make a voxl-px4 package using px4-firmware(voxl-dev)
modalai_rb5-flight_default
modalai_rb5-flight_qurt
- And each one needs the following different crsf_parse function
modalai_rb5-flight_default
needscrsf_parse
(6 arguments)modalai_rb5-flight_qrut
needscrsf_parse
(8 arguments)
- Each px4-firmware has a different version of
crsf_parse
- Branch: main has
crsf_parse
(6 arguments) - Branch: voxl-dev has
crsf_parse
(8 arguments)
- Branch: main has
Our goal was to build the voxl-px4 included MicroRTPS_bridge in px4-firmware(branch: voxl-dev), so we added the following two functions to crsf.cpp in px4-firmware.
bool crsf_parse_buffer(uint16_t *values, uint16_t *num_values, uint16_t max_channels)
- as
crsf_parse_buffer_6
- as
bool crsf_parse(const uint64_t now, const uint8_t *frame, unsigned len, uint16_t *values, uint16_t *num_values, uint16_t max_channels)
- as
crsf_parse_6
- as
Then the build progressed to 89% and stopped with an error below.
ERROR #1
[ 89%] Building CXX object src/systemcmds/pwm/CMakeFiles/systemcmds__pwm.dir/pwm.cpp.o
/usr/local/workspace/px4-firmware/src/systemcmds/pwm/pwm.cpp: In function 'int pwm_main(int, char**)':
/usr/local/workspace/px4-firmware/src/systemcmds/pwm/pwm.cpp:810:3: error: 'qurt_loop' was not declared in this scope
810 | qurt_loop = 320;
| ^~~~~~~~~
compilation terminated due to -Wfatal-errors.
make[3]: *** [src/systemcmds/pwm/CMakeFiles/systemcmds__pwm.dir/build.make:63: src/systemcmds/pwm/CMakeFiles/systemcmds__pwm.dir/pwm.cpp.o] Error 1
make[3]: Leaving directory '/usr/local/workspace/px4-firmware/build/modalai_rb5-flight_default'
make[2]: *** [CMakeFiles/Makefile2:12085: src/systemcmds/pwm/CMakeFiles/systemcmds__pwm.dir/all] Error 2
make[2]: Leaving directory '/usr/local/workspace/px4-firmware/build/modalai_rb5-flight_default'
make[1]: *** [Makefile:152: all] Error 2
make[1]: Leaving directory '/usr/local/workspace/px4-firmware/build/modalai_rb5-flight_default'
make: *** [Makefile:222: modalai_rb5-flight_default] Error 2
We changed the int qurt_loop
variable's scope to like this.
- Before
- After
After that, an error occurred for the label for jump, and it was resolved by changing it as follows.
ERROR #2
[ 89%] Building CXX object src/systemcmds/pwm/CMakeFiles/systemcmds__pwm.dir/pwm.cpp.o
/usr/local/workspace/px4-firmware/src/systemcmds/pwm/pwm.cpp: In function 'int pwm_main(int, char**)':
/usr/local/workspace/px4-firmware/src/systemcmds/pwm/pwm.cpp:864:1: error: jump to label 'err_out_no_test_2'
864 | err_out_no_test_2:
| ^~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
make[3]: *** [src/systemcmds/pwm/CMakeFiles/systemcmds__pwm.dir/build.make:63: src/systemcmds/pwm/CMakeFiles/systemcmds__pwm.dir/pwm.cpp.o] Error 1
make[3]: Leaving directory '/usr/local/workspace/px4-firmware/build/modalai_rb5-flight_default'
make[2]: *** [CMakeFiles/Makefile2:12085: src/systemcmds/pwm/CMakeFiles/systemcmds__pwm.dir/all] Error 2
make[2]: Leaving directory '/usr/local/workspace/px4-firmware/build/modalai_rb5-flight_default'
make[1]: *** [Makefile:152: all] Error 2
make[1]: Leaving directory '/usr/local/workspace/px4-firmware/build/modalai_rb5-flight_default'
So we changed the goto
command to "return 0" instead of using err_out_no_test_2
label.
After that, the build.sh
worked and the make_packages.sh
also worked.(in the voxl-px4
)
However, it did not run with the following error on voxl2.
ERROR #3
voxl2:~$ voxl-px4
Found DSP signature file
/usr/bin/voxl-px4: line 42: /usr/bin/px4: cannot execute binary file: Exec format error
Based on the above results, we think the voxl-px4 with microRTPS_bridge can be built by changing modalai_rb5-flight_default
and modalai_rb5-flight_qurt
to use the same crsf_parse
.
So if you think our thinking is correct, can you give us some guidance?
If it is not possible in px4-firmware(branch: voxl-dev), can we build voxl-px4(included micrortps_bridge) using another branch?
Any advice would be appreciated.