ZCU102 development board (This design example has been tested on silicon 3.0 revD board).
SDK (2017.1 or later release)
Petalinux (2017.1 or later release)
The RPU can be configured to service regular real-time events while the APU remains suspended most of the time. A typical example would be an automotive engine management unit, where the RPU would perform typical engine management functions at regular interval of 2 seconds. The APU would only wake up for passenger entertainment functions, software upgrade and to service other non-realtime events.
Linux/baremetal application boots on the APU.
Real-time application runs on the RPU.
RPU requests the APU to suspend.
APU suspends itself.
RPU sets the RTC to expire in 2 second, in auto-rearm mode.
RPU sets the RTC as the wake-up source.
RPU suspends itself.
RPU wakes up and perform real-time service. In this example, the RPU toggles the DS50 LED.
RPU suspends itself, and the same repeats.
Steps to build demo example standalone applications
APU Application (APU can run either standalone application or Linux.):
APU running standalone application.
Start with an empty APU application (like the Hello World example here).
Start with an empty RPU application (like the Hello World example here).
Configure the RPU to run from TCM (see bellow image.)
(Default HDF has split mode, So RPU will run in split mode. If application doesn't fit into default memory region, user may need to divide the sections for ATCM and BTCM memory regions in lscript.ld file. For more information please see Table 4-5: TCM Address Map in TRM. When running in split mode, each R5 processor has 64KB ATCM and 64KB BTCM. So, user has to divide sections across ATCM and BTCM. As per below snapshot vectors and text sections are in ATCM and other sections are in BTCM)
Create a boot and root partition in SD card and copy BOOT.bin file to boot partition.
Copy image.ub and system.dtb from Petalinux pre-built images to boot partition of the SD card.
Boot the ZCU102 board in SD boot mode.
After booting linux write following lines on linux console. (In petalinux prebuilt image by default RTC wakeup source is enabled. So you need to disable RTC wakeup source otherwise Linux can wakeup from RTC)(In petalinux prebuilt image by default split mode config object is present, So if RPU is running in split mode, RPU1 needs to be powered down, else PMU would consider it PM disabled PU and would not released all unused nodes causing FPD on during APU suspend)
The DS50 LED will on for 2 seconds when RPU wakes up, after that RPU goes down to sleep for 2 seconds. RPU wakes up again and same cycle repeats every time. One can change LED on time (or do another task instead of LED on/off) and RPU sleep time according to requirement.
Steps to run demo example (APU running standalone application) using SD boot mode
Create RPU and APU application from SDK as described in above section.
Create a new folder and copy pmufw.elf, fsbl.elf from Petalinux pre-built images. Also copy apu.elf and rpu.elf into same folder.
Create demo-example.bif file in same folder as shown below.
The APU application will wait for RPU to boot and send request suspend. After receiving suspend callback APU will be suspended using self suspend. The DS50 LED will on for 2 seconds when RPU wakes up, after that RPU goes down to sleep for 2 seconds. RPU wakes up again and same cycle repeats every time. One can change LED on time (or do another task instead of LED on/off) and RPU sleep time according to requirement.
Open Xilinx SDK (It is assumed that APU standalone application, RPU standalone application and PMU firmware are already built using SDK).
In Project Explorer, right-click the RPU-app project and select Debug As > Debug Configurations... popup window appears. Double click on Xilinx C/C++ application (system Debugger). Click on application tab and select checkbox as per below snapshot for each selected application.
Click on Target Setup tab and select checkbox as per below snapshot and click on Apply.
Now click on debug. A new debug popup window with debug prospective configuration appears. Cortex-A53 will be stopped at main() due to breakpoint.
Select Cortex-A53 processor in debug window and click Resume to continue application.
Open serial console COM2 and it will display as per below snapshot.
Similarly Cortex-R5 will be stopped at main() due to breakpoint.
Select Cortex-R5 processor in debug window and select Resume to continue running the program.
In serial console COM2 it will display as per below snapshot.
Select Skip All Breakpoints from tool bar. Now click on Resume.
Application will now run without stopping at anywhere. RPU state will change from Running to Halted and vice versa at 2 seconds. Similarly DS50 LED will remain on for 2 seconds after that RPU goes to sleep for 2 seconds.