感谢矿难,咸鱼有不少二三十块钱的阉割版BeagleBoneBlack
AM335x采用的是TI的JTAG接口,但是xds系列仿真器虽然开源但是很贵:
xds100 150左右 速度很慢
xds510 一万多元(有幸在上家公司使用过)
既然是JTAG接口,可以尝试用JLink(当然是山货)的JTAG接口进行调试,我尝试了,是成功的!
我对比了一下JLink和XDS510仿真器的优缺点:
离线
JTAG接口是在背面:
TI的JTAG标准:
JLink与TI-JTAG连接方式:
实物图:
离线
因为要对AM335x进行仿真,需要先对其进行初始化(PMIC等),所以如果先要测试是否连接JTAG成功,可以利用现有的sd卡linux系统镜像,在uboot阶段对JTAG进行测试(因为进入Linux后,JTAG所使用的GPIO已经被复用到别的功能了)。
插入sd卡,上电过程中,在命令行输入运行JLink命令:
JLinkEXE
然后输入:
device am335x
然后输入halt命令:
h
可以看到am335x寄存器当前的值
然后串口输出启动过程停止
说明JTAG调试成功
离线
离线
选择AM335x处理器所属系列:
选择JLink仿真安装:
离线
下载适用于 AM335X Sitara™ 处理器的处理器 SDK :
http://www.ti.com.cn/tool/cn/PROCESSOR-SDK-AM335X
下载PROCESSOR-SDK-RTOS-AM335X:
http://software-dl.ti.com/processor-sdk-rtos/esd/AM335X/latest/index_FDS.html
我下载的Linux版本 PROCESSOR-SDK-RTOS-AM335X 06_00_00_07:
http://software-dl.ti.com/processor-sdk-rtos/esd/AM335X/latest/exports/ti-processor-sdk-rtos-am335x-evm-06.00.00.07-Linux-x86-Install.bin
离线
我也有快BBB,期待楼主分享
离线
打开CCS:
开始导入AM335X的SDK到CCS:
点击右边ADD添加刚才安装的SDK的路径:
点击下面Rediscover,然后安装发现的所有包:
重启CCS加载
离线
SYS/BIOS 实时内核 资料:
http://www.ti.com.cn/tool/cn/SYSBIOS
新建一个SYSBIOS工程:
阉割版是AM3352,选择JLink调试,选择CortexA核,选择SYSBIOS:
选择ti.platforms.beaglebone平台,主要作用是内存分布,给工程的lds提供数据:
离线
配置仿真的初始化脚本gel文件,类似JLink脚本,完成PMIC、时钟等初始化,其实是比JLink脚本更高一个级别的脚本
选择【CCS】安装目录/ccs/ccs_base/emulation/boards/beaglebone/gel/beagleboneblack.gel
离线
建了交流群
离线
启动仿真:
启动仿真后,出现AM3352的两个核:
右键A8核,然后Connect:
经过测试V8连接几分钟后会自动断开,V9正常仿真。
离线
对SYSBIOS工程进行编译:
离线
加载SYSBIOS到A8
选择A8核,选择load:
离线
加载成功,可以进行单步调试
离线
这是GEL初始化脚本的输出信息:
离线
离线
BIOS驱动全不全
离线
BIOS驱动全不全
驱动在PDK里面 BIOS内核 区分开来
UIA负责收集操作系统信息,在CCS进行可视化分析。
NDK是网络
驱动基本挺全的:
最近编辑记录 Jin劲 (2019-08-06 14:38:59)
离线
可以直接在linux下装sdk编译linux和uboot镜像,但是编译uboot要把对板载的eeprom的识别注释掉,不然识别不到ID不能正常启动
离线
可以直接在linux下装sdk编译linux和uboot镜像,但是编译uboot要把对板载的eeprom的识别注释掉,不然识别不到ID不能正常启动
这里不跑Linux 跑TI自己的实时内核SYSBIOS
离线
我用jlink v10死活连不上. 不知道什么地方有问题
离线
我用jlink v10死活连不上. 不知道什么地方有问题
经过我多天的折腾, 终于能够连上了. 测试发现cti jtag的15脚必须和jlink的15脚连接, 否则不能识别.
未连接15脚的log:
$ JLinkExe
SEGGER J-Link Commander V6.92 (Compiled Dec 18 2020 14:11:06)
DLL version V6.92, compiled Dec 18 2020 14:10:53
Connecting to J-Link via USB...O.K.
Firmware: J-Link V11 compiled Dec 11 2020 15:39:51
Hardware version: V11.00
S/N: xxxxxxxx
License(s): GDB, JFlash, FlashDL, RDI, FlashBP
VTref=3.348V
Type "connect" to establish a target connection, '?' for help
J-Link>connect
Please specify device / core. <Default>: AM3359
Type '?' for selection dialog
Device>
Please specify target interface:
J) JTAG (Default)
S) SWD
T) cJTAG
TIF>
Device position in JTAG chain (IRPre,DRPre) <Default>: -1,-1 => Auto-detect
JTAGConf>
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>4000
Device "AM3359" selected.
Connecting to target via JTAG
InitTarget() start
TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFC1A4C40001
TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFC1A4C40001
AM335x connect: Can not find ICE-Pick (IRLen mismatch)
TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFC1A4C40001
TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFC1A4C40001
TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFC1A4C40001
TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFC1A4C40001
TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFC1A4C40001
AM335x connect: Can not find Cortex-A8 (IDCODE mismatch).
InitTarget() end
InitTarget() start
TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFC1A4C40001
TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFC1A4C40001
AM335x connect: Can not find ICE-Pick (IRLen mismatch)
TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFC1A4C40001
AM335x (connect):Can not find ICE-Pick (IDCODE mismatch). Expected 0x0B00002F, found: 0x00000000
InitTarget() end
****** Error: Failed to measure TotalIRLen.
InitTarget() start
TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFC1A4C40001
TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFC1A4C40001
AM335x connect: Can not find ICE-Pick (IRLen mismatch)
TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFC1A4C40001
AM335x (connect):Can not find ICE-Pick (IDCODE mismatch). Expected 0x0B00002F, found: 0x00000000
InitTarget() end
InitTarget() start
TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFC1A4C40001
TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFC1A4C40001
AM335x connect: Can not find ICE-Pick (IRLen mismatch)
TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFC1A4C40001
AM335x (connect):Can not find ICE-Pick (IDCODE mismatch). Expected 0x0B00002F, found: 0x00000000
InitTarget() end
****** Error: Failed to measure TotalIRLen.
Cannot connect to target.
J-Link>q
连接15脚之后的log:
$ JLinkExe
SEGGER J-Link Commander V6.92 (Compiled Dec 18 2020 14:11:06)
DLL version V6.92, compiled Dec 18 2020 14:10:53
Connecting to J-Link via USB...O.K.
Firmware: J-Link V11 compiled Dec 11 2020 15:39:51
Hardware version: V11.00
S/N: xxxxxxxx
License(s): GDB, JFlash, FlashDL, RDI, FlashBP
VTref=3.348V
Type "connect" to establish a target connection, '?' for help
J-Link>connect
Please specify device / core. <Default>: AM3359
Type '?' for selection dialog
Device>
Please specify target interface:
J) JTAG (Default)
S) SWD
T) cJTAG
TIF>
Device position in JTAG chain (IRPre,DRPre) <Default>: -1,-1 => Auto-detect
JTAGConf>
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>
Device "AM3359" selected.
Connecting to target via JTAG
InitTarget() start
TotalIRLen = 6, IRPrint = 0x01
TotalIRLen = 6, IRPrint = 0x01
JTAG chain detection found 1 devices:
#0 Id: 0x2B94402F, IRLen: 06, TI ICEPick
AM335x reset: Core did not halt after reset. Halting core manually...
InitTarget() end
TotalIRLen = 10, IRPrint = 0x0011
JTAG chain detection found 2 devices:
#0 Id: 0x3BA00477, IRLen: 04, CoreSight JTAG-DP
#1 Id: 0x2B94402F, IRLen: 06, TI ICEPick
DPv0 detected
AP map detection skipped. Manually configured AP map found.
AP[0]: AHB-AP (IDR: Not set)
AP[1]: APB-AP (IDR: Not set)
AP[2]: JTAG-AP (IDR: Not set)
Iterating through AP map to find APB-AP to use
AP[0]: Skipped. Not an APB-AP
AP[1]: APB-AP found
Found Cortex-A8 r3p2
6 code breakpoints, 2 data breakpoints
Debug architecture ARMv7.0
Data endian: little
Main ID register: 0x413FC082
I-Cache L1: 32 KB, 128 Sets, 64 Bytes/Line, 4-Way
D-Cache L1: 32 KB, 128 Sets, 64 Bytes/Line, 4-Way
Unified-Cache L2: 256 KB, 512 Sets, 64 Bytes/Line, 8-Way
System control register:
Instruction endian: little
Level-1 instruction cache disabled
Level-1 data cache disabled
MMU disabled
Branch prediction enabled
Memory zones:
Zone: Default Description: Default access mode
Zone: AHB-AP (AP0) Description: DMA like acc. in AP0 addr. space
Zone: APB-AP (AP1) Description: DMA like acc. in AP1 addr. space
Cortex-A8 identified.
J-Link>
离线
离线