Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP_Logger: log IOMCU cpu id and mcu id #29176

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading