iMX6 Precise JTAG Reset

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMX6 Precise JTAG Reset

Jump to solution
2,666 Views
micahellaiosa
Contributor I

The typcial procedure for performing a precise reset from a JTAG Emulator on a Cortex-A9 (or really any ARM) is as follows:

  1. Assert System Reset (nRESET or nSRST, depending on which ARM connector standard you're using; nCPURESET in ARM's IP)
  2. Assert and Release Tap Reset (nTRST; nDBGRESET in ARM's IP)
  3. Set DBGVCR.R
  4. Release System Reset

This will leave the CPU halted at the reset vector, so that one may debug very early startup code.

Unfortunately, the typical iMX6 development board connects the JTAG header's reset line to the POR_B input of the CPU; indeed, a quick review of the data sheet suggests that its the only available reset input on the SoC.  As is typical of power-on resets, asserting POR_B also holds the debug logic in reset, making step 3 of the above procedure impossible.  No JTAG scanning works at all when POR_B is asserted.  Without being able to set DBGVCR.R before releasing reset, one has no choice but to let the startup code run while the JTAG emulator performs the JTAG scans needed to halt the CPU.  Even on a very fast JTAG emulator, this may take tens or hundreds of milliseconds, during which time a great volume of startup code might run.

My Question - Is there a procedure for performing a precise reset on the iMX6 from a JTAG emulator, such that the CPU remains halted at the reset vector, and the early startup code in ROM can be debugged?

I realize, of course, that there are workarounds - for example, one may modify their startup code to immediately go into an infinite loop.  Once the debugger has halted the CPU, they can bypass the loop, and debug the startup code.  But this is a much more awkward experience then it ought to be.

Labels (1)
Tags (2)
1 Solution
1,109 Views
JasonLiu
NXP Employee
NXP Employee

Hi, Mike,

For your question, currently, we don't have one procedure meet your requirement.But from debug purpose, what I did is:

-  Let ROM code run to serial download,

- Set the PC to 0 (by click "CPU-> Reset CPU registers"), which is the beginning of ROM start up code,

-  Set to normal boot mode and continue debug, this is let you debug code from ROM reset code.

View solution in original post

0 Kudos
2 Replies
1,109 Views
TaborKelly
Contributor I

I'm pretty disappointed that this normal early boot debug case isn't better supported on the IMX6. With that said I have been successful working around it by:

  1. Setting the board up to boot into the serial downloader.
  2. Connecting my JTAG debugger (busblaster+openocd).
  3. Setting any breakpoints I want early in u-boot (eg, board_init_r)
  4. Downloading a u-boot image with https://github.com/boundarydevices/imx_usb_loader
0 Kudos
1,110 Views
JasonLiu
NXP Employee
NXP Employee

Hi, Mike,

For your question, currently, we don't have one procedure meet your requirement.But from debug purpose, what I did is:

-  Let ROM code run to serial download,

- Set the PC to 0 (by click "CPU-> Reset CPU registers"), which is the beginning of ROM start up code,

-  Set to normal boot mode and continue debug, this is let you debug code from ROM reset code.

0 Kudos