iMX6 Precise JTAG Reset

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

iMX6 Precise JTAG Reset

ソリューションへジャンプ
2,759件の閲覧回数
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.

ラベル(1)
タグ(2)
1 解決策
1,202件の閲覧回数
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 件の賞賛
2 返答(返信)
1,202件の閲覧回数
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 件の賞賛
1,203件の閲覧回数
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 件の賞賛