Assertion in chVTDoTickI (Tickless mode)

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: barthess, RoccoMarco

faisal
Posts: 154
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 21 times
Been thanked: 18 times

Assertion in chVTDoTickI (Tickless mode)

Postby faisal » Thu Apr 19, 2018 1:28 am

Using 18.2.x stable, all available debug options enabled:

I am hitting the following assertion in chVTDoTickI, after running for as few as several minutes:

Code: Select all

  chDbgAssert(chTimeDiffX(ch.vtlist.lasttime, chVTGetSystemTimeX()) <=
              chTimeDiffX(ch.vtlist.lasttime, chTimeAddX(now, delta)),
              "exceeding delta");


I am running on an stm32L4 @ 80MHz, and am using the default TIM2 as the system tick timer. Here are my system timers settings:

Code: Select all

/**
 * @brief   System time counter resolution.
 * @note    Allowed values are 16 or 32 bits.
 */
#define CH_CFG_ST_RESOLUTION                32

/**
 * @brief   System tick frequency.
 * @details Frequency of the system timer that drives the system ticks. This
 *          setting also defines the system tick time unit.
 */
#define CH_CFG_ST_FREQUENCY                 1000000

/**
 * @brief   Time intervals data size.
 * @note    Allowed values are 16, 32 or 64 bits.
 */
#define CH_CFG_INTERVALS_SIZE               32

/**
 * @brief   Time types data size.
 * @note    Allowed values are 16 or 32 bits.
 */
#define CH_CFG_TIME_TYPES_SIZE              32

/**
 * @brief   Time delta constant for the tick-less mode.
 * @note    If this value is zero then the system uses the classic
 *          periodic tick. This value represents the minimum number
 *          of ticks that is safe to specify in a timeout directive.
 *          The value one is not valid, timeouts are rounded up to
 *          this value.
 */
#define CH_CFG_ST_TIMEDELTA                 2


I have two interrupt sources (apart from system tick timer). One being an SPI dma half transfer and transfer complete interrupt occurring about every ~1msec, and a UART TX DMA interrupt occurring anywhere from every ~1ms to ~22ms .

I don't understand this cause of this assertion completely ... what could I possibly be doing to end up here? I found this previous discussion, and it seems that there were some bugs initially - but those have long since been fixed:
viewtopic.php?f=16&t=2537

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

Re: Assertion in chVTDoTickI (Tickless mode)

Postby Giovanni » Thu Apr 19, 2018 7:51 am

Hi,

Incidentally somebody else asked the exact same question in the same moment, I just already answered here: viewtopic.php?f=2&t=4611

Let's continue the discussion there if needed.

Giovanni


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 3 guests