【Xilinx】如何用代码使能和禁用jtag功能

一、使能jtag

Xil_Out32(0xffca0038,0x3F);
Xil_Out32(0xffca003C,0xFF);
Xil_Out32(0xffca0030,0x3);
Xil_Out32(0xFF5E00B0,0x01002002);
Xil_Out32(0xFF5E0240,0x0);
Xil_Out32(0xFFCA3000,0x1);

1. jtag_sec [0xffca0038]=0x3F

0011 1111
bit5:3 = 111
ssss_pltap_sec
Setting these bits disables the security gate for the PLTAP and allows the PSTAP to connect to the PL for bitstream loading and boundary scan operations. All bits must be set to 1 to release the security gate. (POR reset only)

bit2:0 = 111
ssss_dap_sec
Setting these bits disables the security gate for the Arm DAP and allows the PS TAP or PJTAG to connect to the DAP. All bits must be set to 1 for the security gate to be released. (POR reset only)
https://support.xilinx.com/s/article/68391?language=en_US

2. jtag_dap_cfg [0xffca003C]=0xFF

在这里插入图片描述

3. jtag_chain_cfg [0xffca0030]=0x3

0x3
bit1 = 1
bit0 = 1
在这里插入图片描述

4. DBG_LPD_CTRL [0xFF5E00B0]=0x01002002

0000 0001 0000 0000 0010 0000 0000 0010
bit2:0 = 010 IOPLL
bit13:8 = 100000 分频比32
bit24 = 1 Clock active control.
在这里插入图片描述

5. RST_LPD_DBG [0xFF5E0240]=0x0

在这里插入图片描述

6. pcap_prog [0xFFCA3000]=0x1

在这里插入图片描述

二、禁用jtag

对于用户希望在 FSBL 执行后禁用 DAP 访问的非安全用例,可以执行以下步骤。
比如在功能安全的应用中,用户不希望JTAG活动干扰处理器的代码执行。
禁用 DAP 的顺序如下所示:

Xil_Out32(0xffca0030, 0x0);
Xil_Out32(0xffca003C, 0x0);
Xil_Out32(0xffca0038, 0x0);

寄存器含义参考上面第一章的内容

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值