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?
Solved! Go to Solution.
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
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
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?
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