Using Cortex-M4F on Verdin AM62 with Torizon OS for UART + GPIO + PWM (A53 ↔ M4 communication)

I am working with a Toradex Verdin AM62 Quad running Torizon OS 7.6. I would like to utilize the Cortex-M4F core for real-time tasks while Linux runs on the Cortex-A53.

My requirements are as follows:

  • The Cortex-M4F should:

    • Read data continuously over UART

    • Log/store this incoming UART data continuously

    • Control four digital output pins

    • Generate a PWM signal

  • The Cortex-A53 (Linux side) should:

    • Send control data to the M4F

    • This data determines:

      • The state of the four digital outputs

      • The parameters of the PWM signal (e.g., duty cycle, frequency)

      I am looking for specific guidance and resources for the following:

  1. Recommended SDK and workflow for developing and running firmware on the Cortex-M4F in this setup
    (e.g., TI MCU+ SDK with remoteproc on Torizon OS)
  2. Recommended communication mechanism between A53 and M4F
    (e.g., RPMsg or other IPC methods)
  3. Reference examples or documentation for:
    • UART handling on M4F

    • GPIO and PWM control

    • A53–M4F communication

Hi, I’m the Toradex AI Assistant.

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


Heterogeneous Multi-core Processing on Verdin AM62

Your project is an excellent use case for Heterogeneous Multi-core Processing (HMP), which enables pairing a high-performance application processor running Linux (Cortex-A) with one or more low-power real-time cores (Cortex-M or Cortex-R) (1).

Recommended SDK and Workflow

For TI-based modules like the Verdin AM62, you should use the TI MCU+ SDK for Cortex-M4F development (1). The Verdin AM62 features a Cortex-M4F processor designed to meet SIL-2 safety requirements, running at up to 400MHz, which can be used to run safety tasks or as a general-purpose MCU (2).

Communication Mechanism

RPMsg is the recommended method for communication between the Cortex-M4F and Cortex-A53 cores (1). RPMsg is an IPC protocol built on top of RemoteProc for message-based communication between Linux and Cortex-M/R (1).

Common Use Cases Matching Your Requirements

Your project aligns perfectly with documented HMP use cases (1):

  • Deterministic GPIO/LED control: RTOS owns the GPIO hardware and executes time-critical I/O, while Linux sends control commands via RPMsg, ensuring predictable response times under all system loads (1)
  • Sensor acquisition on RTOS, processing on Linux: RTOS performs precise, periodic sensor sampling and shares data with Linux, which handles logging, visualization, analytics, and networking (1)

Getting Started Resources

For TI-based modules like your Verdin AM62, you should follow the guide for Setting Up MCU+ SDK and Toolchain for HMP Development (1).

Hardware Specifications

The Verdin AM62 supports the interfaces you need (3)(2):

  • UART: 9x available (3)
  • PWM: 6x available (3)
  • GPIO: Up to 104x available (3)
  • Cortex-M4F: Single Arm Cortex-M4F @ 400MHz (3)

Memory Communication Options

For data exchange between cores, you have multiple options (1):

  • RPMsg: IPC protocol for message-based communication
  • Shared Memory: Memory region mapped into both domains for fast data exchange
  • RemoteProc: Linux kernel framework to boot and control remote processors

Next Steps

  1. Set up the TI MCU+ SDK and toolchain for HMP development
  2. Review the HMP overview documentation for architecture understanding
  3. Implement RPMsg communication for A53-M4F control data exchange
  4. Develop M4F firmware for UART data logging, GPIO control, and PWM generation

The heterogeneous architecture will allow your M4F to handle real-time tasks (UART data logging, GPIO/PWM control) while the A53 manages higher-level functions and sends control parameters via RPMsg (1).

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 @DonDavis123!

I would recommend starting at the Setting Up MCU+ SDK and Toolchain for HMP Development article. After you’ve followed all the steps, you may proceed to the next one to learn how to compile and run firmware on the Cortex-M4.

Regarding the examples, you can use the steps described in the articles to run different ones. All the examples are present in the MCU+ SDK folder:

tree examples/drivers/ -L 1
examples/drivers/
├── boot
├── ddr
├── ecap
├── epwm
├── eqep
├── gpio
├── gpmc
├── i2c
├── ipc
├── mcan
├── mcasp
├── mcspi
├── mmcsd
├── ospi
├── safety
├── sciclient
├── spinlock
├── uart
├── udma
└── watchdog

Best regards.