<?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>LPCXpresso IDE中的主题 Re: LPC1769: SPI data problem when debugging</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1769-SPI-data-problem-when-debugging/m-p/592590#M30071</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by lpcxpresso-support on Mon Feb 03 01:53:11 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;C and C++ are both supported development languages in &lt;/SPAN&gt;&lt;A href="http://http://www.lpcware.com/lpcxpresso"&gt;LPCXpresso 6&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The address - 0x1fff0080 - that you are seeing makes it sound like your board is getting stuck in the built in bootloader. I would suspect a floating ISP pin.&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%2Fwww.lpcware.com%2Fcontent%2Ffaq%2Flpcxpresso%2Fdebug-design" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/content/faq/lpcxpresso/debug-design&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPCXpresso Support.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 22:54:14 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T22:54:14Z</dc:date>
    <item>
      <title>LPC1769: SPI data problem when debugging</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1769-SPI-data-problem-when-debugging/m-p/592588#M30069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Devenda on Fri Jan 31 05:49:19 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm having trouble using the Mbed SPI and SD functionality when debugging with the LPCXpresso (LPC1769).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When using the debug function the data comes out shifted.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have measured the output using the bus pirate (because I can't use a scope at this moment) using this code to interface a 23LC1024 RAM chip:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;#include "mbed.h"

//Instruction set
#define READ 0x03
#define WRITE 0x02
#define EDIO 0x3B
#define EQIO 0x38
#define RSTIO 0xFF
#define RDMR 0x05
#define WRMR 0x01

SPI serialMemory(P0_18, P0_17, P0_15); // mosi(J6-11), miso(J6-12), scl(J6-13)
DigitalOut CS(P0_16);//CS(J6-14)
DigitalOut Vcc(P0_23);//extra Vout (J6-15)

//setup
void SPIMEM_setup()
{
serialMemory.format(8, 0); //the memory module works in SPI mode 0: POL = 0 and PHA = 0
serialMemory.frequency(125000);

//Setup sequential mode: MODE REG = 0100 0000
CS.write(0);
//serialMemory.write(WRMR);
//serialMemory.write(0x40);
CS.write(1);
}

//single read from address(max 0x1FFFF)
int SPIMEM_readDataFromAddress(uint32_t address)
{
uint8_t receivedData;

CS.write(0);
serialMemory.write(READ);
serialMemory.write((uint8_t) (address &amp;gt;&amp;gt; 16) &amp;amp; 0xFF);
serialMemory.write((uint8_t) (address &amp;gt;&amp;gt; 8) &amp;amp; 0xFF);
serialMemory.write((uint8_t) (address) &amp;amp; 0xFF);
receivedData = serialMemory.write(0x00);
CS.write(1);

return receivedData;
}

//single write to address(max 0x1FFFF)
void SPIMEM_writeDataToAddress(uint32_t address, uint8_t data)
{
CS.write(0);
serialMemory.write(WRITE);
serialMemory.write((uint8_t) (address &amp;gt;&amp;gt; 16) &amp;amp; 0xFF);
serialMemory.write((uint8_t) (address &amp;gt;&amp;gt; 8) &amp;amp; 0xFF);
serialMemory.write((uint8_t) (address) &amp;amp; 0xFF);
serialMemory.write(data);
CS.write(1);
}

int main()
{
uint32_t i = 0;
uint32_t address = 0x1AAAA;
uint8_t data = 0xBB;
//Vcc.write(1);

SPIMEM_setup();

for (i = 0; i &amp;lt; 200; i++)
{
//CS.write(0);
//serialMemory.write(WRITE);
//serialMemory.write(0xAA);
//CS.write(1);
SPIMEM_writeDataToAddress(i, data);
SPIMEM_readDataFromAddress(i);
}
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The strange thing is that after resetting (un-plugging en plugging the LPCXpresso back in) the code functions correctly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, before this I also tested the SD functionality. This code doesn't run either when debugging but works perfectly when resetting the device! &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Besides that I keep getting this error when starting a debug session: &lt;/SPAN&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;No source available for "0x1fff0080"&lt;/SPAN&gt;&lt;HR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:54:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1769-SPI-data-problem-when-debugging/m-p/592588#M30069</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1769: SPI data problem when debugging</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1769-SPI-data-problem-when-debugging/m-p/592589#M30070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Devenda on Sun Feb 02 12:35:17 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I have not yet found a solution to this problem, but I understand that C++ isn't official supported. So to avoid further problems I stepped away from the LCPXpresso IDE and started using the Mbed online compiler, which functions perfectly.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:54:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1769-SPI-data-problem-when-debugging/m-p/592589#M30070</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1769: SPI data problem when debugging</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1769-SPI-data-problem-when-debugging/m-p/592590#M30071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by lpcxpresso-support on Mon Feb 03 01:53:11 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;C and C++ are both supported development languages in &lt;/SPAN&gt;&lt;A href="http://http://www.lpcware.com/lpcxpresso"&gt;LPCXpresso 6&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The address - 0x1fff0080 - that you are seeing makes it sound like your board is getting stuck in the built in bootloader. I would suspect a floating ISP pin.&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%2Fwww.lpcware.com%2Fcontent%2Ffaq%2Flpcxpresso%2Fdebug-design" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/content/faq/lpcxpresso/debug-design&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPCXpresso Support.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:54:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1769-SPI-data-problem-when-debugging/m-p/592590#M30071</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1769: SPI data problem when debugging</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1769-SPI-data-problem-when-debugging/m-p/592591#M30072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Devenda on Mon Feb 03 02:58:53 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for letting me know, I'm still using LPCXpresso 5, so this might be why its not functioning properly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll look into it!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:54:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1769-SPI-data-problem-when-debugging/m-p/592591#M30072</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:54:14Z</dc:date>
    </item>
  </channel>
</rss>

