<?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: Ignored CAN messages</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Ignored-CAN-messages/m-p/532013#M10338</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Harrie on Tue Dec 15 09:47:37 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hey, thank you for your input.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I found a temporary workaround by adding the command __WFI(); to the while in the main function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;However the __WFI(); command is causing a sleep mode if there is no CAN RX message.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Therefore this solution is not favorable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone have a clue why this helps?&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:32:14 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T19:32:14Z</dc:date>
    <item>
      <title>Ignored CAN messages</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Ignored-CAN-messages/m-p/532008#M10333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Harrie on Tue Dec 08 09:05:54 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For a project we initialize multiple message objects, each object is set to only receive messages from one particular id.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem we are facing is that after a certain period those messages are ignored.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This problem only seems to occur when we periodically transmit CAN-messages from the LPC11CXX.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a solution to fix this problem?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Harrie&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:32:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Ignored-CAN-messages/m-p/532008#M10333</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: Ignored CAN messages</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Ignored-CAN-messages/m-p/532009#M10334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by 3CPO on Fri Dec 11 10:14:02 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;I have same issue. There is a post at &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fwww.lpcware.com%2Fcontent%2Fforum%2Fon-chip-can-tranceiver" rel="nofollow" target="_blank"&gt;https://www.lpcware.com/content/forum/on-chip-can-tranceiver&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;CAN somebody help us?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:32:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Ignored-CAN-messages/m-p/532009#M10334</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Ignored CAN messages</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Ignored-CAN-messages/m-p/532010#M10335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by LabRat on Sat Dec 12 02:38:32 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: 3CPO&lt;/STRONG&gt;&lt;BR /&gt;CAN somebody help us?&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Obviously not&amp;nbsp; :(( &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Without code (=project) and detailed description (hardware) chances are low...&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:32:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Ignored-CAN-messages/m-p/532010#M10335</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: Ignored CAN messages</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Ignored-CAN-messages/m-p/532011#M10336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Harrie on Mon Dec 14 07:49:34 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your input.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I managed to strip down the code, I hope this makes locating the problem easier.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error occurs after approximately 15 to 20 minutes. (i.e. the content of data_0 and data_1 isn't updated)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Below are the project properties, to reserve RAM for the can message buffer and can API.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;C/C++ Build &amp;gt; MCU settings&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Memory details (LPC11C22/301)*&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;TypeNameAliasLocationSize&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FlashMFlash16Flash0x00x4000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RAMRamLoc8RAM0x100000c00x1f20&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;C/C++ Build &amp;gt; Settings&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCU Linker &amp;gt; Managed Linker Script &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Manage linker scriptEnabled&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Enable Code Read ProtectDisabled&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Link application to RAMDisabled&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Stack offset32&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LibraryRedlib (none)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Looking forwards to the solution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Harrie&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:32:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Ignored-CAN-messages/m-p/532011#M10336</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: Ignored CAN messages</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Ignored-CAN-messages/m-p/532012#M10337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by 3CPO on Tue Dec 15 02:43:22 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Harrie,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I checked your code and I sow that you use the CMSIS library (version 2p00).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could that be the issue? May be there is a bug in 2p00 version of the CMSIS&amp;nbsp; LIB with related with CAN?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anybody know if the latest CMSIS LIB version is 2p00? &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:32:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Ignored-CAN-messages/m-p/532012#M10337</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Ignored CAN messages</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Ignored-CAN-messages/m-p/532013#M10338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Harrie on Tue Dec 15 09:47:37 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hey, thank you for your input.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I found a temporary workaround by adding the command __WFI(); to the while in the main function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;However the __WFI(); command is causing a sleep mode if there is no CAN RX message.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Therefore this solution is not favorable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone have a clue why this helps?&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:32:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Ignored-CAN-messages/m-p/532013#M10338</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Ignored CAN messages</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Ignored-CAN-messages/m-p/532014#M10339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Harrie on Wed Dec 30 09:16:23 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is yet another workaround which seems to work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This has been achieved by defining two separate CCAN_MSG_OBJ structures for receive and transmit (see below).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here the msg_obj_rx is used in the CAN_rx() function and in the CAN_Init() function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Whereas the msg_obj_tx is used in the main() function to transmit CAN messages.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would please like to hear if this is a correct solution, or if there are also other ways to solve this issue.&lt;/SPAN&gt;&lt;BR /&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;
can.c

#include "lpc_types.h"
#include "can.h"

CCAN_MSG_OBJ_T msg_obj_rx;
CCAN_MSG_OBJ_T msg_obj_tx;
uint8_t data_0;
uint8_t data_1;

/*CAN receive callback */
/*Function is executed by the Callback handler after a CAN message has been received */
void CAN_rx(uint8_t msg_obj_num) {
msg_obj_rx.msgobj = msg_obj_num;// Determine which CAN message has been received
LPC_CCAN_API-&amp;gt;can_receive(&amp;amp;msg_obj_rx);// Now load up the msg_obj structure with the CAN message

data_0 = msg_obj_rx.data[0];
data_1 = msg_obj_rx.data[1];
LPC_GPIO3-&amp;gt;DATA ^= (1 &amp;lt;&amp;lt; 0);// Switch LED
}

/*****************************************************************************
 ** Function name:CAN_Init for initializing the CANbus
 *****************************************************************************/
void CAN_Init(uint32_t CAN_baudrate) {

uint32_t initTable[2];
initTable[0] = 0x05; // 48 Mhz/(5+1) -&amp;gt; 8 MHz
initTable[1] = CAN_baudrate; // configure bit rate to 250k

LPC_CCAN_API-&amp;gt;init_can(&amp;amp;initTable[0], 1); // Initialize the CAN controller

/* Publish CAN Callback Functions */
CCAN_CALLBACKS_T callbacks = { CAN_rx,CAN_tx, CAN_error, NULL, NULL, NULL, NULL, NULL };

LPC_CCAN_API-&amp;gt;config_calb(&amp;amp;callbacks);// Configure the CAN callback functions

/* Enable the CAN Interrupt */
NVIC_EnableIRQ(CAN_IRQn);

/*&amp;nbsp; Configure message object 1 to receive only common messages from 0x0FA‬ */
msg_obj_rx.msgobj =0x01;
msg_obj_rx.id =0xFA;
msg_obj_rx.mask =0x1FFFFFFF;
LPC_CCAN_API-&amp;gt;config_rxmsgobj(&amp;amp;msg_obj_rx);
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&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;
int main(void) {

...
while (1) {

if (LPC_TMR32B0-&amp;gt;IR &amp;amp; (1 &amp;lt;&amp;lt; 0)) {// check interrupt 0

msg_obj_tx.msgobj= 28;
msg_obj_tx.id= 0x7CC;
msg_obj_tx.dlc= 2;
msg_obj_tx.data[0]= data_0;
msg_obj_tx.data[1]= data_1;
LPC_CCAN_API-&amp;gt;can_transmit(&amp;amp;msg_obj_tx);

LPC_TMR32B0-&amp;gt;IR |= (1 &amp;lt;&amp;lt; 0);// clear interrupt 0
}
...

&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:32:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Ignored-CAN-messages/m-p/532014#M10339</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:32:15Z</dc:date>
    </item>
  </channel>
</rss>

