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?
已解决! 转到解答。
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?