Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SD card config.txt full comment line parsing #915

Closed
dominiknatter opened this issue Jan 14, 2022 · 4 comments
Closed

SD card config.txt full comment line parsing #915

dominiknatter opened this issue Jan 14, 2022 · 4 comments

Comments

@dominiknatter
Copy link

dominiknatter commented Jan 14, 2022

Hi everyone,

I'm currently trying to ramp up logging via the SD deck. I get to the point where log files are created on the SD card using cfclient to start and end the logging. However, when analyzing the log files using your tools (cfusdlog.py) it seems like only timestamps are being logged. We use a slightly individually adapted firmware, but those changes should mainly regard the UWB code. I've already removed all the other decks to avoid interference via the SPI. Here is the config.txt file, the console output, and the resulting log file:

config.txt

1     # version
512   # buffer size in bytes
sd_log   # file name
0     # enable on startup (0/1)
on:fixedFrequency
1000     # frequency
1     # mode (0: disabled, 1: synchronous stabilizer, 2: asynchronous)
# IMU
acc.x
acc.y
acc.z
gyro.x
gyro.y
gyro.z

console output (... replaces some irrelevant output from our own firmware):

SYS: Crazyflie 2.1 is up and running!
SYS: Build 399:29116e6eee76 (2020.06 +399) CLEAN
SYS: I am 0x20303743575350170023001F and I have 1024KB of flash!
CFGBLK: v1, verification [OK]
DECK_CORE: 1 deck(s) found
DECK_CORE: Calling INIT on driver bcUSD for deck 0
uSD: mount SD-Card [OK].
IMU: BMI088: Using I2C interface.
uSD: wait for sensors
IMU: BMI088 Gyro connection [OK].
IMU: BMI088 Accel connection [OK]
IMU: BMP388 I2C connection [OK]
ESTIMATOR: Using Complementary (1) estimator
CONTROLLER: Using PID (1) controller
MTR-DRV: Using brushed motor driver
EEPROM: I2C connection [OK].
STORAGE: Storage check [OK].
IMU: BMI088 gyro self-test [OK]
DECK_CORE: Deck 0 test [OK].
STAB: Wait for sensor calibration...
SYS: Free heap: 18808 bytes
...
STAB: Ready to fly.
uSD: Config read [OK].
uSD: malloc buffer 512 bytes uSD: [OK].
uSD: Logging to: sd_log08
uSD: Wrote 1315898 B to: sd_log08 (131587 of 133000 events)

log file (I had to add .txt in order to upload it on GitHub, but it's a binary without file extension):
sd_log08.txt

Interestingly, logging works when I don't rely on the fixedfrequency part of the config.txt file. I.e., if I use your standard example config_kalman.txt. This will for now be my current way forward, but it'd be interesting to find the problem nonetheless.

Best,
Dominik

@knmcguire
Copy link
Member

Just for context, the SD card issue is being discussed on this forum thread.

@tobbeanton
Copy link
Member

This issue turned out to be the "# IMU" line comment which the parser interprets as there are no variables to log. Removing that line fixes the fixed frequency logging.

I will mark this as an enhancement and either the parser should be improved or the documentation should be clearer.

@knmcguire knmcguire changed the title SD card logs only timestamps for fixedfrequency SD card config.txt full comment line parsing Mar 7, 2022
@knmcguire
Copy link
Member

I would vote parsing myself, which would require an addition to the driver in the f_gets_without_comments function:

TCHAR* f_gets_without_comments (

But let's discuss it during the triage meeting.

@krichardsson
Copy link
Contributor

Fixed by #1004

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants