Assert failed after watchdog timeout.

Discussions and questions about the Crazyflie Nano Quadcopter
Post Reply
imranmomtaz
Member
Posts: 36
Joined: Tue Mar 17, 2020 7:01 pm

Assert failed after watchdog timeout.

Post 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.
Attachments
cfJacobian.c
(23.44 KiB) Downloaded 102 times
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Assert failed after watchdog timeout.

Post 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.
Post Reply