<?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>topic Re: Flash frustrations in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585448#M21272</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Content originally posted in LPCWare by JohnR on Fri Jun 08 05:31:02 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Shareef,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm glad it worked for you. In your own program, in the memory details box, is the flash memory definition the first item in the drop-down list?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is the file for the M4/M0 project. This is again a slight modification from the very useful project supplied by Code Red, together with a lot of help from them. The modifications were mainly adding the Diolan code for the switches and LEDs as well as the message passing between M4 and M0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You should only need to compile the M4 side - the project was set up by Code Red to automatically compile the M0 code and include the .s file in the M4 executable.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Once the code has been flashed, the program should start by turning (M4) on the red LED, D1, for a short while. Then after a second or so, the LED D6 should light (M0). Then pressing S4 should toggle D6 on and off.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;John.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 19:12:47 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T19:12:47Z</dc:date>
    <item>
      <title>Flash frustrations</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585419#M21243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by JohnR on Tue Apr 24 06:05:44 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am getting thoroughly fed up with trying to flash the memory on my Diolan board using LPC-Link.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I seem to be able to flash reliably if the start address is the start of flash memory. But I want to be able to store the M3 axf file as well as the M0 file to flash. So if put the M3 at the start having partitioned the memory to be split in two, the M3 code works fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But then if I want to use a different start address for M0 at 0x1c100000, LENGTH = 0x100000, I almost always get the error message&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ec: Flash driver command failure 100003F0, 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Occasionally it has seemed to work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have searched for a list of definitions of the flash driver error codes - is such a list available?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance for any help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;JohnR&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:12:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585419#M21243</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Flash frustrations</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585420#M21244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by PhilYoung on Tue Apr 24 07:24:11 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;sounds a bit suspicious as the address is not in the image you are trying to program for the M0 image.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I suspect that what it's trying to do is insert the CRC required by the boot loader, this is created by the linker and inserted automatically.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the error would then be because it couldn't program the CRC as that area has not been erased.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this is the only explanation I can think of, that the CRC is not being inserted at the correct address for the M0 image.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Phil.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:12:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585420#M21244</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: Flash frustrations</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585421#M21245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by JohnR on Tue Apr 24 08:55:58 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks so much for the reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What is meaning of the line Ec: Flash driver command failure 100003F0, 2 ??&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If this is an address, we shouldn't be near there as we are starting at 1c100000? The program is only 1440 bytes long.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The strange thing that it has seemed to load and run OK sometimes but I can never reproduce the success on command.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll try anything at this stage so any more ideas are welcome.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;JohnR&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:12:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585421#M21245</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: Flash frustrations</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585422#M21246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by PhilYoung on Tue Apr 24 11:31:29 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; I assume you noticed that after power up not all EMC address lines are enabled by theboot loader, so you have to enable the additional address lines to the flash in order to be able to access more than 64K bytes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am successfully running code on the M0 at 0x1c040000, to do this I actually build the image so that is both the load and execution address for the startup code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;On the M4 I then set the shadow address for the M0 to be 0x1c040000 so the M0 fetches the stack pointer and PC from 0x00000000,0x00000004 then immediately starts executing code from the flash rather than the shadow area.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this ensures that the CRC etc are correctly located by the programmer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I then set the execution address for the main app to be in internal ram and let the boot loader relocate it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I presume that you are using the M4 to program the image, since the M0 may not be enabled.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also modified the progammer code to use a different flash device and added code to the startup to set up the EMC address lines correctly, I don't know what programmer you are using but it's possible that it doesn't do this in which case you need to use a script.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the effect of this is if the device has been reset before you program it the EMC address lines may not be enabled which would explain why programming may be intermittent.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this is the code I use for setting up the EMC which should be placed in the .ini file &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FUNC void emc_setup (void) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4005006c, 0x01000800); // base m4 clk to IRC&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4008609C, 0x000000f3);&amp;nbsp; /* P1_7: D0 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x400860A0, 0x000000f3);&amp;nbsp; /* P1_8: D1 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x400860A4, 0x000000f3);&amp;nbsp; /* P1_9: D2 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x400860A8, 0x000000f3);&amp;nbsp; /* P1_10: D3 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x400860AC, 0x000000f3);&amp;nbsp; /* P1_11: D4 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x400860B0, 0x000000f3);&amp;nbsp; /* P1_12: D5 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x400860B4, 0x000000f3);&amp;nbsp; /* P1_13: D6 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x400860B8, 0x000000f3);&amp;nbsp; /* P1_14: D7 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086280, 0x000000f2);&amp;nbsp; /* P5_0: D12 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086284, 0x000000f2);&amp;nbsp; /* P5_1: D13 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086288, 0x000000f2);&amp;nbsp; /* P5_2: D14 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4008628C, 0x000000f2);&amp;nbsp; /* P5_3: D15 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086290, 0x000000f2);&amp;nbsp; /* P5_4: D8 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086294, 0x000000f2);&amp;nbsp; /* P5_5: D9 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086298, 0x000000f2);&amp;nbsp; /* P5_6: D10 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4008629C, 0x000000f2);&amp;nbsp; /* P5_7: D11 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086688, 0x000000f2);&amp;nbsp; /* PD_2: D16 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4008668C, 0x000000f2);&amp;nbsp; /* PD_3: D17 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086690, 0x000000f2);&amp;nbsp; /* PD_4: D18 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086694, 0x000000f2);&amp;nbsp; /* PD_5: D19 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086698, 0x000000f2);&amp;nbsp; /* PD_6: D20 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4008669C, 0x000000f2);&amp;nbsp; /* PD_7: D21 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x400866A0, 0x000000f2);&amp;nbsp; /* PD_8: D22 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x400866A4, 0x000000f2);&amp;nbsp; /* PD_9: D23 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086714, 0x000000f3);&amp;nbsp; /* PE_5: D24 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086718, 0x000000f3);&amp;nbsp; /* PE_6: D25 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4008671C, 0x000000f3);&amp;nbsp; /* PE_7: D26 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086720, 0x000000f3);&amp;nbsp; /* PE_8: D27 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086724, 0x000000f3);&amp;nbsp; /* PE_9: D28 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086728, 0x000000f3);&amp;nbsp; /* PE_10: D29 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4008672C, 0x000000f3);&amp;nbsp; /* PE_11: D30 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086730, 0x000000f3);&amp;nbsp; /* PE_12: D31 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086124, 0x000000f3);&amp;nbsp; /* P2_9: A0 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086128, 0x000000f3);&amp;nbsp; /* P2_10: A1 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4008612C, 0x000000f3);&amp;nbsp; /* P2_11: A2 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086130, 0x000000f3);&amp;nbsp; /* P2_12: A3 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086134, 0x000000f3);&amp;nbsp; /* P2_13: A4 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086080, 0x000000f2);&amp;nbsp; /* P1_0: A5 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086084, 0x000000f2);&amp;nbsp; /* P1_1: A6 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086088, 0x000000f2);&amp;nbsp; /* P1_2: A7 (function 2) */&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086120, 0x000000f3);&amp;nbsp; /* P2_8: A8 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4008611C, 0x000000f3);&amp;nbsp; /* P2_7: A9 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086118, 0x000000f2);&amp;nbsp; /* P2_6: A10 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086108, 0x000000f2);&amp;nbsp; /* P2_2: A11 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086104, 0x000000f2);&amp;nbsp; /* P2_1: A12 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086100, 0x000000f2);&amp;nbsp; /* P2_0: A13 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086320, 0x000000f1);&amp;nbsp; /* P6_8: A14 (function 1) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4008631C, 0x000000f1);&amp;nbsp; /* P6_7: A15 (function 1) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x400866C0, 0x000000f2);&amp;nbsp; /* PD_16: A16 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x400866BC, 0x000000f2);&amp;nbsp; /* PD_15: A17 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086700, 0x000000f3);&amp;nbsp; /* PE_0: A18 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086704, 0x000000f3);&amp;nbsp; /* PE_1: A19 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086708, 0x000000f3);&amp;nbsp; /* PE_2: A20 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4008670C, 0x000000f3);&amp;nbsp; /* PE_3: A21 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086710, 0x000000f3);&amp;nbsp; /* PE_4: A22 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086094, 0x000000f3);&amp;nbsp; /* P1_5: CS0 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x400866B0, 0x000000f2);&amp;nbsp; /* PD_12: CS2 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086098, 0x000000f3);&amp;nbsp; /* P1_6: WE (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4008608C, 0x000000f3);&amp;nbsp; /* P1_3: OE (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086090, 0x000000f3);&amp;nbsp; /* P1_4: BLS0 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086318, 0x000000f1);&amp;nbsp; /* P6_6: BLS1 (function 1) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086324, 0x000000f3);&amp;nbsp; /* P6_9: DYCS0, function 3 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086310, 0x000000f3);&amp;nbsp; /* P6_4: CAS, function 3 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086314, 0x000000f3);&amp;nbsp; /* P6_5: RAS, function 3 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4008632C, 0x000000f3);&amp;nbsp; /* P6_11: CKEOUT0, function 3 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086330, 0x000000f3);&amp;nbsp; /* P6_12: DQMOUT0, function 3 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086328, 0x000000f3);&amp;nbsp; /* P6_10: DQMOUT1, function 3 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; /* initialise the EMC */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40005000, 0x00000001);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Enable */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40005200, 0x00000081);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* CS0: 16 bit, WE */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40005208, 0x00000001);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* CS0: WAITOEN = 1 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4000520C, 0x00000006);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* CS0: WAITRD = 6 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40005240, 0x00000081);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* CS2: 16 bit, WE */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40005248, 0x00000001);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* CS2: WAITOEN = 1 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4000524C, 0x00000006);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* CS2: WAITRD = 6 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;_sleep_(100);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;emc_setup();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Phil.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:12:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585422#M21246</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: Flash frustrations</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585423#M21247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by JohnR on Tue Apr 24 17:12:06 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Phil,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks so much for your useful reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You wrote - I presume that you are using the M4 to program the image, since the M0 may not be enabled.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Actually I have M0 and M4 as two separate projects in LPCXpresso, hoping to load them into separate ranges in flash. The code was based on an example from Diolan.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I wrote last I was having problems with the flash loader but now I have got a shorter cable that _seems_ to have cured that problem. I have also used now the lower ranges of the flash.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At the present, the M4 code runs from flash but not the M0 which is mapped into a higher range of the flash. The same M0 code runs in RAM okay but loading this via LPC_Link seems to shut down M4.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It would be nice if there was an LPCXpresso version of a dual M4/M0 project as a starting point.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;John.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:12:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585423#M21247</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Flash frustrations</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585424#M21248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by JohnR on Tue Apr 24 17:25:56 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Phil,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have just reversed the order of M4 and M0 in the flash and now M0, which is now at the lower address,runs but not M4!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How ever does one get both running at the same time?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;John&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:12:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585424#M21248</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Flash frustrations</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585425#M21249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by PhilYoung on Fri Apr 27 01:00:02 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;not sure what you mean by shuts down the M4.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;To program flash you have to avoid anything else reading the flash at the same time, so the other processor needs to be prevented from executin code from or accessing flash.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;by default the M0 is not running until the M4 enables the clock to it, so I always use the M4 for programming.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm successfully running both devices booting from flash, the only thing I needed to do to enable this was enable the additional address lines as they are not all enabled after the boot loader executes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I didn't use the dual boot example code so can't comment on whether it works though.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess if you program them separately as 2 projects you remembered to set the flash programmer to just erase the required sections rather than the whole device!.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Phil.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:12:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585425#M21249</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: Flash frustrations</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585426#M21250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by JohnR on Fri Apr 27 04:53:10 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Phil,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks yet again for the useful comments -&amp;nbsp; maybe you could write "The Definitive Guide to the LPC4300 Arm Cortex M4/M0"?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Re your final remark - I usually erased the whole device before programing the two sections.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;John.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:12:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585426#M21250</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: Flash frustrations</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585427#M21251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by PhilYoung on Fri Apr 27 06:26:58 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; So after programming the 2 sections have you tried using the debugger to view the flash contents?.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How are you connected to the device?, if you are using the Jtag interface do you close the second debugger before programming as this can also cause interference, particularly if periodic refresh is enabled.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:12:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585427#M21251</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: Flash frustrations</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585428#M21252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by JohnR on Fri Apr 27 09:12:22 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Phil,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using the 4-wire SWD over a LPC_Link card connected to the 10-pin JTAG connector on the Diolan card.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The debugger seems to work fine if the flash starting address is 0xC0 but not if I use any other starting address - it seems that it only reads from 0x0. If I run the debugger after loading a program with a non-zero address, it appears to load but if the program is stopped, no C code is displayed and the assembly window shows whatever happens to be in, I think, the equivalent zero-based offset.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;John.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:12:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585428#M21252</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Flash frustrations</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585429#M21253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by PhilYoung on Sat Apr 28 03:50:00 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm getting slightly confused now what you are trying to do.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you load code to flash and then try to execute it with the debugger it will of course try executing from the base of the flash.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The M0 and M4 both load the SP and PC from 0, so each of them has a shadow register which controls what address is actually mapped to 0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to use the debugger to debug an image that is not at the base of flsah then you need to use the debugger command window or a script to first enable the additional address pins, then set the shadow register before letting the CPU Run.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As the CPU will not be issued a reset you then need to manually load SP from 0x0 and PC from 0x4, this will simulate the load that the CPU does at startup following a HW reset.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Instead of this I usually just link the code so that the startup is executed from the flash address, and load SP / PC from the start of the image, that way it doesn't matter about the shadow register.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Phil.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;below is my .ini file for Keil, you would need to make some small changes,i.e. object file name.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You may need to re-code this for your development environment.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FUNC void M4 (void) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; SP = _RDWORD(0x1C000000);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Setup Stack Pointer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; PC = _RDWORD(0x1C000004);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Setup Program Counter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_wdword(0x40043100,0x1c000000);// shadow M4 address&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;} &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FUNC void Jump (void) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; PC = 0x1C000001;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Setup Program Counter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;} &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FUNC void M0 (void) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; SP = _RDWORD(0x1C040000);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Setup Stack Pointer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; PC = _RDWORD(0x1C040004);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Setup Program Counter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_wdword(0x40043404,0x1c040000);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FUNC void emc_setup (void) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4005006c, 0x01000800); // base m4 clk to IRC&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4008609C, 0x000000f3);&amp;nbsp; /* P1_7: D0 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x400860A0, 0x000000f3);&amp;nbsp; /* P1_8: D1 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x400860A4, 0x000000f3);&amp;nbsp; /* P1_9: D2 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x400860A8, 0x000000f3);&amp;nbsp; /* P1_10: D3 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x400860AC, 0x000000f3);&amp;nbsp; /* P1_11: D4 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x400860B0, 0x000000f3);&amp;nbsp; /* P1_12: D5 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x400860B4, 0x000000f3);&amp;nbsp; /* P1_13: D6 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x400860B8, 0x000000f3);&amp;nbsp; /* P1_14: D7 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086280, 0x000000f2);&amp;nbsp; /* P5_0: D12 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086284, 0x000000f2);&amp;nbsp; /* P5_1: D13 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086288, 0x000000f2);&amp;nbsp; /* P5_2: D14 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4008628C, 0x000000f2);&amp;nbsp; /* P5_3: D15 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086290, 0x000000f2);&amp;nbsp; /* P5_4: D8 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086294, 0x000000f2);&amp;nbsp; /* P5_5: D9 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086298, 0x000000f2);&amp;nbsp; /* P5_6: D10 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4008629C, 0x000000f2);&amp;nbsp; /* P5_7: D11 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086688, 0x000000f2);&amp;nbsp; /* PD_2: D16 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4008668C, 0x000000f2);&amp;nbsp; /* PD_3: D17 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086690, 0x000000f2);&amp;nbsp; /* PD_4: D18 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086694, 0x000000f2);&amp;nbsp; /* PD_5: D19 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086698, 0x000000f2);&amp;nbsp; /* PD_6: D20 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4008669C, 0x000000f2);&amp;nbsp; /* PD_7: D21 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x400866A0, 0x000000f2);&amp;nbsp; /* PD_8: D22 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x400866A4, 0x000000f2);&amp;nbsp; /* PD_9: D23 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086714, 0x000000f3);&amp;nbsp; /* PE_5: D24 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086718, 0x000000f3);&amp;nbsp; /* PE_6: D25 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4008671C, 0x000000f3);&amp;nbsp; /* PE_7: D26 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086720, 0x000000f3);&amp;nbsp; /* PE_8: D27 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086724, 0x000000f3);&amp;nbsp; /* PE_9: D28 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086728, 0x000000f3);&amp;nbsp; /* PE_10: D29 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4008672C, 0x000000f3);&amp;nbsp; /* PE_11: D30 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086730, 0x000000f3);&amp;nbsp; /* PE_12: D31 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086124, 0x000000f3);&amp;nbsp; /* P2_9: A0 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086128, 0x000000f3);&amp;nbsp; /* P2_10: A1 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4008612C, 0x000000f3);&amp;nbsp; /* P2_11: A2 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086130, 0x000000f3);&amp;nbsp; /* P2_12: A3 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086134, 0x000000f3);&amp;nbsp; /* P2_13: A4 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086080, 0x000000f2);&amp;nbsp; /* P1_0: A5 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086084, 0x000000f2);&amp;nbsp; /* P1_1: A6 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086088, 0x000000f2);&amp;nbsp; /* P1_2: A7 (function 2) */&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086120, 0x000000f3);&amp;nbsp; /* P2_8: A8 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4008611C, 0x000000f3);&amp;nbsp; /* P2_7: A9 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086118, 0x000000f2);&amp;nbsp; /* P2_6: A10 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086108, 0x000000f2);&amp;nbsp; /* P2_2: A11 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086104, 0x000000f2);&amp;nbsp; /* P2_1: A12 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086100, 0x000000f2);&amp;nbsp; /* P2_0: A13 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086320, 0x000000f1);&amp;nbsp; /* P6_8: A14 (function 1) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4008631C, 0x000000f1);&amp;nbsp; /* P6_7: A15 (function 1) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x400866C0, 0x000000f2);&amp;nbsp; /* PD_16: A16 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x400866BC, 0x000000f2);&amp;nbsp; /* PD_15: A17 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086700, 0x000000f3);&amp;nbsp; /* PE_0: A18 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086704, 0x000000f3);&amp;nbsp; /* PE_1: A19 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086708, 0x000000f3);&amp;nbsp; /* PE_2: A20 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4008670C, 0x000000f3);&amp;nbsp; /* PE_3: A21 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086710, 0x000000f3);&amp;nbsp; /* PE_4: A22 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086094, 0x000000f3);&amp;nbsp; /* P1_5: CS0 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x400866B0, 0x000000f2);&amp;nbsp; /* PD_12: CS2 (function 2) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086098, 0x000000f3);&amp;nbsp; /* P1_6: WE (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4008608C, 0x000000f3);&amp;nbsp; /* P1_3: OE (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086090, 0x000000f3);&amp;nbsp; /* P1_4: BLS0 (function 3) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086318, 0x000000f1);&amp;nbsp; /* P6_6: BLS1 (function 1) */&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086324, 0x000000f3);&amp;nbsp; /* P6_9: DYCS0, function 3 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086310, 0x000000f3);&amp;nbsp; /* P6_4: CAS, function 3 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086314, 0x000000f3);&amp;nbsp; /* P6_5: RAS, function 3 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4008632C, 0x000000f3);&amp;nbsp; /* P6_11: CKEOUT0, function 3 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086330, 0x000000f3);&amp;nbsp; /* P6_12: DQMOUT0, function 3 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40086328, 0x000000f3);&amp;nbsp; /* P6_10: DQMOUT1, function 3 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; /* initialise the EMC */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40005000, 0x00000001);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Enable */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40005200, 0x00000081);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* CS0: 16 bit, WE */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40005208, 0x00000001);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* CS0: WAITOEN = 1 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4000520C, 0x00000006);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* CS0: WAITRD = 6 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40005240, 0x00000081);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* CS2: 16 bit, WE */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x40005248, 0x00000001);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* CS2: WAITOEN = 1 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; _WDWORD(0x4000524C, 0x00000006);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* CS2: WAITRD = 6 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FUNC void BootpSetup (void) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; _wdword(0x40086124,0x40);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; _wdword(0x40086120,0x44);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; _wdword(0x40086088,0x40);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; _wdword(0x40086084,0x40);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; _wdword(0x400f6000,_rdword(0x400f6000) &amp;amp;~ 0x00000300);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; _wdword(0x400f6004,_rdword(0x400f6004) &amp;amp;~ 0x00000400);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; _wdword(0x400f6014,_rdword(0x400f6014) &amp;amp;~ 0x00000080);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FUNC void TestBP (void ) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; _rdword(0x400f5020);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; _rdword(0x400f5024);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; _rdword(0x400f50A8);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; _rdword(0x400f529C);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;_sleep_(100);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;\\M0();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LOAD .\AGR2_M0.axf INCREMENTAL&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:12:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585429#M21253</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Flash frustrations</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585430#M21254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by JohnR on Sat Apr 28 05:21:35 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Phil,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"I'm getting slightly confused now what you are trying to do." - not nearly as much as I am, although what you have sent me so far has been immensely useful.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Right now my target is to get both M0 and M4 working simultaneously on stored programs , initially without communications between them, just flashing LEDS or driving the logic analyser, using Red Suite or LPCXpresso. So far, I have had working M4 in flash, M0 in RAM, but not simultaneously. Then tackle inter-processor communications.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It would be great if NXP, Code Red or one of the LPC4300 board manufacturers could put together a seminar series on designing with these dual-core devices.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks yet again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;John.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:12:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585430#M21254</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: Flash frustrations</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585431#M21255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by PhilYoung on Mon Apr 30 00:02:45 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Perhaps the easiest solution is to make a single image containing both M4 and M0 code and flash it all together.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I wrote my own programmer as the flash on my board is different so I can't guarantee that the programmer supplied is OK.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for this mode first I create the M0 program, then run the following user command.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fromelf --cadcombined --output="..\M4\M0_image\LR0.h" ".\AGR2_M0.axf"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This creates a hex file containing the M0 image.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;next I build the M4 code including a source file with the following code, this just changes the type of the hex file so it doesn't get relocated at startup.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;extern const&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#include "LR0.h"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;then I put the followingg in the M4 linker script&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LR_M0_IMAGE 0x1C040000 0x00020000&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp; ; load region size_region&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; ER_M0 0x1c040000&amp;nbsp; { ; root section for startup code and vector table&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cm0_image.o(+RO +RW +ZI)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; .ANY(LR0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then in the M4 code I conlude the following code to start the M0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;/* take SLAVE processor out of reset */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;void StartM0(void)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;volatile uint32_t u32REG, u32Val;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// Release Slave from reset, first read status &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;u32REG = LPC_RGU-&amp;gt;RESET_ACTIVE_STATUS1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// If the M0 is being held in reset, release it... &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// 1 = no reset, 0 = reset&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;while(!(u32REG &amp;amp; (1u &amp;lt;&amp;lt; 24)))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;u32Val = (~(u32REG) &amp;amp; (~(1 &amp;lt;&amp;lt; 24)));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_RGU-&amp;gt;RESET_CTRL1 = u32Val;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;u32REG = LPC_RGU-&amp;gt;RESET_ACTIVE_STATUS1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/* put the SLAVE processor back in reset */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;void HaltM0(void) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;volatile uint32_t u32REG, u32Val;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// Check if M0 is reset by reading status&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;u32REG = LPC_RGU-&amp;gt;RESET_ACTIVE_STATUS1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// If the M0 has reset not asserted, halt it... &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// in u32REG, status register, 1 = no reset&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;while ((u32REG &amp;amp; (1u &amp;lt;&amp;lt; 24)))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;u32Val = ( (~u32REG) | (1 &amp;lt;&amp;lt; 24));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_RGU-&amp;gt;RESET_CTRL1 = u32Val;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;u32REG = LPC_RGU-&amp;gt;RESET_ACTIVE_STATUS1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;first do&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_CREG-&amp;gt;M0APPMEMMAP = (uint32_t)&amp;amp;LR0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;this sets the shadow address for the M0 &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;then just call StartM0() to get the M0 running.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Both the M0 and M4 start executing code from flash, but both images perform the required relocation of their executable code to RAM independently of each other.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Phil.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:12:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585431#M21255</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: Flash frustrations</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585432#M21256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by nxp21346 on Mon Apr 30 08:40:12 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;This definitely sounds like the best idea to me. There are two cores, but it usually makes more sense to merge the images together and download or program them at the same time. We often do this by converting the M0 image into a .c file (binary array) and compiling it into the M4 project.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-NXP&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:12:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585432#M21256</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: Flash frustrations</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585433#M21257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by PhilYoung on Wed May 02 04:08:36 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Since I just got a new board and experienced a similar problem this might also apply to you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The flash programmer was not setting up ALL of the address pins on the EMC, which was not a problem initially, but on the new board there are additional address pins which if not configured by default are pulled high.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Flash programming succeeds, but the actual data is written to the wrong flash location, however it's also read back from that location and flash verfies ok.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When the program starts it configures ALL address lines, but as soon as it configures an address line that was not configured in the programmer that line goes low and the program crashes, of course in by case the image I assumed was at 0x1c000000 was really at 0x1c400000.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;so check the programmer to ensure that ALL address bits are configured.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The boot loader will set these low when booting from flash, but if you use the debugger to start the code then you MUST set them to the correct mode with a script.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:12:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585433#M21257</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: Flash frustrations</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585434#M21258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by JohnR on Sat May 05 15:34:19 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Phil and others,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With a lot of support and code from CodeRed I now have succeeded in running a simple project on my Diolan board that uses both M4 and M0. At the present M4 simply toggles a port that feeds a logic analyser and sends a message to M0 to toggle another port. Simple but it took a while to get there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Getting Code Red's Red Suite 4 compiler and their Red Probe+ also helped a lot. LPC_Link and LPCXpresso worked but downloading was slow as the system looks first for Red Probe and only after a while accepts LPC_Link.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;JohnR.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:12:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585434#M21258</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: Flash frustrations</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585435#M21259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by sjalloq on Sat Jun 02 12:31:05 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;A loaded question for you - when and where are you going to put up the details of this example so others can follow?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hopefully I haven't just missed it on the forum.&amp;nbsp; :-)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:12:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585435#M21259</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Flash frustrations</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585436#M21260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by JohnR on Sun Jun 03 05:16:57 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;CodeRed have just released an example of using both M4 and M0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fsupport.code-red-tech.com%2FCodeRedWiki%2FLPC43DualCoreProjects" rel="nofollow" target="_blank"&gt;http://support.code-red-tech.com/CodeRedWiki/LPC43DualCoreProjects&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;They were exceptionally patient in helping me get going.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The example they sent me was for the Hitex board so I modified it to work with the Diolan board, mixing in some of the Diolan example code, using their message passing scheme to turn on/off one of the LEDs using one of the buttons.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you would still like the code, I will check with CodeRed to see if they mind, though I don't see why they would.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;John.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:12:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585436#M21260</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Flash frustrations</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585437#M21261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by sjalloq on Sun Jun 03 06:22:35 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks, that would be really useful if you could either post the code or detail the modifications needed.&amp;nbsp; I have already seen their example but it doesn't work out of the box on the Diolan board so I started looking at the flash code...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...which has opened another can of worms.&amp;nbsp; Code Red state on their website that they have customers using the SST39VF3201B flash driver bundled with the IDE but this can't be correct as the Spansion and Microchip parts have different commands.&amp;nbsp; Did you find that you had to modify the flash driver?&amp;nbsp; I'm just going through that now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, Shareef.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:12:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585437#M21261</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: Flash frustrations</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585438#M21262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by JohnR on Sun Jun 03 10:45:17 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Shareef,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I will write today to CodeRed about posting the M4/M0 project.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At the moment I use the RedSuite compiler and Red Probe for downloading. Earlier I used LPCXpresso and the LPC_Link module for downloading code. I had a lot of problems at that time trying to get the Diolan dual M4/M0 examples working on LPCXpresso but with CodeRed's help all is well mow.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I assume you mean Micron not Microchip. I haven't checked the Spansion datasheet but the Micron device seems to behave properly on the Diolan board.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;JOhn.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:12:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Flash-frustrations/m-p/585438#M21262</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:12:41Z</dc:date>
    </item>
  </channel>
</rss>

