This is for chibios 20.3, using RT.
From what i see in chconf.h :
Code: Select all
/**
* @brief Type of system time.
* @note It is selectable in configuration between 16, 32 or 64 bits.
*/
#if (CH_CFG_ST_RESOLUTION == 64) || defined(__DOXYGEN__)
typedef uint64_t systime_t;
#elif CH_CFG_ST_RESOLUTION == 32
typedef uint32_t systime_t;
#elif CH_CFG_ST_RESOLUTION == 16
typedef uint16_t systime_t;
#endif
setting CH_CFG_ST_RESOLUTION to 64 is permitted (and useful when using tickless mode with high frequency).
but osal.h dont permit to do so.
here is a patch that permit 64 bits resolution :
Code: Select all
diff --git a/os/hal/osal/rt-nil/osal.h b/os/hal/osal/rt-nil/osal.h
index 73e8e3fa9..fbeefc296 100644
--- a/os/hal/osal/rt-nil/osal.h
+++ b/os/hal/osal/rt-nil/osal.h
@@ -119,8 +119,8 @@
#error "invalid OSAL_ST_MODE setting in osal.h"
#endif
-#if (OSAL_ST_RESOLUTION != 16) && (OSAL_ST_RESOLUTION != 32)
-#error "invalid OSAL_ST_RESOLUTION, must be 16 or 32"
+#if (OSAL_ST_RESOLUTION != 16) && (OSAL_ST_RESOLUTION != 32) && (OSAL_ST_RESOLUTION != 64)
+#error "invalid OSAL_ST_RESOLUTION, must be 16 or 32 or 64"
#endif
/*===========================================================================*/
also, in each chconf.h example file, there is a doxygen note that need to be modified :
@note Allowed values are 16 or 32 bits or 64 bits.
Alexandre