ZU+ Example - Power Off Suspend

See Power Off Suspend for details about this feature.

Prerequisites

  1. You have a ZCU102 development board.
  2. You have used the SDK (2018.1 or later) to build.
  3. Vivado (2018.1 or later release)

Power off Suspend

Power off suspend is the new feature in the Xilinx Power Management where APU, RPU and PMU will be power down and current state will be stored on DDR Memory.
Except clock all other peripherals such as UART,OCM,TCM will be powered down. MSP430 processor will be used as source for waking up the system.

Steps for Enabling Power off Suspend feature

Create HDF with GPO2 polarity to High

  1. Start Xilinx Vivado 2018.1
  2. Open block design, customize block design using double click on "Zynq UltraScale+ MPSoC" block. (or right click and then click on "Customize Block" option)
  3. On the "Page Navigator" bar, click on I/O configuration.
  4. Go to Low Speed -> IO Peripherals -> PMU -> GPO2. Default polarity of GPO2 is low. Change GPO2 polarity to high as per below snapshot and click "OK".
    vivado_snap6.JPG
  5. In the Flow Navigator → PROGRAM and DEBUG, click on "Generate Bitstream" option.
  6. Export HDF file
  • Go to File → Export → Export Hardware
  • Check "Include bitstream in HDF" option. Set export path if required or keep it default(<Local to Project>). Click "OK"
  • In case of default path, HDF file will be generated at <workspace>/<project_name>/<project_name>.sdk/<block_name>.hdf.

Create new hardware platform using HDF

  1. Start Xilinx SDK 2018.1
  2. In application project click "New" to create new hardware platform.
    sdk_snap1.JPG
  3. Give a new hardware platform name and give path of HDF which should be new generated HDF file. Click "Finish".
    sdk_snap2.JPG

For PMU Firmware

1. Start Xilinx SDK 2018.1.
2. Go to File → New Application Project
3. Give a project name Ex. pmu_fw
4. Select standalone in OS Platform category. Select ZCU102_hw_platform_customized in Hardware Platform category. Select appropriate processor (e.g. psu_pmu_0) from the processor list. Then select next.
5. Select ZynqMP PMU Firmware application from the template then select finish to create project. Wait for the BSP to complete building before proceeding.

sdk_snap3.JPG

Steps for setting compile flags

1.Navigate to the BSP Settings (Right-click on your BSP -> Board Support Package Settings). Ex pmu_fw_bsp
2.Click Overview -> drivers -> cpu (psu_pmu_0) -> extra_compiler_flags.
3.Click on Value of extra_compiler_flags and add below flags
-DENABLE_POS -DENABLE_QSPI
4. Press OK
5. Go to pmu_fw_bsp -> Makefile and check if the above flags (-DENABLE_POS and -DENABLE_QSPI) are added under "EXTRA_COMPILER_FLAGS" section in the Makefile.

sdk_snap5.JPG

For FSBL

1. Start Xilinx SDK 2018.1.
2. Go to File → New Application Project
3. Give a project name Ex. fsbl
4.Select standalone in OS Platform category. Select ZCU102_hw_platform_customized in Hardware Platform category. Select appropriate processor (e.g. psu_cortex53_0) from the processor list. Then select next.
5. Select Zynq MP FSBL from the template then select finish to create project. Wait for the BSP to complete building before proceeding.

sdk_snap4.JPG

Steps for setting compile flags

1.Navigate to the BSP Settings (Right-click on your BSP -> Board Support Package Settings). Ex fsbl_bsp
2.Click Overview -> drivers -> cpu (psu_cortexa53_0) -> extra_compiler_flags.
3. Click on Value of extra_compiler_flags and add below flag
-DENABLE_POS
4.Press OK
5. Go to fsbl_bsp -> Makefile and check if the above flag (-DENABLE_POS) is added to "EXTRA_COMPILER_FLAGS" section in the Makefile.
sdk_snap6.JPG

Step after adding flags in PMU and FSBL

Compile and build the project and now power off suspend feature will be included in any application project.

MSP430

Please click on the link to read about MSP430 procedure -
http://www.wiki.xilinx.com/Zynq+UltraScale%EF%BC%8B+MPSoC+Power+Advantage+Tool+part+7+-+Building+and+Running+the+MSP430+Design+from+Source

For enabling power off suspend feature user needs to replace the current MSP430.txt file with the new MSP430.txt file.

Update MSP430 firmware with the image below:




For PetaLinux Users


To suspend, type this in the Linux console:
echo request_wakeup 8 1 0 1 > /sys/kernel/debug/zynqmp-firmware/pm
echo force_powerdown 6 > /sys/kernel/debug/zynqmp-firmware/pm
echo power-off > /sys/devices/platform/firmware/suspend_mode
echo mem > /sys/power/state
After using above command on the linux console, system will go to power off suspend mode.

SuspendOff.png

In power off suspend
LED such as DS24, DS26,DS21, PSPLL and PSAUX should be in off state.

If user uses power advantage tool then user will see that power reading of FPD, LPD and PL domain should be 0 mW.

PowerTool.png


Note:- At a time user can either use power adavantage tool or MSP430 console as both uses same com port.


For resuming the linux user needs to open UART Interface 3 port.
Go to Device Manager -> Ports
See the com port number for UART Interface 3

Port9.png
Now go to Tera Term/PuTTY (for opening port) and open this port. Here Ex. COM9 at baud rate - 1152000.
Now to resume, type this in the MSP430 console i.e. on port COM9:
@wake

COM12.png

After sending @wake signal to com port system will wake up and user can see logs on the Linux console.

Related Links