<?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: Problems with On-Chip CAN-Driver</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/Problems-with-On-Chip-CAN-Driver/m-p/596830#M31979</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by yanvasilij on Tue Feb 28 02:24:02 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Problem solved! I declared array uint8_t id_table[255]. When I exchaged it to id_table[50] it had started working. Also I increased protected RAM area to 0x10000000-0x10000250. Does it normal? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another one question: My CANopen master gets messagse from many nodes. That why I have to use several message objects for reciving. When CANrx interrupt occurs I use the following rotine:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
os_evt_wait_or (EVT_CAN_int, 0xFFFF);//It is RTX rotine. It wait until CANrx interrupt is not happen
mob_amount = msg_obj.msgobj;
for(mob_num = 0; mob_num &amp;lt;= mob_amount; mob_num++)//read and process all used messages objects 
{
NVIC_DisableIRQ(CAN_IRQn);
msg_obj.msgobj = mob_num;
(*rom)-&amp;gt;pCAND-&amp;gt;can_receive(&amp;amp;msg_obj);//read mob_num message object
id = msg_obj.mode_id;
len = msg_obj.dlc;
for(i = 0; i&amp;lt;8; i++) data&lt;I&gt; = msg_obj.data&lt;I&gt;;
NVIC_EnableIRQ(CAN_IRQn);

//process data from this message object
...
...
//------------------------------------

}
&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;But not all messages processed. What is wrong?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 21:37:37 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T21:37:37Z</dc:date>
    <item>
      <title>Problems with On-Chip CAN-Driver</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Problems-with-On-Chip-CAN-Driver/m-p/596826#M31975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by luky on Tue Sep 20 07:44:11 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I try to use the LPC11C24 with the On-board CAN-Driver.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The Bus is running with 125kbps (&amp;lt;10 Messages per sec.) and another LPc is sending testmessages with the ID 100. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The applications is working fine - except that the Interrupt seems to be aktive the whole time and I can't do anything else with the chip.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My code:&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;
(*rom)-&amp;gt;pCAND-&amp;gt;init_can(&amp;amp;ClkInitTable[0], 1);&amp;nbsp;&amp;nbsp;&amp;nbsp; //Initialize the CAN controller
(*rom)-&amp;gt;pCAND-&amp;gt;config_calb(&amp;amp;callbacks); //Configure the CAN callback functions
NVIC_EnableIRQ(CAN_IRQn);&amp;nbsp;&amp;nbsp;&amp;nbsp; //Enable the CAN Interrupt
msg_obj.msgobj = 1;
msg_obj.mode_id = 100;
msg_obj.mask = 0x7FF;//100;//; //1= Bit wird verwendet
(*rom)-&amp;gt;pCAND-&amp;gt;config_rxmsgobj(&amp;amp;msg_obj);

...



void CAN_tx(uint8_t msg_obj_num){
&amp;nbsp; return;
}

void CAN_rx(uint8_t msg_obj_num){
&amp;nbsp; 
&amp;nbsp; /* Determine which CAN message has been received */
&amp;nbsp; msg_obj.msgobj = msg_obj_num;

&amp;nbsp; /* Now load up the msg_obj structure with the CAN message */
&amp;nbsp; (*rom)-&amp;gt;pCAND-&amp;gt;can_receive(&amp;amp;msg_obj);

&amp;nbsp; printf("REC: Nr.%u: %s", msg_obj_num, msg_obj.data); //Date OK!
 
&amp;nbsp; if (msg_obj_num == 1)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; //Simply transmit CAN frame (echo) with ID via buffer 2
&amp;nbsp;&amp;nbsp;&amp;nbsp; msg_obj.msgobj = 2;
&amp;nbsp;&amp;nbsp;&amp;nbsp; msg_obj.mode_id = 100;
&amp;nbsp;&amp;nbsp;&amp;nbsp; (*rom)-&amp;gt;pCAND-&amp;gt;can_transmit(&amp;amp;msg_obj);
&amp;nbsp; }
}

void CAN_IRQHandler(void)
{
LEDON();

&amp;nbsp;&amp;nbsp; (*rom)-&amp;gt;pCAND-&amp;gt;isr(); //call the isr() API located in the ROM

LEDOF();
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;The LED stays on the whole time and the other code isn't executing (I checked with a Scope)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What ist wrong with my Code?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:37:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Problems-with-On-Chip-CAN-Driver/m-p/596826#M31975</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with On-Chip CAN-Driver</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Problems-with-On-Chip-CAN-Driver/m-p/596827#M31976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Tue Sep 20 08:13:19 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;#1 Is this a 100% copy of canopen sample? If not, what did you do to reserve CAN RAM :confused:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#2 What's this printf doing there? Is this a semihosting project :eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#3 Please post complete files and projects :)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:37:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Problems-with-On-Chip-CAN-Driver/m-p/596827#M31976</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with On-Chip CAN-Driver</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Problems-with-On-Chip-CAN-Driver/m-p/596828#M31977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by luky on Tue Sep 20 09:28:26 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;The Code is from the can_onchip sample, I don't use Canopen.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;printf is retargeted to the USART (for debugging purposes)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The Application works fine until I initialize the CAN-Driver.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:37:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Problems-with-On-Chip-CAN-Driver/m-p/596828#M31977</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with On-Chip CAN-Driver</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Problems-with-On-Chip-CAN-Driver/m-p/596829#M31978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by yanvasilij on Tue Feb 21 22:44:10 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello! I built a project in keil for lpc11c24. Source code is bellow. Program always stop on (*rom)-&amp;gt;pCAND-&amp;gt;init_can(&amp;amp;ClkInitTable[0], 1). I completely don't know what's wrong:mad:: I protected memory for ROM api functions (lived ample reserv: 0x10000000-0x10000180), checked CAN_on-chip initialization (it works with another program), checked clock initialization (CPU freq = 48 MHz, scoped on PIO0_1 - 4,8 MHz). Could somebody advise to me something?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:37:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Problems-with-On-Chip-CAN-Driver/m-p/596829#M31978</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with On-Chip CAN-Driver</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Problems-with-On-Chip-CAN-Driver/m-p/596830#M31979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by yanvasilij on Tue Feb 28 02:24:02 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Problem solved! I declared array uint8_t id_table[255]. When I exchaged it to id_table[50] it had started working. Also I increased protected RAM area to 0x10000000-0x10000250. Does it normal? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another one question: My CANopen master gets messagse from many nodes. That why I have to use several message objects for reciving. When CANrx interrupt occurs I use the following rotine:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
os_evt_wait_or (EVT_CAN_int, 0xFFFF);//It is RTX rotine. It wait until CANrx interrupt is not happen
mob_amount = msg_obj.msgobj;
for(mob_num = 0; mob_num &amp;lt;= mob_amount; mob_num++)//read and process all used messages objects 
{
NVIC_DisableIRQ(CAN_IRQn);
msg_obj.msgobj = mob_num;
(*rom)-&amp;gt;pCAND-&amp;gt;can_receive(&amp;amp;msg_obj);//read mob_num message object
id = msg_obj.mode_id;
len = msg_obj.dlc;
for(i = 0; i&amp;lt;8; i++) data&lt;I&gt; = msg_obj.data&lt;I&gt;;
NVIC_EnableIRQ(CAN_IRQn);

//process data from this message object
...
...
//------------------------------------

}
&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;But not all messages processed. What is wrong?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:37:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Problems-with-On-Chip-CAN-Driver/m-p/596830#M31979</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with On-Chip CAN-Driver</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Problems-with-On-Chip-CAN-Driver/m-p/596831#M31980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Tue Feb 28 03:05:44 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: yanvasilij&lt;/STRONG&gt;&lt;BR /&gt;Also I increased protected RAM area to 0x10000000-0x10000250. Does it normal? &lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No, normal is still RAM area mentioned in user manual:&lt;/SPAN&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;On-chip RAM from address [COLOR=Red]0x1000 0050 to 0x1000 00B8[/COLOR] is used by the CAN API. This address range should not be used by the application.&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:37:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Problems-with-On-Chip-CAN-Driver/m-p/596831#M31980</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with On-Chip CAN-Driver</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Problems-with-On-Chip-CAN-Driver/m-p/596832#M31981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by yanvasilij on Tue Feb 28 03:11:37 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Zero&lt;/STRONG&gt;&lt;BR /&gt;No, normal is still RAM area mentioned in user manual:&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But It doesn't work without it&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:37:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Problems-with-On-Chip-CAN-Driver/m-p/596832#M31981</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:37:38Z</dc:date>
    </item>
  </channel>
</rss>

