Skip to content

Conversation

dakejahl
Copy link
Contributor

@dakejahl dakejahl commented Nov 4, 2024

Initial implementation taken from #23882 but reimplemented using the existing interface. This adds ~700B to flash for the extra data in NodeStatus but I think it's worth it
Screenshot from 2024-11-04 14-45-31

@dakejahl dakejahl force-pushed the pr-uavcan_node_status_logging branch 2 times, most recently from 5f7c105 to d9d936e Compare November 5, 2024 03:15
@dakejahl
Copy link
Contributor Author

dakejahl commented Nov 5, 2024

@vertiq-jordan let me know what you think

@vertiq-jordan
Copy link
Contributor

@vertiq-jordan let me know what you think

Looks good on my end! Here's a couple of quick captures of one of our nodes going through the different health cases:
image

Here's a sanity check that everyone is reporting the correct Node ID/they're being logged:
image

I'll get on the Extended ESC Status PR shortly, thank you!

@dagar
Copy link
Member

dagar commented Nov 7, 2024

I do quite like this, we just need to make it fit.

@dakejahl dakejahl force-pushed the pr-uavcan_node_status_logging branch from d9d936e to 339824f Compare December 4, 2024 02:10
@DronecodeBot
Copy link

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/px4-sync-q-a-jan-22-2025/43384/3

Co-authored-by: Jordan Leiber <jordan.leiber@vertiq.co>
@mrpollo mrpollo force-pushed the pr-uavcan_node_status_logging branch from 339824f to 5ec1274 Compare January 22, 2025 16:40
@mrpollo
Copy link
Contributor

mrpollo commented Jan 22, 2025

Rebasing, we will check back once the FLASH report is done.

@dakejahl
Copy link
Contributor Author

@mrpollo flash report is failing. Does it only work with branches from this repo?

@mrpollo
Copy link
Contributor

mrpollo commented Jan 25, 2025

It's running so often that it's reaching max usage limits for the GitHub api, same is happening with the container action.

I think we are going to have to stop auto comments until we figure out a solution.

@dakejahl dakejahl enabled auto-merge (squash) June 10, 2025 02:27
@dakejahl dakejahl disabled auto-merge June 10, 2025 02:27
@dakejahl dakejahl requested review from dagar and julianoes June 10, 2025 02:28
@dakejahl
Copy link
Contributor Author

I'm worried this 700B is going to push px4_fmu-v6x over the edge..

@vertiq-jordan
Copy link
Contributor

I'm worried this 700B is going to push px4_fmu-v6x over the edge..

Might I suggest that we kill the vertiq_io module from the board defaults? I believe that right now the v6x defaults file is the only one that has our module enabled. We have fairly detailed documentation on our end for building from scratch with our stuff enabled for any board, so I'd be ok killing it as a default option. Should save a couple K.

@dakejahl
Copy link
Contributor Author

Looks like it's the 6c that has the vertiq module, so that won't help unfortunately.

@mrpollo does anyone "own" V6X? It would be nice to have an owner of the target who can keep the flash usage under control and make the executive decisions about which modules to support.

@mrpollo
Copy link
Contributor

mrpollo commented Jun 12, 2025

FMUv5X

Memory region         Used Size  Region Size  %age Used
      FLASH_ITCM:           0 B      2016 KB      0.00%
      FLASH_AXIM:     2021588 B     10080 KB     19.59%
        ITCM_RAM:       14624 B        16 KB     89.26%
        DTCM_RAM:           0 B       128 KB      0.00%
           SRAM1:       93380 B       368 KB     24.78%
           SRAM2:           0 B        16 KB      0.00%
[1296/1297] Generating ../../px4_fmu-v5x_flash-analysis.bin

   FILE SIZE        VM SIZE    
--------------  -------------- 
 +0.0%    +608  +0.0%    +608    .text
   [NEW]    +292  [NEW]    +292    UavcanNode::publish_node_statuses()
   [NEW]    +212  [NEW]    +212    UavcanNode::publish_can_interface_statuses()
   +0.0%     +80  +0.0%     +80    [section .text]
   +0.3%     +64  +0.3%     +64    uORB::compressed_fields
    +72%     +58   +72%     +58    uavcan::NodeStatusMonitor::changeNodeStatus()
   +0.9%     +28  +0.9%     +28    px4::logger::LoggedTopics::add_default_topics()
    +35%     +24   +35%     +24    uavcan::NodeStatusMonitor::handleNodeStatus()
   +1.5%     +16  +1.5%     +16    UavcanNode::UavcanNode()
   [NEW]     +16  [NEW]     +16    __orb_dronecan_node_status
    +11%     +10   +11%     +10    uavcan::NodeStatusMonitor::handleTimerEvent()
   +6.7%      +8  +6.7%      +8    uavcan::NodeStatusMonitor::NodeStatusMonitor()
   +0.2%      +4  +0.2%      +4    RcvTopicsPubs::init()
   +0.5%      +4  +0.5%      +4    UavcanNode::init()
  -99.9%      +4 -99.9%      +4    [8 Others]
   +0.4%      +4  +0.4%      +4    two_over_pi
   -0.8%      -4  -0.8%      -4    ModuleBase<>::unlock_module()
   -1.0%      -4  -1.0%      -4    SendTopicsSubs::init()
   -1.0%      -4  -1.0%      -4    UavcanNode::cb_getset()
   -4.5%      -4  -4.5%      -4    UavcanNode::param_opcode()
   -3.1%     -16  -3.1%     -16    UavcanNode::~UavcanNode()
  -10.6%    -184 -10.6%    -184    UavcanNode::Run()
 +0.0%    +934  [ = ]       0    .debug_abbrev
 +0.0%     +48  [ = ]       0    .debug_aranges
 +0.0%    +156  [ = ]       0    .debug_frame
 +0.1% +14.4Ki  [ = ]       0    .debug_info
 +0.0% +2.05Ki  [ = ]       0    .debug_line
  -20.0%      -1  [ = ]       0    [Unmapped]
   +0.0% +2.05Ki  [ = ]       0    [section .debug_line]
 +0.0%    +585  [ = ]       0    .debug_loclists
 +0.0%    +178  [ = ]       0    .debug_rnglists
   [NEW]      +2  [ = ]       0    [Unmapped]
   +0.0%    +176  [ = ]       0    [section .debug_rnglists]
 +0.0%    +521  [ = ]       0    .debug_str
 -0.8%      -2  [ = ]       0    .shstrtab
 +0.0%    +146  [ = ]       0    .strtab
   [NEW]     +50  [ = ]       0    UavcanNode::publish_can_interface_statuses()
   [NEW]     +41  [ = ]       0    UavcanNode::publish_node_statuses()
   +0.1%     +25  [ = ]       0    [section .strtab]
   +100%     +16  [ = ]       0    __memcpy_veneer
   [NEW]     +27  [ = ]       0    __orb_dronecan_node_status
  -39.0%     -16  [ = ]       0    __param_get_index_veneer
   +0.7%      +1  [ = ]       0    uavcan::NodeInfoRetriever::handleTimerEvent()
   +1.1%      +2  [ = ]       0    uavcan::NodeInfoRetriever::~NodeInfoRetriever()
 +0.0%    +128  [ = ]       0    .symtab
  -33.3%     -32  [ = ]       0    RcvTopicsPubs::init()
    +20%     +16  [ = ]       0    UavcanNode::print_params()
   [NEW]     +48  [ = ]       0    UavcanNode::publish_can_interface_statuses()
   [NEW]     +48  [ = ]       0    UavcanNode::publish_node_statuses()
  -50.0%     -16  [ = ]       0    UavcanNode::update_params()
   +0.3%     +32  [ = ]       0    [section .symtab]
    +50%     +16  [ = ]       0    ___ZNK3Ekf21updateAidSourceStatusI24estimator_aid_source3d_sN6matrix7Vector3IfEES4_EEvRT_RKyRKT1_RKT0_SE_SE_f.isra.0_veneer
    +67%     +32  [ = ]       0    __memcpy_veneer
   [NEW]     +48  [ = ]       0    __orb_dronecan_node_status
  -40.0%     -32  [ = ]       0    __param_get_index_veneer
    +33%     +16  [ = ]       0    __stm32_epin_request_veneer
  -33.3%     -16  [ = ]       0    __stm32_i2c_sendstart_veneer
  -25.0%     -16  [ = ]       0    __up_flush_dcache_veneer
   +0.4%     +16  [ = ]       0    uavcan::GenericSubscriber<>::~GenericSubscriber()
  -33.3%     -16  [ = ]       0    uavcan::NodeStatusMonitor::changeNodeStatus()
  -50.0%     -16  [ = ]       0    uavcan::NodeStatusMonitor::handleNodeStatus()
    +50%     +16  [ = ]       0    uavcan::NodeStatusMonitor::handleTimerEvent()
   -2.7%     -16  [ = ]       0    uavcan::ServiceServer<>::~ServiceServer()
 -5.8%    -600  [ = ]       0    [Unmapped]
 -0.1%      -8  -0.1%      -8    .ramfunc
    +14%      +1   +14%      +1    ___ZNK3Ekf21updateAidSourceStatusI24estimator_aid_source3d_sN6matrix7Vector3IfEES4_EEvRT_RKyRKT1_RKT0_SE_SE_f.isra.0_veneer
  -12.5%      -1 -12.5%      -1    __stm32_i2c_sendstart_veneer
   -1.2%      -4  -1.2%      -4    Ekf::measurementUpdate()
  -16.7%      -4 -16.7%      -4    get_orb_meta()
 +0.0% +19.1Ki  +0.0%    +600    TOTAL

