diff --git a/libraries/AP_HAL_ChibiOS/CANIface.h b/libraries/AP_HAL_ChibiOS/CANIface.h index 3d0c747531..4719514226 100644 --- a/libraries/AP_HAL_ChibiOS/CANIface.h +++ b/libraries/AP_HAL_ChibiOS/CANIface.h @@ -220,10 +220,10 @@ public: // CAN Peripheral register structure static constexpr bxcan::CanType* const Can[HAL_NUM_CAN_IFACES] = { - reinterpret_cast(0x40006400) + reinterpret_cast(uintptr_t(0x40006400U)) #if HAL_NUM_CAN_IFACES > 1 , - reinterpret_cast(0x40006800) + reinterpret_cast(uintptr_t(0x40006800U)) #endif }; }; diff --git a/libraries/AP_HAL_ChibiOS/stdio.cpp b/libraries/AP_HAL_ChibiOS/stdio.cpp index 0f9fc8aa8b..dce772306d 100644 --- a/libraries/AP_HAL_ChibiOS/stdio.cpp +++ b/libraries/AP_HAL_ChibiOS/stdio.cpp @@ -143,6 +143,7 @@ int __wrap_scanf(const char *fmt, ...) } extern "C" { - // alias fiprintf() to fprintf(). This saves flash space - int __wrap_fiprintf(const char *fmt, ...) __attribute__((alias("__wrap_fprintf"))); + // empty function fiprintf(), saves flash space for unused code path + int __wrap_fiprintf(const char *fmt, ...); + int __wrap_fiprintf(const char *fmt, ...) { return -1; } } diff --git a/libraries/AP_HAL_ChibiOS/system.cpp b/libraries/AP_HAL_ChibiOS/system.cpp index b637f42fa0..0e19a3856e 100644 --- a/libraries/AP_HAL_ChibiOS/system.cpp +++ b/libraries/AP_HAL_ChibiOS/system.cpp @@ -83,7 +83,7 @@ static void save_fault_watchdog(uint16_t line, FaultType fault_type, uint32_t fa pd.fault_thd_prio = tp->prio; // get first 4 bytes of the name, but only of first fault if (tp->name && pd.thread_name4[0] == 0) { - strncpy(pd.thread_name4, tp->name, 4); + strncpy_noterm(pd.thread_name4, tp->name, 4); } } pd.fault_icsr = SCB->ICSR;