[Bug] Long log group names cause system crash
Posted: Wed Jun 08, 2016 8:59 am
Yesterday I was playing around with some new log groups in the firmware. I had a variable, which I wanted to log, so I created a log group and added the variable to it. It compiled without errors. I was able to flash the Crazyflie, after that it rebooted as usual and waited for connection. Then, as soon as I start my program to connect to it, the CF just reboots. Afterwards the red LED is flashing in bursts of (I believe) 3 short flashes, but the Rx/Tx LED doesn't go off, signalizing that the radio communication wasn't dropped. The CF can still be manually rebooted and re-flashed after this.
Here's the bit of code I used to diagnose the problem (please excuse the placeholder-like names
):
By changing the length of the log group name and this item name, I found that the maximum combined length of the group and item name is 25 characters, above that the system crashes. I don't know if the name length limit is intended, or is a bug. In the first case, it would be good to add this note to the Logging tutorial/documentation. In the latter case, this should throw an error or a warning during compilation.
For these tests I used my own fork of crazyflie-firmware, which hasn't been kept up-to-date with the official github repo since about Dec 2015. I wasn't able to test this yet with the latest firmware version, therefore I didn't submit it as an Issue on github. Can someone test this with the official latest firmware?
Here's the bit of code I used to diagnose the problem (please excuse the placeholder-like names

Code: Select all
static uint16_t sampleText = 12; // Placeholder variable for testing
...
LOG_GROUP_START(cmdLoremIpsum)
LOG_ADD(LOG_UINT16, lipsumAveryL, &sampleText) // Will work without problems
//LOG_ADD(LOG_UINT16, lipsumAveryLongItemName, &sampleText) // Will cause system reset
LOG_GROUP_STOP(cmdLoremIpsum)
For these tests I used my own fork of crazyflie-firmware, which hasn't been kept up-to-date with the official github repo since about Dec 2015. I wasn't able to test this yet with the latest firmware version, therefore I didn't submit it as an Issue on github. Can someone test this with the official latest firmware?