In KL27 why does MTB_POSITION not read what is written?

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

In KL27 why does MTB_POSITION not read what is written?

ソリューションへジャンプ
1,335件の閲覧回数
bobpaddock
Senior Contributor III

I am trying to use the Micro Trace Buffer in the KL27.

If I do:


MTB_MASTER = 0UL; /* Disable MTB */


MTB_POSITION = MTB_BASE; /* Set position to start of RAM */

Reading MTB_POSITION back returns 0x6000 rather than the start of RAM.
MTB_BASE does read as the start of RAM, as expected.

Per the MKL27 datasheet 43.3.1.1 MTB_POSITION should read what is written,

except for the bottom three bits.

Tracing seems to work, other than this odd reading of MTB_POSITION.


What is going on here?

ラベル(2)
タグ(3)
0 件の賞賛
返信
1 解決策
1,226件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi Bob,

I guess your KL27 has 32k SRAM.  The value written in MTB_POSITION will be AND with 0x7FF8. Please see 43.3.1.1. In MCUXpresso or other IDE, you can observe this by written 0x1ffff000 to MTB_POSITION .

Regards,

Jing

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
1,227件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi Bob,

I guess your KL27 has 32k SRAM.  The value written in MTB_POSITION will be AND with 0x7FF8. Please see 43.3.1.1. In MCUXpresso or other IDE, you can observe this by written 0x1ffff000 to MTB_POSITION .

Regards,

Jing

0 件の賞賛
返信
1,226件の閲覧回数
bobpaddock
Senior Contributor III

Thank you, now the cryptic note "...the active bits in this field are POSITION[14:3] == POSITION[POINTER[11:0]]" makes sense.

Should not the 32-bit field diagram reflect that the top bits are always zero, to match the text?

0 件の賞賛
返信
1,226件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi Bob,

yes. In fact, this chapter copies from ARM.

https://static.docs.arm.com/ddi0486/b/DDI0486B_coresight_mtb_m0p_r0p1_trm.pdf

Regards,

Jing

0 件の賞賛
返信