Industrial Automation
A project required a high-performance data acquisition and processing system for advanced sensor fusion. The application demanded rapid, real-time processing of analog-to-digital converter (ADC) data from multiple sensors, combining their inputs to create a more accurate and robust understanding of the environment. Simply offloading the entire processing task to the main application processor would introduce unacceptable latency and potentially overload the system, hindering real-time performance.
Solution
We designed and implemented a heterogeneous multi-processor solution leveraging a Cortex-A series applications processor alongside a Cortex-M microcontroller. The Cortex-M was dedicated to the critical task of high-speed ADC data acquisition and pre-processing. This included filtering, calibration, and initial feature extraction – tasks ideally suited to the Cortex-M’s deterministic real-time capabilities. This pre-processing significantly reduced the data volume and computational load on the Cortex-A side.
The core of our solution was establishing efficient, low-latency communication between the two cores using Remote Processor Messaging (RPMsg) – a standardized inter-processor communication protocol. We developed a custom Linux kernel driver for the Cortex-A side, acting as the RPMsg endpoint. This driver received the pre-processed ADC data from a corresponding Cortex-M driver (also developed in-house). We optimized the RPMsg buffer management and message handling to minimize overhead and ensure data integrity, crucial for maintaining the accuracy of the sensor fusion algorithms.
Our team handled the entire software stack:
- Cortex-M Driver: Bare-metal driver development, optimized for the specific ADC hardware and real-time constraints. Included DMA configuration for efficient data transfer to RPMsg buffers and interrupt handling for timely data availability.
- RPMsg Communication Layer: Configuration and optimization of the RPMsg channel, ensuring reliable and secure data transfer between the Cortex-M and Cortex-A cores. We carefully tuned message sizes and transfer rates for optimal performance.
- Cortex-A Kernel Driver: A custom Linux kernel module to receive, validate, and format the data from the Cortex-M. This driver exposed a character device interface for user-space access, providing a clean and efficient data stream.
- User-Space Application: We developed a sophisticated user-space application using Qt and C++20. This application received the pre-processed data from the kernel driver, performed the advanced sensor fusion algorithms, visualized the fused data, and provided a user interface for system configuration and control. We leveraged Qt’s signal/slot mechanism for efficient data handling and responsiveness.
The implemented system achieved:
- Reduced Latency: Significantly decreased data processing latency compared to a purely software-based solution on the Cortex-A, enabling real-time sensor fusion.
- Improved System Responsiveness: Freed up the Cortex-A processor for higher-level tasks, such as path planning or decision-making.
- Enhanced Accuracy: The pre-processing on the Cortex-M and optimized RPMsg communication contributed to more accurate and reliable sensor fusion results.
- Scalability: The RPMsg architecture provides a scalable foundation for adding more sensors and processing tasks in the future.