Page 1 of 1

Assert failed after watchdog timeout.

Posted: Mon Mar 01, 2021 1:41 am
by imranmomtaz
Hello,

I have CF2.1 with lighthouse deck and flow deck. I added one custom deck (written in software) which is supposed to copy the EKF filter operation for my research. The code is compiling fine in computer with the makefile; however, I have following as the output when it is flashed in the cf2.1:

Code: Select all

SYS: Assert failed .//src/deck/drivers/src/cfJacobian.c:35
SYS: ----------------------------
SYS: Crazyflie 2.1 is up and running!
SYS: Build 29:5d4350e645a2 (2020.04 +29) MODIFIED
ash!
ngine found
DECK_INFO: compile-time forced driver ekfOptiEngine added
DECK_CORE: 2 deck(s) found
DECK_CORE: Calling INIT on driver bcLighthouse4 for deck 0
DECK_CORE: Calling INIT on driver ekfOptiEngine for deck 1
Hello Crazyflie 2.1 deck world!
IMU: BMI088 Gyro I2C connection [OK].
IMU: BMI088 Accel I2C connection [OK]
IMU: BMP388 I2C connection [OK]
ESTIMATOR: Using Kalman (2) estimator
CONTROLLER: Using PID (1) controller
MTR-DRV: Using brushed motor driver
EEPROM: I2C connection [OK].
IMU: BMI088 gyro self-test [OK]
ekfOptiEngine test passed!
DECK_CORE: Deck 1 test [OK].
SYS: The system resumed after watchdog timeout [WARNING]
SYS: Assert failed at .//src/deck/drivers/src/cfJacobian.c:35
.//src/deck/drivers/src/cfJacobian.c:35
I went to cfJacobian line 35 and it is the following:

Code: Select all

static inline float arm_sqrt(float32_t in)
{ float pOut = 0; arm_status result = arm_sqrt_f32(in, &pOut); ASSERT(ARM_MATH_SUCCESS == result); return pOut; }
I have attached the whole file in the attachment. Please let me know what I am missing and how to correct this. Thanks.

Re: Assert failed after watchdog timeout.

Posted: Mon Mar 01, 2021 1:01 pm
by arnaud
This happens because you are somewhere passing a negative number to sqrt (this is the only documented reason for which this function can fail: https://www.keil.com/pack/doc/CMSIS_Dev ... 34286c60ed)

Since the arm_sqrt function is not used a lot, you could add your own assert before each call to find out which one is causing the problem and why.