From 38503c7ac4cb116a1879fd8532ebf3ee945120ff Mon Sep 17 00:00:00 2001 From: Yang Hongbo Date: Sat, 3 Sep 2022 07:42:10 +0100 Subject: [PATCH 1/2] fix compiling errors Signed-off-by: Yang Hongbo --- cfs/apps/kit_sch/fsw/src/msgtbl.c | 4 ++-- cfs/apps/kit_sch/fsw/src/scheduler.c | 4 ++-- cfs/apps/kit_sch/fsw/src/schtbl.c | 2 +- cfs/apps/kit_to/fsw/src/pkttbl.c | 2 +- cfs/apps/mipea/src/dma.h | 2 +- cfs/apps/mipea/src/peripherals.c | 2 +- cfs/apps/osk_c_fw/fsw/src/childmgr.c | 2 +- cfs/apps/osk_c_fw/fsw/src/cmdmgr.c | 4 ++-- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cfs/apps/kit_sch/fsw/src/msgtbl.c b/cfs/apps/kit_sch/fsw/src/msgtbl.c index 6bc513d..c46b8f5 100644 --- a/cfs/apps/kit_sch/fsw/src/msgtbl.c +++ b/cfs/apps/kit_sch/fsw/src/msgtbl.c @@ -120,7 +120,7 @@ bool MSGTBL_LoadCmd(TBLMGR_Tbl *Tbl, uint8 LoadType, const char* Filename) int obj, msg; CFE_EVS_SendEvent(KIT_SCH_INIT_DEBUG_EID, KIT_SCH_INIT_EVS_TYPE, - "MSGTBL_LoadCmd() Entry. sizeof(MsgTbl->Tbl) = %d\n",sizeof(MsgTbl->Tbl)); + "MSGTBL_LoadCmd() Entry. sizeof(MsgTbl->Tbl) = %lu\n",sizeof(MsgTbl->Tbl)); /* ** Reset status, object modified flags, and data. A non-zero BufLim @@ -317,7 +317,7 @@ bool MSGTBL_DumpCmd(TBLMGR_Tbl *Tbl, uint8 DumpType, const char* Filename) if (DataWords > (uint8)(MSGTBL_MAX_MSG_WORDS)) { CFE_EVS_SendEvent(MSGTBL_DUMP_MSG_ERR_EID, CFE_EVS_EventType_ERROR, - "Error creating dump file message entry %d. Message word length %d is greater than max data buffer %d", + "Error creating dump file message entry %d. Message word length %d is greater than max data buffer %lu", i, DataWords, PKTUTIL_PRI_HDR_WORDS); } else { diff --git a/cfs/apps/kit_sch/fsw/src/scheduler.c b/cfs/apps/kit_sch/fsw/src/scheduler.c index 04d66e4..e4adf3e 100644 --- a/cfs/apps/kit_sch/fsw/src/scheduler.c +++ b/cfs/apps/kit_sch/fsw/src/scheduler.c @@ -403,7 +403,7 @@ bool SCHEDULER_SendMsgEntryCmd(void* ObjDataPtr, const CFE_SB_Buffer_t* SbBufPtr CFE_MSG_ValidateChecksum(MsgPtr, &ValidChecksum); CFE_EVS_SendEvent(SCHEDULER_CMD_SUCCESS_EID, CFE_EVS_EventType_INFORMATION, - "Msg[%d]=Command(ApId,SeqCnt,Len,FuncCode,ValidChecksum)=>(0x%04X,%d,%d,%d,0x%02X)", + "Msg[%d]=Command(ApId,SeqCnt,Len,FuncCode,ValidChecksum)=>(0x%04X,%d,%lu,%d,0x%02X)", MsgIndex,ApId,SeqCnt,Size,FuncCode,ValidChecksum); DataBuf = &(Scheduler->MsgTbl.Entry[MsgIndex].Buffer[sizeof(CFE_MSG_CommandHeader_t)/2]); @@ -416,7 +416,7 @@ bool SCHEDULER_SendMsgEntryCmd(void* ObjDataPtr, const CFE_SB_Buffer_t* SbBufPtr CFE_MSG_GetMsgTime(MsgPtr, &Time); CFE_EVS_SendEvent(SCHEDULER_CMD_SUCCESS_EID, CFE_EVS_EventType_INFORMATION, - "Msg[%d]=Telemetry(ApId,SeqCnt,Len,Seconds,Subsecs)=>(0x%04X,%d,%d,%d,%d)", + "Msg[%d]=Telemetry(ApId,SeqCnt,Len,Seconds,Subsecs)=>(0x%04X,%d,%lu,%d,%d)", MsgIndex,ApId,SeqCnt,Size,Time.Seconds,Time.Subseconds); DataBuf = &(Scheduler->MsgTbl.Entry[MsgIndex].Buffer[sizeof(CFE_MSG_TelemetryHeader_t)/2]); diff --git a/cfs/apps/kit_sch/fsw/src/schtbl.c b/cfs/apps/kit_sch/fsw/src/schtbl.c index c2fb551..d0fcf19 100644 --- a/cfs/apps/kit_sch/fsw/src/schtbl.c +++ b/cfs/apps/kit_sch/fsw/src/schtbl.c @@ -122,7 +122,7 @@ bool SCHTBL_LoadCmd(TBLMGR_Tbl *Tbl, uint8 LoadType, const char* Filename) int entry; - CFE_EVS_SendEvent(KIT_SCH_INIT_DEBUG_EID, KIT_SCH_INIT_EVS_TYPE, "SCHTBL_LoadCmd() Entry. sizeof(SchTbl->Tbl) = %d\n",sizeof(SchTbl->Tbl)); + CFE_EVS_SendEvent(KIT_SCH_INIT_DEBUG_EID, KIT_SCH_INIT_EVS_TYPE, "SCHTBL_LoadCmd() Entry. sizeof(SchTbl->Tbl) = %lu\n",sizeof(SchTbl->Tbl)); /* ** Reset status, object modified flags, and data. A valid diff --git a/cfs/apps/kit_to/fsw/src/pkttbl.c b/cfs/apps/kit_to/fsw/src/pkttbl.c index 66f24b7..5e90521 100644 --- a/cfs/apps/kit_to/fsw/src/pkttbl.c +++ b/cfs/apps/kit_to/fsw/src/pkttbl.c @@ -162,7 +162,7 @@ bool PKTTBL_LoadCmd(TBLMGR_Tbl *Tbl, uint8 LoadType, const char* Filename) CFE_MSG_ApId_t ApId; - CFE_EVS_SendEvent(KIT_TO_INIT_DEBUG_EID, KIT_TO_INIT_EVS_TYPE, "PKTTBL_LoadCmd() Entry. sizeof(PktTbl->Tbl) = %d\n", sizeof(PktTbl->Tbl)); + CFE_EVS_SendEvent(KIT_TO_INIT_DEBUG_EID, KIT_TO_INIT_EVS_TYPE, "PKTTBL_LoadCmd() Entry. sizeof(PktTbl->Tbl) = %lu\n", sizeof(PktTbl->Tbl)); /* ** Reset status, object modified flags, and data. A non-zero BufLim diff --git a/cfs/apps/mipea/src/dma.h b/cfs/apps/mipea/src/dma.h index 344e89b..4872f8c 100644 --- a/cfs/apps/mipea/src/dma.h +++ b/cfs/apps/mipea/src/dma.h @@ -102,7 +102,7 @@ uint32_t dma_virt_to_phy(dma_phy_mem_blk *block, void *addr); void dma_alloc_phy_mem(dma_phy_mem_blk *block, unsigned int size); void dma_free_phy_mem(dma_phy_mem_blk *block); -int _mbox_fd; +extern int _mbox_fd; #ifdef __cplusplus } diff --git a/cfs/apps/mipea/src/peripherals.c b/cfs/apps/mipea/src/peripherals.c index 83237e3..281edcf 100644 --- a/cfs/apps/mipea/src/peripherals.c +++ b/cfs/apps/mipea/src/peripherals.c @@ -34,7 +34,7 @@ int peripheral_map(volatile uint32_t **map, uint32_t offset, uint32_t size) { - printf("osk: peripheral_map() - Peripheral Base 0x%08X, Offset 0x%08X, Size 0x%04X\n", PERIPHERAL_BASE, offset, size); + printf("osk: peripheral_map() - Peripheral Base 0x%08lX, Offset 0x%08X, Size 0x%04X\n", PERIPHERAL_BASE, offset, size); if (peripheral_ismapped(*map, size)) { printf("osk: peripheral_map() - Already mapped\n"); return 0; // already mapped diff --git a/cfs/apps/osk_c_fw/fsw/src/childmgr.c b/cfs/apps/osk_c_fw/fsw/src/childmgr.c index fd24e43..ddf9877 100644 --- a/cfs/apps/osk_c_fw/fsw/src/childmgr.c +++ b/cfs/apps/osk_c_fw/fsw/src/childmgr.c @@ -264,7 +264,7 @@ bool CHILDMGR_InvokeChildCmd(void* ObjDataPtr, const CFE_SB_Buffer_t* SbBufPtr) }/* End if valid message length */ else { - sprintf(EventErrStr, "Error dispatching commmand function %d. Command message length %d exceed max %d", + sprintf(EventErrStr, "Error dispatching commmand function %d. Command message length %lu exceed max %lu", FuncCode, MsgLen, sizeof(CHILDMGR_CmdQ_Entry)); } diff --git a/cfs/apps/osk_c_fw/fsw/src/cmdmgr.c b/cfs/apps/osk_c_fw/fsw/src/cmdmgr.c index 2a2e9aa..9246753 100644 --- a/cfs/apps/osk_c_fw/fsw/src/cmdmgr.c +++ b/cfs/apps/osk_c_fw/fsw/src/cmdmgr.c @@ -181,7 +181,7 @@ bool CMDMGR_DispatchFunc(CMDMGR_Class* CmdMgr, const CFE_SB_Buffer_t* SbBufPtr) ((uint8*)SbBufPtr)[0],((uint8*)SbBufPtr)[1],((uint8*)SbBufPtr)[2],((uint8*)SbBufPtr)[3]); if (DBG_CMDMGR) OS_printf("CMDMGR_DispatchFunc(): [4]=0x%X, [5]=0x%X, [6]=0x%X, [7]=0x%X\n", ((uint8*)SbBufPtr)[4],((uint8*)SbBufPtr)[5],((uint8*)SbBufPtr)[6],((uint8*)SbBufPtr)[7]); - if (DBG_CMDMGR) OS_printf("CMDMGR_DispatchFunc(): FuncCode %d, DataLen %d\n", FuncCode,UserDataLen); + if (DBG_CMDMGR) OS_printf("CMDMGR_DispatchFunc(): FuncCode %d, DataLen %lu\n", FuncCode,UserDataLen); if (FuncCode < CMDMGR_CMD_FUNC_TOTAL) { @@ -202,7 +202,7 @@ bool CMDMGR_DispatchFunc(CMDMGR_Class* CmdMgr, const CFE_SB_Buffer_t* SbBufPtr) else { CFE_EVS_SendEvent (CMDMGR_DISPATCH_INVALID_LEN_ERR_EID, CFE_EVS_EventType_ERROR, - "Invalid command user data length %d, expected %d", + "Invalid command user data length %lu, expected %d", UserDataLen, CmdMgr->Cmd[FuncCode].UserDataLen); } From 4e5a62998f0874d4811ee4f1af8d55abc43ec438 Mon Sep 17 00:00:00 2001 From: Yang Hongbo Date: Thu, 22 Sep 2022 09:37:17 +0800 Subject: [PATCH 2/2] added missing declaration of _mbox_fd Signed-off-by: Yang Hongbo --- cfs/apps/mipea/src/dma.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cfs/apps/mipea/src/dma.c b/cfs/apps/mipea/src/dma.c index 6e46bd4..29cae3b 100644 --- a/cfs/apps/mipea/src/dma.c +++ b/cfs/apps/mipea/src/dma.c @@ -39,6 +39,8 @@ volatile struct dma_channel_register_map *DMAC14 = NULL; volatile struct dma_register_map *DMA = NULL; +int _mbox_fd; + int dma_map(void) { // open /dev/vcio which is used in mailbox