A way to have "make px4_fmu-v3_default" recognize px4io changes

Is there a way to change the makefile so that the command “make px4_fmu-v3_default” recognizes px4io changes (like modifying the mixer file) and only rebuilds the necessary files?

Currently I have to “make clean” and rebuild the entire project if I make a change to the mixer - which is adding quite a bit of time.

Thanks for raising this, I think it’s a bug. The dependency should be set in some cmake file.

The px4iofirmware is added here:

We then depend on it here:

We then depend in a add_custom_command on a thing created by a add_custom_target:

I think this doesn’t work, instead we should introduce a .stamp file in-between. Check this blog post for more information.

I can try to fix this next week if you don’t beat me to it.

Otherwise for faster clean builds in the meantime I suggest to try ccache, it works great and is much faster for this sort of clean build.

1 Like

Ok, thanks, I’ll look into ccache.

A simple example of this issue is changing the debug comments in mixer_multirotor.cpp by commenting line 77 and uncommenting lines 79 and 80 (also fixing the syslog arguments)

//#define debug(fmt, args...)   do { } while(0)
//#define debug(fmt, args...)   do { printf("[mixer] " fmt "\n", ##args); } while(0)
#include <debug.h>
#define debug(fmt, args...)     syslog(0,fmt "\n", ##args)

using “make px4_fmu-v3_default upload” and the debug output won’t appear from the io debug port. I had to do “make clean” first to see that output.

I use FTDI cable,but I cant see the debug message, Could you give me some advise??

my question is here
see debug output

we can do this manually

make px4_io-v2_default

copy
\build\px4_io-v2_default\px4_io-v2_default.elf
to
\build\px4_fmu-v5_default\external\Build\px4io_firmware
delete
\build\px4_fmu-v5_default\romfs_extras\px4_io-v2_default.bin
\build\px4_fmu-v5_default\genromfs\extras\px4_io-v2_default.bin
and
make px4_fmu-v5_default upload

or write some script to do this

hope this can save a little time

1 Like

Perfect. Yeah, I’ll make an alias for this

So do I understand it right that this is a workaround because the dependency is not working correctly in our cmake build system?

Yes, as a new player, I can’t give useful advise to improve the makefile, so far…embarrassed

To workaround it is a temporary choise.

No that’s fine just wanted to be sure!

Unfortunately, it is a known issue: https://github.com/PX4/Firmware/issues/11036