Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse
Brand Logo

ModalAI Forum

  1. ModalAI Support Forum
  2. Software Development
  3. PX4 Build broken for SITL Targets

PX4 Build broken for SITL Targets

Scheduled Pinned Locked Moved Software Development
2 Posts 2 Posters 974 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    ejohnson
    wrote on last edited by
    #1

    I would like to conduct SITL testing on the same PX4 commit I am deploying to my voxl. I have noticed that the SITL targets for both JMAVSim and JSBSim are failing to build.

    I have been able to get my SITL platforms to build, but I have not been able to do it with out breaking the Voxl target. Here is a PR with change I made to get the SITL targets building.
    https://github.com/modalai/px4-firmware/pull/61

    I think the main issue are pound defines like the following

    #if PX4_SOC_ARCH_ID == PX4_SOC_ARCH_ID_VOXL2
    #include "fc_sensor.h"
    #endif
    

    PX4_SOC_ARCH_ID_VOXL2 is defined in the following enum

    typedef enum PX4_SOC_ARCH_ID_t {
    
    	PX4_SOC_ARCH_ID_UNUSED         =  0x0000,
    
    	PX4_SOC_ARCH_ID_STM32F4        =  0x0001,
    	PX4_SOC_ARCH_ID_STM32F7        =  0x0002,
    	PX4_SOC_ARCH_ID_KINETISK66     =  0x0003,
    	PX4_SOC_ARCH_ID_SAMV7          =  0x0004,
    	PX4_SOC_ARCH_ID_NXPIMXRT1062   =  0x0005,
    
    	PX4_SOC_ARCH_ID_STM32H7        =  0x0006,
    
    	PX4_SOC_ARCH_ID_NXPS32K146     =  0x0007,
    	PX4_SOC_ARCH_ID_NXPS32K344     =  0x0008,
    
    	PX4_SOC_ARCH_ID_EAGLE          =  0x1001,
    	PX4_SOC_ARCH_ID_QURT           =  0x1002,
    
    	PX4_SOC_ARCH_ID_RPI            =  0x1004,
    	PX4_SOC_ARCH_ID_SIM            =  0x1005,
    	PX4_SOC_ARCH_ID_SITL           =  0x1006,
    
    	PX4_SOC_ARCH_ID_BBBLUE         =  0x1008,
    
    	PX4_SOC_ARCH_ID_VOXL2          =  0x100A,
    
    } PX4_SOC_ARCH_ID_t;
    

    The problem is that enums are not evaluated by the preprocessor. Therefore, when the preprocessor encounters the macro evaluation, PX4_SOC_ARCH_ID and PX4_SOC_ARCH_ID_VOXL2 are not recognized as they are part of an enum. As a result, #include "fc_sensor.h" is always included, regardless of the board type.

    Would someone from the dev team be able to suggest a better way to create the macro?

    Thanks in advance!

    Eric KatzfeyE 1 Reply Last reply
    0
    • E ejohnson

      I would like to conduct SITL testing on the same PX4 commit I am deploying to my voxl. I have noticed that the SITL targets for both JMAVSim and JSBSim are failing to build.

      I have been able to get my SITL platforms to build, but I have not been able to do it with out breaking the Voxl target. Here is a PR with change I made to get the SITL targets building.
      https://github.com/modalai/px4-firmware/pull/61

      I think the main issue are pound defines like the following

      #if PX4_SOC_ARCH_ID == PX4_SOC_ARCH_ID_VOXL2
      #include "fc_sensor.h"
      #endif
      

      PX4_SOC_ARCH_ID_VOXL2 is defined in the following enum

      typedef enum PX4_SOC_ARCH_ID_t {
      
      	PX4_SOC_ARCH_ID_UNUSED         =  0x0000,
      
      	PX4_SOC_ARCH_ID_STM32F4        =  0x0001,
      	PX4_SOC_ARCH_ID_STM32F7        =  0x0002,
      	PX4_SOC_ARCH_ID_KINETISK66     =  0x0003,
      	PX4_SOC_ARCH_ID_SAMV7          =  0x0004,
      	PX4_SOC_ARCH_ID_NXPIMXRT1062   =  0x0005,
      
      	PX4_SOC_ARCH_ID_STM32H7        =  0x0006,
      
      	PX4_SOC_ARCH_ID_NXPS32K146     =  0x0007,
      	PX4_SOC_ARCH_ID_NXPS32K344     =  0x0008,
      
      	PX4_SOC_ARCH_ID_EAGLE          =  0x1001,
      	PX4_SOC_ARCH_ID_QURT           =  0x1002,
      
      	PX4_SOC_ARCH_ID_RPI            =  0x1004,
      	PX4_SOC_ARCH_ID_SIM            =  0x1005,
      	PX4_SOC_ARCH_ID_SITL           =  0x1006,
      
      	PX4_SOC_ARCH_ID_BBBLUE         =  0x1008,
      
      	PX4_SOC_ARCH_ID_VOXL2          =  0x100A,
      
      } PX4_SOC_ARCH_ID_t;
      

      The problem is that enums are not evaluated by the preprocessor. Therefore, when the preprocessor encounters the macro evaluation, PX4_SOC_ARCH_ID and PX4_SOC_ARCH_ID_VOXL2 are not recognized as they are part of an enum. As a result, #include "fc_sensor.h" is always included, regardless of the board type.

      Would someone from the dev team be able to suggest a better way to create the macro?

      Thanks in advance!

      Eric KatzfeyE Offline
      Eric KatzfeyE Offline
      Eric Katzfey
      ModalAI Team
      wrote on last edited by
      #2

      @ejohnson Yes, that is a bug. Don't have a suggestion off the top of my head.

      1 Reply Last reply
      1
      • J jmltt referenced this topic on

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      ModalAI
      Categories Recent Tags ModalAI.com Docs
      © 2026 ModalAI® · Accelerating autonomy for smaller, smarter, safer drones · Powered by NodeBB
      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups