Failed uart_syslink ASSERT

Post here to get support
Post Reply
Tommi
Beginner
Posts: 3
Joined: Sat Jun 06, 2020 12:52 pm

Failed uart_syslink ASSERT

Post by Tommi »

Hi all,

Currently I am facing a problem with data communication on the crazyflie.

I am connected to multiple crazyflies and continuously sending crtp packets to the crazyflies on port 9, using the crazyflie-lib-python API (send_packet method of the Crazyflie class). Inside the firmware, I registered a callback function (crtpRegisterPortCB) which takes the packets and writes them into a queue for further processing in a separate task.

In addition to that, packets get sent from the crazyflies to the python counterpart using "crtpSendPacket".

Sometimes the firmware crashes and after restart I get one of the following error messages

Code: Select all

SYS: The system resumed after a failed assert [WARNING]
SYS: Assert failed at .//src/drivers/src/uart_syslink.c:373
SYS: cfAssertNormalStart [FAIL]

SYS: The system resumed after a failed assert [WARNING]
SYS: Assert failed at .//src/drivers/src/uart_syslink.c:394
SYS: cfAssertNormalStart [FAIL]
It seems that either a queue is running full or a calculated check sum is not correct, but i cannot tell exactly where something goes wrong, or what could lead to these failed asserts. Also it's hard to reproduce the error. Sometimes the ASSERT gets triggered immediately after take-off and sometimes everything is fine until the batteries die.

Any help to narrow down the problem will be greatly appreciated. Currently I am not even sure whether the problem relates to receiving the crtp packets, or to sending them.

Best regards
Tommi
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Failed uart_syslink ASSERT

Post by arnaud »

Hi!

These error are not common at all (this so rare that we where talking about removing the checksum from Syslink ...).

My best guess as of what could be happening is that you are loading so much the system that it is missing bytes on the UART which causes the checksum error. There is no hardware flow-control in the direction nrf51->stm32 so if the software is not fast enough we can miss bytes.

The syslink state-machine is handled in the highest-possible IRQ priority: https://github.com/bitcraze/crazyflie-f ... conf.h#L90. This means that the only way to affect it would be, in theory, to setup an interrupt with a priority equal of bellow 5, is it your case? If so, try to use the preset priorities instead: https://github.com/bitcraze/crazyflie-f ... .h#L73-L77.
Tommi
Beginner
Posts: 3
Joined: Sat Jun 06, 2020 12:52 pm

Re: Failed uart_syslink ASSERT

Post by Tommi »

Hi Arnaud,

Thank you for your reply!

It's good to know that this could be caused by system overload, but I didn't set up any additional interrupts.
I am running three tasks with low priorities (prios 0, 1 and 2) and two timers with periods of 500 and 1000 milliseconds. The system as a whole is 100% utilized most of the time, but due to the low priorities of the tasks, I'm hoping not to starve other tasks.

Unfortunately the firmware crashes with the failed assert, what leads to the Crazyflie also crashing. In my case, a lost crtp package is tolerable. If I will not be able to fix the error, is there a possibility to just drop the package with the faulty checksum?
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Failed uart_syslink ASSERT

Post by arnaud »

Hi, I cannot explain why you are getting this error then, this is something we will need to investigate. Loading the system at 100% is not advised though, I assume you are using the prio 0 as some kind of best-effort worker, which should work in theory but it is not very well tested.

As for loosing packet instead, you can just comment out the asserts, the communication state machine is designed to drop and then recover from checksum error, so removing the asserts will make it drop the packet and resynchronize the link.
Tommi
Beginner
Posts: 3
Joined: Sat Jun 06, 2020 12:52 pm

Re: Failed uart_syslink ASSERT

Post by Tommi »

I commented out the asserts but unfortunately I'm getting now another failed assert.

Code: Select all

SYS: The system resumed after a failed assert [WARNING]
SYS: Assert failed at .//src/hal/src/radiolink.c:164
SYS: cfAssertNormalStart [FAIL]
I am not sure, if this is still related to the same problem.
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Failed uart_syslink ASSERT

Post by kristoffer »

Yes, that second assert seems to be related to dropping packets on the radio.
I do think there is a high probability that you will run into other problems by removing asserts like this. Most likely there is a good reason for the assert and other parts of the system is possibly written under the assumption that it is there and doing its job.
Post Reply