Introduction The code in src/wf_example illustrates the use of WFI or WFE calls that put the calling ARM core into clock gating mode to save power. This project makes use of the "Sparrow" baremetal/amp build framework. ===================================================================== Source Files src/wf_example/main.c src/wf_example/wf_example.c "sleeps." => Set up CPUs and kick things off. => Run "heartbeats" on each CPU with intermittent ===================================================================== Building the Example 1. Unzip this archive. 2. Navigate to the top level directory. 3. Open an embedded command shell. 4. Set the environment variable for CROSS_COMPILE 5. Optionally set VERBOSE=true 6. Run "make wf_example" 7. A "sparrow.axf" file is created in bin/wf_example. Example build flow captured below: **if you are using SoC EDS 13.1, then use the following command as your cross compiler ** > export CROSS_COMPILE=arm-none-eabi- **if you are using SoC EDS 14.0, then use the following command as your cross compiler ** > export CROSS_COMPILE=arm-altera-eabi- ~/work/sparrow_wfe/wfi_wfe_usage > export VERBOSE=true ~/work/sparrow_wfe/wfi_wfe_usage > make wf_example
mkdir -p bin/wf_example mkdir -p gen/wf_example python src/sparrow/sparrow.py src/wf_example/layout.py -C gen/wf_example/layout.c -H gen/wf_example/layout.h arm-none-eabi-gcc -march=armv7-a -mtune=cortex-a9 -mcpu=cortex-a9 -mfpu=neon -mfloatabi=hard -marm -c -I src/sparrow -I src/qcom -I hwlib/include -I gen/wf_example -DARM -g - fno-builtin -std=c99 -DALT_INT_PROVISION_VECTOR_SUPPORT=0 -I src/sparrow -I src/qcom -I hwlib/include -I gen/wf_example -DARM -DASM -o bin/wf_example/startup.o src/sparrow/startup.s... <Many more files built here>... *** Created bin/wf_example/sparrow.bin *** arm-none-eabi-objdump -DS bin/wf_example/sparrow.axf >bin/wf_example/sparrow.txt python src/sparrow/sparrow.py src/wf_example/layout.py -p >bin/wf_example/sparrow.map python src/sparrow/sparrow.py src/wf_example/layout.py -boots gen/wf_example/boot.script PATH=/home/brendan/.local/bin:/opt/altera/13.1b162/quartus/bin:/opt/altera/13.1b162/quartus/s opc_builder/bin:/opt/altera/13.1b162/embedded/host_tools/altera/preloadergen:/opt/altera/13.1b1 62/embedded/host_tools/altera/mkpimage:/opt/altera/13.1b162/embedded/host_tools/altera/devic e_tree:/opt/altera/13.1b162/embedded/host_tools/gnu/h-i686-pc-linuxgnu/bin:/opt/altera/13.1b162/embedded/host_tools/mentor/gnu/arm/baremetal/bin:/opt/altera/13. 1b162/embedded/host_tools/python/bin:/opt/altera/13.1b162/embedded/ds- 5/bin:/home/brendan/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/gam es:/usr/local/games:prebuilt mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "bootscript" -d gen/wf_example/boot.script bin/wf_example/u-boot.scr > /dev/null =================================================================== Running the Example In order to run the design example, you have to load the generated binary (sparrow.axf) onto the board by using Eclipse DS-5 application. Please make sure the SD card already contains the SD image. **If you want to know how to write the SD card image onto an SD card, please refer to the GSRD User Manual in rocketboards.org. 1. Connect the Cyclone V SoC Development kit to your local host PC and power-up the board. **Do not slot the SD card into the board yet.**
2. Open the DS-5 application and click on the Debug view in the upper right part of Eclipse as shown below: 3. In the Debug Tab, right click and select Debug Configurations 4. On the new screen, right click DS-5 Debugger -> New 5. On the connection tab, select Altera -> Cyclone V SoC (Dual Core) -> Bare Metal Debug -> Debug Cortex-A9_0 6. Click Debug to connect to the board. 7. Run a terminal program. Putty console is a good choice if you are Window OS user. i.) Determine which serial port you were assigned. ii.) Go to Control Panel -> Hardware and Sound -> Devices and Printers -> Device Manger -> Ports (COM & LPT) :
iii.) In Putty Configuration, Select Serial (near the bottom) and use these options. iv.) Click Open 8. Now, slot the SD card into the board and perform warm reset. 9. Pause the U-boot by pressing "Enter." The Putty console should show the screen as below:
10. In the DS-5 program, click pause :
11. Issue the loadfile command in the Commands tab: loadfile "<Directory of Power Optimization design file>\bin\wf_example\sparrow.axf" 12. Click the Play button:
13. Then enter go 0x40 in the Putty Console: 14. Lastly, the Putty Console shows the following screen if the design run successfully: 15. Use the warm reset button to get back to a U-boot prompt.