<?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のトピックRe: Flashing issues with recent version of LPC1758</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flashing-issues-with-recent-version-of-LPC1758/m-p/2180684#M58841</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;I think that IAR has not updated their LPC17xx.mac file to work with the latest LPC1758 version, since the following error is raised :&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.4\arm/config/flashloader/NXP/LPC17xx.mac(40,17): Error: Operation error.  &lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;However I’m not sure what needs to be changed to make it work.&lt;BR /&gt;Can anyone help me with this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;__var FLASHCFG;
__var MEMMAP;
__var CLKSRCSEL;
__var SCS;
__var CCLKSEL;
__var PLL0CON;

execUserFlashInit()
{
  // Save registers contents
  FLASHCFG  = __readMemory32(0x400FC000, "Memory");
  MEMMAP    = __readMemory32(0x400FC040, "Memory");
  CLKSRCSEL = __readMemory32(0x400FC10C, "Memory");
  SCS       = __readMemory32(0x400FC1A0, "Memory");
  CCLKSEL   = __readMemory32(0x400FC104, "Memory");
  PLL0CON   = __readMemory32(0x400FC080, "Memory");

  // Disable the PLL.
  __writeMemory32(0x00000000, 0x400FC080, "Memory"); // PLL0CON = 0
  // Qualify the PLL change.
  __writeMemory32(0x000000AA, 0x400FC08C, "Memory"); // PLL0FEED = 0xAA
  __writeMemory32(0x00000055, 0x400FC08C, "Memory"); // PLL0FEED = 0x55

  __writeMemory32(0x00000000, 0x400FC104, "Memory"); // CCLKSEL=0
  // Enable main clock
  __writeMemory32(0x00000020, 0x400FC1A0, "Memory"); // SCS.OSCEN = 1
    
  __delay(1); //Reading status is unstable
  // Wait on OSCSTAT bit, set when oscillator is ready.
  //while(!(__readMemory32(0x400FC1A0, "Memory") &amp;amp; 0x40))
    
  // Switch to main clock instead of internal RC for stable JTAG auto-speed
  __writeMemory32(0x00000001, 0x400FC10C, "Memory"); // CLKSRCSEL = 1
    
  // Make sure that the flash memory system is correctly setup.
  __writeMemory32(0x3A      , 0x400FC000, "Memory"); // FLASHCFG = 0x3A;
  
  // If the MAM values was wrong, a dummy read is necessary to get the flash memory in sync.
  __writeMemory32(0x00000001, 0x400FC040, "Memory"); // MEMMAP = 1
  __readMemory32(0x00000000, "Memory");
}

