Last edited 3 weeks ago

Cortex-M coprocessor management overview

(Redirected from Coprocessor management overview)

This article provides an overview of the management of the heterogeneous asymmetric architecture implemented in the STM32 MPU microprocessor family. It provides information on mechanisms put in place to help developers to design software in the multiprocessor system.

1. System overview[edit | edit source]

The STM32 MPU multiprocessor system allows to run independent firmwares on each CPU core. The below subsystems are involved in the management of the coexistence of the two CPU subsystems:

  • An Arm® Cortex®-A processor optimized to run the Linux® based OS.
  • An Arm® Cortex®-M processor to run a RTOS optimized for microcontrollers or a bare-metal application.
  • Internal or External memories with access granted for both CPU cores processors:
    • To load and execute processor firmware images.
    • To share buffers for inter processing communication through a messaging infrastructure.
  • An inter-processor communication controller peripheral allowing a signaling system by a dedicated mailbox.
  • Internal peripheral resources that can be assigned to one of the processors.

Copro-hw-overview.png

2. Functional features and design[edit | edit source]

In order to manage the remote processor, a list of services is proposed relying on the open-source RemoteProc and RPMsg frameworks. These frameworks are introduced in chapters below with links to dedicated articles for further explanation.

Copro-sw-overview.png

2.1. Load and control the Cortex-M firmware[edit | edit source]

The Linux OS integrates the RemoteProc framework that allows to load firmware and control remote processors.

2.2. Resources management (for shared peripheral, clocks, GPIOs...)[edit | edit source]

2.2.1. STM32MP15x lines More info.png[edit | edit source]

The resource manager proposes services to manage common resources and avoid any conflict.

  • Peripheral assignment request: the mechanism used to ensure that a peripheral is reserved for a processor usage. The principle is that a firmware requests the peripheral before starting to use it, relying on the ETZPC table.
  • Remote processor resource configuration set: services available in the Cortex®-A, running Linux, to configure the system resources needed to operate the peripheral on the Cortex®-M. The service is implemented by rproc_srm[1] [2] drivers.

2.2.2. STM32MP2 series[edit | edit source]

At boot time the resource isolation framework (RIF) configure the system to manage common resources and to assign/isolate/share peripherals.

2.3. Inter processor communication[edit | edit source]

Inter processor communication is based on RPMsg framework and Mailbox mechanisms.

2.3.1. RPMSG framework[edit | edit source]

Copro-sw-ipc-overview.png

  • On Cortex®-A:
  • The RemoteProc framework is in charge of enabling the IPC on Linux side, based on information available in the firmware resource table.
  • The RPMsg service is implemented by the RPMsg framework.
  • The mailbox service is implemented by the stm32_ipcc mailbox framework.
  • On Cortex®-M:

2.3.2. Mailbox client interface[edit | edit source]

Copro-sw-ipc-mailbox-overview.png

  • On Cortex®-A:
  • The mailbox client char device[3] is in charge of providing a /dev/mailbox<0> user space interface to communicate with the Cortex®-M, relying on a memory region and the mailbox service.
  • The mailbox service is implemented by the stm32_ipcc mailbox driver.
  • On Cortex®-M:
  • The application directly accesses to the shared memory.
  • The mailbox service is implemented by the HAL_IPCC driver.

3. References[edit | edit source]