Skip to content

Commit

Permalink
AP_Logger: log IOMCU cpu id and mcu id
Browse files Browse the repository at this point in the history
Co-authored-by: Michelle Rossouw <[email protected]>
  • Loading branch information
peterbarker and MichelleRos committed Jan 29, 2025
1 parent 99a5018 commit 3a95f91
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions libraries/AP_Logger/AP_Logger_Backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <AP_Vehicle/AP_Vehicle_Type.h>
#include <Filter/Filter.h>
#include "AP_Logger.h"
#include <AP_IOMCU/AP_IOMCU.h>

#if HAL_LOGGER_FENCE_ENABLED
#include <AC_Fence/AC_Fence.h>
Expand Down Expand Up @@ -604,6 +605,13 @@ bool AP_Logger_Backend::Write_VER()
patch: fwver.patch,
fw_type: fwver.fw_type,
git_hash: fwver.fw_hash,
#if HAL_WITH_IO_MCU
iomcu_mcu_id : AP::iomcu()->get_mcu_id(),
iomcu_cpu_id : AP::iomcu()->get_cpu_id(),
#else
iomcu_mcu_id : 0,
iomcu_cpu_id : 0,
#endif // HAL_WITH_IO_MCU
};
strncpy(pkt.fw_string, fwver.fw_string, ARRAY_SIZE(pkt.fw_string)-1);

Expand Down
6 changes: 5 additions & 1 deletion libraries/AP_Logger/LogStructure.h
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,8 @@ struct PACKED log_VER {
uint16_t _APJ_BOARD_ID;
uint8_t build_type;
uint8_t filter_version;
uint32_t iomcu_mcu_id;
uint32_t iomcu_cpu_id;
};


Expand Down Expand Up @@ -1122,6 +1124,8 @@ struct PACKED log_VER {
// @Field: BU: Build vehicle type
// @FieldValueEnum: BU: APM_BUILD
// @Field: FV: Filter version
// @Field: IMI: IOMCU MCU ID
// @Field: ICI: IOMCU CPU ID

// @LoggerMessage: MOTB
// @Description: Motor mixer information
Expand Down Expand Up @@ -1252,7 +1256,7 @@ LOG_STRUCTURE_FROM_AIS \
{ LOG_SCRIPTING_MSG, sizeof(log_Scripting), \
"SCR", "QNIii", "TimeUS,Name,Runtime,Total_mem,Run_mem", "s#sbb", "F-F--", true }, \
{ LOG_VER_MSG, sizeof(log_VER), \
"VER", "QBHBBBBIZHBB", "TimeUS,BT,BST,Maj,Min,Pat,FWT,GH,FWS,APJ,BU,FV", "s-----------", "F-----------", false }, \
"VER", "QBHBBBBIZHBBII", "TimeUS,BT,BST,Maj,Min,Pat,FWT,GH,FWS,APJ,BU,FV,IMI,ICI", "s-------------", "F-------------", false }, \
{ LOG_MOTBATT_MSG, sizeof(log_MotBatt), \
"MOTB", "QfffffB", "TimeUS,LiftMax,BatVolt,ThLimit,ThrAvMx,ThrOut,FailFlags", "s------", "F------" , true }

Expand Down

0 comments on commit 3a95f91

Please sign in to comment.