📄 create-this-app
字号:
#!/bin/bash## This script creates the factory image application in this directory.BSP_DIR=../../bsp/hal_reduced_footprintQUARTUS_PROJECT_DIR=../../../NIOS2_APP_GEN_ARGS="--elf-name app_image_sw.elf --set APP_CFLAGS_OPTIMIZATION -Os --set OBJDUMP_INCLUDE_SOURCE 1 --src-files app_image_main.c"ELF2HEX_ARGS="--base=0x04001000 --end=0x4001FFF --width=32 --input=./app_image_sw.elf --output=../../../onchip_mem.hex --create-lanes=0"# First, check to see if $SOPC_KIT_NIOS2 environmental variable is set.# This variable is required for the command line tools to execute correctly.if [ -z $SOPC_KIT_NIOS2 ]then echo Required \$SOPC_KIT_NIOS2 Environmental Variable is not set! exit 1fi# Also make sure that the APP has not been created already. Check for# existence of Makefile in the app directoryif [ -f ./Makefile ]then echo Application has already been created! Delete Makefile if you want to create a new application makefile exit 1fi# We are selecting hal_reduced_footprint bsp because it supports this application.# Check to see if the hal_reduced_footprint has already been generated by checking for # existence of the public.mk file. If not, we need to run# create-this-bsp file to generate the bsp.if [ ! -f $BSP_DIR/public.mk ]; then # Since BSP doesn't exist, create the BSP # Pass any command line arguments passed to this script to the BSP. pushd $BSP_DIR >> /dev/null ./create-this-bsp "$@" || { echo "create-this-bsp failed" exit 1 } popd >> /dev/nullfi# Don't run make if create-this-app script is called with --no-make argSKIP_MAKE=while [ $# -gt 0 ]do case "$1" in --no-make) SKIP_MAKE=1 ;; esac shiftdonecmd="nios2-app-generate-makefile --bsp-dir $BSP_DIR --set QUARTUS_PROJECT_DIR=$QUARTUS_PROJECT_DIR $NIOS2_APP_GEN_ARGS"echo "create-this-app: Running \"$cmd\""$cmd || { echo "nios2-app-generate-makefile failed" exit 1}if [ -z "$SKIP_MAKE" ]; then cmd="make" echo "create-this-app: Running \"$cmd\"" $cmd || { echo "make failed" exit 1 } cmd="elf2hex $ELF2HEX_ARGS" echo "create-this-app: Running \"$cmd\"" $cmd || { echo "elf2hex failed" exit 1 } echo echo "To download and run the application:" echo " 1. Make sure the board is connected to the system." echo " 2. Run 'nios2-configure-sof <SOF_FILE_PATH>' to configure the FPGA with the hardware design." echo " 3. If you have a stdio device, run 'nios2-terminal' in a different shell." echo " 4. Run 'make download-elf' from the application directory." echo echo "To debug the application:" echo " Import the project into Nios II IDE. Refer to Nios II IDE Documentation for more information." echo echo -e ""fiexit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -