<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>LPC Microcontrollers中的主题 Using the Debug Mailbox with IAR tools</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Using-the-Debug-Mailbox-with-IAR-tools/m-p/2028527#M57532</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have an LPC55S69 based board and I would like to use the Debug MailBox commands with the IAR C-Spy debugger and I-jet probe. I've written a debugger macro that prints the MailBox ID register correctly, but nothing else seems to work.&amp;nbsp;&lt;BR /&gt;Reading back the command immediately returns 0, result register is always zero, and none of the requests is actually executed. Details below.&lt;/P&gt;&lt;P&gt;I'm not experienced with this, any pointer/suggestion is really appreciated!&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Gyorgy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The part I'm using has the following markings (Rev 1B 2022 week 17, I assume):&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;LPC55S69&lt;BR /&gt;JEV98&lt;BR /&gt;WA44003&lt;BR /&gt;sSD22171B&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The macro looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;execUserPreload()
{
  // Called after communication with the target system is established but before
  // downloading the target application.
  if (__hasDAPRegs())
  {
    __message "Has DAP registers";
    __message "DPIDR:", __readDPReg(0x0):%x;

    __writeDPReg(0x020000F0, 0x08);
    __message "MailBox ID reg:", __readAPReg(0xFC):%x;

    // Resynch/reset
    __writeAPReg(0x21, 0x0);
    __message "SYNC readback: ",  __readAPReg(0x00):%x;
    __delay(500);
    __message "SYNC status: ",  __readAPReg(0x00):%x;

    // Mass erase
    __writeAPReg(0x03, 0x4);
    __message "ERASE readback: ",  __readAPReg(0x04):%x;
    __delay(500);
    __message "ERASE status: ",  __readAPReg(0x00):%x;
    __message "ERASE result: ",  __readAPReg(0x08):%x;

    // Enter ISP mode (2 words)
    __writeAPReg(0x00010005, 0x04);
    __message "ISP1 readback: ",  __readAPReg(0x04):%x;
    __delay(500);
    __message "ISP1 status: ",  __readAPReg(0x00):%x;
    __message "ISP1 result: ",  __readAPReg(0x08):%x;

    __writeAPReg(0xffffffff, 0x4);
    __message "ISP2 readback: ",  __readAPReg(0x04):%x;
    __delay(500);
    __message "ISP2 status: ",  __readAPReg(0x00):%x;
    __message "ISP2 result: ",  __readAPReg(0x08):%x;
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output:&lt;/P&gt;&lt;P&gt;Has DAP registers&lt;BR /&gt;DPIDR:6ba02477&lt;BR /&gt;MailBox ID reg:2a0000&lt;BR /&gt;SYNC readback: 0&lt;BR /&gt;SYNC status: 0&lt;BR /&gt;ERASE readback: 0&lt;BR /&gt;ERASE status: 0&lt;BR /&gt;ERASE result: 0&lt;BR /&gt;ISP1 readback: 0&lt;BR /&gt;ISP1 status: 0&lt;BR /&gt;ISP1 result: 0&lt;BR /&gt;ISP2 readback: 0&lt;BR /&gt;ISP2 status: 0&lt;BR /&gt;ISP2 result: 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jan 2025 21:23:04 GMT</pubDate>
    <dc:creator>Hoditohod</dc:creator>
    <dc:date>2025-01-15T21:23:04Z</dc:date>
    <item>
      <title>Using the Debug Mailbox with IAR tools</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Using-the-Debug-Mailbox-with-IAR-tools/m-p/2028527#M57532</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have an LPC55S69 based board and I would like to use the Debug MailBox commands with the IAR C-Spy debugger and I-jet probe. I've written a debugger macro that prints the MailBox ID register correctly, but nothing else seems to work.&amp;nbsp;&lt;BR /&gt;Reading back the command immediately returns 0, result register is always zero, and none of the requests is actually executed. Details below.&lt;/P&gt;&lt;P&gt;I'm not experienced with this, any pointer/suggestion is really appreciated!&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Gyorgy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The part I'm using has the following markings (Rev 1B 2022 week 17, I assume):&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;LPC55S69&lt;BR /&gt;JEV98&lt;BR /&gt;WA44003&lt;BR /&gt;sSD22171B&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The macro looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;execUserPreload()
{
  // Called after communication with the target system is established but before
  // downloading the target application.
  if (__hasDAPRegs())
  {
    __message "Has DAP registers";
    __message "DPIDR:", __readDPReg(0x0):%x;

    __writeDPReg(0x020000F0, 0x08);
    __message "MailBox ID reg:", __readAPReg(0xFC):%x;

    // Resynch/reset
    __writeAPReg(0x21, 0x0);
    __message "SYNC readback: ",  __readAPReg(0x00):%x;
    __delay(500);
    __message "SYNC status: ",  __readAPReg(0x00):%x;

    // Mass erase
    __writeAPReg(0x03, 0x4);
    __message "ERASE readback: ",  __readAPReg(0x04):%x;
    __delay(500);
    __message "ERASE status: ",  __readAPReg(0x00):%x;
    __message "ERASE result: ",  __readAPReg(0x08):%x;

    // Enter ISP mode (2 words)
    __writeAPReg(0x00010005, 0x04);
    __message "ISP1 readback: ",  __readAPReg(0x04):%x;
    __delay(500);
    __message "ISP1 status: ",  __readAPReg(0x00):%x;
    __message "ISP1 result: ",  __readAPReg(0x08):%x;

    __writeAPReg(0xffffffff, 0x4);
    __message "ISP2 readback: ",  __readAPReg(0x04):%x;
    __delay(500);
    __message "ISP2 status: ",  __readAPReg(0x00):%x;
    __message "ISP2 result: ",  __readAPReg(0x08):%x;
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output:&lt;/P&gt;&lt;P&gt;Has DAP registers&lt;BR /&gt;DPIDR:6ba02477&lt;BR /&gt;MailBox ID reg:2a0000&lt;BR /&gt;SYNC readback: 0&lt;BR /&gt;SYNC status: 0&lt;BR /&gt;ERASE readback: 0&lt;BR /&gt;ERASE status: 0&lt;BR /&gt;ERASE result: 0&lt;BR /&gt;ISP1 readback: 0&lt;BR /&gt;ISP1 status: 0&lt;BR /&gt;ISP1 result: 0&lt;BR /&gt;ISP2 readback: 0&lt;BR /&gt;ISP2 status: 0&lt;BR /&gt;ISP2 result: 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2025 21:23:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Using-the-Debug-Mailbox-with-IAR-tools/m-p/2028527#M57532</guid>
      <dc:creator>Hoditohod</dc:creator>
      <dc:date>2025-01-15T21:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using the Debug Mailbox with IAR tools</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Using-the-Debug-Mailbox-with-IAR-tools/m-p/2029571#M57545</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/245590"&gt;@Hoditohod&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try to&amp;nbsp;reset the Debug Mailbox before issuing any commands.&amp;nbsp;Ensure that the Debug Mailbox is not locked by the system.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;       // Reset and synchronize
       __writeAPReg(0x21, 0x0); // SYNC
       __delay(500);
       while (__readAPReg(0x00) &amp;amp; 0x1) {
           __delay(10); // Wait for ready
       }
       __message "SYNC complete";&lt;/LI-CODE&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Harry&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2025 07:23:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Using-the-Debug-Mailbox-with-IAR-tools/m-p/2029571#M57545</guid>
      <dc:creator>Harry_Zhang</dc:creator>
      <dc:date>2025-01-17T07:23:41Z</dc:date>
    </item>
  </channel>
</rss>

