Architecture & Yocto Setup for an i.MX8MP Data Logger

Hello everyone!

I’m starting a project to build a standalone Portable Data Logger & Visualizer.
I have a Toradex i.MX8MP (Verdin SoM) on a Mallow Carrier Board from a previous project, and I want to see what I can build with it.

My immediate goal is reliable data acquisition: reading generic I2C sensors for voltage and current measurement (to log battery usage) at configurable intervals, saving the data locally, and exposing it via a JSON API for a future GUI.

I’ve heard Yocto is the standard way to handle this hardware, but I am not an expert.
I have a few questions about the environment and the best way to structure the system:

  • Build System & Cross-Compiling: I am building on an x86_64 host for an ARM64 target.
    Since Yocto takes a long time to bake an image, what is the recommended workflow for iterative development?
    Should I use a Yocto-generated SDK to compile my application code independently, or is there a better way to handle the “write-compile-test” loop without rebuilding the whole image every time?

  • Sensor Handling: for generic I2C sensors (voltage/current), should I look for existing Linux kernel drivers (accessing data via sysfs/hwmon) or is it generally better to handle the I2C communication directly in user-space for a data logging application?
    I’m looking for the most reliable way to handle a configurable sampling rate.

  • Data Architecture: I’m planning a “Producer-Consumer” model:

    • Producer: a service that reads the I2C sensors and writes to a database.
    • Storage: a lightweight local database like SQLite.
    • API: a simple way to expose the data as JSON for a future UI.

    Does this stack make sense for an i.MX8MP, or am I overcomplicating the architecture for a standalone device?

  • Yocto: coming from a desktop/web background, the concept of “building an OS” just to run an app is new to me. How do I best manage the transition from using a generic reference image to creating a minimal, production-ready image that only contains my logger and its specific dependencies?

I’d appreciate any advice on pitfalls to avoid with the i.MX8MP or any tips for someone getting started with the Toradex/Yocto ecosystem.

Thanks!

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


Hello! Great project concept for a Portable Data Logger & Visualizer with your Verdin i.MX8MP on the Mallow Carrier Board. Let me address your questions to help you get started effectively.

OS Choice Recommendation

Before diving into your specific questions, I’d recommend considering Torizon OS instead of traditional Yocto for your project. Torizon OS is Toradex’s container-first embedded Linux platform that significantly simplifies development workflows, especially for iterative development cycles.

Build System & Cross-Compiling

For traditional Yocto development, you can use a Yocto-generated SDK for iterative development (1). However, with Torizon OS, you get much faster iteration cycles using containers, which eliminates the need to rebuild entire images during development.

The traditional Yocto workflow involves generating an SDK that allows you to cross-compile applications independently of the full image build process. This approach is documented for ARM development workflows (2).

Sensor Handling for I2C

For I2C sensor handling, you have two main approaches:

Kernel Driver Approach

Using existing Linux kernel drivers provides better system integration and reliability (3). The drivers expose data through standardized interfaces like sysfs/hwmon, making your application more maintainable.

User-Space Approach

For direct I2C communication, both Yocto BSP and Torizon OS support I2C tools (1)(3).

On Torizon OS, you can access I2C devices within containers by exposing the hardware appropriately (3). The Verdin family provides standardized I2C interfaces - for the Verdin i.MX8MP, you’ll typically use the general-purpose I2C1 interface accessible via /dev/verdin-i2c1 (1).

For testing I2C devices, you can use i2c-tools within containers (3):

# docker run -it --rm -v /dev:/dev --device-cgroup-rule='c 89:* rmw' torizon/debian:${CT_TAG_DEBIAN}

(3)

Data Architecture

Your Producer-Consumer model with SQLite and JSON API is well-suited for the i.MX8MP’s capabilities. This architecture isn’t overcomplicated - it provides good separation of concerns and scalability for future enhancements.

Development Workflow Recommendation

Given your background and requirements, I’d strongly suggest evaluating Torizon OS for several reasons:

  1. Faster Development Cycles: Container-based development eliminates long build times
  2. Familiar Workflow: More similar to modern development practices
  3. Built-in OTA Updates: Essential for field-deployed data loggers
  4. Security: Container isolation and secure boot capabilities

With Torizon OS, your development workflow becomes:

  • Develop applications in containers on your development machine
  • Test locally or deploy to device quickly
  • Use TorizonCore Builder for any OS customizations needed

Next Steps

To help provide more specific guidance, could you let me know:

  • Which OS version are you planning to use?
  • Have you considered Torizon OS as an alternative to traditional Yocto?

You can get detailed information about your current setup using the tdx-info command as described at Getting Device Information with Tdx-Info | Toradex Developer Center

This will help determine the best development path for your data logger project.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Hi @waldek89!

The Toradex AI’s answer summarizes what I would recommend.

Torizon OS is an easier way to get started with our environment.

That said, I also recommend checking our Developer Website, where you’ll find many articles about our entire environment, from hardware to software, including topics ranging from Yocto to Torizon.

Feel free to reach out to our community whenever you encounter an issue or have any questions.

Best regards.