iMX6 Rex Basic JTAG Debugging

From Voipac Wiki
Jump to navigation Jump to search

This page shows the steps how to initiate On-Chip Debugging and load bootloader into iMX6 Rex Development Kit in Basic configuration.

This procedure is recommended for in-depth evaluating and debugging, for a standard method how to control the kit and load the binaries, follow these steps.

Important notes:

  • iMX6 Rex Module Basic requires both J1 + J2 board-to-board connectors to be assembled!
  • Set base board to USB bootloader mode to avoid executing SPI bootloader
  • Before running "reset halt" command the iMX6 Rex Development Kit Basic must be reset by Reset button

JTAG cable with serial line.jpg

Preparing files

Downloading configuration files

wget https://downloads.voipac.com/files/iMX6_Rex_Development_Kit/tools/jtag/imx6d-512mb-oocd-0.8.0.cfg

Downloading binaries

wget https://downloads.voipac.com/files/iMX6_Rex_Development_Kit/tools/jtag/binaries/u-boot-0x27800000_imx6dl_20160410.bin

Loading binary

Running OpenOCD

/opt/openocd/bin/openocd -f imx6d-512mb-oocd-0.8.0.cfg

Running Telnet session

telnet localhost 4444

Loading the binary

reset halt
load_image /srv/tftp/imx6/u-boot-0x27800000_imx6dl_20160410.bin 0x27800000
step 0x27800000
resume

Log files

In case further evaluating is required, following section contains all the logs from the performed procedure above.

OpenOCD session log file

marek@jessie:~$ /opt/openocd/bin/openocd -f imx6d-512mb-oocd-0.8.0.cfg
Open On-Chip Debugger 0.8.0-dev-00342-gfacd0e7 (2014-02-06-20:31)
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
adapter speed: 1000 kHz
jtag_ntrst_delay: 1000
imx6_dummy_init
Info : clock speed 1000 kHz
Polling target imx6.cpu.0 failed, GDB will be halted. Polling again in 100ms
Polling target imx6.cpu.0 failed, GDB will be halted. Polling again in 300ms
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: 0x2191c01d (mfg: 0x00e, part: 0x191c, ver: 0x2)
Info : imx6.cpu.0: hardware has 6 breakpoints, 4 watchpoints
Polling target imx6.cpu.0 succeeded again
Info : accepting 'telnet' connection from 4444
adapter 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: 0x2191c01d (mfg: 0x00e, part: 0x191c, ver: 0x2)
imx6d init
Info : number of cache level 1
Info : imx6.cpu.0 cluster 0 core 0 multi core
target state: halted
target halted in Thumb state due to debug-request, current mode: Supervisor
cpsr: 0x400001f3 pc: 0x00000fb6
MMU: disabled, D-Cache: disabled, I-Cache: enabled
imx6 clock init
imx6d 512MB ddr3 init
imx6 cache init
target state: halted
target halted in Thumb state due to debug-request, current mode: Supervisor
cpsr: 0x400001f3 pc: 0x00000fb6
MMU: disabled, D-Cache: disabled, I-Cache: enabled
clear_regs begin
r1 (/32): 0x00000000
r2 (/32): 0x00000000
r3 (/32): 0x00000000
r4 (/32): 0x00000000
r5 (/32): 0x00000000
r6 (/32): 0x00000000
r7 (/32): 0x00000000
r8 (/32): 0x00000000
r9 (/32): 0x00000000
r10 (/32): 0x00000000
r11 (/32): 0x00000000
r12 (/32): 0x00000000
pc (/32): 0x10800000
cpsr (/32): 0x000001D3
433028 bytes written at address 0x27800000
downloaded 433028 bytes in 42.324924s (9.991 KiB/s)
target state: halted
target halted in ARM state due to breakpoint, current mode: Supervisor
cpsr: 0x000001d3 pc: 0x278006e0
MMU: disabled, D-Cache: disabled, I-Cache: enabled

Telnet session log file

marek@jessie:~$ telnet localhost 4444
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Open On-Chip Debugger
> reset halt
adapter speed: 1000 kHz
JTAG tap: imx6.dap tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
TAP imx6.sdma does not have IDCODE
JTAG tap: imx6.sjc tap/device found: 0x2191c01d (mfg: 0x00e, part: 0x191c, ver: 0x2)
number of cache level 1
imx6.cpu.0 cluster 0 core 0 multi core
target state: halted
target halted in Thumb state due to debug-request, current mode: Supervisor
cpsr: 0x400001f3 pc: 0x00000fb6
MMU: disabled, D-Cache: disabled, I-Cache: enabled
target state: halted
target halted in Thumb state due to debug-request, current mode: Supervisor
cpsr: 0x400001f3 pc: 0x00000fb6
MMU: disabled, D-Cache: disabled, I-Cache: enabled
r1 (/32): 0x00000000
r2 (/32): 0x00000000
r3 (/32): 0x00000000
r4 (/32): 0x00000000
r5 (/32): 0x00000000
r6 (/32): 0x00000000
r7 (/32): 0x00000000
r8 (/32): 0x00000000
r9 (/32): 0x00000000
r10 (/32): 0x00000000
r11 (/32): 0x00000000
r12 (/32): 0x00000000
pc (/32): 0x10800000
cpsr (/32): 0x000001D3
> load_image /srv/tftp/imx6/u-boot-0x27800000_imx6d_20160410.bin 0x27800000
433028 bytes written at address 0x27800000
downloaded 433028 bytes in 42.324924s (9.991 KiB/s)
> step 0x27800000
target state: halted
target halted in ARM state due to breakpoint, current mode: Supervisor
cpsr: 0x000001d3 pc: 0x278006e0
MMU: disabled, D-Cache: disabled, I-Cache: enabled
> resume

