<?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のトピックWriting to LPC54628 EEPROM through J-Link</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Writing-to-LPC54628-EEPROM-through-J-Link/m-p/1410333#M47850</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to write to EEPROM without involvement of CPU, as it provides a convenient way of preparing devices. I am erasing the flash memory and trying to write to the EEPROM via a J-Link.&lt;/P&gt;&lt;P&gt;I have tried different scenarios to understand what the problem can be. First of all, I can successfully write to EEPROM from the CPU (i.e. when using the SDK). I can also write to the EEPROM by J-Link when I keep the clock and power configurations that CPU sets. However, I am not able to write to the EEPROM when I attempt to erase and reset the CPU and do all the required power/clock configurations through J-Link. I was wondering if anyone can point what configuration I am missing.&lt;/P&gt;&lt;P&gt;Here is a pseudocode&lt;SPAN&gt;&amp;nbsp;showing how I communicate to J-Link to configure the device and write to the EEPROM. In the last line, the bit never gets set indicating an unsuccessful write to the EEPROM (or probably the&amp;nbsp;fact that something has not been configured properly). Can you check whether I am doing the configuration correctly?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;ADDRESS_AHBCLKCTRL0     = 0x40000200
ADDRESS_MAINCLKSELA     = 0x40000280
ADDRESS_MAINCLKSELB     = 0x40000284
ADDRESS_SYSPLLCLKSEL    = 0x40000290
ADDRESS_AHBCLKDIV       = 0x40000380
ADDRESS_SYSPLLCTRL      = 0x40000580
ADDRESS_SYSPLLNDEC      = 0x40000588
ADDRESS_SYSPLLPDEC      = 0x4000058C
ADDRESS_PDRUNCFG0       = 0x40000610
ADDRESS_PDRUNCFGCLR0    = 0x40000630

ADDRESS_PRESETCTRL0     = 0x40000100
ADDRESS_PRESETCTRLSET0  = 0x40000120
ADDRESS_PRESETCTRLCLR0  = 0x40000140

ADDRESS_CMD             = 0x40014000
ADDRESS_RWSTATE         = 0x40014008
ADDRESS_WSTATE          = 0x40014010
ADDRESS_CLKDIV          = 0x40014014
ADDRESS_INTSTAT         = 0x40014FE0
ADDRESS_INTSTATCLR      = 0x40014FE8

ADDRESS_EEPROM_BASE     = 0x40108000


# Clock configurations for main_clk
# Select Free running oscillator (FRO) 12 MHz for main clock source
write_word(ADDRESS_PDRUNCFGCLR0, 1 &amp;lt;&amp;lt; 4)  # Ensure FRO is running
write_word(ADDRESS_MAINCLKSELA, 0)
write_word(ADDRESS_MAINCLKSELB, 0)

# System clock and AHB clock control register
ahbclkctrl0 = read_word(ADDRESS_AHBCLKCTRL0)
write_word(ADDRESS_AHBCLKCTRL0, ahbclkctrl0 | (1 &amp;lt;&amp;lt; 9))  # Enable EEPROM

# Set EEPROM peripheral reset
write_word(ADDRESS_PRESETCTRLSET0, (1 &amp;lt;&amp;lt; 9)) # Reset
--&amp;gt; Wait until bit 9 in ADDRESS_PRESETCTRL0 is set
write_word(ADDRESS_PRESETCTRLCLR0, (1 &amp;lt;&amp;lt; 9)) # Clear the reset
--&amp;gt; Wait until bit 9 in ADDRESS_PRESETCTRL0 is cleared

# Set EEPROM clock
write_word(ADDRESS_CLKDIV, 3)

# Set the wait states for read and write
write_word(ADDRESS_RWSTATE, 0x00000A0A) 
write_word(ADDRESS_WSTATE, 0x000A0A0A)  

# Write
write_word(ADDRESS_INTSTATCLR, 1 &amp;lt;&amp;lt; 2)  # Clear program operation finished interrupt status
eeprom_address = ADDRESS_EEPROM_BASE
write_word(eeprom_address, b"\x01")
write_word(ADDRESS_CMD, 0x00000110)  # Trigger an erase/program operation
--&amp;gt; Wait until bit 2 in ADDRESS_INTSTAT is set&lt;/LI-CODE&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, 09 Feb 2022 14:33:33 GMT</pubDate>
    <dc:creator>Leo11</dc:creator>
    <dc:date>2022-02-09T14:33:33Z</dc:date>
    <item>
      <title>Writing to LPC54628 EEPROM through J-Link</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Writing-to-LPC54628-EEPROM-through-J-Link/m-p/1410333#M47850</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to write to EEPROM without involvement of CPU, as it provides a convenient way of preparing devices. I am erasing the flash memory and trying to write to the EEPROM via a J-Link.&lt;/P&gt;&lt;P&gt;I have tried different scenarios to understand what the problem can be. First of all, I can successfully write to EEPROM from the CPU (i.e. when using the SDK). I can also write to the EEPROM by J-Link when I keep the clock and power configurations that CPU sets. However, I am not able to write to the EEPROM when I attempt to erase and reset the CPU and do all the required power/clock configurations through J-Link. I was wondering if anyone can point what configuration I am missing.&lt;/P&gt;&lt;P&gt;Here is a pseudocode&lt;SPAN&gt;&amp;nbsp;showing how I communicate to J-Link to configure the device and write to the EEPROM. In the last line, the bit never gets set indicating an unsuccessful write to the EEPROM (or probably the&amp;nbsp;fact that something has not been configured properly). Can you check whether I am doing the configuration correctly?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;ADDRESS_AHBCLKCTRL0     = 0x40000200
ADDRESS_MAINCLKSELA     = 0x40000280
ADDRESS_MAINCLKSELB     = 0x40000284
ADDRESS_SYSPLLCLKSEL    = 0x40000290
ADDRESS_AHBCLKDIV       = 0x40000380
ADDRESS_SYSPLLCTRL      = 0x40000580
ADDRESS_SYSPLLNDEC      = 0x40000588
ADDRESS_SYSPLLPDEC      = 0x4000058C
ADDRESS_PDRUNCFG0       = 0x40000610
ADDRESS_PDRUNCFGCLR0    = 0x40000630

ADDRESS_PRESETCTRL0     = 0x40000100
ADDRESS_PRESETCTRLSET0  = 0x40000120
ADDRESS_PRESETCTRLCLR0  = 0x40000140

ADDRESS_CMD             = 0x40014000
ADDRESS_RWSTATE         = 0x40014008
ADDRESS_WSTATE          = 0x40014010
ADDRESS_CLKDIV          = 0x40014014
ADDRESS_INTSTAT         = 0x40014FE0
ADDRESS_INTSTATCLR      = 0x40014FE8

ADDRESS_EEPROM_BASE     = 0x40108000


# Clock configurations for main_clk
# Select Free running oscillator (FRO) 12 MHz for main clock source
write_word(ADDRESS_PDRUNCFGCLR0, 1 &amp;lt;&amp;lt; 4)  # Ensure FRO is running
write_word(ADDRESS_MAINCLKSELA, 0)
write_word(ADDRESS_MAINCLKSELB, 0)

# System clock and AHB clock control register
ahbclkctrl0 = read_word(ADDRESS_AHBCLKCTRL0)
write_word(ADDRESS_AHBCLKCTRL0, ahbclkctrl0 | (1 &amp;lt;&amp;lt; 9))  # Enable EEPROM

# Set EEPROM peripheral reset
write_word(ADDRESS_PRESETCTRLSET0, (1 &amp;lt;&amp;lt; 9)) # Reset
--&amp;gt; Wait until bit 9 in ADDRESS_PRESETCTRL0 is set
write_word(ADDRESS_PRESETCTRLCLR0, (1 &amp;lt;&amp;lt; 9)) # Clear the reset
--&amp;gt; Wait until bit 9 in ADDRESS_PRESETCTRL0 is cleared

# Set EEPROM clock
write_word(ADDRESS_CLKDIV, 3)

# Set the wait states for read and write
write_word(ADDRESS_RWSTATE, 0x00000A0A) 
write_word(ADDRESS_WSTATE, 0x000A0A0A)  

# Write
write_word(ADDRESS_INTSTATCLR, 1 &amp;lt;&amp;lt; 2)  # Clear program operation finished interrupt status
eeprom_address = ADDRESS_EEPROM_BASE
write_word(eeprom_address, b"\x01")
write_word(ADDRESS_CMD, 0x00000110)  # Trigger an erase/program operation
--&amp;gt; Wait until bit 2 in ADDRESS_INTSTAT is set&lt;/LI-CODE&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, 09 Feb 2022 14:33:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Writing-to-LPC54628-EEPROM-through-J-Link/m-p/1410333#M47850</guid>
      <dc:creator>Leo11</dc:creator>
      <dc:date>2022-02-09T14:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Writing to LPC54628 EEPROM through J-Link</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Writing-to-LPC54628-EEPROM-through-J-Link/m-p/1410851#M47863</link>
      <description>&lt;P&gt;Hello &lt;SPAN class="UserName lia-user-name lia-user-rank-Fresh-Out-Contributor lia-component-message-view-widget-author-username"&gt;&lt;A id="link_12" class="lia-link-navigation lia-page-link lia-user-name-link" style="color: #333f48;" href="https://community.nxp.com/t5/user/viewprofilepage/user-id/196654" target="_self" aria-label="View Profile of Leo11"&gt;&lt;SPAN class=""&gt;Leo11&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;About this question, I think you can ask from Segger, the support team know this well.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.segger.com/" target="_blank"&gt;https://www.segger.com/&lt;/A&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Alice&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 09:07:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Writing-to-LPC54628-EEPROM-through-J-Link/m-p/1410851#M47863</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2022-02-09T09:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: Writing to LPC54628 EEPROM through J-Link</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Writing-to-LPC54628-EEPROM-through-J-Link/m-p/1411065#M47866</link>
      <description>&lt;P&gt;Thanks for your reply!&lt;/P&gt;&lt;P&gt;I don't believe the problem is related to J-Link. It is about configuring the MCU for writing to EEPROM without using the SDK. I have simplified the code sample in my original question to make easier to read.&amp;nbsp;&lt;FONT face="inherit"&gt;&amp;nbsp;My guess is that there is a configuration step I am missing and for that reason my write to the EEPROM address range and triggering a write/erase operation&amp;nbsp;&lt;/FONT&gt;through&lt;FONT face="inherit"&gt;&amp;nbsp;register `&lt;/FONT&gt;&lt;SPAN&gt;0x&lt;/SPAN&gt;&lt;SPAN&gt;40014000&lt;/SPAN&gt;&lt;FONT face="inherit"&gt;` do not result in the data being written to the EEPROM.&amp;nbsp;&lt;/FONT&gt;Can you please confirm whether I am doing the initial configuration correctly?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 14:28:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Writing-to-LPC54628-EEPROM-through-J-Link/m-p/1411065#M47866</guid>
      <dc:creator>Leo11</dc:creator>
      <dc:date>2022-02-09T14:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: Writing to LPC54628 EEPROM through J-Link</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Writing-to-LPC54628-EEPROM-through-J-Link/m-p/1413559#M47905</link>
      <description>&lt;P&gt;Hello Leo,&lt;/P&gt;
&lt;P&gt;Sorry I'm not very understand the J-link command well. If you have question about the using SDK driver write EEPROM, or some detail EEPROM issue , I think I can help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Alice&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 08:52:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Writing-to-LPC54628-EEPROM-through-J-Link/m-p/1413559#M47905</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2022-02-15T08:52:25Z</dc:date>
    </item>
  </channel>
</rss>

