Sharing debug i.mx6 from uboot to kernel to jni with Eclipse
////////////////////host ubuntu terminal
root@stonelinux:/opt/openocd/bin# ./openocd -f /opt/openocd/share/openocd/scripts/interface/ftdi/dp_busblaster.cfg -f /opt/openocd/share/openocd/scripts/target/imx6.cfg
Open On-Chip Debugger 0.8.0 (2015-11-27-10:25)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
Warn : imx6.sdma: nonstandard IR value
adapter speed: 1000 kHz
Info : clock speed 1000 kHz
Info : JTAG tap: imx6.dap tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
Info : TAP imx6.sdma does not have IDCODE
Info : JTAG tap: imx6.sjc tap/device found: 0x2191e01d (mfg: 0x00e, part: 0x191e, ver: 0x2)
Info : imx6.cpu.0: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'gdb' connection from 3333
Info : number of cache level 1
Info : imx6.cpu.0 cluster 0 core 0 multi core
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x200001d3 pc: 0x4ff70548
MMU: enabled, D-Cache: enabled, I-Cache: enabled
/////////////////////////after target kernel startup finish will happen
Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed
Error: MEM_AP_CSW 0x24770002, MEM_AP_TAR 0x24770002
Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed
Error: MEM_AP_CSW 0x24770002, MEM_AP_TAR 0x24770002
Warn : Timeout (1000ms) waiting for ACK=OK/FAULT in JTAG-DP transaction - aborting
Warn : Timeout (1000ms) waiting for ACK=OK/FAULT in JTAG-DP transaction - aborting
Polling target imx6.cpu.0 failed, GDB will be halted. Polling again in 100ms
Warn : target imx6.cpu.0 is not halted
Error: Target not halted
Error: Target not halted
//////////////////////solved by this way
gedit /root/project_board/free_imx/myandroid/kernel_imx/arch/arm/configs/mx6dq_android_defconfig
CONFIG_CPU_IDLE=y
to
#CONFIG_CPU_IDLE=y
or
gedit /root/project_board/free_imx/myandroid/kernel_imx/arch/arm/mach-imx/pm-imx6.c
val |= 0x1 << BP_CLPCR_LPM;
val |= BM_CLPCR_ARM_CLK_DIS_ON_LPM;
to
/*val |= 0x1 << BP_CLPCR_LPM;
val |= BM_CLPCR_ARM_CLK_DIS_ON_LPM;*/
rebuild kernel and upload to target i.mx6 board
It because CPU_IDLE low power mode will close jtag function
if want to know more way read
Debugging Linux Kernel over JTAG with J-Link
/////
//i.mx6 only have hardware breakpoint.
//Could not insert single-step breakpoint, cannot continue bug fixed
search in gdb_server.c
if (type == 0) /* memory breakpoint */
bp_type = BKPT_SOFT;
modify to
bp_type = BKPT_HARD;
//add support for openpocd
$_TARGETNAME configure -event reset-assert "imx6q_init"
$_TARGETNAME configure -event reset-end "clear_regs"
http://wiki.voipac.com/xwiki/bin/view/imx6+rex/jtag_oocd