How can I log LSM6DSOX sensor data and timestamps at < 1ms resolution using the SensorTile.Box at 6666Hz?
Hello, I recently got a SensorTile.Box and wanted to log accelerometer and gyroscope data from the LSM6DSOX along with the time at which the sensor output was recorded. Importantly, I want to do this at the highest frequency possible (6666Hz) with microsecond and possibly nanosecond time resolution.
To attempt to accomplish this I used the "ST BLE Sensor" app from the Google Play Store. I entered expert mode and configured the following inputs:
- IMU Accelerometer sensor (6666Hz)
- IMU Gyroscope sensor (6666Hz)
- RTC (Time)
I configured the app to output to the SD card.
After uploading the app to the SensorTile.Box and logging some data on the SD card I took a look at the logged data. There were two problems:
- I calculated the data rate of the sensors by dividing the number of samples in the log file by the time it took to capture the data. The calculated data rate was ~1600Hz! Much less than the 6666Hz I configured. Why am I not able to log data to the SD card at 6666Hz?

- The timestamps in the csv log file were in "hh:mm:ss.ms" format. For example: "12:18:27.854". Is it possible to capture microsecond and nanosecond data from the sensors? At higher data rates many timestamps are the same since the data is being logged at a higher rate than the time log can change. I want to be able to know exactly when the sensor output was made.
I looked into some STM32CubeFunctionPack_STBOX1_V1.3.0 code to see if there were any solutions.
In the "DataLogExtended" project I was able to stream data via a USB cable and view it via Unicleo-GUI. The logged time there had microsecond accuracy but I am unsure if that time is coming from the SensorTile.Box or from my PC. Which is it? Also, when I calculated the true frequency of the logged data it was 4280Hz when I had configured it to be 6666Hz.
In the "SDDataLogRToS" project data is logged to the SD card every 10ms. When I changed the code to make the logging period 1ms and recompiled it and uploaded it to the SensorTile.Box it would not log data at all.
In conclusion:
- What is the highest possible time logging resolution I can have when logging to {SD card, usb cable}.
- Is the highest possible time resolution different if I use the ST BLE Sensor app or if I write a custom program and compile it.
- Why am I not able to log at the configured data rate of 6666Hz? Why is the true data rate always lower?
I would appreciate any help and assistance with these problems. Thank you very much :)
Kind regards
