From 74982630e92b49405eeb987240164ad82620bf15 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Fri, 24 Jan 2025 13:07:17 -0800 Subject: [PATCH] bump ChibiOS to stable release, and update F0 configs --- .gitmodules | 4 +- firmware/ChibiOS | 2 +- firmware/boards/f0_module/chconf.h | 60 +++++++++++++++++++++++------ firmware/boards/f0_module/halconf.h | 16 +++++--- 4 files changed, 62 insertions(+), 20 deletions(-) diff --git a/.gitmodules b/.gitmodules index 3dd267a6..cb879803 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ [submodule "firmware/ChibiOS"] path = firmware/ChibiOS - url = https://github.com/rusefi/ChibiOS - branch = master.wideband + url = https://github.com/ChibiOS/ChibiOS + branch = stable_21.11.x [submodule "firmware/cmsis-svd"] path = firmware/cmsis-svd url = https://github.com/posborne/cmsis-svd diff --git a/firmware/ChibiOS b/firmware/ChibiOS index 0ce1cbd6..dfdb730e 160000 --- a/firmware/ChibiOS +++ b/firmware/ChibiOS @@ -1 +1 @@ -Subproject commit 0ce1cbd649f4bb2d9db941e729d3308b247b8696 +Subproject commit dfdb730ecf5e536174e37dd9b5ff37e6bb5a59da diff --git a/firmware/boards/f0_module/chconf.h b/firmware/boards/f0_module/chconf.h index 8e1fb717..df548feb 100644 --- a/firmware/boards/f0_module/chconf.h +++ b/firmware/boards/f0_module/chconf.h @@ -28,14 +28,29 @@ #ifndef CHCONF_H #define CHCONF_H -#ifndef __ASSEMBLER__ -// HACK: some compilers have a problem with syscalls_cpp.cpp not being able to find pid_t -typedef int pid_t; -#endif - #define _CHIBIOS_RT_CONF_ #define _CHIBIOS_RT_CONF_VER_7_0_ +/*===========================================================================*/ +/** + * @name System settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Handling of instances. + * @note If enabled then threads assigned to various instances can + * interact each other using the same synchronization objects. + * If disabled then each OS instance is a separate world, no + * direct interactions are handled by the OS. + */ +#if !defined(CH_CFG_SMP_MODE) +#define CH_CFG_SMP_MODE FALSE +#endif + +/** @} */ + /*===========================================================================*/ /** * @name System timers settings @@ -45,7 +60,7 @@ typedef int pid_t; /** * @brief System time counter resolution. - * @note Allowed values are 16 or 32 bits. + * @note Allowed values are 16, 32 or 64 bits. */ #if !defined(CH_CFG_ST_RESOLUTION) #define CH_CFG_ST_RESOLUTION 32 @@ -167,8 +182,7 @@ typedef int pid_t; /** * @brief Time Stamps APIs. - * @details If enabled then the time time stamps APIs are included in - * the kernel. + * @details If enabled then the time stamps APIs are included in the kernel. * * @note The default is @p TRUE. */ @@ -643,21 +657,35 @@ typedef int pid_t; /*===========================================================================*/ /** - * @brief OS instance structure extension. + * @brief System structure extension. * @details User fields added to the end of the @p ch_system_t structure. */ +#define CH_CFG_SYSTEM_EXTRA_FIELDS \ + /* Add system custom fields here.*/ + +/** + * @brief System initialization hook. + * @details User initialization code added to the @p chSysInit() function + * just before interrupts are enabled globally. + */ +#define CH_CFG_SYSTEM_INIT_HOOK() { \ + /* Add system initialization code here.*/ \ +} + +/** + * @brief OS instance structure extension. + * @details User fields added to the end of the @p os_instance_t structure. + */ #define CH_CFG_OS_INSTANCE_EXTRA_FIELDS \ /* Add OS instance custom fields here.*/ /** * @brief OS instance initialization hook. - * @details User initialization code added to the @p chSysInit() function - * just before interrupts are enabled globally. * * @param[in] oip pointer to the @p os_instance_t structure */ #define CH_CFG_OS_INSTANCE_INIT_HOOK(oip) { \ - /* Add system instance initialization code here.*/ \ + /* Add OS instance initialization code here.*/ \ } /** @@ -770,6 +798,14 @@ typedef int pid_t; /* Trace code here.*/ \ } +/** + * @brief Runtime Faults Collection Unit hook. + * @details This hook is invoked each time new faults are collected and stored. + */ +#define CH_CFG_RUNTIME_FAULTS_HOOK(mask) { \ + /* Faults handling code here.*/ \ +} + /** @} */ /*===========================================================================*/ diff --git a/firmware/boards/f0_module/halconf.h b/firmware/boards/f0_module/halconf.h index a18bd0b0..ddc7fbbb 100644 --- a/firmware/boards/f0_module/halconf.h +++ b/firmware/boards/f0_module/halconf.h @@ -29,7 +29,7 @@ #define HALCONF_H #define _CHIBIOS_HAL_CONF_ -#define _CHIBIOS_HAL_CONF_VER_7_1_ +#define _CHIBIOS_HAL_CONF_VER_8_4_ #include "mcuconf.h" @@ -194,6 +194,13 @@ #define HAL_USE_WDG FALSE #endif +/** + * @brief Enables the WSPI subsystem. + */ +#if !defined(HAL_USE_WSPI) || defined(__DOXYGEN__) +#define HAL_USE_WSPI FALSE +#endif + /*===========================================================================*/ /* PAL driver related settings. */ /*===========================================================================*/ @@ -289,11 +296,10 @@ #endif /** - * @brief Enables circular transfers APIs. - * @note Disabling this option saves both code and data space. + * @brief Inserts an assertion on function errors before returning. */ -#if !defined(SPI_USE_CIRCULAR) || defined(__DOXYGEN__) -#define SPI_USE_CIRCULAR FALSE +#if !defined(SPI_USE_ASSERT_ON_ERROR) || defined(__DOXYGEN__) +#define SPI_USE_ASSERT_ON_ERROR TRUE #endif /**