Contact Us

Linux Is Up but the Real-Time Side Is Frozen? Where OpenAMP and the RPU Break on Zynq UltraScale+

🇰🇷 한국어로 읽기 (Korean version): 리눅스는 살아 있는데 실시간 쪽만 멈춘다? Zynq UltraScale+ OpenAMP·RPU 연동이 끊기는 지점

A Zynq UltraScale+ MPSoC has two kinds of processors that often share one product: the APU (Application Processing Unit, Cortex-A53 cores) that runs Linux, and the RPU (Real-time Processing Unit, two Cortex-R5F cores) that takes the tight control work. The UI, networking, and logs stay on Linux; a motor loop, a sensor period, or a safety function often runs on the RPU. The usual way to connect the two is OpenAMP (Open Asymmetric Multi-Processing) with libmetal.

The question we get from the field is often not "the board is dead." SSH works, the screen is up, and only the real-time side looks frozen. People say the heartbeat stopped, a command was sent and nothing came back, it works for a moment after a power cycle and then stops when a Linux application starts, or remoteproc says running but no messages move.

This note walks the path between Linux and the RPU in that situation: boot life cycle, shared memory, interrupts and cache, message queues, and power or peripheral ownership. Cases where Linux itself does not boot, or a PL (Programmable Logic) IP is missing, are covered in the Zynq PetaLinux PL note. Here we stay on the APU–RPU path.

Times, buffer counts, and memory sizes in this note are typical examples and calculated values to illustrate the idea. They are not measurements from a specific board. Addresses and setting names differ by device and tool version; check the AMD (Xilinx) documentation and the firmware linker script for the version you use.

Where OpenAMP and the RPU break on Zynq UltraScale+: boot life cycle, shared memory, IPI and cache, RPMsg queues, power and peripherals

A short picture of the path makes the symptoms easier to split

A typical setup looks like this. Linux on the APU loads RPU firmware through remoteproc (the remote-processor framework). The two sides build message queues in shared memory and use an IPI (Inter-Processor Interrupt) to say "there is something to read." That message path is commonly called RPMsg (Remote Processor Messaging). The two Cortex-R5F cores can run in lockstep (both execute the same code so an error can be detected) as one logical core, or in split mode as two independent cores.

Who starts the RPU, and when, is not the same on every product. Some boards have the FSBL (First Stage Boot Loader) start the RPU before Linux is up. Others load firmware through remoteproc only after Linux is running. If you do both, Linux can reset an RPU that was already in its control loop.

From the symptom to the point where the link breaks

Field symptomWhere it often breaksWhat to check first
Linux is up, but there is no RPU heartbeat from the startFirmware not loaded, remoteproc failed, lockstep/split mismatchremoteproc state, firmware file name, device tree, RPU reset release
It works just after power-on, then stops when a Linux app startsLinux remoteproc reloads and resets an RPU that the FSBL already started, or IPI / mailbox ownership changesBoot logs for a second remoteproc load, overlapping IPI channels
remoteproc says running, but no messages moveShared-memory or resource-table addresses do not match, or RPMsg channel names differreserved-memory versus the firmware linker addresses, channel names
A message seems to have been sent, but the other side keeps the old valueCache coherency, or APU and RPU address maps mixed upCache attributes of the shared buffer; whether a TCM address is in the APU view or the RPU view
It works for a while, then sends block or the real-time loop stopsThe RPMsg queue is full; the Linux side has stopped receivingQueue depth versus send rate; whether the receive thread is blocked
It stops only after hours, or after idle or display sleepA clock or power domain was turned off, or a shared peripheral is contestedClocks the RPU uses, and shared devices such as a UART or SPI

Boot life cycle: is the firmware running, and who resets the RPU?

The first question is whether the RPU is running the firmware you think it is. If remoteproc is offline, or firmware load failed because the file is missing from /lib/firmware or the name does not match the device tree, the APU can look fine — SSH and the display work — while the real-time side never starts. Building firmware for lockstep and loading it on a core in split mode, or the other way around, can look the same.

The opposite pattern is also common. The FSBL has already started the RPU and the control loop is running, then Linux boots and remoteproc loads firmware onto the same core and resets it. That is a typical reason for "it works for a few seconds after power-on, and stops when the Linux application attaches." Decide which side owns startup, and do not let the other side take the core down again.

Shared memory and the resource table: do both sides use the same addresses?

OpenAMP firmware lists the addresses of shared buffers and virtio queues (vrings) in a resource table. Linux must keep that region out of ordinary kernel and application use with reserved-memory in the device tree. If those addresses differ even slightly, remoteproc can still show running while messages never move, or Linux can overwrite RPU memory and the real-time side stops without warning.

