{"id":8375,"date":"2023-09-13T20:20:32","date_gmt":"2023-09-14T03:20:32","guid":{"rendered":"https:\/\/visualgdb.com\/w\/?p=8375"},"modified":"2023-10-03T10:57:21","modified_gmt":"2023-10-03T17:57:21","slug":"mpu-interfering-with-tracing","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/documentation\/tracing\/mpu\/","title":{"rendered":"MPU Interfering with Tracing"},"content":{"rendered":"<p>ARM Cortex-M3 and higher processors include a memory protection unit (MPU) that allows marking some regions of memory non-executable. This can interfere with trace programs placed into RAM.<\/p>\n<p>If you see a warning about the MPU interference with tracing, and the tracepoints are not working, consider adding one of the following lines at the beginning of <strong>main()<\/strong>:<\/p>\n<p>If using Zephyr (e.g. nRFConnect):<\/p>\n<pre class=\"\">ARM_MPU_Disable();<\/pre>\n<p>If otherwise have the MPU definition:<\/p>\n<pre class=\"\">MPU-&gt;CTRL &amp;= ~MPU_CTRL_ENABLE_Msk;<\/pre>\n<p>If the MPU macro is not defined:<\/p>\n<pre class=\"\">*((unsigned *)0xE000ED94) = 0;<\/pre>\n<p>This will disable the memory protection unit for the runtime of the program, allowing it to run trace programs from memory. Once done tracing, you can comment out the added line, or make it conditional to debug configurations (#ifdef DEBUG).<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ARM Cortex-M3 and higher processors include a memory protection unit (MPU) that allows marking some regions of memory non-executable. This<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[202],"tags":[],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/8375"}],"collection":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/comments?post=8375"}],"version-history":[{"count":1,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/8375\/revisions"}],"predecessor-version":[{"id":8376,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/8375\/revisions\/8376"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=8375"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=8375"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=8375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}