芯路恒电子技术论坛

 找回密码
 立即注册

微信扫码登录

手机号码,快捷登录

手机号码,快捷登录

热搜: 合集
查看: 329|回复: 0

在nios command shell中下载指定sof和elf文件并打开jtag uart串口的脚本

[复制链接]
  • TA的每日心情
    慵懒
    2021-2-24 10:16
  • 467

    主题

    410

    回帖

    1万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    16826
    QQ
    发表于 2026-8-1 12:48:29 | 显示全部楼层 |阅读模式
    在nios command shell中下载指定sof和elf文件并打开jtag uart串口的脚本



    1. #!/bin/bash

    2. SOF_FILE='E:/FPGA_DEV/AC597/ddr3_nios/output_files/ddr3_nios.sof'
    3. ELF_FILE='E:/FPGA_DEV/AC597/ddr3_nios/software/ddr3_nios/ddr3_nios.elf'

    4. echo "============================================================"
    5. echo " AC597 DDR3 Nios II download script"
    6. echo "============================================================"

    7. echo
    8. echo "[1/4] Checking JTAG connection..."
    9. jtagconfig
    10. if [ $? -ne 0 ]; then
    11.     echo
    12.     echo "ERROR: JTAG connection check failed."
    13.     exit 1
    14. fi

    15. echo
    16. echo "[2/4] Programming FPGA with SOF..."
    17. quartus_pgm -m jtag -o "p;${SOF_FILE}"
    18. if [ $? -ne 0 ]; then
    19.     echo
    20.     echo "ERROR: SOF programming failed."
    21.     exit 1
    22. fi

    23. # Wait briefly for the newly configured Nios II/JTAG Debug Module
    24. # to become visible on the JTAG chain.
    25. sleep 1

    26. echo
    27. echo "[3/4] Downloading and starting ELF..."
    28. nios2-download -g "${ELF_FILE}"
    29. if [ $? -ne 0 ]; then
    30.     echo
    31.     echo "ERROR: ELF download failed."
    32.     exit 1
    33. fi

    34. echo
    35. echo "[4/4] Opening JTAG UART terminal..."
    36. echo "Press Ctrl+C to close the terminal."
    37. echo
    38. nios2-terminal

    复制代码

    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|小黑屋|Archiver|芯路恒电子技术论坛 |鄂ICP备2021003648号

    GMT+8, 2026-8-24 15:09 , Processed in 0.050347 second(s), 34 queries .

    Powered by Discuz! X3.4

    © 2001-2017 Comsenz Inc. Template By 【未来科技】【 www.wekei.cn 】

    快速回复 返回顶部 返回列表