Skip to content

Conversation

hamishwillee
Copy link
Contributor

@hamishwillee hamishwillee commented Oct 2, 2025

MAVLink recently added the WIP PARAM_ERROR message in mavlink/mavlink#2344, which is supposed to be emitted when a parameter can't be set or read, providing error information. This is useful because otherwise the GCS doesn't know if it has just missed the message so it will retry.

This attempts to implement. But I need help because even though I can see the paths and it compiles, I'm not seeing the message in the output.

Comment on lines 208 to 220
const int result = send_param(param_find_no_notification(name));

if (result == 1) {
PX4_ERR("unknown param name: %s", name);
send_error(MAV_PARAM_ERROR_DOES_NOT_EXIST, name,-1 , msg->sysid, msg->compid);

} else if (result == 2) {
PX4_ERR("Failed loading param from storage: %s", name);
// send_error(MAV_PARAM_ERROR_??? ,name, -1 , msg.sysid, msg.compid);
// This case means the parameter could not be populated in param_get.
// It does exist though. TODO work out right error code.
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note this path was being ignored - reporting an error if a named param can't be sent. I copied the same approach as for below (setting and invalid index)

Copy link

github-actions bot commented Oct 2, 2025

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 536 byte (0.03 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +536  +0.0%    +536    .text
  [NEW]    +344  [NEW]    +344    mavlink_finalize_message_buffer.isra.0
  [NEW]    +282  [NEW]    +282    MavlinkParametersManager::send_error()
   +13%    +132   +13%    +132    MavlinkParametersManager::handle_message()
  +0.0%     +76  +0.0%     +76    [section .text]
  [NEW]     +60  [NEW]     +60    CSWTCH.1945
  [NEW]     +44  [NEW]     +44    CSWTCH.2738
  [NEW]     +14  [NEW]     +14    CSWTCH.3478
  [NEW]     +14  [NEW]     +14    CSWTCH.3479
  +6.7%      +4  +6.7%      +4    MavlinkMissionManager::init_offboard_mission()
  -2.9%      -2  -2.9%      -2    MavlinkParametersManager::enque_uavcan_request()
 -30.8%      -4 -30.8%      -4    g_nullstring
  [DEL]     -14  [DEL]     -14    CSWTCH.3473
  [DEL]     -14  [DEL]     -14    CSWTCH.3474
  [DEL]     -44  [DEL]     -44    CSWTCH.2733
  [DEL]     -60  [DEL]     -60    CSWTCH.1944
 -70.5%    -296 -70.5%    -296    mavlink_msg_param_value_encode_chan.isra.0
+0.0%     +37  [ = ]       0    .debug_abbrev
+0.0%     +24  [ = ]       0    .debug_aranges
+0.0%    +144  [ = ]       0    .debug_frame
+0.0% +2.00Ki  [ = ]       0    .debug_info
+0.0%    +758  [ = ]       0    .debug_line
  [DEL]      -4  [ = ]       0    [Unmapped]
  +0.0%    +762  [ = ]       0    [section .debug_line]
+0.0%    +838  [ = ]       0    .debug_loclists
+0.0%    +118  [ = ]       0    .debug_rnglists
  [NEW]      +1  [ = ]       0    [Unmapped]
  +0.0%    +117  [ = ]       0    [section .debug_rnglists]
+0.0%    +448  [ = ]       0    .debug_str
+0.0%    +180  [ = ]       0    .strtab
  [DEL]     -12  [ = ]       0    CSWTCH.1944
  [NEW]     +12  [ = ]       0    CSWTCH.1945
  [DEL]     -12  [ = ]       0    CSWTCH.2733
  [NEW]     +12  [ = ]       0    CSWTCH.2738
  [DEL]     -24  [ = ]       0    CSWTCH.3473
  [DEL]     -24  [ = ]       0    CSWTCH.3474
  [NEW]     +24  [ = ]       0    CSWTCH.3478
  [NEW]     +24  [ = ]       0    CSWTCH.3479
  [NEW]    +141  [ = ]       0    MavlinkParametersManager::send_error()
   +32%     +16  [ = ]       0    ___ZN4uORB7Manager13orb_data_copyEPvS1_Rjb_veneer
 -51.6%     -16  [ = ]       0    __ioctl_veneer
  [NEW]     +39  [ = ]       0    mavlink_finalize_message_buffer.isra.0
+0.0%    +112  [ = ]       0    .symtab
  [DEL]     -32  [ = ]       0    CSWTCH.1944
  [NEW]     +32  [ = ]       0    CSWTCH.1945
  [DEL]     -32  [ = ]       0    CSWTCH.2733
  [NEW]     +32  [ = ]       0    CSWTCH.2738
  [DEL]     -48  [ = ]       0    CSWTCH.3473
  [DEL]     -48  [ = ]       0    CSWTCH.3474
  [NEW]     +48  [ = ]       0    CSWTCH.3478
  [NEW]     +48  [ = ]       0    CSWTCH.3479
  +100%     +16  [ = ]       0    MavlinkParametersManager::enque_uavcan_request()
 -33.3%     -16  [ = ]       0    MavlinkParametersManager::request_next_uavcan_parameter()
  [NEW]     +80  [ = ]       0    MavlinkParametersManager::send_error()
   +67%     +32  [ = ]       0    ___ZN4uORB7Manager13orb_data_copyEPvS1_Rjb_veneer
 -40.0%     -32  [ = ]       0    __ioctl_veneer
  [NEW]     +32  [ = ]       0    mavlink_finalize_message_buffer.isra.0
 +42% +3.48Ki  [ = ]       0    [Unmapped]
+0.0% +8.59Ki  +0.0%    +536    TOTAL

px4_fmu-v6x [Total VM Diff: 528 byte (0.03 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +528  +0.0%    +528    .text
  [NEW]    +344  [NEW]    +344    mavlink_finalize_message_buffer.isra.0
  [NEW]    +282  [NEW]    +282    MavlinkParametersManager::send_error()
   +13%    +132   +13%    +132    MavlinkParametersManager::handle_message()
  +0.0%     +68  +0.0%     +68    [section .text]
  [NEW]     +60  [NEW]     +60    CSWTCH.1945
  [NEW]     +44  [NEW]     +44    CSWTCH.2738
  [NEW]     +14  [NEW]     +14    CSWTCH.3478
  [NEW]     +14  [NEW]     +14    CSWTCH.3479
  +6.7%      +4  +6.7%      +4    MavlinkMissionManager::init_offboard_mission()
  -2.9%      -2  -2.9%      -2    MavlinkParametersManager::enque_uavcan_request()
 -30.8%      -4 -30.8%      -4    g_nullstring
  [DEL]     -14  [DEL]     -14    CSWTCH.3473
  [DEL]     -14  [DEL]     -14    CSWTCH.3474
  [DEL]     -44  [DEL]     -44    CSWTCH.2733
  [DEL]     -60  [DEL]     -60    CSWTCH.1944
 -70.5%    -296 -70.5%    -296    mavlink_msg_param_value_encode_chan.isra.0
+0.0%     +37  [ = ]       0    .debug_abbrev
+0.0%     +24  [ = ]       0    .debug_aranges
+0.0%    +144  [ = ]       0    .debug_frame
+0.0% +2.00Ki  [ = ]       0    .debug_info
+0.0%    +758  [ = ]       0    .debug_line
  [DEL]      -4  [ = ]       0    [Unmapped]
  +0.0%    +762  [ = ]       0    [section .debug_line]
+0.0%    +838  [ = ]       0    .debug_loclists
+0.0%    +118  [ = ]       0    .debug_rnglists
   +50%      +1  [ = ]       0    [Unmapped]
  +0.0%    +117  [ = ]       0    [section .debug_rnglists]
+0.0%    +448  [ = ]       0    .debug_str
+0.0%    +180  [ = ]       0    .strtab
  [DEL]     -12  [ = ]       0    CSWTCH.1944
  [NEW]     +12  [ = ]       0    CSWTCH.1945
  [DEL]     -12  [ = ]       0    CSWTCH.2733
  [NEW]     +12  [ = ]       0    CSWTCH.2738
  [DEL]     -24  [ = ]       0    CSWTCH.3473
  [DEL]     -24  [ = ]       0    CSWTCH.3474
  [NEW]     +24  [ = ]       0    CSWTCH.3478
  [NEW]     +24  [ = ]       0    CSWTCH.3479
  [NEW]    +141  [ = ]       0    MavlinkParametersManager::send_error()
  [NEW]     +39  [ = ]       0    mavlink_finalize_message_buffer.isra.0
+0.0%    +112  [ = ]       0    .symtab
  [DEL]     -32  [ = ]       0    CSWTCH.1944
  [NEW]     +32  [ = ]       0    CSWTCH.1945
  [DEL]     -32  [ = ]       0    CSWTCH.2733
  [NEW]     +32  [ = ]       0    CSWTCH.2738
  [DEL]     -48  [ = ]       0    CSWTCH.3473
  [DEL]     -48  [ = ]       0    CSWTCH.3474
  [NEW]     +48  [ = ]       0    CSWTCH.3478
  [NEW]     +48  [ = ]       0    CSWTCH.3479
  +100%     +16  [ = ]       0    MavlinkParametersManager::enque_uavcan_request()
 -33.3%     -16  [ = ]       0    MavlinkParametersManager::request_next_uavcan_parameter()
  [NEW]     +80  [ = ]       0    MavlinkParametersManager::send_error()
  [NEW]     +32  [ = ]       0    mavlink_finalize_message_buffer.isra.0
-11.3%    -528  [ = ]       0    [Unmapped]
+0.0% +4.59Ki  +0.0%    +528    TOTAL

Updated: 2025-10-09T07:37:41

@hamishwillee hamishwillee force-pushed the pr_mavlink_param_error branch from e2b90d3 to 33c9350 Compare October 8, 2025 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants