CH_CFG_ST_RESOLUTION == 64 : compile error Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
User avatar
alex31
Posts: 374
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 38 times
Been thanked: 61 times
Contact:

CH_CFG_ST_RESOLUTION == 64 : compile error  Topic is solved

Postby alex31 » Sat Oct 31, 2020 9:51 am

Hello,

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

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: CH_CFG_ST_RESOLUTION == 64 : compile error

Postby Giovanni » Sat Oct 31, 2020 10:56 am

Hi,

This would require a 64 bits timer, anyway, it makes sense.

Giovanni

User avatar
alex31
Posts: 374
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 38 times
Been thanked: 61 times
Contact:

Re: CH_CFG_ST_RESOLUTION == 64 : compile error

Postby alex31 » Sat Oct 31, 2020 11:23 am

Giovanni wrote:Hi,

This would require a 64 bits timer, anyway, it makes sense.

Giovanni


Internally, RT don't manage the wrapping of the 32 bits timer ?

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: CH_CFG_ST_RESOLUTION == 64 : compile error

Postby Giovanni » Sat Oct 31, 2020 11:40 am

It does but it is no more "tick-less" it is "much-less-ticks-than-usual mode" ;)

Fixed as bug #1128.

Giovanni


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 27 guests