execUserFlashExit()
{
  // Restore modified registers
  __writeMemory32(CLKSRCSEL, 0x400FC10C, "Memory");
  __writeMemory32(PLL0CON, 0x400FC080, "Memory");
  // Qualify the PLL change.
  __writeMemory32(0x000000AA, 0x400FC08C, "Memory");
  __writeMemory32(0x00000055, 0x400FC08C, "Memory");
  __writeMemory32(CCLKSEL, 0x400FC104, "Memory");
  __writeMemory32(SCS, 0x400FC1A0, "Memory");
  
  if (SCS &amp;amp; 0x20)
  {
    __delay(1); //Reading status is unstable
    // Wait on OSCSTAT bit, set when oscillator is ready.
    //while(!(__readMemory32(0x400FC1A0, "Memory") &amp;amp; 0x40));
  }
  
  __writeMemory32(FLASHCFG, 0x400FC000, "Memory");
  __writeMemory32(MEMMAP, 0x400FC040, "Memory");
    
  // Dummy read to get the flash memory in sync
  __readMemory32(0x00000000, "Memory");
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Oct 2025 16:24:20 GMT</pubDate>
    <dc:creator>Tay33</dc:creator>
    <dc:date>2025-10-06T16:24:20Z</dc:date>
    <item>
      <title>Flashing issues with recent version of LPC1758</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flashing-issues-with-recent-version-of-LPC1758/m-p/2179758#M58836</link>
      <description>&lt;P&gt;&lt;!--  StartFragment   --&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Hello NXP community,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;I've recently purchased a newer version of &lt;LI-PRODUCT title="LPC1758FBD80" id="LPC1758FBD80"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;(&lt;EM&gt;AZC39200 11 SSD2347C&lt;/EM&gt;) to replace my older &lt;LI-PRODUCT title="LPC1758FBD80" id="LPC1758FBD80"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;(&lt;EM&gt;SKB283.1 10 ZSD1810A&lt;/EM&gt;).&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;I am encountering two issues:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class=""&gt;Flashing via IAR&amp;nbsp;fails with the following error :&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="markup"&gt;Error while calling macro execUserFlashInit Failed to load flash loader: FlashNXPLPC512K_Cortex.flash Could not start CPU core. (ErrorCode: -2)&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN class=""&gt;The same IAR setup works perfectly on my older &lt;LI-PRODUCT title="LPC1758FBD80" id="LPC1758FBD80"&gt;&lt;/LI-PRODUCT&gt;.&lt;BR /&gt;I already tried with the latest version of IAR ARM toolchain, it still fails with the same error.&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class=""&gt;Using J-Flash seems to correctly load my binary into the chip, but my application does not seem to run on the recent &lt;LI-PRODUCT title="LPC1758FBD80" id="LPC1758FBD80"&gt;&lt;/LI-PRODUCT&gt;, while the same binary works perfectly on the old one.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P class=""&gt;&lt;U&gt;&lt;SPAN class=""&gt;Questions:&lt;/SPAN&gt;&lt;/U&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class=""&gt;Are there recommended updates for IAR flashloader macros or settings to support recent &lt;LI-PRODUCT title="LPC1758FBD80" id="LPC1758FBD80"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;(&lt;EM&gt;AZC39200 11 SSD2347C)&lt;/EM&gt; ?&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;Is there a published errata / change log for recent &lt;LI-PRODUCT title="LPC1758FBD80" id="LPC1758FBD80"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;(&lt;EM&gt;AZC39200 11 SSD2347C&lt;/EM&gt;) that specifies differences in boot ROM, flash, or PLL initialization?&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;Are there any known changes required for the recent &lt;LI-PRODUCT title="LPC1758FBD80" id="LPC1758FBD80"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;to run applications ?&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;I would appreciate any guidance or recommendations on how to migrate applications from an old &lt;LI-PRODUCT title="LPC1758FBD80" id="LPC1758FBD80"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;to a more recent one.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;!--  EndFragment   --&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Oct 2025 07:51:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Flashing-issues-with-recent-version-of-LPC1758/m-p/2179758#M58836</guid>
      <dc:creator>Tay33</dc:creator>
      <dc:date>2025-10-03T07:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: Flashing issues with recent version of LPC1758</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flashing-issues-with-recent-version-of-LPC1758/m-p/2180684#M58841</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;I think that IAR has not updated their LPC17xx.mac file to work with the latest LPC1758 version, since the following error is raised :&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.4\arm/config/flashloader/NXP/LPC17xx.mac(40,17): Error: Operation error.  &lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;However I’m not sure what needs to be changed to make it work.&lt;BR /&gt;Can anyone help me with this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;__var FLASHCFG;
__var MEMMAP;
__var CLKSRCSEL;
__var SCS;
__var CCLKSEL;
__var PLL0CON;

execUserFlashInit()
{
  // Save registers contents
  FLASHCFG  = __readMemory32(0x400FC000, "Memory");
  MEMMAP    = __readMemory32(0x400FC040, "Memory");
  CLKSRCSEL = __readMemory32(0x400FC10C, "Memory");
  SCS       = __readMemory32(0x400FC1A0, "Memory");
  CCLKSEL   = __readMemory32(0x400FC104, "Memory");
  PLL0CON   = __readMemory32(0x400FC080, "Memory");

  // Disable the PLL.
  __writeMemory32(0x00000000, 0x400FC080, "Memory"); // PLL0CON = 0
  // Qualify the PLL change.
  __writeMemory32(0x000000AA, 0x400FC08C, "Memory"); // PLL0FEED = 0xAA
  __writeMemory32(0x00000055, 0x400FC08C, "Memory"); // PLL0FEED = 0x55

  __writeMemory32(0x00000000, 0x400FC104, "Memory"); // CCLKSEL=0
  // Enable main clock
  __writeMemory32(0x00000020, 0x400FC1A0, "Memory"); // SCS.OSCEN = 1
    
  __delay(1); //Reading status is unstable
  // Wait on OSCSTAT bit, set when oscillator is ready.
  //while(!(__readMemory32(0x400FC1A0, "Memory") &amp;amp; 0x40))
    
  // Switch to main clock instead of internal RC for stable JTAG auto-speed
  __writeMemory32(0x00000001, 0x400FC10C, "Memory"); // CLKSRCSEL = 1
    
  // Make sure that the flash memory system is correctly setup.
  __writeMemory32(0x3A      , 0x400FC000, "Memory"); // FLASHCFG = 0x3A;
  
  // If the MAM values was wrong, a dummy read is necessary to get the flash memory in sync.
  __writeMemory32(0x00000001, 0x400FC040, "Memory"); // MEMMAP = 1
  __readMemory32(0x00000000, "Memory");
}

execUserFlashExit()
{
  // Restore modified registers
  __writeMemory32(CLKSRCSEL, 0x400FC10C, "Memory");
  __writeMemory32(PLL0CON, 0x400FC080, "Memory");
  // Qualify the PLL change.
  __writeMemory32(0x000000AA, 0x400FC08C, "Memory");
  __writeMemory32(0x00000055, 0x400FC08C, "Memory");
  __writeMemory32(CCLKSEL, 0x400FC104, "Memory");
  __writeMemory32(SCS, 0x400FC1A0, "Memory");
  
  if (SCS &amp;amp; 0x20)
  {
    __delay(1); //Reading status is unstable
    // Wait on OSCSTAT bit, set when oscillator is ready.
    //while(!(__readMemory32(0x400FC1A0, "Memory") &amp;amp; 0x40));
  }
  
  __writeMemory32(FLASHCFG, 0x400FC000, "Memory");
  __writeMemory32(MEMMAP, 0x400FC040, "Memory");
    
  // Dummy read to get the flash memory in sync
  __readMemory32(0x00000000, "Memory");
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Oct 2025 16:24:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Flashing-issues-with-recent-version-of-LPC1758/m-p/2180684#M58841</guid>
      <dc:creator>Tay33</dc:creator>
      <dc:date>2025-10-06T16:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: Flashing issues with recent version of LPC1758</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flashing-issues-with-recent-version-of-LPC1758/m-p/2181477#M58846</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/255493"&gt;@Tay33&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for reaching out! I understand that you are migrating from the second device revision to the third device revision.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="diego_charles_0-1759859041637.png" style="width: 427px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/359782i7922719A062D0C22/image-dimensions/427x204?v=v2" width="427" height="204" role="button" title="diego_charles_0-1759859041637.png" alt="diego_charles_0-1759859041637.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The latest revision corrects some erratas from the previous revision. According to&lt;A href="https://www.nxp.com/docs/en/errata/ES_LPC175X.pdf" target="_self"&gt; Table 2. Functional problems table&lt;/A&gt;&amp;nbsp;But we do not have another errata version available that explains further the changes.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As I have been checking there is no new software released for this revision, and we do not&amp;nbsp; guidelines to update the flashloader for IAR.&lt;/P&gt;
&lt;P&gt;You mentioned failure to boot the even after programming with J-Link. Can you check the ISP pin? What is the measured voltage of this pin when using the lastest revision?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Diego&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Oct 2025 20:47:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Flashing-issues-with-recent-version-of-LPC1758/m-p/2181477#M58846</guid>
      <dc:creator>diego_charles</dc:creator>
      <dc:date>2025-10-07T20:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Flashing issues with recent version of LPC1758</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flashing-issues-with-recent-version-of-LPC1758/m-p/2181723#M58847</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/89833"&gt;@diego_charles&lt;/a&gt;&amp;nbsp; for your reply.&lt;/P&gt;&lt;P&gt;I checked the ISP pin, but I still wasn’t able to boot my application.&lt;/P&gt;&lt;P&gt;However, because I was suspecting that the IAR flash loaders wasn't working anymore, I unchecked the “Use flash loader(s)” option under Project → Options → Debugger → Download, and was then able to successfully debug my new LPC1758 from my J-Link probe.&lt;/P&gt;&lt;P&gt;During debugging, I found that the MCU was stuck in the Chip_SetupXtalClocking() function (in sysinit_17xx_40xx.c file), because the SYSCTL_OSCSTAT bit of the SCS register was stuck low.&lt;/P&gt;&lt;P&gt;After examining my external oscillator, I noticed that it was producing a stable voltage level instead of oscillating. I think something went wrong during the chip replacement, which might have damaged my external oscillator.&lt;BR /&gt;&lt;BR /&gt;As a temporary fix, I switched to using the internal RC oscillator, and my application boots successfully !&lt;/P&gt;&lt;P&gt;I will certainly contact IAR to obtain an updated version of the flash loader for the LPC1758, but I can move forward for now.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you for your support !&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Oct 2025 08:39:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Flashing-issues-with-recent-version-of-LPC1758/m-p/2181723#M58847</guid>
      <dc:creator>Tay33</dc:creator>
      <dc:date>2025-10-08T08:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Flashing issues with recent version of LPC1758</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flashing-issues-with-recent-version-of-LPC1758/m-p/2182059#M58850</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/255493"&gt;@Tay33&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is very good to hear! Thank&amp;nbsp; you for sharing your findings and outcome, it may help others a well!&lt;/P&gt;
&lt;P&gt;Diego&lt;/P&gt;</description>
      <pubDate>Wed, 08 Oct 2025 17:39:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Flashing-issues-with-recent-version-of-LPC1758/m-p/2182059#M58850</guid>
      <dc:creator>diego_charles</dc:creator>
      <dc:date>2025-10-08T17:39:56Z</dc:date>
    </item>
  </channel>
</rss>

