Changes required to build nuttx_px4fmu-v3_default with new upgraded NuttX in PX4 v1.7.2

Hi All,

I am trying to build nuttx_px4fmu-v3_default using make nuttx_px4fmu-v3_default with the NuttX upgraded from nuttx@b180535 to nuttx@ec20f2e.
While running the make command make nuttx_px4fmu-v3_default, I am getting the following error

[10/153] Generating nuttx/include/nuttx/version.h, nuttx/include/nuttx/config.h
FAILED: NuttX/nuttx/include/nuttx/version.h NuttX/nuttx/include/nuttx/config.h 
cd /home/cdev/src/Firmware/build/px4io-v2_default/NuttX/nuttx && make --quiet --no-print-directory context >nuttx_build.log
make[2]: *** [include/arch/board] Error 1
[11/153] Generating uORB topic headers
ninja: build stopped: subcommand failed.
Makefile:153: recipe for target 'px4io-v2_default' failed
make[1]: *** [px4io-v2_default] Error 1
[17/910] Generating nuttx/include/nuttx/version.h, nuttx/include/nuttx/config.h
FAILED: NuttX/nuttx/include/nuttx/version.h NuttX/nuttx/include/nuttx/config.h 
cd /home/cdev/src/Firmware/build/px4fmu-v3_default/NuttX/nuttx && make --quiet --no-print-directory context >nuttx_build.log
make[1]: *** [include/arch/board] Error 1
[19/910] Generating parameters.xml
FAILED: ../px4io-v2_default/nuttx_px4io-v2_default.elf 
cd /home/cdev/src/Firmware && make --no-print-directory px4io-v2_default
[21/910] Generating git hash header
ninja: build stopped: subcommand failed.
Makefile:153: recipe for target 'px4fmu-v3_default' failed

The log file of the build gives the following information:

Create .version
Create version.h
LN: include/arch to arch/arm/include
LN: include/arch/board to /home/cdev/src/Firmware/build/nuttx_px4fmu-v3_default/NuttX/nuttx/boards/arm/stm32/px4fmu-v2/include
No directory at /home/cdev/src/Firmware/build/nuttx_px4fmu-v3_default/NuttX/nuttx/boards/arm/stm32/px4fmu-v2/include
tools/Makefile.unix:340: recipe for target 'include/arch/board' failed

Kindly help me to figure out how can I remove this make issues, and if any changes are required in the make or cmake configurations for PX4v1.7.2, than what changes would be necessary for the same.
@rroche @DevTeam Your support is highly appreciated in this.

I would recogmend using the latest PX4 release. But here is what you would need to do.

Did you use make distclean ?

If you checkout the v1.7.2 tagged version does it build for you?

If so look at the log for changes to the cmake files from that tag until the NuttX commit you want to use and cherry-pick those commits to your branch

Hi @david_s5,
Thank You for your reply.
Yes, I did use make distclean
With the checked out v1.7.2 it builds with the NuttX that came with it but with the upgraded NuttX it fails.
Regrading the cmake. Is there any documentation which I can refer to understand what is the flow of the build/cmake. And could you specify which cmake file changes should I track?