Reserved-memory addresses are board-specific, so what you need to confirm is that the firmware linker script and Linux reserved-memory point at the same physical addresses, and that Linux cannot allocate from that region (for example with no-map). TCM (Tightly Coupled Memory) adds one more trap. The address the RPU uses for its TCM is not the address the APU uses to reach the same memory. If a resource-table entry mixes the two views, one side writes and the other reads the wrong place. The two views of RPU0 TCM, according to the device documentation, are as follows.

ViewATCMBTCM
APU view (RPU0)0xFFE000000xFFE20000
R5 itself0x00x20000

On Zynq UltraScale+, each Cortex-R5F has 64 KB of ATCM and 64 KB of BTCM, or 128 KB of TCM per core, according to the device documentation. In lockstep mode, the two cores’ TCM can be used together as 256 KB. That is enough for real-time code and short state, but not for video frames or large logs. Those buffers usually belong in a reserved DDR region.

IPI and cache: the message was sent, but the other side still sees the old value

Writing into shared memory does not, by itself, mean the other side sees the new value. The APU often maps DDR as cacheable; the RPU may map the same region uncached, or it may need an explicit cache flush and invalidate. Skip that step and the report becomes "I sent a heartbeat, they still have the previous one." The same thing happens if your cache keeps a stale copy of what the other side wrote.

The notification itself uses an IPI mailbox. IPI channels on Zynq UltraScale+ are shared among the PMU (Platform Management Unit), secure firmware, Linux, and the RPU. If the device tree and the firmware point at the same channel, or if a Linux driver takes ownership of a channel during probe, RPMsg that worked just after power-on can stop once Linux is up. IPI hardware latency is usually far below a millisecond. If the real-time response is late by tens of milliseconds, look at a full queue or a blocked Linux thread before you blame the interrupt wire.

RPMsg channels and queues: the names match, but sends block

RPMsg connects only when the channel name (the endpoint) is the same on both sides. A one-character mismatch leaves the other side silent while remoteproc still says running. Even with the right name, a full queue causes a send to block or fail. If the RPU's real-time loop is waiting inside that send, Linux will see a frozen real-time side.

A calculated example: if the RPU sends status at 1 kHz (once every millisecond) and the queue is 16 deep, the queue is full after only 16 ms of late receiving on Linux. If the receive thread spends 20 ms writing a log or updating a display, that alone can stall the sender. In public OpenAMP examples the message buffer is often 512 bytes (an example; it varies by version). Subtract the 16-byte RPMsg header and the usable payload is 496 bytes. Trying to put a large log or a bundle of samples in one message can fail for that reason. Look at the period, the message size, and the queue depth together.

A heartbeat in only one direction makes it slower to see which side is stuck. Short heartbeats in both directions, plus a log of send failures and receive times, make it easier to separate a full queue from a stopped firmware or a cache problem.

Power, clocks, and peripheral ownership: Linux stays up while the real-time clock stops

When Linux enters an idle or unused-clock state, a clock or power domain the RPU still needs can go down with it. That is a place to look when the real-time side stops only after several hours, or only after the display sleeps. The clocks the RPU uses have to be held so that Linux does not treat them as unused.

A UART, I2C, or SPI device opened from both sides without a lock can look similar. If a Linux driver opens the same UART, RPU output can stall, and if the firmware waits on that output, the control loop stalls with it. Decide who owns each shared peripheral at the start, or use a lock both sides agree on.

A checklist to work through when you confirm the fault

  • ☐ Looked at remoteproc state (running/offline) and the firmware load log
  • ☐ Decided whether the FSBL, Linux, or both start the RPU
  • ☐ Lockstep versus split mode matches the firmware and the hardware setup
  • ☐ Physical addresses in reserved-memory, the firmware linker script, and the resource table match
  • ☐ TCM and DDR addresses are not mixed between the APU view and the RPU view
  • ☐ Shared buffers are flushed and invalidated, or mapped uncached
  • ☐ IPI channels do not overlap with the PMU, secure firmware, Linux, or the RPU
  • ☐ RPMsg channel names match, and the queue is deep enough for the send rate
  • ☐ There is a heartbeat in both directions and a log of send failures
  • ☐ Linux does not turn off a clock or power domain the RPU uses
  • ☐ Each shared peripheral, such as a UART, has a clear owner

A missing PL IP, or a broken interrupt or DMA path, is a different part of the chip. If a driver does not bind because the device tree is wrong, the device-tree and probe note is the better starting point.

Related notes

THEFINE provides contract development of OpenAMP/libmetal integration between the PL, APU, and RPU on Zynq UltraScale+, including boot images and the Embedded Linux BSP. If Linux is up but the real-time side stops, send us the board, the PetaLinux or Yocto version, whether the RPU is in lockstep or split mode, what the RPU is supposed to do, and when it stops.

Related services: SoC / FPGA development · Embedded Linux development

Contact us / Request a quote | ☎ +82-31-498-3130