Serial terminal session log file

U-Boot 2009.08-dirty (Apr 10 2016 - 14:46:15)

CPU: Freescale i.MX6 family TO1.2 at 792 MHz
Thermal sensor with ratio = 184
Temperature:   21 C, calibration data 0x58e50a69
mx6d pll1: 792MHz
mx6d pll2: 528MHz
ipg clock     : 66000000Hz
ipg per clock : 66000000Hz
uart clock    : 80000000Hz
cspi clock    : 60000000Hz
ahb clock     : 132000000Hz
axi clock   : 264000000Hz
emi_slow clock: 132000000Hz
ddr clock     : 528000000Hz
usdhc1 clock  : 198000000Hz
usdhc2 clock  : 198000000Hz
usdhc3 clock  : 198000000Hz
usdhc4 clock  : 198000000Hz
nfc clock     : 24000000Hz
Board: i.MX6D-REX: Variant: 1 Board: 0x63012 [POR ]
Boot Device: SPI NOR
I2C:   ready
DRAM:   2 GB
MMC:   FSL_USDHC: 0,FSL_USDHC: 1
JEDEC ID: 0xbf:0x26:0x42
Reading SPI NOR flash 0xc0000 [0x2000 bytes] -> ram 0x27600978
.SUCCESS

*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   got MAC address from IIM: 00:0d:15:00:de:c9
FEC0 [PRIME]
Hit any key to stop autoboot:  0 
Rex U-Boot > setenv model imx6d
Rex U-Boot > setenv release 20160410
Rex U-Boot > setenv ipaddr 192.168.0.150
Rex U-Boot > setenv serverip 192.168.0.1
Rex U-Boot > mw.b 0x10800000 0xFF 0x80000;tftp 0x10800000 imx6/u-boot-0x27800000_${model}_${release}.bin;sf probe 3:2;sf erase 0x0 0x80000;sf write 0x10800000 0x0 0x80000
PHY indentify @ 0x3 = 0x00221611
FEC: Link is Up 796d
Using FEC0 device
TFTP from server 192.168.0.1; our IP address is 192.168.0.150
Filename 'imx6/u-boot-0x27800000_imx6d_20160410.bin'.
Load address: 0x10800000
Loading: ##############################
done
Bytes transferred = 433756 (69e5c hex)
JEDEC ID: 0xbf:0x26:0x42
4096 KiB SST26VF032B - 4MB at 3:2 is now current device
Erasing SPI NOR flash 0x0 [0x80000 bytes]
................................................................................................................................SUCCESS

Writing SPI NOR flash 0x0 [0x80000 bytes] <- ram 0x10800000
................................................................................................................................SUCCESS

Rex U-Boot > reset
resetting ...
Re

U-Boot 2009.08 (Apr 10 2016 - 16:35:09)

CPU: Freescale i.MX6 family TO1.2 at 792 MHz
Thermal sensor with ratio = 184
Temperature:   49 C, calibration data 0x58e50a69
mx6d pll1: 792MHz
mx6d pll2: 528MHz
ipg clock     : 66000000Hz
ipg per clock : 66000000Hz
uart clock    : 80000000Hz
cspi clock    : 60000000Hz
ahb clock     : 132000000Hz
axi clock   : 264000000Hz
emi_slow clock: 132000000Hz
ddr clock     : 528000000Hz
usdhc1 clock  : 198000000Hz
usdhc2 clock  : 198000000Hz
usdhc3 clock  : 198000000Hz
usdhc4 clock  : 198000000Hz
nfc clock     : 24000000Hz
Board: i.MX6D-REX: Variant: 2 Board: 0x63012 [WDOG ]
Boot Device: SPI NOR
I2C:   ready
DRAM:   2 GB
MMC:   FSL_USDHC: 0,FSL_USDHC: 1
JEDEC ID: 0xbf:0x26:0x42
Reading SPI NOR flash 0xc0000 [0x2000 bytes] -> ram 0x27600978
.SUCCESS

*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   got MAC address from IIM: 00:0d:15:00:de:c9
FEC0 [PRIME]
Hit any key to stop autoboot:  0 
Rex U-Boot >