FMUv6X

Memory region         Used Size  Region Size  %age Used
        ITCM_RAM:           0 B        64 KB      0.00%
           FLASH:     1930348 B     10080 KB     18.70%
       DTCM1_RAM:           0 B        64 KB      0.00%
       DTCM2_RAM:           0 B        64 KB      0.00%
        AXI_SRAM:      100732 B       512 KB     19.21%
           SRAM1:           0 B       128 KB      0.00%
           SRAM2:           0 B       128 KB      0.00%
           SRAM3:           0 B        32 KB      0.00%
           SRAM4:          2 KB        64 KB      3.12%
          BKPRAM:           0 B         4 KB      0.00%
[1242/1243] Generating ../../px4_fmu-v6x_flash-analysis.bin

   FILE SIZE        VM SIZE    
--------------  -------------- 
 +0.0%    +608  +0.0%    +608    .text
   [NEW]    +292  [NEW]    +292    UavcanNode::publish_node_statuses()
   [NEW]    +212  [NEW]    +212    UavcanNode::publish_can_interface_statuses()
   +0.0%     +80  +0.0%     +80    [section .text]
   +0.3%     +64  +0.3%     +64    uORB::compressed_fields
    +72%     +58   +72%     +58    uavcan::NodeStatusMonitor::changeNodeStatus()
   +0.9%     +28  +0.9%     +28    px4::logger::LoggedTopics::add_default_topics()
    +35%     +24   +35%     +24    uavcan::NodeStatusMonitor::handleNodeStatus()
   +1.5%     +16  +1.5%     +16    UavcanNode::UavcanNode()
   [NEW]     +16  [NEW]     +16    __orb_dronecan_node_status
    +11%     +10   +11%     +10    uavcan::NodeStatusMonitor::handleTimerEvent()
   +6.7%      +8  +6.7%      +8    uavcan::NodeStatusMonitor::NodeStatusMonitor()
   +0.2%      +4  +0.2%      +4    RcvTopicsPubs::init()
   +0.5%      +4  +0.5%      +4    UavcanNode::init()
  -99.9%      +4 -99.9%      +4    [8 Others]
   +0.4%      +4  +0.4%      +4    two_over_pi
   -0.8%      -4  -0.8%      -4    ModuleBase<>::unlock_module()
   -1.0%      -4  -1.0%      -4    SendTopicsSubs::init()
   -1.0%      -4  -1.0%      -4    UavcanNode::cb_getset()
   -4.5%      -4  -4.5%      -4    UavcanNode::param_opcode()
   -3.1%     -16  -3.1%     -16    UavcanNode::~UavcanNode()
  -10.6%    -184 -10.6%    -184    UavcanNode::Run()
 +0.0%    +934  [ = ]       0    .debug_abbrev
 +0.0%     +48  [ = ]       0    .debug_aranges
 +0.0%    +156  [ = ]       0    .debug_frame
 +0.1% +14.4Ki  [ = ]       0    .debug_info
 +0.0% +2.05Ki  [ = ]       0    .debug_line
  -20.0%      -1  [ = ]       0    [Unmapped]
   +0.0% +2.05Ki  [ = ]       0    [section .debug_line]
 +0.0%    +585  [ = ]       0    .debug_loclists
 +0.0%    +178  [ = ]       0    .debug_rnglists
   [NEW]      +2  [ = ]       0    [Unmapped]
   +0.0%    +176  [ = ]       0    [section .debug_rnglists]
 +0.0%    +521  [ = ]       0    .debug_str
 -0.8%      -2  [ = ]       0    .shstrtab
 +0.0%    +146  [ = ]       0    .strtab
   [NEW]     +50  [ = ]       0    UavcanNode::publish_can_interface_statuses()
   [NEW]     +41  [ = ]       0    UavcanNode::publish_node_statuses()
   +0.1%     +25  [ = ]       0    [section .strtab]
   +100%     +16  [ = ]       0    __memcpy_veneer
   [NEW]     +27  [ = ]       0    __orb_dronecan_node_status
  -39.0%     -16  [ = ]       0    __param_get_index_veneer
   +0.7%      +1  [ = ]       0    uavcan::NodeInfoRetriever::handleTimerEvent()
   +1.1%      +2  [ = ]       0    uavcan::NodeInfoRetriever::~NodeInfoRetriever()
 +0.0%    +128  [ = ]       0    .symtab
  -33.3%     -32  [ = ]       0    RcvTopicsPubs::init()
    +20%     +16  [ = ]       0    UavcanNode::print_params()
   [NEW]     +48  [ = ]       0    UavcanNode::publish_can_interface_statuses()
   [NEW]     +48  [ = ]       0    UavcanNode::publish_node_statuses()
  -50.0%     -16  [ = ]       0    UavcanNode::update_params()
   +0.3%     +32  [ = ]       0    [section .symtab]
    +50%     +16  [ = ]       0    ___ZNK3Ekf21updateAidSourceStatusI24estimator_aid_source3d_sN6matrix7Vector3IfEES4_EEvRT_RKyRKT1_RKT0_SE_SE_f.isra.0_veneer
    +67%     +32  [ = ]       0    __memcpy_veneer
   [NEW]     +48  [ = ]       0    __orb_dronecan_node_status
  -40.0%     -32  [ = ]       0    __param_get_index_veneer
    +33%     +16  [ = ]       0    __stm32_epin_request_veneer
  -33.3%     -16  [ = ]       0    __stm32_i2c_sendstart_veneer
  -25.0%     -16  [ = ]       0    __up_flush_dcache_veneer
   +0.4%     +16  [ = ]       0    uavcan::GenericSubscriber<>::~GenericSubscriber()
  -33.3%     -16  [ = ]       0    uavcan::NodeStatusMonitor::changeNodeStatus()
  -50.0%     -16  [ = ]       0    uavcan::NodeStatusMonitor::handleNodeStatus()
    +50%     +16  [ = ]       0    uavcan::NodeStatusMonitor::handleTimerEvent()
   -2.7%     -16  [ = ]       0    uavcan::ServiceServer<>::~ServiceServer()
 -5.8%    -600  [ = ]       0    [Unmapped]
 -0.1%      -8  -0.1%      -8    .ramfunc
    +14%      +1   +14%      +1    ___ZNK3Ekf21updateAidSourceStatusI24estimator_aid_source3d_sN6matrix7Vector3IfEES4_EEvRT_RKyRKT1_RKT0_SE_SE_f.isra.0_veneer
  -12.5%      -1 -12.5%      -1    __stm32_i2c_sendstart_veneer
   -1.2%      -4  -1.2%      -4    Ekf::measurementUpdate()
  -16.7%      -4 -16.7%      -4    get_orb_meta()
 +0.0% +19.1Ki  +0.0%    +600    TOTAL

@mrpollo
Copy link
Contributor

mrpollo commented Jun 12, 2025

@dakejahl For the common px4/fmuv_5x and px4/fmu_v6x targets we don't have owners but the devs who have been helping out and are most interested in keeping them sane are @niklaut @davids5 @dagar and myself.

I think flash wise we should so far we have been dealing with issues when they come and disabling modules based on what seems right at the moment, once we move to a per vehicle type build we shouldn't be running into this anymore, but until then, we should look into how to improve this ad-hoc process.

@dakejahl dakejahl merged commit af878ce into PX4:main Jul 23, 2025
66 checks passed
@dakejahl dakejahl deleted the pr-uavcan_node_status_logging branch July 23, 2025 07:18
@github-project-automation github-project-automation bot moved this from Todo to Done in PX4 v1.16 Release Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants