Using JTAG for imx6 board bringup

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

Using JTAG for imx6 board bringup

ソリューションへジャンプ
8,176件の閲覧回数
philipcraig
Contributor II

I need to bringup a custom i.MX6Q board. The only available boot device is SPI-NOR, so I want to use JTAG to do the initial DDR configuration and to load u-boot.

I am using a J-Link with OpenOCD, and this is successfully talking to the JTAG DAP, including the AHP-AP and the APB-AP. I can read the on-chip ROM and RAM using either AP:

> dap apsel 0

ap 0 selected, identification register 0x44770001

> mdw 0     

0x00000000: e59ff01c

> mww 0x907000 0x12345678

> mdw 0x907000          

0x00907000: 12345678

>

> dap apsel 1

ap 1 selected, identification register 0x24770002

> mdw 0                 

0x00000000: e59ff01c

> mww 0x907000 0x87654321

> mdw 0x907000          

0x00907000: 87654321

However, there are problems accessing other registers, such as the MMDC:

> dap apsel 0

ap 0 selected, identification register 0x44770001

> mdw 0x21b0000

JTAG-DP STICKY ERROR

MEM_AP_CSW 0x2800052, MEM_AP_TAR 0x21b0000

JTAG-DP STICKY ERROR

MEM_AP_CSW 0x2800052, MEM_AP_TAR 0x21b0000

Block read error address 0x21b0000

in procedure 'mdw'

>

> dap apsel 1

ap 1 selected, identification register 0x24770002

> mdw 0x21b0000

0x021b0000: 03110000


The above shows that access works using the APB-AP, but fails using the AHB-AP.


According to the CoreSight Components TRM (DDI0314H), section 2.7.5, the CSW has Sprot = 0, SPIStatus = 1, DbgStatus = 1, which means "Secure transfer produced an error response".

What are the possible reasons for this error response? Is the processor booting up in some secure state that I need to disable before the AHB-AP is allowed access to the MMDC registers?

Note that I am currently unable to halt the processor immediately after reset, so it is running some of the boot ROM code already.

ラベル(2)
タグ(1)
1 解決策
1,811件の閲覧回数
philipcraig
Contributor II

Turns out all I need is to run 'dap apcsw 1' in openocd to enable SProt.

Strangely this isn't needed after there is a working u-boot in the SPI-NOR, so I'm still curious as to what is going on.

元の投稿で解決策を見る

0 件の賞賛
4 返答(返信)
1,811件の閲覧回数
rp123
Contributor II

I am also trying to bring up a custom iMX6Q board and am having trouble initializing DRAM, can you please share your board config file?

0 件の賞賛
1,811件の閲覧回数
philipcraig
Contributor II

My board config for the sabrelite is attached.

1,811件の閲覧回数
EgleTeam
Contributor V

Hi,

We also try to use j-link pro to debug iMX6 under OpenOCD. We can read DRAM registers (we're using Philip's config):

> mdw 0x80000000

0x80000000: d067b2ad

However we can't read SFRs:

> mdw 0x20e000c

20e000c access in userspace and target in supervisor

The same was with j-mem of Segger.

What is necessary to configure  to be able to read registes?

Thanks and regards.

0 件の賞賛
1,812件の閲覧回数
philipcraig
Contributor II

Turns out all I need is to run 'dap apcsw 1' in openocd to enable SProt.

Strangely this isn't needed after there is a working u-boot in the SPI-NOR, so I'm still curious as to what is going on.

0 件の賞賛